From 4ad39a5c96dd99acf819ce189b13fec946d7506b Mon Sep 17 00:00:00 2001 From: talasila Date: Tue, 7 Feb 2017 15:03:57 -0500 Subject: [PATCH] Initial OpenECOMP Portal commit Change-Id: I804b80e0830c092e307da1599bd9fbb5c3e2da77 Signed-off-by: talasila --- .gitreview | 4 + .idea/misc.xml | 19 + .idea/modules.xml | 8 + .idea/portal.iml | 9 + .idea/vcs.xml | 6 + .idea/workspace.xml | 215 + LICENSE.txt | 19 + ecomp-portal-BE/.gitignore | 6 + ecomp-portal-BE/README.md | 7 + ecomp-portal-BE/distribution.xml | 26 + .../sql scripts/Apps_Users_OnBoarding_Script.sql | 320 + .../EcompPortalDDLMySql_1610_Complete_OS.sql | 1499 + .../EcompPortalDMLMySql_1610_Complete_OS.sql | 225 + ecomp-portal-BE/pom.xml | 612 + ecomp-portal-BE/resources/META-INF/MANIFEST.MF | 2 + .../portalapp/authentication/LoginStrategy.java | 27 + .../authentication/OpenIdConnectLoginStrategy.java | 91 + .../authentication/SimpleLoginStrategy.java | 101 + .../openecomp/portalapp/command/EPLoginBean.java | 186 + .../portalapp/command/PostSearchBean.java | 373 + .../portalapp/conf/ExternalAppConfig.java | 311 + .../portalapp/conf/ExternalAppInitializer.java | 60 + .../portalapp/conf/HibernateMappingLocations.java | 38 + .../controller/ECOMPLogoutController.java | 112 + .../controller/EPFusionBaseController.java | 106 + .../controller/EPRestrictedBaseController.java | 52 + .../EPRestrictedRESTfulBaseController.java | 54 + .../controller/EPUnRestrictedBaseController.java | 42 + .../portalapp/controller/LoginController.java | 356 + .../portalapp/controller/LoginService.java | 36 + .../controller/OpenCollaborationController.java | 48 + .../portalapp/controller/PeerBroadcastSocket.java | 106 + .../controller/UserProfileController.java | 77 + .../portalapp/controller/WelcomeController.java | 89 + .../sessionmgt/SessionCommunicationController.java | 64 + .../kpidash/controller/KpiDashboardController.java | 268 + .../portalapp/kpidash/model/KpiApiStats.java | 74 + .../kpidash/model/KpiServiceSupported.java | 60 + .../portalapp/kpidash/model/KpiUserStoryStats.java | 107 + .../portalapp/kpidash/model/KpidashProperties.java | 33 + .../kpidash/service/KpiDashboardService.java | 56 + .../kpidash/service/KpiDashboardServiceImpl.java | 180 + .../java/org/openecomp/portalapp/model/Result.java | 37 + .../portal/controller/AppCatalogController.java | 124 + .../portal/controller/AppContactUsController.java | 224 + .../portal/controller/AppsController.java | 470 + .../portal/controller/DashboardController.java | 361 + .../DashboardSearchResultController.java | 243 + .../controller/ExternalAppsRestfulController.java | 128 + .../controller/FunctionalMenuController.java | 436 + .../portal/controller/GetAccessController.java | 70 + .../portal/controller/HealthCheckController.java | 234 + .../portal/controller/ManifestController.java | 93 + .../portal/controller/PortalAdminController.java | 117 + .../controller/SharedContextRestController.java | 335 + .../portal/controller/UserRolesController.java | 336 + .../portal/controller/WidgetsController.java | 134 + .../portalapp/portal/domain/AdminUserApp.java | 88 + .../portal/domain/AdminUserApplications.java | 96 + .../portalapp/portal/domain/AppContactUs.java | 86 + .../portal/domain/AppContactUsTransportModel.java | 84 + .../portal/domain/AppIdAndNameTransportModel.java | 63 + .../portalapp/portal/domain/AppsResponse.java | 76 + .../openecomp/portalapp/portal/domain/EPApp.java | 319 + .../openecomp/portalapp/portal/domain/EPRole.java | 204 + .../openecomp/portalapp/portal/domain/EPUser.java | 602 + .../portalapp/portal/domain/EPUserApp.java | 119 + .../portalapp/portal/domain/EcompApp.java | 143 + .../portalapp/portal/domain/GetAccessResult.java | 70 + .../portalapp/portal/domain/GetAccessResultId.java | 64 + .../portal/domain/PersUserAppSelection.java | 79 + .../portalapp/portal/domain/SharedContext.java | 161 + .../portalapp/portal/domain/UserIdRoleId.java | 77 + .../portalapp/portal/domain/UserRole.java | 91 + .../portalapp/portal/domain/UserRoles.java | 111 + .../openecomp/portalapp/portal/domain/Widget.java | 104 + .../portal/ecomp/model/AppCatalogItem.java | 159 + .../ecomp/model/AppCategoryFunctionsItem.java | 84 + .../portal/ecomp/model/AppContactUsItem.java | 104 + .../portal/ecomp/model/CommonWidgetsEnum.java | 36 + .../portal/ecomp/model/PortalRestResponse.java | 60 + .../portal/ecomp/model/PortalRestStatusEnum.java | 35 + .../portal/ecomp/model/SearchResultItem.java | 92 + .../interceptor/PortalResourceInterceptor.java | 95 + .../interceptor/SessionTimeoutInterceptor.java | 97 + .../portalapp/portal/listener/HealthMonitor.java | 393 + .../portal/listener/UserContextListener.java | 49 + .../portal/listener/UserSessionListener.java | 125 + .../portalapp/portal/logging/aop/EPAuditLog.java | 31 + .../portal/logging/aop/EPEELFLoggerAdvice.java | 341 + .../portal/logging/aop/EPEELFLoggerAspect.java | 204 + .../portalapp/portal/logging/aop/EPMetricsLog.java | 31 + .../logging/format/ApplicationCodes.properties | 141 + .../portal/logging/format/EPAppMessagesEnum.java | 260 + .../portal/logging/format/EPErrorCodesEnum.java | 95 + .../portalapp/portal/logging/logic/EPLogUtil.java | 76 + .../portal/service/AdminRolesService.java | 52 + .../portal/service/AdminRolesServiceImpl.java | 318 + .../portal/service/AppContactUsService.java | 55 + .../portal/service/AppContactUsServiceImpl.java | 178 + .../service/ApplicationsRestClientService.java | 28 + .../service/ApplicationsRestClientServiceImpl.java | 267 + .../portalapp/portal/service/AppsCacheService.java | 40 + .../portal/service/AppsCacheServiceImple.java | 104 + .../portal/service/DashboardSearchService.java | 38 + .../portal/service/DashboardSearchServiceImpl.java | 238 + .../portalapp/portal/service/EPAppService.java | 164 + .../portalapp/portal/service/EPAppServiceImpl.java | 1218 + .../portalapp/portal/service/EPAuditService.java | 26 + .../portal/service/EPAuditServiceImpl.java | 74 + .../portalapp/portal/service/EPLdapService.java | 31 + .../portal/service/EPLdapServiceImpl.java | 287 + .../portalapp/portal/service/EPLoginService.java | 42 + .../portal/service/EPLoginServiceImpl.java | 235 + .../portalapp/portal/service/EPRoleService.java | 32 + .../portal/service/EPRoleServiceImpl.java | 149 + .../portal/service/FunctionalMenuService.java | 50 + .../portal/service/FunctionalMenuServiceImpl.java | 862 + .../portalapp/portal/service/GetAccessService.java | 32 + .../portal/service/GetAccessServiceImpl.java | 50 + .../portalapp/portal/service/ManifestService.java | 34 + .../portal/service/ManifestServiceImpl.java | 65 + .../portal/service/PersUserAppService.java | 24 + .../portal/service/PersUserAppServiceImpl.java | 117 + .../portal/service/PortalAdminService.java | 31 + .../portal/service/PortalAdminServiceImpl.java | 179 + .../portalapp/portal/service/SearchService.java | 38 + .../portal/service/SearchServiceImpl.java | 188 + .../portal/service/SharedContextService.java | 98 + .../portal/service/SharedContextServiceImpl.java | 173 + .../portalapp/portal/service/UserRolesService.java | 58 + .../portal/service/UserRolesServiceImpl.java | 656 + .../portalapp/portal/service/UserService.java | 34 + .../portalapp/portal/service/UserServiceImpl.java | 260 + .../portalapp/portal/service/WidgetService.java | 36 + .../portal/service/WidgetServiceImpl.java | 275 + .../portal/transport/AllAppsWithRolesForUser.java | 40 + .../transport/AppCatalogPersonalization.java | 38 + .../portal/transport/AppNameIdIsAdmin.java | 31 + .../portal/transport/AppWithRolesForUser.java | 34 + .../portal/transport/AppsListWithAdminRole.java | 34 + .../portalapp/portal/transport/CommonWidget.java | 140 + .../portal/transport/CommonWidgetMeta.java | 50 + .../portalapp/portal/transport/EventWidget.java | 139 + .../portal/transport/EventWidgetMeta.java | 52 + .../transport/FavoritesFunctionalMenuItem.java | 45 + .../transport/FavoritesFunctionalMenuItemJson.java | 57 + .../portal/transport/FieldsValidator.java | 49 + .../portal/transport/FunctionalMenuItem.java | 90 + .../portal/transport/FunctionalMenuItemJson.java | 52 + .../portal/transport/FunctionalMenuRole.java | 49 + .../portalapp/portal/transport/LocalRole.java | 42 + .../portalapp/portal/transport/OnboardingApp.java | 83 + .../portal/transport/OnboardingWidget.java | 65 + .../portalapp/portal/transport/PortalAdmin.java | 53 + .../portal/transport/PortalAdminUserRole.java | 48 + .../portalapp/portal/transport/RemoteRole.java | 28 + .../portal/transport/RemoteUserWithRoles.java | 63 + .../portal/transport/RoleInAppForUser.java | 39 + .../portal/transport/RolesInAppForUser.java | 33 + .../portal/transport/UserApplicationRoles.java | 41 + .../portal/transport/UserWithNameSurnameTitle.java | 39 + .../portalapp/portal/ueb/EPUebHelper.java | 218 + .../portalapp/portal/ueb/EPUebMsgTypes.java | 27 + .../portal/utils/CustomLoggingFilter.java | 60 + .../portalapp/portal/utils/EPSystemProperties.java | 77 + .../portalapp/portal/utils/EcompPortalUtils.java | 248 + .../portalapp/portal/utils/EcompVersion.java | 33 + .../portalapp/portal/utils/HashMapFromList.java | 100 + .../portalapp/portal/utils/ParallelExecutor.java | 83 + .../org/openecomp/portalapp/scheduler/LogJob.java | 45 + .../openecomp/portalapp/scheduler/LogRegistry.java | 57 + .../openecomp/portalapp/scheduler/Register.java | 86 + .../portalapp/scheduler/RegistryAdapter.java | 100 + .../portalapp/scheduler/SessionMgtRegistry.java | 89 + .../portalapp/service/AdminAuthExtension.java | 35 + .../portalapp/service/EPProfileService.java | 36 + .../portalapp/service/EPProfileServiceImpl.java | 76 + .../service/sessionmgt/CoreTimeoutHandler.java | 166 + .../service/sessionmgt/ManageService.java | 101 + .../sessionmgt/RemoteWebServiceCallService.java | 44 + .../RemoteWebServiceCallServiceImpl.java | 83 + .../service/sessionmgt/SessionCommunication.java | 274 + .../service/sessionmgt/TimeoutHandler.java | 252 + .../uebhandler/FunctionalMenuHandler.java | 126 + .../portalapp/uebhandler/InitUebHandler.java | 75 + .../portalapp/uebhandler/MainUebHandler.java | 115 + .../uebhandler/WidgetNotificationHandler.java | 93 + .../org/openecomp/portalapp/util/EPUserUtils.java | 308 + .../portalapp/util/SessionCookieUtil.java | 129 + ecomp-portal-BE/src/main/resources/cache.ccf | 30 + ecomp-portal-BE/src/main/resources/logback.xml | 285 + .../src/main/resources/openid-connect.properties | 22 + .../src/main/resources/openid-keystore.jwks | 12 + .../src/main/resources/portal.properties | 44 + .../portal/controller/SharedContextRestClient.java | 262 + .../SharedContextRestControllerTest.java | 107 + .../controller/SharedContextTestProperties.java | 62 + .../controller/shared-context-test.properties | 9 + .../portal/listener/HealthMonitorTest.java | 17 + .../portal/utils/EcompPortalUtilsTest.java | 14 + ecomp-portal-BE/war/META-INF/MANIFEST.MF | 3 + ecomp-portal-BE/war/WEB-INF/conf/cache.ccf | 30 + .../war/WEB-INF/conf/kpidash.properties | 22 + ecomp-portal-BE/war/WEB-INF/conf/quartz.properties | 55 + ecomp-portal-BE/war/WEB-INF/conf/raptor.properties | 185 + .../war/WEB-INF/conf/raptor_app_fusion.properties | 36 + .../war/WEB-INF/conf/raptor_db_fusion.properties | 19 + .../war/WEB-INF/conf/raptor_pdf.properties | 49 + ecomp-portal-BE/war/WEB-INF/conf/sql.properties | 295 + ecomp-portal-BE/war/WEB-INF/conf/system.properties | 102 + ecomp-portal-BE/war/WEB-INF/defs/definitions.xml | 38 + ecomp-portal-BE/war/WEB-INF/fusion/.DS_Store | Bin 0 -> 6148 bytes .../war/WEB-INF/fusion/conf/fusion.properties | 82 + .../war/WEB-INF/fusion/defs/definitions.xml | 120 + ecomp-portal-BE/war/WEB-INF/fusion/jsp/.gitignore | 0 .../war/WEB-INF/fusion/jsp/collaborateList.jsp | 101 + .../war/WEB-INF/fusion/jsp/ebz/ebz_footer.jsp | 63 + .../war/WEB-INF/fusion/jsp/ebz/ebz_header.jsp | 303 + .../war/WEB-INF/fusion/jsp/ebz_template.jsp | 44 + .../fusion/jsp/ebz_template_noheader_nofooter.jsp | 35 + ecomp-portal-BE/war/WEB-INF/fusion/jsp/include.jsp | 30 + .../war/WEB-INF/fusion/jsp/jcs_admin.jsp | 149 + ecomp-portal-BE/war/WEB-INF/fusion/jsp/meta.jsp | 35 + .../war/WEB-INF/fusion/jsp/popup_modal.html | 311 + .../war/WEB-INF/fusion/jsp/popup_modal_role.html | 257 + .../fusion/jsp/popup_modal_rolefunction.html | 87 + .../war/WEB-INF/fusion/jsp/post_search.jsp | 370 + ecomp-portal-BE/war/WEB-INF/fusion/jsp/profile.jsp | 442 + .../war/WEB-INF/fusion/jsp/profile_search.jsp | 100 + ecomp-portal-BE/war/WEB-INF/fusion/jsp/role.jsp | 298 + .../war/WEB-INF/fusion/jsp/role_function_list.jsp | 225 + .../war/WEB-INF/fusion/jsp/role_list.jsp | 147 + .../war/WEB-INF/fusion/jsp/usage_list.jsp | 99 + .../WEB-INF/fusion/jsp/webrtc/collaboration.jsp | 529 + ecomp-portal-BE/war/WEB-INF/fusion/orm/EP.hbm.xml | 558 + .../war/WEB-INF/fusion/orm/Fusion.hbm.xml | 372 + .../war/WEB-INF/fusion/orm/Workflow.hbm.xml | 48 + .../war/WEB-INF/fusion/raptor/report_search.jsp | 20 + ecomp-portal-BE/war/WEB-INF/jsp/error.jsp | 20 + ecomp-portal-BE/war/WEB-INF/jsp/index.jsp | 21 + ecomp-portal-BE/war/WEB-INF/jsp/login.jsp | 152 + ecomp-portal-BE/war/WEB-INF/jsp/oid-admin.jsp | 72 + ecomp-portal-BE/war/WEB-INF/jsp/oid-home.jsp | 102 + ecomp-portal-BE/war/WEB-INF/jsp/oid-login.jsp | 76 + ecomp-portal-BE/war/WEB-INF/jsp/oid-user.jsp | 139 + ecomp-portal-BE/war/WEB-INF/jsp/welcome.jsp | 695 + ecomp-portal-BE/war/WEB-INF/oid-context.xml | 455 + ecomp-portal-BE/war/WEB-INF/tags/copyright.tag | 1 + ecomp-portal-BE/war/WEB-INF/tags/footer.tag | 12 + ecomp-portal-BE/war/WEB-INF/tags/header.tag | 59 + ecomp-portal-BE/war/WEB-INF/tags/topbar.tag | 96 + ecomp-portal-BE/war/WEB-INF/web.xml | 87 + ecomp-portal-BE/war/images/cache/README.txt | 1 + ecomp-portal-BE/war/index.jsp | 22 + .../war/static/ebz/angular_js/angular-sanitize.js | 647 + .../war/static/ebz/angular_js/angular.js | 22024 +++++++++ ecomp-portal-BE/war/static/ebz/angular_js/app.js | 3 + .../static/ebz/angular_js/att-abs-tpls-1.2.51.js | 17587 ++++++++ .../war/static/ebz/angular_js/attHeaderSnippet.js | 210 + .../war/static/ebz/angular_js/att_abs_tpls.js | 18514 ++++++++ .../war/static/ebz/angular_js/checklist-model.js | 99 + .../static/ebz/angular_js/checklist-model.min.js | 1 + .../static/ebz/angular_js/d7100892.modernizr.js | 1 + .../war/static/ebz/angular_js/ebiz_keepalive.js | 8 + .../war/static/ebz/angular_js/footer.js | 110 + .../war/static/ebz/angular_js/footer_new.js | 102 + .../war/static/ebz/angular_js/gestures.js | 1495 + .../war/static/ebz/angular_js/ng_base.js | 4 + .../war/static/ebz/angular_js/ui-charts-tpls.js | 3909 ++ .../war/static/ebz/attSessionTimeoutModal.css | 1562 + ecomp-portal-BE/war/static/ebz/dashboardBase.css | 5798 +++ .../war/static/ebz/dashboardBase_changed.css | 5803 +++ ecomp-portal-BE/war/static/ebz/ebz_header.css | 607 + ecomp-portal-BE/war/static/ebz/fn-ebz.css | 1344 + ecomp-portal-BE/war/static/ebz/footer_new.css | 310 + ecomp-portal-BE/war/static/ebz/globalFonts.css | Bin 0 -> 6347 bytes ecomp-portal-BE/war/static/ebz/header_new.css | 1781 + .../war/static/ebz/js/attHeaderSnippet.js | 210 + ecomp-portal-BE/war/static/ebz/js/footer.js | 110 + .../war/static/ebz/sandbox/att-abs-tpls.js | 20451 +++++++++ .../war/static/ebz/sandbox/att-abs-tpls.min.js | 22 + .../war/static/ebz/sandbox/styles/base.css | 1 + .../war/static/ebz/sandbox/styles/btn.css | 1 + .../war/static/ebz/sandbox/styles/demo.css | 2 + .../war/static/ebz/sandbox/styles/dtpk.css | 9 + .../war/static/ebz/sandbox/styles/frms.css | 1 + .../ebz/sandbox/styles/ie/backgroundsize.min.htc | 12 + .../ebz/sandbox/styles/pages/iconography.css | 2 + .../war/static/ebz/sandbox/styles/sldr.css | 1 + .../war/static/ebz/sandbox/styles/style.css | 1 + .../war/static/ebz/sandbox/styles/tbs.css | 1 + .../css/att_angular_gridster/sandbox-gridster.css | 173 + .../css/att_angular_gridster/ui-gridster.css | 116 + .../war/static/fusion/css/fusion-sunny.css | 362 + .../war/static/fusion/css/jquery-ui.css | 1225 + .../fusion/css/layout/layout-default-latest.css | 224 + ecomp-portal-BE/war/static/fusion/d3/css/nv.d3.css | 656 + ecomp-portal-BE/war/static/fusion/d3/js/cie.js | 155 + .../war/static/fusion/d3/js/colorbrewer.js | 302 + ecomp-portal-BE/war/static/fusion/d3/js/core.js | 122 + .../war/static/fusion/d3/js/crossfilter.js | 1180 + .../war/static/fusion/d3/js/crossfilter.min.js | 1 + ecomp-portal-BE/war/static/fusion/d3/js/d3.geom.js | 816 + ecomp-portal-BE/war/static/fusion/d3/js/d3.js | 5 + .../war/static/fusion/d3/js/d3.layout.cloud.js | 433 + .../war/static/fusion/d3/js/d3.layout.js | 908 + ecomp-portal-BE/war/static/fusion/d3/js/d3.v2.js | 7037 +++ .../war/static/fusion/d3/js/d3.v2.min.js | 4 + .../war/static/fusion/d3/js/d3.v3.min.js | 1 + ecomp-portal-BE/war/static/fusion/d3/js/fisheye.js | 86 + ecomp-portal-BE/war/static/fusion/d3/js/hive.js | 80 + ecomp-portal-BE/war/static/fusion/d3/js/horizon.js | 192 + .../war/static/fusion/d3/js/interactiveLayer.js | 251 + ecomp-portal-BE/war/static/fusion/d3/js/intro.js | 1 + .../war/static/fusion/d3/js/models/axis-min.js | 1 + .../war/static/fusion/d3/js/models/axis.js | 470 + .../war/static/fusion/d3/js/models/axis.min.js | 1 + .../static/fusion/d3/js/models/backup/bullet.js | 250 + .../fusion/d3/js/models/backup/bulletChart.js | 349 + .../war/static/fusion/d3/js/models/boilerplate.js | 104 + .../war/static/fusion/d3/js/models/bullet.js | 385 + .../war/static/fusion/d3/js/models/bulletChart.js | 343 + .../fusion/d3/js/models/cumulativeLineChart.js | 782 + .../war/static/fusion/d3/js/models/discreteBar.js | 349 + .../static/fusion/d3/js/models/discreteBarChart.js | 333 + .../war/static/fusion/d3/js/models/distribution.js | 148 + .../static/fusion/d3/js/models/historicalBar.js | 331 + .../fusion/d3/js/models/historicalBarChart.js | 419 + .../war/static/fusion/d3/js/models/indentedTree.js | 337 + .../war/static/fusion/d3/js/models/legend.js | 270 + .../war/static/fusion/d3/js/models/line.js | 284 + .../war/static/fusion/d3/js/models/lineChart.js | 465 + .../static/fusion/d3/js/models/linePlusBarChart.js | 433 + .../d3/js/models/linePlusBarWithFocusChart.js | 658 + .../static/fusion/d3/js/models/lineWithFisheye.js | 200 + .../fusion/d3/js/models/lineWithFisheyeChart.js | 297 + .../fusion/d3/js/models/lineWithFocusChart.js | 574 + .../war/static/fusion/d3/js/models/multiBar.js | 461 + .../static/fusion/d3/js/models/multiBarChart.js | 524 + .../fusion/d3/js/models/multiBarHorizontal.js | 424 + .../fusion/d3/js/models/multiBarHorizontalChart.js | 434 + .../fusion/d3/js/models/multiBarTimeSeries.js | 384 + .../fusion/d3/js/models/multiBarTimeSeriesChart.js | 405 + .../war/static/fusion/d3/js/models/multiChart.js | 452 + .../war/static/fusion/d3/js/models/ohlcBar.js | 380 + .../fusion/d3/js/models/parallelCoordinates.js | 239 + .../war/static/fusion/d3/js/models/pie.js | 400 + .../war/static/fusion/d3/js/models/pieChart.js | 292 + .../war/static/fusion/d3/js/models/scatter.js | 674 + .../war/static/fusion/d3/js/models/scatterChart.js | 628 + .../fusion/d3/js/models/scatterPlusLineChart.js | 620 + .../war/static/fusion/d3/js/models/sparkline.js | 194 + .../static/fusion/d3/js/models/sparklinePlus.js | 295 + .../war/static/fusion/d3/js/models/stackedArea.js | 368 + .../static/fusion/d3/js/models/stackedAreaChart.js | 629 + ecomp-portal-BE/war/static/fusion/d3/js/nv.d3.js | 13097 ++++++ .../war/static/fusion/d3/js/nv.d3.min.js | 1 + ecomp-portal-BE/war/static/fusion/d3/js/outro.js | 1 + ecomp-portal-BE/war/static/fusion/d3/js/sankey.js | 292 + ecomp-portal-BE/war/static/fusion/d3/js/tooltip.js | 490 + ecomp-portal-BE/war/static/fusion/d3/js/utils.js | 152 + .../fusion/images/att_angular_gridster/grips.png | Bin 0 -> 951 bytes .../war/static/fusion/images/ecomp-login.jpg | Bin 0 -> 66384 bytes .../war/static/fusion/images/ecomp_trans.png | Bin 0 -> 109926 bytes .../war/static/fusion/images/login_button.gif | Bin 0 -> 1222 bytes .../js/att_angular_gridster/angular-gridster.js | 2244 + .../js/att_angular_gridster/ui-gridster-tpls.js | 168 + .../war/static/fusion/js/jquery.resize.js | 139 + .../war/static/fusion/js/layout/debug.js | 329 + .../war/static/fusion/js/layout/jquery-latest.js | 9555 ++++ .../static/fusion/js/layout/jquery-ui-latest.js | 14879 ++++++ .../fusion/js/layout/jquery.layout-latest.js | 6086 +++ .../war/static/fusion/sample/css/images/blank.gif | Bin 0 -> 49 bytes .../war/static/fusion/sample/css/scribble.css | 32 + .../war/static/fusion/sample/css/slider.css | 142 + .../war/static/fusion/sample/css/spacegallery.css | 18 + .../war/static/fusion/sample/html/area_chart.html | 49 + .../war/static/fusion/sample/html/bar_chart.html | 95 + .../static/fusion/sample/html/d3_gauges_demo.html | 39 + .../fusion/sample/html/data/speedometer2.csv | 16 + .../fusion/sample/html/data/speedometer3.csv | 2 + .../static/fusion/sample/html/data/worddata.csv | 22 + .../war/static/fusion/sample/html/donut_d3.html | 43 + .../static/fusion/sample/html/js/area_chart.min.js | 1 + .../war/static/fusion/sample/html/js/donut.min.js | 1 + .../war/static/fusion/sample/html/js/gauges.min.js | 1 + .../static/fusion/sample/html/js/line_chart.min.js | 1 + .../static/fusion/sample/html/js/pie_chart.min.js | 1 + .../static/fusion/sample/html/js/worddata.min.js | 1 + .../war/static/fusion/sample/html/line_chart.html | 49 + .../war/static/fusion/sample/html/pie_chart.html | 38 + .../war/static/fusion/sample/html/wordcloud.html | 37 + .../war/static/fusion/sample/js/FusionCharts.js | 361 + .../war/static/fusion/sample/js/charts.js | 132 + ecomp-portal-BE/war/static/fusion/sample/js/eye.js | 34 + .../war/static/fusion/sample/js/scribble.js | 19 + .../static/fusion/sample/js/slides.min.jquery.js | 20 + .../war/static/fusion/sample/js/spacegallery.js | 235 + .../war/static/fusion/sample/js/utils.js | 252 + .../fusion/sample/org_chart/css/bootstrap.min.css | 351 + .../static/fusion/sample/org_chart/css/custom.css | 97 + .../sample/org_chart/css/jquery.jOrgChart.css | 51 + .../fusion/sample/org_chart/css/prettify.css | 1 + .../static/fusion/sample/org_chart/example.html | 85 + .../fusion/sample/org_chart/example_vsp.html | 88 + .../fusion/sample/org_chart/jquery.jOrgChart.js | 267 + .../war/static/fusion/sample/org_chart/prettify.js | 28 + .../war/static/fusion/webrtc/getSourceId.html | 78 + .../static/fusion/webrtc/js/RTCMultiConnection.js | 6777 +++ .../war/static/fusion/webrtc/js/peerBroadcast.js | 113 + ecomp-portal-BE/war/static/js/jquery-1.10.2.js | 9789 ++++ ecomp-portal-BE/war/static/js/jquery-ui.js | 16617 +++++++ ecomp-portal-BE/war/static/js/jquery.mask.min.js | 12 + ecomp-portal-BE/war/static/js/modalService.js | 144 + .../bootstrap2/css/bootstrap-responsive.css | 1109 + .../bootstrap2/css/bootstrap-responsive.min.css | 9 + .../oid-connect/bootstrap2/css/bootstrap.css | 6167 +++ .../oid-connect/bootstrap2/css/bootstrap.min.css | 9 + .../static/oid-connect/bootstrap2/js/bootstrap.js | 2280 + .../oid-connect/bootstrap2/js/bootstrap.min.js | 6 + .../war/static/oid-connect/js/lib/jquery.js | 9404 ++++ .../war/static/oid-connect/js/lib/jwt.js | 244 + .../war/static/oid-connect/js/lib/underscore.js | 1221 + ecomp-portal-FE/.bowerrc | 3 + ecomp-portal-FE/.gitignore | 6 + ecomp-portal-FE/Gruntfile.js | 779 + ecomp-portal-FE/README.md | 51 + ecomp-portal-FE/bower.json | 36 + ecomp-portal-FE/build-ecomportal-fe.sh | 181 + ecomp-portal-FE/client/.htaccess | 543 + ecomp-portal-FE/client/.jshintrc | 36 + ecomp-portal-FE/client/app/app.js | 120 + ecomp-portal-FE/client/app/app.less | 78 + ecomp-portal-FE/client/app/configurations.js | 5 + .../directives/auto-focus/auto-focus.directive.js | 46 + .../image-upload/image-upload.directive.js | 222 + .../directives/left-menu/left-menu.directive.js | 96 + .../client/app/directives/left-menu/left-menu.less | 133 + .../app/directives/left-menu/left-menu.tpl.html | 57 + .../multiple-select/multiple-select.directive.js | 111 + .../multiple-select/multiple-select.less | 81 + .../multiple-select/multiple-select.tpl.html | 38 + .../right-click-menu/right-click-menu.directive.js | 38 + .../right-click/ng-right-click-directive.js | 32 + .../directives/right-menu/right-menu.directive.js | 140 + .../app/directives/right-menu/right-menu.less | 178 + .../app/directives/right-menu/right-menu.tpl.html | 40 + .../directives/scroll-top/scroll-top.directive.js | 35 + .../search-users/search-users.controller.js | 161 + .../search-users/search-users.controller.spec.js | 176 + .../search-users/search-users.directive.js | 34 + .../app/directives/search-users/search-users.less | 154 + .../directives/search-users/search-users.tpl.html | 144 + .../client/app/filters/elipsis/elipsis.filter.js | 38 + .../app/filters/elipsis/elipsis.filter.spec.js | 58 + .../app/filters/trusted-url/trusted-url.filter.js | 26 + ecomp-portal-FE/client/app/router.js | 528 + .../client/app/services/admins/admins.service.js | 176 + .../services/applications/applications.service.js | 346 + .../client/app/services/catalog/catalog.service.js | 95 + .../services/confirm-box/confirm-box.service.js | 153 + .../app/services/contact-us/contact-us.service.js | 247 + .../app/services/dashboard/dashboard.service.js | 185 + .../error-messages/error-messages.service.js | 23 + .../functionalMenu/functionalMenu.service.js | 253 + .../services/global-constants/global-constants.js | 21 + .../kpi-dashboard/kpi-dashboard.service.js | 185 + .../app/services/manifest/manifest.service.js | 64 + .../client/app/services/menus/menus.service.js | 145 + .../portal-admins/portal-admins.service.js | 107 + .../support/getAccess/get-access.service.js | 61 + .../services/support/session/session.service.js | 56 + .../services/userProfile/userProfile.service.js | 240 + .../app/services/userbar/userbar.update.service.js | 97 + .../client/app/services/users/users.service.js | 161 + .../client/app/services/utils/utils.service.js | 57 + .../client/app/services/widgets/widgets.service.js | 178 + ecomp-portal-FE/client/app/styles/att-abs.less | 86 + ecomp-portal-FE/client/app/styles/buttons.less | 72 + .../client/app/styles/ecomp-general.less | 76 + ecomp-portal-FE/client/app/styles/fonts.less | 81 + ecomp-portal-FE/client/app/styles/form.less | 189 + .../client/app/styles/kpi-dashboard.less | 111 + ecomp-portal-FE/client/app/styles/mixins.less | 296 + ecomp-portal-FE/client/app/styles/ng-dialog.less | 88 + ecomp-portal-FE/client/app/styles/reset.less | 79 + ecomp-portal-FE/client/app/styles/select2.less | 102 + ecomp-portal-FE/client/app/styles/spinner.less | 56 + ecomp-portal-FE/client/app/styles/sprites.less | 118 + ecomp-portal-FE/client/app/styles/variables.less | 86 + .../add-admin-dialogs/new-admin.controller.js | 214 + .../add-admin-dialogs/new-admin.controller.spec.js | 130 + .../admins/add-admin-dialogs/new-admin.modal.html | 66 + .../admins/add-admin-dialogs/new-admin.modal.less | 99 + .../client/app/views/admins/admins.controller.js | 151 + .../app/views/admins/admins.controller.spec.js | 19 + .../client/app/views/admins/admins.less | 47 + .../client/app/views/admins/admins.tpl.html | 82 + .../application-details.controller.js | 244 + .../application-details.controller.spec.js | 19 + .../application-details.modal.html | 183 + .../application-details.modal.less | 122 + .../views/applications/applications.controller.js | 111 + .../applications/applications.controller.spec.js | 19 + .../app/views/applications/applications.less | 45 + .../app/views/applications/applications.tpl.html | 100 + .../client/app/views/catalog/catalog.controller.js | 166 + .../client/app/views/catalog/catalog.less | 439 + .../client/app/views/catalog/catalog.tpl.html | 91 + .../catalog/catalogconfirmation.controller.js | 62 + .../app/views/catalog/information-box.tpl.html | 42 + .../admin-confirmation-box.tpl.html | 31 + .../confirmation-box.controller.js | 41 + .../views/confirmation-box/confirmation-box.less | 53 + .../confirmation-box/confirmation-box.tpl.html | 28 + .../dragdrop-confirmation-box.tpl.html | 31 + .../confirmation-box/information-box.tpl.html | 27 + .../views/dashboard/dashboard-widget-manage.html | 152 + .../views/dashboard/dashboard-widget.controller.js | 422 + .../dashboard/dashboard-widget.controller.less | 101 + .../app/views/dashboard/dashboard.controller.js | 312 + .../views/dashboard/dashboard.controller.spec.js | 78 + .../client/app/views/dashboard/dashboard.less | 766 + .../client/app/views/dashboard/dashboard.tpl.html | 346 + .../app/views/dashboard/newsticker.controller.js | 47 + .../client/app/views/errors/error.404.tpl.html | 31 + .../client/app/views/errors/error.controller.js | 36 + .../client/app/views/errors/error.tpl.html | 26 + .../client/app/views/footer/footer.controller.js | 49 + .../app/views/footer/footer.controller.spec.js | 19 + .../client/app/views/footer/footer.less | 53 + .../client/app/views/footer/footer.tpl.html | 36 + .../menu-details.controller.js | 384 + .../menu-details.delete.modal.html | 35 + .../functionalMenu-dialog/menu-details.modal.html | 106 + .../functionalMenu-dialog/modal-details.modal.less | 103 + .../functionalMenu/functionalMenu.controller.js | 331 + .../app/views/functionalMenu/functionalMenu.less | 70 + .../views/functionalMenu/functionalMenu.tpl.html | 48 + .../app/views/functionalMenu/jqTreeContextMenu.js | 192 + .../client/app/views/header/header.controller.js | 419 + .../app/views/header/header.controller.spec.js | 19 + .../client/app/views/header/header.less | 380 + .../client/app/views/header/header.tpl.html | 277 + .../views/header/user-edit/edit-user.controller.js | 134 + .../app/views/header/user-edit/edit-user.less | 61 + .../app/views/header/user-edit/edit-user.tpl.html | 69 + .../applications-home.controller.js | 244 + .../applications-home.controller.spec.js | 77 + .../home/applications-home/applications-home.less | 164 + .../applications-home/applications-home.tpl.html | 59 + .../home/widgets-home/widgets-home.controller.js | 284 + .../widgets-home/widgets-home.controller.spec.js | 1 + .../app/views/home/widgets-home/widgets-home.less | 137 + .../views/home/widgets-home/widgets-home.tpl.html | 123 + .../new-portal-admin.controller.js | 85 + .../new-portal-admin.controller.spec.js | 19 + .../new-portal-admin/new-portal-admin.modal.html | 32 + .../new-portal-admin/new-portal-admin.modal.less | 99 + .../views/portal-admin/portal-admin-controller.js | 127 + .../app/views/portal-admin/portal-admin.tpl.html | 73 + .../app/views/portal-admin/portal-admins.less | 56 + .../client/app/views/search/search.controller.js | 184 + .../app/views/search/search.controller.spec.js | 19 + .../client/app/views/search/search.less | 55 + .../client/app/views/search/search.tpl.html | 82 + .../client/app/views/sidebar/sidebar.controller.js | 143 + .../client/app/views/sidebar/sidebar.less | 37 + .../client/app/views/sidebar/sidebar.tpl.html | 20 + .../contact-us-manage.controller.js | 194 + .../contact-us-manage.controller.less | 159 + .../contact-us-manage/contact-us-manage.html | 136 + .../support/contact-us/contact-us.controller.js | 166 + .../contact-us/contact-us.controller.spec.js | 19 + .../app/views/support/contact-us/contact-us.less | 104 + .../views/support/contact-us/contact-us.tpl.html | 125 + .../support/get-access/get-access.controller.js | 70 + .../get-access/get-access.controller.spec.js | 19 + .../app/views/support/get-access/get-access.less | 67 + .../views/support/get-access/get-access.tpl.html | 88 + .../client/app/views/tabs/tabframe.html | 22 + .../client/app/views/tabs/tabs.controller.js | 231 + .../client/app/views/tabs/tabs.controller.spec.js | 80 + ecomp-portal-FE/client/app/views/tabs/tabs.less | 658 + .../client/app/views/tabs/tabs.tpl.html | 46 + .../client/app/views/userbar/userbar.controller.js | 262 + .../client/app/views/userbar/userbar.less | 41 + .../client/app/views/userbar/userbar.tpl.html | 20 + .../users/new-user-dialogs/new-user.controller.js | 211 + .../new-user-dialogs/new-user.controller.spec.js | 222 + .../users/new-user-dialogs/new-user.modal.html | 70 + .../users/new-user-dialogs/new-user.modal.less | 126 + .../client/app/views/users/users.controller.js | 187 + .../app/views/users/users.controller.spec.js | 19 + ecomp-portal-FE/client/app/views/users/users.less | 59 + .../client/app/views/users/users.tpl.html | 105 + .../widget-details.controller.js | 202 + .../widget-details.controller.spec.js | 19 + .../widget-details.modal.html | 132 + .../widget-details.modal.less | 94 + .../client/app/views/widgets/widgets.controller.js | 151 + .../app/views/widgets/widgets.controller.spec.js | 19 + .../client/app/views/widgets/widgets.less | 60 + .../client/app/views/widgets/widgets.tpl.html | 77 + ecomp-portal-FE/client/assets/images/cloud.png | Bin 0 -> 132244 bytes .../client/assets/images/ecomp_logo.png | Bin 0 -> 3868 bytes ecomp-portal-FE/client/assets/images/grips.png | Bin 0 -> 951 bytes ecomp-portal-FE/client/assets/images/photo.png | Bin 0 -> 835 bytes ecomp-portal-FE/client/assets/images/spinner.gif | Bin 0 -> 4178 bytes ecomp-portal-FE/client/assets/images/sprite.png | Bin 0 -> 446 bytes .../bower_components/angular-animate/.bower.json | 20 + .../bower_components/angular-animate/README.md | 68 + .../angular-animate/angular-animate.js | 4121 ++ .../angular-animate/angular-animate.min.js | 56 + .../angular-animate/angular-animate.min.js.map | 8 + .../bower_components/angular-animate/bower.json | 10 + .../bower_components/angular-animate/index.js | 2 + .../bower_components/angular-animate/package.json | 26 + .../bower_components/angular-aria/.bower.json | 20 + .../client/bower_components/angular-aria/README.md | 67 + .../bower_components/angular-aria/angular-aria.js | 398 + .../angular-aria/angular-aria.min.js | 14 + .../angular-aria/angular-aria.min.js.map | 8 + .../bower_components/angular-aria/bower.json | 10 + .../client/bower_components/angular-aria/index.js | 2 + .../bower_components/angular-aria/package.json | 27 + .../bower_components/angular-bootstrap/.bower.json | 31 + .../bower_components/angular-bootstrap/.gitignore | 1 + .../bower_components/angular-bootstrap/.npmignore | 1 + .../bower_components/angular-bootstrap/README.md | 120 + .../bower_components/angular-bootstrap/bower.json | 19 + .../bower_components/angular-bootstrap/index.js | 2 + .../angular-bootstrap/package.json | 23 + .../angular-bootstrap/ui-bootstrap-csp.css | 115 + .../angular-bootstrap/ui-bootstrap-tpls.js | 7715 ++++ .../angular-bootstrap/ui-bootstrap-tpls.min.js | 10 + .../angular-bootstrap/ui-bootstrap.js | 7351 +++ .../angular-bootstrap/ui-bootstrap.min.js | 10 + .../bower_components/angular-cache/.bower.json | 45 + .../bower_components/angular-cache/CHANGELOG.md | 353 + .../client/bower_components/angular-cache/LICENSE | 20 + .../bower_components/angular-cache/README.md | 671 + .../bower_components/angular-cache/TRANSITION.md | 98 + .../bower_components/angular-cache/bower.json | 35 + .../build_examples/browserify/README.md | 1 + .../angular-cache/build_examples/browserify/app.js | 11 + .../build_examples/browserify/index.html | 11 + .../angular-cache/build_examples/r.js/README.md | 3 + .../angular-cache/build_examples/r.js/app.js | 9 + .../angular-cache/build_examples/r.js/index.html | 14 + .../angular-cache/build_examples/r.js/main.js | 22 + .../build_examples/r.js/require.config.js | 6 + .../angular-cache/build_examples/webpack/README.md | 1 + .../angular-cache/build_examples/webpack/app.js | 8 + .../build_examples/webpack/index.html | 11 + .../build_examples/webpack/webpack.config.js | 11 + .../build_examples/webpack_es6/README.md | 1 + .../build_examples/webpack_es6/app.js | 8 + .../build_examples/webpack_es6/index.html | 11 + .../build_examples/webpack_es6/webpack.config.js | 16 + .../build_examples/webpack_es6_2/README.md | 1 + .../build_examples/webpack_es6_2/app.js | 8 + .../build_examples/webpack_es6_2/index.html | 11 + .../build_examples/webpack_es6_2/webpack.config.js | 16 + .../bower_components/angular-cache/circle.yml | 6 + .../angular-cache/dist/angular-cache.js | 1111 + .../angular-cache/dist/angular-cache.js.map | 1 + .../angular-cache/dist/angular-cache.min.js | 2 + .../angular-cache/dist/angular-cache.min.map | 1 + .../angular-cache/rollup.config.js | 22 + .../angular-cache/scripts/postbuild.js | 21 + .../bower_components/angular-cookies/.bower.json | 20 + .../bower_components/angular-cookies/README.md | 68 + .../angular-cookies/angular-cookies.js | 322 + .../angular-cookies/angular-cookies.min.js | 9 + .../angular-cookies/angular-cookies.min.js.map | 8 + .../bower_components/angular-cookies/bower.json | 10 + .../bower_components/angular-cookies/index.js | 2 + .../bower_components/angular-cookies/package.json | 26 + .../bower_components/angular-gestures/.bower.json | 32 + .../bower_components/angular-gestures/LICENSE.md | 21 + .../bower_components/angular-gestures/README.md | 82 + .../bower_components/angular-gestures/bower.json | 23 + .../bower_components/angular-gestures/gestures.js | 158 + .../angular-gestures/gestures.min.js | 1 + .../bower_components/angular-material/.bower.json | 24 + .../bower_components/angular-material/.gitignore | 5 + .../bower_components/angular-material/CHANGELOG.md | 1543 + .../bower_components/angular-material/LICENSE | 21 + .../bower_components/angular-material/README.md | 240 + .../angular-material/angular-material-mocks.js | 77 + .../angular-material/angular-material.css | 6795 +++ .../angular-material/angular-material.js | 13909 ++++++ .../angular-material/angular-material.min.css | 6 + .../angular-material/angular-material.min.js | 15 + .../bower_components/angular-material/bower.json | 14 + .../bottomSheet/demoBasicUsage/img/icons/copy.svg | 1 + .../bottomSheet/demoBasicUsage/img/icons/copy2.svg | 1 + .../demoBasicUsage/img/icons/facebook.svg | 1 + .../demoBasicUsage/img/icons/hangout.svg | 1 + .../bottomSheet/demoBasicUsage/img/icons/mail.svg | 1 + .../demoBasicUsage/img/icons/message.svg | 1 + .../bottomSheet/demoBasicUsage/img/icons/print.svg | 1 + .../demoBasicUsage/img/icons/share-arrow.svg | 1 + .../demoBasicUsage/img/icons/twitter.svg | 2 + .../demoBasicUsage/img/icons/upload.svg | 1 + .../demos/chips/demoBasicUsage/style.scss | 39 + .../demos/chips/demoContactChips/style.scss | 47 + .../demos/gridList/demoBasicUsage/style.scss | 75 + .../demos/gridList/demoDynamicTiles/style.scss | 78 + .../demos/gridList/demoResponsiveUsage/style.scss | 0 .../img/icons/addShoppingCart.svg | 1 + .../demoLoadSvgIconsFromUrl/img/icons/android.svg | 1 + .../demoLoadSvgIconsFromUrl/img/icons/cake.svg | 1 + .../demos/icon/demoSvgIconSets/assets/cake.svg | 1 + .../icon/demoSvgIconSets/assets/core-icons.svg | 26 + .../icon/demoSvgIconSets/assets/social-icons.svg | 26 + .../img/icons/addShoppingCart.svg | 1 + .../icon/demoSvgIconsFromURL/img/icons/android.svg | 1 + .../icon/demoSvgIconsFromURL/img/icons/cake.svg | 1 + .../icon/demoUsingTemplateCache/assets/android.svg | 1 + .../icon/demoUsingTemplateCache/assets/cake.svg | 1 + .../demoUsingTemplateCache/assets/core-icons.svg | 26 + .../demos/input/demoIcons/icons/ic_email_24px.svg | 4 + .../demos/input/demoIcons/icons/ic_person_24px.svg | 4 + .../demos/input/demoIcons/icons/ic_phone_24px.svg | 4 + .../demos/input/demoIcons/icons/ic_place_24px.svg | 4 + .../demos/input/demoIcons/style.scss | 18 + .../demos/list/demoListControls/img/100-0.jpeg | Bin 0 -> 2331 bytes .../demos/list/demoListControls/img/100-1.jpeg | Bin 0 -> 2816 bytes .../demos/list/demoListControls/img/100-2.jpeg | Bin 0 -> 3389 bytes .../demos/tabs/demoDynamicHeight/style.scss | 13 + .../demos/tabs/demoDynamicTabs/style.scss | 44 + .../demos/tabs/demoStaticTabs/style.scss | 25 + .../toolbar/demoBasicUsage/img/icons/favorite.svg | 4 + .../toolbar/demoBasicUsage/img/icons/menu.svg | 4 + .../toolbar/demoBasicUsage/img/icons/more_vert.svg | 4 + .../bower_components/angular-material/index.js | 12 + .../autocomplete/autocomplete-default-theme.css | 24 + .../modules/closure/autocomplete/autocomplete.css | 220 + .../modules/closure/autocomplete/autocomplete.js | 794 + .../closure/backdrop/backdrop-default-theme.css | 9 + .../modules/closure/backdrop/backdrop.css | 59 + .../modules/closure/backdrop/backdrop.js | 38 + .../bottomSheet/bottomSheet-default-theme.css | 16 + .../modules/closure/bottomSheet/bottomSheet.css | 170 + .../modules/closure/bottomSheet/bottomSheet.js | 267 + .../closure/button/button-default-theme.css | 94 + .../modules/closure/button/button.css | 158 + .../modules/closure/button/button.js | 135 + .../modules/closure/card/card-default-theme.css | 12 + .../angular-material/modules/closure/card/card.css | 34 + .../angular-material/modules/closure/card/card.js | 84 + .../closure/checkbox/checkbox-default-theme.css | 47 + .../modules/closure/checkbox/checkbox.css | 125 + .../modules/closure/checkbox/checkbox.js | 166 + .../modules/closure/chips/chips-default-theme.css | 24 + .../modules/closure/chips/chips.css | 131 + .../modules/closure/chips/chips.js | 949 + .../closure/content/content-default-theme.css | 9 + .../modules/closure/content/content.css | 20 + .../modules/closure/content/content.js | 84 + .../angular-material/modules/closure/core/core.css | 2590 ++ .../angular-material/modules/closure/core/core.js | 3779 ++ .../modules/closure/core/default-theme.js | 4 + .../closure/dialog/dialog-default-theme.css | 12 + .../modules/closure/dialog/dialog.css | 111 + .../modules/closure/dialog/dialog.js | 713 + .../closure/divider/divider-default-theme.css | 9 + .../modules/closure/divider/divider.css | 14 + .../modules/closure/divider/divider.js | 45 + .../closure/gridList/gridList-default-theme.css | 6 + .../modules/closure/gridList/gridList.css | 68 + .../modules/closure/gridList/gridList.js | 762 + .../modules/closure/icon/icon-default-theme.css | 15 + .../angular-material/modules/closure/icon/icon.css | 20 + .../angular-material/modules/closure/icon/icon.js | 787 + .../modules/closure/input/input-default-theme.css | 46 + .../modules/closure/input/input.css | 162 + .../modules/closure/input/input.js | 371 + .../modules/closure/list/list-default-theme.css | 23 + .../angular-material/modules/closure/list/list.css | 147 + .../angular-material/modules/closure/list/list.js | 273 + .../angular-material/modules/closure/menu/menu.css | 6 + .../angular-material/modules/closure/menu/menu.js | 29 + .../progressCircular-default-theme.css | 36 + .../closure/progressCircular/progressCircular.css | 1306 + .../closure/progressCircular/progressCircular.js | 109 + .../progressLinear-default-theme.css | 27 + .../closure/progressLinear/progressLinear.css | 287 + .../closure/progressLinear/progressLinear.js | 126 + .../radioButton/radioButton-default-theme.css | 47 + .../modules/closure/radioButton/radioButton.css | 90 + .../modules/closure/radioButton/radioButton.js | 312 + .../closure/select/select-default-theme.css | 42 + .../modules/closure/select/select.css | 168 + .../modules/closure/select/select.js | 1056 + .../closure/sidenav/sidenav-default-theme.css | 9 + .../modules/closure/sidenav/sidenav.css | 99 + .../modules/closure/sidenav/sidenav.js | 424 + .../closure/slider/slider-default-theme.css | 56 + .../modules/closure/slider/slider.css | 220 + .../modules/closure/slider/slider.js | 403 + .../modules/closure/sticky/sticky.css | 21 + .../modules/closure/sticky/sticky.js | 315 + .../closure/subheader/subheader-default-theme.css | 16 + .../modules/closure/subheader/subheader.css | 63 + .../modules/closure/subheader/subheader.js | 93 + .../modules/closure/swipe/swipe.js | 72 + .../closure/switch/switch-default-theme.css | 33 + .../modules/closure/switch/switch.css | 110 + .../modules/closure/switch/switch.js | 169 + .../modules/closure/tabs/tabs-arrow.svg | 7 + .../modules/closure/tabs/tabs-default-theme.css | 82 + .../angular-material/modules/closure/tabs/tabs.css | 272 + .../angular-material/modules/closure/tabs/tabs.js | 867 + .../closure/textField/textField-default-theme.css | 30 + .../modules/closure/textField/textField.css | 111 + .../modules/closure/textField/textField.js | 145 + .../modules/closure/toast/toast-default-theme.css | 18 + .../modules/closure/toast/toast.css | 119 + .../modules/closure/toast/toast.js | 265 + .../closure/toolbar/toolbar-default-theme.css | 20 + .../modules/closure/toolbar/toolbar.css | 83 + .../modules/closure/toolbar/toolbar.js | 169 + .../closure/tooltip/tooltip-default-theme.css | 11 + .../modules/closure/tooltip/tooltip.css | 72 + .../modules/closure/tooltip/tooltip.js | 267 + .../modules/closure/whiteframe/whiteframe.css | 25 + .../modules/closure/whiteframe/whiteframe.js | 15 + .../modules/css/angular-material-layout.css | 2375 + .../js/autocomplete/autocomplete-default-theme.css | 24 + .../autocomplete-default-theme.min.css | 6 + .../modules/js/autocomplete/autocomplete.css | 220 + .../modules/js/autocomplete/autocomplete.js | 794 + .../modules/js/autocomplete/autocomplete.min.css | 6 + .../modules/js/autocomplete/autocomplete.min.js | 7 + .../modules/js/autocomplete/bower.json | 8 + .../modules/js/backdrop/backdrop-default-theme.css | 9 + .../js/backdrop/backdrop-default-theme.min.css | 6 + .../modules/js/backdrop/backdrop.css | 59 + .../modules/js/backdrop/backdrop.js | 39 + .../modules/js/backdrop/backdrop.min.css | 6 + .../modules/js/backdrop/backdrop.min.js | 7 + .../modules/js/backdrop/bower.json | 7 + .../js/bottomSheet/bottomSheet-default-theme.css | 16 + .../bottomSheet/bottomSheet-default-theme.min.css | 6 + .../modules/js/bottomSheet/bottomSheet.css | 170 + .../modules/js/bottomSheet/bottomSheet.js | 267 + .../modules/js/bottomSheet/bottomSheet.min.css | 6 + .../modules/js/bottomSheet/bottomSheet.min.js | 7 + .../modules/js/bottomSheet/bower.json | 8 + .../angular-material/modules/js/button/bower.json | 7 + .../modules/js/button/button-default-theme.css | 94 + .../modules/js/button/button-default-theme.min.css | 6 + .../angular-material/modules/js/button/button.css | 158 + .../angular-material/modules/js/button/button.js | 136 + .../modules/js/button/button.min.css | 6 + .../modules/js/button/button.min.js | 7 + .../angular-material/modules/js/card/bower.json | 7 + .../modules/js/card/card-default-theme.css | 12 + .../modules/js/card/card-default-theme.min.css | 6 + .../angular-material/modules/js/card/card.css | 34 + .../angular-material/modules/js/card/card.js | 85 + .../angular-material/modules/js/card/card.min.css | 6 + .../angular-material/modules/js/card/card.min.js | 7 + .../modules/js/checkbox/bower.json | 7 + .../modules/js/checkbox/checkbox-default-theme.css | 47 + .../js/checkbox/checkbox-default-theme.min.css | 6 + .../modules/js/checkbox/checkbox.css | 125 + .../modules/js/checkbox/checkbox.js | 167 + .../modules/js/checkbox/checkbox.min.css | 6 + .../modules/js/checkbox/checkbox.min.js | 7 + .../angular-material/modules/js/chips/bower.json | 8 + .../modules/js/chips/chips-default-theme.css | 24 + .../modules/js/chips/chips-default-theme.min.css | 6 + .../angular-material/modules/js/chips/chips.css | 131 + .../angular-material/modules/js/chips/chips.js | 949 + .../modules/js/chips/chips.min.css | 6 + .../angular-material/modules/js/chips/chips.min.js | 7 + .../angular-material/modules/js/content/bower.json | 7 + .../modules/js/content/content-default-theme.css | 9 + .../js/content/content-default-theme.min.css | 6 + .../modules/js/content/content.css | 20 + .../angular-material/modules/js/content/content.js | 85 + .../modules/js/content/content.min.css | 6 + .../modules/js/content/content.min.js | 7 + .../angular-material/modules/js/core/bower.json | 8 + .../angular-material/modules/js/core/core.css | 2590 ++ .../angular-material/modules/js/core/core.js | 3779 ++ .../angular-material/modules/js/core/core.min.css | 6 + .../angular-material/modules/js/core/core.min.js | 10 + .../modules/js/core/default-theme.js | 4 + .../angular-material/modules/js/dialog/bower.json | 8 + .../modules/js/dialog/dialog-default-theme.css | 12 + .../modules/js/dialog/dialog-default-theme.min.css | 6 + .../angular-material/modules/js/dialog/dialog.css | 111 + .../angular-material/modules/js/dialog/dialog.js | 713 + .../modules/js/dialog/dialog.min.css | 6 + .../modules/js/dialog/dialog.min.js | 7 + .../angular-material/modules/js/divider/bower.json | 7 + .../modules/js/divider/divider-default-theme.css | 9 + .../js/divider/divider-default-theme.min.css | 6 + .../modules/js/divider/divider.css | 14 + .../angular-material/modules/js/divider/divider.js | 46 + .../modules/js/divider/divider.min.css | 6 + .../modules/js/divider/divider.min.js | 7 + .../modules/js/gridList/bower.json | 7 + .../modules/js/gridList/gridList.css | 68 + .../modules/js/gridList/gridList.js | 763 + .../modules/js/gridList/gridList.min.css | 6 + .../modules/js/gridList/gridList.min.js | 7 + .../angular-material/modules/js/icon/bower.json | 7 + .../modules/js/icon/icon-default-theme.css | 15 + .../modules/js/icon/icon-default-theme.min.css | 6 + .../angular-material/modules/js/icon/icon.css | 20 + .../angular-material/modules/js/icon/icon.js | 788 + .../angular-material/modules/js/icon/icon.min.css | 6 + .../angular-material/modules/js/icon/icon.min.js | 7 + .../angular-material/modules/js/input/bower.json | 7 + .../modules/js/input/input-default-theme.css | 46 + .../modules/js/input/input-default-theme.min.css | 6 + .../angular-material/modules/js/input/input.css | 162 + .../angular-material/modules/js/input/input.js | 372 + .../modules/js/input/input.min.css | 6 + .../angular-material/modules/js/input/input.min.js | 7 + .../angular-material/modules/js/list/bower.json | 7 + .../modules/js/list/list-default-theme.css | 23 + .../modules/js/list/list-default-theme.min.css | 6 + .../angular-material/modules/js/list/list.css | 147 + .../angular-material/modules/js/list/list.js | 274 + .../angular-material/modules/js/list/list.min.css | 6 + .../angular-material/modules/js/list/list.min.js | 7 + .../angular-material/modules/js/menu/bower.json | 5 + .../angular-material/modules/js/menu/menu.css | 6 + .../angular-material/modules/js/menu/menu.js | 27 + .../angular-material/modules/js/menu/menu.min.css | 6 + .../angular-material/modules/js/menu/menu.min.js | 7 + .../modules/js/progressCircular/bower.json | 7 + .../progressCircular-default-theme.css | 36 + .../progressCircular-default-theme.min.css | 6 + .../js/progressCircular/progressCircular.css | 1306 + .../js/progressCircular/progressCircular.js | 110 + .../js/progressCircular/progressCircular.min.css | 6 + .../js/progressCircular/progressCircular.min.js | 7 + .../modules/js/progressLinear/bower.json | 7 + .../progressLinear-default-theme.css | 27 + .../progressLinear-default-theme.min.css | 6 + .../modules/js/progressLinear/progressLinear.css | 287 + .../modules/js/progressLinear/progressLinear.js | 127 + .../js/progressLinear/progressLinear.min.css | 6 + .../js/progressLinear/progressLinear.min.js | 7 + .../modules/js/radioButton/bower.json | 7 + .../js/radioButton/radioButton-default-theme.css | 47 + .../radioButton/radioButton-default-theme.min.css | 6 + .../modules/js/radioButton/radioButton.css | 90 + .../modules/js/radioButton/radioButton.js | 313 + .../modules/js/radioButton/radioButton.min.css | 6 + .../modules/js/radioButton/radioButton.min.js | 7 + .../angular-material/modules/js/select/bower.json | 8 + .../modules/js/select/select-default-theme.css | 42 + .../modules/js/select/select-default-theme.min.css | 6 + .../angular-material/modules/js/select/select.css | 168 + .../angular-material/modules/js/select/select.js | 1056 + .../modules/js/select/select.min.css | 6 + .../modules/js/select/select.min.js | 7 + .../angular-material/modules/js/sidenav/bower.json | 8 + .../modules/js/sidenav/sidenav-default-theme.css | 9 + .../js/sidenav/sidenav-default-theme.min.css | 6 + .../modules/js/sidenav/sidenav.css | 99 + .../angular-material/modules/js/sidenav/sidenav.js | 424 + .../modules/js/sidenav/sidenav.min.css | 6 + .../modules/js/sidenav/sidenav.min.js | 7 + .../angular-material/modules/js/slider/bower.json | 7 + .../modules/js/slider/slider-default-theme.css | 56 + .../modules/js/slider/slider-default-theme.min.css | 6 + .../angular-material/modules/js/slider/slider.css | 220 + .../angular-material/modules/js/slider/slider.js | 404 + .../modules/js/slider/slider.min.css | 6 + .../modules/js/slider/slider.min.js | 7 + .../angular-material/modules/js/sticky/bower.json | 8 + .../angular-material/modules/js/sticky/sticky.css | 21 + .../angular-material/modules/js/sticky/sticky.js | 315 + .../modules/js/sticky/sticky.min.css | 6 + .../modules/js/sticky/sticky.min.js | 7 + .../modules/js/subheader/bower.json | 8 + .../js/subheader/subheader-default-theme.css | 16 + .../js/subheader/subheader-default-theme.min.css | 6 + .../modules/js/subheader/subheader.css | 63 + .../modules/js/subheader/subheader.js | 93 + .../modules/js/subheader/subheader.min.css | 6 + .../modules/js/subheader/subheader.min.js | 7 + .../angular-material/modules/js/swipe/bower.json | 7 + .../angular-material/modules/js/swipe/swipe.js | 73 + .../angular-material/modules/js/swipe/swipe.min.js | 7 + .../angular-material/modules/js/switch/bower.json | 8 + .../modules/js/switch/switch-default-theme.css | 33 + .../modules/js/switch/switch-default-theme.min.css | 6 + .../angular-material/modules/js/switch/switch.css | 110 + .../angular-material/modules/js/switch/switch.js | 169 + .../modules/js/switch/switch.min.css | 6 + .../modules/js/switch/switch.min.js | 7 + .../angular-material/modules/js/tabs/bower.json | 8 + .../modules/js/tabs/tabs-default-theme.css | 82 + .../modules/js/tabs/tabs-default-theme.min.css | 6 + .../angular-material/modules/js/tabs/tabs.css | 272 + .../angular-material/modules/js/tabs/tabs.js | 867 + .../angular-material/modules/js/tabs/tabs.min.css | 6 + .../angular-material/modules/js/tabs/tabs.min.js | 7 + .../modules/js/textField/bower.json | 7 + .../js/textField/textField-default-theme.css | 30 + .../js/textField/textField-default-theme.min.css | 6 + .../modules/js/textField/textField.css | 111 + .../modules/js/textField/textField.js | 143 + .../modules/js/textField/textField.min.css | 6 + .../modules/js/textField/textField.min.js | 7 + .../angular-material/modules/js/toast/bower.json | 8 + .../modules/js/toast/toast-default-theme.css | 18 + .../modules/js/toast/toast-default-theme.min.css | 6 + .../angular-material/modules/js/toast/toast.css | 119 + .../angular-material/modules/js/toast/toast.js | 265 + .../modules/js/toast/toast.min.css | 6 + .../angular-material/modules/js/toast/toast.min.js | 7 + .../angular-material/modules/js/toolbar/bower.json | 8 + .../modules/js/toolbar/toolbar-default-theme.css | 20 + .../js/toolbar/toolbar-default-theme.min.css | 6 + .../modules/js/toolbar/toolbar.css | 83 + .../angular-material/modules/js/toolbar/toolbar.js | 169 + .../modules/js/toolbar/toolbar.min.css | 6 + .../modules/js/toolbar/toolbar.min.js | 7 + .../angular-material/modules/js/tooltip/bower.json | 7 + .../modules/js/tooltip/tooltip-default-theme.css | 11 + .../js/tooltip/tooltip-default-theme.min.css | 6 + .../modules/js/tooltip/tooltip.css | 72 + .../angular-material/modules/js/tooltip/tooltip.js | 268 + .../modules/js/tooltip/tooltip.min.css | 6 + .../modules/js/tooltip/tooltip.min.js | 7 + .../modules/js/whiteframe/bower.json | 5 + .../modules/js/whiteframe/whiteframe.css | 25 + .../modules/js/whiteframe/whiteframe.js | 16 + .../modules/js/whiteframe/whiteframe.min.css | 6 + .../modules/js/whiteframe/whiteframe.min.js | 7 + .../bower_components/angular-material/package.json | 48 + .../bower_components/angular-messages/.bower.json | 20 + .../bower_components/angular-messages/LICENSE.md | 21 + .../bower_components/angular-messages/README.md | 68 + .../angular-messages/angular-messages.js | 739 + .../angular-messages/angular-messages.min.js | 12 + .../angular-messages/angular-messages.min.js.map | 8 + .../bower_components/angular-messages/bower.json | 10 + .../bower_components/angular-messages/index.js | 2 + .../bower_components/angular-messages/package.json | 32 + .../bower_components/angular-mocks/.bower.json | 20 + .../bower_components/angular-mocks/LICENSE.md | 21 + .../bower_components/angular-mocks/README.md | 63 + .../angular-mocks/angular-mocks.js | 3170 ++ .../bower_components/angular-mocks/bower.json | 10 + .../angular-mocks/ngAnimateMock.js | 2 + .../bower_components/angular-mocks/ngMock.js | 2 + .../bower_components/angular-mocks/ngMockE2E.js | 2 + .../bower_components/angular-mocks/package.json | 34 + .../bower_components/angular-resource/.bower.json | 20 + .../bower_components/angular-resource/README.md | 68 + .../angular-resource/angular-resource.js | 768 + .../angular-resource/angular-resource.min.js | 15 + .../angular-resource/angular-resource.min.js.map | 8 + .../bower_components/angular-resource/bower.json | 10 + .../bower_components/angular-resource/index.js | 2 + .../bower_components/angular-resource/package.json | 26 + .../bower_components/angular-route/.bower.json | 20 + .../bower_components/angular-route/README.md | 68 + .../angular-route/angular-route.js | 1016 + .../angular-route/angular-route.min.js | 15 + .../angular-route/angular-route.min.js.map | 8 + .../bower_components/angular-route/bower.json | 10 + .../client/bower_components/angular-route/index.js | 2 + .../bower_components/angular-route/package.json | 26 + .../bower_components/angular-sanitize/.bower.json | 20 + .../bower_components/angular-sanitize/README.md | 68 + .../angular-sanitize/angular-sanitize.js | 717 + .../angular-sanitize/angular-sanitize.min.js | 15 + .../angular-sanitize/angular-sanitize.min.js.map | 8 + .../bower_components/angular-sanitize/bower.json | 10 + .../bower_components/angular-sanitize/index.js | 2 + .../bower_components/angular-sanitize/package.json | 26 + .../bower_components/angular-scenario/.bower.json | 20 + .../bower_components/angular-scenario/LICENSE.md | 21 + .../bower_components/angular-scenario/README.md | 61 + .../angular-scenario/angular-scenario.js | 44994 +++++++++++++++++++ .../bower_components/angular-scenario/bower.json | 10 + .../jstd-scenario-adapter-config.js | 6 + .../angular-scenario/jstd-scenario-adapter.js | 185 + .../bower_components/angular-scenario/package.json | 33 + .../angular-smart-table/.bower.json | 38 + .../angular-smart-table/.gitignore | 7 + .../angular-smart-table/.travis.yml | 12 + .../angular-smart-table/ISSUE_TEMPLATE.md | 15 + .../angular-smart-table/bower.json | 29 + .../angular-smart-table/changeLog.md | 175 + .../angular-smart-table/dist/smart-table.js | 534 + .../angular-smart-table/dist/smart-table.min.js | 6 + .../dist/smart-table.min.js.map | 1 + .../angular-smart-table/gulpFile.js | 60 + .../bower_components/angular-smart-table/index.js | 2 + .../angular-smart-table/package.json | 29 + .../bower_components/angular-smart-table/readme.md | 72 + .../angular-smart-table/src/bottom.txt | 1 + .../angular-smart-table/src/smart-table.module.js | 7 + .../angular-smart-table/src/stConfig.js | 26 + .../angular-smart-table/src/stPagination.js | 80 + .../angular-smart-table/src/stPipe.js | 36 + .../angular-smart-table/src/stSearch.js | 43 + .../angular-smart-table/src/stSelectRow.js | 26 + .../angular-smart-table/src/stSort.js | 82 + .../angular-smart-table/src/stTable.js | 219 + .../angular-smart-table/src/top.txt | 2 + .../bower_components/angular-ui-router/.bower.json | 34 + .../angular-ui-router/CHANGELOG.md | 316 + .../angular-ui-router/CONTRIBUTING.md | 65 + .../bower_components/angular-ui-router/LICENSE | 21 + .../bower_components/angular-ui-router/README.md | 252 + .../bower_components/angular-ui-router/bower.json | 24 + .../angular-ui-router/release/angular-ui-router.js | 4539 ++ .../release/angular-ui-router.min.js | 8 + .../angular-ui-router/src/common.js | 293 + .../angular-ui-router/src/resolve.js | 252 + .../angular-ui-router/src/state.js | 1470 + .../angular-ui-router/src/stateDirectives.js | 391 + .../angular-ui-router/src/stateFilters.js | 39 + .../angular-ui-router/src/templateFactory.js | 110 + .../angular-ui-router/src/urlMatcherFactory.js | 1081 + .../angular-ui-router/src/urlRouter.js | 431 + .../bower_components/angular-ui-router/src/view.js | 45 + .../angular-ui-router/src/viewDirective.js | 351 + .../angular-ui-router/src/viewScroll.js | 52 + .../bower_components/angular-uuid/.bower.json | 23 + .../client/bower_components/angular-uuid/LICENCE | 19 + .../bower_components/angular-uuid/bower.json | 13 + .../client/bower_components/angular-uuid/uuid.js | 21 + .../bower_components/angular-uuid/uuid.min.js | 7 + .../client/bower_components/angular/.bower.json | 18 + .../client/bower_components/angular/README.md | 64 + .../bower_components/angular/angular-csp.css | 21 + .../client/bower_components/angular/angular.js | 30428 +++++++++++++ .../client/bower_components/angular/angular.min.js | 307 + .../bower_components/angular/angular.min.js.gzip | Bin 0 -> 54462 bytes .../bower_components/angular/angular.min.js.map | 8 + .../client/bower_components/angular/bower.json | 9 + .../client/bower_components/angular/index.js | 2 + .../client/bower_components/angular/package.json | 25 + .../client/bower_components/es5-shim/.bower.json | 43 + .../client/bower_components/es5-shim/CHANGES | 404 + .../bower_components/es5-shim/CONTRIBUTORS.md | 27 + .../client/bower_components/es5-shim/LICENSE | 22 + .../client/bower_components/es5-shim/Makefile | 63 + .../client/bower_components/es5-shim/README.md | 190 + .../client/bower_components/es5-shim/bower.json | 33 + .../bower_components/es5-shim/component.json | 19 + .../client/bower_components/es5-shim/es5-sham.js | 563 + .../client/bower_components/es5-shim/es5-sham.map | 1 + .../bower_components/es5-shim/es5-sham.min.js | 7 + .../client/bower_components/es5-shim/es5-shim.js | 2065 + .../client/bower_components/es5-shim/es5-shim.map | 1 + .../bower_components/es5-shim/es5-shim.min.js | 7 + .../client/bower_components/es5-shim/package.json | 75 + .../client/bower_components/es5-shim/shims.json | 7 + .../client/bower_components/hammerjs/.bower.json | 27 + .../client/bower_components/hammerjs/CHANGELOG.md | 54 + .../bower_components/hammerjs/CONTRIBUTING.md | 41 + .../client/bower_components/hammerjs/LICENSE.md | 21 + .../client/bower_components/hammerjs/README.md | 51 + .../client/bower_components/hammerjs/bower.json | 16 + .../client/bower_components/hammerjs/changelog.js | 71 + .../client/bower_components/hammerjs/hammer.js | 2643 ++ .../client/bower_components/hammerjs/hammer.min.js | 7 + .../bower_components/hammerjs/hammer.min.js.map | 1 + .../bower_components/hammerjs/hammer.min.map | 1 + .../client/bower_components/jqTree/.bower.json | 28 + .../client/bower_components/jqTree/.editorconfig | 12 + .../client/bower_components/jqTree/.gitignore | 2 + .../client/bower_components/jqTree/.travis.yml | 12 + .../client/bower_components/jqTree/LICENSE | 202 + .../client/bower_components/jqTree/README.md | 63 + .../client/bower_components/jqTree/_config.yml | 18 + .../bower_components/jqTree/_entries/01_general.md | 7 + .../jqTree/_entries/02_introduction.md | 9 + .../jqTree/_entries/03_features.md | 15 + .../bower_components/jqTree/_entries/04_demo.html | 34 + .../jqTree/_entries/05_requirements.md | 6 + .../jqTree/_entries/06_downloads.md | 9 + .../jqTree/_entries/07_tutorial.md | 77 + .../jqTree/_entries/08_examples.md | 8 + .../jqTree/_entries/09_usecases.md | 17 + .../jqTree/_entries/10_changelog.md | 233 + .../bower_components/jqTree/_entries/11_options.md | 6 + .../jqTree/_entries/12_autoescape.md | 6 + .../jqTree/_entries/13_autoopen.md | 28 + .../jqTree/_entries/14_buttonleft.md | 12 + .../jqTree/_entries/15_closedicon.md | 12 + .../bower_components/jqTree/_entries/16_data.md | 46 + .../jqTree/_entries/17_datafilter.md | 17 + .../jqTree/_entries/18_data-url.md | 45 + .../jqTree/_entries/19_draganddrop.md | 18 + .../jqTree/_entries/20_keyboardsupport.md | 14 + .../jqTree/_entries/21_oncanmove.md | 22 + .../jqTree/_entries/22_oncanmoveto.md | 22 + .../jqTree/_entries/23_oncanselectnode.md | 26 + .../jqTree/_entries/24_oncreateli.md | 16 + .../jqTree/_entries/25_onismovehandle.md | 17 + .../jqTree/_entries/26_onloadfailed.md | 15 + .../jqTree/_entries/27_onloading.md | 22 + .../jqTree/_entries/28_openedicon.md | 12 + .../jqTree/_entries/29_openfolderdelay.md | 13 + .../bower_components/jqTree/_entries/30_rtl.md | 18 + .../jqTree/_entries/31_savestate.md | 42 + .../jqTree/_entries/32_selectable.md | 18 + .../bower_components/jqTree/_entries/33_slide.md | 12 + .../jqTree/_entries/34_usecontextmenu.md | 14 + .../jqTree/_entries/35_functions.md | 6 + .../jqTree/_entries/36_addnodeafter.md | 20 + .../jqTree/_entries/36a_addparentnode.md | 20 + .../jqTree/_entries/37_addnodebefore.md | 8 + .../jqTree/_entries/38_appendnode.md | 50 + .../jqTree/_entries/39_closenode.md | 23 + .../bower_components/jqTree/_entries/40_destroy.md | 12 + .../jqTree/_entries/41_getnodebycallback.md | 24 + .../jqTree/_entries/42_getnodebyid.md | 21 + .../jqTree/_entries/43_getnodebyhtmlelement.md | 29 + .../jqTree/_entries/44_getselectednode.md | 10 + .../jqTree/_entries/45_getstate.md | 19 + .../bower_components/jqTree/_entries/46_gettree.md | 12 + .../jqTree/_entries/47_loaddata.md | 46 + .../jqTree/_entries/48_loaddatafromurl.md | 55 + .../jqTree/_entries/49_movedown.md | 8 + .../jqTree/_entries/50_movenode.md | 15 + .../bower_components/jqTree/_entries/51_moveup.md | 8 + .../jqTree/_entries/52_opennode.md | 44 + .../bower_components/jqTree/_entries/53_reload.md | 22 + .../jqTree/_entries/54_removenode.md | 12 + .../jqTree/_entries/55_selectnode.md | 24 + .../jqTree/_entries/56_scrolltonode.md | 13 + .../jqTree/_entries/57_setoption.md | 12 + .../jqTree/_entries/58_setstate.md | 8 + .../bower_components/jqTree/_entries/59_toggle.md | 8 + .../bower_components/jqTree/_entries/60_tojson.md | 13 + .../jqTree/_entries/61_updatenode.md | 50 + .../bower_components/jqTree/_entries/62_events.md | 6 + .../jqTree/_entries/63_tree-click.md | 37 + .../jqTree/_entries/64_tree-close.md | 15 + .../jqTree/_entries/65_tree-contextmenu.md | 21 + .../jqTree/_entries/66_tree-dblclick.md | 19 + .../jqTree/_entries/67_tree-init.md | 15 + .../jqTree/_entries/68_tree-move.md | 73 + .../jqTree/_entries/69_tree-open.md | 15 + .../jqTree/_entries/70_tree-select.md | 28 + .../jqTree/_entries/71_multiple-selection.md | 9 + .../jqTree/_entries/72_add-to-selection.md | 11 + .../jqTree/_entries/73_get-selected-nodes.md | 10 + .../jqTree/_entries/74_is-node-selected.md | 11 + .../jqTree/_entries/75_remove-from-selection.md | 11 + .../jqTree/_entries/76_node-functions.md | 13 + .../jqTree/_entries/77_children.md | 12 + .../bower_components/jqTree/_entries/78_getdata.md | 17 + .../jqTree/_entries/79_getlevel.md | 13 + .../jqTree/_entries/80_getnextnode.md | 12 + .../jqTree/_entries/81_getnextsibling.md | 10 + .../jqTree/_entries/82_getpreviousnode.md | 12 + .../jqTree/_entries/83_getprevioussibling.md | 10 + .../bower_components/jqTree/_entries/84_parent.md | 10 + .../bower_components/jqTree/_entries/insert.py | 46 + .../bower_components/jqTree/_entries/renumber.py | 38 + .../jqTree/_examples/01_load_json_data.html | 47 + .../_examples/02_load_json_data_from_server.html | 31 + .../jqTree/_examples/03_drag_and_drop.html | 44 + .../jqTree/_examples/04_save_state.html | 52 + .../jqTree/_examples/05_load_on_demand.html | 70 + .../jqTree/_examples/06_autoescape.html | 47 + .../jqTree/_examples/07_autoscroll.html | 49 + .../jqTree/_examples/08_multiple_select.html | 72 + .../jqTree/_examples/09_custom_html.html | 68 + .../jqTree/_examples/10_icon_buttons.html | 28 + .../jqTree/_examples/11_right-to-left.html | 27 + .../jqTree/_examples/12_button_on_right.html | 27 + .../bower_components/jqTree/_layouts/base.html | 49 + .../jqTree/_layouts/frontpage.html | 20 + .../bower_components/jqTree/_layouts/page.html | 7 + .../client/bower_components/jqTree/bower.json | 18 + .../client/bower_components/jqTree/coffeelint.json | 122 + .../client/bower_components/jqTree/gulpfile.coffee | 57 + .../client/bower_components/jqTree/gulpfile.js | 2 + .../client/bower_components/jqTree/index.html | 48 + .../bower_components/jqTree/jqtree-circle.png | Bin 0 -> 239 bytes .../client/bower_components/jqTree/jqtree.css | 132 + .../bower_components/jqTree/jqtree.jquery.json | 23 + .../client/bower_components/jqTree/jqtree.scss | 197 + .../client/bower_components/jqTree/karma.conf.js | 59 + .../jqTree/lib/drag_and_drop_handler.js | 489 + .../jqTree/lib/elements_renderer.js | 220 + .../bower_components/jqTree/lib/key_handler.js | 120 + .../bower_components/jqTree/lib/mouse.widget.js | 191 + .../client/bower_components/jqTree/lib/node.js | 588 + .../bower_components/jqTree/lib/node_element.js | 226 + .../jqTree/lib/save_state_handler.js | 238 + .../bower_components/jqTree/lib/scroll_handler.js | 137 + .../jqTree/lib/select_node_handler.js | 111 + .../bower_components/jqTree/lib/simple.widget.js | 125 + .../bower_components/jqTree/lib/tree.jquery.js | 1101 + .../client/bower_components/jqTree/lib/util.js | 49 + .../client/bower_components/jqTree/lib/version.js | 1 + .../client/bower_components/jqTree/package.json | 51 + .../bower_components/jqTree/phantomjs/runner.js | 193 + .../bower_components/jqTree/phantomjs/server.js | 14 + .../client/bower_components/jqTree/screenshot.png | Bin 0 -> 31319 bytes .../client/bower_components/jqTree/sitemap.txt | 13 + .../jqTree/src/drag_and_drop_handler.coffee | 491 + .../jqTree/src/elements_renderer.coffee | 237 + .../client/bower_components/jqTree/src/header.txt | 17 + .../bower_components/jqTree/src/key_handler.coffee | 107 + .../jqTree/src/mouse.widget.coffee | 184 + .../client/bower_components/jqTree/src/node.coffee | 490 + .../jqTree/src/node_element.coffee | 170 + .../jqTree/src/save_state_handler.coffee | 208 + .../jqTree/src/scroll_handler.coffee | 114 + .../jqTree/src/select_node_handler.coffee | 84 + .../jqTree/src/simple.widget.coffee | 107 + .../bower_components/jqTree/src/tree.jquery.coffee | 918 + .../client/bower_components/jqTree/src/util.coffee | 48 + .../bower_components/jqTree/src/version.coffee | 1 + .../bower_components/jqTree/src_test/karma-test.js | 17 + .../bower_components/jqTree/src_test/test.js | 5 + .../jqTree/src_test/test_jqtree.js | 1390 + .../bower_components/jqTree/src_test/test_tree.js | 726 + .../bower_components/jqTree/src_test/test_util.js | 34 + .../jqTree/src_test/utils_for_test.js | 107 + .../bower_components/jqTree/static/bower.json | 16 + .../bower_components/blanket/dist/qunit/blanket.js | 5299 +++ .../bootstrap/dist/css/bootstrap-theme.min.css | 6 + .../bootstrap/dist/css/bootstrap.min.css | 6 + .../dist/fonts/glyphicons-halflings-regular.eot | Bin 0 -> 20127 bytes .../dist/fonts/glyphicons-halflings-regular.svg | 288 + .../dist/fonts/glyphicons-halflings-regular.ttf | Bin 0 -> 45404 bytes .../dist/fonts/glyphicons-halflings-regular.woff | Bin 0 -> 23424 bytes .../dist/fonts/glyphicons-halflings-regular.woff2 | Bin 0 -> 18028 bytes .../bootstrap/dist/js/bootstrap.min.js | 7 + .../fontawesome/css/font-awesome.min.css | 4 + .../fontawesome/fonts/FontAwesome.otf | Bin 0 -> 134808 bytes .../fontawesome/fonts/fontawesome-webfont.eot | Bin 0 -> 165742 bytes .../fontawesome/fonts/fontawesome-webfont.svg | 2671 ++ .../fontawesome/fonts/fontawesome-webfont.ttf | Bin 0 -> 165548 bytes .../fontawesome/fonts/fontawesome-webfont.woff | Bin 0 -> 98024 bytes .../fontawesome/fonts/fontawesome-webfont.woff2 | Bin 0 -> 77160 bytes .../bower_components/jquery-1/dist/jquery.js | 11008 +++++ .../bower_components/jquery-1/dist/jquery.min.js | 5 + .../bower_components/jquery-2/dist/jquery.js | 9814 ++++ .../bower_components/jquery-2/dist/jquery.min.js | 4 + .../jquery-cookie/jquery.cookie.js | 117 + .../jquery-mockjax/dist/jquery.mockjax.js | 1003 + .../static/bower_components/jquery/dist/jquery.js | 10220 +++++ .../bower_components/jquery/dist/jquery.min.js | 4 + .../static/bower_components/json3/lib/json3.js | 902 + .../bower_components/pygments/css/monokai.css | 65 + .../static/bower_components/qunit/qunit/qunit.css | 431 + .../static/bower_components/qunit/qunit/qunit.js | 4366 ++ .../jqTree/static/documentation.css | 171 + .../jqTree/static/documentation.js | 51 + .../bower_components/jqTree/static/example.css | 60 + .../bower_components/jqTree/static/example.scss | 86 + .../bower_components/jqTree/static/example_data.js | 128 + .../jqTree/static/examples/autoescape.js | 19 + .../jqTree/static/examples/autoscroll.js | 8 + .../jqTree/static/examples/button-on-right.js | 15 + .../jqTree/static/examples/custom_html.js | 32 + .../jqTree/static/examples/drag_and_drop.js | 15 + .../jqTree/static/examples/icon_buttons.js | 14 + .../jqTree/static/examples/load_json_data.js | 21 + .../static/examples/load_json_data_from_server.js | 11 + .../jqTree/static/examples/load_on_demand.js | 20 + .../jqTree/static/examples/multiple_select.js | 27 + .../jqTree/static/examples/right-to-left.js | 13 + .../jqTree/static/examples/save_state.js | 13 + .../bower_components/jqTree/static/spinner.gif | Bin 0 -> 673 bytes .../client/bower_components/jqTree/test/test.html | 24 + .../bower_components/jqTree/test/test_build.js | 3267 ++ .../jqTree/test/test_jquery_1.html | 16 + .../jqTree/test/test_jquery_2.html | 16 + .../client/bower_components/jqTree/tree.jquery.js | 3640 ++ .../bower_components/jquery-mousewheel/.bower.json | 27 + .../jquery-mousewheel/ChangeLog.md | 147 + .../bower_components/jquery-mousewheel/LICENSE.txt | 37 + .../bower_components/jquery-mousewheel/README.md | 76 + .../bower_components/jquery-mousewheel/bower.json | 17 + .../jquery-mousewheel/jquery.mousewheel.js | 221 + .../jquery-mousewheel/jquery.mousewheel.min.js | 8 + .../jquery.event.drag-new/.bower.json | 13 + .../event.drag/jquery.event.drag.js | 402 + .../event.drag/jquery.event.drag.live.js | 87 + .../event.drag/test/binding.js | 64 + .../event.drag/test/handlers.js | 160 + .../event.drag/test/index.html | 28 + .../event.drag/test/interaction.js | 198 + .../jquery.event.drag-new/event.drag/test/live.js | 41 + .../event.drag/test/method.js | 64 + .../event.drag/test/properties.js | 71 + .../event.drag/test/requirements.js | 24 + .../jquery.event.drag-new/event.drag/test/touch.js | 206 + .../event.drop/jquery.event.drop.js | 302 + .../event.drop/jquery.event.drop.live.js | 93 + .../event.drop/test/binding.js | 32 + .../event.drop/test/handlers.js | 130 + .../event.drop/test/index.html | 32 + .../event.drop/test/interaction.js | 134 + .../jquery.event.drag-new/event.drop/test/live.js | 60 + .../event.drop/test/method.js | 63 + .../event.drop/test/properties.js | 62 + .../event.drop/test/requirements.js | 37 + .../event.drop/test/tolerance.js | 189 + .../jquery.event.drag-new/event.drop/test/touch.js | 140 + .../event.keyend/jquery.event.keyend.js | 20 + .../event.linger/jquery.event.linger.js | 190 + .../event.linger/test/binding.js | 45 + .../event.linger/test/handlers.js | 111 + .../event.linger/test/index.html | 24 + .../event.linger/test/interaction.js | 231 + .../event.linger/test/method.js | 43 + .../event.linger/test/requirements.js | 23 + .../event.wheel/jquery.event.wheel.js | 50 + .../jquery.event.drag-new/fire/jquery.fire.js | 171 + .../jquery.event.drag-new/fire/test/custom.js | 61 + .../jquery.event.drag-new/fire/test/form.js | 50 + .../jquery.event.drag-new/fire/test/index.html | 26 + .../jquery.event.drag-new/fire/test/key.js | 52 + .../jquery.event.drag-new/fire/test/mouse.js | 54 + .../jquery.event.drag-new/fire/test/mutation.js | 52 + .../jquery.event.drag-new/fire/test/object.js | 50 + .../fire/test/requirements.js | 26 + .../jquery.event.drag-new/fire/test/touch.js | 61 + .../jquery.event.drag-new/jquery/jquery-1.4.2.js | 6240 +++ .../jquery.event.drag-new/jquery/jquery-1.4.4.js | 7179 +++ .../jquery.event.drag-new/jquery/jquery-1.5b1.js | 8068 ++++ .../jquery.event.drag-new/jquery/jquery-1.7.2.js | 9404 ++++ .../jquery.event.drag-new/jquery/jquery.js | 9404 ++++ .../jquery.event.drag-new/jquery/qunit.css | 118 + .../jquery.event.drag-new/jquery/qunit.js | 1069 + .../bower_components/jquery.newstape/.bower.json | 34 + .../bower_components/jquery.newstape/bower.json | 24 + .../jquery.newstape/dist/jquery.newstape.min.js | 1 + .../bower_components/jquery.newstape/gulpfile.js | 22 + .../jquery.newstape/jquery.newstape.js | 135 + .../bower_components/jquery.newstape/package.json | 8 + .../bower_components/jquery.newstape/readme.md | 99 + .../client/bower_components/jquery/.bower.json | 25 + .../client/bower_components/jquery/AUTHORS.txt | 278 + .../client/bower_components/jquery/LICENSE.txt | 36 + .../client/bower_components/jquery/README.md | 65 + .../client/bower_components/jquery/bower.json | 14 + .../client/bower_components/jquery/dist/jquery.js | 9814 ++++ .../bower_components/jquery/dist/jquery.min.js | 4 + .../bower_components/jquery/dist/jquery.min.map | 1 + .../jquery/external/sizzle/LICENSE.txt | 36 + .../jquery/external/sizzle/dist/sizzle.js | 2143 + .../jquery/external/sizzle/dist/sizzle.min.js | 3 + .../jquery/external/sizzle/dist/sizzle.min.map | 1 + .../client/bower_components/jquery/src/.jshintrc | 29 + .../client/bower_components/jquery/src/ajax.js | 845 + .../bower_components/jquery/src/ajax/jsonp.js | 100 + .../bower_components/jquery/src/ajax/load.js | 83 + .../bower_components/jquery/src/ajax/parseJSON.js | 13 + .../bower_components/jquery/src/ajax/parseXML.js | 27 + .../bower_components/jquery/src/ajax/script.js | 68 + .../jquery/src/ajax/var/location.js | 3 + .../bower_components/jquery/src/ajax/var/nonce.js | 5 + .../bower_components/jquery/src/ajax/var/rquery.js | 3 + .../client/bower_components/jquery/src/ajax/xhr.js | 167 + .../bower_components/jquery/src/attributes.js | 11 + .../bower_components/jquery/src/attributes/attr.js | 142 + .../jquery/src/attributes/classes.js | 177 + .../bower_components/jquery/src/attributes/prop.js | 125 + .../jquery/src/attributes/support.js | 36 + .../bower_components/jquery/src/attributes/val.js | 177 + .../bower_components/jquery/src/callbacks.js | 232 + .../client/bower_components/jquery/src/core.js | 494 + .../bower_components/jquery/src/core/access.js | 65 + .../bower_components/jquery/src/core/init.js | 134 + .../bower_components/jquery/src/core/parseHTML.js | 41 + .../bower_components/jquery/src/core/ready.js | 103 + .../jquery/src/core/var/rsingleTag.js | 5 + .../client/bower_components/jquery/src/css.js | 502 + .../jquery/src/css/addGetHookIf.js | 24 + .../bower_components/jquery/src/css/adjustCSS.js | 65 + .../bower_components/jquery/src/css/curCSS.js | 60 + .../jquery/src/css/defaultDisplay.js | 72 + .../jquery/src/css/hiddenVisibleSelectors.js | 18 + .../bower_components/jquery/src/css/showHide.js | 48 + .../bower_components/jquery/src/css/support.js | 121 + .../jquery/src/css/var/cssExpand.js | 3 + .../jquery/src/css/var/getStyles.js | 15 + .../jquery/src/css/var/isHidden.js | 16 + .../bower_components/jquery/src/css/var/rmargin.js | 3 + .../jquery/src/css/var/rnumnonpx.js | 5 + .../bower_components/jquery/src/css/var/swap.js | 24 + .../client/bower_components/jquery/src/data.js | 187 + .../bower_components/jquery/src/data/Data.js | 200 + .../jquery/src/data/var/acceptData.js | 18 + .../jquery/src/data/var/dataPriv.js | 5 + .../jquery/src/data/var/dataUser.js | 5 + .../client/bower_components/jquery/src/deferred.js | 158 + .../bower_components/jquery/src/deprecated.js | 32 + .../bower_components/jquery/src/dimensions.js | 54 + .../client/bower_components/jquery/src/effects.js | 629 + .../bower_components/jquery/src/effects/Tween.js | 121 + .../jquery/src/effects/animatedSelector.js | 13 + .../client/bower_components/jquery/src/event.js | 711 + .../bower_components/jquery/src/event/ajax.js | 20 + .../bower_components/jquery/src/event/alias.js | 27 + .../bower_components/jquery/src/event/focusin.js | 53 + .../bower_components/jquery/src/event/support.js | 9 + .../bower_components/jquery/src/event/trigger.js | 183 + .../bower_components/jquery/src/exports/amd.js | 24 + .../bower_components/jquery/src/exports/global.js | 26 + .../client/bower_components/jquery/src/intro.js | 44 + .../client/bower_components/jquery/src/jquery.js | 37 + .../bower_components/jquery/src/manipulation.js | 481 + .../jquery/src/manipulation/_evalUrl.js | 20 + .../jquery/src/manipulation/buildFragment.js | 102 + .../jquery/src/manipulation/getAll.js | 21 + .../jquery/src/manipulation/setGlobalEval.js | 20 + .../jquery/src/manipulation/support.js | 33 + .../jquery/src/manipulation/var/rcheckableType.js | 3 + .../jquery/src/manipulation/var/rscriptType.js | 3 + .../jquery/src/manipulation/var/rtagName.js | 3 + .../jquery/src/manipulation/wrapMap.js | 27 + .../client/bower_components/jquery/src/offset.js | 218 + .../client/bower_components/jquery/src/outro.js | 2 + .../client/bower_components/jquery/src/queue.js | 143 + .../bower_components/jquery/src/queue/delay.js | 22 + .../bower_components/jquery/src/selector-native.js | 211 + .../bower_components/jquery/src/selector-sizzle.js | 14 + .../client/bower_components/jquery/src/selector.js | 1 + .../bower_components/jquery/src/serialize.js | 125 + .../bower_components/jquery/src/traversing.js | 175 + .../jquery/src/traversing/findFilter.js | 100 + .../jquery/src/traversing/var/dir.js | 20 + .../jquery/src/traversing/var/rneedsContext.js | 6 + .../jquery/src/traversing/var/siblings.js | 15 + .../client/bower_components/jquery/src/var/arr.js | 3 + .../bower_components/jquery/src/var/class2type.js | 5 + .../bower_components/jquery/src/var/concat.js | 5 + .../bower_components/jquery/src/var/document.js | 3 + .../jquery/src/var/documentElement.js | 5 + .../bower_components/jquery/src/var/hasOwn.js | 5 + .../bower_components/jquery/src/var/indexOf.js | 5 + .../client/bower_components/jquery/src/var/pnum.js | 3 + .../client/bower_components/jquery/src/var/push.js | 5 + .../bower_components/jquery/src/var/rcssNum.js | 7 + .../bower_components/jquery/src/var/rnotwhite.js | 3 + .../bower_components/jquery/src/var/slice.js | 5 + .../bower_components/jquery/src/var/support.js | 5 + .../bower_components/jquery/src/var/toString.js | 5 + .../client/bower_components/jquery/src/wrap.js | 79 + .../client/bower_components/json3/.bower.json | 47 + .../client/bower_components/json3/CHANGELOG.md | 44 + .../client/bower_components/json3/CONTRIBUTING.md | 3 + .../client/bower_components/json3/LICENSE | 20 + .../client/bower_components/json3/README.md | 152 + .../client/bower_components/json3/bower.json | 38 + .../client/bower_components/json3/lib/json3.js | 902 + .../client/bower_components/json3/lib/json3.min.js | 17 + .../client/bower_components/lodash/.bower.json | 14 + .../client/bower_components/lodash/.editorconfig | 12 + .../client/bower_components/lodash/.gitattributes | 1 + .../lodash/.github/CONTRIBUTING.md | 78 + .../client/bower_components/lodash/.gitignore | 9 + .../client/bower_components/lodash/.jscsrc | 97 + .../lodash/.markdown-doctest-setup.js | 48 + .../client/bower_components/lodash/.travis.yml | 86 + .../client/bower_components/lodash/LICENSE | 47 + .../client/bower_components/lodash/README.md | 46 + .../bower_components/lodash/dist/lodash.core.js | 3830 ++ .../lodash/dist/lodash.core.min.js | 28 + .../bower_components/lodash/dist/lodash.fp.js | 879 + .../bower_components/lodash/dist/lodash.fp.min.js | 17 + .../client/bower_components/lodash/dist/lodash.js | 16404 +++++++ .../bower_components/lodash/dist/lodash.min.js | 127 + .../bower_components/lodash/dist/mapping.fp.js | 371 + .../client/bower_components/lodash/doc/README.md | 10897 +++++ .../bower_components/lodash/fp/_baseConvert.js | 466 + .../bower_components/lodash/fp/_convertBrowser.js | 18 + .../client/bower_components/lodash/fp/_mapping.js | 309 + .../bower_components/lodash/fp/placeholder.js | 6 + .../bower_components/lodash/lib/common/file.js | 71 + .../bower_components/lodash/lib/common/mapping.js | 9 + .../bower_components/lodash/lib/common/minify.js | 39 + .../lodash/lib/common/uglify.options.js | 23 + .../bower_components/lodash/lib/common/util.js | 27 + .../bower_components/lodash/lib/fp/build-dist.js | 55 + .../bower_components/lodash/lib/fp/build-doc.js | 65 + .../lodash/lib/fp/build-modules.js | 120 + .../lodash/lib/fp/template/doc/wiki.jst | 227 + .../lib/fp/template/modules/_falseOptions.jst | 7 + .../lodash/lib/fp/template/modules/_util.jst | 14 + .../lodash/lib/fp/template/modules/alias.jst | 1 + .../lodash/lib/fp/template/modules/category.jst | 2 + .../lodash/lib/fp/template/modules/convert.jst | 18 + .../lodash/lib/fp/template/modules/fp.jst | 2 + .../lodash/lib/fp/template/modules/module.jst | 5 + .../lodash/lib/fp/template/modules/thru.jst | 5 + .../bower_components/lodash/lib/main/build-dist.js | 30 + .../bower_components/lodash/lib/main/build-doc.js | 55 + .../lodash/lib/main/build-modules.js | 34 + .../client/bower_components/lodash/lodash.js | 16404 +++++++ .../client/bower_components/lodash/package.json | 55 + .../bower_components/lodash/perf/asset/perf-ui.js | 131 + .../client/bower_components/lodash/perf/index.html | 69 + .../client/bower_components/lodash/perf/perf.js | 1977 + .../bower_components/lodash/test/asset/test-ui.js | 170 + .../bower_components/lodash/test/asset/worker.js | 15 + .../bower_components/lodash/test/backbone.html | 170 + .../client/bower_components/lodash/test/fp.html | 41 + .../client/bower_components/lodash/test/index.html | 351 + .../client/bower_components/lodash/test/remove.js | 27 + .../bower_components/lodash/test/saucelabs.js | 914 + .../client/bower_components/lodash/test/test-fp.js | 2173 + .../client/bower_components/lodash/test/test.js | 26729 +++++++++++ .../bower_components/lodash/test/underscore.html | 484 + .../lodash/vendor/backbone/LICENSE | 22 + .../lodash/vendor/backbone/backbone.js | 1920 + .../lodash/vendor/backbone/test/collection.js | 1998 + .../lodash/vendor/backbone/test/events.js | 706 + .../lodash/vendor/backbone/test/model.js | 1418 + .../lodash/vendor/backbone/test/noconflict.js | 13 + .../lodash/vendor/backbone/test/router.js | 1062 + .../lodash/vendor/backbone/test/setup/dom-setup.js | 4 + .../vendor/backbone/test/setup/environment.js | 45 + .../lodash/vendor/backbone/test/sync.js | 239 + .../lodash/vendor/backbone/test/view.js | 495 + .../lodash/vendor/firebug-lite/license.txt | 30 + .../lodash/vendor/firebug-lite/skin/xp/blank.gif | Bin 0 -> 43 bytes .../vendor/firebug-lite/skin/xp/buttonBg.png | Bin 0 -> 167 bytes .../vendor/firebug-lite/skin/xp/buttonBgHover.png | Bin 0 -> 171 bytes .../vendor/firebug-lite/skin/xp/debugger.css | 331 + .../lodash/vendor/firebug-lite/skin/xp/detach.png | Bin 0 -> 655 bytes .../vendor/firebug-lite/skin/xp/detachHover.png | Bin 0 -> 586 bytes .../lodash/vendor/firebug-lite/skin/xp/disable.gif | Bin 0 -> 340 bytes .../lodash/vendor/firebug-lite/skin/xp/disable.png | Bin 0 -> 543 bytes .../vendor/firebug-lite/skin/xp/disableHover.gif | Bin 0 -> 344 bytes .../vendor/firebug-lite/skin/xp/disableHover.png | Bin 0 -> 512 bytes .../lodash/vendor/firebug-lite/skin/xp/down.png | Bin 0 -> 637 bytes .../vendor/firebug-lite/skin/xp/downActive.png | Bin 0 -> 543 bytes .../vendor/firebug-lite/skin/xp/downHover.png | Bin 0 -> 526 bytes .../vendor/firebug-lite/skin/xp/errorIcon-sm.png | Bin 0 -> 447 bytes .../vendor/firebug-lite/skin/xp/errorIcon.gif | Bin 0 -> 365 bytes .../vendor/firebug-lite/skin/xp/errorIcon.png | Bin 0 -> 457 bytes .../vendor/firebug-lite/skin/xp/firebug-1.3a2.css | 817 + .../vendor/firebug-lite/skin/xp/firebug.IE6.css | 20 + .../lodash/vendor/firebug-lite/skin/xp/firebug.css | 3147 ++ .../vendor/firebug-lite/skin/xp/firebug.html | 215 + .../lodash/vendor/firebug-lite/skin/xp/firebug.png | Bin 0 -> 1167 bytes .../lodash/vendor/firebug-lite/skin/xp/group.gif | Bin 0 -> 158 bytes .../lodash/vendor/firebug-lite/skin/xp/html.css | 272 + .../vendor/firebug-lite/skin/xp/infoIcon.gif | Bin 0 -> 359 bytes .../vendor/firebug-lite/skin/xp/infoIcon.png | Bin 0 -> 524 bytes .../vendor/firebug-lite/skin/xp/loading_16.gif | Bin 0 -> 1553 bytes .../lodash/vendor/firebug-lite/skin/xp/min.png | Bin 0 -> 552 bytes .../vendor/firebug-lite/skin/xp/minHover.png | Bin 0 -> 485 bytes .../lodash/vendor/firebug-lite/skin/xp/off.png | Bin 0 -> 742 bytes .../vendor/firebug-lite/skin/xp/offHover.png | Bin 0 -> 680 bytes .../firebug-lite/skin/xp/pixel_transparent.gif | Bin 0 -> 43 bytes .../vendor/firebug-lite/skin/xp/roundCorner.svg | 6 + .../lodash/vendor/firebug-lite/skin/xp/search.gif | Bin 0 -> 550 bytes .../lodash/vendor/firebug-lite/skin/xp/search.png | Bin 0 -> 685 bytes .../lodash/vendor/firebug-lite/skin/xp/shadow.gif | Bin 0 -> 4364 bytes .../lodash/vendor/firebug-lite/skin/xp/shadow2.gif | Bin 0 -> 3093 bytes .../vendor/firebug-lite/skin/xp/shadowAlpha.png | Bin 0 -> 3403 bytes .../lodash/vendor/firebug-lite/skin/xp/sprite.png | Bin 0 -> 40027 bytes .../vendor/firebug-lite/skin/xp/tabHoverLeft.png | Bin 0 -> 438 bytes .../vendor/firebug-lite/skin/xp/tabHoverMid.png | Bin 0 -> 261 bytes .../vendor/firebug-lite/skin/xp/tabHoverRight.png | Bin 0 -> 436 bytes .../lodash/vendor/firebug-lite/skin/xp/tabLeft.png | Bin 0 -> 449 bytes .../firebug-lite/skin/xp/tabMenuCheckbox.png | Bin 0 -> 220 bytes .../vendor/firebug-lite/skin/xp/tabMenuPin.png | Bin 0 -> 207 bytes .../vendor/firebug-lite/skin/xp/tabMenuRadio.png | Bin 0 -> 192 bytes .../vendor/firebug-lite/skin/xp/tabMenuTarget.png | Bin 0 -> 142 bytes .../firebug-lite/skin/xp/tabMenuTargetHover.png | Bin 0 -> 148 bytes .../lodash/vendor/firebug-lite/skin/xp/tabMid.png | Bin 0 -> 262 bytes .../vendor/firebug-lite/skin/xp/tabRight.png | Bin 0 -> 448 bytes .../firebug-lite/skin/xp/textEditorBorders.gif | Bin 0 -> 117 bytes .../firebug-lite/skin/xp/textEditorBorders.png | Bin 0 -> 3144 bytes .../firebug-lite/skin/xp/textEditorCorners.gif | Bin 0 -> 1821 bytes .../firebug-lite/skin/xp/textEditorCorners.png | Bin 0 -> 3960 bytes .../vendor/firebug-lite/skin/xp/titlebarMid.png | Bin 0 -> 273 bytes .../vendor/firebug-lite/skin/xp/toolbarMid.png | Bin 0 -> 242 bytes .../vendor/firebug-lite/skin/xp/tree_close.gif | Bin 0 -> 300 bytes .../vendor/firebug-lite/skin/xp/tree_open.gif | Bin 0 -> 202 bytes .../vendor/firebug-lite/skin/xp/twistyClosed.png | Bin 0 -> 334 bytes .../vendor/firebug-lite/skin/xp/twistyOpen.png | Bin 0 -> 309 bytes .../lodash/vendor/firebug-lite/skin/xp/up.png | Bin 0 -> 619 bytes .../vendor/firebug-lite/skin/xp/upActive.png | Bin 0 -> 551 bytes .../lodash/vendor/firebug-lite/skin/xp/upHover.png | Bin 0 -> 526 bytes .../vendor/firebug-lite/skin/xp/warningIcon.gif | Bin 0 -> 357 bytes .../vendor/firebug-lite/skin/xp/warningIcon.png | Bin 0 -> 516 bytes .../vendor/firebug-lite/src/firebug-lite-debug.js | 31176 +++++++++++++ .../lodash/vendor/json-js/json2.js | 519 + .../lodash/vendor/underscore/LICENSE | 23 + .../lodash/vendor/underscore/test/arrays.js | 555 + .../lodash/vendor/underscore/test/chaining.js | 99 + .../lodash/vendor/underscore/test/collections.js | 896 + .../vendor/underscore/test/cross-document.js | 141 + .../lodash/vendor/underscore/test/functions.js | 728 + .../lodash/vendor/underscore/test/objects.js | 1102 + .../lodash/vendor/underscore/test/utility.js | 420 + .../lodash/vendor/underscore/underscore-min.js | 6 + .../lodash/vendor/underscore/underscore.js | 1620 + .../client/bower_components/ng-dialog/.bower.json | 53 + .../client/bower_components/ng-dialog/CHANGELOG.md | 106 + .../bower_components/ng-dialog/CONTRIBUTING.md | 37 + .../client/bower_components/ng-dialog/README.md | 701 + .../client/bower_components/ng-dialog/bower.json | 43 + .../ng-dialog/css/ngDialog-custom-width.css | 3 + .../ng-dialog/css/ngDialog-theme-default.css | 191 + .../ng-dialog/css/ngDialog-theme-default.min.css | 1 + .../ng-dialog/css/ngDialog-theme-plain.css | 131 + .../ng-dialog/css/ngDialog-theme-plain.min.css | 1 + .../bower_components/ng-dialog/css/ngDialog.css | 114 + .../ng-dialog/css/ngDialog.min.css | 1 + .../bower_components/ng-dialog/js/ngDialog.js | 895 + .../bower_components/ng-dialog/js/ngDialog.min.js | 2 + .../bower_components/ng-dialog/karma.conf.js | 46 + .../client/bower_components/ng-dialog/package.json | 65 + .../bower_components/ng-dialog/protractor.conf.js | 75 + .../client/bower_components/ng-dialog/server.js | 9 + .../client/bower_components/ng-dialog/yarn.lock | 3281 ++ .../client/bower_components/ui-select/.bower.json | 41 + .../client/bower_components/ui-select/CHANGELOG.md | 180 + .../bower_components/ui-select/CONTRIBUTING.md | 161 + .../client/bower_components/ui-select/LICENSE | 20 + .../client/bower_components/ui-select/README.md | 57 + .../client/bower_components/ui-select/bower.json | 31 + .../bower_components/ui-select/composer.json | 29 + .../bower_components/ui-select/deploy-docs.sh | 31 + .../bower_components/ui-select/dist/select.css | 271 + .../bower_components/ui-select/dist/select.js | 2217 + .../bower_components/ui-select/dist/select.min.css | 7 + .../bower_components/ui-select/dist/select.min.js | 9 + .../bower_components/ui-select/docs/assets/app.js | 1 + .../bower_components/ui-select/docs/assets/demo.js | 461 + .../ui-select/docs/assets/docs.css | 339 + .../ui-select/docs/assets/plunkr.js | 110 + .../bower_components/ui-select/docs/index.html | 191 + .../ui-select/docs/partials/_footer.html | 2 + .../ui-select/docs/partials/_header.html | 64 + .../client/bower_components/ui-select/index.js | 2 + .../client/bower_components/ui-select/package.json | 61 + .../angular-att-gridster/angular-gridster.js | 2240 + .../angular-att-gridster/css/angular-gridster.css | 173 + .../styles/angular-gridster.css | 173 + .../angular-att-gridster/styles/ui-gridster.css | 116 + .../angular-att-gridster/ui-gridster-tpls-0.0.1.js | 86 + .../angular-att-gridster/ui-gridster-tpls.js | 164 + .../angular-att-gridster/ui-gridster.js | 131 + .../angular.att.abs-2.17.0/CHANGELOG.md | 1190 + .../angular.att.abs-2.17.0/README.md | 70 + .../angular.att.abs-2.17.0/att-abs-tpls.js | 20422 +++++++++ .../angular.att.abs-2.17.0/att-abs-tpls.min.js | 22 + .../angular.att.abs-2.17.0/styles/base.css | 1 + .../angular.att.abs-2.17.0/styles/btn.css | 1 + .../angular.att.abs-2.17.0/styles/demo.css | 2 + .../angular.att.abs-2.17.0/styles/dtpk.css | 9 + .../angular.att.abs-2.17.0/styles/frms.css | 1 + .../styles/ie/backgroundsize.min.htc | 12 + .../angular.att.abs-2.17.0/styles/images/down.png | Bin 0 -> 1059 bytes .../angular.att.abs-2.17.0/styles/images/up.png | Bin 0 -> 1064 bytes .../styles/images/upanddown.png | Bin 0 -> 1033 bytes .../styles/pages/iconography.css | 2 + .../angular.att.abs-2.17.0/styles/sldr.css | 1 + .../angular.att.abs-2.17.0/styles/style.css | 1 + .../angular.att.abs-2.17.0/styles/tbs.css | 1 + .../bower_components_external/bowser/bowser.js | 559 + .../bower_components_external/bowser/useragents.js | 1267 + .../ionicons-2.0.1/.gitignore | 4 + .../ionicons-2.0.1/LICENSE | 21 + .../ionicons-2.0.1/css/ionicons.css | 1480 + .../ionicons-2.0.1/css/ionicons.min.css | 11 + .../ionicons-2.0.1/fonts/ionicons.eot | Bin 0 -> 120724 bytes .../ionicons-2.0.1/fonts/ionicons.svg | 2230 + .../ionicons-2.0.1/fonts/ionicons.ttf | Bin 0 -> 188508 bytes .../ionicons-2.0.1/fonts/ionicons.woff | Bin 0 -> 67904 bytes .../ionicons-2.0.1/readme.md | 60 + ecomp-portal-FE/client/configurations/dev.json | 65 + .../client/configurations/devServer.json | 48 + ecomp-portal-FE/client/configurations/integ.json | 65 + ecomp-portal-FE/client/configurations/mock.json | 51 + ecomp-portal-FE/client/favicon.ico | Bin 0 -> 1150 bytes ecomp-portal-FE/client/index.html | 279 + .../kpi-dashboard/controllers/AAI-controller.js | 48 + .../kpi-dashboard/controllers/APPC-controller.js | 48 + .../kpi-dashboard/controllers/ASDC-controller.js | 45 + .../controllers/Closedloop-controller.js | 48 + .../kpi-dashboard/controllers/DCAE-controller.js | 375 + .../kpi-dashboard/controllers/DMaaP-controller.js | 48 + .../kpi-dashboard/controllers/ECOMP-controller.js | 25 + .../controllers/ECOMP_Portal-controller.js | 48 + .../controllers/InfrastructurePortal-controller.js | 48 + .../kpi-dashboard/controllers/MSO-controller.js | 48 + .../kpi-dashboard/controllers/Policy-controller.js | 48 + .../kpi-dashboard/controllers/kpi-whitelist.js | 22 + .../client/kpi-dashboard/views/AAI/AAI_KPI.html | 33 + .../kpi-dashboard/views/AAI/AAI_Metrics.html | 33 + .../views/AAI/AAI_UserDefinedKPI.html | 33 + .../client/kpi-dashboard/views/APPC/APPC_KPI.html | 33 + .../kpi-dashboard/views/APPC/APPC_Metrics.html | 33 + .../views/APPC/APPC_UserDefinedKPI.html | 33 + .../client/kpi-dashboard/views/ASDC/ASDC_KPI.html | 33 + .../kpi-dashboard/views/ASDC/ASDC_Metrics.html | 33 + .../views/ASDC/ASDC_UserDefinedKPI.html | 33 + .../views/Closedloop/Closedloop_KPI.html | 33 + .../views/Closedloop/Closedloop_Metrics.html | 33 + .../Closedloop/Closedloop_UserDefinedKPI.html | 33 + .../client/kpi-dashboard/views/DCAE/DCAE_KPI.html | 204 + .../kpi-dashboard/views/DCAE/DCAE_Metrics.html | 41 + .../views/DCAE/DCAE_UserDefinedKPI.html | 33 + .../views/DCAE_DASH/dcae_locations.csv | 10 + .../views/DCAE_DASH/dcae_locations.html | 431 + .../views/DCAE_DASH/dcae_locations1.csv | 7 + .../kpi-dashboard/views/DCAE_DASH/lib/d3.v3.min.js | 24 + .../kpi-dashboard/views/DCAE_DASH/lib/leaflet.css | 497 + .../kpi-dashboard/views/DCAE_DASH/lib/leaflet.js | 28 + .../views/DCAE_DASH/static/visjs/legend_v2.js | 85 + .../kpi-dashboard/views/DMaaP/DMaaP_KPI.html | 33 + .../kpi-dashboard/views/DMaaP/DMaaP_Metrics.html | 33 + .../views/DMaaP/DMaaP_UserDefinedKPI.html | 33 + .../client/kpi-dashboard/views/ECOMP.html | 30 + .../views/ECOMP_Portal/ECOMP_Portal_KPI.html | 33 + .../views/ECOMP_Portal/ECOMP_Portal_Metrics.html | 33 + .../ECOMP_Portal/ECOMP_Portal_UserDefinedKPI.html | 33 + .../InfrastructurePortal_KPI.html | 33 + .../InfrastructurePortal_Metrics.html | 33 + .../InfrastructurePortal_UserDefinedKPI.html | 33 + .../client/kpi-dashboard/views/MSO/MSO_KPI.html | 33 + .../kpi-dashboard/views/MSO/MSO_Metrics.html | 33 + .../views/MSO/MSO_UserDefinedKPI.html | 33 + .../kpi-dashboard/views/Policy/Policy_KPI.html | 33 + .../kpi-dashboard/views/Policy/Policy_Metrics.html | 33 + .../views/Policy/Policy_UserDefinedKPI.html | 33 + .../client/kpi-dashboard/views/sec-level-tabs.html | 29 + .../client/kpi-dashboard/views/top-level-tabs.html | 44 + .../client/kpi-dashboard/views/userapi-edit.html | 71 + .../client/kpi-dashboard/views/userstory-edit.html | 102 + ecomp-portal-FE/client/robots.txt | 3 + .../client/utils/test-utils/test-utils.js | 51 + ecomp-portal-FE/e2e/main/anchoring.spec.js | 27 + ecomp-portal-FE/e2e/main/main.po.js | 15 + ecomp-portal-FE/e2e/main/main.spec.js | 16 + ecomp-portal-FE/karma.conf.js | 131 + .../mock/ecomp/data/admins/account-admins.json | 140 + .../mock/ecomp/data/admins/admin-app-roles.json | 25 + .../mock/ecomp/data/applications/admin-apps.json | 30 + .../data/applications/applications-onboarding.json | 128 + .../ecomp/data/applications/available-apps.json | 25 + .../mock/ecomp/data/applications/user-apps.json | 62 + .../mock/ecomp/data/functional-menu/app-roles.json | 34 + .../mock/ecomp/data/functional-menu/dev.json | 22 + .../mock/ecomp/data/functional-menu/favorites.json | 27 + .../data/functional-menu/menu-item-details.json | 12 + .../ecomp/data/functional-menu/menu-items.json | 674 + .../data/functional-menu/menu-items_small.json | 674 + ecomp-portal-FE/mock/ecomp/data/ping/ping.json | 4 + .../mock/ecomp/data/user-profile/user-profile.json | 6 + .../ecomp/data/user-profile/user-static-info.json | 7 + .../mock/ecomp/data/users/account-users.json | 40 + .../mock/ecomp/data/users/query-users-results.json | 38 + .../mock/ecomp/data/users/user-apps-roles.json | 59 + .../mock/ecomp/data/widgets/widgets.json | 39 + ecomp-portal-FE/mock/ecomp/router.js | 144 + ecomp-portal-FE/mock/server.js | 16 + ecomp-portal-FE/package.json | 90 + ecomp-portal-FE/pom.xml | 7 + ecomp-portal-FE/protractor.conf.js | 51 + ecomp-portal-FE/server/.jshintrc | 14 + ecomp-portal-FE/server/.jshintrc-spec | 11 + ecomp-portal-FE/server/app.js | 19 + ecomp-portal-FE/server/components/errors/index.js | 20 + ecomp-portal-FE/server/config/environment/index.js | 25 + ecomp-portal-FE/server/config/express.js | 40 + ecomp-portal-FE/server/routes.js | 17 + ecomp-portal-FE/server/views/404.html | 157 + 1886 files changed, 806013 insertions(+) create mode 100644 .gitreview create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/portal.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 LICENSE.txt create mode 100644 ecomp-portal-BE/.gitignore create mode 100644 ecomp-portal-BE/README.md create mode 100644 ecomp-portal-BE/distribution.xml create mode 100644 ecomp-portal-BE/ecomp-portal-resources/sql scripts/Apps_Users_OnBoarding_Script.sql create mode 100644 ecomp-portal-BE/ecomp-portal-resources/sql scripts/EcompPortalDDLMySql_1610_Complete_OS.sql create mode 100644 ecomp-portal-BE/ecomp-portal-resources/sql scripts/EcompPortalDMLMySql_1610_Complete_OS.sql create mode 100644 ecomp-portal-BE/pom.xml create mode 100644 ecomp-portal-BE/resources/META-INF/MANIFEST.MF create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/LoginStrategy.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/OpenIdConnectLoginStrategy.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/SimpleLoginStrategy.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/command/EPLoginBean.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/command/PostSearchBean.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/ECOMPLogoutController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPFusionBaseController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPRestrictedBaseController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPRestrictedRESTfulBaseController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPUnRestrictedBaseController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/LoginController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/LoginService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/OpenCollaborationController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/PeerBroadcastSocket.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/UserProfileController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/WelcomeController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/sessionmgt/SessionCommunicationController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/controller/KpiDashboardController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiApiStats.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiServiceSupported.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiUserStoryStats.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpidashProperties.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/service/KpiDashboardService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/service/KpiDashboardServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/model/Result.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/AppCatalogController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/AppContactUsController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/AppsController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/DashboardController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/FunctionalMenuController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/GetAccessController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/HealthCheckController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/ManifestController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/SharedContextRestController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/UserRolesController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/WidgetsController.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUsTransportModel.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCatalogItem.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCategoryFunctionsItem.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppContactUsItem.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/CommonWidgetsEnum.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestResponse.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestStatusEnum.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/SearchResultItem.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/interceptor/PortalResourceInterceptor.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/interceptor/SessionTimeoutInterceptor.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/HealthMonitor.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/UserContextListener.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/UserSessionListener.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPAuditLog.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAspect.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPMetricsLog.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/format/ApplicationCodes.properties create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/format/EPAppMessagesEnum.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/format/EPErrorCodesEnum.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/logic/EPLogUtil.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAppService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAppServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAuditService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAuditServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLdapService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLdapServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLoginService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLoginServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPRoleService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPRoleServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/GetAccessService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/GetAccessServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ManifestService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ManifestServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SharedContextService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SharedContextServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserRolesService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserRolesServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/WidgetService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/WidgetServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AllAppsWithRolesForUser.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppCatalogPersonalization.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppNameIdIsAdmin.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppWithRolesForUser.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppsListWithAdminRole.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidget.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidgetMeta.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/EventWidget.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/EventWidgetMeta.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItem.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItemJson.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FieldsValidator.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItem.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItemJson.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuRole.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/LocalRole.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingWidget.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdmin.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdminUserRole.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RemoteRole.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RemoteUserWithRoles.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RoleInAppForUser.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RolesInAppForUser.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/UserApplicationRoles.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/UserWithNameSurnameTitle.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/CustomLoggingFilter.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EPSystemProperties.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EcompVersion.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/HashMapFromList.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/ParallelExecutor.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/Register.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/SessionMgtRegistry.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/EPProfileService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/EPProfileServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/CoreTimeoutHandler.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/ManageService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/RemoteWebServiceCallService.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/RemoteWebServiceCallServiceImpl.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/SessionCommunication.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/TimeoutHandler.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/FunctionalMenuHandler.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/util/EPUserUtils.java create mode 100644 ecomp-portal-BE/src/main/java/org/openecomp/portalapp/util/SessionCookieUtil.java create mode 100644 ecomp-portal-BE/src/main/resources/cache.ccf create mode 100644 ecomp-portal-BE/src/main/resources/logback.xml create mode 100644 ecomp-portal-BE/src/main/resources/openid-connect.properties create mode 100644 ecomp-portal-BE/src/main/resources/openid-keystore.jwks create mode 100644 ecomp-portal-BE/src/main/resources/portal.properties create mode 100644 ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java create mode 100644 ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java create mode 100644 ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java create mode 100644 ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties create mode 100644 ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java create mode 100644 ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java create mode 100644 ecomp-portal-BE/war/META-INF/MANIFEST.MF create mode 100644 ecomp-portal-BE/war/WEB-INF/conf/cache.ccf create mode 100644 ecomp-portal-BE/war/WEB-INF/conf/kpidash.properties create mode 100644 ecomp-portal-BE/war/WEB-INF/conf/quartz.properties create mode 100644 ecomp-portal-BE/war/WEB-INF/conf/raptor.properties create mode 100644 ecomp-portal-BE/war/WEB-INF/conf/raptor_app_fusion.properties create mode 100644 ecomp-portal-BE/war/WEB-INF/conf/raptor_db_fusion.properties create mode 100644 ecomp-portal-BE/war/WEB-INF/conf/raptor_pdf.properties create mode 100644 ecomp-portal-BE/war/WEB-INF/conf/sql.properties create mode 100644 ecomp-portal-BE/war/WEB-INF/conf/system.properties create mode 100644 ecomp-portal-BE/war/WEB-INF/defs/definitions.xml create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/.DS_Store create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/conf/fusion.properties create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/defs/definitions.xml create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/.gitignore create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/collaborateList.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz/ebz_footer.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz/ebz_header.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz_template.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz_template_noheader_nofooter.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/include.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/jcs_admin.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/meta.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal.html create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal_role.html create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal_rolefunction.html create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/post_search.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/profile.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/profile_search.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/role.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/role_function_list.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/role_list.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/usage_list.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/jsp/webrtc/collaboration.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/orm/EP.hbm.xml create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/orm/Fusion.hbm.xml create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/orm/Workflow.hbm.xml create mode 100644 ecomp-portal-BE/war/WEB-INF/fusion/raptor/report_search.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/jsp/error.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/jsp/index.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/jsp/login.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/jsp/oid-admin.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/jsp/oid-home.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/jsp/oid-login.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/jsp/oid-user.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/jsp/welcome.jsp create mode 100644 ecomp-portal-BE/war/WEB-INF/oid-context.xml create mode 100644 ecomp-portal-BE/war/WEB-INF/tags/copyright.tag create mode 100644 ecomp-portal-BE/war/WEB-INF/tags/footer.tag create mode 100644 ecomp-portal-BE/war/WEB-INF/tags/header.tag create mode 100644 ecomp-portal-BE/war/WEB-INF/tags/topbar.tag create mode 100644 ecomp-portal-BE/war/WEB-INF/web.xml create mode 100644 ecomp-portal-BE/war/images/cache/README.txt create mode 100644 ecomp-portal-BE/war/index.jsp create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/angular-sanitize.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/angular.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/app.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/att-abs-tpls-1.2.51.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/attHeaderSnippet.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/att_abs_tpls.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/checklist-model.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/checklist-model.min.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/d7100892.modernizr.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/ebiz_keepalive.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/footer.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/footer_new.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/gestures.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/ng_base.js create mode 100644 ecomp-portal-BE/war/static/ebz/angular_js/ui-charts-tpls.js create mode 100644 ecomp-portal-BE/war/static/ebz/attSessionTimeoutModal.css create mode 100644 ecomp-portal-BE/war/static/ebz/dashboardBase.css create mode 100644 ecomp-portal-BE/war/static/ebz/dashboardBase_changed.css create mode 100644 ecomp-portal-BE/war/static/ebz/ebz_header.css create mode 100644 ecomp-portal-BE/war/static/ebz/fn-ebz.css create mode 100644 ecomp-portal-BE/war/static/ebz/footer_new.css create mode 100644 ecomp-portal-BE/war/static/ebz/globalFonts.css create mode 100644 ecomp-portal-BE/war/static/ebz/header_new.css create mode 100644 ecomp-portal-BE/war/static/ebz/js/attHeaderSnippet.js create mode 100644 ecomp-portal-BE/war/static/ebz/js/footer.js create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/att-abs-tpls.js create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/att-abs-tpls.min.js create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/styles/base.css create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/styles/btn.css create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/styles/demo.css create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/styles/dtpk.css create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/styles/frms.css create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/styles/ie/backgroundsize.min.htc create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/styles/pages/iconography.css create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/styles/sldr.css create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/styles/style.css create mode 100644 ecomp-portal-BE/war/static/ebz/sandbox/styles/tbs.css create mode 100644 ecomp-portal-BE/war/static/fusion/css/att_angular_gridster/sandbox-gridster.css create mode 100644 ecomp-portal-BE/war/static/fusion/css/att_angular_gridster/ui-gridster.css create mode 100644 ecomp-portal-BE/war/static/fusion/css/fusion-sunny.css create mode 100644 ecomp-portal-BE/war/static/fusion/css/jquery-ui.css create mode 100644 ecomp-portal-BE/war/static/fusion/css/layout/layout-default-latest.css create mode 100644 ecomp-portal-BE/war/static/fusion/d3/css/nv.d3.css create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/cie.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/colorbrewer.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/core.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/crossfilter.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/crossfilter.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/d3.geom.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/d3.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/d3.layout.cloud.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/d3.layout.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/d3.v2.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/d3.v2.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/d3.v3.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/fisheye.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/hive.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/horizon.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/interactiveLayer.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/intro.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/axis-min.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/axis.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/axis.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/backup/bullet.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/backup/bulletChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/boilerplate.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/bullet.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/bulletChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/cumulativeLineChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/discreteBar.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/discreteBarChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/distribution.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/historicalBar.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/historicalBarChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/indentedTree.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/legend.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/line.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/lineChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/linePlusBarChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/linePlusBarWithFocusChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/lineWithFisheye.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/lineWithFisheyeChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/lineWithFocusChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/multiBar.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/multiBarChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/multiBarHorizontal.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/multiBarHorizontalChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/multiBarTimeSeries.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/multiBarTimeSeriesChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/multiChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/ohlcBar.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/parallelCoordinates.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/pie.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/pieChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/scatter.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/scatterChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/scatterPlusLineChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/sparkline.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/sparklinePlus.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/stackedArea.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/models/stackedAreaChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/nv.d3.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/nv.d3.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/outro.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/sankey.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/tooltip.js create mode 100644 ecomp-portal-BE/war/static/fusion/d3/js/utils.js create mode 100644 ecomp-portal-BE/war/static/fusion/images/att_angular_gridster/grips.png create mode 100644 ecomp-portal-BE/war/static/fusion/images/ecomp-login.jpg create mode 100644 ecomp-portal-BE/war/static/fusion/images/ecomp_trans.png create mode 100644 ecomp-portal-BE/war/static/fusion/images/login_button.gif create mode 100644 ecomp-portal-BE/war/static/fusion/js/att_angular_gridster/angular-gridster.js create mode 100644 ecomp-portal-BE/war/static/fusion/js/att_angular_gridster/ui-gridster-tpls.js create mode 100644 ecomp-portal-BE/war/static/fusion/js/jquery.resize.js create mode 100644 ecomp-portal-BE/war/static/fusion/js/layout/debug.js create mode 100644 ecomp-portal-BE/war/static/fusion/js/layout/jquery-latest.js create mode 100644 ecomp-portal-BE/war/static/fusion/js/layout/jquery-ui-latest.js create mode 100644 ecomp-portal-BE/war/static/fusion/js/layout/jquery.layout-latest.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/css/images/blank.gif create mode 100644 ecomp-portal-BE/war/static/fusion/sample/css/scribble.css create mode 100644 ecomp-portal-BE/war/static/fusion/sample/css/slider.css create mode 100644 ecomp-portal-BE/war/static/fusion/sample/css/spacegallery.css create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/area_chart.html create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/bar_chart.html create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/d3_gauges_demo.html create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/data/speedometer2.csv create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/data/speedometer3.csv create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/data/worddata.csv create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/donut_d3.html create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/js/area_chart.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/js/donut.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/js/gauges.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/js/line_chart.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/js/pie_chart.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/js/worddata.min.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/line_chart.html create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/pie_chart.html create mode 100644 ecomp-portal-BE/war/static/fusion/sample/html/wordcloud.html create mode 100644 ecomp-portal-BE/war/static/fusion/sample/js/FusionCharts.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/js/charts.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/js/eye.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/js/scribble.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/js/slides.min.jquery.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/js/spacegallery.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/js/utils.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/org_chart/css/bootstrap.min.css create mode 100644 ecomp-portal-BE/war/static/fusion/sample/org_chart/css/custom.css create mode 100644 ecomp-portal-BE/war/static/fusion/sample/org_chart/css/jquery.jOrgChart.css create mode 100644 ecomp-portal-BE/war/static/fusion/sample/org_chart/css/prettify.css create mode 100644 ecomp-portal-BE/war/static/fusion/sample/org_chart/example.html create mode 100644 ecomp-portal-BE/war/static/fusion/sample/org_chart/example_vsp.html create mode 100644 ecomp-portal-BE/war/static/fusion/sample/org_chart/jquery.jOrgChart.js create mode 100644 ecomp-portal-BE/war/static/fusion/sample/org_chart/prettify.js create mode 100644 ecomp-portal-BE/war/static/fusion/webrtc/getSourceId.html create mode 100644 ecomp-portal-BE/war/static/fusion/webrtc/js/RTCMultiConnection.js create mode 100644 ecomp-portal-BE/war/static/fusion/webrtc/js/peerBroadcast.js create mode 100644 ecomp-portal-BE/war/static/js/jquery-1.10.2.js create mode 100644 ecomp-portal-BE/war/static/js/jquery-ui.js create mode 100644 ecomp-portal-BE/war/static/js/jquery.mask.min.js create mode 100644 ecomp-portal-BE/war/static/js/modalService.js create mode 100644 ecomp-portal-BE/war/static/oid-connect/bootstrap2/css/bootstrap-responsive.css create mode 100644 ecomp-portal-BE/war/static/oid-connect/bootstrap2/css/bootstrap-responsive.min.css create mode 100644 ecomp-portal-BE/war/static/oid-connect/bootstrap2/css/bootstrap.css create mode 100644 ecomp-portal-BE/war/static/oid-connect/bootstrap2/css/bootstrap.min.css create mode 100644 ecomp-portal-BE/war/static/oid-connect/bootstrap2/js/bootstrap.js create mode 100644 ecomp-portal-BE/war/static/oid-connect/bootstrap2/js/bootstrap.min.js create mode 100644 ecomp-portal-BE/war/static/oid-connect/js/lib/jquery.js create mode 100644 ecomp-portal-BE/war/static/oid-connect/js/lib/jwt.js create mode 100644 ecomp-portal-BE/war/static/oid-connect/js/lib/underscore.js create mode 100644 ecomp-portal-FE/.bowerrc create mode 100644 ecomp-portal-FE/.gitignore create mode 100644 ecomp-portal-FE/Gruntfile.js create mode 100644 ecomp-portal-FE/README.md create mode 100644 ecomp-portal-FE/bower.json create mode 100644 ecomp-portal-FE/build-ecomportal-fe.sh create mode 100644 ecomp-portal-FE/client/.htaccess create mode 100644 ecomp-portal-FE/client/.jshintrc create mode 100644 ecomp-portal-FE/client/app/app.js create mode 100644 ecomp-portal-FE/client/app/app.less create mode 100644 ecomp-portal-FE/client/app/configurations.js create mode 100644 ecomp-portal-FE/client/app/directives/auto-focus/auto-focus.directive.js create mode 100644 ecomp-portal-FE/client/app/directives/image-upload/image-upload.directive.js create mode 100644 ecomp-portal-FE/client/app/directives/left-menu/left-menu.directive.js create mode 100644 ecomp-portal-FE/client/app/directives/left-menu/left-menu.less create mode 100644 ecomp-portal-FE/client/app/directives/left-menu/left-menu.tpl.html create mode 100644 ecomp-portal-FE/client/app/directives/multiple-select/multiple-select.directive.js create mode 100644 ecomp-portal-FE/client/app/directives/multiple-select/multiple-select.less create mode 100644 ecomp-portal-FE/client/app/directives/multiple-select/multiple-select.tpl.html create mode 100644 ecomp-portal-FE/client/app/directives/right-click-menu/right-click-menu.directive.js create mode 100644 ecomp-portal-FE/client/app/directives/right-click/ng-right-click-directive.js create mode 100644 ecomp-portal-FE/client/app/directives/right-menu/right-menu.directive.js create mode 100644 ecomp-portal-FE/client/app/directives/right-menu/right-menu.less create mode 100644 ecomp-portal-FE/client/app/directives/right-menu/right-menu.tpl.html create mode 100644 ecomp-portal-FE/client/app/directives/scroll-top/scroll-top.directive.js create mode 100644 ecomp-portal-FE/client/app/directives/search-users/search-users.controller.js create mode 100644 ecomp-portal-FE/client/app/directives/search-users/search-users.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/directives/search-users/search-users.directive.js create mode 100644 ecomp-portal-FE/client/app/directives/search-users/search-users.less create mode 100644 ecomp-portal-FE/client/app/directives/search-users/search-users.tpl.html create mode 100644 ecomp-portal-FE/client/app/filters/elipsis/elipsis.filter.js create mode 100644 ecomp-portal-FE/client/app/filters/elipsis/elipsis.filter.spec.js create mode 100644 ecomp-portal-FE/client/app/filters/trusted-url/trusted-url.filter.js create mode 100644 ecomp-portal-FE/client/app/router.js create mode 100644 ecomp-portal-FE/client/app/services/admins/admins.service.js create mode 100644 ecomp-portal-FE/client/app/services/applications/applications.service.js create mode 100644 ecomp-portal-FE/client/app/services/catalog/catalog.service.js create mode 100644 ecomp-portal-FE/client/app/services/confirm-box/confirm-box.service.js create mode 100644 ecomp-portal-FE/client/app/services/contact-us/contact-us.service.js create mode 100644 ecomp-portal-FE/client/app/services/dashboard/dashboard.service.js create mode 100644 ecomp-portal-FE/client/app/services/error-messages/error-messages.service.js create mode 100644 ecomp-portal-FE/client/app/services/functionalMenu/functionalMenu.service.js create mode 100644 ecomp-portal-FE/client/app/services/global-constants/global-constants.js create mode 100644 ecomp-portal-FE/client/app/services/kpi-dashboard/kpi-dashboard.service.js create mode 100644 ecomp-portal-FE/client/app/services/manifest/manifest.service.js create mode 100644 ecomp-portal-FE/client/app/services/menus/menus.service.js create mode 100644 ecomp-portal-FE/client/app/services/portal-admins/portal-admins.service.js create mode 100644 ecomp-portal-FE/client/app/services/support/getAccess/get-access.service.js create mode 100644 ecomp-portal-FE/client/app/services/support/session/session.service.js create mode 100644 ecomp-portal-FE/client/app/services/userProfile/userProfile.service.js create mode 100644 ecomp-portal-FE/client/app/services/userbar/userbar.update.service.js create mode 100644 ecomp-portal-FE/client/app/services/users/users.service.js create mode 100644 ecomp-portal-FE/client/app/services/utils/utils.service.js create mode 100644 ecomp-portal-FE/client/app/services/widgets/widgets.service.js create mode 100644 ecomp-portal-FE/client/app/styles/att-abs.less create mode 100644 ecomp-portal-FE/client/app/styles/buttons.less create mode 100644 ecomp-portal-FE/client/app/styles/ecomp-general.less create mode 100644 ecomp-portal-FE/client/app/styles/fonts.less create mode 100644 ecomp-portal-FE/client/app/styles/form.less create mode 100644 ecomp-portal-FE/client/app/styles/kpi-dashboard.less create mode 100644 ecomp-portal-FE/client/app/styles/mixins.less create mode 100644 ecomp-portal-FE/client/app/styles/ng-dialog.less create mode 100644 ecomp-portal-FE/client/app/styles/reset.less create mode 100644 ecomp-portal-FE/client/app/styles/select2.less create mode 100644 ecomp-portal-FE/client/app/styles/spinner.less create mode 100644 ecomp-portal-FE/client/app/styles/sprites.less create mode 100644 ecomp-portal-FE/client/app/styles/variables.less create mode 100644 ecomp-portal-FE/client/app/views/admins/add-admin-dialogs/new-admin.controller.js create mode 100644 ecomp-portal-FE/client/app/views/admins/add-admin-dialogs/new-admin.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/admins/add-admin-dialogs/new-admin.modal.html create mode 100644 ecomp-portal-FE/client/app/views/admins/add-admin-dialogs/new-admin.modal.less create mode 100644 ecomp-portal-FE/client/app/views/admins/admins.controller.js create mode 100644 ecomp-portal-FE/client/app/views/admins/admins.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/admins/admins.less create mode 100644 ecomp-portal-FE/client/app/views/admins/admins.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/applications/application-details-dialog/application-details.controller.js create mode 100644 ecomp-portal-FE/client/app/views/applications/application-details-dialog/application-details.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/applications/application-details-dialog/application-details.modal.html create mode 100644 ecomp-portal-FE/client/app/views/applications/application-details-dialog/application-details.modal.less create mode 100644 ecomp-portal-FE/client/app/views/applications/applications.controller.js create mode 100644 ecomp-portal-FE/client/app/views/applications/applications.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/applications/applications.less create mode 100644 ecomp-portal-FE/client/app/views/applications/applications.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/catalog/catalog.controller.js create mode 100644 ecomp-portal-FE/client/app/views/catalog/catalog.less create mode 100644 ecomp-portal-FE/client/app/views/catalog/catalog.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/catalog/catalogconfirmation.controller.js create mode 100644 ecomp-portal-FE/client/app/views/catalog/information-box.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/confirmation-box/admin-confirmation-box.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/confirmation-box/confirmation-box.controller.js create mode 100644 ecomp-portal-FE/client/app/views/confirmation-box/confirmation-box.less create mode 100644 ecomp-portal-FE/client/app/views/confirmation-box/confirmation-box.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/confirmation-box/dragdrop-confirmation-box.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/confirmation-box/information-box.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/dashboard/dashboard-widget-manage.html create mode 100644 ecomp-portal-FE/client/app/views/dashboard/dashboard-widget.controller.js create mode 100644 ecomp-portal-FE/client/app/views/dashboard/dashboard-widget.controller.less create mode 100644 ecomp-portal-FE/client/app/views/dashboard/dashboard.controller.js create mode 100644 ecomp-portal-FE/client/app/views/dashboard/dashboard.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/dashboard/dashboard.less create mode 100644 ecomp-portal-FE/client/app/views/dashboard/dashboard.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/dashboard/newsticker.controller.js create mode 100644 ecomp-portal-FE/client/app/views/errors/error.404.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/errors/error.controller.js create mode 100644 ecomp-portal-FE/client/app/views/errors/error.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/footer/footer.controller.js create mode 100644 ecomp-portal-FE/client/app/views/footer/footer.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/footer/footer.less create mode 100644 ecomp-portal-FE/client/app/views/footer/footer.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.controller.js create mode 100644 ecomp-portal-FE/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.delete.modal.html create mode 100644 ecomp-portal-FE/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.modal.html create mode 100644 ecomp-portal-FE/client/app/views/functionalMenu/functionalMenu-dialog/modal-details.modal.less create mode 100644 ecomp-portal-FE/client/app/views/functionalMenu/functionalMenu.controller.js create mode 100644 ecomp-portal-FE/client/app/views/functionalMenu/functionalMenu.less create mode 100644 ecomp-portal-FE/client/app/views/functionalMenu/functionalMenu.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/functionalMenu/jqTreeContextMenu.js create mode 100644 ecomp-portal-FE/client/app/views/header/header.controller.js create mode 100644 ecomp-portal-FE/client/app/views/header/header.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/header/header.less create mode 100644 ecomp-portal-FE/client/app/views/header/header.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/header/user-edit/edit-user.controller.js create mode 100644 ecomp-portal-FE/client/app/views/header/user-edit/edit-user.less create mode 100644 ecomp-portal-FE/client/app/views/header/user-edit/edit-user.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/home/applications-home/applications-home.controller.js create mode 100644 ecomp-portal-FE/client/app/views/home/applications-home/applications-home.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/home/applications-home/applications-home.less create mode 100644 ecomp-portal-FE/client/app/views/home/applications-home/applications-home.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/home/widgets-home/widgets-home.controller.js create mode 100644 ecomp-portal-FE/client/app/views/home/widgets-home/widgets-home.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/home/widgets-home/widgets-home.less create mode 100644 ecomp-portal-FE/client/app/views/home/widgets-home/widgets-home.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/portal-admin/new-portal-admin/new-portal-admin.controller.js create mode 100644 ecomp-portal-FE/client/app/views/portal-admin/new-portal-admin/new-portal-admin.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/portal-admin/new-portal-admin/new-portal-admin.modal.html create mode 100644 ecomp-portal-FE/client/app/views/portal-admin/new-portal-admin/new-portal-admin.modal.less create mode 100644 ecomp-portal-FE/client/app/views/portal-admin/portal-admin-controller.js create mode 100644 ecomp-portal-FE/client/app/views/portal-admin/portal-admin.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/portal-admin/portal-admins.less create mode 100644 ecomp-portal-FE/client/app/views/search/search.controller.js create mode 100644 ecomp-portal-FE/client/app/views/search/search.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/search/search.less create mode 100644 ecomp-portal-FE/client/app/views/search/search.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/sidebar/sidebar.controller.js create mode 100644 ecomp-portal-FE/client/app/views/sidebar/sidebar.less create mode 100644 ecomp-portal-FE/client/app/views/sidebar/sidebar.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.js create mode 100644 ecomp-portal-FE/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.less create mode 100644 ecomp-portal-FE/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.html create mode 100644 ecomp-portal-FE/client/app/views/support/contact-us/contact-us.controller.js create mode 100644 ecomp-portal-FE/client/app/views/support/contact-us/contact-us.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/support/contact-us/contact-us.less create mode 100644 ecomp-portal-FE/client/app/views/support/contact-us/contact-us.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/support/get-access/get-access.controller.js create mode 100644 ecomp-portal-FE/client/app/views/support/get-access/get-access.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/support/get-access/get-access.less create mode 100644 ecomp-portal-FE/client/app/views/support/get-access/get-access.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/tabs/tabframe.html create mode 100644 ecomp-portal-FE/client/app/views/tabs/tabs.controller.js create mode 100644 ecomp-portal-FE/client/app/views/tabs/tabs.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/tabs/tabs.less create mode 100644 ecomp-portal-FE/client/app/views/tabs/tabs.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/userbar/userbar.controller.js create mode 100644 ecomp-portal-FE/client/app/views/userbar/userbar.less create mode 100644 ecomp-portal-FE/client/app/views/userbar/userbar.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/users/new-user-dialogs/new-user.controller.js create mode 100644 ecomp-portal-FE/client/app/views/users/new-user-dialogs/new-user.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/users/new-user-dialogs/new-user.modal.html create mode 100644 ecomp-portal-FE/client/app/views/users/new-user-dialogs/new-user.modal.less create mode 100644 ecomp-portal-FE/client/app/views/users/users.controller.js create mode 100644 ecomp-portal-FE/client/app/views/users/users.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/users/users.less create mode 100644 ecomp-portal-FE/client/app/views/users/users.tpl.html create mode 100644 ecomp-portal-FE/client/app/views/widgets/widget-details-dialog/widget-details.controller.js create mode 100644 ecomp-portal-FE/client/app/views/widgets/widget-details-dialog/widget-details.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/widgets/widget-details-dialog/widget-details.modal.html create mode 100644 ecomp-portal-FE/client/app/views/widgets/widget-details-dialog/widget-details.modal.less create mode 100644 ecomp-portal-FE/client/app/views/widgets/widgets.controller.js create mode 100644 ecomp-portal-FE/client/app/views/widgets/widgets.controller.spec.js create mode 100644 ecomp-portal-FE/client/app/views/widgets/widgets.less create mode 100644 ecomp-portal-FE/client/app/views/widgets/widgets.tpl.html create mode 100644 ecomp-portal-FE/client/assets/images/cloud.png create mode 100644 ecomp-portal-FE/client/assets/images/ecomp_logo.png create mode 100644 ecomp-portal-FE/client/assets/images/grips.png create mode 100644 ecomp-portal-FE/client/assets/images/photo.png create mode 100644 ecomp-portal-FE/client/assets/images/spinner.gif create mode 100644 ecomp-portal-FE/client/assets/images/sprite.png create mode 100644 ecomp-portal-FE/client/bower_components/angular-animate/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-animate/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-animate/angular-animate.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-animate/angular-animate.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-animate/angular-animate.min.js.map create mode 100644 ecomp-portal-FE/client/bower_components/angular-animate/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-animate/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-animate/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-aria/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-aria/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-aria/angular-aria.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-aria/angular-aria.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-aria/angular-aria.min.js.map create mode 100644 ecomp-portal-FE/client/bower_components/angular-aria/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-aria/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-aria/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/.gitignore create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/.npmignore create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/ui-bootstrap-csp.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/ui-bootstrap-tpls.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/ui-bootstrap.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-bootstrap/ui-bootstrap.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/CHANGELOG.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/TRANSITION.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/browserify/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/browserify/app.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/browserify/index.html create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/r.js/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/r.js/app.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/r.js/index.html create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/r.js/main.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/r.js/require.config.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack/app.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack/index.html create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack/webpack.config.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack_es6/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack_es6/app.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack_es6/index.html create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack_es6/webpack.config.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack_es6_2/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack_es6_2/app.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack_es6_2/index.html create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/build_examples/webpack_es6_2/webpack.config.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/circle.yml create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/dist/angular-cache.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/dist/angular-cache.js.map create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/dist/angular-cache.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/dist/angular-cache.min.map create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/rollup.config.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cache/scripts/postbuild.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cookies/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-cookies/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-cookies/angular-cookies.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cookies/angular-cookies.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cookies/angular-cookies.min.js.map create mode 100644 ecomp-portal-FE/client/bower_components/angular-cookies/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-cookies/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-cookies/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-gestures/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-gestures/LICENSE.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-gestures/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-gestures/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-gestures/gestures.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-gestures/gestures.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/.gitignore create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/CHANGELOG.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/angular-material-mocks.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/angular-material.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/angular-material.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/angular-material.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/angular-material.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/copy.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/copy2.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/facebook.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/hangout.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/mail.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/message.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/print.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/share-arrow.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/twitter.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/upload.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/chips/demoBasicUsage/style.scss create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/chips/demoContactChips/style.scss create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/gridList/demoBasicUsage/style.scss create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/gridList/demoDynamicTiles/style.scss create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/gridList/demoResponsiveUsage/style.scss create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoLoadSvgIconsFromUrl/img/icons/addShoppingCart.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoLoadSvgIconsFromUrl/img/icons/android.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoLoadSvgIconsFromUrl/img/icons/cake.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoSvgIconSets/assets/cake.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoSvgIconSets/assets/core-icons.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoSvgIconSets/assets/social-icons.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoSvgIconsFromURL/img/icons/addShoppingCart.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoSvgIconsFromURL/img/icons/android.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoSvgIconsFromURL/img/icons/cake.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoUsingTemplateCache/assets/android.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoUsingTemplateCache/assets/cake.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/icon/demoUsingTemplateCache/assets/core-icons.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/input/demoIcons/icons/ic_email_24px.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/input/demoIcons/icons/ic_person_24px.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/input/demoIcons/icons/ic_phone_24px.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/input/demoIcons/icons/ic_place_24px.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/input/demoIcons/style.scss create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/list/demoListControls/img/100-0.jpeg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/list/demoListControls/img/100-1.jpeg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/list/demoListControls/img/100-2.jpeg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/tabs/demoDynamicHeight/style.scss create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/tabs/demoDynamicTabs/style.scss create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/tabs/demoStaticTabs/style.scss create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/toolbar/demoBasicUsage/img/icons/favorite.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/toolbar/demoBasicUsage/img/icons/menu.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/demos/toolbar/demoBasicUsage/img/icons/more_vert.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/autocomplete/autocomplete-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/autocomplete/autocomplete.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/autocomplete/autocomplete.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/backdrop/backdrop-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/backdrop/backdrop.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/backdrop/backdrop.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/button/button-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/button/button.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/button/button.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/card/card-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/card/card.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/card/card.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/checkbox/checkbox.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/chips/chips-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/chips/chips.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/chips/chips.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/content/content-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/content/content.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/content/content.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/core/core.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/core/core.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/core/default-theme.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/dialog/dialog-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/dialog/dialog.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/dialog/dialog.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/divider/divider-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/divider/divider.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/divider/divider.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/gridList/gridList-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/gridList/gridList.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/gridList/gridList.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/icon/icon-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/icon/icon.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/icon/icon.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/input/input-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/input/input.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/input/input.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/list/list-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/list/list.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/list/list.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/menu/menu.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/menu/menu.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/progressCircular/progressCircular-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/progressCircular/progressCircular.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/progressCircular/progressCircular.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/progressLinear/progressLinear-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/progressLinear/progressLinear.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/progressLinear/progressLinear.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/radioButton/radioButton-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/radioButton/radioButton.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/radioButton/radioButton.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/select/select-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/select/select.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/select/select.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/sidenav/sidenav-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/sidenav/sidenav.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/sidenav/sidenav.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/slider/slider-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/slider/slider.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/slider/slider.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/sticky/sticky.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/sticky/sticky.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/subheader/subheader-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/subheader/subheader.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/subheader/subheader.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/swipe/swipe.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/switch/switch-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/switch/switch.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/switch/switch.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/tabs/tabs-arrow.svg create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/tabs/tabs-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/tabs/tabs.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/tabs/tabs.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/textField/textField-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/textField/textField.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/textField/textField.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/toast/toast-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/toast/toast.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/toast/toast.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/toolbar/toolbar-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/toolbar/toolbar.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/toolbar/toolbar.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/tooltip/tooltip-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/tooltip/tooltip.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/tooltip/tooltip.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/whiteframe/whiteframe.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/closure/whiteframe/whiteframe.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/css/angular-material-layout.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/autocomplete/autocomplete-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/autocomplete/autocomplete-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/autocomplete/autocomplete.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/autocomplete/autocomplete.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/autocomplete/autocomplete.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/autocomplete/autocomplete.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/autocomplete/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/backdrop/backdrop-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/backdrop/backdrop-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/backdrop/backdrop.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/backdrop/backdrop.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/backdrop/backdrop.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/backdrop/backdrop.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/backdrop/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/bottomSheet/bottomSheet-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/bottomSheet/bottomSheet-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/bottomSheet/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/button/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/button/button-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/button/button-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/button/button.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/button/button.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/button/button.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/button/button.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/card/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/card/card-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/card/card-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/card/card.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/card/card.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/card/card.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/card/card.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/checkbox/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/checkbox/checkbox-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/checkbox/checkbox-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/checkbox/checkbox.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/checkbox/checkbox.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/checkbox/checkbox.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/checkbox/checkbox.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/chips/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/chips/chips-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/chips/chips-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/chips/chips.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/chips/chips.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/chips/chips.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/chips/chips.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/content/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/content/content-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/content/content-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/content/content.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/content/content.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/content/content.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/content/content.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/core/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/core/core.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/core/core.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/core/core.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/core/core.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/core/default-theme.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/dialog/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/dialog/dialog-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/dialog/dialog-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/dialog/dialog.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/dialog/dialog.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/dialog/dialog.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/dialog/dialog.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/divider/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/divider/divider-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/divider/divider-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/divider/divider.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/divider/divider.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/divider/divider.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/divider/divider.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/gridList/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/gridList/gridList.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/gridList/gridList.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/gridList/gridList.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/gridList/gridList.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/icon/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/icon/icon-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/icon/icon-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/icon/icon.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/icon/icon.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/icon/icon.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/icon/icon.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/input/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/input/input-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/input/input-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/input/input.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/input/input.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/input/input.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/input/input.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/list/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/list/list-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/list/list-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/list/list.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/list/list.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/list/list.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/list/list.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/menu/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/menu/menu.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/menu/menu.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/menu/menu.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/menu/menu.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressCircular/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressCircular/progressCircular-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressCircular/progressCircular-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressCircular/progressCircular.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressCircular/progressCircular.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressCircular/progressCircular.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressCircular/progressCircular.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressLinear/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressLinear/progressLinear-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressLinear/progressLinear-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressLinear/progressLinear.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressLinear/progressLinear.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressLinear/progressLinear.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/progressLinear/progressLinear.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/radioButton/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/radioButton/radioButton-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/radioButton/radioButton-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/radioButton/radioButton.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/radioButton/radioButton.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/radioButton/radioButton.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/radioButton/radioButton.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/select/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/select/select-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/select/select-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/select/select.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/select/select.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/select/select.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/select/select.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sidenav/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sidenav/sidenav-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sidenav/sidenav-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sidenav/sidenav.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sidenav/sidenav.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sidenav/sidenav.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sidenav/sidenav.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/slider/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/slider/slider-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/slider/slider-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/slider/slider.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/slider/slider.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/slider/slider.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/slider/slider.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sticky/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sticky/sticky.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sticky/sticky.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sticky/sticky.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/sticky/sticky.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/subheader/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/subheader/subheader-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/subheader/subheader-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/subheader/subheader.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/subheader/subheader.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/subheader/subheader.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/subheader/subheader.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/swipe/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/swipe/swipe.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/swipe/swipe.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/switch/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/switch/switch-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/switch/switch-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/switch/switch.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/switch/switch.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/switch/switch.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/switch/switch.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tabs/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tabs/tabs-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tabs/tabs-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tabs/tabs.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tabs/tabs.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tabs/tabs.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tabs/tabs.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/textField/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/textField/textField-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/textField/textField-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/textField/textField.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/textField/textField.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/textField/textField.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/textField/textField.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toast/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toast/toast-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toast/toast-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toast/toast.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toast/toast.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toast/toast.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toast/toast.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toolbar/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toolbar/toolbar-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toolbar/toolbar-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toolbar/toolbar.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toolbar/toolbar.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toolbar/toolbar.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/toolbar/toolbar.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tooltip/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tooltip/tooltip-default-theme.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tooltip/tooltip-default-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tooltip/tooltip.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tooltip/tooltip.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tooltip/tooltip.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/tooltip/tooltip.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/whiteframe/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/whiteframe/whiteframe.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/whiteframe/whiteframe.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/whiteframe/whiteframe.min.css create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/modules/js/whiteframe/whiteframe.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-material/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-messages/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-messages/LICENSE.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-messages/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-messages/angular-messages.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-messages/angular-messages.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-messages/angular-messages.min.js.map create mode 100644 ecomp-portal-FE/client/bower_components/angular-messages/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-messages/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-messages/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-mocks/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-mocks/LICENSE.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-mocks/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-mocks/angular-mocks.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-mocks/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-mocks/ngAnimateMock.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-mocks/ngMock.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-mocks/ngMockE2E.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-mocks/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-resource/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-resource/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-resource/angular-resource.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-resource/angular-resource.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-resource/angular-resource.min.js.map create mode 100644 ecomp-portal-FE/client/bower_components/angular-resource/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-resource/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-resource/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-route/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-route/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-route/angular-route.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-route/angular-route.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-route/angular-route.min.js.map create mode 100644 ecomp-portal-FE/client/bower_components/angular-route/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-route/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-route/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-sanitize/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-sanitize/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-sanitize/angular-sanitize.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-sanitize/angular-sanitize.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-sanitize/angular-sanitize.min.js.map create mode 100644 ecomp-portal-FE/client/bower_components/angular-sanitize/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-sanitize/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-sanitize/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-scenario/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-scenario/LICENSE.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-scenario/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-scenario/angular-scenario.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-scenario/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-scenario/jstd-scenario-adapter-config.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-scenario/jstd-scenario-adapter.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-scenario/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/.gitignore create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/.travis.yml create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/ISSUE_TEMPLATE.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/changeLog.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/dist/smart-table.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/dist/smart-table.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/dist/smart-table.min.js.map create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/gulpFile.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/package.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/readme.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/src/bottom.txt create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/src/smart-table.module.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/src/stConfig.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/src/stPagination.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/src/stPipe.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/src/stSearch.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/src/stSelectRow.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/src/stSort.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/src/stTable.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-smart-table/src/top.txt create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/CHANGELOG.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/CONTRIBUTING.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/release/angular-ui-router.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/release/angular-ui-router.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/common.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/resolve.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/state.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/stateDirectives.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/stateFilters.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/templateFactory.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/urlMatcherFactory.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/urlRouter.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/view.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/viewDirective.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-ui-router/src/viewScroll.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-uuid/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-uuid/LICENCE create mode 100644 ecomp-portal-FE/client/bower_components/angular-uuid/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular-uuid/uuid.js create mode 100644 ecomp-portal-FE/client/bower_components/angular-uuid/uuid.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular/README.md create mode 100644 ecomp-portal-FE/client/bower_components/angular/angular-csp.css create mode 100644 ecomp-portal-FE/client/bower_components/angular/angular.js create mode 100644 ecomp-portal-FE/client/bower_components/angular/angular.min.js create mode 100644 ecomp-portal-FE/client/bower_components/angular/angular.min.js.gzip create mode 100644 ecomp-portal-FE/client/bower_components/angular/angular.min.js.map create mode 100644 ecomp-portal-FE/client/bower_components/angular/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/angular/index.js create mode 100644 ecomp-portal-FE/client/bower_components/angular/package.json create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/CHANGES create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/CONTRIBUTORS.md create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/Makefile create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/README.md create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/component.json create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/es5-sham.js create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/es5-sham.map create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/es5-sham.min.js create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/es5-shim.js create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/es5-shim.map create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/es5-shim.min.js create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/package.json create mode 100644 ecomp-portal-FE/client/bower_components/es5-shim/shims.json create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/CHANGELOG.md create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/CONTRIBUTING.md create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/LICENSE.md create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/README.md create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/changelog.js create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/hammer.js create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/hammer.min.js create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/hammer.min.js.map create mode 100644 ecomp-portal-FE/client/bower_components/hammerjs/hammer.min.map create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/.editorconfig create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/.gitignore create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/.travis.yml create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/README.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_config.yml create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/01_general.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/02_introduction.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/03_features.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/04_demo.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/05_requirements.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/06_downloads.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/07_tutorial.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/08_examples.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/09_usecases.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/10_changelog.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/11_options.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/12_autoescape.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/13_autoopen.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/14_buttonleft.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/15_closedicon.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/16_data.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/17_datafilter.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/18_data-url.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/19_draganddrop.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/20_keyboardsupport.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/21_oncanmove.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/22_oncanmoveto.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/23_oncanselectnode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/24_oncreateli.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/25_onismovehandle.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/26_onloadfailed.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/27_onloading.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/28_openedicon.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/29_openfolderdelay.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/30_rtl.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/31_savestate.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/32_selectable.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/33_slide.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/34_usecontextmenu.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/35_functions.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/36_addnodeafter.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/36a_addparentnode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/37_addnodebefore.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/38_appendnode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/39_closenode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/40_destroy.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/41_getnodebycallback.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/42_getnodebyid.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/43_getnodebyhtmlelement.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/44_getselectednode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/45_getstate.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/46_gettree.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/47_loaddata.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/48_loaddatafromurl.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/49_movedown.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/50_movenode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/51_moveup.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/52_opennode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/53_reload.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/54_removenode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/55_selectnode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/56_scrolltonode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/57_setoption.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/58_setstate.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/59_toggle.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/60_tojson.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/61_updatenode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/62_events.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/63_tree-click.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/64_tree-close.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/65_tree-contextmenu.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/66_tree-dblclick.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/67_tree-init.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/68_tree-move.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/69_tree-open.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/70_tree-select.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/71_multiple-selection.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/72_add-to-selection.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/73_get-selected-nodes.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/74_is-node-selected.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/75_remove-from-selection.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/76_node-functions.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/77_children.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/78_getdata.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/79_getlevel.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/80_getnextnode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/81_getnextsibling.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/82_getpreviousnode.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/83_getprevioussibling.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/84_parent.md create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/insert.py create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_entries/renumber.py create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/01_load_json_data.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/02_load_json_data_from_server.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/03_drag_and_drop.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/04_save_state.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/05_load_on_demand.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/06_autoescape.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/07_autoscroll.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/08_multiple_select.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/09_custom_html.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/10_icon_buttons.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/11_right-to-left.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_examples/12_button_on_right.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_layouts/base.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_layouts/frontpage.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/_layouts/page.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/coffeelint.json create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/gulpfile.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/gulpfile.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/index.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/jqtree-circle.png create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/jqtree.css create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/jqtree.jquery.json create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/jqtree.scss create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/karma.conf.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/drag_and_drop_handler.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/elements_renderer.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/key_handler.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/mouse.widget.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/node.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/node_element.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/save_state_handler.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/scroll_handler.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/select_node_handler.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/simple.widget.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/tree.jquery.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/util.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/lib/version.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/package.json create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/phantomjs/runner.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/phantomjs/server.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/screenshot.png create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/sitemap.txt create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/drag_and_drop_handler.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/elements_renderer.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/header.txt create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/key_handler.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/mouse.widget.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/node.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/node_element.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/save_state_handler.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/scroll_handler.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/select_node_handler.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/simple.widget.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/tree.jquery.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/util.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src/version.coffee create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src_test/karma-test.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src_test/test.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src_test/test_jqtree.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src_test/test_tree.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src_test/test_util.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/src_test/utils_for_test.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/blanket/dist/qunit/blanket.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/bootstrap/dist/css/bootstrap-theme.min.css create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/bootstrap/dist/css/bootstrap.min.css create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/bootstrap/dist/js/bootstrap.min.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/fontawesome/css/font-awesome.min.css create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/fontawesome/fonts/FontAwesome.otf create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/fontawesome/fonts/fontawesome-webfont.eot create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/fontawesome/fonts/fontawesome-webfont.svg create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/fontawesome/fonts/fontawesome-webfont.ttf create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/fontawesome/fonts/fontawesome-webfont.woff create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/fontawesome/fonts/fontawesome-webfont.woff2 create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/jquery-1/dist/jquery.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/jquery-1/dist/jquery.min.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/jquery-2/dist/jquery.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/jquery-2/dist/jquery.min.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/jquery-cookie/jquery.cookie.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/jquery-mockjax/dist/jquery.mockjax.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/jquery/dist/jquery.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/jquery/dist/jquery.min.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/json3/lib/json3.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/pygments/css/monokai.css create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/qunit/qunit/qunit.css create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/bower_components/qunit/qunit/qunit.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/documentation.css create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/documentation.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/example.css create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/example.scss create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/example_data.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/autoescape.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/autoscroll.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/button-on-right.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/custom_html.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/drag_and_drop.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/icon_buttons.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/load_json_data.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/load_json_data_from_server.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/load_on_demand.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/multiple_select.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/right-to-left.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/examples/save_state.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/static/spinner.gif create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/test/test.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/test/test_build.js create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/test/test_jquery_1.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/test/test_jquery_2.html create mode 100644 ecomp-portal-FE/client/bower_components/jqTree/tree.jquery.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery-mousewheel/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/jquery-mousewheel/ChangeLog.md create mode 100644 ecomp-portal-FE/client/bower_components/jquery-mousewheel/LICENSE.txt create mode 100644 ecomp-portal-FE/client/bower_components/jquery-mousewheel/README.md create mode 100644 ecomp-portal-FE/client/bower_components/jquery-mousewheel/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/jquery-mousewheel/jquery.mousewheel.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery-mousewheel/jquery.mousewheel.min.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/jquery.event.drag.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/jquery.event.drag.live.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/binding.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/handlers.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/index.html create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/interaction.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/live.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/method.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/properties.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/requirements.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/touch.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/jquery.event.drop.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/jquery.event.drop.live.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/binding.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/handlers.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/index.html create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/interaction.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/live.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/method.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/properties.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/requirements.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/tolerance.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/touch.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.keyend/jquery.event.keyend.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.linger/jquery.event.linger.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.linger/test/binding.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.linger/test/handlers.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.linger/test/index.html create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.linger/test/interaction.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.linger/test/method.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.linger/test/requirements.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.wheel/jquery.event.wheel.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/fire/jquery.fire.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/fire/test/custom.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/fire/test/form.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/fire/test/index.html create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/fire/test/key.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/fire/test/mouse.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/fire/test/mutation.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/fire/test/object.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/fire/test/requirements.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/fire/test/touch.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/jquery/jquery-1.4.2.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/jquery/jquery-1.4.4.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/jquery/jquery-1.5b1.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/jquery/jquery-1.7.2.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/jquery/jquery.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/jquery/qunit.css create mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/jquery/qunit.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.newstape/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/jquery.newstape/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/jquery.newstape/dist/jquery.newstape.min.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.newstape/gulpfile.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.newstape/jquery.newstape.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery.newstape/package.json create mode 100644 ecomp-portal-FE/client/bower_components/jquery.newstape/readme.md create mode 100644 ecomp-portal-FE/client/bower_components/jquery/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/jquery/AUTHORS.txt create mode 100644 ecomp-portal-FE/client/bower_components/jquery/LICENSE.txt create mode 100644 ecomp-portal-FE/client/bower_components/jquery/README.md create mode 100644 ecomp-portal-FE/client/bower_components/jquery/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/jquery/dist/jquery.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/dist/jquery.min.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/dist/jquery.min.map create mode 100644 ecomp-portal-FE/client/bower_components/jquery/external/sizzle/LICENSE.txt create mode 100644 ecomp-portal-FE/client/bower_components/jquery/external/sizzle/dist/sizzle.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/external/sizzle/dist/sizzle.min.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/external/sizzle/dist/sizzle.min.map create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/.jshintrc create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/ajax.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/ajax/jsonp.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/ajax/load.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/ajax/parseJSON.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/ajax/parseXML.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/ajax/script.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/ajax/var/location.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/ajax/var/nonce.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/ajax/var/rquery.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/ajax/xhr.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/attributes.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/attributes/attr.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/attributes/classes.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/attributes/prop.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/attributes/support.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/attributes/val.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/callbacks.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/core.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/core/access.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/core/init.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/core/parseHTML.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/core/ready.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/core/var/rsingleTag.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/addGetHookIf.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/adjustCSS.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/curCSS.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/defaultDisplay.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/hiddenVisibleSelectors.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/showHide.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/support.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/var/cssExpand.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/var/getStyles.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/var/isHidden.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/var/rmargin.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/var/rnumnonpx.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/css/var/swap.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/data.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/data/Data.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/data/var/acceptData.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/data/var/dataPriv.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/data/var/dataUser.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/deferred.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/deprecated.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/dimensions.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/effects.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/effects/Tween.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/effects/animatedSelector.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/event.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/event/ajax.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/event/alias.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/event/focusin.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/event/support.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/event/trigger.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/exports/amd.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/exports/global.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/intro.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/jquery.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/manipulation.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/manipulation/_evalUrl.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/manipulation/buildFragment.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/manipulation/getAll.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/manipulation/setGlobalEval.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/manipulation/support.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/manipulation/var/rcheckableType.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/manipulation/var/rscriptType.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/manipulation/var/rtagName.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/manipulation/wrapMap.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/offset.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/outro.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/queue.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/queue/delay.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/selector-native.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/selector-sizzle.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/selector.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/serialize.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/traversing.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/traversing/findFilter.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/traversing/var/dir.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/traversing/var/rneedsContext.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/traversing/var/siblings.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/arr.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/class2type.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/concat.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/document.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/documentElement.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/hasOwn.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/indexOf.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/pnum.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/push.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/rcssNum.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/rnotwhite.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/slice.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/support.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/var/toString.js create mode 100644 ecomp-portal-FE/client/bower_components/jquery/src/wrap.js create mode 100644 ecomp-portal-FE/client/bower_components/json3/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/json3/CHANGELOG.md create mode 100644 ecomp-portal-FE/client/bower_components/json3/CONTRIBUTING.md create mode 100644 ecomp-portal-FE/client/bower_components/json3/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components/json3/README.md create mode 100644 ecomp-portal-FE/client/bower_components/json3/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/json3/lib/json3.js create mode 100644 ecomp-portal-FE/client/bower_components/json3/lib/json3.min.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/lodash/.editorconfig create mode 100644 ecomp-portal-FE/client/bower_components/lodash/.gitattributes create mode 100644 ecomp-portal-FE/client/bower_components/lodash/.github/CONTRIBUTING.md create mode 100644 ecomp-portal-FE/client/bower_components/lodash/.gitignore create mode 100644 ecomp-portal-FE/client/bower_components/lodash/.jscsrc create mode 100644 ecomp-portal-FE/client/bower_components/lodash/.markdown-doctest-setup.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/.travis.yml create mode 100644 ecomp-portal-FE/client/bower_components/lodash/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components/lodash/README.md create mode 100644 ecomp-portal-FE/client/bower_components/lodash/dist/lodash.core.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/dist/lodash.core.min.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/dist/lodash.fp.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/dist/lodash.fp.min.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/dist/lodash.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/dist/lodash.min.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/dist/mapping.fp.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/doc/README.md create mode 100644 ecomp-portal-FE/client/bower_components/lodash/fp/_baseConvert.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/fp/_convertBrowser.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/fp/_mapping.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/fp/placeholder.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/common/file.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/common/mapping.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/common/minify.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/common/uglify.options.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/common/util.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/build-dist.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/build-doc.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/build-modules.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/template/doc/wiki.jst create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/template/modules/_falseOptions.jst create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/template/modules/_util.jst create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/template/modules/alias.jst create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/template/modules/category.jst create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/template/modules/convert.jst create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/template/modules/fp.jst create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/template/modules/module.jst create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/fp/template/modules/thru.jst create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/main/build-dist.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/main/build-doc.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lib/main/build-modules.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/lodash.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/package.json create mode 100644 ecomp-portal-FE/client/bower_components/lodash/perf/asset/perf-ui.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/perf/index.html create mode 100644 ecomp-portal-FE/client/bower_components/lodash/perf/perf.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/test/asset/test-ui.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/test/asset/worker.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/test/backbone.html create mode 100644 ecomp-portal-FE/client/bower_components/lodash/test/fp.html create mode 100644 ecomp-portal-FE/client/bower_components/lodash/test/index.html create mode 100644 ecomp-portal-FE/client/bower_components/lodash/test/remove.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/test/saucelabs.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/test/test-fp.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/test/test.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/test/underscore.html create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/backbone.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/test/collection.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/test/events.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/test/model.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/test/noconflict.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/test/router.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/test/setup/dom-setup.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/test/setup/environment.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/test/sync.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/backbone/test/view.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/license.txt create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/blank.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/buttonBg.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/buttonBgHover.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/debugger.css create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/detach.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/detachHover.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/disable.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/disable.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/disableHover.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/disableHover.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/down.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/downActive.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/downHover.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/errorIcon-sm.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/errorIcon.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/errorIcon.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/firebug-1.3a2.css create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/firebug.IE6.css create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/firebug.css create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/firebug.html create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/firebug.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/group.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/html.css create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/infoIcon.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/infoIcon.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/loading_16.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/min.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/minHover.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/off.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/offHover.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/pixel_transparent.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/roundCorner.svg create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/search.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/search.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/shadow.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/shadow2.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/shadowAlpha.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/sprite.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabHoverLeft.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabHoverMid.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabHoverRight.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabLeft.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabMenuCheckbox.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabMenuPin.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabMenuRadio.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabMenuTarget.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabMenuTargetHover.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabMid.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tabRight.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/textEditorBorders.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/textEditorBorders.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/textEditorCorners.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/textEditorCorners.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/titlebarMid.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/toolbarMid.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tree_close.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/tree_open.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/twistyClosed.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/twistyOpen.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/up.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/upActive.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/upHover.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/warningIcon.gif create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/skin/xp/warningIcon.png create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/firebug-lite/src/firebug-lite-debug.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/json-js/json2.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/underscore/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/underscore/test/arrays.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/underscore/test/chaining.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/underscore/test/collections.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/underscore/test/cross-document.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/underscore/test/functions.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/underscore/test/objects.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/underscore/test/utility.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/underscore/underscore-min.js create mode 100644 ecomp-portal-FE/client/bower_components/lodash/vendor/underscore/underscore.js create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/CHANGELOG.md create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/CONTRIBUTING.md create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/README.md create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/css/ngDialog-custom-width.css create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/css/ngDialog-theme-default.css create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/css/ngDialog-theme-default.min.css create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/css/ngDialog-theme-plain.css create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/css/ngDialog-theme-plain.min.css create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/css/ngDialog.css create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/css/ngDialog.min.css create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/js/ngDialog.js create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/js/ngDialog.min.js create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/karma.conf.js create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/package.json create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/protractor.conf.js create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/server.js create mode 100644 ecomp-portal-FE/client/bower_components/ng-dialog/yarn.lock create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/.bower.json create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/CHANGELOG.md create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/CONTRIBUTING.md create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/README.md create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/bower.json create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/composer.json create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/deploy-docs.sh create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/dist/select.css create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/dist/select.js create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/dist/select.min.css create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/dist/select.min.js create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/docs/assets/app.js create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/docs/assets/demo.js create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/docs/assets/docs.css create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/docs/assets/plunkr.js create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/docs/index.html create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/docs/partials/_footer.html create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/docs/partials/_header.html create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/index.js create mode 100644 ecomp-portal-FE/client/bower_components/ui-select/package.json create mode 100644 ecomp-portal-FE/client/bower_components_external/angular-att-gridster/angular-gridster.js create mode 100644 ecomp-portal-FE/client/bower_components_external/angular-att-gridster/css/angular-gridster.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular-att-gridster/styles/angular-gridster.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular-att-gridster/styles/ui-gridster.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular-att-gridster/ui-gridster-tpls-0.0.1.js create mode 100644 ecomp-portal-FE/client/bower_components_external/angular-att-gridster/ui-gridster-tpls.js create mode 100644 ecomp-portal-FE/client/bower_components_external/angular-att-gridster/ui-gridster.js create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/CHANGELOG.md create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/README.md create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/att-abs-tpls.js create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/att-abs-tpls.min.js create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/base.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/btn.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/demo.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/dtpk.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/frms.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/ie/backgroundsize.min.htc create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/images/down.png create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/images/up.png create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/images/upanddown.png create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/pages/iconography.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/sldr.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/style.css create mode 100644 ecomp-portal-FE/client/bower_components_external/angular.att.abs-2.17.0/styles/tbs.css create mode 100644 ecomp-portal-FE/client/bower_components_external/bowser/bowser.js create mode 100644 ecomp-portal-FE/client/bower_components_external/bowser/useragents.js create mode 100644 ecomp-portal-FE/client/bower_components_external/ionicons-2.0.1/.gitignore create mode 100644 ecomp-portal-FE/client/bower_components_external/ionicons-2.0.1/LICENSE create mode 100644 ecomp-portal-FE/client/bower_components_external/ionicons-2.0.1/css/ionicons.css create mode 100644 ecomp-portal-FE/client/bower_components_external/ionicons-2.0.1/css/ionicons.min.css create mode 100644 ecomp-portal-FE/client/bower_components_external/ionicons-2.0.1/fonts/ionicons.eot create mode 100644 ecomp-portal-FE/client/bower_components_external/ionicons-2.0.1/fonts/ionicons.svg create mode 100644 ecomp-portal-FE/client/bower_components_external/ionicons-2.0.1/fonts/ionicons.ttf create mode 100644 ecomp-portal-FE/client/bower_components_external/ionicons-2.0.1/fonts/ionicons.woff create mode 100644 ecomp-portal-FE/client/bower_components_external/ionicons-2.0.1/readme.md create mode 100644 ecomp-portal-FE/client/configurations/dev.json create mode 100644 ecomp-portal-FE/client/configurations/devServer.json create mode 100644 ecomp-portal-FE/client/configurations/integ.json create mode 100644 ecomp-portal-FE/client/configurations/mock.json create mode 100644 ecomp-portal-FE/client/favicon.ico create mode 100644 ecomp-portal-FE/client/index.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/AAI-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/APPC-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/ASDC-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/Closedloop-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/DCAE-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/DMaaP-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/ECOMP-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/ECOMP_Portal-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/InfrastructurePortal-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/MSO-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/Policy-controller.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/controllers/kpi-whitelist.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/AAI/AAI_KPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/AAI/AAI_Metrics.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/AAI/AAI_UserDefinedKPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/APPC/APPC_KPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/APPC/APPC_Metrics.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/APPC/APPC_UserDefinedKPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/ASDC/ASDC_KPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/ASDC/ASDC_Metrics.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/ASDC/ASDC_UserDefinedKPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/Closedloop/Closedloop_KPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/Closedloop/Closedloop_Metrics.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/Closedloop/Closedloop_UserDefinedKPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DCAE/DCAE_KPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DCAE/DCAE_Metrics.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DCAE/DCAE_UserDefinedKPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DCAE_DASH/dcae_locations.csv create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DCAE_DASH/dcae_locations.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DCAE_DASH/dcae_locations1.csv create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DCAE_DASH/lib/d3.v3.min.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DCAE_DASH/lib/leaflet.css create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DCAE_DASH/lib/leaflet.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DCAE_DASH/static/visjs/legend_v2.js create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DMaaP/DMaaP_KPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DMaaP/DMaaP_Metrics.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/DMaaP/DMaaP_UserDefinedKPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/ECOMP.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/ECOMP_Portal/ECOMP_Portal_KPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/ECOMP_Portal/ECOMP_Portal_Metrics.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/ECOMP_Portal/ECOMP_Portal_UserDefinedKPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/InfrastructurePortal/InfrastructurePortal_KPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/InfrastructurePortal/InfrastructurePortal_Metrics.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/InfrastructurePortal/InfrastructurePortal_UserDefinedKPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/MSO/MSO_KPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/MSO/MSO_Metrics.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/MSO/MSO_UserDefinedKPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/Policy/Policy_KPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/Policy/Policy_Metrics.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/Policy/Policy_UserDefinedKPI.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/sec-level-tabs.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/top-level-tabs.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/userapi-edit.html create mode 100644 ecomp-portal-FE/client/kpi-dashboard/views/userstory-edit.html create mode 100644 ecomp-portal-FE/client/robots.txt create mode 100644 ecomp-portal-FE/client/utils/test-utils/test-utils.js create mode 100644 ecomp-portal-FE/e2e/main/anchoring.spec.js create mode 100644 ecomp-portal-FE/e2e/main/main.po.js create mode 100644 ecomp-portal-FE/e2e/main/main.spec.js create mode 100644 ecomp-portal-FE/karma.conf.js create mode 100644 ecomp-portal-FE/mock/ecomp/data/admins/account-admins.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/admins/admin-app-roles.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/applications/admin-apps.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/applications/applications-onboarding.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/applications/available-apps.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/applications/user-apps.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/functional-menu/app-roles.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/functional-menu/dev.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/functional-menu/favorites.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/functional-menu/menu-item-details.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/functional-menu/menu-items.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/functional-menu/menu-items_small.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/ping/ping.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/user-profile/user-profile.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/user-profile/user-static-info.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/users/account-users.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/users/query-users-results.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/users/user-apps-roles.json create mode 100644 ecomp-portal-FE/mock/ecomp/data/widgets/widgets.json create mode 100644 ecomp-portal-FE/mock/ecomp/router.js create mode 100644 ecomp-portal-FE/mock/server.js create mode 100644 ecomp-portal-FE/package.json create mode 100644 ecomp-portal-FE/pom.xml create mode 100644 ecomp-portal-FE/protractor.conf.js create mode 100644 ecomp-portal-FE/server/.jshintrc create mode 100644 ecomp-portal-FE/server/.jshintrc-spec create mode 100644 ecomp-portal-FE/server/app.js create mode 100644 ecomp-portal-FE/server/components/errors/index.js create mode 100644 ecomp-portal-FE/server/config/environment/index.js create mode 100644 ecomp-portal-FE/server/config/express.js create mode 100644 ecomp-portal-FE/server/routes.js create mode 100644 ecomp-portal-FE/server/views/404.html diff --git a/.gitreview b/.gitreview new file mode 100644 index 00000000..05c5a73e --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=gerrit.openecomp.org +port=29418 +project=portal.git \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..107a11b6 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..e4a40b06 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/portal.iml b/.idea/portal.iml new file mode 100644 index 00000000..d6ebd480 --- /dev/null +++ b/.idea/portal.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..d14af4f9 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1486497013233 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..880bbc9d --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,19 @@ +/* + * ============LICENSE_START=========================================================== + * ==================================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * ==================================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ==================================================================================== + * ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property. + */ \ No newline at end of file diff --git a/ecomp-portal-BE/.gitignore b/ecomp-portal-BE/.gitignore new file mode 100644 index 00000000..f3fcea6a --- /dev/null +++ b/ecomp-portal-BE/.gitignore @@ -0,0 +1,6 @@ +/catalina.base_IS_UNDEFINED/ +/target/ +.classpath +.project +.settings/ +/bin/ diff --git a/ecomp-portal-BE/README.md b/ecomp-portal-BE/README.md new file mode 100644 index 00000000..35ec4e09 --- /dev/null +++ b/ecomp-portal-BE/README.md @@ -0,0 +1,7 @@ +Quantum +======= + +Framework for Java Application using Spring and Hibernate with Analytical Engine and Workflow + +build using maven command: +mvn -U clean install diff --git a/ecomp-portal-BE/distribution.xml b/ecomp-portal-BE/distribution.xml new file mode 100644 index 00000000..6cef2812 --- /dev/null +++ b/ecomp-portal-BE/distribution.xml @@ -0,0 +1,26 @@ + + distribution + + zip + + false + + + ${basedir} + + + **/src/org/openecomp/fusion/** + **/src/openecomp/raptor/** + **/.settings/** + **/target/** + + + + + \ No newline at end of file diff --git a/ecomp-portal-BE/ecomp-portal-resources/sql scripts/Apps_Users_OnBoarding_Script.sql b/ecomp-portal-BE/ecomp-portal-resources/sql scripts/Apps_Users_OnBoarding_Script.sql new file mode 100644 index 00000000..e9fa6227 --- /dev/null +++ b/ecomp-portal-BE/ecomp-portal-resources/sql scripts/Apps_Users_OnBoarding_Script.sql @@ -0,0 +1,320 @@ +USE portal; +-- Apps +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 + (2, 'xDemo App', 'images/cache/portal-222865671_37476.png', NULL, NULL, 'http://portal.api.simpledemo.openecomp.org:8989/ECOMPSDKAPP/welcome.htm', NULL, 'http://portal.api.simpledemo.openecomp.org:8989/ECOMPSDKAPP/api', '', '', NULL, 'okYTaDrhzibcbGVq5mjkVQ==', 'N', 'Y', 0x89504E470D0A1A0A0000000D49484452000001680000012C0806000000EE2C29AF0000200049444154785EEC9D099C5D6579FFBF67B9EBEC5B6626B364DFC91E12080142D87710595C0A5A37B455FBD75AB56A6D6BD55A6D6D6D6B6BAB15045111C50504917D95B0869090909DEC997DEE7AF6FFE77DCFBD333721C0850C3093BCE7C3903B73DF7BEE39BF73CEEF3CE7F7FE9EE7D1508B424021A01050088C4A04B451B9556AA314020A018580420045D0EA24500828041402A3140145D0A3F4C0A8CD5208280414028AA0D539A010500828044629028AA047E981519BA510500828041441AB734021A01050088C520414418FD203A3364B21A0105008288256E780424021A01018A50828821EA507466D96424021A0105004ADCE018580424021304A1150043D4A0F8CDA2C8580424021A0085A9D030A01858042609422A0087A941E18B5590A018580424011B43A0714020A0185C028454011F4283D306AB314020A0185802268750E280414020A81518A8022E8517A60D466290414020A0145D0EA1C500828041402A3140145D0A3F4C0A8CD5208280414028AA0D539A010500828044629028AA047E981519BA510500828041441AB734021A01050088C520414418FD203A3364B21A0105008288256E780424021A01018A50828821EA507466D96424021A0105004ADCE018580424021304A1150043D4A0F8CDA2C8580424021A0F5A6EC40C1A010500828041402A30F0145D0A3EF98A82D520828041402120145D0EA44500828041402A3140145D0A3F4C0A8CD5208280414028AA0D539A010500828044629028AA047E981519BA510500828041441AB734021A01050088C520414418FD203A3364B21A0105008288256E780424021A01018A50828821EA507466D96424021A0105004ADCE018580424021304A1150043D4A0F8CDA2C8580424021A0085A9D030A01858042609422A0087A941E18B5590A018580424011B43A0714020A0185C028454011F4283D306AB314020A0185802268750E280414020A81518A8022E8517A60D466290414020A0145D0EA1C500828041402A3140145D0A3F4C0A8CD5208280414028AA0D539A010500828044629028AA047E981519BA510500828041441AB734021A01050088C520414418FD203A3364B21A0105008288256E780424021A01018A5088C28416B1A68E27F6A510828041402C718024110100423BBD3234AD0B1884E32668CEC16AAB5290414020A81318080E5F8642D6F44B75411F488C2A956A61050081CAB0828823E568FBCDA6F85804260D423A0087AD41F22B5810A81A31701A1B18A45CD331DFE182B823E7ACF7DB5670A81518DC08E1D83DC7BEF4EB98DAB5675306142F5A8DEDEB763E31441BF1DA8ABEF54081CE308B8AECBAF7EF5221FFAF0831289EBAF3B830B2E988CAEEBC7383207EFBE2268753A280414026F3902B66D73D34D6B79FF9F3E2CBFFB673F3D8BCB2E9B8E6128C756E9C15004FD969F9AEA0B15020A817C3ECF0D373ECB873FFCB804E327379D21093A128928704A105004AD4E07858042E02D472097CBF1A31B9EE1DA6B9F90DF7DD34DA7F3CECB6628823EE44828827ECB4F4DF5850A01858024E81F3DC3B51F5504FD6A6783226875AD280414026F39028AA0CB835C11747938A9510A0185C00822A008BA3C3015419787931AA51050088C20028AA0CB035311747938A9510A0185C00822A008BA3C3015419787931AA51050088C20028AA0CB035311747938A9510A0185C00822A008BA3C3015419787931AA51050088C20028AA0CB035311747938A9510A0185C00822A008BA3C3015419787931AA51050088C20028AA0CB035311747938A9510A0185C00822A008BA3C3015419787931AA51050088C20028AA0CB035311747938A9510A0185C00822A008BA3C3015419787931AA51050088C20028AA0CB035311747938A9510A0185C00822A008BA3C3015419787931AA51050088C20028AA0CB035311747938A9510A0185C00822A008BA3C3015419787931AA51050088C20028AA0CB0353117479388DECA8C027E8DB4490EB26705290EB016B407E879FD9034E06341D2D568B166F18FEEEAA7630A2F26F5A450B5A55C7C86E975A9B42E02D4240117479402B822E0FA7231BE5D9787B1F23E8D900D97DF87D9B09522F110822F62D70B2E0E6E57704760A7C1BD0C04CA09989E1EF8ED5806EA0991510AD444B8C43AB6845AB9B8ADEB400BDE93888541DD9B6AA4F2B04DE020414419707B222E8F2702A6B54E064F1773D10FEEC790CDC4C48BA411046C86E163C9BC0CD41E095B5CE571DA4E961442D483C528516A900CD90DC8E66A25577A2371F8F31E522B4FA1947FE7D6A0D0A81114240117479402A822E0FA7571D153869FCDD0FE33CF8391919E33BE0BB829A4760ED47B00A41E0BA8956D18631F14C8C1957A2B79E1092B85A14026F23028AA0CB035F11747938958C0A0A32842789D87BF116DCD55F23103AF2DB4DC8AFB92F1A5A653BD1737F84563F538ED68CA8945284E67D444BE01FF93A8E6803D487C712028AA0CB3B5A8AA0CBC349926F90EF87D40EECDF7F00BF677DE1936F73945CF6F6970E141A48B8E813CE20B2E43352C7D6E28D523279DD8BEFE1F73C8F5E33456AE36A5108BC16028AA05F0BA1F07D45D065E024A2E3A0E779BCADB7E36DFC0941B6AB8C4F8D9D21C22DA2B79F823EE97CCC199783997C5D1BEFEF7F1AE7912F1039E9ABE8CD0BC3094EB528045E050145D0E59D1E8AA05F15A780207B006FFD0DB8CFFF1FC1E08E9199DC2BEFD8BCF5A38C3891657F8DDEB112BD711E98F1D7DE063787F3E89771D7FC37D10B6FC6987096923A5E1BB5637E8422E8F24E0145D087C3C9B371D77E9F6060AB24687FCF2304E9DDE5213AD6471931F4A6F9D2B6A7554FC098740E5AFDAC9793AE67E1EF79146FCB6FF05EBA97A06F23D1F36EC2987AF13137095914B90E7A6E38EC1FC7FAC93172DBAF08BA3C2C15411F062777C34F711FF834415E4CFC1DAB8B06D12AF471F331A65F8131ED32B4787D0846E0E16DBF0BF7B12FE377AF1B7AAA889EF13D8C59EF91CE91A37E11D6C921460E5F084E1E7E558A80927C0E3D1F144197778528822EC129187C09F7C97FC2DB7A1B41665F79081EEDA3444663BC1EF3946F624EBB2C9C44B453E46F5A4630B84D98BC8710889EFE5F18B3FFE4D8216841C99A349D176E5CE2F7024D07E26FC5F78FF693E4F5EF9F22E8F23053045DC0C9DBF63B9C873E2F650DE96356CBC108442A3067BE1BF384BF913730E79E8FBDCC561859F135CC851F073D72D4A327EE4B828A050F0B2A9626456935D408D0C2FB56E13D153FBFFC7450045DDE25726C13B4A88931B00DE7F1AFE26DFA257861BAB55A5E0D8122DDBCDC5E689EF02569D97B4356BD510CBACC042D2C322E16241C804B40CE87BC1BE0BA015EE0636A1A31D3A0361206D732BE9651B65A4A1150045DDEF970EC12B4A88FB1EB01DCC7BF8EBFF7D1F2D052A35E150173E127899CF4F760C4DE52A402E151470BC970580816A5A70AF2C3213715C9B705F61CDA521112879244715D22440ED71D126DA005E41CC8783EBD399FFD298BFDFD167927C0F1021CDF470B7C6246C0B82A9386AA38CDD5719A92260953470FD732AC5617C3EFB714ADD1F1658AA0CB3B0EC72C41FBDD6BB17F7DC9B1E3CE28EF7C38A251C6DC0F113DE59BE5D9F38EE89B0EF970416E10EC2CA25D3D64D39249BB428EA7E064190D0B223E38DD5D727620A859BC1B927DB804782252767C7AF32E2F7459F4E61CB2B64822D0B0020DBFA0377B22B9544CA0FA2E9A9BC7C4A73AA633BBA592992D55D4554431C4BAB5A1DB49E12B8E3DAD5A11747917C03147D041BE177FF3ADD27DE0AEF96E7928A951652160CC7C37D1D3FF334C1D7FCB96909D8BD41A68BE50802110AAB02E63683B08C87922E2CD3360B9641D485B3EAE0F9E1F485295E42C43E580A20745C7A33611A33259417FCEE140DAA1D7127F15045E903964E0ED83EFE37B3E7E10E0061EBEE71278E25F8FA4EED25A1B637C759C8698C6FC094DE1DCA2F84EF1427EEFB1258328822EEF0239A6085A249AB8CFFC3BEEDAFF05CF2A0F2135AA6C048CC917C83A1FAF3713B1EC2F78D9C030622ECD5C143C27485944B53DB6C78BBD3976A65C76A61D3674E5E8CA7BA41D8D8CE5E00BDD5844BB9E85E179E88120581F538811814F7D4594396DCDB4D7D71574643FBC19F822AAF62531FB5E611B84262D09DAC317A9EFAE8D2F483BF0B17D5FBE879527A9D9BC7FC54C3AC755A10782EAF5B0F6F71B07614C7E5211747987ED982268FBDE3FC37BE12610E53ED532E2081813CF217AFE4D6F3A418773768589BB21D942BCD0480501BB52369BBBD33CD365F14C9747BF15907675D29E81E30798BE4BA59F2111D844F048682E31CDC790D28329A58CEACA1A6674B631AE224E4484D6224A0E021128E307A1941112B420EA50BF766420ED11F81EAEEB84442DA3690FCFF37005613B2E932BE0B485139935BE16B320CF8848FA58226945D0E55D7EC70C418B7A11F61DEF0D6D746A795310D05B9711BBF47720EA528FC47270703CB4462929C8B8599072381198436767D6E5B60D0758D765B32FEDD2E3C5496B7149A49AEF92D0032A758F3AC365BC99A7427388E113D73C0C215CE8069617A1DFAC605C731B159118BA274AC70A32464A1BC2A9218857B2B4F89B27DE13441C482216E42C48DBF15C193D8BD79EE7E2FA01AEA7A189D7F92C13EB34CE5B3A9599CDF568F8324297D1F431B228822EEF401FF5041DA477491B9DBFF9370456FFDB5B4BC38862B42E43EB380D73F6D5A0BF81CA71C5E3EAA4F15EBA077FDF9304FB1EC7EFDFF2B6FBB7F5A6B9C42EBF0F22475ED16EC83921E977386F5A44AB9A9888D34DB27EC0833B06F9ED867EF63B06B66630E847707C0DDFB1A88AF8CCA88FD35913A53E1145CFF4E1A57AF173299C5C56BA2E021101FB1E8316F47911DAA6CEA2A65AB4190B35E6A0206548995946D0A15EED89509A90A0FDC09551B47C2DA2651129FB829885DC11FE1BFEF8F8AE8BE3DA684E8E981E70F6FC0ECE5B1436530865E863238E5604AD085A12B2FBE43FE33EF39DB74773D60D6939D31BE6622EFA24C6A4730B0E8791BE0803BC6D77E2BF7833EE8E3F803D0822F27B8BEB536B15E3895DFD2C5AB4BABCB3EF554785141D52B398F813C4A8E36B06BE1FB07130CBDD9B7B79648FC77EBF02CF088DC7819DA54273195F6932735C2553EBE218BE8D97CB92EEDA4F3E3D8863E5C9E52D5CD796137929CB67902A5A672DA4A1A989C0B6C3893FA95C08520E658CE26BB945051216842D74EC21822E21E4E218296F8888DA15DAB48B23E63F1C3171E971D2F446DE7FCA5C12868E9CE01CAACB3DD2E7C8081C92115C8522E8F2C03C7A2368CF92C927F6FDFF0F44E4FC562C661C2DD1282348D17E4A9F7016C6940BD11B8E7B8B92370A74B66F35CE837F45201BD10690EF0FEB8AC82E2F6FDEA225C711BBE6F91121681929173655389185D52D6B7B64ED803BB70FF0D8CE4176E60D5C2389661818BA89A1F94CACF0985897A4A53A4652F3D06C1BD7B2B133830C76EF259F4D63DB16996C56EAC4AEEF918D34D230653EE3C6B586BAB2EFA1090943C4CF7E48CC45722E9275F15F215F841383C311B378EDBAEE10897BAE3B1C5D7B1EB663E10A95C473195F1DE1B2A5535838B995A8A117DC1D85F4F1A398A3154197771D1E9D042D1E81B7FC264CDD1EDC5E1E1247384A448DA2A09031F783E8CD8B0A6B7B3BAFB0822C200867FB9DB8CF5F87DFBD8620B52B9CF07A9396F8B5FB6437F2235D849C204D7281262D725BFA73DCBFB597A7F6E5D81B6B0E73AC038D58E0D2561130B93E416B65942ACD1EF2310BF9C2C967C9A57AC9F60F30D0DF8D95CB60E7F3643359529E4EC6A862CAFC65348FEF905639690191138021297B624250FCBDF8BBD09905714BF942481D05D78688A40F913464042DA26741D04592F67D6C4744D10E81EBE0E472B4D5E87CF0BC1399DDD91A4E488682C7512D7728822EEF0A392A09DA3FF02CF69DD7C812986FF6A245ABD01AE76174ACC498FFD130821E858B683AE0EFBA4F4A21A2E98098F87A33969122683909878FA7C1133BFBB9FDC51E36E5A2E48C04B611C3F05CA2F84CAE3139AE394175C44017A41E88A70431D916E0B90EB9C13E327D7DE407FB1918ECC1CEE4B0F27906B2797AA964DCD4794C993E8398190953B8A52B4310B2F837F4498BDF872368A1390BDD3AD4995D394958785D42C245B22E12B4EB384304EED80EAE277E5C1CDBC2B0D35CBAFC382E5BB180642C8226273EC53EBC9D37F837E3EC185EA722E8F2F03D2A09DAFACDA5F8DBEE280F812319251EAB279D87B9F4F3E80DB3DFF214E737B4E9F620CE93DFC2DF7E17229B7244BA8B976C48FCFD1B651DE9D7B71C5CA85364FB0951C30D74B6F5E6F8C5865E9E1ED071A2893043D0F5A8323CDA6B624CA98FD310054338354A547749AE769E74CF7ED27DBDE4D2830C0EF460A72DAC7C96DDB98044DB2CE62C3A9E8A8A4A49CCC2972CA366797318D6990F92388250AE2812F6101117648DD2285A4E18BAA1E54E46D18508DB16B28BE7E2899E968E8D9549735C5B1D9FB8FC4C263454A369E2E629321D1541BFBEF3E8E81B7DD411B4A8B466DF76E588134FE9A1D79B9760CCBC0AADA205AD6E067AE3DC317566B8EB7E88BBFA1B6107F211963B62EF79E2F5E321095952A2A4249164B2664F3F4FEF49B1C38EB0336F92F185633920E6DBCC1F5F43B5E15117D3881B05122BA64F0F293B3EF9CC207D7B77911DE8259B4E3338D0473E9D23E3B8C4A79F48E794695455540D4D060AC786FCEF9049C1E1DF45C4EC1C44CEAF48D04E48C87282D00DA3E7A22E6DD9B69C2CF43D1BC7B1C85BC2F2E771ED25A772CEE25918BA70AA88041645D063EAC27A1336F6A822E820B513EBB7EF20E85AFB264035BCCAF8D56BD0AA278E8D88F93048E47F309920BDE74DC12876E9EDE89DA7BFBE754B3B9B706978B24646D685AFDFF322FBFC24D9682522B74F44B871CD62725D8C79E31232EB2F8CB443395A96D728D4D090E288EB4A79A36BD776B283BD58990C03FD29329914079C08275F752DF18889CCF716E9DEC5B24842572E44C862278A041C46D182A08563637842B07432B0F85A4C1C7A43045DF041BB6E18450B0DDAB2A4FE2C2418DBB1C9BB0E5A3ECDFBCE5ACA9F9C750211532790553B8EDE45491CE51DDBA387A07D07E7EE8FE26EFCE99BE656D02295444EFBB7B06BC8185DDC47BF8CF3C437DEB4AD8F5DF44BF449E7BDAEF58799819E4CD6C8A273DF867DDCB2C3213013385A4C929A48919ED118A7B3364195970BED76D2922688BA506DAEF0AD527E701D327DDD74EFDC4636DD4F2E9B61A027C5817496C15813175E750DBEE30C45CF82A48B245CF4380F5BE9428D59BC1F46D0E1EF87BA358674E6E2C4E050041D927351E6102E8EC0B1E5F7DBAE70A638C434978F5F761A172F9D8121DC1C52E278854C9DD785EEE81CAC08BABCE3727410B4886CD65D8FFBE8970872DDE5EDF9EB19A519E8F5332439EBE34F1A7B4D51858CE1E5711EFC2C42DE1879BBDD70E9CED885BF40177EEFD27A70C5A240AF8079B1DEB2706EDFFDC25EEED8D045AABE1D373024D655584C6F8CD35E1D23E2B918854A756175A3E145FCE6E9A07B019E6D91EAE9A27BD736B2A901B2B90CFDBD29B6A55C262E5AC9FCB9B343392308B30385AD4ED4D8184A4639C8EB3C4CC842372E7A9E8B12C610593BCE505AB7533A29E83838452747E0625B7902DB9263C5053868392493493E7BCD799C3FBD49EC32BA22E8D773851EB5638F0A829605901EFF1A81D537F2074A74BA3EF59B98733F3846276D02DCA7BE8DFBC43F859994872EA27F60690714DD402BCD70946C2192404AD29045DB2B59AE332448BD6A025AB245BED666BF07BDE37499622252988533A248D6438FEC850247A2BEB2AC4317183CB3B397DFACEF62AFD98863C6F00257AE43A466CF6E4AD092142E8D32EC81528AF064324AAAFB00DDBBB64B592397C9B2617F9696E356B060F102022B47E08B6CC1128F7321392524DC421D8D82BFB9384E44C132922EF89CC3ECC1A29D2ED49A053917DF77E524A1156ACE52F670C8590E9A97C77534F6EFCCB2DFAB22DFDA8EE70DF0FCD72E624A4DAC509D4F24AE1C5C1675E44FF0B7678D2A822E0FF7A380A0039C073E83FBEC7F94B7C7AF6754A40263F285984B3F875E3FF3F57C72F48C75F3B84FFF2BDE965F0F6F53AC6EE8B5B005EA95E387DF8BD74265C7F0FBD14AB48A5634235E1410A076329815720EAB58B728CC5216948CF40ECB1F517FA2F023A95546D282EB75C4DC5E54D788E8A1FDF8862776F374DAC48D26080283C07749EA1E136AA2B45747881D142D9746CEA54A6DB10F958F9DCF91EADA4FF7EEED64B329B2D93CBBEC2A169E722E15C9B8D4808BA45B9A2D38246B14ABD215A48CE29821CD596607869380421F179F731C7B6832B0286738628C63E18BF7A4CCE160E75D02CBA6F7A51EF6AEDF47CEAC21367F01D9C66AFEF2CC4EFEF2AC9924A2A0FB1ABA2C6E7DF42D8AA0CB3BA6639EA0835C9724684F68CF23B908729E7E854CD11EB3E42CF070F304B903F2DFE2A2D54D7B0DA45E9D14427A0CFF2F26E67C7C59252EEB06A41D9F7D595766FC651C9F8CE591737DDCC2849EA60798862EB3E66A22260D0903CBB1B977A7CD3EDB9451B24714337098506DD2561B23AEB98542FBC3B98507EF4089C12E0CCAB1F35952DDFBE9DDBD834C2E454A54D86F5DC09459C785E42CEF188592A142DA2868CCA5045DEA6F2E92B9888E4B53B8858D2E4C5A0909BA48E0C24A17A67887041D5AED7C3C274FC4F278E9B92DECDFB8172DA3E3E9519C8E0ECC8573A8AC36F8CA550BB962712771B123C2CC71144E172A822E8FACC6344107D90378EBAEC35DFBFDD03236528B192772D25731269F1FBA35D4328C80205AADD0F6296BD39B73E9B321E56A64DC80941DD093B125613B5E6892F0440D8D02A9CB24104DD46DD33074D1BF4F7424F118744D9C20228958C365526D84D64484B819BA3B6481FC728F83F86E2B47BAFB00BD7B7791CE66D9D59F63E2E255D4D7D687645CC80E0C35E7E1449450BE10863EF1B790788BA45B2A6DC8D4EE82C75992B41827A40DE1E010E9DCD2EB2CA40F1BCFB6B11D07CD7798D652CBC9D327B167D376BCACCFB34FEDE00F773D8F1B4DE2B58DC35FBA9089ED493E7CEA24DEB9A08371C9E106BC47536F4345D0E59DCC6397A0453AF7F6BB70EEF93382CCC85AC6F496E3895DF95079081E6DA3645FBE304216C9D6C51E7FA5D5E5065C8FD53B07D995121D4620E31B7242CF2F481C82600D024C4DC7D075F442417A41B122CF2F10937C22CAF57DF2521E10A590345C4D481B3ED59ACDA2B64A0C1F7491B42199B91825CB02D00583434995BBE1E70349AE5E3E4BBAA797BEFD7BE94B6779B1DB62E189A7529D88E3A1CB0A766252505AF264BAB6D88ED04A17DAECFC421AF7C13536A47D4E96112D789CA5AE2C3CCD3E8E889285B75910B72DD629A2680BCF72F13219668EAFE53DE7AF64765B3DA669629A70FD0FEEE6CB7FFD1320229BD006679F46B6BD9D96448EBF3B6F16EF3E7E62D815B168F72E3CB78CF5D34E1174794770CC12B494361EF922DEFA1F85CD3E4768D192CDB2E8BC746B1C934BB14DAAC0542F31196BB283F54B83393675A559DF07592D2A2701A503423C8D8B76513AD4C4848461C81FD1E5DA1C9A272C8823225B0F64946DB9E2C7A7CFF2C8D86194D95E5B495B8588B143CD5A9775374A3BC28A770A5AC641253A430D5C4817BE20E8BE3EFABBF6B3BB37C39E7C8C79F317509988CA9B81E88452ACAFE1FBC58247226F6798984B4B850EC91A8290658D8D83AD73E27D1125FB2285DBF5B12C4F5650F4FC1CBAE5B368C2781A2339CE5E71022DCD09224682542AC3BF7CF397FCE8BA87087413D3D7E8EB68A1F2E453B0123E57CDA9E2BB572F2FECAB48E229765E19FBBAB422E8F2C865CC12B4DFF52CD62D6785A535476A31A244CFBD514A1B8736151DA9AF18BDEB292ACBC566AB855ED9F2CF3A5D399B67F7A7D8D827122B4CD2A688443574DF23AA7924220615D11815A6415264F50D3546152E8D029916495570A3E45CAD10750B7FB14ED676A503A2B62A4E2408CBA58AD653A2C6864CF12E74DC96938845538988CE75D188B564C63270F16D8B7C7F2FFDDD5DBCB0378D956C64D6B4A952FB16DB5DACB921562DEA39CB4E2805B943481A6219AEE35C8CB043194390BB4C462990743199C595B246585AD4B184734344E52EDD2F6CE5FCC57338616127B95496D3CF9A876926D8B1753F5FFADC8D3CF2E84B843DBF0306741B6DFE71C416CF63D9D41AAEFF9345D4C6C4934C98C473B4E8D18AA0CB63823149D0819DC2FAD10282CCEEF2F6B28C51A22468F4829FA1D54E2963F4D1386428264597C5E803990CD263793CBB67807503016922328A132363814D753442752C414C4E64899E7E61A0EB16026FBDE08A93997E251284142C869414591B0E3F083DC4B82EBAEF080B88ACC521A5132326234C0C83401335A1CD90D865C966596EAEB0F6403658D1752F8CDAAD0C07F6EE63F5F61E264E9D496763B57487084D1C5F4CF6850F5FC311F470F2496979D183B205EDD04A5724E7A25B43DAEB44753A173C51903F9726D3956560FB368C9E1C99BE34FFF0CD0FD37D600FEF7A9748E4091D1A8F3CBC817FFCEA4FD9F8C25E342D82E7EB58BA8F3F7D0A0D272EE2FCA575FCD5B9F3185F119337BDA3A53E8722E8F238646C12B4D54FFEBF43DFED482DD133FE0B63D67B0FF6048FD4CAC7D47AC20ED50E3A2F0D5A3C2BEA616475F2BA298BC9EB1E183A3455992422427E084B82CAC7EF21A9342C052A5D120769A701811ECA2132AA16516BB16EB2F005CB4ED8521426E71BE8461C5DD8EECC381866988E2D3E26B2088BB2967487143569999018B6B8127BE0FBF41CE865DDCEBD4C9E3C85A6AA78E8B8D07402D1D43510242F9253C2087A285BB0B04DC58494616B5D18410F47D607CB1C395754A60BF7899C4D76C77E1A4C93DE3D7DF4F7F5F1F75FFD30BB766EE4F2779E8B666852833ED095E56B7FF7536EFBCD13327BD04378A05DAC649CE8B2C54C387E027F73E12CCE9AD1425411F498BA92466263C72641A7F720EA498CD862C6899EF793B0E3C9B1BA14345E99D517681CC839FC7E730F075C13DF48485434DF23AE05542522544544342DDC0EF29D30242E4E2DFAA1FE20125104414B322E261BCA529D61EB28D9F95A140EF25C701DA947677D0D2B8044552391681CCD8884845A1281CBE8B650BD2E944FC2C85DC6E28198001465472D8240978D65D2C2DA6646658358D9AE4A4A1CA2EBB6B81784DB22BAA2941274A9DC21FCCBC59E83A254E870C5BA509209A3690FD7B1713C1BCD72493DBF9B591DEDC47483679F59CBA92B8EE3A413A793C90EB2EACC2572F2547CFF9A67B6F1CDAFDFC2534FEC243084D061E2EB2EA2E7BC376306D5A72EE45DC78FE32F56CD05F8E9980000200049444154A035190DA59CB12F41A322E8F28866EC11B4C8127BFC1F711FFF4A797BF81AA3B4783DFAC4B3892CFD3C5ADDF41159E7985C492112CD3A3E7B07F36CCBF8ACED71F08CA8E45E91541237022A2286AC2057CC1B09FB9E849379B2EBF590F61CF276283F87EE084D4CAEC91467D1FE29D470450A74266FA1099B991E27EF413499A4B2AAA630F77B88BDAE90F957ECB83224CC14826841B8A1C02D32FEC4A45F78F310FD0085BC216F0E224897DEE502F10E15DD0F2D7787764329FDDD91FEE642012441CCD25A27925544F289456D328696CEB26BF5666A9249E90469AC4F72E925A7626879DA3B5A19DF568BEB6ADC73CFB3FCFC670FB2E6995D64D3BED4D50D7103110A8C48F4696B2376C6494C6C31F9F8E993B970763B8948A1EBCA18676945D0E5B1C49823E860701BF91F2D94B5258E78D13459CF3972F237D06AA71EF1EAC6E60A42660B894E63F5CE3E9EE9CACBC2F89A1E911367E2C1BB361125618849AA70E2AEAC4508C2821045042AAAB78908339F95C48CE7627BB03FEB9173A0B1AD938A9AFAC2649F30C2BDBCC3753159446E6D8971A758CB43BE2FC3E2F0CDC3950D3D2821454A1B0737782D7A9D8B29DC323A2E494E2926A014A366DB11892A3681936362758CE5D3A6A00FA6184CE564D1A38898344D98B4B737D1DED68C6906446326B93C7CEF7BB773E30D0F92C91452DE8550248F45B8EF7E5515C6F22598131A58DC11E5DFAE58425B9DA8892DACE4633B8C56045DD615246BB5648523680417AD57642B8CD0128BE82463C3F508DC67FF13E7814F8FC8DA450F3D73D917308FFB008849A86364199E6A2AB82B0AD1A7E5C3CF9FD94F774444B326119953E25111D1A88A849639C97D8714292AB1E90E491B61990DD1C5DAC6CDE724397B82E8EC9C7CB477759DAEAC478F15A1B9B595EA9A5AA9718B6E2261958F83097A989CC346AE434B21422F9276D875FBF0CD5E8B641C16E50F5B5589649430221E766A94164112BE67910558B4DC494943C8197E2133D0168E911CA66F71F1E2494C6B692016C0E0604E626598060DF595D4D6C6D1759D4824413C5E496068AC5EBD99AFFCED4F79716377F81C229374C2671291DAE3440CFC59D3491E3F8F9A44C0CF3FBC94E9CD95614B2F45D0C7C4D53AA6085AF4D3B36E3D8FA0EFC5233E385AAC0663C19F61CEFFD8A86D5375C43BF90A2B18266831ED1652C2BE812CCFEDE9678B5D8DA78B093F5F3A2112D2D32CD22884AE1B6AC16191A38397E1782E407444153286487116197D5E3E272500291F68263BBB53EC1DB4E998328DFABA3AE2B1F8505D8FA2C9EFD06A78A551B2F8E6E2EF52832E1072694D8DD22248A58E8C62042D09B91041BFAC2A5D21F124CC142C46D0218187198285FD131DBAD3194C2B4F1D0133C7D572C292195455E8C4A249A2B118A6283AA2F998119DAE9E1CB7FCE27EB66EEDA6BEBE86CD5BBAD8B6653FAE250A2709D8C4646B44EE8F30037A41805D5B4DCD49228A6EE53FAE9ECF19936B0BE246F118BC3C921E0BE4AD22E8F2AEEE3145D0EEFA1B71EEFBF383EA4A94B79B2F1FA5D5CF2076E9EFD02ADBDEE82AC6ECE742822E265F6BA42D8F3F6ED9C7D69C8615AB938FD9A2FD5345CC2026324F8417B9CCB929E1D7F5F2966C3725C9D9B664F42C4A9C0AC259BFCF626B5796798B16D0D9DE84212ACA8571B7DC2A59FD4EBA42866F0282188BCB417246B1F3F7219DB75FAD0892889C65328ACC16149383C3D1F310514B1B5DF8775943A35846D4F711DD508487DAF65C74C72261E789BB79E6774C62EFAEAD9C71F2121AABE338A64977574E584E68195F41736B1D4F3CB19D4F7FFA7BA4D28284435D7EF98953B9E4A21359BB660BB7DEFA0039CB0C495A3CBDF82E9609C90573A858BA808F9DD5C9B527761211369AF02E75F0E469E15146A6B31464ABD14AD68AA0CBA38F3145D0F61D57E36DFAC588B4B3D29BE6117BF7EAF2503A2A4785F634E16858B76B802777A7C957544A8FB1889E45C45C1B8FBD42058C62E28900264C139471B8AC71E162A70764B94F41CE72324E94E8F46D2C3DCA6F9EDDC3CA534FA6655C3D81E34B57B5F8FF2B2D879336A414209256640DE7E18EDB8746D087D6D810A42B2606C537CAB2A1E277D925254CDB2E56A62BED1F28AC7FC29D1188F7456ABA206B57E8E73ECD519DD3674C20EE7BF41CE867DAD4F154C4C57A3D1E7D7A3FFFF3BDDFC8CE2A9FFC8BCB58B56A11BFBFF349BEFDED5F93F54C343F82E66579EFBB8EE7739FB99275EB77F2B9CFFF2FDB76E540BCEF69F86E8A5CE0109D3A9571AB4E65C5C25AFEF2C27934579A4481D05B134A49D20EAE891F0DA320FBC80AB1D24613DEEE0AC9FBA3E26C56045DDE611833041D0CEEC0FAD58523226FC82481D665C4AEB8BF3C948ED25182D0BAD2791ED9D2CB012F8A174F8471ACE8986DE854C5A2AF52A26838C295AAA92067619B732CD96A4AE8CDD239E1D9B88E4B2A30D9D29367E2ACB98C1F57876B87198622320F55D7972FA5E45C94354AF56741CEF2F7C2A460D1B75C2A6FBCAC4A5DC15227C958A6758791F210418B424BC2FA57F8BBCC0A141AB46C572592516C3C51CFD9B1995C5341936FF0F8236BC8D80133A78CE3E20B961389EA7CFE0BB7B271F36E342360C1DC164E5CDC29E645B9F781E7D979004CDD2011B178F7554B79EFBB4F2195F2F9D6B77EC1A3AB77E3D92EB1288C1F5F41B2A282A7B67553BFE2541293C6D1520BB515D05C9564666B3D6D0D5574D625A88FE8529212924A65DC90FF1613C38B754CC4113BDCE4EBDB717A2B822E0FF53143D061D1F96F1CBEE87C79FB3A3C4AF89E57FE1BC69C6B5EEF27C7F4F862E4296B55482B9AC6B3BBFB796C9F875E511146589E4D4483642C8A71D8C48850B32EC664923885DE6C0BBD398B9BCBE0E6B272124D44CF8EA7B1A13BC70B072C8E5F348F299DE3110FF122CA139B5070C1BD0CD7C3C91AA5242DFB1116A48D22098BF75F4EC8C54A75C35EE7522943F89BE5EF25353686BBA18814F490A045FF40E1950E2C9FD481019A8D80E3A775F2C4939BC858018F3CBA86CB2F5949A66F0F7FF197D7F0B14F7C8F0D9BBAD0CD084BE78DE7C37F72226D2D06916805DFBFEE3E3A3ADA9935BD93CEF62AAA2A7574DD249509B8E79E27E9EDEBE18A2B2F62F2E426366DDECB97BE72231B064C2A16CD837852B6D615C9E862A2559471B5BD3C7AE0501D37185F6370F58A49CC6F6F607C659CEA9849B450C44AC847A58E72F9FCF3364D362A822E8F4AC60C418BAA75EE0B37806797B767AF324AABEA2476E583B22BF7B1B98436B5BC1BF0D4BE1CEBFA020253D49F0B307D979829B46761A913DAEFCBA3DBE149C6F0F1DAB32C1C41CC96F81996360449BFD4EFF2E4DE2C53A64D67C9AC293241239C637C659B5829391749B9F45F91065EAA3317A50D31A6D8F0B57432301C2B087A385296A45C283B2A12518A2543A537BB245B50C81F610DE8D0BD91EBCAF3E2531B684BC225672F65CDBAED38BEC9D66D07386E7A070D35011FFDD8152C3FEDB3387E42660C365519BCEFAAE59C7C621B11C3438FD5108B4464612943F3D145828A261C1E11A2F14AE992314D8D6CDEE697BF7E9A7FFBF7DB493911F4A67A3022B2E1811635312A931889387A55257E65054E24826DFA541B1653C655B268623D67CE6EE5F8CE3A92C23F5DB0F14979E835DA90BDD9D78522E8F2101E33046DDF7639DE96DF96B757AF31CA987D0DD133BF3722EB1AB32B09020EA42D1EDD99A1CB8FE1EB614C1C0D7CD9ED5AD46A2E54B57FD92E16095A5AC37C17279BC14EA7F0EC9C94396C613D135A74E0B3F6804B2A5EC7890B6753138D86135B929B43DDF9658EBD42C1A262647790A451485211045D1A4D17ED73C508BAF87B314B3024F0E1087AA87E46C1032DE50B37246F31AE94A045228D903564228AABF1FCC3EBE9DEDACDE23993B8E8ECE3D0FC1C1B37EDC5334C2A2301975EBC9C5CCEE6437FFE63FAD38EB4D9E164B8F0AC595CFDAEE554C504C746314C9388114117F545D089464D62A2B398A1631886ACD3B16B6F3FFFF8AD5F71F71FD66106313C212A17F465D1D6C0D17DCC680C3D99C4A8AAC4A84A12D4D762B677E0450D0C3360767B928B17B470D2C446A6B55493940D69DF7E0FB522E8F298E3D823683D22B567BD797179081D45A364E05A48BB1607FEE91D3DACEB75D12AAAF17571F107C4651B2AE1B31DF6481F0A812C312AB3F4449FBD3C766A1027932AF8853D1C3B2F33025FECB6C946AA5930FF38EAAA2A0BC5F88B6B3B4C645E24E0121BDDC1B24668AF9313838531A5DEE6A2065D8CA4C3BE826171FE506B0EAD7EA13BA390A4228A3249096398A045D76D51DF597640112E0E3B4B65D4A47B571FABEFDB4A6005B434C4387BE5143A9A1368668CDEC114B9748E8A8A2A5E7CF180D4944D532797B769AC8B73F2099D1C376B3C095323E3983CFDF47A6CCBA3B373A26C58904A0D62E811AAAA222C5F3E9FCAA4CE60DAE2B1D59BB9EBCEA7E93990A6B232414F6F8A679EDAC8A489AD2C5C3C8DFBEF7F8E7DFBFA993C651CA7AC9A8FA399DC72CF0BE8C90A2C714C1BAA699F3591899D2D34D646397F7A152B66B7D19810425368510CDB29840A7538A1F8E653B822E8F288E5982368BD712EB1773F3EF63A7397773C5F635468ED12015457C6E5EEE776D16F561215FA73A11E7ED21417AE68562A29F07039290482C0A53BC3C1CDA5B15329F9AFA843E1F83ABE9D664B46E3B16D3916CD9DC9F2E3A6C9758A08503BB8B4DDD0F61E6E42B0F8A620D9904386C9B9288314258DA2CC51FA7B585F232C235A4ACAA58E0D59856EA8C9AB983874B16D0BD713FA738067E54906164B674EA4677737B7FE622DA9816E2EBB7019EFBC7839BD5DBD3CB7712777DEF3047D030EFBBA2DE29128FFF0E9F3A9A9D0C8BB3E158908F535E2A9C424168BF19F3FB853661876B435B164D15CE2C988F464F7F4E4B9F9E63B983C793CD75E7B05D555BA749A7477E7C8641CAAAA4DBA7B72BCEFEA2F326BFA243EF8E1F3F8F94F1EE2A9273672C1852772C699F348A72CAE79FFBF138D26A9AA8A921CDFC89E4812AD7D025A730BE36A3C4E9BD9C0BB4F9ACCE28E46E9D609B3436505ABC275F1CAAE9A11390D41D5E22813C8B141D0A68B7DFBBBF0B6FDAECCDD7AE561E6E24F1159F1B5235ECFD85B41C16825224A74B67465B877DD3EB4867168221345689281465C3C92CB72FA32982A743339786FC5C49E2E745A3131984961675292C8022F8FED050C3A3A77BDD88F9BACE792954B6916A5320541CB28FDB51D1B61465DB8C83C944281A56281FDC3D9E90ED59C65642DB304C32EDC45821EAADD2CAD7FA2F0FE702FC1A20DCFB6457D0D11417B44BD3C0BDBEA583167221586CEB6032EE9812E96CE9D44476B1DBE11E5869F3FCA3F7FF7F70CA41D3CD3208ACEF7BFFA4EEA2B5D3CD15D46B82B44701A89E193E4735FFC1F2E7FC7E92C5934858A8A2855D555242A4C296D7CF39B37F3F4535BB9F2DD6773F1C50B8919A20094417757370D753544E3557CE04FFF9AC6DA06AE7AD7E974ED4BD1D337404B6B0D9515115C4BE3FFFDC5FFA09926E79CB78464BC821FFFE271F658106BEF20B26C31B6E130B71E3E79C66C2E3B7E52A1BAA008A0C5F4A3005DD68F7D531715419707EF9820E8447E07F65D1FC2DFF348797BF52AA3A2EFBC1BA36DC511AF67ACAD406AB9D2D226A2508DD59B0EF0D4AE0CC9D6567CD15B4A14330A3462824D8AA923C345EA0EDA5DC9B1560E5768CF9934563E856BBB18760ED77378B227C6635B539C7FE652164C6D2370C42D4168CFA113F7D0E5708E0D912C534CC428D598C5670FF53797CA1CD2DF5C48020927050FAEB75194368A3EE8A1641459BC49A470FB389683232622DD3CD31A139C377F0AAD0993B809664D35C9A8B8E178442231D24EC037BFF32B6EFCD573785E8440D4A2D63596CEA8E6FCB317336D5223B1427DEA4832C97D8FADA7B5B193B6E6188978841736ECE5D9E7B6327FFE4CCE387D0935B5716EBFE3596EF8D14FF8D2973EC07173DAA5D4B267F71E9CBCCB9E7DBDF4F5F5D13EBE9588E9239AF08A42FEA29B8BB0F10985B9FB80472E97A7ADAD8AC71E7B81EBAF7B845456C3094CFC855349CC9D493652C1C2D608FFF927F399D35415362B9085AE7499A8A4087A745CE16382A063FBEF97F53782DE0D47849A5E3F5BBA3788561ED17A46FB87C389B5D0A72C0D71B28646802BFB004257CEE18117F69237AA885726866A4008028DCA1653C58E27AF10F0FA0176AA17279DC6CD67F0F27949108E98300CA27CE7D16EDE73F14AE6743622BE54FA718B0D4F4AC03B5C128A0CE0048DCBFC1321C90CFF1489FCD02248A5B24691A0852C52EC7A52D49DA5CE5CA8FB2C9D1905DDB9B4F8BEEBBBB8791BDFCDD15615E19CB993993EAE964854F4103449C46398A22E891123123788C76264F23E37DEF2000F3DB199CEB6361E79683DCFBFD44760E75836A7853F7DD7623ADBEAC86434FEFDFBB7F3E71F3C035D8B70E73DEBB8F1D6A7B182288E35C0F4CE6AEEBDFD6FE94F7BFCD5A7FF83258BA671ED47CE95B54BBABB7A181C48234A57899E878303199E58BD81A79EDCC6C4894D9C71E602B66DDFCBAE97063969C53462B1F02964CBA6FDFCE29627E8ED4F3363662BEBD674F1D29E41EC4651EA602EB4B7B0A833C95F5E3497D327354AFFBB903ADE6C155A45D0E5B1C8D820E81DBFC479E40B048347D6B95BB4B28A9E7B0398C9F2D019D5A38AE9CF61265FA807842F7D21D816EA1E3B3EF4E75DD97D7BC0F2C9381EBDB68F25EB6A0839A3F8F9508B14057D0E2A1577E8A3AE206FCFC5EADB2FE50DCFB2B12D0B57A47613B0291D636BB682CBCF399EB858A31F66FD1D6E795582F6C4A3FDC1045D9A8052943986A3E7302BB0E8C41822E5621124A9290FD77216759D0357746D11138661328D90385CDFC3CD0E521F373963CE44668F1F8768B12584A1A86952D790A0321923669844449317DD9451772A67914E79C41311FEF0D07A3EFEF99F4A1FF909F3C7F3BECB17D3D1524126A7F19DFFBE8D0F7DF07412D12477DDBB9E1B6F7D8AAC6DE0BA29E64CA9E70FBFFE222FED1CE0BAEBEFE08C558B983EAD01C7F1C80929C989B06B6F9EBBFFF0088DF515444D839FDF7C3FA79FB9844B2E3D953FDCF5383FFCDFDB39E7DCC55C74C90A2A2B62128FBEDE2C8EE7D1D454CB7F7DE71E1E7A68037A3C8AD5D244F4C4A5588918735A63FCDFFB9731635C95EC4A1318A1E4351C498F6C58AD08BA3C721913041D7DF187B87FFC7B82EC81F2F6EA154689C2489193BF0E46EC88D6337A3E5CC8E62B5E3B525F0E3B64F7E63DFAAC9098BBB32E693BC00944BB284D7A730BE59B0F22681971BF56E28248DC736D72DD7B70B2697CCB91936A2222CDF83A776D4D71FA69AB98DA5E876F0B4DF3B5C939149A87E56E593B5AB6A23ABCDFB954831EB2D405616D8DB09091F85CD1AD51A85257ACE15C88A25D3B4CA41111B3746A48EFB3D0AA1D92DE202B66CF60FAB866366EDACD93EB7630904EC9AC9AB9D33B58B67812F36775D0545B81EF59E4450125272097CD61D93932B918E7BEF79F9938BE91954B27B262C9046AAB23B87A941B6FBE8F534F5EC2F8E64A76EF1DE0C7B73CC9F3CF1FA0AE46E73D57ADE0931F3B87DBEE788ADFDFF118975F7E0A2D8D49C19632FD7ECDDA3DFCDF0FEF62DDBACDBCF39D2BB8F28A93D9B9B397EAEA18F58D49F6EEEBE3A1079E67F2C47666CE9EC4E64DDBA9AC8CD1D9592FC1CD657D3EF5E91F31D02BFA48826546C877B661CE9E85555BC5972F9DCCFB4E984CBDB8F3489D235C868FE0C809D38AA0CB6391B141D0CFFE23CE93DF023757DE5EBDC2A8C819FF8D29DB5A1D2DA5458B151634D2B6477FDE21E3F8E4029D03695746CBB2B934A2C9AA8802C30AFAA2A4671825178B5B0E5F8C52147995EB505AD6AC3C9903BB64D6A02726D46C9B8CA3F15CB7CD93FBB2FCF507AE20A20B7B5B28B11CBA1C94882227270F2E21FA4A9981F221A130E137AC4317124E4469D342224A91B40FB6D37961995069AF2B383764D53A91BE1D7A9DC58D47773D8E1FDF447F6F0EC7D648A732385E9EF1CDB574F76519D790E0B9B55B696A1CC79927CFE2DC5366E13A1676DE2697CF33386873EF231BD8D735C8CCC94DB4B7D6938C0AAD188C68820D9B77F3C4532F71FCE269B20C695F7F9EFDFBFA98D0398E19B326B0F1C52DDC76FB6AC635D672C53B575095D0A5FD2E5911E3C9275FE4A187D7CA4495450BA632635A13BA1E953715F17420BEC471024CC3249DB1F9ED6F1E116D1C39FBDCC524A251D2A93C7FF7F7B7E0BA1102DBA3A73743CE30099A9AF0DAC7D3B16432E72C69E7ACA9F59C34B355F69A0C6D78B200F5880AD38AA0CBA3B2D14FD0864BE48F9FC37DEEC8134B84FEACB71C3FA2275A79308FFCA89052C30833E3066CECB6D89D71C97922D013979470B7CA82CE0521599AE786FB01BEC14D1276302F9B26B57F275E2E2B1BA48AA2F5FB3206B7BD3848754B339FB8E81459D02A54410F26E843ED74A17BE4E57A73E9B8C3799D87248E12A786187750379482DF59DE5464324AD8C1457CB658783F7003F29ED8870C86956566CB380677E7F8D91D4F307B4A3B1FB86225F1B8869DB7C8E71D49763FF8C1EDAC7E6E278D4D4D7CFAFDABE86C34A56DCCCAE71948EB7CE9DB3FE7E295C75355A5CBF65DF555111A6AA2B2FE46241AE1073FFB2303FD196A2A13AC5CB984BA9A38AE67D3DD6D71EFFD8FC908F8AA2B4F236E0A6923C340CA4133A2C4A26282D70E1D3162424188D3F2F00A374A207F04A3CA7ADBBECE9EDDA271408ACE090DB2029E382BD6AEDD851718A407036EFBF5A3BCB4B34F4A3879132267ACC26B6E605A93C797DFB180B3A70B794778DE45275E71AB5511F41BBC6CDEF0C7463F417BBD987FFC1CDE869FBCE19D2C7E50F89FF5A6F947BC9EB77D0562C61D106D11BA320EBBFAF3ECCB055832522E542FF30359DE532ACBB2EEC6F0B4E1CBB7BF34821E7EB760851EFA83ECF957D06807F7BE842F9C1C8E8DE5FAACEB0AF8C3F634A79FB294F38E9B24279A0AA6ADE1CF9724A214A3E1E277149D1743C45C42DA877A9D0FD69F8733040F47D0A57537647BAA42828A2C7A24BBA104D86E1E2FD7CFC49A4ACE3D7E111FFF9BFFA3BABA8153164CA0637C0BBFBEF75976F6F449FFC9E5672FE4BD979E483693E5A777ACA5B936C15567CF0527473A9B12FDCEF9E12F9FE48107D613AD88E004010BA6B773C959C7D1586D08C3057937CE9AE7B7B16EC30E4090BB88BCFB686A68E1B24B4F66DAC47A6286905C3406D236BFBEED61FEF8C4063EFD89CB18D7501936CC95A4A94B0B5E36EBC8CCCF6884B03142A1AFA460EFAEDE14CFAFDD4C67BB68B555174A165A848D2F7471C30FEF65DBF61E594D509C0156472B15272E215B19E1EC6915DCF8C193C2F415697B0CCFAB915A54045D1E92A39FA0AD7D988F7F166FD32FCBDBA3571935B6093AAC9F519C5FB77D9F8D3D595E1A74487B4658A54CD7A4C62C62D762E727D9B95A62F2C666E64B2F49499E9E879DED27B56787943A44169ED0B71FDA65B379C0E79A4BCE607A43A5D4B24B09FA952604C34D1B2E7C344CD007BB3786258D42C3D9429660A9AC213E5B1A41CB946ED13CA0904558DA915BE8E69E982414371C2B4D53D4E7ACB9D398D2D2C6D91FFD365FF8C47B3975F1447EFCABA7F8DF5B1E473345395593A8DFCBDF7CE2024E3E7E269FFED2F7A96968E6AF3EB08AE66A91F99792938DDBF7E4B9E5F6B53CBD790FFBFA2C1AE206579C398BF3CF9C4522A6614685B32646366FB0BF6B90FE8134C97884F1AD0D744EA844D610742D1C342C2BCA962D7BD8B5B78F850B3AA888990579CAA367D0E7DEFB9E938D676B6AE29CB6721EF3E77662BBE942D6A6C6FD0FBCC075D7DDC505179ECCD967CF97D98B77DEF1240F3EB89E7DFB2C904D02C4790379313F31A593CA139630AEA5921B3FB89069F549793E89E256C508FA35E729CAB8521541970192B8698EFA9657D65ECC3F7E166FF3ADE5EDD15148D03272150E559150A7C1F6812C9B7AB2A47D51DB423831741CDD43383644728520E54016030E67E18B9DAF87A0293B102A991E2AB499129D52ACC13E52BBB7E13A79A93FEFCBC05DDBF3548D6BE5FD179D4432081FA7C36D18962F8AAF4B0F914C4A2929B87FA853A35473169F2BBA338AC5F60FD59D8B042DC95A44CC857E82B2334AE1C70B7CACBC2027F1378B79CDD59C3EBD9DBAAA18BD76824BFFDF75BCFBF4395C71DE095CFFBB35FCF2FE0D61179920C0C9F6B3727633FFFAB50FF1FB479EE1C7373FC8673E743673DAAB480FA6B1DC3C96E5921DB0B9E9EE17B9FB8F3B69694EF2912B4F64E98C4634C3A53AD904A6B80159619AB51960EA3A51334AA2BA194D384ADC0C795BE7F7F73EC9AF7EF7282B4F5DCA79A7CE2126928A74979D7BD2FCC5E76E606FB72D356A31A7675B69CE397D0E9FF9D42A7C574C2C06F4F4A67966CD36D94477F1E2690441826F7DFDA7AC7EE245B448122396C0F0C2BA2B82846D4D67A03641ED8AA5CC98DDC45F5F308F55339B10A5B3C2E8BBEC93E755AF5745D0E5D19922E8F2707A5B47C94C3A4D931EE66D5D2936F7E5C8184939D96914E48B8C8804458DE382EE5B24C7305DFBF012C66BEFD4B0052FECF9272268177BA09781DD5B65D71441803B07E1AE1D361D53A7F2DEB317127545BA83D046C3AA69A12F3B5C4A5FCBDFFD973B36C4DF0FAD4A375C00A93019284A7F160A2B15B3030F9A142CE8D1B20FA2C44614DE0F35E83019C5C2772D702DCE9BD9CEB249CDD2EB6C6BB59CFBE7FFC1BF7CE9232C9D5DC7F76EFE23FFF5F3A7C08C482D56CFF4F1D90F9FCE490BA7F1D9AFFE90CAEA717CEA9A93E968D4490F0E62D9196C4F279D8971C3AF9FE681A776B2EAA4697CE01DF369A88960C422FCE496C7E9983891D933DA185F671217968A888EEB193CF8C85A2AE31AA7AD5C246A0BB2FAB95DFCFD577E4867CB383EFF990B68AAAD92730FDB77F573CDC7FE879C1B0B537F021D3B6BB3604E2DDFFDF6D532B925D06C742D86615648FDDCCE67652A7B4F7796679FDDC2BD0F6CE0F98D3D44021D5364558A3040B83D0870A6745073C672CE9A5DC35F9D771C53EB92AFD256E1B5CFA4434728822E0F3345D0E5E1F4B68E129AA3E5796CECCDB3ADCFC6D1A204BA29BDB9A2B09BD05145C3D7B001529831286D03AFB01CA6A5E06BEE5F512316F537EC811E06766DC5B1454B2B871DA980BB77794C9D3993F79C311FD31D8EB25E89A04B13504A23E822391F9A8C529A3D2826D44A53BB8B045DD4A08B5E6841C8C5085A24A8086B9D48F2081353B244038789D5559C3AA38DCE862411334AACB292D33FF67F242B2A3973C9049A1B6AF8ED7D6BB089CA4CBE93E67770D1394B18CC64B9F1670F31ADA396779E3E07138B6C368365D9ACDDD2CF8EFD197918F6F5E6A9ACAC64D9DC76AA2A626CDDD5C70D37DF4375A28271E3925C76F65C56F6ECE2F600002000494441542E9F4ECA8AF0A31FDF475B5B0D0BE74D66F2C466621193ADBB7BF8F92DF7D3D6D8C439E7CC26198FA3FB1E7BBAFAF99BAFFF86ED3BB3E4F3AED4A0135138E7F4195CFBBE95B8B29598C58E97FAB8E79E3554D72458B572A14873A1BB2F232596471F7D89EBAFBF8F88AEA3FB01AE485011A78F68ED555745E28255D4D447F8D35327F3BEA513A98F475EF33C29778022E8F29052045D1E4E6FF1A8E1A40041CE83AECF969E0C3BD326AE8C633C9C00B26E801BB6D90E7BF9BD89CB90D3C2B5C90F76D3B7630B8E9D95A4B72BE373DF2E9F0953A6F3BEB3162314F1701EEBF0BD04C3505A3442092BCD95BA380EADA9513A2128E50E69A5B30B76BBE16E28C5085B960A15FAB4A8F72C1BBEBA327A96A46D7B8584141BCDCDB2A8A38565D33A694C68C462069188705918DCF3743FDFBEE17744137196CCEDE0C25366316B6A27F73FB691B696763EF5B73F6057F720A72C9CC4973E703251D325675958B91CDBF6E6F88F1F3FCA9F5C7916EF3A773EF94C967FF8EFBBF8F99DCF485C4CCDE7FFBEF54192A6C73D8FAC2716D3B8E6AA553CF8E456BEF2ED5B98377322E3C735B0706EBBB4F1897D58B771A7B4ED2D5F34998AA429A360218D740F183CFCD80BAC5DBF95DA9A4A4E3EF138664F6BC6F35204BE284C65F0F8D39BB9FE477772C6AAE339EB8C053CB5662BDFF8E62DE4AD28AE2B52950ADD1F45FD0DE9D81025397C5C53C39B3189CAA58BA8A886EF5E398F93A736C94317CA1C4796B8A208BABC8B5511747938BD65A3E4692F66E80B9A5FCAF1D9DC9767F7A08555E842276A26E47C911518BA34E4E55248A51EB24295CA1A877077F91174F1422CCA1342CAB4A5C4D1B363236E3E2735E8BD599F07766BD4B775F0C10B9713D38C50CA286CC3A1124758C9544CF689ECBF509429B5D21DD6565778049772856841E5879F1F766984D24758CB397C1D367C2DD6D870E5CD44764E716DB2FD39A6348DA3311963E9F446664FAA236A6898310333D6C8ED0F6FE0C6DB1F63E38EBD2C9A3F8D96867AEEBEEF71264F9AC4FA2DBB686FACE18A55B3B8F8A44EAA6BAA71FC80AD9BB6B265771FB7FC7E03D7FEE9859C38A7153F6F71C36D4FF1AB073690496798DA56CB173E76169695E1F70F6F67C3D67DAC38711E0FADDEC4DD8F6DC4CD8425528F9B51C9B7BE740D6DCD757CFFC6DBB9E99607F8D7AF7D94C5F3DAF19D5C88997892F20DB2962BEB474784AE2D4AA54A8BA3B0DD451848B96CDBBA9B86FA18CD4DD5FCFA8E67F8F677EEC430AAA5475ADAE870E571105DDBA563C31713CD60D75753B57C095A5B1DFF72C51C2E3AAE45E69E86245D284FFA06AF0C45D0E50137FA09DAED09270937FEACBC3D7A955163C3C5115AE88A997E3B072C9EEFCA91173193268A43EAE43D8F9C78542F55055F4D673E34B82EC9DA7BBDA006AE8333D847D7B60D78D92C8E93A73717F0E83E03B7BA9E0FBF6315B551531244B1B46891A043D2966C7C5021A4A2AC513A41585A204946BF41584CFF95AC74227B50269D48CD5964040A19C339A8F8BE2D9351845FD963CDBA3E3C4B448B1AD79C3B87F79D3D839A6840C48C10ABACC0D3A2ACDF76805BEF5EC3C34F6D61206B61B92E139A2A993FB59365F32631797C82E6DA186DEDED18A6CE0BCFBFC0819E3E06337166CE6EA5BED294FD05F7F5E4D9DB93931A7543459CFA069F6CDEE4A6DFAEE3B67BD7108B2749673C328E256B74882784E5F31AF8F2272F65F6B476563FBB9DAF7CE326FEF29397B17CD94490859184BD50C81182A8455ABC2DDCD1E019F8BE8E70F9AC59B38B3D7B7A58B6741AD55526E203BBF6A7B9E5D6A7B9EF81E748A79C822FDE970D033C471488124D741D74238A1B89139B3D83CAC5B3F9C87993F8C8091D54897E68E209A95058E9F59E3FC5F18AA0CB436EF413B4E111F9E367472651E5AA47467DA1FE7042509744B4B32FCBE63E87415FA4DEEAD2F79C753C6CDF905ED7D219F5D735117898C24505D5E155CF1A39D5278A09A507D8BFF9799C94A8C591236D3BACEB8FB1211FE7A23357B07C5253C16257F05F9746D28526AFA51A7451C628FE6D485316581C525FA318359746CF42069004ED7B8852A143B63A9198229C1CB25D958393CF5315093869C102563FFE025535AD3CF6FC0E164F6BE02FDEB984C60A88181AB1448268348A6E98ECDE3FC0D69DFBC966F39214639180AACA040931A997CFCB47FD8E09AD3436D492CFFBE4F396246BADD8FD44A4DE8B92A6AE2B13595CCB2197CF48FBD4B63D19EE7E7823DB77F7326D721BAD0D491E7D720B0D0D157CF0BDA733AEA19AEACA28220774E3E6977869670F0FAF7E01C7F53967D5024E5E36155364120A4B9E63C93EDF791B0C23206F6B5C77FDED18BACF1597AF24168DF1E4531BD87760102BAFF3C0C34F93CFDB9C77F672060607686CACE1C0BE2E3C4F67D6EC697CF73B374B32F7AB6BA85CBA8459CB3AF8FC457358D159272D9DBE5E9C8E7E63D29A22E8A385A0233A9167BE86FBD43F832B2E8837BE442FB81963F205A3BA58BF8C32358DFD83799ED9D54F464F821112F440CE262BB2C5C4A36DA1C07AE9E5F17A2E95C3F93A5ED5EB515CB9B0AFE50638B0E939F2FD7DB2925DCECAB22717E3F1BE04D367CEE4FDABE613C8BA1FE11A4B270A05798A4941C9F525B5360E4D46092368F1E82DBAA184F5358A51F541D982059D5910B9F8BB23258D82AC213307056187EE0D3B635111C007DE790EE3E319D66E4BF1AF3F79800B4F9EC79F5DB8105377D1A326D5958942F53D61C71384EA228A2B897E8BE96C1ECB1637823C563E47E0384CEC6CA3797C2B6622269F0C743C06F3067B0F0C4AFFF2C0608E6432C6B8BA4AEA2B22D8763F962DDA6841FFA0452AEB9248681858FCFC77DB59FDEC06162D984ECECA71D292E95C728EA8EB0CF73CF002DFFCCEEDAC796133575F79325FF8D455AC7F612735B5513A3AEBD9BE2DC58D3FBE8F8ECE24175DB092FD7BF7C93AD46DADF5BCB8F100FFF29D5FB16173376D4DB55C76C54AEAEA74162F9C295D2D56D6A1B2CAA4BEA91E5D8BF3FDFFB999813E83DFDDF128FD4D6D542E9FC307CE99CEA74E9B4E5C78DC656661B16EF7EB39F3C2EB571174793C36FA23E8884EF4F9EFE0AEFE47027BA0BCBD7A8551A250BFB9F0E3A08FDC6CF4116DD0613E2CC82CE7073CFAE27EFAFC18463C5EC808343890B3B134A1136A8812CE2398795BF66E08C274ED0C3D9B9E23D7DB8393CB62E5B2F45BF074BA023BD9C417AFB940DAF1867A7F9756A513E45C983C3C1C411F5C6363B84555697D8D525B9DACAF51F03A4B0DBAD0BEAAD8EC5554AA13B52A703CF6EC4DC9CCB9692D0D5CF73797F3ECF39BF99F5F3EC8DC9953F9B32B57D13A2E89AF9BECEB4D317D7C1542CEC9A4B2B2C7A088C48543C3CAD932C1C5B2F2E49C3CB5B535B4B7B4128D478956082F739CADFB737CE55F7EC9DA8D3BD9DF93C672908E8CE6BA1873A73773ED7BCFA4BA52C74D0F4A4D5CD4CF10371622113EF4C55FB0A3CB420B5C34CF65C1F47AFEFEB357B064EE4499F1B77D678AEB7F7C2BADE36AA9AA6AE09BFFFE332E3E7F059FFCC43BF8ED6F1FE4AFBF701DE79D731C1FFFC8A574B4D7C93ADD426E7AF299ED7CEDEBBF664FF720313DCF673F730573664DE69E7BD7B07AF533B434D7306DCA783239970B2E398FA953EAF9C5CD0FF2D5AF5C47AAA299DA734E65E9DC66FEF9EA654C4C98050DAED8D5A1ECD36768A022E8F2301B13041DDB743DCE637F4790DD5FDE5EBDC22863DE47889EF20D30E247B49E37E3C34305E9029F6777F7B3EE409E644D9D4C991673F639C7A74F5CC8087216133AA12821FF79BD014CC18957BA1FAFD0E864A8E5959453A4842C269FF2F46C594FA66B3F7666102B93216BD96C722AD998ADE41B9F788F944286DB1A163305C3EE289444D0826CC5F2B2D6557E2855944A19C5A495E1FE8161D42CE48BE264A19C189456BA30ADDB96F2874D904FD3D6D0CA434F6C6560C0E56FDF7B22C7CFEAE4406F3FBF7A681D8E11E7FCB397B1FAF10DDCF5E85A2E3E753EEF38750E6D8D7172D99424E79CA5E15869A2318D8816913246BC2A492216150F38E4F538773EB49E1FDCFC304F6DD8433C9E90B53722C2DC261C24A257A3888A67B471D945CB387E4E0B869F93DB8F6FB2E5A5149FFCD6EF481391BEE4381E679F3285BFFAB3F319DF5089EDD9329DDB301274ED1FE0D6DB1FE4C1D59B9933B583ABDF751A9B366E67D3A67E2EBDF80462A683655B589E887303EC40E7BBFF75071D1DE389472D664E6E63FD0B5BF9F7FFFC151133C6C7AEBD185D37F9C63F5DCFC4C9CD7CECA39713040E37FDF40FECEC75094E5841DDF83ABE78D93C2E98DA50A8F1A208FACDE082D2758E09828EEFFD03F6839F21E8DB74447868F533885FF9304485D97FF42C438625F1388FC60D7FDC4675739B2439F1C09C760306F236AE26AAF0C9A4EE90280BC4FC7AF939A4F68397575AC7CBFE2EA3618FCCDE9DF4EFDB49A6673FB9C15E9C5C9A8CA7F1A2D3C0F2732F65E994163CA18BCA4941C1C98592A28568BAD4D75C9A2D18EAD122B12424E82152164938C5D655B2546858FF39EC27188E15846C89DFC5EC9967E1DB2EA201AC20D7A6CA4A3E7FE5198C4BEAF4A7323CFEDC1E3C372F1FFFFFF7CE75DCB57E3F3927862977D89451E607CF9DC9C72E582823D93B9FD8CE3FDEF07B164CEAE423979D4847438CA4E9138BEA44A2097A2D8DCB3F7BE3FF67EF3CC0ACAACEF5FFDBED9439D30BD319981960E8D23B82A0A8891A6BAC29A6F7DEFEC9BD3726F7A627D7146F62A229C6A8B125512CA8A8802220BD0E7D18A6F776EA3E7BEFFFB3D63E0706053D5272AF66B60F0F32B3CF2EEBECFDAE6F7DDFFBBD2F075A7A98775E2535792A9FFFE8E51CDE77446A6578FD1E8A470EE7DB3FFC235DC10C36EF3E484196C167AE9DC7B2B915C4AD08A613E0C6CFDD49BF290208958C3495658B2732764C392B57AEA7E148339FFDC8E55C7DC554E962138B0A77700B4DA6776C3979C762B654A18BC735EE7B6815BFB8F369028174465595D1D6D6C5F471D9DC74E3321E78E859FCFE346EBCEE02145DA33F14A6BCA4587E57ED5D1D1414E4A16A169B371FE43FFFF33EC2E7CD451B59C2D22A1F3FBB6EE671D12DA1FD721ADB50049DDAA0BD3D00BA7303B1173E87D3B13DB5BB3AC55E8AEEC7FB813D2881A2333ACE59FD70C2BD44469B8AC3919E101B9AE3E81EE1741227E63874456CC2A2334CD564FE5CD0F04E24C09DD52B7A938309AEAC45A4A79DDE96467A5B1A0876B7486D68A110D71E0FD0513E979B2F9A438EC099B840679195750B7E227A7E2D38BBC09BB0A63AD61DF8FA08FA58349D10D73F46A54BD85589283A2AA874C228362EBA1C6DA93DD1D91FA3B9B5939F7CF40A1657E7D0D0DEC3577EF30263CB73B8EA82496C3EDCC1BD2F1EE0506B5C52CC4C3B4C866671D9EC0AA68ECE273F3B83E7371DE2A1557BB04371668C29E6C3974F656A550E5E03E24A1AF73FB795DF3EB18B505F275FFAC0855C30B98CC9132AF0790DA9156D9B361DFD7D6CDD7D8467371CE5DE475F116E855CB168145FBA71219A3D80E9683CB67217BD4131F1D81C69EC64DD96161C5D98CF86890D04F9B74F5DCE37BE70312DAD1D3CFFC2368A4AF21835B2180783D5EBF6B273E7513E72CB6232B2D2F8D3FD6BF8D91D4F62DA5ECC6888F2920CBEFB95CBA5D0FFF77EF62899593EBEF7ADF7B27D571D7F7B6213975F3C9BEBAE9E8FEE31D8BAFD00C1C800C545053CFCF04BBC14CCA63337979AAC280F7C7C51C21C3E2943FAD69FBF21804E6DCCDE1600ED379B89ADB815BB61756A77F5067B79DEF3185AC545677C9CB3738044549930AE306D8515DBF613CFAE9020261A5204D7B92322AC47C54E2E0BF53863E3F4A297D3BF7637D6173248B1503F031D2D74371DA1BFA59EE8401F91984938E6B0D1338E65E7CF654E4D398665CA6298E87A14138EC4E8C1C541DB923A1012A093DC68E16C92307B3DB13BD04D79B862FB6EF1F07554BA9809428FC48A10150EDD2187C3CD411ADB83DCFEC94BB86A5A213B0F7771F96D8FF29E59D5BCEFA209ACDDDDCAFD6BEA68E80E93E9D1C84C73C822C2A76F5C4ADF401F79197E0E3675F3DB47D79199974F535D1D5FBD611E972F18236979BB8FF6F1A33FBF80E1CB60E69861541705F8C8F5737114836028CAC04018BF57473344FDC0E07FFEF2140D6D0EAFEC6A223D4DE56BB72CA0A2409379E8984863490A9DC6C69D2D7CEFCE55988A8EA3DB38E1305FFEF8C5DC7AFD0CC20321F6EF3B443466535D554A7BB7CDB7BEF317F61DEAE4131F5CCC65974C61FBB646FEE7EE2739D21EC289EB32EDF1DDAF5F4A46208D1FFEEC11468EC8E72B9FBE8C47FEF112F73CB09E6BAE98C67FDEF6613A3A43FCFBB7EFE4AAF7CC63E182892C7F6A330FD546E8C81B468ED6C7B35F5CE2A6A9A4C7A4D00F7FEBCFE11040A7F616BE2D005A745DC59EB8FEACB87A6BA3AFC373C93DA98DCE39DE2B11344B2924C1DCD8D5D8CDAABD8D948CA892790101D1BD11E88C5852E3D9CD030F7A194ED6717226B21B27BBDFD71DCFFD81742119E8A1AFB581CE43B5F4773449801674AFDA78319EE2D1CC993289492386E1157AC5223123DC4B060923C9885802F471AFC06403CAEB54E912D655526FC37485F68F19BECAE614578B2466464044D8669CEC4C3F0BC68EC4B61522518B25532A1916D038D4D8CDD7EE7C8E8B678D62F1C4E13CFAD23ED6D6F5E0317432358BAB178EA5B3BD930963CA098623E466FA39DAD84ECF401453F5B273F77EAE3E7F32E5055E06A20AF7BDB897879EDFCB8D974EE7BAA53514A4EBD2626AF781A3540E2F2533238DE6F62E0ED71D61E1F4C992E7DCDC61F18F557B7879D35E96CDAEE48A4535188A70A7B1D8B9BF995DFB5BD871A09DB5DBDA7144CD44D0DAE271468D18C6D47139BCFFEAB94C195B4267CF00CFADDEC5F2957B58BDFE30B198C69C89597CF5F357931BD079716D2DBF7F701DF547FBF0E90E1FBC7E0AB3678CE6851737A1281AB3A68D95935E5D7D1B1326543275EA6899427BECF1754C9F3E8ADC9C4CFE78EF4A9E3E1441193716D5E967CD5716CBD670292025D3D0A7961538D52B3404D0A981CBDB03A0BD1AB1E5D7621D7C3CB5BB7A83BD14231DEF47EB51FE0FF812BAF460297E40D85278E4E57DF4797C9414E449301639C58EB04D8F10DA10E02C0D5106472BA78BC6A73F8C32E52852BC227232C3447A3B68AEDD4957FD7E9987B6A3033446FCB4798A482F19CDC5F3CEA3AA301B4B74A909FA9B743E71BB0C93002D9A5092CC8C6379E6846EF3F122A12B1DEA02F4F1085A449D82B9216450456130160BCA966E33AE909399CE2D8BA730B7A698CC808F17B71DE268632FC387E5B163DF3EC6578DA0A727C4F20D07C1EFE7D259A3C9F32B1CA96FE6C08123CC9C310E9FC79014BD7DFBEA78F79259F83C3AD1A84D9AEED0DDD3C191CE28BFFCC7665ED9D3CD7F7C703197CC2A21CBAFB362DD5EFAFA07B862D96C29C224AEF977F72D67EAC4092C9B5D4D4BA7C5F31B0EF1E7E5EBA92CC9E43337CE23C70FDD6195EFDEFE08DBF737513EBC90BE7E4BF2A5354DF0A155E2518BD2BC087FB8FD134CAACC055DE3BF7EF138773FF03271DB8F1989F29B1FDCC485E78F47B1426CDBD5CC776E7F926DBB5AF0185E46975B7CE93357CA7CFE5F1F5A437757841BAF5BC89C59A37865C34176EE3EC89C59E3A81E59826A183CBD621D1B361F615FC44FE6AC29C408F3E297CFC727177F2E956828823EFDF7E9CD3EF92F07D06240BC573F8B5AB6E0CDC6E69CFFDEED78B625F61EED0CF3E09A3D148CAE22CB2B3AF15444EB417BD8A63F96606B9CF32B4AFD042222564503486480B603BB69DEB78B486FA7644B74866D7A1D3FDDE92398357B0E4BA78D910EDA22D5612554E88E6B6CB85D82C7DCB813EDDBAF7546B107E59945AE3B09DC029C054759A64DE282B9102266C531C30EDDBD712E9A51C317AF9985473778EFF71EA4F65013D3CB73F87F1F58847053F9FD935B79EA957D8C2ACBE72BB72C233F5D65F3CE7A543BC2D489C3A5EB89B0988A5A3699693E2C33447666366D4D6D7474F6D2D4A772C73F36B2F15037D7CF29E1B3372C24C36BF0D7E736515E5EC8ACC923A96B6CE3BCB115DCFBF73598C0A7AE99C7A18630B7DFFD142BD61F66DE79357CE9FD7329C854680D3B7CF5DFEF62F6CC69DC78ED5C0E1D69E3377F5EC9FA1D6285A2A29961164C2BE0E7DFFF38A5394234CB61E79E56F61C68A72FE4D0D1D1C6273F7011861A053BC6BA4DF57CE7F615EC3FD283A2EA5CB67034D75D3607AF07D66FACE50F7F5ACE55572DE0C61B2FE6D39FFE09FB0F1D62F1A2697CE93337A0F974FEED5B7FE4D5CD0DA48F1D43C545F3315593155F5C40BA8C2D5C95C5D3715A198AA0537BD7FE25015A9FF54D8CD9FF96DA089DE3BD441422F278EBF735B272672BD5E78DC327B514544236B484E284E3A75A42FEF323689975948C3BD7C854B1A2F4341EA679DF767A9B1B880CF4110E0E108EC669338AA898BA984BCE9F454017AEDA0A8EC84927981C96A4D125CC5E0745CCAFCD3B4BFD8C41CD2749F076F59DDD766E91F270E216B1480433D6C7F8B2524CD28944427CEE86F33954DFC257EF5E4986C7E0FAF913B9727E353DFD31566C6B94ADD8B3ABF3193D3C93E52F6E60EE941A8A057D4E350864FAF1780D34434CA436E118787418E8EBA2B72FCEC18630BF5EBE8D757B5BB8FD2BEF61D6A84C0CC561F596FDB4B5F5F0BEEB2E213B53A72F14E547BFFC0B4B16CDE192E9D5F45A3A1B0EB6F18BBB9EA52C3DC0E7DE378FDC348BCEA0CD4F7FF157AEBFF6122E5D3A51AE18B6ED6FE6C7BF7D9C504861F1EC712C9C554D557996E44A4BDE8FE391D2A46271250D73A33184359910107F76D54EBEFD932769EB73D0741FA34BD3F1C7A30C2F0D70CD758BA9AB6B276A06292BCD65CD9A7D8C1E3F82C58B66E3516D56AFDBC58BAB6A797EE556BCD515542E5B886DD82CFFDC5C32E56ACE5DD90D01F4B90389B70D409B6B842FE16F211E3AF3D1300278AF7A0AB568E6991FEB8C8EE04AF1F7C5151E787127FD5A265555A5A8F108263ADD5187D6011353E49F4F83EE7C4697F6261F96D1BF34034076D585DA9BE8ADDB4DC791FD7435374B3B2CC1A8684B1B41E6F8455C38F73CCA3234ECB85BE893A90CE16F28803541911BACEF7C2C829646AF2EA73999061111B4C837CB7F4B9A5D18D190220A8B66D0E45DF3E7306A7809F150174BA78C42157E7C1E4853559ABBFB68EB8C70F30F1E624F4B04CD085093E3F0C5F74C9682F5AB37EEE243974E27A6F87968CD6E1E786E27936B4AF8E6871633B9A2905FDFFF38E98100572E9E4B6BC3513A43264F6F6DE6AF2F1CA6AA3893FFF7FE0554157AC8503D1C0D3A3CBF612BCD2DADD4540FE7CA8BE65098E9939D7BAFD4B6F0F51F3F4A575794AF7DF8022E9A3712D58CC97674512C35BC3AF9B9D93285613B2A5ED5C0B4A2C44527A960C2881491F87FB12C114F919CF4145984154EE58A1D97A92891BFEE0AC153CF6EE2A18756B178F1242EBE702A15C539B4363773E4681B5959856CDEB297E933C771FBED7F22AFA084EA9A49FCF72F1F4133A4510F81CAE1542D5B84EDB1F8FB276792257E282DD54E4FC47F28824EEDED7CDB00B4B5F7414CC1853EC36615392C9A0763EA17D0E7DE96DA289DABBDC403AEB8207CCFCA9D78871533A22417C516A0ACD311B4690D99B251E5ADD7C9CFCD452714A71334BF84D4A9484B840718686BA4E3E01EEA776EC0944A7751FA940CBAB36BA89E349325D36BC8540598B8A2476EEED915DE7F9DD9AB28048A7D04E80EF212143F8B460550B9EDDFD2834FE8520BA797B84347D022BF60381D5D3D0CCFF1F1EDF72D66DBF61D8C1951C48C51C3D974B49DDF3DFC22EB9B606F7318AFA671D3EC726E983D9C83F5CDAC5CBF9DCF5C339FA0E3E7AEA737F3E48606C65464F2EFB72E64EE980A1AFAFB8974072909A4D1DDDB43674F2F073AA2DCFDE44E3C812C469764529619E3D64BA7A27935344F3AAA9646C0AFE26816BAEEE5177F788CA63E87F5B51D14A4F9F9CE272FA2B4C88B1535B14362A511C774A2E46467911908C8894CB42B498F492909EA4ED7429B251E170A83A21148E482C57322BE1321CC1FC5892B6E4F90A611770CEAEB3B292F2D4053A2C4A3415A3BC23CF7F201D66FAA63C3E69D5CB8E47C9E79661DA6ADE3F77931851D9623689D161963CAA8BA6801966EF1B74FCE9011B44C710CE5A0CFCD8B9638EADB06A09DBE7A624FDF82DDB2E1988CE5E98F8C825A3A0FEF35CF9DFE21CECA274504E2B0BFAD9F3FBEB09BD2CA6ACA0B32112D0716BA04EED6601C4BD2EB5E2341774C1B63D0859CF0B3C16C8FE43E2791B17BED71DEA40699AC511EFB58C252CBB16C62E11003AD0D1C7AE5597A3BDD2EC3483446B796472C7F0C93CF9BC2FC89A3F16A8256771CA093290D195927981DA245F9C4EEC0C4BF851B8AF41374591B02A0ED585416E10C8F8F57EB43744684CAB1C6F8F23C968CCB9574C0EB2F9ACAAC51651CEAB779FFB7FFC49EDE742C5BC5438C4B261672C3CC52BCBAC5FEA39D4CAFC845F3186C6BEC66DDAE26C6561470F9BC1A32020196AF59477E7A16D34795D3D3DB416747AFB4897AB9B69D07D63470B4AD8B65F34673DDBCD18C28CE241E8E2452242A597905EC3DDCCADD8FBFCCCA17F7505452CC47AF9EC527AE9E8162C788C42CFEF0C87A0CC3275BC2C754E6332C2B204156342505C3260D2D5D7409479D8843437B90EEBE20FDFD11A96F921EF09395994E699E261DC005FB64586E3AC2C65040A9AA8B62652CA1FAE7F0FCDA43FCECD7CFD2D51B930541316A49BB34F15D688AC8928867CF266F4225232F9C434C35F9C7C7A71348E6A08700FAAC20C1A90EF2B601687103F10DDFC7DCF07DB062673C286AC124BC37ACFB5F174E1200FDEA9136FEB07A1F93274CA434C7475C11D1A34ECB80497348E41913F29D83F8A62E01E4D439E89355D68FB146CE70F4125DDFC7F59E931D8D62E96DC668DBBB85D603B5F4341C20D8D5268571426A80504E2517BCFBBD4CA82844111A19423B43E44C85425EA21B5000BD00665344C6096ADDE0085AB6710B2FC4A4BFA0480BC462A8668459E346F1CCEE767AC21AC53939146579A8CAF370C1B4914C1C9E855F57E973FC7CFABF1FE1F13D2255A649AAD9CC8A4CAE9C94C3D8021FAD9D3D74456164413A238BB3F1FBBD780D15DD9FC18EBA3646E406D044039119A7ABBB9B48FF008663A17B7C3CBCA985A73637D3128C32BA20939A51651CAD3B4AC0508859363593C6B2F2A56D34B60D50539AC907AE98C6754B27929BEE9500DC3710E7435FFF2D55230AF9FC872E939D8642DF595CA7C8313FF0CC761E59B18D1DB50DF405E3320DE65155A9C02744F6ADB84644E8B4587DE464FA98589DC775EF9ACA82E91520A26C494237E5337FB825CC8F7EF5349B76F724D267B6D4821691B8C85DD98AE0E9086D68B8B6DBAC0000200049444154F7392B9B359EE18BA711B50678FCA3B3E513298D225EA3AA98EAA33594E2486DA4DE56006D376F20FAB74BC00CA676776FB097925D85F7DD0FA1E48D3BE3639DC901C463BEF640237F58B39F69E74DA12CC78B684BB16D8DE6605CFE912DDEB22960F0262A42A73EF371807ECDE7DE4A5D5102EFEB3F70B2E0FD9820883064ED6AA2BBA19EF643B5B41EDA43B0A39998E510D4B3F04DBE841953A75053988962C52485CD357E75B9CD326D3108A0933E8372BF24F7391A763D06A520BF89190E529D97C1758BE6D0118912B11546E4E79217F09091263CFF84E59FD07AF660695E9EDF7E845F3F53CBDE862EDAFB2CAA0B7C5C581360C9E812B23C2AF73CB785E125C31857293A4E856B8D82E928043C2A23F23339D2D2CD81CE8894171D9EA1519A019A1D27A807D872A49B977635B3F560BBBC0EC712024A82871DC7AB397815583CA78AAB2F98C8E2E923C8F40B8714D77641AC0A0E36761248F752989D8EF05314631DC760EBBE16BEFCA3BFB3A74E00AA978047A3A0C0436B530F936BCAF1EA0EEBB71C46248D8533555F5850A7A3CC9D52C6C76F399FB165B9684E08413B178E914290E927BF7B86755B9B133C66D7BC57344149912BD9879268A4B26D2A174DA36CEE646CAB9B473F3C47A637444A6508A0CFE4ED7FF3CFBEAD009A7898C8BDD3717A0FBEF99DBDC91E8A27137DDA17D1677EFD8C8F75260710F0F7D2BEA3FC6ED55E664E9BC6F05C3F36222FABD13C10A741444A8A50DF3B19509EFBCCF4C9087E273BABCC8BCAC8CB41318344FB7A659761FDCE5769DDB75DE6A84D5BA5BB700A199553993D711423F203A882B72C73D089A25F92EB3C485F4344D002A05DAEB385191502436EA150880F05548B2B674E666ECD08D23C0E8AE641D76C54D54155353445435555148F1745D3246DEE4047880DFB5B7962DD5E46E4A771DDF935F86361FADADB69ED8DCA2EC0CEBE10D1B8499AA4D7C1A4AA723C19693CB9763FF7AFDE8382CECCE1395C34A588E20C01C4AA2CEA7504159EDBD3CE11918EE81542FF0E695E83E23C0F13471673FD4593292D10A907054D17D7A6618B13D831E29A5F521185283F8E8EED68ACDB51CF2FEF7F81F53B3A89251C638A7333F9E42D0B58B76E3353C755929B13E0CF0FAF60446905078F76B3657FA7745911E3317B5219B75EB3800995E9B2482B24B762B6CE3F9EDBCFF7EF582E5DC1454A488E95D0B2967E648A2BC895B0191B7BF17C8AA78DC16B7771EF07E7BA1C68E9C69268837D8B2FC150049DDA80BDBD005A4413DB7F87F9C26752BBBB37DA4BC876E68C469FFB1DB4AACBCFFC7867708457EA5AB9FDC92D4C993C99B1E5B9600B912183B688C3A1DE1831C74D71BC267E4EB97098FCEC5BA5439D2AD87E2D408B55F1894D8D82F32C5AB223F4341DA271F716BAEBF6D1DFD986198B13F11760948EA7B2663C534795499DEFA43595E04BBBC2FB2ED739A9F12C53209610DE8F6346232E50C74D86A57BB9786215E755E4E3F778F16AC2EC5C14E73C58AA87A86899D73C78BC3EB27C6EBF8F4851689A2EB9CD5DFD11D27C06F959E9C4A3513AC32677FF63A3C4C7FD878E503A2C939EBE209565E518BE007F5DBF9FCE9E28ED7DA23A675193AF73F3F92319374CC710D1A7EE45511D59609346BE8E23CF251A5EFC690659997E0A72B264E1B02B6CF2B717B7B0EB40334BE74EE082699564FB5D5F402148D5DE17E3AF2B76F2C0333B38DA1EC60C45583CB59A6B2E9D8C19EC615CF570F61E6AA6BDBB4F6A880845BD9AD1C54482260D6D7D1869593CF8E44676EE6DA0345BE5EA8B26F39E25D518C2100295AE8108F54D21D7CFD23669E930B9EB9EA768EFB1510C0FAA68F2741C4CDB64FAB54BC91D534645468C1FBF678A0C2204A8CB89F934E28421804E0D30DE76004DAC8FC81FC7E1843B52BBC33701696DECCD180B7E80E2CB3DF3E3BDD5232410706B7317DF7F781DD5636B985153816345A4F75B8FA9B3BF3BCA80C08264D76182DE264EF5DAF76230A09EEA776FF6F354332027D412072937B9B42B7191C2845488FBF7D3DF7A94AEBABD341DDC4BFFE1EDA8964D9FAF0C5FF54C66CD9E4E41C070991882929028FEC512396801C43149B38BC94614272614EB6212B823668C9955C5DC346702E90298555532297AE236B58DDDEC6BEAA6A3A783886033E0E7BC9179CC9E54C1F8D21C1C3386A65A32BA56745D82BA652BFCE6C9EDFCF2B12D44C226A1984561A687F6EE7EF20259A4F93DEC12D29B9683660BD5B838178C49E7BA9925641BD0D21BA1B12344F5C86114A48928DEC1301CD23C017C5E3FBAD7405563A8DE00583E7EFFF87A7EFBD4767A223AB99E105FFDE022A90DA2AB22E7ACF26A6D3D9FFFF19352C449F8079A7D9DD23FF1875FBF16271EE7AE0737B06977036D7D21D90894E6D3A828CDE657FFF62172D2355EDEBC9FEFFEEA310EB79B92765791E3E1CF3FBD018FE2B22FA4988023FC5A84588A494CCBE2A7BF7E8615CFD7A2FAD3A4EEB86C22B2E3CCB9E922B2471631AB348D2F2E1AE9D6AC132DDEA781CF4382FD2962C5DB0FA001F3C52F10DFF6EB146FF18D7753F3C7632CFC316AF90567E5786FE9200952C5FEAE20B7DDF7121945C52C9B3D1EB19ED69D3803B68703BD269DE1B8949F74D31CC76546DFD2B9CEE9CE276769BB4C2C0B27D24FA4AB95D6FA031C78E93962A2E3D08181AC4A72269DCFA4AA0A728CA8044DDB52888BDC74425F437A0B8A42A088A00548C74C82824B2DF635C32C9B38822B678D93FC5FC39BC10BFBDAD9B6FF103B9B06B0550F5FB8763EB5879BF9FD632FB1647A15A1602F15A5657CE3C6C5F824B7212ED30C86A653D7D9CBF5DFF8131BFAF3DD82992AF2B842D75A41B15CAEB1A27951054D109B2C9FCA7BA79470C9B85C2CC7E2278F6E667B5D37238A037CEBCA69B23350D521EA78E8891B0C44A394E76530A2D027F59FEFF8DB36EE5EB193385ED2F520DFFDE4C55C37AF1255D41B1483675FADE77DDFFE078E6690E3B7B87EC978A6560F931A214FADDDC3777FBB12430F8010531257246889F10897CF2CE20B1FBD52A62A9E59BD8B67D71F60DB8166AC5090E7FFF0297C7A58E69B053B44B6DE3B269A62D03CA073F7FDEB79EE859D685E9F6B6D25D22D3ACCBAF142F287E773C58422AE99982781FDB58C9EB7F2880D45D0A98DD6DB12A0ED968D44FF3A3FB53B7CB3BD140D6DFC076467E1FF8A0CA9E3D012B6F8CEC3AFD01054B969D90C7CAA2DBBF484C1D7A13E9BC67ED159E882A0CB7375E3DC5389ECBFD92D9FFDDF2762A8D75D902B4729A237271624DCD7CDA1575FA153E876743711B675FAF3C65154319AF1E5B9D22F302E4D4F5D668654B4139C60F1FF42465476134609C5903A2023B20C2E9B3E8EAAE2610C381E1A431A773FB3815B2E9A21ADA57A3ABA593C71047D11879D8DADCC9E54CAD3AF1CE5570F3DCF17AF9FCFF431E514667BC80E783034C18080BB976FE44B7FDD03A23BCFCD35B86C05416770DCBCAC224D6F05B726CEF080CAF4AA42429110F5ADDDD2C75080FA4DB34B19579E83A378786CD3519ED9DE48576F3F534695F1A30FCD970982BFACDCCBFD2FEE46513C8C29F473DBA72E61628968A2B6B0149D47571FE1D33F7E12C3A392E977B8F38BEF964A79ABB61FE5BF1F7889C65EA18EA74A0307D934925CFE845BB962C9443E75CB52A90BFDCB7B5FE4D9B57BA460D4BDFF752DD5E57EC984110174D4B4E80AC568EF8E73CFC36BD9BCA71DF0C8274DA438E28E495A410653AF58486545161F983792F38609929DE05DBB63733ADB1040A7366A6F4B8076A2BD44EE2C962FC9D9DAA45FE13F3D17ED86D05114EE5ABD87DF3EBB9B1BDEBD88B18569AE9A9DEA70B4CF626F97852DB4A045482791396989727A2FC7D91AB3138F934487E3D1B46001C8FC66A2A941FC6D0F7433D0DE44DB9143741CD84647533D617F11C5131750555E449A139251B274E016AC0E91738E455D4F4091EEB063D803212AF3025CBB702A0579B96C6CECE7D57D8DCC1B3F8A8A4C1FC3F3540CD544D7BCA0EB688A28C6093A9A23B58E1D7C6C6D0B72DB9D4F307B42259FBD7C1A25D93E34D1E8A1298CBCF54E8EF4795144D14F4E8D3AB6E8469486B78A3403C8F55AE4A57B38DA19251277F0C50778F9E737317EC43039A1FCF1C1A7C9C9C8A4ADCBE468284E5B5F9CF5BBDB69EC1EE0BD8B27E25322747675525C94CBF4F1C3A92A2DA0625806861391DF73C8F6F0AB8737F18B07379395A6307FCA483EF1EE1AFA43369FFAC183B4C7BCF8155D3ABBCB967B4744FBEEFBA0C8E6C230D72D1DCDA50B26F2F8EA6DACDFDA40635B9C8F5D359E9B2F9B4C38D48BAA68D4350FF0AB7B56B17177379AD020571CD951292D212C074B8D3366CE04C6CF1ACD85938771F5E4323C89EFF474F3CFE2E843009DDA5BF8B6046862FD44EE9B81D35B97DA5DA6B097B1E40EF4B1B7C882D23F6D4B584889F33D53DBCCD7EE5DCD94A953B8625AB9FBD2290A4D0371767599B2502838BB6E249D781165DAE3FFC2969C284F4C75B8854301D222F8749D0944CA231E0B11E96EA3BD762B0D5B5EA63718225E3E93E155359467AB1822C72C0A81827E970468C1E410D1B465931EEDE58A3993995E3D9CFA5E93BBD6D63160C6F8D2BBA6333EDB83AAC4B00D1F2D41D8DB1AC2B21C72D374A657E592ED17AC62A86D37F9F9DF5F26689A7CF6B2192C9E301255B1D134856FFD65356B76B5CA0E4E51446CEE8DD36F09F70111559A8C2FF470D5DC115497E6F0F8EA5DB4F645195592C737DE3B8382AC34D9C5B7BD56687CF453DFD4C9E40923A9AA2C63CDCE467EF78FADACDFDDCCC4520F5FFFC845CC1A5342A6A1BB5443332A530AA27B7BC0D6F9E9FDAFF2BB27F690996673D1F44A3E73C56436EEAEE79BBF7A9A982F0F4D86CC82BFECE6FC45E94FA4617461D86B47397F723E5FBAF5121A3A82FCF1E1977875472B372CA9E05337CC23141E90CF577D5B88FFB96F1D1B7777A088204040BEFC3A8571818D2FCBC7AC4BE631615C3E57CD28676A71967419175CEAE3CCA2B71E280C01746AEFEDDB13A0AD28E6DAFF20BEF9F6D4EE3285BDD4E14BF12CB90325B32285BDCFD22E12C0C4C38E2C067EE6AE67E9B4FD7CEB86F9C2A44FE63E7B62B0BB3B4657C4CD4BBA4ED9C251E5E479DFB374656FF13083A3E7133FEABEBA6EC7A4B851D1FE2022512516A1B7E930F51B9E9352A5DD6923304AC75153964B8E1AC30E07654AC315438AC9885A44D0F198C3ACB2742E9F35994CAFCEC6A3BD3CB1AB93F29C00EF99594145BA435C0FB0BD23CAE35B8EB2E17037C2012B60C0F5F34673F5F44A8AD34D6268B40C44D975A495E2DC74E68F2997C0AD8A49B12F486B77580254534F88BFAED9C7939B3A08590A694E90DB6E59C0F5E757E1B1E334B5F7C9083A3F379D7C617FA5D832EAB41C3FE1688C50344AA6DF4B7ABA977E74BEF9EB95FCE1E97DCC199DC3AFBE7115A372546241A1BFE1E6828576B548A1F4391A3F7B600BBF7FAA1645A419EC5EFEF29D9B254FFA6B3F5F8EE9CD4195939F28584A5DA4E3E228B62639E68BA61570D9F96379F8B1F56C3B3C40C8D4B879E9703E76DD1CC2E101F9BD347646B9FBAFEB78695B23A801195523849644711087B2D165CCBA643ED3AA035C755E3185012F9A08D11DE1EE73EAEFFDCD1EA021807EB311727FFFF604682114D3B11D73D557B01BCFDC65458E84E6432B3F1F7DFEF750F3C6A7367A67B897CC5424F29CA2A9E19EF507B9EDA175DCFED9EBF1119536514243A1330207BA06E8347509CD2EA8FF5F02E8D40742AAE149FEACD0BDEAA3E7F00E5AF76CE1486337E1BCD1949416539D69E304071202492E408B3FC26F50B7A27CEDDDE7939F25E86C1E5E38D44B7D5F94778D2F6378A64654F1F2974D0DBC58D7475D579490A8AFCA79D0A130C3C3D4615E3EB264148B46E7E0185E9ED97A98C6EE20372E18C7B0805746FBBAE0AB25F8BDCDC118773CBD933B97EFA6330CDE583F5FB9FC3C3E71C514BC4E0455C0BAC03431F5D8AA6485C8158323920F02F1D5844E8650C8D0B873F9666EFBE32B1465194C1B53C2F0FC0025F9695417E530B3A6149F21F2DB1651C7E09E670EF0DDBFACC7A32A8C2EF6F1D5F7CEA2AC28979FFEE9399ED9D48C62A4498016AB2D194C8B71552C9C984D49B6C2973EB098EA11053CFAD4569E58B38F8E7E93EFDC3A8B0BA695108985E598C42216758D5D34754758B7AD83CDB58DF447DDA274667E3A3396CEA1645421EF9998CBBC113918AA822681F9CC566F43009DDA3BF3F60468716F560C6BEF03C45EFC3C986741E12E315EDA8865782E7B08297FF64FD8645CE922358783261FB86305172D5CC0D4522F51E1462DF29F8E4E437F84ED3D36A6941E15F969F1B9337B49FE09B7F7BA530872972CBA89175CB035BA9A69DFBF83BD9B36D1172823B3743863B31CD4900BD0A250285C524491301A0E316944011F9B7F1EB6E610D7023CBAB38DEEF000EF9F3D8A228FC38E1E2F5FFBDB469AE2DEC47798588ACB85878D1AECE6FD73CAF9C98DD3244DACB93FCEEA3D752C1C57C6D8C23C2C2D8E070F0396CD81B65E1E59BB9F075F3C446F30268969237254FEEDE625CC2C139E91A62BBBAA3A38BA9781709448D096CC88CC7C0F9982F121DCC565C940C1D1143A623A5FFDC5638CAA28E3506317ABB7D64BFD8B9A0283FFF8D8C54C2C4B9391B4781E9EDAD0C6277EB512C3F0936E585C3E65189FBB7EB1EC64FCCFBB5F606753D08D78E5F420645BC1107F625D7CE4DAF97CE8AAF93CB5660777FD6D3D2D9D31FAC2511EF88F2B28CBB23085238AE81CB44518E04E48ED418DBFAFAEE56F2B76A0FBD21933A38AE94B67E3D743BC6F5A09E38A3265FDC3ED527DEB698DC10FC31040A7F6F6BD7D015A3C96DDFB30577F15ABEEE9D4EE3695BD541D63CEB7D1A77F3995BDCF6C9F64114D3EF482F0A5F0F3E7F7F3E4C17E3E7ED144BC8897DBAD96472C83550D03F4C5F50407F5389BE3CC2EE2DC7C5ABEC26F44AA1691A688FC82DD52B3A3F6A517E85272F0978E605C868D1AEE77BDF912006D86C3A42B36EF5D348D490519E8C2895AF353DB0BF95E8551D9C291DB6175639C6F3DB593A0919158F24BF16A771345B4F0004B47F879E0B38B5D4686D7CF139BF731A62C9F29A5C3A400BEC8F3FFF685DDDCB97C2B755D71FC9ACE4D4B2671DEC85CB2BC3129A664C44258A2F8A829C46C833D473BD85FDF2AA14EFC1154C16105394C1C554E6E9AC7A51B8A31D1344251C8F07BD87CB49B6FFFE16536D7F6123006F8DA07E672C3B49128AA255923ABB7B7F3F1DB9FC624434E665FBF7936372D1A2BF3192B371DE16BB7FF9D889D8662884E53E12A13271EB1F9CA0D53F9F0B58BC8CBF0F2F3FBD7F0837BD6A0AB7EF4581F8FFCE47AD2957EF9ACB9591137FA562D15C7EBE381A777F1C747F7905590CFB21B17935F964D893FC2B5934B2913097CB90D01F4B9796B5E7FD4B735404BB3D19D77115BF38DB3A2CF911C1EC59B85EF63CDE75E482909D072D9EF46D107FB4C267DF3413EFFDE8B9855918F1D176DC72273EBE195A63EEA07043FD7EBE2CD6B10F0CC629A933F72A936AE9CECD3A7BA1E9183161E8B12396321826D0DD4AE5A415BD487BF78046302266AB84FFAFA49808E8650A261168DAB66E9A44ABC6234349BA0E6A3C14A6798DF4FA1164151636C6857F9FA937BE857B3130A80421759A4844491D24089F4F3AE9A4CEEF9D02C2C4DE795031D3CBFF520372F9DC884924C6C1191DAF0C9DF3FCF1F9FAB43F5A6737E75806F5D33839AC234D7762B16C7D04494ABD3692ABCBCF9203D7D034C9F3A0DD51790E90DBF1966C7BEFD7476754999D5CAA20C297A250B8D8A85D7B6E85302FC74F96EFEE71F9BC18C70EDEC32FEEB9645788C18B61263E7A13EBE79F77A763545E524FD891BE662F77630A2C0C3FCE9A379FAE5033CFB4A2D750D3DB2F53D274B61C6D891FCE7976FA0BEA59DBD871AD976B09BDF3DF2AA5C818C2B31F8E9672FC2AB4425033C6A6B0CC47421F62108D1F49A0A77DEBF922DFB06C82DCBE77D9F7D2FBAD5C3BCCA4CE6570D23CD487EA367BE721B8AA05383F8B737404B94B230577DF9AC35AEC8615375F471EFC758F84330A4B9CF39DA121CDB63045611BBA92CFBEFA7597FB8971B2F9AC19289A57884909088EC84087C5F9CCD4DBD0C38BE44EE53148A34B7927F963779C893A0EC1B46C6295C83CBE54E04B642FBBABF87FD2F3F4B634F8C404E29237C119C50A72CD2093124AF1D63E98431CCAD2AC650A2A86A3A8A1143D1FD2CAFED655B731F1F5F308A919982C29BC513B5ADFC62CD11BAE33E6CD18227625A278E27DAC7DC0A0F3FB8793195E996A4E1B53B5E8E76F533AE20409E5F45B7350EC72CAEFBE1636CAE07DD037346A4F3A1D963983ADC4FBA1694EEEA82DF7CA4B5875D473B28ABA8E6A117B7B2727B1D39E97E0C4F1AF54DED8C294EE3D6F72C24CF17A73CDB4B71769A8C5B35C5A47140E7377FDFCA63EBF69393E1E5E60BCFE3AAF963C8D2FBA51B8A62E95214E95057905F3DBA96155B9BB1AC00A61964E1A4726EB9741607F7ECE4F26553F1797C7875039FCFCB532BB7523DA18AA757EEE0378FBC420C956CC564D9CC6A6EBC6402697AD89DF01D8D577775F1DDDFAF268AA0D72968899E7D6F96C265D72C65D4A842E6566633AB220BBFD01E7DAD77CAE9D3A087687629BC276297B73F408BC59D705BD9F28BB3CA8B56BCD9E8D3BF843EF9936048F5DB73BA09CD037773787047335FFCE32AD233F3F8E0B249D4148BE5BA483A2385FCEB7A4DF6B485E8B184D3B72AA351B9B41E243F7A0EF0FAD8FD0FEAEC7ECB6372A2E7ADEB08120F0539B4FE799A3BFAF0650EA354741586BB880B3D0FD362644136174EAAA128DDC0706CB20C0B47881EE91E36368768337D2CAACC23D788E2D321AC66F08FBDDD3CB6BD9EFA3E9794A863727E652E9F583286C9C5E2FBB4A522DD4BFB1AA4FCE9F935C578B0112CE95575DDDCFC3311D10710A2C8AA196252B6C2B7AE9ACE84121DCD51A52A5E7BC8A6A12FC60B3B1A7878F52EAE5A3A93922C91065058B7E728AF6CDBCBF88A3CCE1F9DC794CA02A65697A2A971A9B35CD7EDF0ADBB9EA77DC0E413574E67D9B4110444641B15AB0BE15C28F44C5C9EF3DEC620BF7F62232B77F710313572FD0A8134132516E373EF5F2A0D6DD3FC5EE6CE3A8F7FFFDE9F30B27289C4140E37764BB1A425138BB866F1388AB314B7655EB1885906CB5F69E2F7CB6B31142D61E61BC7D162CC59369B050B27C962ED053585E407C4F3255B57DEF2F77DAA0F0C45D0A90DE53B02A0E33B7F4FFC95DBCE8EDBCAA07153B22A31E6DEE636B088A68773BDC93E0893EE98CA771FDBC8BDAB0FB06CE604AE59300AD556E58B2596E0160607BB0758DF2C981E82CD90C80ACA94897B91C9C0F75C01F5095A1C27199753A5375E0FD03656344CFDA697686CE9262D9045A13A801DEEC58E9B882EF7B4DC128A0B8B49D354B2149B1B2666CA8611A17571B027CA9A86089606534B73995F16C0ABEB4455832D2D415E3ADC230B6239693AD74C1FCEA83CD1AA0DA6EEE5F7ABF672DFF39BF8EA3573B9694E952B9FA9EAEC6AECE4DFEFDBC8CB7561FA2DB79839C21FE17B37CC65D230034D50E2148596A8CEFE8E28772CDF40477F9C4B678D61E7FE2384A336572F9AC6531B76B3B7AE91F74C2D614665010B278E24CD7079CB5DA6CE1D8F6F24666B7CF9FA79E47B5CFD6BD9491917290D211AE5DA5B39AA8F836D11BE73CF8B6CAFEFC134C554E29095A631AA3483E68E7EE98358599ECFD6DDF5D2E24AE83AA71BB0786201375D3C8EA24C1D251E952DE962C68AC40D1E79E930F7AE3C8221532F82561761FC946A165FBE80BC0C8D778FCA6074BED0E410359204B3E52CBD0343009DDA40BE2300DA1968C2AABD9FF8969FE384DA52BBF354F65214D482C918F3BF8F5ABEE88C2BD7A99C529AC83A50DB19E44F6BF6B2B539C284AA32A6541692A9DBB23025E0376239ECEB8AD21C84B6B045548ACF27D1F9383CBABD226717A64F06BEAF3D432AF9F04482072716A163F7461A1ADBF1682A39561F56A44F1609459EB6C75F424CCF92CC429F15E3474BCAA84C17195D13212BB5B3C3646D5D177E436771753E05191E46E606500D0F4121066483DF6790E773D00C95DA96309B8EB4D113B649F368BC6BCA084617F82523428826C5559DDD0D5DACAE6D6563FD00B190C9F85C87C5E38A18E613EC606121A5D218843DED26773CB15136B59C5796C3DA5D4770743F5FBB6E012B36EC62FDDEA35C33633853CBB35838A182748F8056240FFB6073377B1B7A8888D94541E689FB4C15331AA73C5767CED8620A33F4447D42E795DD0DD43674D3153668EE8971B0BE959E601F31D3E5410BE794CC4C3F63CA0BC84933C8F6D94CAAC8A6B2240BC7162C14C1F470B08496091ABBEAFBF9C3937B39DC1AC67234662CAC61EACCB10CCBF731BED0C792EA3CBC32684EEA20A6F2ADA6F2940F7512A6364AEF901487C4207380F8DA7F23BEFD2ED735E22C6E5AE5BB30E67F0F2567F4B90769D970E76A01B7854DBEBB7C078F6C6EE0F27913B9A0A648AAA3894D134A632874871D6A7B22ECEF8D1376C402DD7D890699AF9CC591383B873A06E62EC7102D16C269D8CBE1C30DC4234102F17EE2E120038E418FAF90605A29961648A4794CDE5D6071F3E41C0A3C31544DC1D0BC7446743635F7B07CDB61AA8665F3E98BA793A65B44E351F27C06217442A6437E513E7F7E7E27B58D1DDC306F1CB347E690EE111AA442AED32379CBE91E4D1AA58A16FC97F6B4D2D33640558E8D6345319C38A6307045A533AA53D71DE70FCF6F6757733F372F988A6599042351B2337D3CFDEA5EC2C120EF9A50C0B491F9CC195D86CF10B436712BAE13CAAA1D6DFCF0B19DB48685C1208445F389A331CC30B971C1486EBD681C9A1996E02A3C62510C229642E780C9C1967EDAFB061818084B100FF87CE465FB18939F85DF2B0AA371B90A911DE08A228D07C26614BFC783138F108ED9BCB8BD9FBFAEDC415A410157DE742139E90A63867958505940AE57979DED6E7AE30C12CE27796C8622E8D4DEA57744049DBC55A7EF08D1BFBD0BA7E7406A779FEA5E7A1A5AE5253292563286A7FAA9D3DB4FA639C432D835FCBCEFD5437CE58157C113E09B379DCF884C11BDB90C32B154B6559581B8C2FAC630077A84FB8AC877B8CB51D169265E4C378A3E45DAE3B5B98A37CB5DBCE95D25E0571EC7CD560FEE377B5DA4EDD878CC20FECE23D4D6EE271AECC71B0F4AFFBD1E239B604629713DC395B694DAC336B9D16E3E7A5E018BAB33F0383174CD902245225ABE6B631B475BDBB960D22899571D0845B87CD638F6B7B4F2FC8E064616A5130C4679EF828954E679F02B96549CD3FD016A5B43FC7DCD2E164FA96478718EF4F07BFED53AD22C8B09855E29D4A4C6632852AE53A725285AF11D7637F7F397976AC9C9CA627C45812C806DDEDF42381C65414D21D3CAFCCA875F6A0000200049444154D4146532B62C0F552810A1CB083A62DA3CB1B589FF79760F41D1FD27F929315735CF8C73614D163FF9E07CC9F397D90E6187620B7D0C370A8F0B072BD1D7628A5597A06288261221702464EAA2529343C4FB62D2198819BCB2A389FDF50D4C1F3B9AD1A5D982C7C18A4D4D6CACEF66CA82998C189EC398021FF347E54870D6456BBE6884392169F6A60F404A3B0C01744AC3F4CE28121EBF550767A099C8DD95A9DDFD5BD94BF3A0F80BD0465D25E549CFE9964031F19E09AD88DD1D41EE786E272FECEB65CEB8E15C3E6F1C99822B6B09BA9410CB51080B011A47A73B62B3BFBD8FDA6E8BB8E6435544AF9BCB99960D0909E0948BD6415A20C7EE47EC7AAC16741C4E8F81AC8BF927D94EFCE1A9922AF2F0426744008CA390AEC49990A7D077643FAB366C23DAD7836E866857B308665660EA4238CAA5A7C989C7B1B961B8CDD563D2C9D54CC92BD6849091F85B35888A3CAEAA60A4A511B5BCF4471D3C5E0D5553C9F4E86479E368B649567AA6E4302B9AC3917E87BB5EDCCF337B3AE9300DD20CB7655B48720A10152DDD3E254A45BACD6D978E47D38504A949D4D4D8D1D84F6B4F98E2D20AB6377473A4AD13D37298515DCEC8C2743A5B1A29CA30185F9EED1E5351082B69DCF55C2D2B76B611C64758E42824BFC3BD3F81BA996A844F2CA9E2BDF3CA5D0EB5E2A7BD3F427A204D4E2A829E18B54C99BD127C7291AF76A406B7C0F0B8D431C112A93085159B0EF3D8C626BAA37EE296894F084759114A0AB3587AF1F9A4E767621831DE35AE8011593E3C862205934EE66B79B69EFB21804E6D24DF511174F296C37764415C986D9E9BCDFFE9DE7356341CBC9014FA0CB26D4251A90B9A5CFAFDA7D8DB1163FEC4726E3C7F02E542F75D2C7E85672171745100D20CA923BDAEB18FFAEE103D118798EA939AC2C20249B6054B6C160B5797EA762CCE1D146527E3DF63B07B2C8F9DA05BC976E6C4F84ADEDDA920F9B5C0ADCADCB1BC3347654C86C38C620F3BB7EEE4E9B55B88F77649879596CCD144FD0538F2DE124D2662668846B9E7DD65142903EE1D081B2BAF079F306E151D78BAA01F0A4710074315943701B6A02B068E6A6328BA04660C1D5DD389695E7EFCEC3E7EBBA681A8A6BB4A4A22272CD6F6B2A53E21391A47D2F41EFCF044F2552104EB8AFD47F1B0E7681F754D1D8C18399CF4DC6C29AFDAD3D24A5D7B3799012F3347E6C922A5AB8C67D318D4F9C6BD6BD9DBEF47F3A4C973298EF826458DC1062BCEE4020FFFEF9A198CCAB5D17583C35D2A3F796015F9F9994CAB1AC6F8E24C86650A8EB7489988DCB9473E070290AD81303ED5D5CF8E2906CBB7B670DFAA8344A30AC2E550083269AAC9D20B6670C1D29968911E46E76BCCAF2A244D17CE07EE126D08A0CF0D7EBC95A3BE23013ABEED37986BBE7A56DCBF4F36985AF9628CA5BF41C9283FEBCD2C2766FA5C80164B5E1109FF78C50EFE7B85D054B09834A6882F5C3D9780EA6A31A8426847A2AAE0442B44342FDDD138477B821CEA8AD2167288383A9668C490FA0D83531183EE72702A24991E49C2EF2007E7E3B44037BF795CBC6910501FB3FF4E08F9C8E388285E38975AE4191A17946A940614D6ACDFC1332FBD2AC5FC4504DA523417E704654121D0A3A0C5C3FCED8A5274332A2DAD36B705D9D212625A4511938BBC147A44BC2D96F526AA21C0589334324DF5A0796C74250D29DA6608FB409D305EBEF5C45EEEDBD28EA28B494380931B891E97DE76530B7A2CC27D375452E2890B0F1239430989D2B8E1A52B14A7F650832C3C8AF1280C2894161753989381CF11EC89648C6C115132F8FB9666EE5F7B884E4B70B53D9229A1D9624524581C312695A6F3B9774F664C81876D47BAF8CBCA5DBC7A6440AAFC79549B456372B9EDFAA99236D71F5359B7A785BD4DFDB4076DB29508375E38950C8F28FEA9BC54DBC3EF9FDD4D5F5095FA2E79393E162D9ECC94A955F8D52863727D4C2DCF255DF88539A2BE212E36B9DA7A2B7092FABE4311746A63F58E0468612E2B5C57ACA32F20F2D2677D13BCE3A219E8D3BF22859594AC9167FD1489B0D1D581932FB72515CE1EDF58C7832FEFA739AC525494CF799545E405340A33D3F07B451E5380AF800F055B1380ACD21D3269E9138A78367D518B7E11652584E8E57906119B4F88AA05409F84AF775CA73D11469F346F9DA0FC258491E4491272CAEE2464519CA631BF340D3D1E65C5CB5B7876CD3ACC8101C29E2C7A8AA6268A820298937DE3AAA03AF0E9C9B9E4F80DEA7BC2BCD2D0CBBE9E18C3FC1E2616A5B16C7436E3730C8A7D22B72CF2B57EBA438E144DB2359B989A260B80938B3DA4193AAAE6E53F56ECE7771B9A712495528094183F916A107F89EB762DA14A7D0EBF7E572901CD211A17CD1E96648EC8A2AE2AF8E85E4C61AF251CC0FD0A9A484158368EAA21F487064261390C1E7F169B5B4DEE5973504E9E8E88DC45FED889E3885CB4580D1065CAF04CC60F2F62F5F6831C6A17FB098A1F98164C2A54F8DDAD33885926AF1EEEE1CE277772B0DDC4527D646A11DE3DAB9205E3F2C9F2C0C6035DFC6D733326E9548ECC64D6CC7154550C23DB30A9CED1A9CA4F27DD10ADF762B5F6BA769473F26C0F01746AC3FACE046871EF5614C18F16407DCE3691DFADB9C12D1EA6159C3D86C7A0303A19C8897CA8284E25E3B0B547BAF9DC9FD7B1B7A51F5F9A972BE78E65D6E852B2035E3CAA852D8A44B2582872D4C95672C1A5D6B045AAE384944432E9EDE61D9331B004E76301F16BA87BAF1BD4443130E1EC21AF3BA1017DBCC894B0EB1201AE9B00478D3BF25A1F79660D2B5F5E4FD849235A301AD3275AB593A98D44449B3CA7084745514C74094AB1204935702B66A14EBEB47024378ECD96D6547511953FBF7A941DAD3199EEE9366D0CC7E2F6EBA67181D087F6387CEFF97DFC6A6D2B66427848E6BCDD3CD0B19C304E0CC30AF3AD459514A42B1C68EA40B51DE65764135005DF435C86681CB2E404105704DF5A90EF2CDA6206AF369AACDFD784C7D018969FCBB3DBEAE9890B0EBB2601DD4D1CB94C0D4D5A6AB98029FE3BD68494982CC43EA3B21C7EFD91D972E2F8C3CAFD3CB4B10D5BF54A9689E81ED4E241AA720DC60ECF278443766139E3C6955298E3274B8B5396E3A7BA2040814CBDB88EEC82F5214B828E98E8CFDEE37CB2F76F08A05343A5772E408BF7B57E25B1A7DF7F760C664F319E4A7A09DAE86BD0C77FD0A5E1C997FCEC6EC7F2C489B484789D43A6C5AA836DFC7D733D2FEC6E2564AB8CA8C863D2F062C616E75051E095CD0AB2FC2F8B72E2D51B649825C133F912BA12A0C9A8DDFD3B193D275CA6A573B72B24F446EFAE5BB4728125A91572D29AA23CBD0B82966D72EFDF9EE5C557B713CDAA20965526B5AF4FD85E97E23E36750DAA6A0A7B9A7E3E35B3840F4CCAC2346D9E3C12E4AEF54DB4C404854E3ACBCA22E5C46C9B5BE7D7505D94C15D6B0FF0D8AEDE04C73C419191E74B8C91046B1182C7A9CED2C9F4281CEDE8265DD3B86E5C0E73CBBDA489DCBE6AB85DE58A22036FDD8EC963ACAA1BE0DE2DFD34F40BB08DA31BC2515C914D311298ED845C68623674D34F8A9B6E11558664DA494CB4D24B50919CEE5B6697E231749EDBD9C6B6237D325217CB2D2B1E45D72C0A32BD9C377638D3A68EA17098900A35199EA95095EBA338C38F5F7F2DBFF95851E1EC3EC02739DA1040A736C4EF688076822DC437FC80F8EE3F21D21EE76C33D2D14AE7635CF04B372FFD4FD844E55ED0ED9AFAA3BC72A89D5F3EB7978DF59D6478BC9415E673D99C6ACAF3B2C8F31B3267E936C02473ACAFAFD00F8A9BDDC0F5358A652E5E253C0693E09EC88D1C67D489A324402D21D2EF8275721B4CBB3B9EB7B66C9BDFDEF70F5EAE6DC4CCAF266E641D97C23BF6E1C1087D62A63ED147E99E2432C08D130BF8C49C323AFA42FC6A7D13AB1A22C445FA22999B7104788629CF36C8494BA3AE2B4297C0D2E48A4102B2E0AF25E7AC44342DA9273109D46267BFE2704985C10D13F3C822445B44677D53AF34899D9067303ADF900C9A27F60EF0A76DFD745BE2DF9614E777437E573A5644FA72D844ADE1585F51621CA59F43625A4C5C9334E1722C32B430AA6A108C2239CD8E6D636830B22C8BCA91C58CAE2CA6B424879C804A40B1284833985C964196474BF262FED708F343009D1A48BCA3015A1A69069BB00EFC9DF8965FE2F49D3D8BACD70DAF28CE154E43CD1D833EF5F328E75CF43F69122AA854710EB60DD0D617A1351467435D072B763648C3509FE1252DDDCBB0EC348A7202146405282BC8425745AE34017449C3D1632965F7D8B2A162502419883631A3F1E7F8E35D3C31EA77123864C4EC724D8E83B350AB4BFC549CE38446C6041089F1932C0C79009BE756ADA525A262F9B2254809B6810BED8949258995493A59E2E7C9CE4B37E214A4064B6A550CCFD088991607FB1DFAE309EC4D9C4B90142CC1F1156A88526E5314C404748AF4C2F1CECBE48426D4E9A45D97B85E995E71ADA544AE789861511550284C536818B0D8D32BEA9FC262CB6464965772940FF798D4851462028005BF5D887927274BD16E243D055D435A29C1EA0EEAB1BFE5E429CF271644E25BB1F0192AB99959E4650618599E4F69491E693E8F6C7F0F786DF2B2FC146779A54468815FC3A722E975018FB04E73574567E288921ABC9C7AAF21804E6D04DFD9009D1C837898F8E69F13DFFCDF08C3D973BAA9064A7A29FAE48FA14F3D87F9EF647E22F1A225B156D83BF5454C56EE6FE7E57D4DBC7AB0833D4D4182111BC3D0D07D3A395969927D20013A918E108713AD2D2E68BB9B649008A8B51D2EF0EFE08B590F5365EF256CE92CEDBA936E2B4D5E45F233C9683919272763E7C1491141B2139B889F05DB4D80A3E5C4B96C5A19934797A32B22FF291201EE5E492A4572A290E792AA6BC92B4C80996B9AE2325964938F9B6291FA2512DC0400BB91B1C8F10A3D1301B871D13822D3406E94ECA6710605CFC9F191054357E3C2E594BB1387885A85B9AA6EBBCC0E29572A24525553E0289663B8632C9833096D8D586212702738C16116809FE430278E993C76C22DE518688B2F58B1C8C90E503AAC8874BF419A17B94AD245D38F62519CA35390E1931D94E9BA60B124925B623C4E103C7AB384D5B97B5386003AB5B1FDD70068F9D2DA44EF9F8DDDBE3DB59139C3BD04481BE7FF04ADF232295F7AB6373766158821F29DE2E5B66405DEC56B0122AA9070A7251C67D59E4656ED6E626FF3004D5DFD0C44E238B228E482B0CC838A3A9BEA46A14923EE2408E66B7DFC34EF4EE67977CA1F0985B5C7C3F3F88F9E0F21F806F2B3C97487B48B7217EF026865DC294E25FF08817B910756E4D25FF8FF698235615B7CE0C209D494E5488A9CD09493544089D1C7F3A4121A251E27D20F12705C6790E426582BF26A1202F92E8F595C872D8B80627F01D0925F2D8B716E87A2EB66ED46ED525AFF58E2DC1D4B39A5481D6B710DEED8B9B9E204584BE016002D605A3407895A847B9D72A2905720181F6EB47CFC04AA7B4F897B914D408955CBF1C9CFDD475CA725CF6B4BA716C7114A243601CD20434CBC3E4DF2AD856FA084643131C9F11F5C5F48145C4FD08C3D6995E06C3FB2271C6F08A0531BDE7F1D8016E9436134BBE72F38C1E604952AB5413AEDBD743F5AD565E8533E235BC4153DE04A979E35A10C1798DC629B28048AB84E808D6B3C2A5F4CA1D0868268DBE989DA74F447E80D9928826A702CA79C04D004208ACF5911887693D6B38BC2DD3F23D0B951024372B38D4CBAC67E9C9E9A8FA37A335165C12B015C09F84970014EB8DD2458BBD8EB829EAA3804445E54152C08F77E04582663E82458CADF25532E890B3996914844FEC7FCC513FF76FF72514F46D072C044A12DB9424870B49379F564149E484027825E773293BF4BD8DF0E5A7D24AF4174F3090075F984EEA4E0AE5092D1BDDBAA2E521C6E047EEC72DC887FD00FA4A8913CDF71F094BF561DA9E1E15515C95B1634BF0C8F815F97EE88C70EE84273227F7D02FEBEBE187CDACFF7197C7008A0531BBC7F298096AF8E1924F6C40DD80D2F9EB34696930DBD225C98ABDF835E733D4A76154A7A596ADFD05BD86B70F34812CC8EBD9BC9B6EE24C56E70C13E991F112F756C00A7FF28D6E127A4F8D49B6D6AC95C8C853F411D2678CB2772AA8F058A83EB7BAF39E071B878839D5E7B11830027195F9F78EF83412D71DC934C8A278B1B8F657812BF749B24075DDBF165CA2016CCB1B03771A583417070C224F9EBD74A779EB84F72184FBCEDE43113CC9CC4BCE3AE33DCEB9314C91312FEC78BC1C99F9FCBEEC0377B5606FF7E08A0531BAD7F39809620DD7F14F385CF611D7E32B5513A8B7B295278E95234D1E4925DFD4F310348468D6E92F5D8EBFCBABB72C21DC477FD1167DF23D8ED5B53BB6B45C558F07DF4C99F76696C12CF12803128FA3BE5C14EB9BA3E19609FC9523CC5E3BDD16E8327A093D8CAA43EC5B8D3CAB1FD4F2264754286E558642C47F778F35062F5343861F2465F9ADB8872266398DA2391CA5E43009DCA28BD83E44653BBDDC45EA230D3B08AE8DF2F3FEBD2A4295D87607C94CC412D5B885A3453B23F8410D3B9DA8E4764C948EDC497546868DBCDEBB18FBE407CE7DD6F7965A18DBA127DEE7FA266559EF5F4CDC9A3C8D31DA9D742E85906AB5321742A1E6129CE1F8366D8B33B34A73BA4A7F9B921804E6DE0FE252368198744BAB0F63D2C41C9AA7B4A0AF4FCD337CD8B923902357F028A2FD73DBDC85B8FBD113577EC391364B2F63D84D3B91327DCE946BCE14EECF66D38FDF5098EEF5B1C094F065AE902B45157A38DBE4EB62E27530F291D2965704AE968A9EF94F2798FEF783C33742A707F83387A505A69F05E838F3438F374F21B1994BE4970CEFFAF44C5A90FFC90607FAA63F52F0BD02E3259523BDADCF853ACFD8F9C5567F054BF80D7EDA7EAAEBE477A99747351726BE41F35BBF2F40C6CC53DF61DC16EDF21EFD56ED980DDB60527DC7ED69B770473C5B3E47F50472C3BEDDB1FFAE0BFC6080C45D0A97DCFFFDA002D41DA96AC8ED88A0FB985C3FF2B9BD075105AC8423E53F7CBBFD5FC4912B41105C761534E79A52212B69BD7E2F4D563F71C74279E7848AE1284F38C6BB1716E3625B302DF07F79E9B830F1DF51D330243009DDA573904D089718ABFFA23E21B7F8213EB4B6DE4FE37F63AE696224AF66FA0F9215B82651FE03905E3530D81EFD6032819679FA5F2BF31E443E73C37233004D0A98DEB1040BF669CE23BEE26FEF23771A23DA98DE0D05EAF1F01D5409F702BC6C21F82E61B1AA1A11178DD080C01746A0FC510409F649CEC96F5C41E7D979B0E18DA4E6B04145F0EFA8CAFA24FFC1818C2B6EA9FBF59B643DC168D1DAA94003D934D3492C4E289261551CBD514A96732B49DDE080C01746AE33604D0271B27A125BDE107D81D3BB17BF6E3F4EC97EDC843DB5B1B0125AB1263C10FD0AA2E3FF6C14387EBC98AB69ED095F86647D5F38713C82B427B0340EC0BC739DA1922337494EC78171E3B422866138C5964FB7514C34B9BA78C3E238FD2FFDFDE79874759657FFC3BBD646632994C7A01124A48082194109080D2150404042C14CBEAAA587077ADBBBABA826B57102B82B00A48D31510842010405A2091165A422009E965D22799F27BEE1D3229A4CC40767F3BCEB9CFC31F64EEFBBEF77ECEE4FBDE9C7BCEB9DE4AE855D2361FCBC2B8AF96D5A0C4500DAFFA0278D7E5C164AA4769553D98E8B32066AD4202B15C8962893F2A255A786A5408D0CADB15EDBCB25A949596C2B7F68AFDD9F54229AA852A54893D11E4EB05AD87C491E871FEE2C92BAD41655909BC4C8590F0D2A6B65629D2A0D623005DFD34908AED074CF2CFCE67E6C2B3361712763C582BAD9E9D1A2E54A256A28140AE81BF56CED3C83B3B7C9A04BAA36FBDED7312E8F638996A60CEDA03D3E185B0E4273B46947A351290282119F81788E35EE43FAB335B7170E90BF0339CB295D874B05D89B80FEA4193D12F4405590BC13199ADC828A8C4F9F42C18D20EA07BE15E04D4654165A96876F71AA102E9CABEC854F482266A38A68CECDFE6D37F39958FA28C53C0A523E85A9386D09AF3FCF4F096AD4AA842A6220279F2AE30870CC49851B7C0DBD3A3CDFBAE4ABA0C8F946F106DD867EF532354C220D1A350160CF49D8C4923A2F98ABFA3565A69C4D65D87E075612B826B2F4261A9B65F522809C0C9C049881E320203BA6979E53BD6D8BB65C7D2D711547A1C326BEB61A546811CE5622D0CF24094EAA2A1098F41CFB01084F9A9788A7967351268C748924077C4C96AE6F53B4C47DEB41D9FF51F8C80E86828AEF4B940E10D51C47D1047CD83C03B920F3DCF6084E4E33110189D731D6DF2BA1FE74326E391E18108F751345BCD5DB86AC06F4989D067EF4158D549A8CCED6FF2D60AE4C8D4F483E8AE45181C76EDD4962660734B6B70F8EB7FA24BED3904D56640CC0AF577D0D8AA334F1A8A8C417FC290C1B1F0F7644767356F6C85FFF9F65398716201D4E6EB2B2AB2B322777A4EC1A8079E819F57DB22DF70D7E2A2221CFEFA6D0C2EDFD5E2741C7698B70807D4637038F47E4C1E188CF8300DBFACB0A20E82256321ACED78239C15912A11FBE0AA220CF921A33164D46884FAA83B42E1F0E724D08EA12281768093B5B694AFA0CDA757C29CFEC38D257338F09CDF4B17A1361CA2B89720EA320602A5AF7D5A978A6AA0F97C9CD302BDD1EB7EFCAABD1DB3E2FC30BAB797DDD551536F41C6A144089396426FBCCA8BE13BD2D89FF04B23BFC0D8984024F4D4DAFDD317F3CA71E8781AC61C7E1A925656CC1DDD3B4D198B63114F60FAAD7D10A86DEE42C929356243E231CC38FD17C82CAD1F1E512AF2C6D6B88F317B4418BC942D4E9469F27096CC62C8BA00C3F2475A157B765CD651D52DD8E03517A3FA06E2DEC17EFCEA1BE1CF84BA48E2879CB8673068F8ADD028DA1E57477C9A7E4E02ED182D1268C738D9925A6A8AF83FD389CF613EBD0230B7EEC773F496BFB77E028907C403FFCCB30979981D3F84B5B1B5148862B10F1235139121EBD92E0A83480B9354831903FD3026D226D0C51546ECDAB50FFD2E7E05EFF2F3CD56917BD4E391EC3194FB724D1041CC4E3C178830B16C3D226A4FA15628C7AB418BE1A5D5E0EE81BE18D855836DC7B3E199BC0CFE4547A133E6DAC7735AD10FEC7E9542352FEBDA508E55663522ACF63CA694ADB6F735438412890F4E77BB0FA3A7CD8246D1180A995D5A8B4D89C7703717689B7B81CD3B47DA0509153BF9FF59E1A3D7821743E71F88BF4DECDAA6CF9DFDD2AEFD2111779E64AE232B7E55DDC67DCA31D547B82BA641A0D77BCDC56DD101981DEFDFAA40B7E42FB318799D0FEFFA224C2B5D05B5A571A57D41D51FFB42E6213CA217EE8ABDF9B20424D08EFDF693403BC6A9792F530D2C3907507FE0A5FF5A7DE91B19E67FF31A61403C24C31642E837B0CD14F596029D2F0904735F9C91F7ED70A8CC8FFADCF850F4F453C26CB62231E512EAF6AFC42D255B9A89F3173ECFE2A22C02CCB7CB1ADB57948A84A8B758A1AC37A0A7F10C2697ADC622FFB721947BE0AE583D8234429CDDBB0D83339743632AB18FA54E20E52F90ED9E77D9CF6254B033A57855552B826AD331B5601982EB9A9F1C5F2CF5C78E5BBEC41F4704DA45B635813EA388C125594F4C285B6F7FE62B811FC1ACF6C5A3C383B8CFBDB57631BF0A9BBFDF8CB957DFE61F3386CCE73EA2FC67EE5B7654A09BF2679B89CCBDCF8ECE62FB03D1352978A8E843FBE3D94A7AA9DF8BB8AAE983CF67F7EAD05E1D752081EE8890ED731268C738B5DA8B1519321D5E04135F4DDB0E0875AF2600441288639FE22B6781EC7A9F6E531E6D09F4798F180C0BF744400BB740D36BBBFB2810EEABE41B55ECC081CFD6ECC4942B1F40672EB2773309C4F86BE0125489D43C9A22CC478101A16AF86924A8309A7128C380ABA5B5A8AFAD42B54506854C8229B17AD4D75643B3E72D44571EB66F5E32713EE431025BB577A346A4844A2A420F3F056EEFE3CD43EC58D8DD85DC4A9C3B9284D1856B115A77C93E0EF67278ABC797B86B803F6E8BF0E23F6F4BA0D3E47D31D1B0DEBEAADEE639153BB49331384C87C76E0B6A35A263E5AE73084E5E82D8AA5FED02ED61A9C0AD3721D07D823C302AC20B4595F53C9C30EBEC09DC9BF697662FBF75BA0770C0E356AC7A38FAA6A33A48A01D530A1268C738B5D9CB5A990373DAB7305FDEC153C6D941B53CB5FAF7DC58BD105D044F4117068F80B8EF23FC40828E5A7B02FDCCA860C4863AB609F5536A1EAAF72EC7C8E20D4D56BB32EC578FC216ED0C683C9898DBC4B4A79FA2D9B0982F78EB89627E502C2B783F2E4A07D1A58350EE5F0C7DDD55DE97B91AD8EA7699FE2928140A84EAE4981AAB474F7F8F66F1D4CCDD71E862092EEF5A8DA1F91BEC1B94B54205FE11F43EC24303F05042203FE5A42D81FE453D01B71B3622CC6873D3303FF412FF9720D387E0A9512108D2367713B150BDE5EB133137E79F3C72833DEBDFDA7BA033156278C5CE1B5E410F09D360F6107F782A6CA7FFD4E45F42D6E78F416F2AB0F3DBAF1A8DEFBDEEC59B3322E1EFD976986247DF037EFF9A1AAC5A95823F3E7694775FBD7A14A64FEB0589A4737CDC8E8CC115FA904077A2952CC5A7613EBB9657C863F530D80AFB77D54452B05A1BAC0E8864E45208A48E096A0383CE12E867971DC0F3597F6AB69197A28CC78F5E335129F7C313B705A37F68EBEE8186B1B07866A3C9761C57F5B67721485E6B375595508D0FFDFF863C712017F0FBE3FDDB4C74A93359F06372367CF6BD8DA88A43EC5447D40964F8D26701323CA23131468FA9B13EC829BBDE07CD5E02ABF44F20BE722FC618FE0D0F8B2DBAE5B06A3836783F88F89E7AFC2121D03E2E16FBFCD1D6B318F9DB2BE85297CE7F7E5C19CF5F4A432B7F41424562A7097459411E5296BF8A986A9B80B296AA8CC35ADD83981C1F8E097DBD6FEAAB4D02ED183E1268C73839D58B9D7BC80A2F99CEFC0B5656AC88152A72F126F0898128E4560883D9BF040824ED0B606BD36D4FA01F1A16803E81CDC3CB989B4229634761358FBFFDE0D335989BFB8EFD116CC5FB8DF7A348560E45989F075E696783ADE5B8AE9619B940EBD236DA3FCA90F5C227BE7F419D508E3BFA78DBA320DA32E1EED3F928DFB302830A37436EA9814920C166ED0CECD38C45422F3DEE89F3454955FD759B844CA057FA3C8900731EA6172D47B031833FC220F2C23BFE6FA0778F103C39B2B1A6C9A5A26AACDBB20F0F5DFA2B77C5B0D573A27A029234E331CEF0038675A24057E667E1DCB23FA39BF1827DDA49EAB1F8413B0B63FB0674C8A4A3AF3B097447846C9F93403BC6C9F95EA66A58F28EF2D29E96AB0760C9DE0FABB1D4F9FBFC3F5F2150FA4018780B449173210ABDEDA66A6BB414E832910E3F7B4EC119652C220294D0B5082D1388C4080BF641BFAE5ECD328D535614000018B149444154E27E78F7650C2FDF6627C3922B56EA1FC329457FCC1FC9E27E3D1DA6969653C105BADB95CDF66B0EA846F28D37AB58863BFB7A63DA80C650C1D66E7CEC5219D2776F40FC956FA0B294DBE29055A3B0D96B167A87EA704F9C1F3F65A66514071768DFA721170B3035FF0B44571E811066B0B8EAF55EF36089BA1D4F8DE96A7FE47707B3E0F9EB12C41912F9CF7224A1D8A09B831C59379B4097778E8B83B96E8A2F9F43EDD70F43696974D7ADD13D8C43AA044C1BE08F293719C94102EDD8579404DA314E37DECB6C84B5221B564306ACA61AA09E09F76198D3BE81B5AE79B6DB8D3FA4F3AE64BE65E657E6E54CE53AB0D03996B2CD6A3D4374737EC79602CD36F58AC5BE2817B15864C1751B4F15224F9CF31D8DA8F8040CEEEEC5A331583BB8682E7AD59EB44F3A57128CF5BAB9B828EB85A5F745D8FDA88E50399651C2053A2A7FBBBDFB6A2E44C3E1AD9261D6205F0C096F5FF02F1454E3D09EBDB8E5EC07D09A8AF849E1A714B158A97F027EDE6ADC3FD81F5AA5A855815EE5FB34A2BAE8A02E3A8D11E73FE469DBEC2F824BB21ED81FFE38C60E1F80C86B7F59FCB8760D62CE7DC1639FD9EA394935063B3577422E93624CE9460C2EDD71C32E0E1631323652875A9305E72FE5A14FD60674496FF4F15F968563ADEE21E44842F0F74961E8EEDBDCB7EF08EBA67D48A01D234602ED18A7CEEBC5E2A98D06580D9760C93F064BD62E5872F6DB4F37E9BC07397727A1771F08BB8E85387236A0F4B3F997859DBB61E36CA2044FDCD04E87A8CF38CC880B828FDA369E33AF4F84BFC9B6A1C7DA39791FB0641626D45FCEE905A5B49D52AC2DB01CB958CC05BA6FE1CFF64F3EF57D1E698A6874F5566076BC1F7AF9B75FEC29D760C44F49BF21E1B7D7A0AFCBE5029B268FC6329F67E0A154F2CDB7602F699B023D2E360825A5E5884A7E13BDAA52F969E02C1264B7D714486F9983E9037CF90A3CFBCBC7A1CA39C237130BC57EDCCF9D270902D34AB6613AA0D8B9303BF617CC2ECD44B048120F99107E0A337415E98828DE037FE365EEAE6968EB74F370C86338EA0552AC7CB0F74D178A228176ECF79304DA314EFF815E565B46A2B90E96A2933067ED8535FF082C45A7612DCFFC0F3CAFC52DD90100BEFD210A1D0551F72910A8436C2BE4FF6079506705BA214E57DA7D08EE8BF747E0B588868BAF8D6D165EC7123E98406749BBE18B3911372DD05FEBE723C5231E11FE4ACC19128010DDF5A9DB4D695E2EAEC59EA443B8E5D45BD0D5E7F31574B2C72D60A22653D8043A54276B53A06FEF1F0C9D4288EC7D9B303A7BD9B5CD4F014E7A0CC2B1FE2FE39E41BEA8349AA15AF3006425369FF0554908DEF37F0D66910C7E0A2B4614AE775AA0D98B84F9CB994B8635E6E967BE6D96D8C35E020D8D25F92CD7CFC709C54048C5222C9F1771D3DF4F1268C71092403BC6E9BFDACB929D0473DE11A0240D968254582AB23AE5F942EF4808BC7A40DCE76108030677CA3D9DB9494B812E11EBF1A3E74C1CF318C2DD1B2D4BF188AC661E151115AAC37D83FDECA15D4717DD8BF0DAB3F647174802C0B2E6CECB23F1F99CDE4E097472BA6D05DDA7A07105CDA222767A4E4254A00AF386FA77185296965B8594DD3F63C8C54FE0692AE1598B873D12B0D16B36E44A0FDC1FEFD7A1402774F7C4F25FCEE3FE944721BF56F8E8A4A23FD687FE19B3E2FC915F548ABE7B16C0BBC656092F4BDA15EFF8FF036291087E4A0B12F29D17E8B66CC75E306C0ECC05C53228F7AAC6E1B07A38CC120FF8AA25786B5AB833666FB52F09B4630849A01DE344BD3A81409B511CCA18EED36C88C16DF9A861DD3D798C7443C9CBED6F3D83B8AAA4C6151E8458A17F12BF29073ABD823E9D5DCE053A3C6B8BFD7E29CAC158E3FD07E8759EB82FDE0FD141ED47AC24A515A264CF2A0CCAFF9EC7263337C05AEF87705439147E1A195F41EB55E27657D07744EB702ABB02A1DFDC09519D2DDCEEA2AC37BED1FF1152AD2F220DBF6254EE2AEE7FB66D428EC446DD3C0CECA286B7CC0C6DCAD74EAFA0596A3AF3F3570B9B47CFE48B0371411E89C3AA04B0841DC63D4023C59CA1FEFCA5D51965B049A01DFB852281768C13F5EA04029D1507FDF5E20F31A96855B311FDDBEB1EEC538DC6C773FB3AB58266892B55DBDE85FE6C63981D8B8EF8C0FF555EE3994560C475B355836BADD59BADD872F40A3CF7BD87E8CA8360AB7EA350CE57B7F9E2009EE4C256D09E8AB63709998B8309342B075AFCDE4428ABF3F8A3988FF827ED349C500EC2F4929588AD3EC4EFCFE2AC3FF17D0E59CA081E8FAC1699519FF485D302CD7CFC3F6A67F2BA254D1BAB3362821816A188676E0678CA3073A02F58B6617B35B99DF98A90403B468B04DA314ED4AB1308749640BFFDAF5D9891B1101A73E3B164D9D2AED8EC390393A6DC81E890B605B5E534AAEBCC28D9BE14D263DF72DF2B6B4C0057E8E7E38A672C26F5F7E31989AD3596EE7D2EB71267F6ED40F485E57C839035B6C1F762D0A75CE00677D370F70C7B4E6B61762C8AA341A059ADEB759F2DC6C8ABABB86B87B919CEC9A2902E8F405CD53EF8D6DBEE9FAA1CC4135C82F52A5E08E972BE01757B9D17E8A6B538FC3552BE19DAB4DE365B392BA54244F87BA0A7BF1252AA07DD09BF05CEDD8204DA395ED4FB26087496406F3C9809E9C12F704B5963681C1BD679791476F57E112F4CEEDDE64AAFCA68464A463182F54A74F5B1B92E4EEFDE02D9FE8FA1ABB7657EB2CD33B6E1B8CEFB21C4F48FC1CCC18DD97C4DA75F60A8C5FE7D071172F22B84D5A4D937D65826E28BC19FF00DB53B63BC79F5B7B652BD5B0AF4A24DA770D7E917E057DF18A5D2F4994CB417F9BF89324530CF729C31D0173B4FE4DEB440B74CF5BE09333B7429ADA01DC244892A8E61A25E9D41A0B3043AB7AC16ABD76DC1AC9C0FA1B0366669B24DADCFFC5F44BFB8384C1A1074DD908FA697E0646631B417B6C210311953E242789D8CCD072F40BF67217AD69CB48B2CF323335FB479E8C3B863D8F5C58158AAF885F3E9C8FFE96344180E354B3B672E8355FAC7D14527E7197751811E0E0BF496947C54EEFD0A634B1A63909B4E8455EAFBD4F72F50AB5578747820BFF78EDFDC53A0338FE663D93BC770BE85A5C57231A6BE3416D33B0A363118B0F5BB935899D85856F5AD1563D0CDA3A3F0520B3233B3F0F1375578F0A9484436F983EDC4D73BF0C64FED1FF220556AF1E8BB4391A0EFF8B78A56D01D33A21E9D44A02D813EA78CC1A8DE5E3CD2A1B5D6C3578960AFC6CFEACD16FC78E02C5447BEC2A0F2DDCD2E2994F8E357DD9DC80A198750AD185DFCD4FC6CC122430DB4977F41CFC2DDD0D417E3C3AEEFA247908EFB70F34BAB91BBF73BC45D5D0B0F73E3692F2C4331D96F32F2226620CC4F8D10BD12ACF6467E791D2E6415C133F7286EBDB4D45E898E0DA45CA8C552BF1790270DC6A0AE1A5E729495F2747405CDAAC9BDBF26090BB25FE0FEE6966DA5F71338E63118C13A055E9FD48DDFDBDD04BAB622137F1F73085B4B8DC8BC508696E7F3088402F41BD70B1FAD1CD7AA08D657D7E3B34736E29B320D6E9DD20BD3FAAA80736731FBA533903C380EA75E0B6BF71BBFEBF5B57866A710C1B70FC2BAE7BA41CDEB4B55E3E7D7F7E0B92F2EE2C4D5B6AB5AF67E7C0C563DE08F6ED13A783B90F74502DD49E243B7E998404B8166E15C6C43CD2C10F3129E2C9BB0B596E47337EAFB4EC1A47EBE50CB6D31BBC67A334E5FCAC7956DCB30BCF8876697311F729D5006E632158984B058ACBC3CA8D86CE42B5D9685F7B7A025B04A143C957B528C378A0C5558BB331513CFBDC12BC33534B6923689E4FC3E7C83CC6A85D90A98CC16882CF5CD4E47F9513B0BC714F13048BD111BCAC439080AA92DFBD1518166BFDABB4EE5A3F097551857B4A6D9BCD88A9E654C560A35E8E1ABC0AB93BAF1CFDD45A073362562F8B399C0E0FED8BC24026D2D40CB3727A2D76397A18E0EC193AF24E01F931BF6102AB072E646BC711C48393C03D55621942A295432216032A1C4500293C40BBE9AD657D0A3466D42E433133162D3A778F9B81E9B0FDD839E0A9B7D4F9CB022506F84556C81E16432E21EBE82E7BF9C8A075A943A97A8E4F052767CE66483E149A03BD615EAD149049C4D546978ECBFB5B3B0DF6B02660F0D44420FADDDBFCCDC0CE947F7C2B8F34304D465F38DB58E1AF32FB3C35E5F095A0CAB588A89D1DEFC54159B881AF1C996542CB8381F42ABE5BAB3FEDABA377BD1B01AD41FFB3C8FABD250BEB1F6CEF4EED02A6DA53B9D1168D6979D5FF8EEAA1D987FF535FBC625FBF932FD029C50C64220102236448567C7DA4ABCFEFE05DA8AEC1FF662FC82B3F826F501845D48C6B0B864844FEE8EEFBF9F709D592CC63AFCF4EA5ADCB94E8A67FE391A1FCCD0C354978337E276E0ADB42ACCDF361FEF8CECE89BD2F8B9C564C191CF7E42D9E4788C0E16E2ADC1FFC206930F528EDF7BFD4D2C16AC7EE4337C103E09475F6C2C74E5F8D39AF72481BE5172749DD304CA6BCC28FB6832A435C54E5DBB597B37F669C66174A4370F7B6B7ABAF4E18BC5D8FEEB694415EC44644D2ABC4D05FCF8A7968DC5FC321165A16F7BD5E378CC345B8D4FE9E783F17D74F6EE39A57558F7CDB74830FC0CBDB980C735B7753E215BA99789BD705A1E8B7DEA512812FB412814A2979F122F4FE8D26C082C9C6F7DE2714C3DF322AF1BCD5E14279503F0ADCFE3B8E35A985D43040573A3ACDD710C61BF7DCAE7C41ACBF8FBC8EF65644AC3E12113E381A10118126E737E269ECC43D5DE151850B40D4A4B252FB67444351CDF6BEF6D76E415CB78947E3E11B25ADBA9312C4D7C83D71C9C9347E17F7A93D05C84AF9F388CF484A17879A60A079EFF166397D461FAFD43F1DDF23EAD88A419A95B93307041019E7D7B34DE9EEA8577EFDA8A85BFE461E43B7761E3230E387FF95D2DA82A29C3D6A5C9F83C558EA5EF0F4278F96F18187304C27E3D91727C7C8B675B50FADD76043F7A05DFA5FD111303AE7D6CB6C02410F08585B3E7A293403B2515D4F96609ECDEF26F54A6A7C068B2F0F3FD1C692715B1C890F7C29D7DF598D6DF87BB431A1A5B451F4C372035B304A82A45B7F4F5F0AACBBBEEDE9542159255C3F87D2C4229BAFA78204C2FE7279E34F56FB3FB7E989805182BE0517C0E3E85C7E063CCBE6E98EC7C42162F7D54958052B11E569104DD7C943CD36E5A7F5F7BDD90860B0D3526FC7CFC0A7A64AC4775561AEA8552B04CC1E3EA04DCD5DF0FE3A3BDED616C2C1EFA6C8E01670F24C23F63339F0BCBBADCAE998272890E51412A3C3D2A180A89ED4FE5333906649F3A0ED5A5DD4059362A042AFE0262E7298EE9E3C7E3B0596363C8FC6131AA2F9FE46E1F1666B75B339E8F7F780F2D2F0CA5B956B0DF11BBDC4C1FA7A2380C065CAC9221D0478E334947F0D7F18791332E120BFE36140F0EBEBE6893D564C2DE553BF0F02639DEFDC740C48A4BF1D81B69A88C08C7B697D80BCE011783C984D2A222ECDD968D9F4F8A30677E6F0C0913E3C86B6B11FF4619864D4A40D2C6986B08EA9092528CFC82526C7D7937569C1360C3868695BD18BD033CA0EEA9825A2E4647DB8F2D999240DFCCB78CAEBD2102EB930B70B1A006D5751DBB241A1EE02113F1F303D999846DB8AAB9006D3856809CB23AF004943A33F76BB3F70013248D5CCC8FD50AD6CA30A99F1E7A55DBBF2E6C157BEA6A150E6794E37C7E0DAFE7CC0AE637D4A66E78B7B07BB0534FFC3D259810AD6FE6D6680D0EDB045CB8F5326AEA6D1B80BE6A29A6F6F741DF60765A4BF3F55546610D561FC9479EA1CEFE6C768C1713D286BA244D9F919C59819D674A70B9C476282D2B1AC542F1D8BF86C69EBFEA601E77E7B0D86C9140C0398C89D421AE9BBA5959D71B32AE83173925D04DEE19ABFB0CE7BC7DF1F5F6A998D146C679EDD56CBCFEC42F502E988CA7038AF1C6B349C8888BC3070B2210AC6A5F9C57AC3803639D19A8ADC585D3B9C8D20461648F86DDBC1AEC5B7C04EB2F8BF0E8EA795832C9F672284DCFC2276FFD8AF7D6E4A3B44A8D898F7641A3734389BBEFEE8191236FEC8003126807BF50D4ADF30830F1CB35D4A1B6DE71816685FB59324553F7466B232AAF35A1A0BC9E0B50598D893F83EDEDB14367BD144CA09998B28D21C72ADE95569B905E5083C2CA3AB0ACC1B26A5B0815BB1FBB878F5A8A102F19BC55920EC7D630DEA399155C1C1B049AA5B9B7362FC689CD23AFDCF66CF67208F751B4591B84ADBCAF14D772816652CF04BA9B5ECEC7D6B4B128942CF602339AF93D994077F196F339FDB7DA0D09B4211F5E5DB761ECA2F1F8F2317FB49E8E54839DAF6EC1A2CD22AC39743B2EAC3C84057F3D813F7C31110F4C0E477B8113977F4945DFC9FB515E757DF44C532E72B516EFFE3A174F44D97E5A9C568C038B93307F7536AC4313B06F5B3F3456F1BE39A224D037C78FAEFE1F26C0048B7DC18542F095A1B3FEBFD6A656516BE22B72994808D97F51D0FE8731DFD0D09C17E85A1C782F11E376E890B271287AB45A1EA51A89FFDC83173ECE44FFE7A660C9340196FC3511AFAC2CC1EAEF2762CAE4F68A3C95E1C0A622641973F1E97DA938DBB52B9E59D4B399D0161F48C5735FE643A80CC7A6EC0918DBA40AED63776DC18AD47A7CB4711C1EEDDF7E795A678091403B438BFA120122D029049C13E85A1CF8F4573CF7561A5EFBE17E8CEED7CA010AC55998F77436C63D158A6E56118223FD21CFBC84BF3FB9054B932C58F6FD44CC991CDEC2075C8375EBCE23C5A0C5FCFB03A03119316DFA16F49C702B1E1CA142AF18359A9691DAF2CC7798F9691E4483E2717CFF6074BF462273572AE6BE9F8B898F0FC01FC7FB40DD8929F124D09DF275A39B100122E00C016704BAE4502A1E7AEA30361FD7A3A86812B4DAA62E9B726CFEFB212CFC3C03FF5C3309838707E25A68322A2F6661D19FB7E3CD1FABE1A9EB820FF68EC6EC28158475F5D8F5F6F798F79901C366F5C2CBAF0E45A44A8C948F3662E4F1EEC8FE32069EADE44CAD9EB71A0FAF2E8464E4309CDA3E00216CC2E585F8ECF9BD7875BF0ACB360DC7841E4A34388AAA2F5FC5C7EBD3A18B8FC1C3C31CAF0FD3942309B433DF2AEA4B048840A7107058A0AD65F8EED9BD78FEA34C5CEE1B8D82DD09D0AAD8FE81199BB79CC6CC59FB20888FC486C5F19814D3BC6C2A5087D4F5C9F8D39F92B13BC7DA2CB2472291A2CFA8287CB86A3886EB01EBB163E83FF32866AE7F002FC4B69ED1BAE681D578E8DB424015802F5367E0BE50C0907A16CF3E9B84157B6A9A1C710088C44208BBFAE1C94523F1DE7447C3FAAE474B02DD295F37BA09112002CE107058A07372B070E111ACDCD5582FA3E1393D8786E295F76F439C57FB4F4EFFE9285E7AF70C52726CFDD46A298E25DFD3ECA2D3AB77E3A98FAE60F1CE7B10A5697D2B3177F31E4C78F90A4CFDC2B0F0E918DC3940CD725A7174E551BCB6341DE70DB65BCA3CA458B8F51E4C6A888376064C8BBE24D037018F2E250244E0C60830815EBD3A150B9E3DC66FF0D557233165720F4824CE460ADFD8F35DE52A126857B1148D9308FC8E08D4D6D6E2C08173F8FE87743EAB39B363111B1B4C024D2BE8DFD1B79CA642045C9480D168446E6E2ECACA6C872E04070743ABD5422C6EAC5FE2A253EBD461D30ABA5371D2CD880011708480D96C465555159850B3A652A92097CB21682B4DD4919BFE0EFB9040FF0E8D4A532202AE40C062B180FD634D24129138B76234126857F826D318890011704B0224D06E69769A34112002AE408004DA15AC4463240244C02D099040BBA5D969D2448008B80201126857B0128D91081001B7244002ED9666A749130122E00A0448A05DC14A3446224004DC920009B45B9A9D264D0488802B10208176052BD118890011704B0224D06E69769A34112002AE40E07F5EA05D01228D9108100122E02A04042515750DA7D2BBCA98699C4480081001B7204002ED1666A649120122E08A0448A05DD16A3466224004DC820009B45B989926490488802B1220817645ABD198890011700B0224D06E61669A24112002AE488004DA15AD4663260244C02D089040BB85996992448008B82201126857B41A8D99081001B7204002ED1666A649120122E08A0448A05DD16A3466224004DC820009B45B989926490488802B1220817645ABD198890011700B0224D06E61669A24112002AE488004DA15AD4663260244C02D089040BB85996992448008B82201126857B41A8D99081001B7204002ED1666A649120122E08A0448A05DD16A3466224004DC820009B45B989926490488802B1220817645ABD198890011700B0224D06E61669A24112002AE488004DA15AD4663260244C02D0808DC6296344922400488800B1220817641A3D190890011700F0224D0EE61679A251120022E488004DA058D4643260244C03D089040BB879D6996448008B82001126817341A0D99081001F7204002ED1E76A659120122E0820448A05DD0683464224004DC830009B47BD89966490488800B1220817641A3D190890011700F0224D0EE61679A251120022E488004DA058D4643260244C03D089040BB879D6996448008B82001126817341A0D99081001F7204002ED1E76A659120122E0820448A05DD0683464224004DC830009B47BD89966490488800B1220817641A3D190890011700F0224D0EE61679A251120022E488004DA058D4643260244C03D089040BB879D6996448008B82001126817341A0D99081001F7204002ED1E76A659120122E0820448A05DD0683464224004DC830009B47BD89966490488800B1220817641A3D190890011700F0224D0EE61679A251120022E488004DA058D4643260244C03D08FC1F8024C458BED69FBE0000000049454E44AE426082, 'Default', 'ueb_key', 'ueb_secret', 'ECOMP-PORTAL-OUTBOX', 1), + (3, 'DMaaP Bus Ctrl', 'images/cache/portal944583064_80711.png', NULL, NULL, 'http://portal.api.simpledemo.openecomp.org:8989/ECOMPDBCAPP/dbc#/dmaap', NULL, 'http://portal.api.simpledemo.openecomp.org:8989/ECOMPDBCAPP/api', '', '', NULL, 'okYTaDrhzibcbGVq5mjkVQ==', 'N', 'Y', 0x89504E470D0A1A0A0000000D49484452000001680000012C0806000000EE2C29AF0000200049444154785EECBD09985D577525BCEEF8A69A354BA5C91A6DCB039EC0536C636C631308B6434248483A2140C3FF058281907446487F49FA4F87A4D3FDFD9D4E826D861092302401023433D880C1C8181B5BB6065BF358D39BEFFC7F6B9F73DF7B552E59922D4B25F994292455BDF7EEBDFB9EBBCE3E6BAFBD8E05F3652260226022602230272360CDC9B3322765226022602260220003D06610980898089808CCD10818809EA337C69C96898089808980016833064C044C044C04E668040C40CFD11B634ECB44C044C044C000B4190326022602260273340206A0E7E88D31A76522602260226000DA8C01130113011381391A0103D073F4C698D332113011301130006DC6808980898089C01C8D8001E8397A63CC6999089808980818803663C044C044C044608E46C000F41CBD31E6B44C044C044C040C409B3160226022602230472360007A8EDE18735A26022602260206A0CD1830113011301198A31130003D476F8C392D13011301130103D0660C980898089808CCD10818809EA337C69C96898089808980016833064C044C044C04E668040C40CFD11B634ECB44C044C044C000B4190326022602260273340206A0E7E88D31A76522602260226000DA8C01130113011381391A0103D073F4C698D332113011301130006DC6808980898089C01C8D8001E8397A63CC6999089808980858E3D53033613011301130113011987B1130003DF7EE8939231301130113018980016833104C044C044C04E668040C40CFD11B634ECB44C044C044C000B4190326022602260273340206A0E7E88D31A76522602260226000DA8C01130113011381391A0103D073F4C698D332113011301130006DC6808980898089C01C8D8001E8397A63CC6999089808980818803663C044C044C044608E46C000F41CBD31E6B44C044C044C040C409B31602260226022304723F08203F46C7679C69D698E8E06735A26022602732A022F304067C8019A7F2A60B6D0FDE99C8A853919130113011381E71981939B7E9E5280E695139C0D403FCF3160DE6E22602230472370460134F3E5677E9DDC4B98A3F7C99C968980898089C0F38CC00B9C413FCFB3336F371130113011781147E03400B4C99F5FC4E3CD5CBA89C0191281B9B11BE0A90768B96E03D267C82835A76922F0E28C40F6620268CB40F28B73949BAB361138F322309772C8E79541675906DBB6C13FF32FFEDDB28E35FB1CEBF767DE4D35676C226022F0E28980C23E0B699A8A74F89890F71C43F39C019A20CC9323400B6991A60A98F9DD03D8DDF3228813980D383FC77B65DE662260223047229027A7291352A21AF15070EFE4D2B7CF19A009CC6AF650279703B482DFD94E32FF9901E93932C6CC69980898083CC708CC640ABA007D7221FA3903742FA5E108CDA1C05A65CF33698E6E0F61061B982304FC73BC37E66D260226026773048E73919F53B94C543BB42E935536E3CDCA229C78D09E3340E733084FCE751C3921C7B68497C9B2A487C8D099B32C054C17E189DF22F30E13011381531D81E3C9217B315051BE19923483653B278DCA7DCE009D531B499208403373F63C1BBEEFC02615DD7B8A5D238E531D67733C130113011381138A400ECEC76293C9F0B204C76499A5B7284C104429D2EC2865B8133A0BF5E2E705D0E4A109D0CC9C799604E742C151E07CACAB7B0E276BDE62226022707A22D05B413A3D67700A8F7A9CB260B2BA560F4087618C56104368DC932486785E006D59E49E359D91A528F80E8A454F21BF01E85338A2CCA14C049E430472AE75B667558B81B324933431D5A065F39FCFE15067EC5B9E858FCE33E73C7C4118A31D241AA04FCE153F0F80EEDE5DC52CA7F03D1BC5A2AFE60E03D027E70E994F3111782122D0C9123358B311AEF210A7C8122AB42CC4AE7AA4DD0C7072CAB217BC7215ED0B71AEA7FB336705697DC11AE738810561827610E3644E612711A013F89E8352D157E134007DBA879539BE89C0B34740837467B56BA54A61C56F0BA2EBB5997A25C0F65D357CEB5B4FC1B3AAB8FEBA8D58B162FE741C32008D3639E8203969F4C6F3E4A06766D006A00D1E98089CB91160A52B013292AAB60268E682291005C0273FB305EFBEEB6E78CE5EFCEFBF79076E7DD54B857F7D517C1D67066D00FA45311ACC459A089C8E08B0E225902C009DB31EC4A6A0017CFC1F9EC45BFFF3DD70DD27F00F1F7F0F7EE6B557C116AEE345F06500FA457093CD259A08CCE90810A0BB3C05AB4A5112C3B71DD4AB363EF6D16D78E73B3F02CFDF820FDDFD9BB8F3CE2BE1BA5A4F3BA7AFEB249C9C01E8931044F31126022602271681692A0E0DCE92455389C0D2BF238A8D46CDC2DDF73C89BBDEFD2178DE93B8F79EF7E08EDB09D08A0A39EBBF0C409FF5B7D85CA089C0DC8A80566948355F78678D42CCA22DA5E54D325B8A84CD3A70CFBD5B71D7BB49713C897BEE7E37EEBCE365F00C4077C4105471180E7A6E0D7173362602676E04048FA938A072C3EBAAAEA4CB2C45AA6D1958371480FEF056BCEBDDF7C275B7E1DE7B7E1377DEF15203D05C3EF4C8EC0C409FB98F8339731381B915810E40338376956423F767B032C11D31D2D4007DF7BDDB70D7BB3F0AD7DB8A7BEF7907EEBCE30A03D006A0E7D6983667632270D644A0C3AB66E8B409F618E864560AC2B4953A68D40101E8BB3EA601FA370C40CB146632E8B3E6793017622230E722908334B3E719FB6964C24393E870D0A839B8FB1E02F4873540BFD3501C06A0E7DC7036276422707645E059009A4D2B29E8B363A3517771CF3D5BF1AEBBEE81EB6E371CB48C0293419F5D0F83B91A1381B91481993E1ABDD60C9AEA105A3A059A0D521C4FE25D77B148F814EEBD8719B4E1A00DC5713206F4CC81C8CF9CA96B9CE91B724C97AF9E133BAA13D8719CBCF12B398E209997BC6011E81DE733FD44739F8E146808406FC55DEFFA305C77871409EFB8D300B401E8933132F38196AF4A3440B3049263B5B879E91DBB84F7A70181640F3D6603F9609EE1153B9B739FF8CD74DCA2D41B7BEA2FDDAB3AD6C43033ABE98DC7D1DE7B3262663EE3C517817C5C53069D5F3DFF9202F50E407F04BE501C0AA04DA38A29123EFF07A5374BC84158EBF215885AA0C7ADD615A949D1A63E942223EE14334B1BD16CA0DF7BA63337363F5A47EC510198D2270DEBCFF29AEEAFB89998F93211781E1110699D1AD8D3C65206D49BC0DDF7308336003D3DBB3200FD3C469C7EEB6C00ADD35995E9EAECB607082931525F2A83561FF12CFBD870BF9B4ED94067E34703D65990F49973403E63A813158B84DE25A89CB75A03B0CECE6E2F395343993CFFF1F262FD0403D047BFF3B3663FA64878521E15B66012CA98633253EEF183E95048741DE8CD94050FF3CED769389F03772F62E6103E03F56705E83C3D79E61D9F9E30339BD1340B7AB6109BF1990AA0D5346232E893325C5EBC1F6200DA00F4E918FD046865FD2284C5F4ADB87AC5FAB24DBACA983B389883F43332D3DE1FE899545EAB53F2D932D9A321287F3E2D7BCFF96B82347FA101BAF7DC6739BC41E8D331BACEA2631A8036007D5A86F36C95EAFC447A0A7F5D0AA3BBA384805E0E8633FF9CF6DE9954B5B079BDE4883A62CEA7F40442B2F74E43BF2E4AF65414E5B03DEFE3D662E06E95C2CF9023D78779B198A79F9641F42238A8016803D0A76D981F8D9BEDCDA0E5E47AA41C9D9454BFA817A07BB3E1FCD7D35E96B766CD4E3E3CF3EDFAB8548D08E06AD09617EAACBE538F8865FF47290BA60EC0F7188EE3B40DADB3E6C006A00D409FB6C19C92FBD5FBAC698585CD7F0A0E927F4E15C889F3226D1601DBD2EA8EFCA4A7D3D45DD257A7B82A135629B7F0D739A0F7EECBAEEB8C9220CFCCECE5DF7C41A277B6D04A0E8B4636163247ED72A14A83096C4DDB58B48A7C71EDB37CDA86D1597D6003D006A04FDB004F12C07604E01201CF0C96453B72FE40FF2E2FCAF6EC766C67D4476876A2979EE8D54277EA7E1A7DE5DF1652991432D836996F9D2113956542C80B8AFAC3B5939824D016B363FD9DC480ED2900B608D04270E8A980AFE1B148A7E814FA682B85D3167873E033260206A00D409FB6C19A723B1F05652A0B4D75064A84B3655B79514348164DE08B90890F81D6174B01517FCBDFF979EA2782C33D19B1A21E7AF80E7E28DF231FAE05D8B2DB66AEB156993D3F8B1BB6F3AD6A2F8B0C8EECB24CB73166F80AA87B0B98EAEF8AEF96E31A803E6D43EC8C3FB0016803D0A76D1093C22010E774040763162393ACD4159015BD4496C1C92220AB73A31F006D206901D571A05D45D69E421AD491864D200D110401DAED362CC743A1D807CF2F20B31CA4B60DBF50865BA8005E1F5019012AF300AB04A000D845C02A00962B3B5708F4E7A9BAC66462B84C2942C5CCE8B0C90329C8DC63E46B00FAB40DB133FEC006A00D409F96412CAC020159F1CA206D8010B05AB2A7BC300E710A381EAC34861555911DDA8660F26934AA7B91B42790548FC00927E1C555B8710D56D4808308691C218E520179DB2DC3760B486D17B16D21737D646E1989D38FC81B028A0B51E85B8CF2F05294E62D833DB40828F6037085BA500D29CCAA3D642801B6FAB9602EA912D21E92FECF507A18803E2DC3EAAC3BA8016803D0A76550EBC21A59026E428CA80D641340BC1BD8FB30A243DB3171700F82564B40B0E0A448DB63B0E226AC24441A07401AC1CE22B8762C7F220BE5B52C3492A5CE32F5ADB6ABB7913233E72B2C0789E522818BD422781761792540BE8BB0DC22D2CC82653928F50DA330FF1C14575F0A6B681D8061C01D4442B0D7E4862D74C77480569488AE599A0CFAB40CB1B3E2A006A00D404B047AD50B470B49AF0EAD177404A97A7F7014DE550A815CFA335B8E81B4AD8E9486405A45F6F40FB07FF3BFC39A7C02C5E820BCAC0D57680FD5C1975A91D00B76EA0AF7613B547628B2599A4744FEA18F912A0ED8B655CBB5AA07AAA29D6A35D1AA8E8E1C4FFD4581BA3E4DF2197611756F2192FE7330B0EC62F4ADBD12F6A2F3152DE27852E414DE3AF5D516451A959F15A07BDB263BAA92D3DC127E3CF7FFD910AF776C280AFED85F33DF33F31DC7F319C73ACAD1C6ECB1DE37577E6F00DA00B43C4F3D98DAC5DA1E7320E913E9A28992C2A52A73E4DFDD148945E02520BA82BF165359FDC5CFB7F8C3AC2D3446D21E03A27158D1389ABB1FC5F8E6AFC26AEC411913F0E23A7C514DF0184AC6C663733709E17F7B1A41667F86BB3FED9CC14C638D4EBD70C6C4D239E3FC9D36E2CC43621511642504CE30D0BF1CA337BC06D9BC95C8EC7ED8CE206C6701807EA14084A04E2380123CBD3373F73C1292EABADCA8741E59AA447A9DA222FF762CF03AD9007234803E1E90D43D44F94B652DD1DB7DDF594A746BBA795DF6597381E339F6B1E2A0E766398593F179C73ADEC9FEBD016803D0128199B686F2C02692512ACD84CE30F583ACC05375CE4952CC8164A748B30C2E414AB473F9DBF88200C014D0DA87B8BE133BBFF6AF482777C34BA650B46AF0D30914D0829B05025A2981596926D40D22A7CB0940B77E9F4AFCE219C85C647948DD0A6AB18BC41B42CBAAA0810A06566EC2D20B6F80DBBF0A767939E0F621B3A8EEA03A45D32C147C508942CB5499011D0DDEBCB80056368EE6F8380A7DCBE01406A4787AEABE7ACD50665BFDE4DAEFEE34D299AAF58F72675899AB7B015A8FAD69D7D2A99F763D5066C34E35C63A53BCFECB31EEBC9C4F3791983DF13875917DDE4732006D00BA9BE6F6C4C2165241F3ACB62E84692097A439A713723959DE6D4730CB6039394F9088E2226B1D4430FE1360FB37D1D8FE6DD8E118B2AC0D87BC711AC263C69C92C2B084FF4DA98F2688698DB214E3F4A6F3A736BDE475A6FA9A4A22F293B927CEE0383E52F808AD12027F3E4ACB2E817DCE75185C7B155267212C3D51259603CBB2E0662C7E5243CD78325E9C84B8C7DC38D243DFC4130F3E881557FC22FA176E00B2C2F37EB68FFF0308949C4D7334CD5B206599D4930EF35F4EE72EF0D5AECE94D52A47BD5ADEDDEBE3DD638522BFCB3F56E8A91EC0EDC9B4F3A9409D53AE32E79812E796EEA9CEC4EF6983B92B959C0EF6C71F99D3FE4A03D006A02502BD990A9FA069CD17CA5A33A74E856ED04A5FE184C9118BC698853536DD25B01C66CC75209D02EABBD1DCFA3D4C3EF60DF88DDD280587E1644D647608C7EEB1EDE4136EB380A7926FF5C0B37390C748456E278FEB29CE2E65621000721126096CD791461A97D79B9282F111DA65D49D2154DD455870C92D18597E2930B802700690BA83C8AC226C293CF21A7875D47993AE9904C2A750FFFE87B07BEB4E8CDEFCDBE85F713960558E8FC73D6908A234E4BDC8A7A29D0F0CE54B9CCB0F7328E73C2C8D961AA0F39FF7D209BDD9758EC11DAFEFDEF3EF4D8EA725CA1D4497496DE66A4E8E792CFA829F77ACD79CB4589EC40F32006D007ADA73481A81A35D6465DD6425CF8C54B4940F9DD64AA8AE10AD9AB0A8A6B00264F1218C6DF9362216FC5A3B91EEFF09503F80421AC04F294D8B6039A15022E49485ABA5D2821F6F5BC2672BCE9B1A68B202161C7D9C4474D227F12138C6470935C1B2A69E38E0BA40C2A61AC04E980D3BC81C179165A3C53FDD2194E7AD4336BC014EDF6AF4ADBA0CF6BC35B0EC41C9402D66AB19635447BCFF87686DFF1A9C5DDFC4A1BA8385B77D0095555703565F4FE5F6D45DEBB484B427C6BDD8D69B8D76EAB29A91E990203D137E9E5977890735729E1530A7A7D0CF1E8019E779C666CBB35DA5016803D0D3005AEF5A022A253440B3CD593D2F04234DC84A2AA4A466D23EAD335D2BAB02D97EA4DBBE825DDFF957F8ADFD28A635B8590B8E15089D2180E75888D214B6EDC1E6B2995617B2DC6531901A66161CD5234D70667BB7C36C95D383CDD79CAA744875205A7A52484953C8FA9DEDE236B244FF8E3F77D8E7482EBE8438251D5241EA0DC35DB41EFDEBAF4761D54DC84A4B915A2E9CE829C43BBF8EB107FE0DCED8E3E84BC631E62D47E5A63FC0E0FA1B61D903B3EF1A732AB0BA17496745D119E0DA933DAB21931797A79FEC342FEF5E7278DACBF4C10565BB14459E434B5A30DBADD7207DCC533F15F13B99C730006D00BA3702043E79C03A0E6ECA87429E957C1D9BBBD1DBB949502ADA642BAB01B52771E447FF8664E737E0D576A39434859A1052449CF96358568C38CB90D81EB2D451D9B15EF28BF04300506D6FD599185295A9AA8EEDDCB8E8643E0947FB2C9E90CAF08592B032B84E8A3089E0BA1E126DF84468D6848C00BACD4E48A1631C847605F5E26A8CFCD4DBD1B7FA2A64CE20D0D88CC94FFE1E507D0A45AB05378A70D85F87CA2BFE00031B6E84650D9EDA0C3ACF4273243C4A36376D5995BF663680E6EF7A4178B615CF4CA09DF99A1EEE3A3F2D59B53CDBDCDC33779CB239FC851C8606A00D40E799F2B44C7A46583259E653B5A1A46F2C7425B9A366CA16EBDDC0D3DFC4BE07FE05D6C43694AD06ECB801C7621309690C458928DF8D0CA9954A262C3BAA10D0C8CF8A62449E6C9D49EBBFC943A7B7B992C2BF9E445EC80763E6676BBEA7D7275A65845D973C16FEAC8CCC34AF547269C49685B6E520F686D1761663D1DA97C1BFEC95C8767C13F56FDF2DADEBB69DC28D1C8C391B51B8FA7D18B9E856580EBB194F1D8F935909B83AB059D0E4FDCD9516D379095D33A41245194CB101A8F3D503F2B2189219AAA31FEC288504B7757D5084403A59EEBD5C594BE97B2D1277491C74443829F2F8DACB453E41CE83594477049D155487016803D0B302744FF6220542795182340A61BBF4ACA05A2384954C20AB6EC391CD9F446BC7D7B1C03E82A4761805CF13884AF453AA1263D5D4A1BC3698056B5D730ED03D4F7A9E31A9A49DB482CAD6659F3F520EA7109CF326184B8A949C48B407AA0083523F1098A55125531CB38550F1F4B687C0B6116516BCCC453B2D23282C821B1EC2A03D86C48AE4FD4EE22A80BEFCBD9877C9AB607903A710A0D584C92FC6378D09D4AA26907F4D93ABE5E8C97B4BCB554BBB0BF6D20C1DDB5835DFD29C50B4CFACAFEAE49A574EAC8DD30C419C2152A1006BB0451FF02C0BBE65490D829A1E5BCE510371AA29303D5108DD26DE5B8E80F7340AFB54B1612FC49834006D007A3A40ABD19C6A7E59B241A15C1545A1141419ECB8892C3D8C78CF37D1DAFCCF681FFC090A691D4E5045C9F3C0E7872C89EC3D486F0D293C4ABE2C5405C18E822DA56BEE7601AAA3AB5C290746D90750405AA563562AFA8917E27178C6671264A5455C1A6762C9F2D9C9A8247F9C6494BB1ED28200B4A28358280D65A591662E225239B051E015A740683BF06C764486D25199F7361E71D7C17BC93BB0F0F23B60B9F34E194033E6715E90950950CB3272BF6E0D78B91BABAC1BD258AD690888BD227A4D4CD1BF9B0D38BCBF9295734CD9409C01ED38463505C6C30C631301C626AB68870912BA17A629D22842D1B1B160A084C54315CCEFF33054F250F294B1161BA0946115A938AD8D1705109B84BA1B29E423E98C546FE423D100B401E8E9115060A948841E791D8B60DA4DDF628B767A08D1E11FE2F017FF174AD54750008D8A52F172A6B73D1DE104D709CECC7DA701B4A233486BA8AAA3025FC5542B70EE921D399DC1F352C5CA53BD558998A04ABD8A60CCD310A78FEE794B46E97535BAA2846131944D2A8E34B810C8AC28814D4F113746222A105FF854123F29228C796B605FF0562CBEF21760B98B4E99E1BF02689DBDCAED577CBA46437102E44F98B35202D9CB7E4C2BCAE981A422A3575D3DB6AFCD30432388B073DF118CB73354231B610A440927727AA3D848924C56694E1AC34DDB70E326868A36562F9D8F954BE661B0E2C361566D012EA933A92E13A8F9A7034BEC5F7B6893E391E09D92A9FE391EC400B401E867464067B4BD5A36495DF8D03681E62E4C3EF52DE0F003881FFB3A2AD938ACB8A5B857DBA5020D19B31979ACA5B543EFDCAD3868796167C711A5C8C8015A9D8B02E8BC2899738F926BCB80EDF1DD788EE3FE44DED6E532D5EA81D9B3809018307155A1EA61C2A1938316CE34113B52667919A90FD2383CA81323B002B8CC4A59204D5D59C20311C6DD554837FE3216FFD4AFC0F6969F528016193B270B1642396B6489A87312DB968CBF9559A847C04423C064B38D208CD10E4284698234A16C92D799AF8854799740CA9F0FF4F5A1BFD28F7A2BC364BD8D6ABB8924F590D945191D71D6FDE6AE3919C1360D91854DD8491B6E1AA060A79837D887A5831EE6155DAC5DB54C3A1609D2769AA86C5A3C6095FA28E7B5CF781EDA00B4016819D0B9FD4387FCCD531F6D564FB049ABC0D413987AF4B398FAC9575068EF43D969C2CA9AD225472546FE70B038269CA33499A8ADA0246396F2995A16E740A700BAD39BA8B2546647B274EE948614EDA197E2DAF0F34470F639BFB6AB06D00528C9E4D5B5E4C54BA53C513C6EA74BD04A64E2B133576822CA0B332745ECA4328959F014BF2AEE4C09C6DDD588D6BE1ECB5EFE26D8FEE829036875CFF2766E6E8B004496B86EE3709861E744887DB536F64F85D87B680A93B5967452369A2DA4490024216CAE08E82942CA8193561AC3B76D0C94CA58BB622516CDA75789A2CE12C792F7334E046432219CCA733E3A8E7906AC77B0059E5C59842C8984FA70DA531846885B6FBC124BE7F7C317BF704E109C0CBBBCF9340EFA39DFF939F04603D0672340AB7428DFA2C9F76C945875E9A416B3E4CCBD00DDDDBF496D30220F6F0356B21B47BE7D2FE2273E8B5278187ECAA57980D48EE1C2861D936F54C971C44671D9AD84459E443F447C6CB85CF61599215AE7196A2CBD66CE01580172FE2FD5C9964AEEA47642C9F7E9EE74973D2B73DB951928D3A5BC7D9C795CCE29F76A7873AA255FC8EB4944D335BC16163E5587A02201329BA55172A59ED26BD3FE34B5243EA480A894605C62ED33E2F06F59022BB530E1AE467BF59D18BDE9CDB00BCF17A0BB3E17B3DEF79E829E2A31B0E9DC1260E6B6083B6B199E3ADCC09387A7B0F5400D1341866662210862C47102DF76602531CA4E083763ABBE0D8F3FD3296B1886A8F83E36AC5E8DE14A1F5C5D4864744299EC596064076A8684BCB34C52ECFFE1E4A5C64510D082369398250933F50485A889426B0A0B060BB8FAF2F370CE9211194DA214E2BD3FA55DA6A700C00D409F4D009D679BB30074417173C7FD959073565E11B6D50092034269ECF9F2DFA134F5044A6953BC8B2C8F52B24896EA36B959ADBA5045279527BB6C48D10F1099576A83D51234910C0A0EB943E5E1616B92931C6326046D2696A25C6E13EFA3AC88A6330F89554606178968A35D291009DBAD8B8E4A12A85048C805FA7BF020722E293C8BD344282DE78EF0E74DB8EC80A42F88EB08172ABA6BC9F6734A859F19C31121AE8730027CB720120525AB535C3A8FD3ED76E4125CCB083B7C28BD46B43F751AC1E3694619AADE0AD4466FC5CADB7E037661B52A78CDA640385A7DB4F35A619575BBBECAF43B9D7B323494B6869C2DB96766CA4DFDBDA7057CF7F1713C79A889B15A1B8D30469AD2342B112AA1E83AA03EA7E23898D75F44190468FA8BB8C81C6E86E0238829D9B3B164E12294FC827480B2FD5F326864886442223833E32620D3A384F73895EF24890594E398C756935A9C2448E2146E1CC36B47B0E2492C1C7271E3951760D5E261B00CCB38AAF96146DC7ACC938E7BFCCF95171A803EBB00BA5B64EB66D005CF46F15800ADD78404383E10AE54E12358DCE1A4FA040EFFF0D3686CFF3AFA92FD285B7564ED260A968B88B69A8A5C150E56D1155DB749D5A6AD321C45517099AB335136AB10D11D1B51C425B10B97D926FD38D294FBAB20B63D447601895D826517D1B6FA515C721EE68F6E0046CF010AFD5ADE464AC556D4B6EA37D492380550CA984873C862BF17C26A4E00879E427C703BEA479E4250DB0F2B9A829DB4507448D91078D5E7C97F5C09C844C2B8B8B02C1F49C49F11FE94EE595D5F978051748D9EAAF466B779029EB2A59DC5309BAB8F145567192617DF80735E7317ECE2063D39F48CCFE359B78BA42D8623BB20705E52AB0E9963F4B9A45984C4F10494A752E0915DE3F8D6A34FE14800349C7E4C063642A70CC4212A9E8D65237D5836AF8CE1A28BB85187D56E226DD711D426618581806F68B9A84529A6DA3156AF3F17FD43F3D546E8A2BA21C02B8E5AC056AB3B7A417926400B48E7809D52E191228E62B9AD5990C28AAB72AF8A59153F75C946BCFCA5170BDDC1A9685A838C0ABD1E13479BD9E60A1ACF721E06A0CF4680EE367330933C1E80561A524AA10834AA31C44DEB40633B6A9B3F81E6639F45393E82349A82E593B2C8E046365CCB17F73966C32A7B541924E14D3D9E0AA0723F0BF51A252DA32DA92C67655DCCADAD288D56196C041B4D7B0075771E9AFE62F8F33662F1BA6B503CE722B5F38945837C1E830A097EEB4D60B52A443E2CAF14754823A34A00002000494441540C76045DB57529FFE4D3CE825404246D60F7E3683DFD100EEFF83ECAC95EB8D17EB8D9146C4765D4F9C4213ECF510436A977B6C6B2B9A1AD526A2B65C6F40E0CCDA8AB8C9EBCABDE252B11D0E72AC3C6A4B30463235763FD9DBF05A74080D6EDF69D21AA41771689A192EA89E3B6520A2BD18B845634197A2F45D5956FE14806EC6CA4F8F613753CFCF42134781BFCA2B4DFAB55428A918285754B4670CEC221787184A455C7E491436855A710050DB45B0D356946C0543B443306D69C7B0106E72D948C3A0C22386A69A4B2654EC8D4C6F70034A98B2E38278ACA2020CB9F9ADAD07F32A34E32F51D350305C8ED715CBE7E295E77C3A5A870A2A4ECAFB76C9163F3F14C6E7311A70D409F4D00DD49173407CD657AA600BA786C8A83851DF12BCE698170175ADB3E8FE6773E0ABFB10D1EDAB09D0C4116C0B11C78340A4AF5AED6C277D0E08820C5DC93DB4929EF0C5520E4B9A8A61372D6F29564F044CD4063530FA9D38FD0EE47569E8F963708ABB200834B37A0B2FC2260643DE02E533B9908F2901C2740EB4D67F543D9159E742996CE1DCE5DD7743E2590A63BD059C8445C079209C01E477AE0511C78F04B40382600EE8475B8CD03F0E21A3C87A01E8B4A416D6CCBFF245DEC00346D3855469D173FBBCA6D9EAA283FA4614F193139998D296B090EF45F8AF35FFFFB708AE709859343B2BA86670768A5D456F176D8CCC3AC35C99079B6AC46486554C304E35182CD3B436C7EFA30F63412A45E057EC67B91C2B5228CF417B06CE11046478AF0E3103EB3E4760B41A38EEAC4189AF52AC23840AD514323F4106605645E01A3E7ACC5BC45CB443647EA4AC4889AC650197417A0E59E3FE39BC0AC326702740ED2FC37C159BEB30861DA869D7A089B21BCA481D10117AFB97C032E5CBB021E8DACF2ACA043C36BAA6B36BA682E8272EF3919803600ADD15267974CB90291D3B59FFA1282FBFE37ECEA76B8686AEF62554194CC883CADF836E71A61F2BB0A48C8C14AC55EA456DD6786FF909FB17828E91D0B74ECB02B2028AF80B3F61518D9F40A60E1B9CA6A543220368114D59F9221E9274DD2C219BB8F74B2A71E43E2691967AEF1EED2BB9DB768EA0369A00A98B2CF21B3EB16DABB7F84E0C9FF80BDFF21F8B53D645211725A21FF2E9ECED2EBA63364D5F2AD56156A45D26956EFA17A72450A97E40AA017637FF1029CFFC60FC0295D304B067D0C349109422942B4D845365C08E1A09602DBAA6DDCBF7D1C8F1C6AA299FA88A8C3F61CD85180E515072B160C6264A0889297210DDB2830D4DC80B7D94250AFA3363181A98931C99C5B610B8D76805AE423B68BD8B8E922CC5FBC14F4BE166E5BA4774A8D436A430099F48BCEA067036882F36C00ADC05A017442450752B49A811868A59477B626704EC5C2CFDDF6726C58BD54267DAE02A857975DE33911CA84914F71731D957BCECF00F4D906D039B1A039E82C83EF39C7C8A03567AB3A4C806C12E9C1EFE3F057FF0EE5F187E1A753C8AC1009795B52C65A4541FD2A3341A5A72050254A4A27692C018BBFD7EE15F26395B14A6EA5413B421991BF10F6C24D70462F4765D3ADB02B2B905A7D52F093CF147C533C724F2239FB8D13B4ED95A1A8E3C997B2CCD3AA909CA3CD815A0149D7F321DFCD9B801701E924D0DA0AECDD8CFACE1F626AEBF750B227514CAAA2D3251DA18A83AA4583D23AD51A9E332DF9FD501398E2E155D62DAF4F5DD4ED8538E06FC4B96FFC6338A58B157573025F39F74F7A85B234B66B532DD2B06C6CDE5DC5D7B68C61673343D5ED83EBBB8883162A568CD1A10AD62F1E41BFC78922824B6960C2E27086248AD0AA4DA13E3181E6D4041AF51AEAF5061A61846A33402D2D6074CDB958BB7E232CD783E5F88822EECE4E0E878D248ABB57C53EAD8CD759B5CAA009BEDDE2A00269FDFABC6098243A838E90B291254911052D51E1844980A455433998C26DD75C865BAFBD14FD255FC68D32FC6241560D49F1EA3A8178CE89971A803E1B013A17A6292999E73B4A6677D4259ECABA74AF1890EDC2C47F7C00D1530FA01237E05A6DA47680CC2650A5F0AD02A2C446E47AA206201FED2080C36ABE5AB08376A5F9034130A2E42C11FA84CD19E4AD59FCF3D17016C15B7515E65F72079C91F3017708197CB123555CB820AB6A191657B9E969D0331EB89C83EEBC5715C9146EE77B70E99CB9E3C2A6E470041225B753D7A03C3734B79D514247C73E1AECEFC6E1CDFF84D2D35F8535FE14DC24E07A4056068970F8F4B026E8F233D849A84861DE0B7545AA755C7546F23FF2D60E1AF6021C70CEC1B96F783F9CC19702C2B2F65CEF3196E83C4E7E07782DCC1E9B29B0752AC2971F3D80C7C752A4853E0429150F6D94AC00A38365AC9C3F8CBE4251541AECE7938E50097E82286C636AEC201A136308EA554C4D55516F05A80529269A31FA17ADC0F997BC14954A9FD2348B5C8E8A8C043629A03896C613293E8B2CD312EF0D9541F7F2CD8AD2C8E574426B90EED03F4B34C52100CD5A61D814FD753B69234B0264B5299CBB74086FFBF95761F18221E934940C9AA7D303D07302744FE4240C409FAD00AD818D70E711A0D98ADCBD56B1CEEC6CEA9AF3A401AC7412E18EFF8B235FFE13F487FB4452A5409080422693E53FF28E0E6287452C668B7CA099E912E454E62CFF135055F447CA6FC716BE32B246E02DBA00FEC6EB101796C19DB70EA5E1756AD3554AF0C85713CC25FB16C19C9C3A416F6606DD29D0E7B9EA333C26150FDEC539DDC23C13F934F0CBB17596DD2D32EA394218951A90EC44F6C4A7D1FAFE8781E67E20A3319227C4322565A2E6934A200F42AA470134818F71A775A9D20BB3034E4D06DC68B769CDC7416B146B7FEEF7E12CB84E01742F85D30BD07A37734D7C0B00B2155F3AF16C20CC80C7F7D7F0E3BD63D8DDF6B0AF69A145AF9038440131CE5D310FFD568281B20FDFE504C68953A9CCA95156F4448276B38EC3FB77A139358E767D0A13D5266A4186F11630BA6E134657AF41B16F405903C8B5D168C9124A423A0285DE5059324F59D2006935CD74A63C2363268DA10B854269F480B4E2A129CBCB10B75AB0921461DC449AB491341B986735F09F6FBF11975F7E894837D93823345ADE88752A77793811107EB6D71A803E3B015A0192CA41A55145CBEC3AC0DC0348F25A51A05581C947B0EB0B7F8D81F1FB51880E4AE3093BDEF8D45B16F93FF2AA4AA5C15C4BD91FE5D92153521A067109CFA2A15249F8D2EE0C04968FC05B8823F152ACFB85DF86337011526F3E6015245B55196B3E19680E99B481A6283A4BD45ECFDFFCF60978E539F7CC32FE33BDEF95A97C1E040DDFD391BCBB1E569540E5078D23009EC4DE8FFD1E066B0FC1B2EAB26088536E28E0A0142B37B5406F3860D19655B26416E054F79C4C626902CFA1F704419A2B0E076D7B1E26EC6558F1EAF7C05E799BC445CD74EACA3A9351079C55D553E2ADFB6BF8BAB60D4C45093EF4E52DD81B17D02EF423755C64611B834E826503059CB77C21DCB0AD54376AFA53F7B2A75DDB4A63D4AB9338B467A70074D06AE2E0440D536D602C7471EB1DBF00BF5810DA41BD8D9FC3BFA8EC98F79ED749D0168066C76096211280D67AE71EA506B3E5344E10A7CC9C35E72C0D2ABA489824889248BCB8B33045166588C226D234441206F06BFBF1AB375F8E57DE76335CDF97E628A51E5269829A0CCFB02F03D0672F40AB6EC2E900AD1A3EF4409D66CA1B00D11E1CF9CA0781BDDF84DDDA858A9DC04B15F8D030472C428537D5AE7262AFA90C8F5834132C490BEAA85CEA13D0C50F9A805D42CD1A46A3B801A32F7B130A1BAF079C61002C002A7DB4CABA89B3DA6AA7F781CA112A3FF59EDB364DE970942C69263B30ED519D09CCD3F09AD7263D768A22899F061EF85B8C3FFC39149383706C0208F95A163D3D20A1743041E6725359075194C0725D55BC4BB802B1613905A17FD2842DCD196CC7459ADA6865FDA83A4BB0E2D677C15EFB3380555419B89E6A45712236AF54DBE8758D00B3DE2A8C506441A6906F6C6DE15B4F1C40AB3482982E84610BFD768473E60F63F95005054AD2282FA4424582AE2D54B5ADAB902F5184FAC4380EEDDE8976BD86B0D5C6DEC3E3186FC608BD0A7EFAE77F491CE8724C577B2CE67A6766D02CB4767966590DA519A2589931E57C732FE7CC5892CE20C04751D4A13CD8BDC89F87A902E8B81D216A3309005A418856146324ABE15DAFBB1ED75C7E210A2E4BCF6A25C0FA809853D105EF4C036903D0671F40E7579467D0B90E7A3A28E96C538A392D203A88F4F1CFA3FED04781EAE3706CEA7C2D58F44C703C36BA69B241596CAAC256BEC37286943A6059D61354F82044B028A7731CB49232EAD62264F33661F1D56F80B7F85AC01D51CB77DDF5451A40AC142481D6C637D3B2639D42CE02D06A22EA92186A4D3BFDBE3E2B40F7BEB42748EA3DCC042781740288C651BFEF13489FF82CBCF83090D1208AA0E8206386488EDC2EA95DBF858FB7C53C8A5ED0A43CC47D4DFEED0950B9E4D92DBAB931C60569C2A93B0BB0E1A6B7C239E716A138B85251CD268A1957B9A0267D64A71A4E9E5212130F8D5696E1EB5B6AF8CAE37B600D2E423DB150705354AC10ABE6F561E9701F8A968D30A4D6D9869B50E3A1E8240165A16D554349D26EA13E3E8EC37BF7A255ABA35E6FE150B58E23F5006B2EBC04EB2E7C896A001290566DDB3204845BA6B24565CF1D5D332762D213D4E1599970CC39EF9C73D2F4E150009D220A591454BC742EB38B62A5E208DA2DD9173208695F6A63A29D60A410E1BDBFFC4A5C7FFE529411CB8A456D08E0698BD2332C7B9621AD544779A351E70A32A0DE04EEBE672BEE7AD747E0BBDB71EF3DEFC01D775E01D7CD1FA433F07A4FE494675D10F5AE8A959C9556B64190D79F4EE400CF32378C57C9223E972F9D8DE686A1A2E2A01707B7975219980230BD8B33FF4CA7D078E823081FFA07A0B603252F84E3F0018AC4D48700449652A96C991977951AB9B7736A87B2C34A9A9554130A68A204046919557F23FAAFFE4F18DC740B602D901DABB943B670B31A5AA7D317DD94B6DBA5AB97CF72F24ADAD71BA0A32D5E3B973B23941D5E5D06FF51DE2DCF45002BD98FB11F7D16ADCD9F44A1F1344A560B192D57A56B92948E0FDB294BE193AA09CBF35457A3F83FDB886D1796E74BEC13FA43A30CB8BEB42F73024B6D0FC5BE6158A5F9683BF365D795CAE8C5BA094665D0FA7F9AE650574F8584A86444AD013CBCBB8A2F3E3E8629141038BE38CD153C0BC5B885754B87B1B0BFA4A805E9EC14676ED1E3080D91D346BAC3254B42A4ED266A478E60FFEE3D68B72354EB219EDA7F04CBCFBD009B2EBD024DAEC6C4C14FEF4B49AA23CFA0A53098B76A2B9095FA21576491AA49E4ADDC3920138C05A035703F13A069984413A5047148FB810851E063F7C11AC6620783C30578D1417CEA83EFC4C6E1B2325A620584CE7934A5D2AACCE7F2549DB6F718803EBB32E88E9DA74E23BB8D2ADA0653C059EB8D844A20408F63EABE3F87F5E38FC2CBEAAA934C6B56B98335B39BDE729DC233B53D8692D531834E54771C8AAA38680588AC0A027F05DC95B761E0E2D7C159B001995396E53DBBC92C3E3179EE9B9F526FD54F3FFC0A43094A79C192D48A56041EE3C9E9426FCE91CC32EF4DB355ED514DF0CD94D805FB70E4E12F21DE751FFC644A356194FB90CA6E220EDC621F0AA5419198F10C3DCF47A15082459F0EC6A958068A25CD22B84061082811A4A919D64B0712D9761F326B0089DD0796F23845C7B95FB2EEC453264FC47F5B3270A2BE48D2017CF6811D7868B20014FB55A1350950B062C99C17F6F9F277593049BFBADA39C5938944C544F973B016C04E931069AB8EDAF8111CD8BB1FF5066D42338CB7135C7ACDCB511A1892F34B82B66ED8514D31FCA88E7C8EF23A91D8256A32D23C3EDBE3C97C8BBF86786C900E51CD29711C76336666D09D269548017A18C38A13448D3A9C38C1FEA727F1F48E4368142A98BF61350A032E7EFD960BF0F6575D8C924B550A0FEAABF547778398D386B7277C6003D0671740AB544BEF46222B24D5EA5D2AEAB661DD3C20B898D0E42602EA4FA37AFF5F207DE253F0ADB6E253E57962A349BE696CC7825D1E6555D4533B65C8A258B249B5DB09F3E7C876D128AC4069DD4D18DC7407EC914D922932B354BA664D3A6B9FD31C23158CEA057DAF9C596F162BEF620761A76AA6EFDFD152E52EF44CE7489E71DB67C9C7E5471910D581F61120AE2929225D9BFA48D1F8AA65CE21B5A1D522A2B7D57BFA0928A8AB513A5C9A2951A5A2DB91F96F899D9A33D938D2880B988A528C35DB6827199AED14CD204518293F0A16DE1861CF7385E3F64B3E0A250F61023CB4E3300E444524992D8A0CDA492D1C2861C97009252786CD061CDE3B1AF0F3BC09C6726CF2B3CAFA9359BF147DE3A803D0FBF7ED43B51560B29DA27FC128D69E77115AA12A6E7255A574CE3C355578558E74A44978CE0AA409BE02DE492AFE250468FE4EB86566D73A6B16E586FE591C11AC75076144808E8030048236EC20C1CEC77660FF9683085A365A8502BC65CBD07FEE7AACECABE2BD6FBC1637BE74BDA23A124A4C2DB5F9CB99F66500FAEC0168055EEA7A483708E865094AAE8332551C1A08C4A35952A90859631BC2C7FF1DEDC73F0DA7FA186C02760278D4EF8A617BDEE7415736C57F6636F945BE5FD9D3A8ED87B89C6499DE45EC528DB0080357BD1E036B6E00FAD72143BF02F05C0FACBDA13B528999D94D2F8791F3CEFAE2D406B427F2355B1570B6F7CFF23A390FAD48910C534F2E5257EB7A65E43C7167D73CFD511DEA40B1C5F2FF8A2822770A8C37534CB4DAA80711EA498A7AECA01924A8D69AA2178E98558A8195FA40B567201B8654E7A250277E41DA84EA5122523AB6D5FB59826543152CA89450B46378F20A55B49329D0223FAE762AE767F3F372476B72B7884269EF669170EFFE83E2B5B177AA81F35E72052A43F3C5B950E879D09150359AF0B3A416AACD8D848B26A5A2BD35E458046F66C259AC3868CAE6E87E473A4DC09BCDA58AEA88A216D294B406F9E850FCA1FDA889F54BE6E3A273D761F7D66DB01BC0C39B77E2735F7B04F5D2009CA5CBB0E2822558B6C4C2AFBE62136EB9781DE6F7F5AB0ED7CEB0510D4BBD1B11E73943FE32196A9DD55C8F6CE84486DDC978AD01E8B30BA0C5FC5DB630620795E26D4B8E8DB24F4D6DEE3247EE90D4460DD1539F47E35B7F0DA7B61DAED594FD03F990D167433268D987508D555738C7440A82C27D6645B55B88B8DF05E24F915965D4DD95682FB80EA3B7BF13F09621B32A5A8CA7B4D14ADE966BFB4EC6287EA13FA3DB60D23D522F27AECA770AA4BBEA3D29ECE41BC8682F0ADA8C52CB514D323CF2F4240ED4528CB56334094E044C87BBAA2670A5CF4439F41148D53E7C6A75C1B98CB50126ACAC7DB0F184F01BB148C7AC3809D1E700EB4617A090C6287277172A3F3A3BC1E4E2C8AED39E9058228FA4D733999D00563B446D620A7B0F1EC658B385A78E8CE3922BAF45B1320027B6B8390C6266C262D0AFC05781B0A235C4FB7A165F0DA5DA20208788F919CCA8D350289738A2993F2991086154571B13536C1204889B556C5C328C5F7CD50D58B962094A051B4E087CE4EECFE30FFEE8E3A8FB03A8FB452CBCFA62388BCA38DF3D8C77FCCC95B8E9CA8B95ED94A5AD037807C427862B31ED91A2315826D8DC5D56F8784EA5EA75A7E5CB00F4D904D0F9FE7D1C6DAA838D1D6B64372483CECD8264B95D43D6D82ACD16AD9F7C1AA56452DA63D9EDC77149DB4F617D05A0D520A601101F729A1DE5A6F41CE4E4406D69D6A096771093C5F3B1EC557F087FC145805311FF67793E7A77D2EADD20E0B48CFC1339683EA1CC94784CEF4C9CF60C73CDDFB3A22138D07BB99E59D8351963C7441D4F8DB5D0B298DB3A0266D2C96767F0D21443A59228401CD783EDBAB073933689A12ABEF1ACA8106947295A51865610A015B444EF3CBA60040B07FB80A80DBF67E76BDE4B7A72F7A4936A514035867422C6F0C96DC7944784A88E4FE1E0D838F64D4CE150AB8D8B2EBD0285F200EC28831BF3F88980B49C8F06E49C83EEFA3B4F373ECABB05993DC7B1A53B065B48289F8BB4835D96A0D99C9242A01BA670A3109B562FC39017E3966B2FC1A285F3C4A6B53995E27FFCC52771EF3D5F40E411A00B8816CFC7E22B2EC062F7206EBA703E7EF7D7EE00B545BC6C493BA4A354196D75A832ED3D20E45A673EA67494FF507D00A7E5CB00F4D903D04A55A0F8617A3BC8AED27602DFCF502EB89D5D991287C3731FC2035FC381CFFE15FADA4FA19C717B215A812AC99A98AC8BB1514E95E84D5EC9996AC92CB9569A2289153BABF3EE1026BD1518BDF537E08FDE8C2CEB974D3CE97B2C8C80168E086D92BB1DCF52B33B2D0FC2F11C7466834CCFB9CB5F357ECB6E21BAD53A4B954639722C1C69015B0E4C62C7911AAA998D96E3CB7E7C7C1B770529BB0EFA0B1ECA9EA3409500429588C08A52DEB02B93DA6B2A2F24AA424D10E01D84D4092701A27613F306FA256BA49786437F6DBD3BB9F885E48D1B72CD6A4563DB4A8A96C8E7F38D21AC304173AA8E436313D8B1EF00B272192BD7AE83EB152575F778FF09CE9241E7ADDBBD7FCE9E410BCF1C31DB66B66C29E546DA44CC7397AC5AF1D5ED7A9D2A7978ED187B1E7F042FBFF202BCEC92F310348EE086EBAF41A958C0D62D07F047BFF7213C70FF562476054D9A4E153D94369C8335E78DE092F386F1276F7A3516FAB21ED42DEC1DDEAE07A0BB9DAB6AF732D61694CE5A6C5F4D067D3C4FC8A97DCDAC8B9AE9EA81B925B3930D4C1540BB897AB069DEE31752940B6C7D55084380B4DA8F60F7BFBC0B95C61614E31A9C980231D5A22CCB682968758B7FB214948612E55227593697ED2C38D1541F7DC8862F40FFCDEF8333781EE0960047AB18F24C45A79409682EC4E66255BC3963BE34404FE329F5C9772E837E1E2CBE12F71C1F6DCBC2444860AE61EBA129342D0F895744100528780EFA7D0F7DBE8F025B93A9AC106C4A618BE1BEE2A4724648CAB6DC468B9CB880B592DAF15894428ADE388B90913760C75E4880E104C17140A95F0199E3E94941CD2EB2ED9760345F47B0D5F04DDA8A001A44D87FE808B6ECD881A56BD660C1926570D8E21FC4B099ED5A2962ADD450D4461794C55EF428BECEA26F26F71CDAC249C76913611AA09D06427544CD0885D04663DF182677ED445C3B82B0B917FFF503BF8D438776E20DBFF073A29176EC0ABE73DF63F8EF7FFA8FD8B2652F2CA784AA6361C2C9E06F588275172DC7CF5EB8106FBBFD3A2CE8E32EEA927EF42E203A456E65FC6AC1CDD92B69D9572F7D8683C0A91AB426833EFB326866CE8EA829C829A6F07D0DD04C87F9EDC5485BDFC7BE0FBF09FDC12ED9928AF6A19218CB8054995ABE43887E947526A7DABC99D3796CC98585C02EA26A2DC4F0756F4665DD1B80E212D5F0407F0EF16DEE493D4999080B4B3E904BC73309A0BB56A5D31E5A591E2860556B053664D8A85BC0D35311B6EC9DC4FE5A1B6DAF84586FF755B433CC2BFBE877394D29891A657B290B8F2E77AA2167ACC121D7B4EB1D5B04A8C55590801E2365F306DBA0E31841A45CECC23082ED789219F3339D4219499E49EBC2AE80BCAE0970F295C4512668D62752B854EAA4C0814347B06DE74E8CAE5D834A7FBFF0DC0EF57F94C1C986005DD3A3DC7CBFD7885F796A68F0CE9B4E12A5D0C8424B541D511A20CA144053BFE78636FC6A8AEACE83985FF4307E6007C626B7E38FDEFF5BD8BB77077EF6CE3BA4D186D778F8401B7FFA817FC4E73FFB2D64998FD04D11F816AAC37D187EC93ADCB061006FBBFD6A5C7BEE72F8E269A01DEE7245BD241AA24D924853622ADA6EBD7ACC37403855983CED3806A0CF2E80E6C3AB96C3EC40E358EC72D0926D092151473A793F0EFEC3DB30924D88B97BEEABA6D67CF9EB7495ABA34850FCA5926231C38A85BE68B90338E2ADC3C21BDF8E8155B721B5D9C2AD80578A6439A797D3007AE0778AE4A765E43F8783EAD27ECE6C4CCFAA74042563A50733B0BB95E0FEAD53A8C754C3B848D9FA1D72835560A4EC639054865883B22248DEC94328F74217080588D564294E783A951630156F8B54AC3D09CC54531033B9BB0925796459FAFA06E07A05F9DC8CEDE47A0305353E142F259A67B9E5DACF8319BAB603154A8A389C246885119C62516E2BE56FA22CA61C0EA94C26BDBB9FCC34E27F0640472A6366B7652A00CDA6A850BEA3B80DA79DC269A4187F722FCE5DB20A453BC18F7F7C3FAEBAEE025C75F525A8D5C7F08A1B6F52E148811FFF6817FEFC4FFF050F6DDE2619341020B2DB38581EC0E09A95D878D152BCE6AAB578D3CD17637EBF7208D48B4978F970CF27D6DCD13607E89E1D6A9EC38879FE6F31007DF600749E7109BCE6FECBD0323BDF577EC75903480FA0FAE047116DFE102AE1B898FC509A9B48C55A2B2D34179DB7EBF1B30567452AA7CC7E644B59AB84767905A255AFC4D065AF47716803D954690C2048C8C6DE3DBD31DDA2CCF31FBBA7FE13A6B7A0773C8BE4A274D1CE72508F80DD9375EC0B2D6C39D842C64E42E9647350F25C913D166CBAF3B11D996A189D7B931FA679BFC8DF72D11B3F5739054AB6CB0C34646307E903FA2167D231586BB560FB25D152731E2E17CBA8F4F549B62B3ECC1A70F29849238BEA1CD1FE272AF7CFF964C9D23B26482C67D802D422AC4B2278CC3AA348B6C8123BD91E0FE767283774D62CC04D2FE730449205A2D41015479C22A3C6396AC30A1A5850E883556D61FBC34F60A850E626849837AF84D7DCF10AA4590B2B572EC1A245A3C2617FE5CB9BF1CF9FF8261E7D7837EA0DD5D9E9D01E172D8C9587E02F5D8C9597ADC3DA251EDE7CF3265C7DE16A547CBA74A87949B2658E539D3C8867B988C3F3E6283606E54FD6A91F71A6D5FB59627EA671D0525692CD518198050EFD50975C172502B46C1D380E547F80EDFFFCC7188E9F403969C04DC85126489409B0FC4FED79D2E5DEA4D2AFB373D7510529383EEAD902F8AB6EC0E0356F81357CA1DE2B50F37C8CAD4D80514B47393339846671CF14E39A7C20081D905702733A48659CD2426D39086C1B0F3F3D89270F37D0727D8474914BE8A16DA3BF584291BA65015F351976563CB9C5A9CED8D46B547B2527D6380AA4B1288D22B41B0DC9B8C338453B05261B019A7182F94B4651191C51923C9DE6F78E6115FAFC2E760EDF5D34C954A03864D597AD9A4F04B805E479AD6A876F8BF73FE516546AD7F58EA786DE9D5BBAFEC8331394C931476C6851AF0B09D07C6F1A4BB6CFDFD95108B75DC78A81322EDDB01E56A381FA54039EE3C0F132944A36962F5F84654B17C0E3CAA3D0875A23C187FEF64BF8D847BF8036C199F64872ED216C2B46CD2B201C1AC4824B3662D1C2025EBABC84BB7EE9155835D227D729B24869B8623D455BC3C88A25A7E4993237530000200049444154F43D1215D269A2E24C067D3665D06A171079A0682E4F4222030AAE2BBB7A0B2CA60791FDF8EFB1F7BEBF47C51943210905A0A99996DD40A462A40056ED23D83522526A2DC5D4D10F3AF007D1286EC2D025BF84FEF36E039CF95DB30F1614735FE4DC92340725D94B30E73B4E435672A28754167B9A4B9F0ED0EAE7CAEB985AE4C9D4C2577FB41B55B71F1157190E8BA1BC071ECA85A2F0C61431F3E7CA545FF30D799626332137A8D59D792CFC4521C2B0AD8A69712C6E706D1A0EB9054C3502545B21E62F5E8281E111508F27B452BECD586792D52E73F90EE5BAEF991BFE324354BBBF884D9280AA5A6D298F0D6538946B9D55E720270BBAD591569909D0D38CF773ABD028EA0168AA35F29DBA23017BA7D544296AE2A6CB3761EDD285F0B21853B586BCCE2F7998373288C1BEB238067A6E09855241C6DAF77FB01B1F78FF87B163EB0E1965E4F169F12A99BDEBA15DF0E06F18C5399B9663915FC7FFFB8ED7E2BC85C37AFF4C4E484C5C6C29784B0221064B5C2572F0E693E46934F130007DF600B44AB7F46C6F47C22F4A5799A7005A9EB4DA6338F2B9F7C0197F00AED382CD4AB8B41E8BC259795E085870594EC659779E71E92DAA020AB612B4DD3E348AA3E8BBE0F5289FF77AD8A565805D5400CDD360E6E52A7B259E91EA53D39BC58A7AE34451F234BE3E4F473557DB995B74A225006559D83FD9C6637B277020705073CAF02C0B05FA617B1E5CC78643B066D6461F12D591DF91B9F5520F32C1D2C2949F1BB4918601DAAD960027FD2F22CBC5C109EA9327B17AED460C0C8EA0582CCAD29C7B10E60B933CE79349562611658A24E6FE6A2B5FB523BB1C504DBC5D8056F23BA15FC40489C387D9B502662A3604A0A573B09B41F7AA38E8EDAC0C9062B10E55DB5EA532D9D0B45FDABFC30871AD8E42AB85013BC4C6D1415C7EF179E8EF2B8AC789E79764771D4AB399681C39D4C0673EF9653CBD7B37FA0687B1EDA903D8BEFD1032162CC30C49CC64A38858767DCF10DA29EA233ECEB96C1D962EF2F0FE5F7F2DAE5939049B9B4FD0C7DBF211CB76092C94EB6484CD579D2C7A86B3E2A91E8606A0CF32801638E4F052404AB99CEB3B2852071D57113EFE398C7FFB4F3098EE404A4B5056F4296CD67A22D98A490627CD46F919BA29050E1CA145954EB6E18DA03A7C21467FFA7761F55D0680C5196558CC0796598CF279E86D99A5324179789C515F1D8AA38716D03F63D868F33919028FEC3884DDD51051A11F2DDB452175D0EF7AF03D82A6DA528CADEE92718BC659EF48AE0BB3EA35AA68479E396E37908501E25653B4C194C8B5321BDBF71FC6D3FB0EE1252FBD124B162FA1A9A9F87350BDC10EC3EEEA44F1CA1D1B39CDBC2A9A4381B36A3852002DDECD427190C6D0E02CB446F75BA4746CCBEE48EBE8BD311DA0737B500174EDAB415A436480E2F31C22A1295214A0185B705B212A698A73572FC6FE5D8FE2FAEBAFC2C0403F2CF4617CBC219AF2458BE661C9D2F9F8C1F7B6E1777EEB8398986A28B329BB8D2BAE78097EE6B6DBF0E8C34FE2739FF91A9A918B90E3374B105A31EA15078BCF1FC5EA8B96E1976FBA1C6FBC6ABDD400B80B3D25A24AB9A10BA632867DB180E52A47FE79FA080E6337FA6C4071A671D0BD0FA65AE272091DC165618A2BC2780F0E7DE97FA2BCF7F3709A3BC44A423228D0BF41EDBD47599E6A2DE386A504E8509A51D84AE1A66C8049458B7B241D4175F13558FFBAF703CE6AB5C12997BE3633F1E99D8382F73A5B147E2F0791D344EB9DF0E43093C8ED49FF39E5B42DE0B1DDE37874CF14B2CA10023670D80EBCC4C248B9025B803712458602BF148EEB2B30D5E9AE2A02129C15B7DBAAB1981B89EF7126BB8C00CD2845EC95F09D871EC1E557FD14162E5D8C3826F34AACD1DA688BBB892B4811C15CBE52D19207D1EBE85953005A126595D52BE0569239D9895B7B80288F0D4B4B0109B2F4D2C8773E514D2A1DEB50D901A5EB52C7A2207F1F6AE3237E36C1DA8ADBB0A23646DC0A2EDB70212AB0519DD88B55AB87D0D75F116EF8FBDFD982BFFF3F1F439606F88D77BC09D75EFF527CE54B3FC4FFFCAB4F22CC58B40CE1D887F1BA3B5F8EF7BDE71DD8F293FDF8DDF77D107B0F4C21CE485DB4D08A5B98CA6C0CAE5F81B5D76EC2D5E7ADC0DB7FE64ACC1FCC131935DC45B1AF37449082381F03E93CEC6DFD3EE191F3FCDF6032E8B32983561C9A549DB9AB34B5CC7620CE67253F8235F15D1CF8FC075118FB11FC780CE5A28738619187D56C1218EC12A4B65901B4EC226287A2DD4D321F5ECADD08A5CD0C07B22548D6BF162B6F791B5267991C4F71D41CE5B2FB1E9C8EAB5B47D0AB82DDD1A93DFFF17BAA3E21673754E154CD30FC23B26DECAFC77870C7114C240E22BF282E73542570AFBFB2CF2E345568A34115C3435E575EA395144A67CBB459F1CD59D446AB3A21F7A5194692E5B5E20C416A61CFFEC358B3FE5C2C5DB118F5462AE6EC0A709950B24D59D311DAD65F58541D6F55A4E544A0C158868BDAE544680F39CFEE24221BBDF267DA46947FE6EE742CF0C5047202B0B60CA57DA8F2E3605193C6FBF9765789066805FE04681604FDB08D25434BD0E754F083FB1E40D09CC0B9E72FC1CD37BF129E5BC67FFDA3FF0F5BB7EC816DB770C185AB70E9E5EB91A4057CE52B9B3136D91693A6C1F2145E7FE7CBF173AFBB1DAD9683BFFCE0C7F0DDFB370B85E2F50558B0743EFCBED5F8EEB6BD587AEDE558B27804CB06CA28F57B1818AE60F5B2A558BEB00F4BFB520C7840C1027CDBC6BC725128AADC0EEB19B9C4A94A2E0C409F3D00AD17B4FA82F8D84B93313C9F00DD44F4E0DFA2F9D04761B7F7A0C81D50586892244EB7BE8A89BF6A6FA5E05F38632B446A2B8B4C522102BADC56A9782EFAAFF94D0C9C4F13FE41CD7D2B72451E745BEDBF67E5AD58EA57672438E72344605937F248469901A165E1D15D47F0C8FE36B2BE61DAFB8BA11437DB2D95184365E529A1A549BEB62555323A95408BA715B5CC6188A8DD4212B61036AB08C8DD5A2EAAA9879D8726B06BDF215C76D9653867E50A05BAB6E69045BEA3A41632CD6AB14C2E25EB7853698056748656690885C1B72A9960BE038A6A38C98D8F14C5A16472DAA18E4E74A4393A56A1CA8D2E4A08F85466D0FC48293958B053CA8D14569421E57655E30731E858D8B4FE023CF4FD8711B6623CF0BD6FE2F6D7DE88A9A909FCE63BEFC23BDFF9E7D8FAE441B85E804B5EB20A6FFCC59BB178F122F87E1FEEF9F03F61D5EA35D8B86610AB4787D0DF57466615315507BEF98D6F637C6C0C3FFBFA576374D5423CB9AD8EFFF267FF84C71B0DACDEB851F682CCDC1811DA4A66C76BA08D294294CB16968E94F0CA9FBA021B968F60F1401183250F059BF755797173159877D9AA86ABAE6A661A9A74E8BDE34C236652693240CC8E2A478DDE994671A8EC4E379D385A819166F07C0725BF8AFAD7FE18F6D67F461A1E91FDD95C72C1521C226E2A334C470A79FC0C820B75A5AA6D5830809EC1D2EDE6617CE82A2CBFE32F81BE35DA4CA6275ACFA0048E7380CEB997E9D4534BEBD4EEDC6A09A0A467161A4986C7F6D4B17D2C42E49741CB28169C2A2EE0B834AC52C150853AD501987FE5DB5831A36531306E3510B7EB88C3400A69641628A3DB399560CBEEC358B5762D2E3E7F03D885C813A00995BA6F79FFA29E03258B56FEDCF98A45CE387712CCB3658DDCC215F7FC4C191FE5FE1AB911128B85AA3828AE736977F76DD97B3066E18F593EF7FFA3BE39076882768688CD29627C64A175B086ED3FFE21E6557CDC76F32D78FCD12D48121BBB9EDE868D1B566068B082B7BDF5E770ED8DEF44940EC0B203CC1B4AF1ABAFBF1E575E71BEEC37687B152920169C108EC5EDBB94D7387C07E54A49CE9F5D94AD26F0997FFB01FEEA6F3E8389D44269703E2CB788C469A150CCE0152BF08A7D702A7DB0FB4A887DAE744214AD08EB978E60D3AAF9B876D3326C5AB50815CF8193A424049171C721A1006D691F971DE7734096C953E7479D31738CC1DDEBF3D25B4037007D3665D0325CE4614BC5715FB5EB12A00BCE3826BFF85FE06DFF17E92424D8DAA44174F59E52A3AE5B31470B1B90992910C095FF1935B08953441303289EFFF3E8BBFE7D80B3A0EB0A36E70076FA094D1BF72772AEF91BD96527C0CCDD63B8751570A016E1919D554C242E22C797860E5A085508228CA9AE942AB9620EA53D5527D11AC7885A0D84F52AD280A641B1C8CB1AE49CDD129EDC378EC42DE3E24B2E46A55492FDD469C8AF0A8EAAD0C72EC11C8C73F5456722D0E0DB59C468F095A9262F06CE00E5FCE7AA65BBEBAF212A0E7A38E73CB3502009B258991C45CCC6B91515FF4DAA83323B6E36C06C9A7ECE69113FFCC68F31B6E7495C7ADE6AFCF4CDD7224B5AD8BA6D1F6CC746A1E0E1A76FBB1A412BC6DBDFF9D7A836D9E0C30D7BC770DB8D9BF02B6F7835FA0A162CB72220ED58DC1D9DEB0647F4D15E516D6EECB9B469F5B1775F15FFEDBFFF23BEFCB50791794544A98728A52F490C2B6D21CD5C387E1976B10267A80C542CF1BB9EB770093C2B40C16D63ED8A215C73F979B870ED4AAC5954C210179132017025A2B2E78E765A5BCE3E27897F8EF106A08FEFE93CF332680234E98854009AD90E3963DF735070C730F185DF86B7E333B0E972AE377D557B016A8F0971C3A3B2C3829D70776E3EF8BADD5878CB1889378C09ACC0E86B7E0B18BD19B007CF0C809E6674946BBBF538E8484D9E8D58E453A32821E1581D1FD538C523BB26B063AC059407C5369444BC27895C77E9AB3AF67416AD7D3444734CD0D63AE776BD8AA05113D5068F520B63B4ED3276EC1B033C0F175E74310606063B1D70D4EDB21351DD3B4E09CCA6959E3907D7DE512E3C759E316B80CE5F9767CBBD59F3F40C5AA93A4485412A464BE4C4609F3A68F2D01133EA48B2644E3874A86BB3159DB2CC3046D26AA2E25B38BCB786EF7DEB7138D1112C1D7670CBF59763C1481F2C7F1013B526EACD00FD25073B9EAC8A0EDA2F141036A7306FD8C55557ADC7A6F5AB51F65CD45B317EF4E3C7D06C37B17AF56A61E36AB52A6C2BC3F0F020AEB8FC52942A05D45B2DDCFFDD27F07FBFFC200E1F1A43FFC07C1C1AAB61F3E61F60CD9A9578C9A697E0BE6FDD8FFDFB8F60C5BA65B8FAA697A191F6E33FBEB2196E2905DC08C5E17EAC5CB70A2B4717627420C1D5E7AEC2CB2E588791324DC514AF9F6FF849F330B54C5203AE6711330D74F442ECD8406432E8B32D83E676466C6250CD06E4D88A2C7E784730F185DF85FFD4BF035643C0C161612F6F649036431609C9C5014E07A0D50B9481528AA6BD10ED91EBB1E48EF7018555805DE9D18C1E7BBC9DB6577456FBB9D6B5E74C3ADCB8D670CF729202B25CCAEB6A61E4B838D00AF08D1FEF41C32EC2EB2378B26097A050F00528A97966A62B6DD37965544F8802ACA40BA21071BB8576A386B0D910E3A3D072504D6CECAB26F8F1933B71F1A68DB8EC928B44E74C028ADA637A48B802D08ACB8E95D0EEE8009DAB346664CC7C6F4E69CC343AEABAD1758B7DCF04E84C9424343C123F0DBAD131BB8E62B45302768842BB8D5212E0D20BD6E2C0AE297CF6D3F7A159DD893B5E7D2D6E7FCDAB70E8480D9B9FD8832F7EF57E54EB6D4C1E38843ECFC7EFBCF7ADA81413D8718072C945FF6009B65340C1EDC787EEFD5BB86E86D115CB70E9A597C2F7CB8291D5892AFEE99F3E85952BCEC15BDFFE4654FAB859B28BC9B12A5AF506CAE522C62742FCA75FFB7FB07EFD3ABCE9D7DE844FFEF3A7F1D0833FC26DAFBE192FBFF91A8C4D16F06B6FF95D387D09FC7E1F838B57A19A661858B400F3168CA0BFAF80AB372DC66BAE3D0F17AD1A81CF498878CC159668E659AF513EE98A0E9B5E1DCA5732F9307B56A73C03D0671740B330C74A3B2B4FE499C96F96BC18BEB50F135FFC43F84FFF0760B594CA42E475AACC2FCA0F36B911A02DC04D289B53A6FFD4C692DEE3501BCF9662E4D277A074C5EB017748B5766BEF82D306BEC77DE0A3901CD378E1EE8775146A9A43965D68E487B6D8886E1B6FE1DB8FEE823BB40076412CE19125114AC5A24C92F4D4500F5F8FD1914C67D2F32666F4D43847AD26DACD3A4216089304F5CCC36456C4777EB44538D35BAEBB1A03655F6829B14EB2556BB24B599EC8E6C8477372E81299B9B2A397C6C80B93BD19F36C7FCF9B4D728016D739F2E4B9844E8A7F7A9357D9C28A5B55916B8E1066B40B65D12D4198B590464D0C044D5CB062092EDDB40625670087F605A8D776E3C24DABB074C9285207B8F75FBF8BBFFA9B4FA1560F51B633F8691B7FF167EFC15039442123CFAC1C491C7F1849D687F7FFD17B71E7EB6EC305175E8C62A90F43C3231277C74AF1977FF17778F8478FE3177EF15578E5ADD7A2E81230538C1D1EC3C8F002140A05BCF92DEFC0C8FCF9B8F3677F1E070E1CC6E4F804962D5D8482EF20890771D75D7F0CAB18E0A657BD1296BF089FF8B72FE17010C25FB41CA3E76E42C59FC08A91046F7AF59578C5651B848376C45D8AFDA4D4602BCA90D24AB5078E1A64BD233007EAE9D9F48CCAA201E8B30BA089A8F462E09E6F6C16A1A2A0E4B5E135B660F2AB7F066FDFD7003B906C4C6DFCAAF462E2E121197424838876A5D2AB2DCF3C7751E102DFC184BB0EA3AFFE1FB0175E06F8DAEFF98C02E8A3D018DD7A9ACE7754E6ABE055819F453132FFF42CD4B20C0F6C9BC496FD47D0B760A972A393892E96CE4D2A1C64DFC7AE51B47C962E194A0391F0CD04E6561D41AB2916A16CFA9842098F1F6A60CBB6A771FD0DD7E1A20DAB652544F185D24E6B7DAE4C9DAA0354FCBB854951F2BD1CA095F14FB7E09703F6CCAC79F6C260CE352BB7BADC0489BA6C6946917D04B5EE59360BE09E8804E708161B5362EEBC5DC3F9F38671F585E762DE601145A78091CA42D9FBB254A087B58766ECE24FFFE65FF0897FFD3252AB84248C5070800BCF5B8957DF7A0DD68F5650E0A6B73637C91DC1B7BFFB30162D1AC4828583F08A4BF0C4137BF0F0C33FC14B2E5A875B6EBC0403FD1EBEF81F0FE2231FFF3FF8833F7C2F2E38772D82A0853D7BF7498173DF9EBD989C9CC4E2C54B61BB74FC2BC1B253B49A0D38DCA51D1E0E1E3884206A60E1E265B8EFFEADF8D8C73F87894688566110C3EBCFC3F0390BE0F4C558BBC8C76FBFE5766C9CE7C18FB8F78A923E52F7ED5362A93B71F37697DE49BF9341E7ABD80E84F716DC8D8AE3A8087D2672D0F411705D471E1E95414728B975D887BE8FDA7D7F0DFFC8F790A1ADA47522834B757776EE66A6DA8155E38A78D24982CC3D0E43A782E6E06558FCDAFF05BBBC56F91F77ECEA8E3B8D9D9B2F9C76B37370560F47A8377AE56A43ED0398E1502BC1834FEC43031E8AFDC37A13DD141E63CEC614664E123F3644E49BDC6988A6543C4D10D42610376B924107418080BEC8F4F3C84AF8D4D77F809FBDF3769CB362B102E798F7C112ADB3341BE61DDA5A7B4E3E5A80587BB1F466D03940CFC639CF546B4CB70A2510F75A892A937D72D0CA894EA93A12EE88426A2649D166E8025A86B6E044352CEAF771C385E763CDB225D2E054F45CF4154BF01DFA8D58F0FD0ABC9203D2F89FF8CC7DF8EEF71FC3F2E5E7E03BDFFD219E7C622BECB48DCBCE1BC12FBFE1A7313ABA04D57A84BFFDD0C7F1E637FF8A24145FFECA63F8D467BE8E306211F230D6AC28E00B9FFF30AA93167EE7F7FF00175DBC016FF9F55F9626AA8347C630395E836D15A49E323131811FFEE027F8E1E687B062C502DC74D32BF1F4B6BDD8B3E7295C7DCDE5628F90A60EB66F1BC3BF7EFA8B989C6860E9C6CBF0BD27F761EFD80138831EE6AD5F8645F32BB870C542BCE5F6EBF0B2FF9FBDF780AFA33CB3FFBF33739BAE7AB72C59B65CE4DE6D6C535CB031361803A68412B221A411926C7A42FAEE26D964D32B210909A186DE4B68066C0CD806F76ED9729364F5ABDBEFCC9DF97F9E77E64A328124B0BFFFEEC2C7978FB02D5DDD3277E6BCCF7B9EF39C3366881B19A6CE27CFDB46AD8A83E61107F543721783C786FCEDB571B2827E6F55D0020A4A3DA05A4DAE6C2ECFE8217BE405E22FDF405EEF66B50D7337522E673920D2CA51AC2E30B9C92AEEC8B8A9FB881B15F81BCEA664F1BF43A0CE6D4FBD5517E4FF1A0CE72E0AAF57A6F4C71EF72C1A5F15D0EAD5CCB92A47E863E17CE352D59A36D1B8453C9D555F914C468D5DDB7A40ED2CD46E24E739A2C9EE4550541A77F2335771E13EAEDBF59750D6646F3776328A954A90362D62199B8C1EE0704F9AD684C385E72E52C6F832D4E24D62AB06A480BB4C775A6AA7E4BE6A5D0CFE956DA90704839A858381F9AD541B83330573D6A1725F1547A5941CDE38B78403A8946E771845403AE74B9DB1B2646C878095468BF6521E343875EA44C6D4D5AAF25F34DD81A04E594998A27C1F41DD26A0FB317459041D62098768DCC40804787EED41BEF2A5EF11F4079831A9842B2E5B4AF59012922987DFFCE6563EFCE10F10080479EAB95DDCF7C073A4D3191CAB93098D853C70EF6F397634CBAD77DCC4C245F318D350AF1A98D178924C26485B6B92679F7B92D2D20282869F07EFBB8B258BE7B2EAFC4B79E289B5DC7CEB1F386BF94256AC3C8F505E182C9D4877AFCC11515831969FDEF8006BD7AEC55F9047B6A294EA6953D04306932BE0471F5F4E437599C26615FA2E3B0A599F255432A7DA54FF7E438EC59BF11FEA74395941BF672A6877D9168016E258B82F31801180EE20BDFF0952EB6F221CDBED0EA378ABFA09D22FEFF7DD241637C32D07D0192D48C43794922997923FEFD3D8BE1A575ED4DF60FBBF86C86F783D3963234926573B0B17A973DEBFAADED1D4707C7F232E91CA124999F4A44C2212A09AB0D48831FE20595D53CD3AD9BA2A6F110FA075352A2F4D2359047D6AC047F1CDB929CB9C094F2645B2B78B4CB497ACFCDDB289593A3127C0EBBB0F306FD1D934D697E1A425295D940142570D849ECA74A700B4BAF815B5220B426E61F53CA6BD6198B7E299074BE906288E81F41317A007F4CEAEB44E541C2EC52106486E85EDA8D0808CA835AC2C412B4D2893E4D429931839A49AA67DFBD9BA6D275D31E97DA49930B19ED9D3A730BE711835E54564D3E2CB6192C9D8C4122689743EB1A4CD55577E92DA9A2ACE983792B9B3C753585C884D903BEF7A9C05F3E7525D5DCDE1A371EEBDEF0976EEDE4D69899FCBDF77161FFBF02A9E796A3B4F3E751F975CBC8221E52E608A57F4B66D87F8C39FEE67E79ED7B970D5395C76D145B41D69A6A4D0A7F8E9B6B63E5E58FB22C346D6316EC214F6EDDB4F714188FA6143C96635E2C9023EFF959F12E9EAC5F1F9898843E190A194358EA62C2FCE272E9ECB05F32751EAD391D43277711E2472CE6DA2E483934ADB2B0A0649EC4F3C714F02F47BA78276DF89EE01B41B59251AD2B0D642DFB6FBB036DD4661BA59E944DD5B4EC339B875E1CAB5FA015AC6BDC55E540BD36D0CA77AD1C7088EBD84AC31C475DC7863D7E3FF324E0FD299E61CE5BC1E298EAE1193CA389521216069425FCA1DB5CE481529B6514610DB082046AE2AB45513258C2C860336AF2A01457D99FD61AE2E4D94E385DD8BD24E2589B6B76125226AE22E6E414F46E360579C7DCD47F8C4B51F23A0D9CA6D500CFF6525541ED1DEC2A2C6EFE57B9ECCCB6B25788A91016586FA88BCEA7770259DAB8A4F546A7852BA41E6FB2E40E738689910940ADAE5A605A0A531E8F2D10E662A839E35095836636A6B317BBA70524922D114692B4D554D09DD3D51CA2B3476ED6CA6A2B48CC5F327B064C15CF47446699F6349F1B7F6F3FC9AD7E9EDEC644CC310EA6AC2E405E5BCF6A3FB0BD9B5FF189B5EDFC0CC19D32929AB26D297A0B5AD8DE1C3AB183776347B776FE2E9A75EA5ACDCC72517AD203F10C66F040887F3D8B071376B5EDA842F643171EA181A478D96E03515922B41023E9F1F19B0B56C8D7446E3E1871FC1AF67587AF61282A1222211F8CE776FC0B2C4D2D4A0B53B42C208A2575652585340E3D41A96CC18CEFCB135CC18D74858CE91DCA29C43612F624B766D3932ED2440BF03E078B771D039D0950A3AA787D5B414F94E33DDAFDF81B3ED5E8AB22DAAC273290CB78134F834C9D9502AF05695B6ABB5CD6885741A23197AFE1709D62E21AB950F9C78EFE0D8FEAFFD8AD764539E4DAAAA7230354866358E754469E98992D6FCA4D5208AF0097E0F04E57E06964A3277E91F35C727833E831237542287D7BD5761AD6A1058656ABBDE1B4A6DE1904DC4E96D3B869D8CA92A359AD5694B38ACDB75888AF20AAEBAF83CE5AB91D3A8CBE7E45232C233BBA247B757E082B68A7A5557FB8013DDE066E160401E0CD8B934EE0110F6D41A9E2C4F280E45634868808075CE885F65200AEF2CCE7432A66E8198206552D40F6DA0BDA59BD58FDDC7F891C35975C507F1899E3915C54AA739FBACA9DC7CF37DECD8B687211541AEFDE0FB18515644221E276AD974C5037CF7C737B36CF1428AF20368568CF2E220A5857E0C9F1F7FB0903BEEBA8FCEAE3E0A8B4B983F7F11C54525D87692EEEE4E9E7FF6691A473770D1C5CB08040CE251D14827F005E4130D28A0178F1A491117B9A93B01EF5E33D96C4A9987398E4FA5BDB4B6B6128BF6306CF870340162DBC7CE6DBBB0ED4222318D871F5CCDC1D66E923E8364186A678FA3B22CC888F2009F7ADF124E1D5FAB125BA498E94F6DC95A68E2C4A70A8613A740FF56E67192E2780F511CEE352A90E0B6A6E4BF0405E63EBA36DE02BB1FA1D83EEE4AB3FA1506B9A053EFFA567A3A71AD135587546FD27CD230B5223A8C51D45E743DA1AAF9D85AE94042CA3B1A9BFA5F82684FC524F4844808D30E74C52C5A7B62F424320A98B3BE806A7689078932B437452521010402B81E8DA48EB31BAEAA16728F6376E5E45E95AC067DE43AF4F4CA62542496A022518BC7881C6F259B88AA749A287EF6752458BBEB08CBCE5CC41993C7E0F36998390B6DA9A6857356C646EE02E1D234AEF4CF75EE76FDBAD527FF8669C1C1003D584637902538A0D4C839D30D501CB946A10BD0EA6B10408B31942F954290B0A6B48853E69DCDD7BEFD73CAF3D2CC9B3585C29AB13CB3FA15BADA3AF139112E5A319755179E453CDAC7638FBEC2D0B2022E5D320F279BA03B1927619472DB432FF0E273EB28C82B5234DB84D1435879F6744A450B8D8EA985D9B879177BF6EE53116CE984495FA49BAAAA122EBC601923870F514A112938FAFA823CFCE8E3BCB271355FF8EC27282F2E508D56E5E6E713D7141F8984A86E6C8201D1A6BBB6B8CAD50FE8EAEA63DB8E5DD40DAB6368553921F15371CAD9BEA39D5BFFFC38CD873BC91859FA020E0CAD64E4B4C9CA64EC9CC961BEFD890B944DAF7C29CAA3BF79983B67DC51FDFE26E11B54762739E8BF8313EFC60A5A0184679AA38A2A3B41616627DD1BFE0CFB9EA030DBE12A0CFE06A0DD080EA90E05A0FD591F8E9EC552006D90A15855D075B750A75B000020004944415402D0D50B71907467CF95E7DD02D0A2A515C37BC15543239985A35D195ABA63A41CD117FBDC705751AD880C4EB9D6B9CE80AE75A75B050B4088C6593A746E2A8A0C28B8EA17A579559C74CE074DA05350D6D52CCBA52823D19600745B0B762A8634D77A2C1FAF35777030A671F9F92B682C0D2ABF63D719C5FD5276DCAA60769406DA909173CF785F0D09AA2661CEA9CE95D6BD19C5D12F97F340DC6D0A0E8C74E778E7C14DC21CFF9CABA07326FC69510B59690A627D94FB1C4E9D3985D2BA195C7ACDD7F9EA672E65DEAC466E7D6413B7DDF3143E3D48301BC56FB6F2A5CF7D843973C672FD377EC390F2123E7BD5395496848825E2F4983A4DED511E7D740DBBF71CA5B3334A5158E3A2E5D35876E6A94A9E97D583F8F30A48C423B41F3F4E229AC11F08505553C18886A1F8A4076099D8599D74BA88BD4D0769397E8059D3475310101E3D1F4D2BA1B527C9B36BD6B365EB2E8A0BFC2C593883E9931A4927234A0D65DA1ACFBFB885DB6EBF8DF3562C62D992A5D8199D071F5EC78B2FEDA4B35D926E7C64C51A36A8110D81BF6E1863664EA631BF85EF7CE6328696172B973C15AB25BB2875EA886CD0FD64D580518E06C9518639F039C941BFC7386875250B372A9202018B3885C96DF46CBC19A7E969F205A04FB8E5C2E6DDE879693C8922C16FF914E86475011E83B4534CB76F24B5177C8950CD99A0150EF858FE6F0174EE243E61FE64506EA0D790515B5805BA6EF28980DEB11E93239D11A5C1CDFA826A4C5BAA63194D968EBF4BAF7B23CEB225963D89B2729572D5258844979BAB886CCD52BCBD3405D58656A6343D4F6ED57A546A18572A67CAE45D2C42F7D143AEB5A899E55842E3D5BDC7C81B3A924B57CCA752137090D2CBF5E996B7E8D5EADEE7EB01B4E656F9396E5AC5550DAAA007AB36DE4CEB9C73A87384BA70C44BC36D0CBAEE759286221E1B6E1A8AF2DA90C5459CEC94B42E8399B5F0A512CCA828E4B40963282B0CD2962CE5EA2FFC9CF3168FE7FCF31671FB635B7962F516C5EB868961C48F316DE230FEEB7B5FE3AF6BD773CF5D0FF0F58F5DC0A8BA72A2B198CBC7A71DA2C93C1E7E6C1D2FAFDF4A4D4501575FB280699346299FECA2F26AD25616BF9EC2A76531B4009AE1C7080609E7FBD0B48C6A3E66D21ACF3CB385C71E7F8A050B6671E6C2E9E407D2384E05878FA6F9E2377F446B67125DF3E193F9804C3B0B4E9FC897BFF011C5B1A38538DE65B375EB16B0BB3965E61CEC6C881FFCD74D6CDC7800B40282FEB0AA8E934E86B8CF265150882FA031715625531A4BF9E0AA73983D6E0441595815FDE8711EDE94A1A2139513577F6B68D0DF4F521CEF298A438D978A524140C49061930405E92D74AFFF3DD9FDCF52E0443C7317F792578A8341E3A86A4BEEE8F8C45046AA48DD5292AEA45E4CAFD140ED855F26547906F8CA55C2B41BDBFD16C31FFF7FB118DE36B03FBFB51FA09577A4A2100C5DCC9EDCB053358526FA654D23E5381CE94A73A4BD57191159BA441E4913CEA794086A7BAF820E5C7EDA7D0E19FE70E52A03EF74F07B76C924CF16D0631B733245A96A5DA6514808791C2BAB61F676D0D7D2A45245E296CEFE989F4D4D47A86F18C105CBE613F6526772D89B03E99CC78300BEF84EE42A6AB5A078AE74AA09E90D960C00B45B25BB16A2EED049FF7D241350864F1C87A424B54B97CCD63C573A990C4CABA82B5131C43226697987D924A4E3643332CA9DE0EC710DCC6A6CC0F0D944B41A2EBFEEFB7CF75B1F65F2C4A1FCE1CECDDC7AEF33383E87A016C3891EE5F31FF920A7CE98C4F5DFFF394545797CFEAA73A8A908D319E92693D549993E7A5345DCFDE06AD66FDCC899A74EE783AB16515098879E17E2AEBB1FA3A1610C93C655535116242C61BC869821F97869DDB3883A6ED1C28558593FAF6D6EE5FBDFFB21F535613EFFB98F5055954FD22CA2F958828F5CF73DD299A02A688286493A7E9C49934AF8F9CFBF8C93CE609BE25C57823F14249DEA22954AA8C5BAABD562DBE6A3AC7E711B7B7637BB610CBA4E1A83B46613372C02A3CB193F671C4B1BEBF8F00567505F1E941943C549AB0D8FD73650C64B3980F63CAF06C0FA2440BF8700DAD3F3CAF08902319178A528486DA27BE31FB0F63F47BEDDABF854B7352140E472966EE4B7465655893A862DBFEB1AB88BA42CA117D0633450B7EA2B842A1680AF6CA082FE9F0668D9B97B3AD25C91EC1A01E5161D97475741209EE7B254CDD1ACCDA1CE34ADDD7DCAECC83482646C5D5576725FC9DE535B7DA16EBC14B07EBDF83B788FAE84D1F361106F0E6586EF20FD34ABF73891634D4A6217B77DEC8DFAD97AB085C6B1A358B9F454FC59D14F7B01089E1263708925E0AAD828AF999703E537AB98079A8239D3A381041475FFACA4749B6A872169302A815B1D0B71A54B2B109695409A6669C7212E9C7326862F1DC3679B8C282F627E633D434AF209847C50349A8BAEF91605451A73E7CEA0AC6C044F3DBB06534B2927BC99931B59B1641E99581777DCF35746D557B26AE11CFC8649D44CD017873DFB8FD376BC878CA5D3D51BA7303FCCECC9E329280871A4E50877DFFD80CA61ACAECEE7DC658B386DEE294A237DEB1D0F535B57C1B4A9A3691856455E30C881C3311EB8EF118655E7B364F13CF28B7C64EC3C8EB425F9CE7FDECC91A311AC7452D12221BFC5D2A593B8FA83E7A09B593427C0C1C37D3CBB7A3545A53E16CC5F882DA3F89D322350C04B2FEFE4B6DBEFC5670495ADAA889F85EEC80675E29561EAE7CF645481CEFB168EE782534751120E2959A6E0B1E7AEE0D21E39DF7435DA3BB89A3E09D0EF21807605F06256E357DECDD29848939FDC4CEF6B7FC46A7A96FC6CB70BDEEAE6F2A7AA32F4CA51F17950196D22B4F79678F14A48E87974FA46517FE1D708952F04A3C8739AF720F27F526E37F81CEE97CEB92F402925D47B1FD09F8A4A236E6539D411A7332E2E6B22999346A04E322395A39BE23C78FACE3564F7005E2D68FF8D5D82A71557002D7234CBC1EA6BA7F7E87E65331ACFEA34C57D6C3D789C118D8D9C7FF669E42BAFEE81F7947B6FB94F4E01B4F77E73AF3B5711E7C0FAC4C6608E677E938057A98EEDB43A5F2CA17C646B6F5B988EA58CF71D53C26BC5A81F526686949321944C114A25183FAA9669E3865311CA5218D2F0F975B2C15A9E5B7F90DFDD76177A28C89CC9E358BC600A631AEB58F3521343860CE19BDFFE291D5D6DCC9F3E9C7FBDE67D14EA3E92C918D17482E6E349FE78C723FCCB454BB970C559F4260C7E76C36D3CF8E8B3EE708B93E0473FFA2E81B0CE8B6B5E5640FDBE4B2E61FD6BBBF8C14FFEC084898D545584993B71288B4F9B816987D8B37B3F9DED6DCC9A358170817B686DCD4F774F80752F6F65DB8ECDCA877AFE69B31937A606B27DD8A65C0979ACDFD0CC2DB7DFCAC2B366B164F1B9BCB67E3F3FFDC52D2492BAA279344906A7C0EB4F487A3958864677180A46D6316AFC28EAF3227CFB03673075ACA841026A91367CD2CCF70A8B7E25D04980FEA737DEEFC626A1CA04F4005A2E58BF66124E6EA17BE39FC8363D4DA1DD8978BAA80B5E350B5D10C881B60BD05E3E9BF2EA70D51C02D0EDBE46EA577D9DBCB2F9E02B72A757073CECFFE9E3FAFFFC8EB966E520BDA97811AB800107650B7AB83BCEF1484A4DB3D9BA4F558AA2D4C8588EE25D5D08CEB5D9739CAF7BB1B87EBF6FFF96ABE995EF894773A8CA54B8DC68175D87F62A1F8EA40547537E36371FA7B47624975DB8884245310D786A0C501C5E55ED5987E67865B5DC7A137FB9BF0FF6DB707FE64652B97CB248E75CB056F155880B9D848A18AA8296DCC1AC935615B4701AB62C2A599BB499568648464A23D39DA2B6BA8C8A7C8D398D654C1859AD3C928D50094EB08027D76DE1DEC75FE460D37EA64D9E4255D5505E7CEE451A868D645FD37EE5A571E992A99C75EA644A8A8BD502B1FBC0019A5B7A79F4AF2FF2F10FAC64E69471F4A5FDDCFBC8733CF5FCABA4A3BD8CA9ADE0DA4F7C944426C5732F6D61DF81A3CC9B339F75AF6EE3C5759B948706768C1923C3FCE05B9FA1B2AA8E5B6FBB877BEF7984FFFCFEF54C9A56A71254C4CDD1CEE62BA04E585155DCF80C836C26A180D3B103D8593F7D9134070F3751581EA4A262044F3CF22ABFB8E14E6C2D9F3C7F005B16FCAC7C5E5975BD291ACBD18905FD644B0BA9993189116569BE7DC56C4E9BD6882153859E4582D2B17B834C2E7DF5068EE36493F0AD2FBC772740EB6ACB2AE3B3E23816D44CF2323BE97CEDCF387B1FA328DBAE74BD392F871C8FEB02B4A39CD272491FC28B29A37EB224F502DA7D6319B6EA6BE4959D06FE925C10B80B5EFF531574FF93BD490485F7A6541F4F5E90A19171E0585F8AFDC7E364F0A97C4551C3A66D9B9497C7E8CEDD7A9619B9AAB4DF78DD8B337A07EFCFADC0DD1415F7657B8E471E40B71DD84D369D2065DA74640CB61DE9C62C18C295979E4B95CFED0178DB82FEDD41AE9276290E91DDB9809BAB9ADFBA29E84EFF0D36DFCF8D744BD3CF724C6534A2653405D0AA594A0ACB4A6167249DDB51064096A23D52A4620607761F279534C9B3135CBD6C32172F3F955010457304C301D24601DB0FB6F2F033EB7975C31EE27D69F44C9AE195A58C1D3B9219D3C631764890EA623F43EA6B55CF64E79E265ADBBB49A52DC637D653901F226507E9E88ED2D6D14932DA47797E88E2E20AE2498B7B9E58CBE3CFBC4A3858A6A472F14C1A5BE9FC939C3EA992AF7EE6838C1933868DAFEDE2873FBC914F7EFA439C72EA68D72F2463A365A53360933112AAD7629AAE4247A818CB0AB16DEB4E8EB71E64E6EC69840AF294F2E3C8E1240F3CF23CAB5FDC40BC2FEED1588E4A7A4116345BC3CC68A4FD61E2A13005931A193BA6908F9DD3C8050BA652289FADAA05723B33E905E514436F48BC3F09D0EF258096C905C9BF130324A9006430D624CF3948D7A6DBB1B7DF4B9175CC1DBC908B5B55D1EEFBCF01B42811543A87787A788D2D0196B4E8A07D63A93DEF0B846A17E218A5EE98713FF8BCFD0AF31DFDC69B01747F19EF5A36BB0A424735B38E44121C6C8F92248CA5FBB11C8DA4659112D31FF1B850F239B7F9D7DFEE54032CDE77BC71DD77F25A07784677AC5C8E970CB618421FC47A39D6B41B539CECD2197AD2364DD2BCCCE4B37CC942668C1CAA8650946AA49F8376FF2E3CF689B446EEFB03432A39F0CD796C28537D4F4A974B43C9C9ED54EA8980BC652BDE55D40B12086B3919321E072D715722B1CBA41284823EE64D9BCBEBAF6CA6A074183B36BFCE9C5121AEBE7439A5D2C4336CC2613F7E5FBE5A240F77C53878B88B743C839D49139608B6821021493FE9EB20A45BD40EABA7ACB28264C6229932559357334471234BAD9FB4254E7E594509998918564ABCA635F6B5F62A995CDBB14E1A468CA1ACA29AF55B36132A0A73DD07CE62484935056103C3D0D9B7FF20CD873A7975E326B46C2F4B17CE63FEECD3D1758B94D64342C43B7A899A2854FE33699D3B6EBB1DBF9E60D5AA55048225ACDF7880632D29CC6C8635EBD69048F672F6D96711EB8B52595E467B6B1B8EA531715C233FBDE13E9A3A12A4CB8A193D652873675572EDAA3399595BA58E9134166528462DE32AB9E86405FDB6AEB3775F052DD3656ECDAB3C21C4B8C631091BAD746DB98BECE6DB28CA34BB6A82DCFCA097FE90334D52CA05250893555E09CF14179DA1881E7D14D54B3F4970F472B27A19AA8D98F31A785B47F6BF71E7C1003DA872EF77F5746D2F046B684964D87EF438195DC0390FC717A4570C73A429E6F793364D34C350A3F1025E224B55CA54C5BDEB8A977627CDC4B5EFED6F13C4DB43805E4DFB791A10C3B1F13B2666BC8F634DFB49F6752BABD144264B5BCA60737B96F18D63B864F9FCFE2941B7BA1FA8A67300AD36C7FD46FC83951B83AC41BD2414E53A37C8F428378CE2DA853A642DB777A1A2ABCC8C3B88E2D8A42D99144C61CBC460C6C44C2409683AD75C7201A5411F3B0E7670CB6D7770EEC2C95C7EFED9E40947ECF711CA0B103634C5E3264D8B442A8D9996E93D937822463223F48989158DA2654D468C184E79551581FC30D9AC3B651749D81CEF4AD2D212A1B7B78F82223FE5250594E487C8AAA9C4940A37E88E88656B127FA090AC96C7C34FBDC8AB5B76316BE2689C74925933C770EE390B08E70558BD7A0BBFF8D55FD8B36B1D975DBA9C2F7DFA73ECDDBD9FC2CA2C43EB46B16F7F947BEEB983DADA522E5871016D2DC7308C143555C3D8B7A7835FFEEA7676ED6B65C890022EBEF46CF24B83CC983E55B299C9A43314E4E7535926BED4016EF8FD93B4C735EE7F760DD9323F23A657F3C1A5A7F0D125B394939F8ACC92068FAA877274DA1B50E76405FDDEAAA095E85D49672D358AEDCB6694595274CFC3645EBB89C2C43E3580AC00DA1B353DD193437869A1085C1DB43B05274A8742E25A2DE5A77E00FF8CABB08C6A2476A95F26F1DFC0DCB7F5AB83005A55F039ED8607AEEA9C5761AB36EBF6B6D0858F80C451593A19CD473C6592CA98AEBE58B9C1B94E73B99101979217EE3D5753CB5B1C641BF9365EACEB692280EFCE1F8A9E5C005AB79238E914479BF69110595922462299A0C70AB0B34757314F9FBCE64A9783CEBA76B0B9B82AA96495E84645669D08D0AEB1FEC014616E8C3B07CEB9AA7A7005ADAA68F1D73025BE4A4CF64D358E2DCF9D16B99B74B3EC145933A552E0DB5BBB38DC748C2975F9FCF89B9F62D3CEBDDC7ECF838C1D3F990F5D711E0DE5F94A977DBC3BCEE8BA7C65DC9F882548A633C4249B309B211AE9C0AF4994551A3393A6B4B488EA9A72FCE1207A5E18C70870A035C34F7E7E077BF61D56EE73A6E9E0F365185A5DC4D8861AAEF9E08594E443261A57FED3924C93CE06491BA57CFEEB3FE570BB896EC7F1D1CB84F1057CFDFA8F3165C218FC4690FDFB62DC7DDFBD949695515A388C5FFCE2279CBB723AD75D7B2D4F3CB28D6F7FFBAB2C5E329B4F7DFC63D40EAD226926719C3CB66C3CC48F7F7223475B3BC90BA6F8DCE73E4EE384C9BCB07A0D1B5FDE4055553923470F23954A72C1CAF3A96F28E72FF76FE0DF7E70230989CD5A3889331B2BF9CE07CEA7BC584CFD7376D1E2C3EE35E7DF48A59D04E8F716402B3582022D4B511412C713327A49343F4DEAD51BC8EFDBEA02B4023AB775956B81293DA6CBDEBA89D16A0B269D23A102C2649C320AC7AFC07FE697B07C43DD440FA5157AA378F36DA0D8DBBD6BAEC0F0140E8AAAC9A92D943E57027335B635F7B0AF3B865D54A6A44F028EB1B4AD8642644BAF5EB37283736586398076E5CCEEB04E6E864F384A2F1AE56DBD5AF5A80AA05D499C50474271C8A28999A6E55033D1AE76E50B9D4E448966FD34457DF425D37CF173D76299F2129596CEA3AD64D433EB9A1529DED99D6E5421C1F2E555C8B931EF9C87864B65B8E3D9FDB6A1DEF4A0026BE5A5E1FA6A88ED67D67413B92D4B5395B565C655E0AB480F6A4AABD8B6711B99EE66AEFBD02AC64F9A406B5794475ED88EDFF073EEA2796CDABC8DE7D7BECC9253C773FE59731956554A5F3C4D9715C04C25D1D351F20C8D800C45D9168585F9F8F2FC98BE10514DE7D935FBF8CB7D4FB363EB66828120A140B9A23CB2768A78AC17C7CE30765C1D179D7F1673C78F25288B4726419A20FBDBD35CFF6F376269D5E8768C803FCAC24563F8C4B597525F5D8E95C82A8B517C3E3A7B12DCFFC0F36C78ED55268C2BE5B28B2FA1696737FBF6EFE0E24BCE513B47D3B2954F8BF86C63FAB8F1C65B18565F475EC0A161442D3B77EDE67737FE815020CC87AEF90079F93ADFFBDEF718366C18D75D772D5902DC7ACF736CEF49503A7B12638A2DBE7AC999CC9A3882406E53A668C5DCB9F28686F449807E6F01B46B7224A025D48444576509F91264DBD6115FF73342DDEBC5C9C07BD3FD75A3E70F2DDA4E77B2D0ADFE5C347401D0876387312BE6527AF1CF7142C3D16D89C792A686F068EF44E7F0B6F0CEBDF30900EDEE02721AFF9CDA42EC6E1E78612B05B523C904F2D5B45B329D266EBA2E652E6A7A69318A3A18308C722B680168B78276771AEF0CA0DDC003E1C4DDB228E73EE7B74DE552D7D57E9C9EB6A3C47B3A48F6762A3FE8CE6C1E5D098B25CB97336EEC28CC8CEBF721120B792C51802812CB9B2E14A0CE8DA0BFD1A16EB001923B1538A0DC109ED91D5C9166988C45BB433A32BA2D89DCE2D627064822934F24536066280BF9B9EEFD2B189A57426B6F8ACD3B772843FD8AEAE1DCF2F8165EDE7A809838C2193EE5A459CA11AE5831932B579E43C6F6F3C46BCDDC7CE31F9935BA81F75DB2989A21418A744729219C4021EDA69F7FF9D22F696B39CA9CA98DD45705F8E4C7AE60DF9E6692C90CA15098DAFA917CF747BFA32B9E66D79E7DD486E19A4B5670D6693349581611025CF7D9FF24952E269B89535692C7E98B6633766C232F3CBD86F623DBF9E435E7B372E512E2A92C896C0ADDF0E31720CC485ABA414A1A887E1D2B13E4AE7B9EE597BFBB93704119634637D0DEBA9FE9531BB8F4E22B79E0BEFB292A345975D14A74239F583CC2D0A165E83E1FC7DB3B185A55AD4C98D66F69E2DB3FBF1DBB710A2387F858DA58C4C72E5B4E5E3F40BBA7766E706540067BD20FFAEF22C4BB8D8356622E4FFD2E13802A27CDCA12F2A731225BE97DE10704DBD76290F200D9032B714793B342840F52452B3ACC8B53121ED65BC5C5C92B121847F595BF472F1AE702872E668DFF0B00DD2F1F75F5CAB96EA7D4C3C7226976B444C8F80B9501BE349AFA120992968323EE74B23BF01A83DEA5E111252E90E6DCE9E44FE190D59CE0DF4DF67CF3D328B760B82FCF759C930550F968E0108F44E83C769848FB3152BDEDC4E34962B69F1ECBC05F5AC3CAF357120A045D532A014C99F8935C429564E27A6E64A582F62608DF1CA05D10FE9BC6A0F2A9C82A5A4380D9925C41CB54CDE5BE78CC0D631025432A43527CAA23BD445A9AF9F6751FE1D45175ECED4AF183DFFD9931430B59BA6439EB9B4C1E78F6359A3B7A557C6D36D14B55A88D65F346317DF4280A4B87F2D496C33CFBF40BD8D12833265573C5856730B9A19670208F24A5DCFDF46BDCFCD82B983D87F9DCD52B993DA39EA99347BB3981B259B31D3A7A2C5EDF7E80B59B8F72CB5F1E259F24CBCF98CEC7AF5AA17CCED37A80C79E5A474F440293431C3ADCC62B5B7628DA2493B2D0D287F9CAA7CEE7739FBC8AEECE084FBDF012D535358C6C1881960DF0EABAADECDCBD892BAEBA84C2FC52FEF29797F9D98D7792C91A989938F5B541BEF8B9AB0887AAF9F10F7F4659718AAF7FED7AB66C3BCA5F9F7A94B397CF5580ED0BE86C7D6D3BA9648A8AA175FCEE914D6C89852836224C2849F09DCFBE9FB0DA050E4219AFD838A1DD71B2827EEF54D00AA0D5EE5D00571236848376084A68ACD944F733FF81FFE8D3F8901AD36B4A78DA6195482C35A39D33867727EAA4EA934942F999DFD6E8D1865379EEF730462C00A90174C9257C8334E81D14C66FE757FA4F6BB5A6E4E81AD7063469C30B9B0EE02FAF511573560F90B42D7A1349326AF1F20D18D3A8EAD6F5B1E81FD576EB677578BCFAD703E8B7F30ABD625F19E9BB5590323A5295B9ADC0598E583A9120DAD946F7B166E21DC74844234AC5205440BB5DC882458B983A69BC02521945D604A45DA4EA0768A1360464D59F9E8FF3008D3110F63A58D5E102B2EBAF2155B6F86BC856DE110E3B230A051B53D684545AC9CDC41BBBB5E518913601E80F73CE8C096C3E1AE523D7FF3B2B4E1FCF79CB97B3767B1F8F3FFF1A6DDD510A833A85019B9240371FB9E25CCC4894BCC222761F4F71E7BD8F515A5A414FF366AEBDE21CCE5E700A863FCCF64316BFBAF92E7C8545CC1B3384499506975CB94CEDF5A4C1188B27C8F3870804426A57F39B5B5673B82BC58EEDBB290A5AFCEB875650535EA0169B8448021D3F66A680D7B71CE267BFBF17530FC8765201F4673FBA820F5D7A36E9BE287BF7EF2365690C1F399C9E9E20DFFED66F693EBC996B3E7C01CB972C61D3E6766EB8F9018EB5F529280DFABAB8FE2B575114AEE5A73FFA258DA3CAB8EEDAEB78E8C197B9EB9E5B5879E13CBEFE8DCFD3D39BE43FBEFD6FAC5C7936734E9FCB1DABF7F3D8CE5E8A02716AFC1DFCE2FA6BC857BE292E3DE8328E6E21E09E7F1E709F04E8F71640ABEA4F970C414B8D74FB6C8DA05FA2855AE8FAEB37F1373FAA2A68D7AE32A75A106B4D57D9A1D9E27FACE17724C9C3C2D26D2CC56BEBF81C9D3E6A30265E49F9FC0F8151E301F4FF10BD91FBA84E4068D78F53D232329AC68E633D6CDC75989A8631CA6323AB19F4A6D3F42492388670D1AEE6598E536E3AB0BF2FA32E86C1DDF41C3FEF2928DE2646BB8A901C40BB1ECE4A61A3ACFCC1CE64B0E25122C78F70FCE06EA29DAD6AE4B8CBC9E760329FCAEA6AE6CC9AC9E89123F12B125B3C323C8016A016DA44F1D16F04E8816194011AE3443BD15C9495FC5CC9EAC494DF74A9974432AD067CC4DFB9A2B080A91347E37362649311CE98750AE5A152F6B444F8F16FFFC0A253C63363FA0C1E7A692FDBF71E24E4877C43E39C33E7D1D37E94C963EB49C59314951472A0B58BBE680CEC20CD3B3772CEA2390CA92E2792D6B97BF57E9E78E6392E3A6F3E2B17CCA4BE5027934D2A00AD1F3192FCA202DA3BBA39B4BF995367CD23A9FB38DC19E789E737F1DAC657593E6F02CBCE984D50CF12CD686CDBDFC2EE7DADEC3ED8CE4B9B0E621B214535F9ED18E3469431736C31EFBF782113C68DA3AB27C1D36B36F3E4737B58F7EA1ECCF4314E9956C3973FFD69F2F30A79F695FDDCFE97676939729C505E1F975FBE80D9D34E61EDF36B31748759D36788350A478E363379CA68A64D1FAFBC4B1E7FF219A6CF9846417131BFBA672DAB9B7B69A82FA2C06CE1F7DFFC3805EA20BBDCB314489EF0D51B56C94D819D1CF57ECBCBEEDD487128805695AF709632B2AD13F44B15DD4ED7935FC37FE0217C4ECA7366F36A446930E92EA521002DD4886CC31D4905D12D35DC2106E6866390D0CAE92898CCD8CBFF0D429394DBD789B741DBB69CC462F01DDEEC7B6F13F83C0C75AB0D1596EAAA4E62683CF4D276D27A98CAAA21D89A0F4B37E84AA48848669DD0031E8521CDD49C694D2EB72B4765B84D427951B9E6A7C7A7BCCDD7E94682B9F1532E55E23582727593806C3A41A6AF8BA37BB7D379F400D9780FDD561E87D3F9D892805D51C1E285F3195653832D2E7B8A8F769B86A26291F470C5430B972C15B0D248CB48B92BAB53E0AD425EBD6414F1A296AA5938683545282929194C69022A999D4D3A2546F6599C9449757E3E172D9DCECC89C3C8CF0FB1F1B5BD341F35195253C9BEBDDB691C358AF64882A736ECC21FD0593C6F029505851CDE7F80C307F6337BE61402C19032A2DAB36F174B172F24CF2FEA8E0441BF4E7B6F1FCDDD16BF7E7003BB766EE1F31F5ACE9279D328CDD359BBE66562B13ECE5ABA08573AA0E800002000494441545F20AC5259FE72EB7DCC9C3899B90BE6D1D213E7998DFB79E0C1C7185B5DC4C72EBF90B2904677D2E007BFBA956D7B7651337C141D7138DAD243400F61C8F14927185ED9CB6F7EFA59C68D1EABCE931FFCE27E6EBEEB79B71849B5F2B3EF7D9E65F367AAE3F1EACE5E7EF8937BD8B5A38960304E4343884F7DEC1A029AC65D773F42A4B793CB2E3D9BD9B3E7B2FED5ADECD9B39DD9B327523F6A0CBACFCF137FDDC073DB9BD96F6A4C9A584BD86CE3F7DFF8288503C1468A62544BB8D2BDCB797712A0FFE1E5F66E0468A97E95304CF913BB9CB45435617F275D8F7F9950D343184E4A350065E4598656048C5D80168A43C4795EE8AC12CFABE02CC533CB63A709D3EBAB60D8B95F82FA5540614EECE01D4F39EB3C899A3A809E119387DBDEFAF10F8FFD3FBC43FF63BBCF27A2C243BD69EE7B7E33C31B27A88B3F6B48328A41772C49426C321547EF6E28DDCFD63332EA7FB2BFD138793FC93511FFE1ABFA9B3BE4F2E87291B1EE73BA5A754577D8199C648CD6037B38BA6F27C9EEE398B69FAE984D440F6105F3396DCE6CE69E32CB4DD496AA59F4DB8AF2D0DC316D098CD5DC493FF115513ED58A53F6F204C5465452B8BD3C4191CB09285B02E08EED26A364A4312863E81699741C9C34C908647A632C9D378CABDE77364EA888EBBFF13376EEEA66CAD8323EFEA10B4839856A0CFB8535EB195957C927AE5E456551315B5FDF22BE6E4C993C96A28222C56D63A508E587157D52921FA6B3ED38C7BAD21C8DFAF9CD23AF7260CF362E9C5BCF47DE7F21050178FCE917193AAC8EE953C770ACB59B516387F3C8438FE3CB9ABCEF8ACBD97B28C2CF6F7998B5EBD6B3686A03D77DE0122A0B4274C61DAEFF8F9F3067D6582E7EDF0AF61EEEE5A65B9FE6F5CD7BC8A652F8CC04679C52C37F7DF7D354561663393EB6EDEE664F530BD1588458771B1FBEEA527C5A5251622F6C38CE0F7F7E1F4D078E1334A22C5F3C990BCF3D9B90E1E795F59BB9FD8E5BB8E0C233B9ECF22BF9F4BF7E8D834D7B983F7F2ED77EE63A7C01876F7EE316D6EE3840DEB871CC3F633205561BBFFCEA0728567D901C95E15E36AA5EEE17F59F6C12FEDD2BEEDD09D0CA6FD4F57256D3821A797E8D7C5F27DD4F7E8D60D303F8EC840268F14096F69E4F7C178483D6DC8A5BAE25D3F02C3295D6D90B45557ECA3ECC4021C5D3DF0FA77C16F4AAFE6D9A7B300701B4C7ABB9BABFDC14C87F732CDCFB50DC0119F7B1646149A2B1714F2B2FEF69A371E22464A0DBD4FCC46C8DEE5882B4C8EFD4E0C83B9104BE11B8FF79A0EEA739BC5F714D7A5C8096869F6E9B689924DD2D87683BB08FEE96C3247A234A23DC91358819794C9C3A83C54B96E0377C4A37ACDEB770C6968D6688565974BAAE9A43260265F044388AAC786A781E1C02C2E2AF211C764EB1A18CF995BB9E9822995E08AC501E09CC541FA36A2790272DBFF83EAEFE9795EC3BD2CDCF7E793BC1D010962F9DC5FCD3A7703C11E495F5DB30DB3B9832A68EC69195AC7EF209E6CE98496145A98A762A292C252CE7A09E22ABD9A4C487423208A3497A1206BB5A92DCF8F0CBECDEF61A3FFDCAD54C6B1C4A81DFE2999736D2118973F9A52B292AF2D31733B9E1D7BF62FEE9B33965DE4225097C65472737FDE9018617A6B8F6AA8B28090768EF4BF3B3DFDCC4072E5DCAE233E712B761DB9E2E7E73E3BD98C904F3E74EE7D4D98D8C1E518EE5887DA82C9A85AA303184D2936C45274B262BAF37C0D32FEEE3BB3FBC8D9EBE2CF9FE34238706F139167535B5ACBAF8729A9A9B30B30986D60EE7F9351B983C713CA79D36033DA4F1D2BA26D6BCB089475EDA807F54030B4E9B44195DFCEC6B9753A442997329EC5ECAB78A311B747E9DE4A0DFFA627BB702B47220D62D55A9398E501C1AE14037C9B53FC4DA76273E2BA2B206A57A1280164AC36D040A67ED72B496D8D9E546BDBD2168496A117031F520DD053318B6EC1B1835D3A47582A389AAD3AB4B073302B94A57191AE538DD7F1EE0DEF49E2A4FD01BE0D0746593D967693CBA66133DD93C468C6E44B3D30AA07BD259BA62094C2FB2CA73D87F072FE09DF1EC6A247B90D9D260F9A25034BA9D25A8D9641311621D6DB41F3944FBE183741E3BA4AC5023199D68A09CBAC6899C79C65CAA2BCAC824530444126DA5D5FB121F67D12E2B3F684F232DDF5334869545135A43650B4AD52C15B7A7DC302D457FC8EF5AA9A45AA0E322B54BA458BC603E13EBEB70A21DCC9B3512BF6EE33334749F467BB7C3A148922F7CE7F71C688991EFF331A930C555172F533F7F7DEDB35CB1F21C3A7DE53CBC760B4FFDF505268D1ACA973EBC92C63175DC74EBCD541797B364C1220E1E6D2762867872C361563FF70CA38704F8F4872E665879087FB890DE588A17D7AEA7B5F52813C7D6B36CE962CACB0A88A4B36CDEDDCBBFFFE076FA7ADAF9F247CFE1CCB91355959EB275D28E8F3CC76448651976D0A746B3240650826085C697516ECB14B37F3936421B895A4657B40FA44867FA300262472B81088544123A8F3FBD8E87EEBF93A50B6773E6A2D3A81F3E4C8D8EB7B476505454C4A64DBB993DF7747EF2D31B28ABA862FCC4E9FCFCE7BFC1D08324F3F2088EAAE7CCF95328A68BEF7FEE52CA0CB105F6288DC1A1172701FA9FBB3EDF8D00ED6E8F845396E699F0AC3EFC01080722687BEEA273ED8D049347309C841B082B9E1B1284EA255AFA84E210372E19C9533CB6DB3C14DDB0EB4CEA5207C71841E9DC8F5339F33CE55FE020DD75AF23AD9A7003C7581A204AC3D03FFCF1CF1DFFBF7B2F6F8C505E9BA5416BCCE6DEA7D711AEA853DB62194D9614EECE689AAEB854426E94D5E0DDE3DF7BFC133FFB375221FFFCEBCF1D87DCE3B9BA6A4FBFAD541E620DEB60C84875324A775B2BED87F67160C76B6493195269875E7F19764139E3264D61EEAC59141862A69F560D2AE17615E86771134094878654D22E080BCDA14B828B00B470CFE203225FA624A228830BEC94A97CA9C5A324A91944FBD254550C25D9D6C4F0723FD77DE4FDECDEBC9509C36B19337E383B0FF7F2EBFB5F62C3A104C75A2314692657CEAD519CEDBEC347D8B4E6393E72F985B453CA6D8FBEC8BA75AF337678355FFCE8794C9E349A8EEE2E52BD3D541517D1D5DD4747C4645F7B967B1E7D9A506198913585D496E85CB472053E43C71F2C50F98CF9799E03AB1F7EFBC71768EFCEB267F74ECA0A35BE72ED2AEA6B4A4967D26EA880E510B092549715A90945A5159753DAF093148E45F7ABDD879571DD056537A254A372CD18367E23432A99F6405B869FFC585A8023879A195E5B8526C9296993F64E9B175FDCC4EB1BB7F1DAA6EDCC5F74364F3DBD1AF4003E5FD87D4C4DA3CFB0291C375CA5B514395DFCE7E72EA354F7E60EBC895E654DF6372CDBC926E15B5E6DEF36807659D5018A438CC1257A29E087BC601CAD773D1DCFFE1AA3ED65F2EC1ECF50C95DC18583969B4F19C50B60BB34894093A20664FB2702B1AC68890D7A7CF5A4872D65E4F26B71FC7522C25351B56E6BF2C46D9A3B91E80601FC3FA33ABC825CE46512D3B5FB789C079F5BCFB0518D9457562AAAC5D402B4475374C6D26475BFA242DE78050C70C3EE69700227E87DC71DAD7E67B71301DA6B164A234AA9FBDC400425BB938494AC49261E23D6798CEDAFAE26DED1492696A4D7B449F80AB18BEA9931631673A74C40D7258FD0C227409CC990D5FC98A6C8F0DC0194018096C943A91605A05D6BD18CFA9DB40270CDCA62A765BC3BA55CFEAC503E7B9A24C95A236C479830A29C53268D21DD7E88CBCE3E9D5113C6D01471F8E8B77ECFC16890AC69506027396F52014B4F9B861E0A736CFF5E268E1C86162A645FF351766CDDC3A8865A162D9C4A614198D5CFAFA1A220C094310D2423095A3B22C48D42D6EE6EE5C1B53B683DD6C4D205335971C61C1AAACB48A513F8030686DFA0A0B28A9DCD2DDC7FDFCBBCB8FA1546D5FAB8EAE2455CB56A99FA8C62968FBBEF7F10DDAF33636C2DA386555156568563BB010EB1341C6EEDA6A3B79768CAA4A3234B5F5F82685F4AD1414545614A8BFD9416E894E585292F08535111C417907206023285683924B3267D699BB5AF1EE5D7BFBE9748B7BCC6A0EB16EAA5BFDB59CDD5DCDB199221879289F52C3C7D22F9563BDFFFEC15947853A69EAAD35516F5CBEBBCF3ED24C5F1DEA13806BF1355F3A9B3C520A8003A0DD611929BEEA2EFB53F5260B6E297D46AA9A244A7ABBB2D659FED479393596511BAF97612E523548968A40D6FC823A295931C722A23567D15C73F5A351105DC5CB819E81BBAF5BC0B6FEAE41BFCC3778A7A72A5E5AA50518369B0B1B98B879F7F9DF1932753565EAA9ED5C4A700BA239A51D1566F366C32D8A4DF0568258EFE9B9322D75C7C27303D586EE7EAADDDB46F7758DBE58364ABEB0E09D9908ED2B27F07ADFB7611693D4667573B7D698784BF023DAF9CB3969FC798C6E16856125DA80D69ECD98ED22F3B8A67769DEBC436D4E599B364BC0ABA7F30451A8AE2C121432FE98C38FD6066524C983A994DDB9A884475EA2B020C29D2195651C282999399505F017921BA1C83CFFDF07E9EDF791CCBC923ACA5995F0F0BA78DA27EE810BADA3B301319AA879451377408E1503E3EBF813FAC73A0E900D515352E676E9AC4DABB48C7E238C2A587CA7978C37E5ED9B495DEBE287595E54C18DDC091437B0906FD64B23076F23456AF7D999ED656C60E1BC2E52B4FE182A5A7505E5444C6D6E84CC217BFF255EA87D7F1A96B2EA3B2B080AC3453351F494DE3D1275EE7D127D6B37D77137D7171AD73ED45FD3ED402260D71196DF7E9594AC361C68F1CCA852B66336FCE04259DD32D0DDD32C8180687DAFBF8E12F1E66DB8E367427A0DE93245D5852C438723D48B1239FAF493C68523B671C73678D243FD5C67F7DE64A0A72E7BF9708AF1AFCFDDF3B09D0FFF05A7BD755D0B92EB0C0B29D4BC1736576E180786846A0F3558E3CF4158AD307084A03487C2184AF960A5A260905A065B25099F9BB00AD92BE354379E7FA64D3A7DB44ED7CACCA69549DF579A83C4DF1D0EE4DA88481944397F47893ADDB3F3CFA7FE70EB26FF446B505E864ECE6A5FD1D3CF4FCEB4C9D3E950A694E6990B6754571B4C72C35A8A02EA037A985DD6B62A04C56CA8B4137F5F377B098B894BB50483976DE5BAA14D5E272FEAED5A9DBCD57495B4A556311EF394EF791FDB41FDC4DEBC1BD44BA7B486703C48C62864C9AC7F46953185957852E032752418B4FB348E9BC082B44B592F1680D71A513158780B10CB348FE6046A2ACC4A4DF52F486168B32ACB284154BCF209EB449A6FDD456E551566850140A93E733081A1684F248E84156EF38C42D8F6D65CFB11EA2BD5D4C2D4B73C6C45AE64C18453054CC238FBF48DDD0121A470F537B3AF197CEC8591208535B554F536B372D9D7DE8F128430A82D414FBD5CFE38122B61EE8E0D5ED87D8D9745805C34AFE61C0AF93362DE50217D01D169D329A0B97CCE68C59E3290EFB94CDAC48E452E81C3E7294A28230D545C5325C48467348E8061BF61DE73BDFBB95434D51B5FB0886FC549555D271FC2813C6D5AA0A78E3EB3B104E50F7FBC92452AAA13E6FFA103EFC81F369185643C074F05B1A294DE74877929FFEF651366E3DAC1435AEC45E9AB492D22DE79BE784A86589FA328C5C388579331BC88B1DE5FB9FBA92704E5E9FB3EC7DB353FE6405FD1EAAA0BD982601841C400BB84A4C5C5872DF9D0C5807387CCFBF92DFBB95902511972E400B204BC56D645D80167A433868E50FAD4E3CE1B3655845E0D624E504B00A47E09F742505B3AE06BD143419FB1693254F2EE4910A2EB736484EF40EC0EE44C4F4CA706F34567C9F5FDCDBCEBDCF6D60F69C53282B2EC430644B6AD0DE97A42D6A91D1430AA04F80DE77D6F7737703DE0BFA7B6F2507D0EE40D01BEE290A1BCF4FC32556BC06AB2D1A741B27932419EFA4B3E50087B7BD466BD31ECC7882A44C6F960FA77AD818264F9B455D75397646647102C602D2E229214E6E12FEEA4AE984D21080CEC8308A8C8B4B911E8F819551B983562246A16DB2EC8C39CC1CDF407E300F9F8CC8FB2C35C5EF234F59CBFA7D59F56F2760882B3FFB8F46D8D8D4CEDA751B195DAAB172E12C7C7686B6CE345D7D720E9944221D2AA1243F3F9F8C9565C498A904F387F0E4BACD3CF6EC5AC24E92E92387B0646A03E545214170B2FE42BA6259366EDFCFA1960E62BDDDCA052F100E50515AC8F891F55CB46C0E7515850A4875511C19EE14AD6ABA59A24F92F06FD73637A169BCB4FD08BFB9F379B66FDB8F133331B42465A5797CF05F3EC8FA97D63075D228CACA4AB8F39EFBA819D1C8DE832D1CD87F54A5701784B2CC9C3C92CB2F5ACE9486A104327192AA9518E4916777F2D35FDD8A4F979DA386E1F36388BDAD251ED4AE8DAD2CC6315F86F1CBE63073C2108A12C7F8EE759713CA099E3C35526E80F00457819300FD5E02E81C308A9E59DE971B4E29148798A4BB55E27132DB6EA275CDCD546A11F46C5C81B16A05AAB05897AA90EFB9369B9256EC65FD49DAB78A8D4FBB61AB817292E5A75138EB6AF2879F0646B1AAB4DD7173975F956A5A00DAF5F7C81D6BEF1FEF14A80757D01EC5B1EE4037B73EBE9629D3A753573714BF26CD32E84E981CE9CD907464F118B0ED7451F69F481AF4169B9CDD67FFD93208DCDF0AE7070722BC796C564ED5E2FDE94D370AC888CC2B2B86F9E928D1A34DB4ECD942D7E17D7477F512370DD2814A0AAA47336EFC68268E1FA9405046B5E5D064D31934DB56923C45693836C98C98EF8B7EDA5176A264C401CEB511AD2ACA67E1B4094C19398CB0583167B314E4E5910AF9C9F8FD6006D4B911CA33C80B0BE82508D83A01DD4F141FDD927212D0292D2E24914ED399C872D7435B4998699A0E35515359462CD243C330E1A5AB78E2E59D1CED8AD2934811CA46692C0F70C5C2298C1852AA8689D430ACE123AD3CBDFC4A9F6D047C684183FCA041796188CAE230C1408096B88F275F58C3BE7DDB587CEA0C16CC184749385FA5649BF8E9E8B3B8FBC957B9EFA90D1CEE4C6125FA983F732CE79DB3904C3A4243C3040E371FA5A7E3B8CA65D47D3663C64D2212CFD0D5D64330E0E7A1275E61DF9EED0C29F373F1D2392C3B6DA272DF13DAAC3D1AE0F0B11E74DDC0CAEAB4B5F771EB6D0FD2D39B563604928F298542DC309973D1994CA8CF674C7E8A4FBE6F29C1BF0168D75746EAEF01AAE36493F02D11FA5D4771F4D776B9C10A57B62032BBBC90E79761F780B98383B77F93F2F876027694AC17C5E76EB1A5B1E8E615E6A41839AA4301B8C235D1D442863CFA7CF584C6ADA062CE353879A3D07429B1A47C7123A75C758837BAA27059FE973B33DDE77ADB37D51A175EDC2DCC656BBCB925C60D773FC9887193983CA991806693312DE2598D83DD492557736D51079EF0042AA3BF9A7DB357E3F2C46FF7D69FA892F3F51844759C706E79EA16B54B515ED4367E5D232D5392423325FAE86B3B4467F3768E1FD8474BD341B2FE52924629D5A3473363DE1C8AF30238665A49EAA4692836AA99B418EDBB66496931CBF7941D3816995814D249F44C8A698D0DAC387D06F986F0B1210ACB2B698FC6696A3BCEA13671DCEB52664A62B13561DC08664C1CC1A4115590723FC780213B2B07DBA791F169FCFEA12DFCE9916DC4120952991445C52544BA3A185A14460B97B3E77852D1647636413971E68DAD62E59C911484C33477A58844BA1839BC8621794182B2EBF105F0E7E793F507282A08216E80BE4010CB08F1FB0737F097479FC34C4528F3F7F2A56BCEE6DCB39611F4E7ABB4F40D3B9BF9E67FDDCBD1F6043EF9F893C799D850C8D7BEFE254C1B6EBF6B0D9BB61CA4AF3782EE6408871C6A6BF3F9EEBF7D91F2908FD7361CE27B37DC466B670F5A36495DB1C91F7FF1350CC352693326416CDDAF06C26C0AB028E65737DCCD5F9F5DAFCCFB2DDB51B2BF84CFE4CCCBCE664C95C6E9230A5875E66C022A62C73B135455639315E9A5E2AE4F4E12FEC3EBEDDD06D039731FB78E1ED8CE0B7F9717928C3BC1C604386D245FBD89C4EB372935877825AB0C4BB1B4F44E8C5C432D171AAB7E59A930DCB41619959609AC845688563195A2799FC43F6C31E8794206BA882C5560C06D1AAAE1558571AE7CCFFDCE3B04E813E8054701F4FE1E8B1FFFF9418AEB46336FEE54826A043A8B903807BA527426855377ED43DFD1ED1DB8D9B9A3E3DE02A50278DDF058A56871CB79AFAA973F72E3BD02D2728C25785476206AAF8E26DBEAEEA37437EF61F74B6B88F4A5C81022535CCEB071139934B691B0DF8FA6E47332C221FADE8C4A3191B25ABC375232C22DC72493C49F3531CC344E2CCAE9332673D6E93355EEA02F58CEFAAD5BD9D1B497E663AD6ACB7ED5A597D2D4DCCC9D0F3EC8BC39B349F77631A2AE828F5F7D294165C865A99415A9700F7445B9E22BBF637B5FA51AC397A829CBF12BBDBD9EEA5352353350A4CEC3A096A6CA97E6DCB9E35930A946E9F2FF78EFE3ECDBB38B1143CAF9D465E72B7E3A1B2CA0CF3688581A663C467D7931E5436B48EB7E7E7FFF46EE7DFC058C6C8A52A3836F7D6A258BCE3815B400712DC48BAFEFE0F35FBF5735EDCA43262B16CF64DA84A18C9A3085E75E7A9D1FFDFA3E8C4095B231D0AC34012D856DB6307FCE68BE7CEDC7D53179F8A55DACDDB0837DBB76E3375BB9F3F7DF26E417CD4B064B0D83192A0DDDD28A698FF8B8FD9EBFF2F4731BC90B0425BA9BA4AE93F25B2CBB783163CB1D964F19CAC25326286FF0012F758F5254678214392701FA1F5EA7EF4680CEC9745C55860B06019F4138E82538483828499CE3CFD2FDC067C933DB7074A1354C25DE3FC17F4255D332FA2D278F1A045795825CFCB2A5731C43C502247C15F8275C4EF1CCAB30C223400B7A55B88323DC602EEFAF1FA0DD6DDB9BEA3EFFE1A732700755906B8EA2325A531ABFBAEB290E441C56AE5C4CD8B6C4939D94A3D3DC9BA1A5CF549E0B27D83BBEE1B9DED81C3CE199DE2640E7EAED9CF9522EF1D07D985C6370B009931227BA5A721904143AC290741CD9B3B8C936562689D97D9CA6D75EA6FD5013C958941E3B88AFA48AE1C31A18397C38F94191BEA531B3E24467AABF8B524334CF12F125BCB43C4BAAB793906D32B4B8880573E730A46E28B61EA2B52BCDD34FDECFCA734EA728AF503527A74F9F423295A0F94833132636B271C31E6EB9F34E2EBDE232664C18457571908A50480DA924D0F8D5E33BF9C6EDAF1132B28AE736B57C742388664A3BD76D90CA3965D826412B454DA19F99A3ABC824BB38D67A80B021ACB7CEF279D319515B453258C1D31B76B266CB5E92DD1DCC1859C7B59FFC30966EF2E05F5FE7AF4FAF51DCF7F861857CF9DA8B686818AA766E71238F879FDDC637BF772F61BF4E6528C6B7BEF219EA6A6B78694B33BFB9F57E3A6229B28E9F6036A824874636834F8BE1985DAC5C3C8B0F5C710109C2FCE14F4FF1D2DA8DE8E9A3FCF6C79F65584DB1440FAB54F8B4E9A337A22BDEFD967B9F60F3AE26B27A10C336D410554CB7281992CF5967CD665A6D888B4E9F407D6D850AF571D37B646B95BB5EBD85FAA49BDD3F4682772340CBD0895BB9B92A0CF1E408F97C8403C223BAE0A0720763AF72FCE6F7536CB77A60995521962EB0A8B20DCD91955CC0DB0508F97E2E67CFED040A57ED90D60B38EE9F48CDE24F51D270266845AE91BEEDA851DF7E9999375CE21AECBB8AED77C01C789E056E0A94783C48B32DE2E8DCFDFC366E7D7A0BE75FB8925115210C5DB4D03A87FA2C0E7525955638374C73C2A7DFAFDA780B1AE31F15DD6FC97EE4267672D5B1BB58B9D22BD7E7E4445D55CEA743D82137B1DB4D6291F76AABE3E57332D8B11EE2EDC7387E682F070FB772A4A5033D98CFB87113A9AF1F4EC0D03053096C9530ED8E7167D49734892D458538F128F515C52C9B7F3A5555D5EC38D2CEB69D7B9935650AD5253E6A2B82F8FD0538A2CEF11B6A043AAC675533CCEF17C99A8FA696767E2506FC93C7F2910B965059948FF008AD3ACCB9E6CFF4F675ABCC47D329C091455B93D807652642C88A531474282E2AA1A3F5183E3342D08E70CBAFAF67ECC8612AFFF0C13B9FA4ACB898C33D295AE3695AA226BB77EE27D2DECBE2B3E6E2374C7ABB7BA9ADAA64FAC4718CAC29A7A13A5F71F7B6A1D36987B9E99E6DDC7CD7C314E7692C9C52C3FB2EBC9058DCE60BFFFE4B224E1ED9804E36EB10C8FA096886DA75189A341953F833C738EFEC799CB1F02C9E796E2B9B37351339BE937FB9642EABCE5B4232D6AD0CAD8EB624B8E94F7F65D3CEA3644305A41DE9A186B0D36E6F2711CA306DE6184E9B3E923327D7B26CF668957321CBB41A8C51AA516FB19686CFE0F3ED6493F0AD81FADD08D0EE36DAE590C5D14E2AE990CFA0C02F55ADDB7C1006C2486FA7EBEE8F11E8DB89E148FA8A979BA712543C0E5BC0D991F11459DD4D0FF8C564C915FDE79ECBD442F4EA75949F713505632F84E05055596B429DB82D0F57F4EBC5805BDEEE4DF1D96F97DAF53E144F0AADF85A01E8946EF0FCAE0EFEE3CF4F3065EA54CE396D124E3685AD1B1C8DD91CEC4C90710CF56F858F4AE636F8F9FFDE0B71536A06DFBCB0ED13C896379E49390076178501F0750F88D0496F04684F2DE381B85B7DCB2AE48915D53FA57968423A46A6B793D6DD3BD8B3752BDD890C2555B5D48F1A4D5559999A4CB4D20905D0D21C14BF0D01694D74D3C938A16C8673E69FC684310D1CEFE9E3DE175E5389D9D75EB884DAAA62159996F695D21E73686EEF54CA889AA0C6A431751485754C2DC8918E5E7E77EF63643209AE5B712AA74F19AF9A62BD3EF8C11D9B58B76D1B695F909E88437B4F8A84A750F165924CA90972EE6913A81A56CFB32FAC27DADBC9B8DA22FE3FF6DE3B4AAFF33AEFFD9DFAB5E91518F4DE0136809D1409768B2A9428CB56B3E4E52CDDEBB8A438891D47B937D7292E711C3B766CD96A962C52A6444AA24491144991040990041B00A2770CCA00D3CBD74FB96BEFF79C99010836E52FC9336B8104E6FBE69B53DEB3DFBD9FFDECE7F9FCC76EA5BDAD55F1F2FDBB8F303830C2A9BEB3AC5CBF8C9E254BD5B5E5AB0FBDC6BE3DAFB06C5E3BBFFDABF770F9CA7934663238418C253A225239383E7D4186FF7DFF6BFCC3F77E444B1EEED8B8888F7DE803ECDE7D96FFFABFBE41C96B52DCDCB66DACAA98065BC4B6D87C054AE5CBD47AB9F68AA56A6575E66C91FBBFB58543BB9EE543B7ACE2B39FBA874A7184D0CDD17BBACA57FE7E0BAFEF3F4DCDF1D50756C6EA7DE1484555AC0E8B5B365FCE954BBBB8FBAA55ACEC6924768DE8ACA42F4692765A7B2691E730B9D24C93F02D23F4CF5E80369969CA1830013A5065B7829F51AEA60469690A3AC1498A2FFC19A3BB1EA239EAC70EA5F495DDDB8405A1E7290CA12E2B46DF4EDA71C6F5DB4D106E095CD20F74A95A4D38F3AEA2F1BAFF0BBB6D03B1DDAC9082E12748363082531B00002000494441549E78675966AC5CFE29CE1BE66B5AD7FA6277E3821B311558051717BF148BAAE57270B8C67FF8BB1F50A987FCF34FDD43502F29063852B375A860B01252777DD5139187431A9DF2502AB09066F7933E8D46FED19CF7F9DE8DA64E9F3A74730653A08679C53C58E968B7F94ECADA98AE8E77FE07A570900C2D983CDBECABD24BF2A4C987C1DC4543421A7CE5E30739F0CA8B9C38D3479829D0DCB388853D3D34DB116175823814B823543E71B516AA30935F1D67DD82D9DC72D515F80D2DEC39768A675FDFC3DC8E263EB07115859676AA9946F6F75578E2E57DEC3C7A9C288868B71DDE7FFD3A7EE1BA55B4153C1DA73F59AC72F0F03196B7E6D8B466896E3A65CBA66F22E6ECF030E5D8A277A4C2F79FD9CB93AF9C24AA55688C2BFCBBCFDCCE476E58A61A30670726749271765B236D7E84EDC8FDB15463B95E0B2996CBE41BF2F8850CC3B6CD17FEFA251EFDC1F7B964E522FECBEF7E96F9AD1651197CD167118357EA548918A499BFFAE6AB7CEB912771E332CD411F7FF49F7F9F53A7ABFC3FFFE32B54FD3623102699AC70C46D8B9A65E3591E4EBD4EA17E9CEB372EE1FA9B36F3E0C34FB3FFF0286EE534F7DEBA824FFDD207A8944609629FBEC190AFFDE3333CFFDA616A4E413729D145716C8FAA5DA573652B776EBE94EB167472C765CB69CFB93292A87569CA919F5479BC605DCD04E8B74EA02FDE4E4A76BBE43AEA9C442DA45A4D89096FF379EFE1256B68ACF65E73CBC958A74155A6019300ED895852C637CA590A4B08A43C4138B095D1AD5F84DE9F908BCBFA7049096AC6A725DB342142ACAE84B6645B55039DC4125A9360AED7C360A715B79BEABC5B9875E527B03B2E25B60B096D2852DA97AAE24970D4006D444C27BFDE4E24635A80D62452036B4A9993211B6944390CC5F0ED177BF9D237EEE7DFFFCBDFC073C58D5C1C476C15D7393430C6B0249F4A3F74951D201AC8E2B42D1E7A12A325784FE9364B969B8AF65ED860BC30D85E1874D534CA98EFBE871B2F6F95CB2E7F541236310116A35F2FAAE9F7AACA46114A644876BC9FC1A3FB3872F000474E0F10B4CC61E99CD92C2CF804F531A34C270E29625F25A553699486608CCFDD7317B39A724C786DBCBAFF18834367B9F6B2752C6C1439D966BEF3C23E5E3D32C091C132E36A4A6BE3070E0B0B2197CC0AF9F82D9770DDBA0594DD1CDB5EDAC1C4403F77DC7C15AD4D0DA64F91DC33A9967A4BF0B51FEDE66B0FBFAA06B9F9DA10BFF1D1EBF9ECDD1BB5CA92B7CA008AD0E9F4FC059C95BD370CB1F54627D58EEB31107BFCED0FF6F0A5BFFD2A1D2D4DAC5DD5434F7B8E79EDDD2CE96A67E3EA85F899804A5466D49AC3038FBFC1FFFCCAC364DC9855B35C3EF7C97B98356B167FF1F78FF093970EE07A397D266C31A8705C4A91A8CAD8F8D5120B9B8B7CFEB31FA07BF132BEF7D81B3CF993D761EC10BFF3D99BB8E6CAB5D4AB45758B2FD51C0E9D1EE5F448CC8BBB8EB37BF7614A6531BBB0287417B8F2F6F5AC9CDBC0DDEB16B271E11C7C394DCFD63EA0D1B7313D41BD64172E96990CFAAD9F9E9FB50C3AB5CC919BEC86AE19E1B6EAF8BE4D2EE31B6D671967B5641E5046ACCE5239F820235BFF924CAD8F4C54575B2B51AD0B1C195031AB47981C3A866A49FE26EC4ED1DD9010215C693376ADAC69B78162D4893DFF66BAEFFC1D626F0E1192B9273E875AC7990864CC7EA6497FBE3DC2705ED26A72D17456DA302524E312F9A763E598FFF4DFBFCAF537DCC6BC4573A80B0E1E1B2DE893C58823FD139422997634830532BC239EE5260C18332A5501D44335E3EE69363C35C09EAE99748598833F1F5336B9F0DB31AD2F1C339FFEA9C62232A93F1472929C5F60266177C84627E53164AAC3D487FBE83B72889776ECA398EB66617B2B2B5AB2946BA39A4BCA1878AD52272ED7B1C6FAD9B4B48B0FDD72036E546724338B2DAFEC251E3FC71DEFBB8E06CF657F39CB17FEE1C70CD52C828C50C7E4381C1DF5CF95CFD1563BC947AF58C0EFFDCA07A9DA2E83136576ECDACDA56B97B0746E8F8931168C4470E85CC00FB6ECE7074F6D674C8C5FC3228BDB3CFEC527EEE09205CDBADB0A355346B16D2FAB23DE325C23F87B6B531385AC8F1D56553B44B8D165BB407F35E48FFFFB9759B0780507CF0DB275FB0E7C7C96B4FBFCDE3FFB202B167712C555C6EC1E1E7F693FFFE1CFBE8FE73974B9E208B3825FF9C43D9C1828F3C7FFFB7B1C393980086D485355138D081A182353E9E373F7DECEBDF7BE9FEF6E3DC07D0F6E65A86F944CF1307FFD07BF4653A3DC03B9322E4120CF8A47396C64A098E5B1A777F0F08F9FC7CA5BACBA6C19D7DDBC8E567B820F6F5ACE8A599DFA3CE8D2731278232D9B2EF60CCC04E89F9F002DF083881E192F4223C62FB655223493936915C12EB571E818BEB3E8088FBEC4D8CB5FA47C6C0B0DC13099D004D310334528016A3257D4C02A99A4341C258C099D4BA58735E80A64E05A5906DD25345EFB7FD3BAE1C3C474AAB3F1D4A08AA4F7D342D19B32868BDC8FA46A49A10353F827D389A9BBB5E85B5B50041E786A2FCFECECE5831FB9CD1CBBBA8FC368E4F3C6B121866A12EA1C6CD19F8CABB88900AF08EA981A22E54B27CDD604E6982C51260F716A0B4F83924981CCF7CDC0C95BDB65BD356B241D0C4AFB09E97D08353BB544994F86376C1BA73E415C1C66A4F728DB5E7A9D61AB9185AD4DAC6AC933511FA312D7949F1357EBB8E345DAAD2A1FB87E034BE7772BBC33E076736AA842971BD0D3D182EBD93C73B2C21F3DF22A457C42E1B50B8E25138AD8348463E4C77AB96B49137FF62F3E4D20C608BEC796175E61F1DC59AC5D344F7D042B56C4379E3CC0571EDECAD9C11A19C7E683B76C62C3E22E3AFDBAFEDFAD8D18BA261E35B7C091DE331C3A76428D095CCF53FBAFEEB6162E59319FD6425669A09A1C88BB8A8CA97B1E2F9D19E57F7CF91976EF3A4C873DCAEF7DE67DDC7AFDA5F856C870D4C233BB8EF23B7FF25D350BCED607F9F54F7F980FDD7E19D5D066DBAB27F8CF7FFA654A32209975557AD513A3E5CA097EED9737F3C97B3F4CAE39CB9FDFBF8DBFFEBB1F910F035AE3337CE94F7E0B2F63A90942183938966B0C12EC26427F36DFFAC1737CE3BB8FD1BDA08DBB3FBC99395D197A0A11775CB68CD67C065F866E129FCF34839EB6E4669A84EFB6E2FC59CBA04D8036D31B6E9866BDA1EA186433F2A019BA9C6489CAA1A8C920C43906773FC8F8B6BFA3BD7E984C5CD56C398E2493942942611208232456CEA744572F906C5C5EAB118BBA9750F1C23AAE586DC95044761E679C15ACF8F41F12FB2B8934A027043EC111DC0B1B74C91D793BB6441AF792809E5486EAEFA726AA9643DDB2149F3D300E1FFE9DBFE2B39FFC45D6CE6F5178458D742D9B9D470738557128E211382E8E60B962EFA48335924BCBB5496420F5980D269F54DFD360AFE9C1D994F4531C6BF39A64E06F17A0DF6A1DA69A3929D4211B92DC5783535AB8B64BB526C31A023D05D8B512E5BEE3BCB0F50586CA214B3ADA58D490A11855294AB35004B14A25F213135CB77629376C58822FE3D1BEA39ACDA335979E7C4ECD5E23ABCCF37D75FEECD1D719AA6508EC3C9665065F6C274FBE3A4661EC241F5DDBC91FFCDA3D947C97370E1DE2E5ED2FF3A13B6E64517727353FC36814F1FB5FDACE3F3EF90A0507AE5C3997DFFEF88D2CEE68C4AD8E29B7DBB12D2A91F0257C9E7D750F6706C7B9FCCA4DE4F30D542A81AEA71387F63276E628D76F5CCFBCEE36BD1FA6E96C13393E677359FEE63B2FF29D079EA4B136C047AE5AC0AF7FF61791E55EF61AD9716C94FFFAB78FB0BF7740250AFED9273E4CE5DC0916CCE9E1CA8D6B787ACB4E9E7FE1054E9C3AA1E252856C8E4D972FE577FED567E93D5B66EF913EDED87F8E87BEFD087E6D8465B32CFEC3BFFE846A9E587E8E52BD815ACD25AC0454438F1239FEF6FEEFB0EBC851DADA6D7EF3D73F4DA13ECAFA855D6C5C398F5C467A1F815603BA46A663CEE9A29EFE1CCC64D03F4F19B4B8589B3BEE89D4610204FA9E455627092598099EA8409F091EA1E8389C6664EBFF24DE791FD95886770533480AFF840B275A1D81F8A6C9C86FDD2CAEC0916110ADD5F0052B8CEA124AA83B8D949D5964567E90A6AB3E0BF9F926482705FF340EFED4C59F5C9417ADF3CEC7E6D220ADD5821179126C364CF0E301E0737FFA23F6EE3FC8BDEFBF85ABD62FC515A8C3B229E172BC08BB4FF653B58D4EB05C13E11B1B9D66D3B094C09F203CC948F8D453631A87E921258DC0A4AC9F6A049AE6A80A35BFC72FBD6DB6919E944A253513354E2CD3704ADB56C6817080193DC7ABDB5FE2EC4891B98D05BA9D887228F0469DB85A251F45DCB46135972F9D4F3E2E917165C382897C3B2FBE7188D3078E70F76D37D1D3956724D7C90FF69CE681275E67342A1089008B5C8F20225F3AC7B50B5BF8B79FFC004B9A1D2AF90CE3B51AC5B37D2C9CD54257739EC1D0E544A5CEE7FFE0515EEF1DA360D7D8B4A49D5FBE7629972D6CA3CDAD51AC476AE47A6A709CDDC7FA685BBC9EC79E7A8E97B76F57F17BF1313C75E60CF36677F1B97B6EA5C50D98D3D148474B83B28A222BC3C044C05F7F770B8F3FFF1A9D4D79EEBDF56A3E74ED1AF26E8863854A772B5B190E0DD97CF98167D9FADA1E1CD9ACCB252EDFB0948FDCBD99037B7673C7EDD792C9BA64B24221F479FCC7DB597FE90ABEFFF86B7CF31F1F56138B063B60F3A615DC73D755E4BCA2D2EB2A718117DF18E0AFBE783F9E02653695D8A29673711BB37CECC337B27E6917572EEA66FDA22E7C6567241B6D0A7E4DAF0E67208EF7F6A4FCEC65D012A0CD13EC8552621B184004FBCDA877A2D826C14C839234EF62AC7098A117FE9C70E7D7C885FDB83ACC226F17B68629710DAF5A1A6A316E60864CA4032F19B504119162745C719F88A88B929E9DA3585846F3A5F7925B7D27716E01911ACCAA6F851ED779F8EC7B0DD006BB309D3D6D4A197B2FF9F688058FEC19E4BFFCF5B7C8B774F18BB75FCBF2D9CD5862A0EA65295A1E47874A1CED2F325E8F885D4FA7290D9163EA29491918FAAB122384A9703CFD699A9A0FD400AFD76E6AAEF32D33E5F3B97A936FD34F9E2600289E919269A5B8B914FA6A46AB1BA985285D5B137DBCFAF22B9C1E2CD19DF3E8C9C6542B1306BBADD798DFD1C60D976FA0AB204E23559A5C5B47B427B20DBC71EC145135567DE676BF4ECDCF32916DE1C937FA78E2F5639C1C1ED381A07C7D826B9777F0993B2F6371CF1C85048E0D57D8B97B2F97CE6BE08A558B34084D7879B61DAAF0DB7FFC00A76A395C27265739CBA5AD657EF3DE5B58DB2DFCE3066A769EC162959363759EDC7592C79E78960FDE7E336DADCDCABED9BE733FAFBFF61A97CF6BE0CA55F358BD641E6B572C26EBC68CC53EA7C602FEE4AFBE4971BCCC67EFB989F76D5C430E19C611F92C51C1AB2ABE3D4603FBCE54F8FBEFBFC02B3B0F532C06B4B57A34E402DC609C5FFDF44738B4FF38995C0B1BAF5EC77FF96F5FC4CF75508F1C4EF51EA7D52973DDFA857C78F3E574B76794BD117A2D14E3161E7EFE180F3CFCAC8A884953BE1A5708B23157DFB4913BAF5DCD82269B1B572FA13D6F7A42625E21F75708A81732812EDA4D9EC9A07FBE3268330422BACE52A69BC93F9938950C5ADD51C2345B34AD2F6954397199F13D0F30F6D2976898D84B361A25B08426E413076E92594A061A68D62D8C0E0D65AAAF98343A1C331823537D2AB169D914A326A2D6D5345FF529328B6E2676BB34F3310DC6845A9766108980FD74EACCD40679311A5E320492DA68A56F96869805FD41C49F3FF822DF79E635AEBFEA52EEBAE94A7C61418856B2ED53751D8EF697D8D33B405594EE9C8C561512A5D34A53E122AD0CD2DF9FF8204A1626E1517E67126453E687B9FA69A69BA2F76F5E63E7C1EAD35E9ECCCDF5D71AD9564FAFB9FCDBB8C2483523908DE1E0393A91E79607D8B37307A7CF8DD3628774FB01954A59191CE22ED2DAD2CAECEE0E9A9C8856ABC62D1B5651082AD433197A87C7D873E494D21E57CCEB60D9D225D8BE4FC92A70F0CC083B0E4AF95FA7B31073EB55AB59DAE9538EB3847E86871E7B991F3FFE08BFF5F15BB8F3862B55F1B0ECFAEC3955E48FBEFE635E3E3A42B1125388C659961BE05F7EFA83ACEE6E52F9D79A95E15C090E0F56F9BBEF3DC3E878919BAFB99C03FBF6A9E8D20DB77F88ADCF6F65F4D0CB6CBE6205EB17F770D5252BC9BA01552FCF50CDE65BDF790A11C6FFD55FBE8BA682674C09EAE26E0EB96802272CAB2441D56D605F5F9DBFFEDA77D97BE49C56164154A5ADC163C19CB90CF48D287B64CEFC1EF6EE39C8C4B8407D210D7EC455EBE672EF2F5CC7EC069BB85ED25B1E50602428F0DDE78FF1D0E3DBB5698B1B520E4659BF690577DC751DF373356E5CBD8085AD8D78CA704D8C9C4536DA68934EF59D0D39FFCD0B652640FFFC04E82471D31372924112B9EDAE6F200E615D68AE27138209BFD62C8B0AD6F801C6F63F42F0DA37C9958E28BE2CA22D76E826496AAAA1A1F8C8B48C320942968C528B51AD3020D2C0ED11D044A9EB6A5AAEF92CF93957128B2CA98E8F4F7D2554FC0B2C0B2FE03F4CC3EA8C095782454E6A87A49425C3BAA85B317B07AADCFFECEBEC3E33CED2E54B58B7680ECD1957F17219649808638EF64F70AE64A98B76DD3265AAEE3F2215A923EEC634577B7D89A894685BA844B652FECCDF27AB133DADF48DE980CA7BABDCCCBD31EE2BBAD9A619B46A6D9BD752268B64F64E1490AD0D7174DF5ECE9CEAA721AAD0625518ABD629C62E135681BA9727F27C724189D6608CDFBC7B334B33A6B750C6E6C0C028BB0F1E229BF559BF7C29B35A9AE86E6FD4E65E35741516CB66A1493270C762DFE961761F3FC9F844404326E6962B96B0B0AB0B3B96C9439BD08B79EDF8302FEC39C6DEA3E3CA2059DD51E1EA754B6816757C616EE07272C2E2E0609D2F7FF729F1C165D5A239BCFEFA6BD8AECFC73FF339B66E7D89DE1DCF71E7D56BB864413B57AE5F46C18BA84953D8CE72A4B7C8E1DE012A71557B249550A628ABD48A159674F9EAAA32AB45A60BA162E77965CF09F69D1866B81431305EE1D8F1A38C8D4E10D524D18870DD98B6960616CD9D455BCEA6250BCB9776B1A0A715576605641D84D233752947395E3D1972DF8FB6D27B7688D0AEB3E9EA356CBA7239B33B1CD6763470F5F2F96495C72E7D12D3DC1698F03CEC59D7D8C586A7660655DEF6C9F9598338CCC9A4A5F594C19374E6552C6972F0624A9FD93CEC015654845A2FD5E7FF8689BD0F938B07B0027137F6948B2AE43A09C08AD326015E54ED4CE96FB8BEA9C8BF69AD196FC328F628DADD788B6EA475D367705AD682DD649801C231368204D316A864A6491331BD3BE7A309934E2466B349329129E245027D541563EE2D07FCF9F75FE0F1ED87D87CDD555CB97E290D9E452442F7CAFCF019AAC089FE0A27068A542C97D0158D11C1EA4315FB51FA5D5A9AE8608E18D69AD521015A925913A3A70E54DD651218E262D0E2DB2F3CAD6D0CF6AD1C5D732F534EB452D3B44A31025719E13614FB193FD7C7F16327606294C6B8CA6025608C2CA55C07B56C33A19B25139669A80E73CBBC66EEBD7419793756682AC8E419A804EC3B7D8E17B6BDC4829EB97CFC176EA6D1A9ABF07FB6A181B22DA4FF1A3DB3DAF8E1A3CF72FC442FB7DD7815EB56CCA7909114DFC171C59BD2125D7F6DD80A0EBC63CF5946FBCB2CEC8855EBC289CD24AA04E8FEBACFA1C180FB9F7C8513A7CE70E7CDD7A98940B15C5178EAF9E7B6922D9EE47DEB1771C9A22E2E59B5481DC2C58BD1CB3452B65BD8B2F3305FFADE939C9BA8AB59AC27D563B5445766847B6EDEC02FDE7E03765D6CCF5C6D4A064E8E722832A9558E9FE963746C82D2D884928B0A199FD6963CF3E77492B7C017736526D42A2CB6B232A54EBD1290CFC89C80CB996A81E7769DE0E127B6D0D456E0539F783F4D7E91E53D79362D5B448BEF29A427CF990C8809C0A71568BA28B4F92BBD1D13A0A5369B71F57E9709CDCF5A8036AE1CC9515BF574B25B39A042B333D042DA614B32BD44F3D9A466E330F61AA77FF0C7340FBF88178C63CBE8AADA204B804E14E1645045C71525406BBE6EC64E1477354D31C32556615F15A3A9DA5D788BEFA4E9CA5FC2C92F0227AFC69D3AC69C967769D9974A30A6813BBD5F6FBA21A953F8B4EA508F47FE53258AA53670B8FFC543FCD1379EC2CDE6F9B5CF7D88F6C66695ACCC8A568718887A59C6438B5DC78654F7A1EAB8843AFC627489C5E859BCE554E254B62A0DCA8EA14AC9004EC2819E8E61EB7EA10FDC4FF1953692922AC864D449E6AC015B082762142BE2FB35B2718D5C6594FAC4087BF7EDA53A3A4A368C18ACDB4C788D5473EDD4334D0AED384191D6689CB9C553DCBB61219BD62E570717C775293B3986DD069EDCF202A74F9FE3DA4B57E3872582E2289BAEBB9603E70678E5B51DCCEEEA242A4D70EBF557B2A4A70DDB0AA9B83E4ED6E3E89980A79E7996AB366D605677878AFCBFF8E22175E25934A719BB5AC40FEA46AD0F8BB3C598DE8998DD67AB3CFAE4B3B4371558B27821E54A95DDFB8F52298E73FDEAD9AC9BDBC28A396D2C9A3BDB0CAFD8592A81C750DCC013AF1DE2EB8F6E653CF23468BAF5807C58A3A176941BD775F16F7EF59754B94FE445E51ED642C1F00D42548DCC8A950D5B4C0E4463CC76C5115D14FF6C63C2EB8454ED3C23B51CBB761DA4F7D809562F9FC3FC05B3A9B88D6C797937FB0EF7B269D306962D6CD1516E312168CE66123551C99E6526416B52A33B963245270D954DD5954EEF4EAE9A1988E3AD1FA09FCD006D52C9D812EEAFC930354067BD0B76665921C6F9DBC87E5AC441152B2E11165F66E86BBF428B354CA06C8E40C572D24C2ED0409594F849C0571DE3484A37471B4AF2FB45DB567E83EB78D4A30C65A78B626E396D2BEEA46DE3DD6089C0BF6FB05F8510CCA4E179B4E3E9B7473185692C06D3BD4BE00503B5887A987C984CA689CD92644DC3D580BD0315FEFEF1D779E98D835C7EE9E5DC79E37A1A0871C3B26E402532942D8FB205E7C62C4E0F15393E384ADDCD26929012148CA6B44C271ACB2DC9040D8E9FE4D309EB621A9A78D145F44E41DBE0EBA6144E5DC01309D9490D14C310C951A5109659D2D1CCD953C7D8B6FD058A62925B7318B30B04F976EA6E9ED0C928F49409C6698FC7B86D410377AFEAA6392B10491DC771955F5CB67C05C204461246830C8C44E5127E36A33A13F97C56E978D938A42D674C52AB991C7B4B19EEFFF18B3CFFFA510DBCA26FA1AC059137AD0A793122E7862CF0CBFC9B8F6CC617EA5E546722CEB0B77780932375662D58CA91E327E8EB3BABFAD5EBD6AC62C1AC0E464F1E6056A3CB8AB99D789EA7D202434E07FFF0D88B3CBBF30413E419AF06C4225FE8C4B8B5906C50638EDDC7C76FDDC01DD75FA66606A1536078AC482E97A32913105746A8D54C55580B8D3FA15867C96625EE3422DD2A8DD9E1D0E3C9ED87786CEB61EAE24758AED0D868518B4699DDD3CDE69B6EA0ABB591A66CC4D5EBE7D299CFD3EA27309E168892D868DB32811EA707E8C450597B3217E959CC04E89FB7006DA2586C9BA93379C0458B4307552E0C7648B75B02A297465BF38EE018A7BFF24BE4CB077165A4431A8022C328A57D6CE908AB52BEA409A9C2FE221D29A59B9127D514C1AAEA48B7E082A2C4E63AAE4EC095AC0ECE05F359F76BFF15322BC06E98DC2404F15079CD8B98B64ECEC1BEC958D3089DEBEF95FC3D25518863B53C68327423E6020E1C2CC36FFCBF5FE6E84095F52B16F1B1BB6EA4332792EB35222F4F39F2A9850E6E4EB0CC98570F8F7062B4C2784DCA5C9369598EA70FAD6C2AC2FC90586D8A9694129710ED2633F9770AC66F7E7D6A22D198F50A5422015BC691CDDDB5353313ECB92118675E93CFDA05B3D8B5E3359E7CF659C62A3113359F6AA69DB8A153843D4D5F8088C66882FCF829BEF0CBB7B390614281717C0FC7F5955E297A7FAE86923A76A1013B9357B7491512727CE5268BA29EFCEEE67C8E9AED319C69E08F1FDBC5035B0E52B31AA9267D014714F2C57E4A0739EAC46199F9E5E3FCD5E76E21EB0408FD53608E2A1E077BCFE9A8FA9C25AB54E0DF756C864E1F63F0F4515AB3361B562DA529E711EAD45E9603A506FEE4BE27383C6251F79BD5E547EE501807F8514CA65E636D5B95DFFAE49DCCE96AC0C91638D65FE32BDFF816ED1D1DAC9F93E7F2255D3467E48C456CCB25F6F2C44E96308898181BA3C1A952AFD718753A78FAF5D33CF8D45E4A65B9362175C6B0BD0AB7DD7805776FBE06B73CC8DCB60C97AD984F932FBADC2A3693CC3C2526C7D3F289F4AEC762CE6C0CE512B82EAD809377CC04E89FA7006D68629A6B696669C673B39E3478D2B1EA69295D2A71A812A5690351B2D97384BBBECEA917BE4173FDB8283E1BB19E304EBC0E45CB2269A8D9C6F5C391C94509D2320E9EC2218243DBAE12F3951AE6D8D4C5FDD869259E7B0B4D37FC166ED33CB3926D51DB4B33E8B772D14C46645305B0245B36C1DB78210A63C1178532C5168C68875C0FC9E48BD87CE947AFF2BF1F799DD16A9DE58B7BF8FCC76FA7D989A9D5451A526435054208B14405CE6B60A00E47072B9C1A9E60AC54D132592C8C02C96C6D69DAA5A0512A529506E864047DCA8BF65D476A83E08B60956D9AAE92494B55209C660BD549F16D1B3BA832CBAE72F9A276DA0B595E7CF1659EDEF21C4315915FCDE234F7507304EF37B254715CA7291AA7B574962F7CE61E0A637D94F34DEC3BDD4FEFC9B3AC5A3887353DAD747A214DD4A83A11A21890B16C5CDBC3F67C5C378BA755451DD71361239F41A7C07FFCC12E1E7EE1389ED7425D849A62913A3574409D6A0D4543BC4EF7D02EFEF673EF23572850956948D90C1452F2192E87EC3A7C8A52A9A2EBADA3E0A88468775B23B17AFB09B466868646DC6E1E79F918FFB865AF9EAB24040239C9E8B51B85D895712EEDF1F8D58FDC4ACFEC76761E38C1B79F78950327FA182F1559E48E73CDC2167EF3331F250C03CE0539B6ED3EC681D383548B326E12F28BB75DAA92A8459AD8B677807F78EC75758971AC2A4DED19AEBE7603375EB68A462A2CEE6860D982761AB36087D2B5704D7B440AAFB4EA3BBF336EA0C024409B0D5EAAD064EDA7EF9D09D03F4F013AED3C48804E071DAC2440273CE8E9FA17E922D02C504258A2015D1B25E62C83CF7D15BBF7C7D8138771E312AE8E6C9B86992A7629F753325889D1325A2EC9AF28DE099BC30CB0C82A15BEB562D8AABBE011D42CC6338B097AAEA763FD4D381D4BC8342D044C309974C49ABEA0130C560661E417AACA85893A93AC8934B99E74EBD2C59D4C422A7DCE611887EFBE729AEF3FBD8DA16AC8ECEE59AC5C369FC6C606DA9A1A69F12D3271055784E69D3C25274BD5B31929470C0C8D3351AC50AA1A7538E17BEBF3A4E76A1A3DDAA24D0E4985E9D38C5E31568CF3EE00002000494441544F43E19B54124A655D936F690F41AE6D327529D5806934CA54A8D02165F333EED52A881506CC6BF05935AF5BDD399E7E6E1B8F3DBB8DA11A54BD46326D732847421F4CA6D6EC987C58225BECE743D76DA22BE3706CB4C8CEA327E9EF1FA6AD9061794F2B372D9FC5BA66686CC92AE127721A1829878CD5E5D664F4DECBC4E9B2B94D34B82EA58CCBFFF7F87E1E7CFE14512C729B725D04CC15B98A08B7162BBE2BBEDE6BFD21FED3FBD761E71B29D663727189BC634015D1EB26D3A0F8B37C35F9522588196EACD9ED68DD65AC22EBCBC66AEC6157EF080F3DB39313831342753178BFD8B249C516D56808475835BF93458B17F0D2CEBD1C1BA850C7C7757C5A8A2758DF0E5FF8E79FA25E0FD976749C6FFC700BC7FB27C8B8365E54E1FDD7AEE68A358BB1724DEC3C7486275FDC8D63C52C9ED7CEA64D6B59BA78168D5685851D4D2CE86A262FC72BAD51D5741676BA599A9A2C4CA7D49D57C91A5D1AF9D2C1B2C91ED24C06FD8E19CDCF1A069DAC07B333278D2B090B9904839E7C213DF314D3D500614C62B5D49234512240ED30E5DDF731F2E2D76888FBB4FB6E181CB1AABFC908B5490E0CD3C1C8CC4996274D11491F8CB79AA1F7C90620714C865F7C7D186B6418F5679159B199D91B3F8E9D5F0656C1947A9226491A95F6346DC928253C8B6EAF519936FE7D17DCC68BE2D4661C5CBA7D226A53B16D864378EDD4287FF4E54739D8374C365F60F3F557B071C53C3AF30E39026AB1AB7C5DA5BCC509075C610D5739B3220E67361DA3BB61360CC3DED06EBC69951A7537D12A111F3EE58D4B5355D82AC948B966C5E667EDBA1171371B51FABC4E6BEC26AA7B86AE25D99A70A40D0EFEE0A34FF2C8D65D94AC1C7E730756B699AA060AE90B18884339D3823987A2012EC764A01A09BACA9E8942DA47F6F3CFDFB79C6B2F5BAB6A73474A3E0FBFF0067BCF8C3251B5182FD5E808CFF1AF3F7517D7AC580805F86F4FECE75B5B8E2BE758400083D15BD861881BE877A8C5115DE5D3FCF6AD6BC9347772E4541FCDC120972DEEA6C191C01612B91933C821C7A3B8B0D0E30A0CD47D76F48EA9F29EE537D0DA39876DAFEE64BC66AB79AB6C86DA9ED6C4C474E12448CB28BC910240A5001CB258759BC6F02C4B9A03BEF0EB9F54A5BEAF3CBE93275FDA4F449ED8AA624725B24199D99D4DCC5B3C8720AAD1DDD9A5D0D8AC962C0D6E484F5B9E799D8DB43766B44D3E2910AB104F224FF74E149E8B64D5E7ADE8990CFAE7278336673295169B9EB068714893D0372FBFC58249B9B5B292350B14E2683C44B9F729867EF2A73454DE50794B1114F224168722C96F7E5FA22D97743E8C029CE1428B238BB047CC71489036C1CB0839099450715BA9342C24BBF466F2ABEEC46DBD04EC4673983A1092344E3403958D23E5475F4C272E3DB90BB756D33834BB96D11A9E88602C8A79E9C8902A9EBDB8FB28D508E6CF9BCBF285735932B7939ECE46354315FC544182C4D44082990A44E967992D4AB2363D4FAD46049A301E90C6CEC8541AA10093718C6F65D4C5C368114B5809A92B7345A000D3CC154DE3F46625717F6AF04C8291300E5477D838D74880FEFA433FE2C7AF1E262AB4E337B412D859025B02B409184697DB1CA72AE9697A3FB55E0CF3C665D6D8213EBF690ED76FBC4C45A51E3B3AC2B79EDBC9B99A8DE5E6F477B631CCE2E6888FDD7C1DB3E674F2E5E70FF193D77B55533946FA1D72EF257336D65672B7EAB1A3BA146B9A22F01B39D73FC8DCF82C775E329F0D8BBAF43D812BEE2B963ACA78A1406B316376232F1E1DE1C1978F7376BC62AA16DB343363F13894DE85E8A8A474E2747C5FCE35BD07DAA8934D56CC75659A7294AE5C8DF75F7B89E2EF4FEDEE63F7D173D8B60F7199281CA140487B5386F56B1673C5A5ABE8E96CC58FABCC6EC9B3A0334F47639E9C97E89A9F37157A9166DF3BA6836FF18699003D13A027AF802CF024C6E9631B96884AC7187FED6B54F63F84571B226B093E6B8C4875196AE637A578A74F6F22FAAF0FAA0C2EE883641A8792A9A7832E32E91845B68112B2DD443D57D179FDE7710B0B8855A7573AE1468CE94DA5DF85B72D4DA5A78916E9394C36EB4C4D21196CDA2C9710588AA06FACCAF6C3E7B8FFB1EDEC3A760E3F9BA7A7BB83DB6EB8849EB6661A73596D6819D90FC3B0086468417728393E034198BC59A2C5541335ED0AD89664ACE314A2320D4199A2D5C2B8DB9EF8CD887E891C9BA3558A5CDB644C50CF322D81D3409D9E960459391F09D46118F2A5FB1EE485FDA7701B3BB1FD82EA5EABCD973435B541959A101898283D621D7AB12385AEE2C8A36BE224BFB8AE9B5B37DFCCD989325FDDB687178E0F1048134D2A8028226B15F1C23116343793CF3772683462AC261582F4243CE2C031FC70AD3CEA1A3CEB764E35ADFDCAA8B277C4817C41748A1B96B4F2BE4B57E17859FA4B0E478E1E5771A605ED5916CCED5236CA4FF69EE53BAF9D6242B371D3DC9673976A463716A5443AA623AC8139363206B29169E8176A644818CA7BB32643A64CB35DD36C7D30F49990E30F420AB99839DD05D62C9AC3CA05DDCCEF6EA6B5E09371A0BD29C79239AD34666D9DD6F59CD4CC627A72308DC7FF4E19F43B05EE99003D13A02733EB0427D3C7571FAE1022A1DD1DA27EEC698AAF3D80377650FDDA5C897EA29226D8B590472331A595ACD194EED24A93D25A82B41121920C464A5679784C1B4C0347249C580942792A760774AF236A5F43C725B743EB52A5E2C59A85273E409AF525637DD345FE13C53DF33C4C5901985CC664B94A254C02B63CB822F42F5998CA948670FCEC107DA345062A31BB8F0CB3EDD51D5462072FD78CEBE7686F6BA1B3B395B6D606BABA5A71C51057F7A3445B3A755357B68B997794C024479B8BC6E9AC1DA3BBB89BF6A1EDEC772FE7F4FC7BA90A773716A94A73CCAE15100412E493694FF91CC5CFCD99A9F48864F2A95092EB69062D23EC4F3DFB0C63C5228E5FD0D175C95BEB8287EA670B9DC560BD72D0FA39938E2F729055858E8832F8C573CCCF0734B4B6321EC1D1B198F164A254AFA68C2A8B225B54C3B5A5FD1B5389655C46A089645235F24D634F297C81EA72D7E38C327AB4BD2C0135A8D2581BA2C30B98D5D248BEA185A162C899BE73BAFE648AAFB3BD49ADB2849F7EB26C539173903523ACA07A224790DE5E6D8A48159364CE1AA0536AA69CB7307B32D4A49742A09A1EDD8D59DA9AF2CC5E308F593DB3556DCEB76B3465E5B50C3D2D0566356769C9BB4ADD14E38BAC2B4DD3444E762A0B48AA91E91C9CB7AE58DF292E4FBE3E13A06702F4B427DF0C63A438AE49A38D9E72ED0CF5D7BECAF8AE6F13977BC958813A434829AED9B150F524486BBE6202B496F63A5167862C14E650B7106181C82362A9B1AB27C1B52A5DFE2C229F3F91ED61A2E5121A576CA673DD2DE0B44A88335D7CF90DB22924138C939B4BD22A4FA568CEC3A627B9D2698493A82A412B71EE48B05E850A1C8B3270AE1CB0EDC008AF1E3ACDEB074E73E4543F956A45F592C5BD5A047D148797E0A99975AA39A73E2A38EA1D6802ABD82DB5944F707DD3293677F5B3CEDDCF735CCBFF3AB28A73712B55274FA01C725546569E7524FCF0C99333C76DC027D3F8F43D8F58F0678159346B84EBAFB9820D2BE669C0D6C6A058389984DE084125E5BE0449D3E04DA49FF4DED4938C5374D96A1096A93B2288251C765122144959B9A706DEB142D38CABCA4094A01972FCBA89460475813684F1617A1BA1AA1C4AB62F2C0C87BAF42E821A9E1DE3C9845EBD9A003036A56AA44A76EA3E1E0B354F9A82D27F1039D9742394BDC65C77B58DA80549A35660EC848D24554852889873371095BC5AACD7705D8B96E6020B449F24EB50F0E59A9AE9568F3A3DED8DB4E73CDAF22E59C7C2B34D50D6F440EDAC8CE38B6C945350D1547036473613A0DFF546F4D3BCF167B149F8D362D0E9139C860123C41312BB3206EE405D64490F70F87B7F4061780B0DD12876553226DF3C0769AAA22EE066CC5BE9183A1E6EC2A666B35292EBC3AC73AFD4C340E951221E13C8649CEF52893D4A512361CB4AE65DFF4BD0731DB13F4FD5F0A4D9A5FE81170ACBA4A5E4C59A866F7A5ACC9DD5ECD73C712ADB6939428D92A69379B685432D23DF83C598ED7B4FB2ED8DFD1C3AD5CFD9E1716AD550F9B2521E1B1A8B49E38C5AA90458A3E7E151A1B17282D5CE613E36F72CABF3FD3447431CCB5DC18FC756F2E3BE067AEDD9D88E8727CC0CF94CCFD7EC579A767ACD92B16E6D8D5A31BE23EED301BE64CF6140C6CF1005011FB8FD26D62CE8D2CC553620A13826C9A599229D34034EE77D0CE4A3024CDAC495CC56208050EFBD402E3231E948A33110CA5C48206A85B20139191CC723B46A3AD421B43281A284AED890CF49424EA52ED4B7983819274FFAC4849A824BE5603259E9458848BFE871ABAAA06EC2E24958C355268C0C20C9FD3012B8A92BBC49060C7346362999304C7551746BD4359C346CA358AB3E1DD956790113FCA5C9EA47759A9C2A39DF239B6FA0B990A3B3D1D504448A4303E12BD86F168D40298A3D49533CBDFFA623935EEF9900FDD344DCF7F833FFA402749A6E240328EAA0218A4BF2544940D587BE9FBED7BFCDC48187C88F1EA2A93EAE9C535D94B650C00CE55E522AE3F82D11306D7619F6422A1493668232982299A6B233D40D39D4A19658865A68A1E4CFA5B0F8065AD6DE0C4DDD386E13F86D60E515EB34C3EBC99D4AB2440367244D308557A6206C99FC93075E9E2D794E0D2E9B02EF261098C0280FB80C59484090610A8B09602C84FE71284E481033F86FCA99918C5A6858E2DD68DB55DC6018AFD2476EEC00D5FD8F326B702B0DF5733A4C31E6CE6730B79ADAF2DBF156DE46352B565105FC64363C951891259BAEC3645E053182319B5D32299F906E9A7290133F04418EA67AA2931E8E467D6F6A0E286DAAE9069BEC79A9D1B8C4A0244E9B4C50664E9201CA40C59B8C80944C8B2A2345AE45B2A10435F56430D75D7C21928C5DC39AA8298AE7A5E518B9DA046F97630B4281C1E4DE987B94744027A103F19654D7EDA4F12ACA8C3AC5999C98E0F092DD1AD64D122CD57CD794104245D454C1C6F4140868C835A8CD57AB13ABB185343965D97AB236D2A5EBC81592F59F365D121BA15447665A237B7AD27C1EFAF11E63CF0CC4F12E2ED83FA900AD4E2B929F980C46C2AE665DB226356591055A026B04EAE738F5E817C91E7F8A6CD0A7C47D1DA6B05DEA711D9920D3874C1A34899F9E795A25A026C60149B34DB34E09D09AAA48A26282AE8E503B596A5146C5D1859247B693E6851B8997DF4CA675094EBE9B98BCBEAEBC6FFD7403A324CEB49A112766E6536B3EF9DBE4FD4D980D6926ACE1795A962EE766E01A237873A104BF5A8B292B3032BA16F57304C543948E6DA5EFC5EF938D47C946E3E4A371851264AA91A8401C3732E2B612CFD948C735BF8EDFB90E3B34A5F42423616AEF99EC77A64A7AD34FC864926FAA2BF42D93DFBFA0BA489B8E06FA480095291AF724762F9BAE500A4D3229938641D26FB0547F3CE90898F562482BC94E90A20C534D33C59E553AD5FCD1775EF0A05DA43EBA389DF222CFF054AD6602F4855A28E925480411CC8A8FD16C590E43E98EC9791A5E72B2134E7168DEE22A4F5B54FFA78DC1E9E7358341BF75A4FE2715A0D3E22C998C134ADB6409A9E988E08FF2880AFE1B108FEC62E2B9BFA47EF4697C19FFD06937295B6B584E92554D3207D2713A19AB15FC3999B6D3A7539E0C2D5C93469EA1840935CC96EC5A9C9D55DB43446EB254FD4EC6FCD9B42EDC48CBDA1B705A9711FB9D44564EBDFA4CDC4F44A364245D82A750BF042698D4CC4842C864966DD680C97892D453FF9D3CAD09862BA316BA89A9DB89E9A49ACD40AE4915E251281D63E2C0B3548E6F2738B393A6701051FD334A0C468EB526823E1288438BD0F519F0E690BBF65FD1B9F6C35871A3895CE9E0E785CBF34D69590AAFA46FBCE8AA4DAE6D9ADF4DE6E4D310B134853617C204CD8495926CDA6613943B234D613384945A43EAF59B8C88DA019CBAA8CA9D4F7E679AAECBBD4930DDC90A265D0FE79D731AEE1337FA0BC3E3F460981E80FE88D996A6D547E9B6910C1419FB37990A95AACE4D761913A0E5BCE51505D1DF1C902F7689CF0BCAE93FDEEA5EBC75CC79D32B33017A26404FAE5C59579381C13CB0CA39D55AB7960C3298715AC2D3D47A9FA0EFB1BF241F9D24135694272D429D9A6B4DEB9098093B33D0A28FB73EE826733142F7268B36A232267717F687F988C4BC36814E624B5A380E15A7955CCF3A987D29D959EBC8762E874CBBD2B7E250B279C35ED0869923831A4E5209240F6FFA10278A739318799A085DF8E0CB7109561A491B53CE31E58B4B40AF42F924D5FED7A99FDAC6C89E2D14C2513241093F168EB3345E43DCD46457862544C7594B7D8B31BF8BDA8A8FD27DC52F93292C13AFEE4486F582E030994D1B96828979E6CAA6308B424C69B03C6F699F77426F5AF486079F6C383A669E86B7A422D12A626AC39A1C209A16832603B464D5C97D3459F5B49F9BB60F4B562ED7C038EC5C7807D2CDC47CDF70CB4D9594A0BEE61CDE141813BCE7CDEFBC20194E02B4C22312A04D73DC68B9C8662A3C7F336CA5D7F46D62EDF97B667A40E73D4CEF21225FF0D699003D13A0A7AFF3A97568169A6174248A5B6A262B89A3809C25C2F231268E3E47786A1BF5135BC806E7C80435E5B7CA03256C07D1549652D1A8B219D9C5C036743C6101185BAEC40F5002B46813A88A9B642F622C6AA2BB301B4CD22A58674C35F2099C16AA4E2B5E730F99B6B9047E13816850645A695FBC015AE78260D6B6082488DD966FE86B9343053AF130B9114D7FD8D3FD450771D56C57E4282B108D43A59FF8D43E26068E1354C6F5FB4E6D88DAC061E2E249BCFA185911EF114D08F13EB7A5729081868A6E3D6688C552E1A14A6451F31A2966E6E0CCBD9AC6059B292CBB1ABC4EA529A65F536339E6BE4C86EE0BE2EE241E7F5EDEF71619DDB49F9D9A304EEEFBB4C7C2E86E4F01F9E95FD310745E804A24BA13D3343D4EB1839ADA5092B89AC87DEAD54FEF87FEEAE99170EA075583636A6C69EABABC094E78D30531EF4D2F58BA9725959BF1F014468AD944A618E2E9394BA1F056DA3069D575610C99C9A07FFA1DE93DFCE44537CD64A34F6E812498959A282AAAD4D97BF8F0B77FAB3534567BD3D27B779F9E1E44CA727D779384A90ADC248638094A4E8588C9A4CD881EC8F02ED40709477633BEEB9B84277E823F314046B8AE8E4FB55E51369B04617D0E2C99248C35A3D4B16351528B245889425CEA2C6578248E8C540BADCBA8F59AEEBC63F498E5A7C5AC56C6C6CDF49BE0CC1248457B2F4BDD6EC16E594ADCB490BCE87CB4CE26D3D6038DDDAAF5A0399892760D24A2C127319C4D08E04A79535847BAFD92314F0C513B7B8C68F83895B37B61603F71E9A46A94D891C8B4CA079A6B2E8D42849192C0458164F58AEE4BABD18C1D9B6C33229060ED7ACA512ED91D149B37D073C3AFE22DBA436640CD2699342ED33B3199415E6C855CB8069386DA4517E7853FAF90AB193A9ADC9D27C544A6B255BD64CA5034D200931AE4E6878C1142F238C8B14A8F6DF233271D61CC77DE34AAFF768BFC1DA1858BFCF0F45839BDD848DEAAAEF57A1CD33C02D3E53DFD825FECB8D2CF9BFEDAC5BEF7EE1EDC8BBF6B26837EEBABF74F29402B9759C2880083FA009ACCC27C3B5191132C572163993C138A5C0D4F9EBE6884686C27E77EF2B77827B7E2D707C8FAAEE1BB26D8AF794825904A062D942DC99E93A106C5288D6CA8C9C66494D9568D62853D62F1E650F29536FD15A215FA97D0C834A59709B6BA360463D1DAA80BBCD14C20C23E5E0396278D469FD86F26D3329B4CEB1CF22DDDD0D4656810CA2448E80DF2EFA0021383D4FA7B290D9FA1561AC6AE15718271E2EA38BEC8930665CDF085B1219395AACA9694CBA2F427722632D8203B8130524C88321C5DE39861A9BA9F9C6B1018BDEDC0C9528C9B18EDB88D651FFB0BB0F39338AA5E97B74B00DE32304C6EAB6FBDD0F578CC3D1618C164B5D3E08314F64A7DBF260F246DC125D9B5463A9383CA999AC0F7E6CF124D15554B4EBB84C9B94DFF95E9BE703E7C901E679ABB9F7F4A6F97D1984B37CDE0E1BCC03DEDFB9384D0F4F0E47EBDCBCCEBA7D940DE2978CF04E899006D521993A96AE746026112A0A794B88C76840C2908CB40034F9A6F0914110E32F2CAF719DDF96DF2F563F8E1B00E1A28EA2C19B54E78893C674CE808CBD72C7CC9C192D0ABA5AEE9AEEBA8876193A8ED941167B20323BD19BB66B4D98C384BD32ED6C66420729C5252BB19C29AF0622500CA3047127C646ACF6B568FBE4A940509DEC2341159CC04079572D651CD862A99A8841716F1E30A8E6E128196BB41281B8DABC24BB65CA038D009404345B4A9D6C1CB37A9ABB60C6BE830CB34B70CB16452A14DE119CBDF444829D1BA93ACBB375ECD92CFFC0D64E7832B94C28B68645F100CB408F8296B2EC34933C72E660CBA0226A180691317FA1EB9F7C986A3B17F1A2F505F9BCE9B989695A6C7A67B925C6F69324E7BF612C2443A31395D6965EA6353EA64BA7998CD47CF7D1ACB626AEE32FDFC641C3BC5B9CF9B409DFEFCA7D7C19DD4153795DE7436C7D467BE23307DD1FB91EC5893C7F00EC17F2640CF046813A093D574A1DCE1050FD19B739624AB1638201A85A88FF88D47E97BED3B78C5E3E4E3091D44D0115C1938880235B1D5C938A5121B4F36E5142B1462F4956583108EADFC5F6183487485A5E30EA1E0D4895A9E391E616A2470887E9616D693142983239B0D42E5E825B8A6365D099D3015354A1E79C3565071249977943FD3B34513A04C83D33050265F4FC7D8354794801610D902EDC8618A6636EAD22D23D5C459A2C46CD738C984F84ECC388D8C387329ACF9241D57FE0A96D7442C9AC991814DB41C4FB48665833189A1617E988DC6F40D626D908AE1EB54734D191A89E894305C648B3065914C844AFB53BF83A35585094C6609C8F54B2609718D95645A79C8CBA28A279B659A7A2BD15CB07733EEAECA7D6916ABBA2C327492C477BDE8295F5D3675D3809596B37EB4566D893183347ED5B74F7E48920AB9A7B2B612D2B2B04B54CC4A289E9AC327D899BC6772EA443F57644C65A250C7F1A561299F2CA6838E388E5BBA3E85CF3D997D27709B3911CFC8EE2695475A21998DCE53CD12BD7C09B17CCAC52D315FD693970A716A9D9ACB7301DE3D13A06702F43B55596FF7FA6475AC014882C38406E9E8EC768EFDF08B146ABDE4E371D5D7553538A5BE0923246D0EA6943C23589E96938229EB1FA3BCAFD387D269D75F23C12461E44EB218920AC094C4498036A13BB1BB371A2017D3C07BA7F337014D7731A36F9D6C62530F6EB2C9A4E5B1BE6E8E55BE420DD09ADBAB4E8484412B9400ED6B5334928C5D54E764AA32AE2B150FBFC08077396D977F8686D5771067DA35C018112045E1938A2709C8CA5A4932C01463D78B25415ABC1F6514DF3CFCB249DA8E4CDD25965A49262C415E8C0864B28EA86C02702A26A2A5800DA28FED38268796189C6C5C72CC93088754243226AE55438CABCD55F963B432F473E5CD320DE3366AB0D31E84543BB609B4B6B2AD93A9C264A8482610D361181D5594E3B473C412B475A3946AC8D4607A9E3A58E34C72B3353B5791AF44EE55D7A2D97C6CB1888B45F0BA0E6E3315CBD6A1A1B4B9691AA54905A1FF4FE475E56774A826BD27F25A5ECD1C84A522975F5DD975F948735DAE4D0AA9987562B64059E7A69A3C2FA79E09D03301FA9D02D4DBBE9EEA3CA458B57A399789A361FA773C4AD4FF0AB9C15DD84307F1243049D00DCB3ADA2CB952CAEB4B9D8CCD645F92596B704D9F121378150631A9B766C353656682236BD34A326DA35B6D449A8CA4E7A474E97B3CE1A922C264641736C58C7ADF8560AB313190AC5982735A2988E4A5BAA147AE916E15B8467490932CD2B88288F851CC84D54DBDF5725AAFF90D0A4B6E30AE37519D33878F60D7CBD8C29851CD93507B069A454BF0096C3C91349520665B549D020DEDB3696EEB566EF964045023D324C38DA15A1C6764B01F6BEC2C3E6358B29196C5EDBD46546821F05B08326D8CB9393A3BBB686D1488C8041FA94A9282C24C2EDA31FD83831487CFD1543F8D5B1FD5E38A2A751D1B77A48DD890A79E9B4BE83653C5A5A1A585B68E46ED2DA8C646A2FB212C10F96C11B5AA0C0D52EA3F81532FAA5E74E016085C63BDA552A95D732814723A0DA3AE3FB23F256B4AADC3922F75AC0902868606288D9E25138CE0085D9288AAD3C184D348DE2F30AB6716B667A46305A61338EBCCA17D589A7048EFA16AEE7DE2746F36E4266A4E8EAAEBE0657274B7B593CDC84632B502B5759226CF2A2026F7D168694FF60034A86B7D90EE39532B378689127CF92B07F997FFE2EFF1DDC37CF52BBFC93D1FD9849B8A86BCC775FE33F7F68BA243C962491EDA9F1B16C74F7B7394FEA462F58229A717C7704C6114EABD04BDDB187BED61ACB36F9089C720AC9A0C2B89144AC37BD3012420A806D7B4C84E9C41A63C2892009D02A6F221C938B904C734331171A5A479F5539DA7664753476882F179CFCAB44ED814786BD4FD4420C86C1066C3309BCF64E19CCAB62A3E61049C64C45C12E231AB8BB1EC2AF2977E9E39977F486DC3ECDA20CFFFCD1FE216C7F0C4D854AA09857C448C48CEDE250C2C7C27AB0A7575CBE64C660EFEFC4B58B4E11AE62F984BCE77CC88B47A4B4A221A307CF238E7F6BFC6E0E1D7B1C74ED12CD05458C591AC5D4C55F1283A7926FC7686DC0E66AFB88C6B6EFB85C4255E02BD0986F2C78B630EBCB295E1A3BB99E8DD4347D0473E2AA9307EA87D074703B8542665E907B8CD2ABFEACF5DC125777E8066F1244C60079DD04C1AC362E8BBF7C70F51DFF103FC7A15378A28391E55D9ECED2C634E17CDAB6EE4C69BAF53512B6340606A2DE3986D829D161558944787D9F9D83F50ECDD45BE3E4E46583676C498DD463F9D54BA37B0FCAA9B59B9B89BBCF8D14A03A63EC8737FF19F702D494284E72E558F28B618084BFED4EC0C153B4B29D384D53C9B96F96B98BB6C355D3DB3D46BD1309ACC1F53F1199D6E1592128BB0B4073013A0DFFE719D09D0EF1CCE4C692A4D3CC1EF64E5250D2D95F39472B20C611FE5034F31FEEA0358C3FBF1296BE661534B04E453A0C2ACDA94CB9B62BB290F5732667DC012F1A564759B87637AB32A09D2062E3183EB6608E69DCFE7CDEF98066B24165A9AAD4E6E1BC99336F98309BD51190F26B08B01ABE135C8B512FC5B200703BD44822BABF0BEB0495C6CCB579D8AAAED30915B46E38ABBC8AFFC08D9B61504768CD3B783935FFD026E6542F71F191B0F957E684069D512142B2ED1C4F72C4AB1CBB1FC4A8EDB7389DA9771DB6D37B2B0ABA01B80413622068F1FE2E0B33FC43EBB974DF0DC380000200049444154964A2F46AA49365D61A6887C86D1B796EB57B5F394FD168EF94B5879C7AFB062F9020DF62A1A95A017F1E0099EF8EAFF60767886E670C094ED225624E25B09461F2AE326261B96F41A4D58EDF4E616535F7F2B576CBC96CE9646830F28722044478B91C0E28DFBFE882527BE8FA7BC50979A48BE26CE3427334BD899DDC8473EFD695A5A0BFA3B8DFC6972B7E47FA9B85114533C7D8CBDDFF802EDB5D38ABC3B5105971255B78D7E67362F35DEC470FB6AEEDA389F0D4B7BF4F338F32AE7BEFA1FA986E388D3A60849999E89AC310F2BCA68735C36E48ADBC0B0D3C699CC22ECD9CBD878D366BABABB1529490B1913A0CDCEA6425D8A85274DDA99003D13A07F9A9035FD674CB014EC2FE974DBA2416CB03A91C21446AC0C72C4A5B3D407F652DCF32413C7B75108CF900B87148F4DA70965BC7C6AA2CD388B1802461A10251B5500608A039634A50C94717E232F1D904945204D809EDEF57C37672FE7659A93EAAB98FE9EC9D233C511CFC7A68DED523A25997055B4E126A8AD313FD5CCDA16317B2565635905C27A9E31BF9B62FB32E65EFE2172B3376165E782952594FED789ED8C7CFDDFE3D4C614221AF4DB18759BA95939633D26413071E0964CBC66799CCB2FE154D4C1B8DBCAFBAEB994EBD6CED55948C962B3A57ECE6C7B84BEED8FD31C0C910F47A9B8A211D24E2D16B53A39564184433261916C5CC10F4AEC6C7E1F473A6EE0EA4B1772E9EAF9BA31B8618DD2A9C31CDFF2109CD84E637D108F90B3DE1C8A76A3D9AED4045706936450A9C2ECCA710AE13855B791B35E0F87BD85342D58C3C6CD77D1D2D232D9629090D7371673ECA13F61E5896FE34ADFD9CA30E61474913405239CC92C6047C355E4662FE7B6BBDF4F2663B4C9255BD6DE712AAC245047B548E9E41E0EDFF707344772CEAD78518942388058C68EE416F0747E33C7BC85DCB9B68DDBAFBDC42C9D234F31FECD2F50AB97A9B939465C311468506956B9A95E04B9B044212A92894BDAAC1CF53A39E9CFC35B772B9B6EB8917C2E97341F93B5A8FB47D2543CAF569B8138DE095E7DF3EB3310C705D764BA8646E2BDA7E59AC924D52F36EDB18565A2924CDFEDC37AE37146F63C4B86716CCDA82B09934016AB8073BE323752B53933866B3AFD064A99F695083DE998F8B4206D94F34CE05464F73C72EFBB09CE9AC218EC5B25550D7463208B041B4CC681277F574288D16D24DDB3341B35C310AAD6A67086690CC5764D098B75BB914AD48295994FEB863B60D52D640A8BC16E494C480D06EB1E9700FD7B38B561F5563C9C5941AFB7506DA10466900D4FF8E7919B55D6076E8651AB95B25D003FC7E66B3670EDEAD97A1C13A3831C7FE4CB34F5BD4666FCA4B6E5EAB14B5F7601C7DD854C441902276306EFA31AB97082598CD0553BCDCB4DB7F04AEE2AE6168ADC76D552562D9EC781E71FA7F8C653348E1CA4A372D2588B39CDECC95D429F338B509BC046504AADD8A212CB6BFBE909FBF47797EC02436E17673273A974ADE1031FF9185E567EBF39F7D3C321271EFAEFAC38F1104E18125819FAFC1EDD407A6AC719F63AD893BF847E6F3E4ED7723EF6D11B54945F687266344A7A74B11A2D84C5B3ECB8EF2F6938FB2A4E5CE78CDD43362E32273E49297219C9CEE3E986DB38EA2CE017563573C7F59718D5BC233F66F49BBF0FF580A2D5C8C1DC6A4EBA3D4C38E20014918DAA14C20ACDE1080B6B07680FFB09EC0CA7724BD9DD7005B5A6392C5EB9961B36AED271F27440EAFCBEC6F4B53D8341BFE5933A0371BC8B20A6BBBF31784DE9A22AA8A445A93C16AE611D4C72AA64C0631C6A4304A7F733BCFD3EA2A1EDE4A3B3F862F26915A80532C421596BA00D41B57612C562499BE2980C2E513DC215FD60FD5C697449674A82A2046909A4866E270D43310830A3E6D3B1EA77716E936F31D4BF542BC40CD598E0AD0D490DD2A68169D88A6673922941E50C084E2CE6A94E4179E4A125A5B19936940C2BF41A198EE7E3CCDE44F7B5F7E2B52F03BFC36872086D2C618A49F9EB1D7F99C1AFFF2E6EE90C91EFF36AEE0676653630E0362934220C0CCDD0ED1C81588A89ACA764CB56A0C6ACBF7CF70D2C9BD54C1C84ECDCBA8D78FBD79955DCA70DB2A2D7C269A7874399951CF05728EE2CB5B868098A96BDB04C5AEA43CCB786389059C3416B11B3BC416EBFBC87B90D31A79F7D90EED35B68090668884B9CB3DA389D5BC28B85EB39E6CC27B47D726199A67814D7F570C2324B6AFB995F3EC09CEA09DCB8462DD3C2517B1EBDB915B42D5AC12D1F78BF5E6E3987BED188630F4A06FDA0E2EF91DBC0217FA95EE745E57DD4DC3C4772CBD963AFA1BFF5523EBA79296BE637282EAF0C95243B158C3738BE83ADDFFC9FCCAD9DC07232EC7557A87ECA8ADA3E02DB61D09BCD138DEFE7A8B794BB5617B8EBFAF5BA02AC634F3170FFEFE3944A94ED165E6EBA8E3DEE4A069D763CDF254F89B05A27571DE1DAF24F585EDFA71B48BFD7C389C2060ED1C3687E0EFFF69FDD8D9770CFCD986C9A7424BB7ABAF6669A846FFDA0CE04E87711C4A6AFAB49A94A094B52949A003D2D7227CD11E9FA04502F416917633BEF67F4C03364EB2338D5808C948B5195382AABE38AA30D4579484D06AB432F42BD12FC4F13F8A48927BE7E6A4C9B04692DF94D9056EEF0A49ACFBB38AF696F494F31854826C533D31D49F7A7442C5EA98666343D16635311A0D7F3106C5898153196E80EC73E6194A7EEE519A799960DF7D0BAFE2E282C2424AF6C0BB39F24034289DCA777E22506BEFE7B642AE7A8B91E5B7377F27AF60AC6F2CD2C5BBE84F9AD8D448164E6190219A1D7BB50C78B4B2CEA6A60E1AC1CE28F12178B3CFBD53FA767F0456645A714633E935DC8DEC215EC633E67728BB1E31A73BB5A58BEB087F6D606CA9588E37B76503D73883E770E67AD7666B9A3DC71490F6D630718DEF6004BAAFBC98465DDA2F6E7D7B337B3867DFE7246BC4EF2B90C0B3A1AB8E5F2C5C6453C0A281DD941DFB6EFB0B2B883D6704885FBCF145670B2712D67DC4E36DC700B97AD9EAFC6B092419FF9FE9FB2F2C403E4B0188FB2EC2C6C642272B822D8A523F703D91E5ECE5CCD0EEF32AE5EE2F04B775C31D99E10AD67A56703077FF8252ABB1EA5239A602CCEB33BB39A96709835955D3AAB35E875F193C60F70D85BCA9D6B0ADC71FD7A0DA1CEB1A7E9BFEFDFE3942628BA1D3CDF740BBB331B1876BB98D7D3C9D56B7B18192B290CD4FAC29F317F609B326DC6AC66CEF84BD8E7AFE07876095FF8FC5D64D3A6BAC25D069ED376F97983343319F44C06FDDEE2D505F042F2CFB40F731EB1DF2C392374930C1C24BACA9A93EAA0C318D1C411860F6F61ECE4CB64C68FE38F9F21531DC38DCA582230A4F88034D27C1DEDB6DCBA0AB36B375C0658AC8C52EE94059566D1DAB43142F229FCF0D307E8A4C1A8D9724AB53363172658CB38BA0015C2F3161AA049881479D6A112636A20624DC2ED954CAE6ACD216A59C784DF41F3C2F574ADBA11BB711E1139A55BE96F49B271F98B6C7942AAF37B5FA0FF6BFF0EBF3E46C9CEB1ADE94E76F91B54C2F49E3B2F67CDBC2E755DD7B6A8B2154C8057B849BF675AA6FD5B7EC8D073F7D1119E252F1438CBE1487E1D5B0AB7722AC8D3D0DECDF22E972BD7CC67DEDC363D9F5433E8DCB971B6EC39C9C17345DADC3AEF5B3B8B96238F537AE58734D50609A4D5E635F36CC32DECF0D7D19AB799D396E1C6CB5730BFA725696482E7C4DA803CF9C64B0C3DF145DAC78FD0169438E1CFE160762947332B695C7C091FBD69258DF90CA7462C4E7CE70F597DFC7ED53A1CB33B78AEE556C6C872F5F85374468394638F575B6F618BB78925ED161FBDED4ABA5A0AAA9C98E6A9A383A3ECFAF2EFB2A0B4970A0D0C676673C49F4F6BD0CF9AEA1B6A1E31E477F26CC35D1C751772FBEA266EBBF1326DF37A479F61F8BE7F47542933E275B1B5F136F679AB28D2C0FA25B3F9F0F58BC8173CA27A88D3FB2C27BFF69FC958456A6E0367BDF9ECCDAD63AFBB94DFFAC4EDCC6D14ED73F36514168CFFBA99424A5E98C9A06732E8FF93F89C50340D4FF362FDB7698C8794843F5999E84323E1A2020C433C00830719DBBF9D5AEF5EDCD249A89CC48DC60D873AF4347855308EDA52768B8BB3422893C249060757BC3811FE495D5CCE179878F7676D2611E5FC041B379086C10C93E03CDDDA2B9D5E53E682199E885DD966847ED542CD69C5699C83D37609DD577F1C722DE04AA34B0636324A4153064502A198A3344D5209D0DE891718FCFBDFC5AB8F336E6579A1E956F6662FD56CF9C3775DC6BA85DDFAB3411CABD492193F4F40171131123D6AE0E93FF91DD6955E271B95B4041F77DAD89B59C773B99BC8647D3EBAF912562F6C541B2E8558D47C21092658546D28CBFD0BA0B1D6CFC4A37F4169C7938A2F8F66667336338F9F64AEE750660577AECEF2A16B979311094FA19289FEB282FA21A1C054B512C79EFD1EE3DBBFCFFC89C38CE667712C339F573257D29759C02F6C68E5BA8DAB383DE672F23B7FC89A13DFC48E1C46DCD93CDAFA410669E0BAB1C758189C2017D7D8D178252F17AED280BA7CE97C3E78EB95538A7A419DC7BFFD8FB41FF921F383E39AD59E72E7D0471373A233ACABEED01539E077F15CC31D1C711770FBEA166EBFF17203571D799AB1FBFE2DF56A85616F16CF37DFCE016F15D528C3654BBBF9C0B54B686C1068AA4AF5E8739CFAFA1F53604C79D167BCB9ECCC5DCA4E6F05F75CB79A1BD72F3C2F104FF5B0A7D5EEFF7F7B5F025F5575ADFF9D73CF3D77CA9C90810021090984799019A4CE828A885A6BDFEB7B9D5E47B5752C4FFDB77DB5AD5A87DAC1AAAD1650A1D679061C502C606592790A53022401322737C99DFFBFB5F63E37272108416825ECFC4ACD70EEBD677F7B9F6FAFBD866F298256047DE254758C2B2DB7999DA4E326A095C72CF25F39EDAC3391F3514F28C7B1425EB801A8D98DB683ABE0DFFD01C2F53B6086EB61844977C38920059BC8D5411A19F4D0B3AC27E5F692BD28322488A0D9F2A6EA336B1739A92C0E7A8664468695632DA529454BAFF6CC0E91E34BA980641951F35511210DE8142C4B849935025AD62824E58E85B7D730C0CC92692A22658C83A32C7F2A937F6D72A384100709CB3F41E3337723D6528B56C38375C953B1591F84B02319179F7F0E8AFB66F03D91B60769E8999A06978BE4561DEC090A6B3A6F872B1EB809A3FD6BB9F0C5EF484699A7185B8C12F6670FCEF1E1862B86DB72C1DA952E44959FD83028684B1679ACAA14A1250F21B86F1D0702CBDD03B1D3330C9F3A4A50EDCAC1AC215E5C36A15868A2E822E990F29CB9138DEC68BB65FDA7A85DFE0206552F479BC38D4366B608D27906E1C242072E9C3404879B9DA878F5210C2E5B48C5E6A87164E3ADB4EB50E5C8C058FF8718182C4566A00A7B3D05D8E11B860A2D1BD9454370CDA5E708822653A0720F56BEF414721B372129588B9D89E350EEE88396700C85913D181958C325E6D5662E96254CC71E673E5BD0D3CF1DCDAE078DB238FE3607A14010756636962793053D106D1113E7146763E6A40148F4B981B01FC1FD2B50F5F46FE08B36A1C5E1C37E5701367A47639B7B30CE1B9C8E2BA70C8B4BA8F289D296CD117FD214412B82FE5C041D0FBC49DF99B4B8E2590AF1E2552A10B0DC0232B068CB88E1A28238C107596F9A5A6B856B4AD156BD1DC1CA2D68A92C45ACAD810B149C68851E6D80CBD1CA0515A2C250A6B0C5A57364F9AF5CFCA2D2AEFB5F82A0E9CBEAA948FE66FA9DF07553F091E5963493FDC7B19817D1981B219808E86E44137AC1DDBB04E983CE85993D18706673977222F1F6325F994FCD9848EB9CFB214A226382D66094AD42C3DC3B60845BD0E2F0A0D433107B1D7DD0E648404E4E1FA42578A0932E89164690F2F29C3E64E51521BF301FA641F74AD6B586950FFE10839BD7C38885D060A661937714B61BC538E82EC4972F1C89497909C2AD441B862C8996721F888643D0C9F2956E17FF9EF5082FBA1FFAA1EDDC7E6CAB67343EF54CC041672EDA9C09B86268322E1E37902D53EEF7C8BA28C2DFCA3A4D5480B2AB0C55EF2FC4F08AC5BC89549B1958927805767A8763424E08174F2C4620968803AF3C8C92032FC21109A2D1C8C0DBA95F45B92B1F03829B31A875338AFD5B51AF7970D8DB175BCDA1700F188BEB674C1204AD033BDF7B0ECDAB5E426AB4116198F867E234EC77F44562B801C5A14D18EEFF982B126BCC5CBC9B7825F6380B71D9602FA69F4B697644D0EFA365C19D680D8651EBCAC13F932EC07667119A35174615E762D6C401F0B94C38A92BFACE3750FDC2EF60C642A875656187672893F97E231733C7E6E3823185B2B3BA585DA282D03206E45A5504AD08BAFB94657B85D5CB90F574A52E253F7D22FD4E783EC925600F544B139AE269965F84B539ACCA2AE18F634F2A25FD879B106E398840FD2EC4427570045BA0556C47E3FE8D88062A61B20B848A5E447300CB2D204A5E0449F3FFE2EE87EE8DD84ED0A2EA51E47E5360877B146A06C2BA1BC1981761A4C29B940B5F4E112219FD11F164427367C293920747420E6B4788A601ED9B45FBC6219D409D02AFC2C921CE17CEB2D5689C77077422E818A58365A2D691C4644D8141129BA26D2A160DA2C5484393B3179A13FB61C4F8F118599401A7234C9D79F1F18337A2A86D279CB1206A9DE958933001BB9C05A87164E2966F5C82DE2E19789512B3B65B127A16D4EB31164340D37064EBC7D0963C046FDD6E440C0FD6FB266185670A1A351F12929270D5B83C8C2ACE16DA18D1288C78299DC88E21E2DE7FB8110716CFC7C05D2FF232AA35D3B024691636B98661505233A64F19089F3703FB5F7D0403F7BFCA297A4D7A1296A4FD27B61B4518DBDF85ECAA15C82B5B0297164293666253D26434F41A810B278D465EDF5C3EA56D7CF65EA4EC7D8733400E3BFB6099F74BA832B29117ADC4D0E07A9434FD83D76CAD998BC589B351EA1C8099833D98317558DC82F62FB81B2D547D696662936F224A8DFEA8D35D18D43F1BD34A72A1075B71A87413B2AA9621F1E06AAEA02CF30CC0DAC489A8D07BA339EAC60D5F3E0FF91974B211325BF48FCF97AC9A48DFC9660DA792A0A52899DD3AEF1890B43F177609D6639F9CEDC927F1ABBA7275D21FEDC92AD6C5F1C402B9C8651C495CDE39A3A58B328663D95CB60349201841DB992ED8DF3DCAB213B42D3A68AF7F8E3BA42582C79A349E894E8BC1B2C22D66E247987AFEF985887E380A046A11F61F44F4D056040F6E40CBE1522E8671469AE1D4029CDB2A8AC9492B9AB22A68BA3B89B29FE0A0ADCA46CAD4A0D2613EE03B2873D78980E6419B968036473A8CD402A4F51D056FC168387C3980D3C3162C15994073713BAE0E35E2B645DA6171C7D52DAD0A482A1311696266F93A543F3D07465B1D5BDA41DD4440331174989C52470698499585D1089AF474541939D8EC1E815E8346E2F2097948F7117E4DF8F4A15B9017D88B685443B599834F93A7A254EB832647126EFFF625C8A4D6E0923C44AC526CB57CD261DF3F55BEC5D0AAE9A8DAB402C6A20790D2548E90C383D58953B0D4338DADEF9C5E699835A50405D9E463172E27A10047298862EAE9BF871A43D8BB681EFA6D5900A7A1A14E4BC07BE9B3F1A973287ABB9A307D7231B2533370F0F547505CF61ACC68000D8E342C4ABB9E53022F1EDD1729152BE0D9F4327AE9CD08B7FAB13D7902CA3D03306CF8304C9C300A08D562D7C2FB915CBE1215EE7CECF50CC61A730C1AB42494180751E25F8B92867FB2555BE3CAC192C499D8E52CC415250998317584E8FCB2E703D43DF73304836D687524A2DC55C439DE0D70C1E77220C70DB8DB6A61345620335C85A4483DA7016EF18EC0074997A0494B803BD28ABBBE3F133EF98CB019214F4A1AEB8150ACE56409FA1C18DCF65D3C77E251125A30D4F498534E39622F356E58AB5CA6FBCBEBB90519CF954DE2C02257EB39962266965126129AA462617B018074DBC8060F2CB828275CD6B95B8D42E8ED2D69E3A823C26B9D9C84718506BBE26B076BC1B2EA3A32B5BD494F20180591F46751D0095241FBDEF6AFEEA8D2DD1BFCD75FDF0E2F6F0961D26CF6B3DE472C7818B1EA52A0621B5AAB7723D45889B6862A44432D2CDF2972A9651FBF2E543F8E37165E9B96ECA6C3443846812E13315732CCE43E48CE1B0E67FF91D092F2A0E969D0CC3461295B2BBFC37F8FF769C2B816161595CB85417D18593888166DF9A7A87A760EDC813A3E0EB7908E8523097EDDC3963C05F2A2D40040D3E1D793516366638B391829FD07E1EA8979C84A8A00913A7CFAE08F50103EC0A5E7871D39589330097B8C7E68369270DBB72E462F937CE9526785FDC4F2E192EE23FA15E5A6FB351D8737AF84F1D603486D2A435837B13A692A96FAA6211A73A05FEF2C5C39A5047D332831CE326B84BFC1EA8D4B963859D0FBDF5B80FCBDAF02E110FCCE54BCE5BB049B7DA3916134E1D2C9C5E89F9589832F3D80E2B25738D5B2D19589B792BF8C525731668CE98B22AD12B5CB1722B9A11449E1266CF38EC41E5701D20A4A3065F268A4D76F47F9A2A79070780B76FA86F2DFB7600022CE0494380FA2B8710D4AEAD7F07DD5B832F15ED2E52835C8C591841954A84280ECFD00D5CFFD0CD1363F220E13F58E742EC60939BCD0A35178A2ADF084FD70475B39504B4A7BE47EDA953C061FB827231C89205B6BC06DDF9D05CA3DE2FC7C918C249A1A939A1E8945C5FB3F9E689ADD2ECC9B4762496360907AA1244041D0A2CA56B481A6F446291E2E6B0598C83BA4C85A046D13236B3F98CA652D0D33D9F957F45E90BA2756DD834D4955744CA2AA4EAB56409CB62D2E678296E1AA882108DAB4085A66D2D2271E15BFEACAC8E9646853BBABB6206D4FA7EEEB5FDEF2EAD4DDFA697EA7782EB30537B941E89FD559BB1508D60147CA11AA2E83BFF6209A6A2BD0D2548728C95376F34B1822423C21A6BBE1F0A621BD7711D20B8601990522FB42A32A32EA77480F06599EF48051CEADA549DCDD0FB52C1FB933480B8BAD8AF275A85AF013B85A6B118A39B0837DC703508174C09BC26E1EF2119B86136D310757DB45740706E5E760E684626450C7AF4823563D7803F2837BE04614754606D6F8C67399759D91869BBE7505325D244F2A02AD421A56EE1A6C6D897C627A0E299BA37AEB2AC4DE7E1829F5BB79FBDB903401CB7DE7A2414B466E5E01AE9A988F3EA924092A3C5FFC68B26F23CACD17E8DBAACA2AEC593C0FFD0FBEC31B4CA3918E77D3AEC216CF08F47136E3D289F9C84A49C7A1371E41F1BE1779C7AC77656351F2B5D86D1661C698DE38B73011EB5F7C020995ABD03B76049B9DC3B1CB3318D5097998366924322B56A079F5CBC80A1CC0EE8411D8680C42996710829A0B25AE4328A85D8581F56B78CC756606DE49BA023B9D859831381997B20F1AD0F72E43EDC29F221668E6DE9C018787CBE9A9838EC981D930429A07CD7A021A5CBD38FF9B0A76A83AB24CCB42821E443F4F1BBEFBB5CB4964954D4BA2432A42E2C0294BB11250DDF541EFC2DCF937E1AAAB47C3246959210E2E1566AD188A2D0664A925C8A99546B40CD6B3EF51C648C4DA6D2770BB1B52FA662CB555AB0B7CD429E697D455DB6D7869615BB95C528ED7EE72E79D4AC4CAD940B1BB45A5F7B4DDDD28C76267DD78128075041718B605C3ECE2B014C9BBF9347679B922E863A1C8AA6DA4C12B349FE581593C3C32EF97BDB531AA586C01A2E416A132F27655BCEE4D90CC2563EA31A565EC03406E0B2F629A8B33192CC39C8D4D2221EB193B45DB3697BAD3F8F6AFC1910573E068A961A9CD3509E762BD3912B59EDE48CDCC448A4717ADB6A41A1C1DCB5D91668C1D948B923EBD58B088326556FEE67B286EDBC225DCA4D1B135710C4A1DFD506564E286FFB916E92ED242A1EC189B39C21E0AE1DEE12C3992B400D0B47B03428B1E81E7F0564EB3DBE61B85B5BE8938A0E5C09399872F4FEE8FA2DE3E44484E5A147CCAA7DEEA6D1843E9864F7178F9DF915FBD1241231147CCDEF8D07701072E07240470D9946224FB5251F1CA431872F04544A311D41A5958927E1DF6B806E0F211BD3065580EC27B3F45F96B7F4056D34EEC4F18869DAE126C750F418657C3D0BA65E8EDDFC99A23EB132662A37B140E3B3250589087017A259C9B5E4351C35AF67D927F7949F24CEC20821E9288E9534748825E8AC6857721D21660774EB53313757A0ADA742FE3AE474268D13C68D212516B66A246A3134E32029A81D4B4245C3E6D0C06F5F6B2042A0939116948656FE179EEBC5EBAE183FEEBFC1B71D5D563E0229D6DA9D42D96A6A42616BD12D0B3B56A59A672F90A8F8B4D045BF669B4424BED4B41B601B308D48A6F73A71C6ADC41042D26DB124468DF0FA45C2F1F4BE5A6CFE6B3F4AAC4770A2A46B3B92DF83358AD475AC2D265199756906BAA43319A70D19005DD4A047D9249025DF18522E86312B4AD29B71557B075426AF7BC49AB5A8660D8C541A4DEED49B2C258D224606AA2209FD8202C91758E6758FA48D66E2F89BA7B1B423B79F17736173EBB0ECB57E1D0B37360061BD01233B12EF93C6C3687A1C548C4AC19E330342F5376F110962E95C953CE316F5ED20CA2FF7C78DFF7303CB8018E68107E3D0107DC456C41EF71F6C5F7BF733D5298A02DB56EE13BE64D4E37441E333F1831902A5DA8B294F3A063FBD6B06F789FBB18DB3D23B1C3284238BD10578FCFC188C20CF6EDB29FD1F6E0910F32166DC3B68F16A37ED56B280A94729975997B10569BA3B0DFEC8BC129315C3C6900BCDE3454BCFA304ACAFFC6BECC1A3D1D6F675C8F3DCEFEB87A5406260DCB8523588D6D4FDC85BCC6EDECDEA134B9B59EF130C37E4CF62F4376F4089FB896A75C8155AEB17018514C1D9987BCD86134FD63210A1BD7F1FCD698BDB1287916769805B86C8807974D192E5C107B96C0BFF02E048361343833B1D97B0E4ACD621C3132451FCA681B57815241929F4E56861B6E3D8ADC240D974D2C417EEF7491BFCF588AD453BB1179D411BE3B043D8F2CE871300D11738977A4B18A9EA45B99ADD338638AD42926525AD3A2B58CF859CE93D503818501AD66C15C7B600BA9B0E6B928D6A240359BC1B666042CE0A5E972FE6D556B717FB2D426E757516AAC654A5BBB87A8B6945119B9E90892665BDC3A245856B474DFD0DB070331B4928B23AED373524F6487172982FE2C0CE564705A9E24436B7717012819D1B02E205FA0D40BE1205737E6271EEBB4CA7265AA494C7605E1F5606587F01BCB0E06D20778122E6F61D9580681ED27B24F48CDEEF0823970B6D521E8F0E293C4F3B0D1390421C38BABA68FC7F0BC2CD92FC44A14A1078FFCEF74A70ECEA4083B80958FFE027DAB572029D6C48B9D3490CB5C85D8E41E86E9332F47515EB66819151F376D7851847583DB41D121DAB02455FD55A859F2185A377FC8CA74247854E1CCC33ACF441C9019AD5300002000494441544A1A84CB466760CA88FEEDE757699259FA18F5E53B50F9C133302B36203D780407CD7CECF60C6317C411770E26F5F7E1C24903D11A7461FFCB0FA0A4EC796EB9556BF4C2A2D4EBB0CB9987D9E76463E2F0FE7038C258FFFBDB5058B30A2DBA178DCE5E2833FAC18806901FDCCD1A288DCE34ACF49D8FCDAEE128EC15C3E59307A3AD6C1B1A962FC080C6D588C2856AB31F1627CF44A9D91F570C1604CD5A2B7BDE857FE19D0805435CA8F271E285D8EC1A8A1A3D0D19A98928CA3185EB82C85737782349766A18D03B15F9998930B8E7A368BA2C8891BCB25645AAD445EF706C3F511FF41ECC9D4B16F4043849528F5AADF12CC926C032558478935AC919719F855433E34547CC2C5AA75995BF6C53DB2D6CCEDA22F296C145EB59621131B16E453F4B6956CBE0A1B88C8AB7E2CD633AC6CBADCD43122CA3C2811F19A894BF675FB6C48B3F410A9975786078A39095BC6441539030103F6B77E3E93FF6A58AA08F858D65D05AA71F3E1AC948AE95CB67113413B95C48F16BECF477227325F3BBED660E5B7D640189335EBC4F86B53079750B1FE0C910B4FDE427F285C57994AC32C7FEB538F4CC1D7005EBD10A139F245F848D54EA6D7870D5F473303C2FD36AE9CA2E11FA7C22523628B84B0910D480BDEFBD89FAD52FA377A81CC9A11ACE1A38E82AC07AEF38764B5C7DDDB5B2E3872833178F97C8F76E0B86B07DC72E64676723B7572AF45023CADE9F07FFDA45C8081FE67C703F92B02AE97CCEFB9D3CB22F2E9C3C52A8B751493E9112737F0CCD75D5D8F9E1CBF06D7F03E9C16AEE85B8DF3B04DBDD23B045CB458B2F1B33466661EA39C5A8AA8FA0FCC50730A4FC157E6DBD998545C95763AFAB10D3C7E460FCC802E8868E0D4FFE0AB9FBDFE5221DEE65489D4CB8ED54845D27FBDC45D86C0C41754201A60D4EC6F48925D8B6FA130E30165316073C3862E6E1DDE4194CFE579478398B83F5B6F77C80A6857722126843BD330B2B922FC51667099AE0C1E8E2DE9839310F493EEAEE220D4C56EF13A737CAEFA63D8D4F340CA9F0410B706D26E0496971ECC1DCBFDE88D9574F80C1BDBA48C65774A6B10C76663683FCDD744FBAC86F642A138D24C40C6BEC8A62A2155C6D5BC6B6EC0EBB535A3E46B4B6E447C45B8575F062481FB31C799C7B2DC54B2BABCE7A0D6F64BC6E05989657846575A45D7494FE9994F1A56D44740A7520108A2018A0C2B61379DE4FEC1A45D09F8593FD682517587BA275877397D435B0FBB2BA3B4B9D7231AD9522F768B139B4FB21444A5EFB3FDB279FD8CCCBAB44D71661C15ACD5A439A0346D95A542DB81D66C80F3FBC589B380D9B9D43D0EA4CC24CD2E2C8CB8867D15A046DB27B43183524D644FD08FD872BF1C182C730C0BF11D9C172F68492457AC03D1007F5DEC89B7419C64D1A6965A3F35DD156B77FCB36D4ED5A8F8DD56178FA0FC7A5138723CD15C2A6656FA061F5EBC86BD90A2F69828775EC4918C62E86DEA32662C279E7C9EE2B0211E6864808812DCBB0EF9DB9486F2987271A4034A26347D244ACF68C47B59182848C4C5C33310F05B9A928AB8BA2EAF5473064CF0BAC04D8E0CCC2A2D46BB0CB55C8591CE347E6738A5EC5476FA2FAA3E791836AF882B58280B817A08652CF50ACF58EC321470E90D00BD75F320C45D93E6C59F531EA563E8FC2865520BDC43A672E96265D823DCE3C4C1F9C808B278FE623BA63DF47685C783722A4C5E1C8C027291761AB73101AB5048C1E9089D9930AE0F350AF494BBB445882E2B4A0094D109E5A8BADAC34378BFCECAE34CBCA6E27A8F822EAA2E5D55FC9C5317B3C28BECB8173DA08659B2D3E3AD10230840F57A3A86408D8BCB10A8F3EF6111A02D4F1862C7B07825A0CA637821FDC3803E34664C3E0E6C2F2F5347D64C6524C3E063404A378E3F59578FFED771074F810D4753CFADB9B9099E212CB5716717135048BE5687C6BAD0E60D7FE0ABCF0C24BF8EE37BE8CDCB44C6801A108F6D25BFBF1F7D73E801E16C60F278A506F479D7A66B600861FDE8426DC75D7F7D0BF6F865857D4503A7E6AB5DC2DE2D41808C4441E74975A14DD7A2CE3172B823E166EF2C864051FC4BEDF95556C375FBBBEA27B532388BDDD41228FFF36061622A3EDEE89788BDAEEEE09FC30502054967EB3BE36D99F5449B81A8716DC0167A8152D7A22B69BC3B0D799CF043D78702172333C421A34148646476CC36441A2ACDC5CF8D253C542275DC070149F2C7D07DAFA97D137B0172EF811881A68317B71F795C34925484CF621353D15BDB2FBA0A1BE014DB50D8856ED42464B19D6E8037020E31C1467B8316D74211A0F97E1C0CAD7915BBF1E29816A2444FC68A0CE2466162A5386C2D5B704D959D9C8C9CA463414424D7D132ACBF620BB6229926A36B0B07F2BDC68766661933912EBDDA3D9D21B589089FFB870384C43C3BEDA180EBCF2008695BF045289AED7D3F156DA35D8690EC08CD1FD3079543EDC0665111EC6E2B97F4251CB4664B651EA9F9BF1230ADCE01D8B7F265F047F484356660ABE7DCD04243962D8B66A25AA97FF1D054D6BE1D05C5CB0F361D225D8C55A1C89B8642A69713860501EF4DF7FCA7AD0355A1A56279D876D6609EAB5448C2AEC856BA61422511234BB44A4651ACFA3605E8E77A2902E311924B08EF571BBB57B043D77DE4D9875D558B84C725548C7099BC2D24097A7403AC7B4D607F03FFFFD07EC296DC4AE323F9AA254804F454ED476CB40CC15C0E40BB3F187DFDF84217D3C3068B7E788A3A8FE0C3407F1B3BB1FC786B2FD987EC9798CFDAE4A076EFFF96F31E3C27CFCF1E13B58B48BA582B97E401809968BE3577F5A8197DF7C0DE74EEB839FCFF92E7C0E171C0160DEEF97E0A127D760DB7E52AFA18E4394764827204A1B0A028E565C75ED97F0A35BC6A0A4A43F123C54044729B754A4D59ED36D4FA00EB6491F340765BBFD307649138AA08F49D0B6731253B348D33AEEE6D8D910EE063B5BF4DEDE8AEBE88A26CBFD6CDF2AE25B44B7D784A54B42B9C8949E268EC1BCC8CB3FC6910577406F6D421026DA3C59A88FFA107138E17639A0479AE1A094C0A88E58248A88E1C37EA3376ABC7D9056320EE3C70E45BAC760E1FA582888EA2D2B50BEE41964B5ED83470B70697AB3918CDAA8073E230617A53C694EA114188EC0156B83116CC4EAD44BB1D21C87443D887347E561DA980244EAAAB1F495E7D0FBC82A0C0D6E833F14439BD38B7A23151167129C4E83CFC014440B8648E40AF0B41D40A2A3852DFB327711D679A7E090DE0B7E331543F39231F3FC1148320DAE4DAA6A88A1ECD50750B4EF79D652A646044B32FF0B3B5D0371C9A81C4C199107939207A8747CFD0604DEBE0F03DA7622A43B4597183D1D9B93A76029C620D11945612F135F9F3D0EDE68045B57AD40CD8AE751E4DF80584443B5230BEFA55C8152D7005C3AD887E95346889349D907A85B70B7D8641CBD98ECB73A07A259F3605C7116AE1A9F87440F159AD0A2940E8278968F5590258B7D6CEBD6F21858F673BB4FF5447DD0BB319F9AC6CE1ECFCDD23963815C159214A9693959BDCBFEB917DFBAF5E7189A3F187F7CF007209916B2B223E4AE8B6AA04253B26257AD6CC5AC1FDF89824169B8EB860BF0DFB32F16C95131E0A6392F63E58AA7B1F4FD67D116897087189FDB442006D43437C3E5882123991A0AB777899172EDB8E68A6FE1EA59DFC0DADDAD58BCF42DBCBBF83E64A6BBF9F92DDDB40F69C929EC9AD9B0A305DFB9690EEEBDF7664C1D9F2FB289C867AF031EAF0B098954F445731D1601453A038663D075433456B0A506920FBAADCDD67CBA1BCFFE31694815AA1C031ACB776777F0DA08B083F7A3F35B9CACBFA1331FCBCFEBEAED3AB80FBB32EC4F687170662C5BD0F6283F3995F58A35A85C407AC40D701A0622113ABA894D8ACABB4D3D82B6500486D3C7DD4B5A626EEC4B1D8D9D463E0E9A7D70DE97A6627C111D0BA991400C5A2880F235CB50F9E18B488DD5410BD6C2ED8CC2454F4C6B1313212D7AD2B56E23253C33098DF0624DD2C558E71A075FB419E78ECCC545E38BD8E3595317C2DAA77F85A206CAE8F0C3A5B5C149565084EC7FBA551DA170084EC30B4D73C1AF3BD14C9B823309BB1246E1236312B7004BD2FDB8F9BF6720C31D030D91B49CABEA22287BEDB71870F0656854C9E7CEC11B89D762AFBB18978FC9C28461F9F03875F6B1B7B6B562F3EF7E8C01AD5BB85B4B839ECCEE9B4F5DE76093771CBCAD9518579080EB2E1F0B570CD8B6FA63547FB410039BD72114D1D1E0ED8777932FC736477FCC189280CBA60C8383DC24651FA272DEFF428F86D1ECEE8D8F122EC03622E898817145D9B87A5221127D2E993346046545B185CB8AE2009DC21996B35AFA4CAD926FB950BA91C5F1F45F45576FDD9496AE159EA18F0E01ABDFDB8E1FDCFA4B2C7CFB71F89B745C7AD17770F1851978FA9987D90860D78BD42B0B8480BB9F3A88A7E73E8E5FFC642ABE7BDDC5083545F0D56F3D8AB797AFC65F9EF80EAEFFF26491F921F71DD1B838C49A38E15004A66E4A5F1615FF46F1DC734B317EE8681416A5E19AAFFD1907AB77E2E37F3C285C21923F69D326A9F89FFF7A099A429BF19BFB6E8583BC35B4B7B3433ACAADF4C4466F595D84A8506D14FF2774622C538EAA08E9DF31BBD69CD033D9F12265417717B47637B07445B4BB1AE26E906E5BB2E2262CEB26FE3E965BA5F3FB75211D7052272A196C69F75252DEA9DC25EA7763E35F7F0AB3B501CE4850746661B7A0E8BC428130EAA412811354F1DB0637F69A85D86BE6A3CC918B31238660D6A47C6E8A100983ADADD26DA558FDC10AF8FCFB911B29456AE4303CC11AB81C746CD4A08503DCA9BACE9DC60248075D79D8E518880A473FF47136E2E2D17D3069E400F62D92D1D45A538757E63D8E5CFD30D2DB0E20357404495A10313283A9DD143D8511222A37AA5CD9A874F7C35E671ECA1D7D71D89D8F94681D466569B8EECA29ACC8470F1BF146452DB0E7D5DFA1E0E0ABD0221A1A1CBDF08FF459D81BCBC6ECB13998306A0074A703C1A886482488AD2F3C01E7BEE5480D57A3C948C14EDF486CD20661AFB318FD5C8DB86A4A3106176531B65BD7AE42DDCA175058B7068198816A4F1F2CF39DCF42543386A6620607396340D93F70E0B95FC3156E456DCC874FD2A66387B3888B82461566E1CA890385DC282F1C2BB225C8998EFA96AB43E83A8AA0A9B82CEE04E9C404276E41CF230B9A2A09857109C4C8192DB234826D0EDCFFCB8528C8ED83EBBE3205F7FCA10CF73DF810BEFED5BE78E24F7338A06CF5004538C21BF2732B2A71FB8D8FE29EDBA7E1EB5FB908DFFDC18B7871F15BF8D11D3331E7E6AB58CE56BC468C93525923B4A13B4CDE54399D3004341E69C1D3CFBD838F56AFC66F7EFA43B85BB23066FA4DC82E4EC2C72BEE15FD19E936A595FFCE478DF8CA377E88154B7F8B9262526724FDF428DAB4283C3A694552F8CFE4C566F503A66EEC82B5A56B87674B182E816018810061DD29F3A4BB1C63BB5E117477C18B9BB3EDAC69B9243E3741DB99F9588919C732DD4F6653E04EE9C27F470F3647B3AD6D27D4844FDF5C8823070EA0AD95F449C2D0751D016AEDA5536F6A6A1A60A02D4C168586A8D38B5A2303B55A0AFC4632268C1C844BCFC983E910957DC499F459A5DB0FA072C70678FD7BD15A7B0091D64644756A446BC0156D434477A2C148C1A158321A5C595C629E96D30FC5191AC60DCA45769A57EA6A88BCDE37DE7A0FA6BF128EA60A688D35D04341C4A254D91803C8C263E52413471CA9A836D2516DF442C44C465A463AFA26C4307DDC20A4249AAC1AC84DAF751DF52DC0DE8F17C338B01AD5357ED4867D2C6BEAA71CF03139183BBC10BACBC9D660341245E3DE9DD8BA6209FCD507D1A4F970C0CCC3612D037E3D15A3FAB870ED0523E1F5187CDF15E57B51B17125C2E5DB501BD470584FE60A456A083B7D683AA64F1A299ACE365760CB6BF3505975184D8E642E8439ACA5B3C8D184C179B874FC400E12C6D3EDE5FC7366822D5D4DA8218A9C07C16FD68572B159EBB91B163413F4ECB1305CD2D32A7DB2D15818AD7E1D358780EC341DAB57EEC3753FFA33060CEB8BBB6E3A17174F1BCABA2AC240A572730AF2024FBCB5157F7FF61DDC7FDB2C242699B8F3BED791D3D7837B7FF15524BACDB884ABB5B91021D2B4F2DE2012495077288465EFAEC3AA4DDBF19FFF730186E5F5C182C7F6E2FBBFFC19BE74F970BCFCB7DBE0A4A51A0636AC2B4355951FBF79FC03ACDEB006CFCFBD816313F4C7DEF939C8EE9F0D9F69F0F221FDF70E82639C464B4B5E6C74E236042173A9B72A54E92EA39E86EB3B93B4DDDF701A3ECEE2CC0E567267BFC7C910B4B5C28939395DCFDEEF5188E77FF4C9A7D87B28885030C8D177F2B3C662A4B31C6672A0DF450D933B7F53A523E97A2499C005E34A909FE16312B70A1038B94ACA64F8FDAD58B67A1B0E348471A0B6192DC108DC24E0138D211C73C1E7F120332D0599A906268C29417A12BD373566A520937C70886E740DADA130F61DACC4A61D15D857E147736B048168186147944BD1A9EB08694A27A724212B3D09593E07A68CC8479A5758EE7C7A666952E114A0F2053AEDD635F9B1F0957FA0396C220013E9496E5C36B61F06F4EBC5562A9F28F8080C541CAAC392959B51D918E4D6C4A6AEA16F5A322E9F3A185909E4E327670F05F3A809AD8E2D7B2AB162F36194D53673897C82338A8B866461D2F001A28A929AEDFAFD78F5C38D286FD4D014612572E424C43069587F0CE99F0597B39332A3CCD464EA15BE28AB5DBD3C8E8BC579541C4500DA21CD2CBE8CE3591CBB70CBCD4FC3347663FE5F6FE42C0E879BCE51EDCA88EC0927E0A8C82F0C140CBC1FE1E4723CF3C2FF61D2900CB8B84E80CAFA35C44231684103F547DAF0BDFBFF8CE9575C80F3F30B70F7AF9E40E2C00CCCB96936B212BCE021D230AC5253D640D2D016069E7B6629C2410DC10050BAB309D0FC18382C83E32966C08305CF6EC1AAF2F771DFEF7E88EF5F3705CE2050B5AF010FFC6E39FEF2DC6A34C70EE12B5F1E83649366979A73B462D65517E0DC69E3E22507E299134756DEC0293B891E152EE1B5ED8A4CD031B406A80D9C754AF9FC64A02CE893C5D04E90274B8E27FBD9F6D7F12EFF39DEC83ABBC9D421AB4C95BD6DE41E8E0187EAA3089165CA8D6885B5C0DE37EE8012159624556F51C942348424534356326579D093257291F936C93294ADB1285BB8A605A86E89A2B2A61E8DAD6D8885C21C81771A0E24794CE4A425232BD584576AFA58B2AE8219ADBC5EEADE224AC1EB5BA23870D8CFBDFA88B45B4324871A83DB74C06502E9495E64A726A05782133ECE38104F3EC3C72956F2C1D248EC5FF4DFD9BEB7162D012A458FA257B217FD3312E03234715497B7C0BD7AC2C081FA20AA1B9A118984E14204FDB3D291996C726770D258B17281A9634D8BA6E1602D5071A4164E3D8A04238AC2CC24A49208BF4C0FA4937855730C076B5A106C6B854B8F2233D1859CB404789D0E21A5D185FB8BDF807F6F0B627033E3CF26688B8C2C4E12BC1D4373B38627E7EEC2ADB73C03B77317E63D75235BD0BA5B64FC58416A7643C8E05F4D335030E2FFE1865BA6E28E9B2F8657A7EA472A3C914740F651014F3DFE3116BCFD045E7C791EDE7F6D3B7EFAEBDFE3EE07AEC33533CFA556C6EDA9A51C9FA37C6E4A657460F53FF763F6E5BF4673B30B0167332206C92D046525AB17E15036A0FB60646DC7DF5EFA052E1D5B0433081CD8598BC75FD88D47E7BF8B81834DBCF1C26DF07944E607B94AE23157C9CB56A36A26E8CEA75A8B03E4DF384848047DDC4C82137F5E15419F385667DD95963BDACE01D6F7C7DA9F44BECBF1EB66ACF7B66C0D7A6EC354C34C1DC59D44F6ED4D608E17738DBF97ED09A2F7A30C8E48240AA7A1F37BC68924EEDBB7E596779ADDAEC66EBDBECBA0AD7424D8F139160E748DCC468E7F6A67DCACF7B15F67FFFCE361D29DC52A0885B25DC42750A054EE594CF22D7E0D4FCDDD851FFFF869988E5D983FEF265C3DFB1CE82E51312ADC63104136DA5542C0E3CFAFC4A3CF7F8037FE763B7AA73860905B8CAEA56BA496D85FFEFA211EF9DD4BB8E11B6371EDF55FC3BDF77D8C3F3FF3189EF9FBF770E5E593DBC95CBAD9A3BC03508051C3FB6F55A2E97025E6DCF53E6219D5B8E9275722C51D8119011C6127566DF0E00F4FBC0733670396AF781403331399A049EBECBAEF3F8EA5EB7660FE633762FAD402E195677D1D2BFE272A8259B2C122EAA300958B4D4E14EBC59CD57AD0DD5971EADA2F2E029DCD10FBCFD6F75D5D73CC07C53654EBC4C98510ED14261E365B74F754B2DB1717E913BE332668AE02156EAEB8D0111FE9A368F1EB786A5E296EBD653E9C8E3D2C377AF5D5E361182278460D7588E00C22E700F0F2C26DB8E74F8FE0E1F97760E2C842B8C8AD41E67B58541536B70037DFF90B5CFB1FFF8504570043FBE5E2509586DBE77C883797BF8127177E13D7CF1C071759E332784E27A417DF5C8CAADA5A7CED9A59D0DBDCF8E637EFC6E4A93370D125791832B82FA73E52931FB2CCEF7970377EF987375134F2003E78FF374873027A40C3C72BAAF1ABDF3D85EBBEF925CC9E311609E443A1A033ED1D524287B271D8EFD54D826EA32C8EB356B0FF84979BBAF08C42A093492EDC20EDAA7DC2F7D79170BB1A1F079DF8CCDFFE57F6E572CA5D178C7CD479F58C42ED94DE2C8BFB7025E9D1044D1FD4DA02FCF9C99DB8EDD679308D7DA020E195578E8349DD7064493F19B7461BB07D5D1437DFF622FEB9EDEFD8513E1F690909F14EE7C47B8FFDF145FC69EE7378F0F1FFC5C489A3E1A63841C8818A3D21FCF4A71F62DE1B6F2031BB0D2F2FF87F9836BA2F22A108FE327719EEFFC39F70E995E7E3B63BFE0B69C93EBCF4FC36BCFCDAD358F0CC3D48753BA538121DC3E88680DBEE5A8BDFCF5B8AE193EAB1F88D7B90AA47116836F0AB7BDEC3A277DFC313736FC4B051B9BC5C9C01A0AAA60ECFBCB408C386E5E1D2F3C6710A9F25E1655F53B6D515F74DD3EF685353047D4A97A57AB32F0C02761FCA89126CE79B3F1EE11EEFEF5F1830FE0D37222D684BB4426AE30B778416426BAB134F3E598ADB6E9D0BA7B113F39FBC05B3AF9904DD1543281A86C3E1844E6E8B26E0DEFBDFC7BD8FAD42AFBC303E5C7633D23C6E762BBCFAEE5A7CFBBBBF42C9C02C3CF2F0AD983076106B7050829EE5F0FF707129EEB8FB75ACDBDB88683400B7D18C58A4029E443FC64E29C6A38FFC0C03FA6660F39E18AEBAEE163CF2C00D987E7E21FB26D83943D6B374B1DCF58B7578F04F6FC2CCD984F7173F8C71FDFB62D7E630E6FC6431DE7E7F05A2AE20029A1F305BE172D6A377A68E39B77F0DDFFEFA6C0E1147C351E8DC90E038E95436178722E87FC3DA551F791A103811B2ECECEC3E91D7F079581E8BA55B83DA90517A6087AF137DAFD330F42FD45B5A185BC9EFFCB3C8A316E259F415417393034FCFDF891FFFF82998C62E3C33FF56B6A075972C86A1E29330D074288C071E7A1D2FBCB71111D4C0348EC049625F70A264CC14DCF97F3F40DFBE0069B65000906685B5C0E81BD96D6EF9F223F8E5438B70B0F21022E106A4A4B66119159938848F9B0A5CDE7C6F23EEFDFD3CBCF0EC2FD1BB97974BF5E98B34FD38E53B042C5BDE8C1FDDFD08728B02B8ED47D7E0BC5123D8FDF2DA6B7BF1C7C7DEC1C12387107147E1F685F1F853F7605889C6F7448162A1FECEAA1E8AA0BF500B56DDCCBF0681CF22C863FCAD831FB9ABBB3C86157ED4A59D89FF5F33E22FE6A7D8B1602B5A801F179CE7986D0C7EBF8685CF96E2CE3BE7C369ECC7A38FDD802BAE3C872B48A9EB7A5C2439AA73DAA15446108D072CCD72760388FE92AC1D1321B795F823FD5E0410455E3565F8D0ED50293D678970EE3455F6C9962AD4AF53A6B9F1BD5AA72E5B5621A7C44999609667A7EC0FDA7CA43824BF4427FD0ED21AA76B75BE5741CBA24558FCABCB98C5D1414265417F3197B9BAABCF8BC0B108BBBB646ABFBEABE063E7FB5496B43C7258015459266E719E4CC16C69013E5A5E8937DF580943AFC557FFF3028C1A9D0F27A50E32E6C47AF45FF17307E845AE9E203CD672A680A114DA67F17D2ADB96455224D6C5E99B36917E8D32EB45AD9E28B4D199DC39984954EEA0D27171FF16A7F2E75B27009953CE7E76A9A7CE06374B400BB150FA9EDA8A716E3B352DA6AA563B292B82FEBC4FB87ABD424021D02D049874AC2A4322C476521479EBD204D5496F248C83871A50DFD0C89D71FAE466223D2D998B90E84BC8A24BEB5B12A5CDA8E56BA40C97D01C8F0BF6536B29EA8C427D296D25EB5C3824DEC12A6CE28E38F27DE2A5E2FCA652EB5AEE0A567358EB333BD592C886C2A29E92E289F4E5A41FA4667F07DD676B108AA0BBB5B4D4C50A0185C0E745804947F6CFB408931951BA1CACD2392AAB8E46D0D8EA4720188423A22129C107978BB4A845B97D5C6CDFF2FF33CB0937050B0FC93657A20B91D52856882FB35383BA95C884782E55B784FC656D0AD3B0F53BA9A06AB1BE90CB8FB70A67E2B5FE716EB9BD9D962DDEC7B72AEFD72A529425AAB65385646645D09F77B5A9D72B041402DD4240BA1EF835B6AE25E25BA985C76E69917A174698D31D1D51D262112E002A9F1772FD92A42DD6E37A6FD9D6CAA2CB787B92388BC73F9ADDD6524489F8942A43E9F6B84F0B8BC5C8B62B16A95AAE2C59A26F31AD7474C8B275B16D08E21762FC72FF8937986D6F166B1390625788B4F25590B05B4B4A5DAC1050089C2A04EC56A1C54F52CB83F9D0F22DD3DF48F04AFA80454360E1CFA5E09AA062D249B12C524970A2B6306EA4C7CB38ADCF65239BD23222A0D277BAD6191365F72474257EA3B5AB2BB21BC5266BC07975E25F845337A85CDBF2894BBB9E7D3541D9FB50A4CCB12F9BC385B271ADDDDC66939BEFC0D6AC59A5D99DAA25A7DE4721A010E80E029D1DC547892DB59320D7FC50008D0369C2E4156DA6884885C6B3F8927E6DD638A1809E2455AB8EBA03C99216798885B6C85E3658154FB49122B785A4FD8E5A335D047FA3D23F22BA7CDB495C0A4FF338654E336F35CCC4EDDDEBEC98B1A54D16B4B8266E761F85ABBC11396E55A8D29D85A7AE550828048E8F4017041D77E712F1C89439E62049829C81C15FC227211AAD0A7FB395EE66D73517C26E22BD4E58E6F65D4058D144E4F1F7603F35B1BA4878B3979DF32D49D70CA7EA59422596E52FAD6C7AA5B8077A6FB2C385CE92BC81B85EB6A5DA4CA14ADA0EF8DE78AC3692B77E3E1309DAEEF3A1A41797D301B7DBD971C73BFE32515728041402FF4E042CEBD79EB570943B41FA82E3F9C1328FCDB2A83B11B4351C6159537A9DE4BECE046D25E5C52D70EB834519F96712B4B5894812B5B9D2E30148227FCEFAB0B9993B5CC78976425EE09804DD99B43BA58658EFC71D5502D4E5BC5361D4E798DBCFA76647471E4A188F521239603A75B85CE7815CC6000004E94944415422F5467D290414026738027677827D28C7FAFDA9186E9CA86DBEDFAE2C5AEBBACE9B4B7C679056BE752438D6755D59CC9F398E8E37284E17A2282614A69E8444D05DA67D9C143A274DD022995CEAFB46A370E85A4782EE0A68EB16ED7F3BA9DB562F520828041402A711013BC71E65DDCBE8A42DA84A69E0C19050B3FB421034A7B05851510E1E1CC782B6476F4F23AEEAAD15020A0185C0E745C0EE8EB6F2A53BFA6E452EA0D57FC022686A79757C35F413BFBB93B6A02D8226CB391AA1A86B0C4EF241BBA81D79A71B903F9FCE93D1890F595DA910500828048E8D40E7037E9CCE6C6E122E9C24EFBAD4FBA01FA941045BD0A7D04370D2044D2E0E2B48188B524B200DA6A933411FF5D5A90BB55A1C0A01858042E08B8C40572E6B994062EF21CB43B0C29A44D0E483FE4259D0D6ED517E24B51632AD5E6936F4ED22265FE44951F7A610500828043E0B017BBC526A2B0957475404098341EA0E7FEA4CE893B6A0594E85357785949F50FD13FFEDCA9571EA6E592D208580424021703A11E83242D8E103AD9E85C27A165CD8CE895F802C0EFBDD5A55971DCB788E05E0A9BBF9D33945EABD15020A81B317817683B2A369D935758B7EF3A7E3EB7358D0EDB763CF6F3F7E95CAE919C8E90047BDA742402170F621D031C5BA9DA03BD7F158FEE753E973EE8CF62925E8139B4A45D0278693BA4A21A010F8F721204AD33B7B0A3ADFCFE976DD9E1282FEF781A83E5921A0105008F45C041441F7DCB95523530828044E33025DF9034EA5557D1A085AB49339B623C3CA1A3CCDC8A9B7570828041402278DC089B9623BFAA56526C7497FE6D12F3CE5046D453315419FC259526FA5105008FC8B11E83E418B5E34C2403D555FA79CA04FD58DA9F75108280414025F7404CE4017C7171D52757F0A01858042E0CC404059D067C63CA9BB54082804CE420414419F8593AE86AC1050089C190828823E33E649DDA5424021701622A008FA2C9C743564858042E0CC404011F499314FEA2E15020A81B3100145D067E1A4AB212B0414026706028AA0CF8C795277A91050089C850828823E0B275D0D5921A01038331050047D66CC93BA4B858042E02C444011F45938E96AC80A0185C099818022E833639ED45D2A0414026721028AA0CFC249574356082804CE0C0414419F19F3A4EE5221A010380B1150047D164EBA1AB24240217066207062AAD467C658D45D2A0414020A811E858022E81E359D6A300A0185404F424011744F9A4D3516858042A04721A008BA474DA71A8C424021D093105004DD9366538D4521A010E851082882EE51D3A906A3105008F424041441F7A4D95463510828047A14028AA07BD474AAC1280414023D090145D03D6936D55814020A811E858022E81E359D6A300A0185404F424011744F9A4D3516858042A04721A008BA474DA71A8C424021D093105004DD9366538D4521A010E851082882EE51D3A906A3105008F424041441F7A4D95463510828047A14028AA07BD474AAC1280414023D090145D03D6936D55814020A811E858022E81E359D6A300A0185404F424011744F9A4D3516858042A04721A008BA474DA71A8C424021D093105004DD9366538D4521A010E851082882EE51D3A906A3105008F424041441F7A4D95463510828047A14028AA07BD474AAC1280414023D090145D03D6936D55814020A811E858022E81E359D6A300A0185404F424011744F9A4D3516858042A04721A008BA474DA71A8C424021D09310F8FF23866F9D43DF71C80000000049454E44AE426082 , 'Default', 'ueb_key', 'ueb_secret', 'ECOMP-PORTAL-OUTBOX', 1), + (4, 'SDC', 'images/cache/portal956868231_53879.png', NULL, NULL, 'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal', NULL, 'http://sdc.api.simpledemo.openecomp.org:8080/api/', '', '', NULL, '78ot0W94rpB0o4FYzVoIOg==', 'N', 'Y', 0x89504E470D0A1A0A0000000D49484452000001680000012C0806000000EE2C29AF0000200049444154785EEC9D079C5D55B5FFBFA7DD3A3D99F44602015208044209BD77E945050151442C806097A20802A222584014B120A2285800A54887480D2D011292903E997EFBE9FFCFDA6726441F0804E6CF7DCF7D78F326CE9C7BEE9EDFDEF777D659FBB77ECB88E338461F1A018D80464023507708189AA0EB6E4EF48034021A018D80424013B45E081A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013B45E031A018D8046A04E11D0045DA713A387A511D00868043441EB35A011D0086804EA14014DD0753A317A581A018D80464013F4FBBE06A20D4660FECFD1C40118F2639358FD43FD0F75A87FC56FE30F30E43DE4F5C9B1E13BCA35E45DE3FFF1D37F7B9FB7F136FA148D8046E0BD454013F47B8BE7465CCDDF806E07E8327E9D1C893D3084A44D4245B296A2544BCE89C0D890A03778D9FA81987252A4C83DC420C654542C2F932F07B090DF878AA4E5F7C939F23EC9EFDFE0B6B1117FA77E89464023F04E11D004FD4E117BCFCF1F2468A1C1C108D950ECA948348650FD3826C6C526C014CA0C5210D844A998C04C5E997075C2D249BC9CD0B93148F87231F91AA467F9A7BC6D1242FFDB110FB0BFA6E8F77CCAF50535026F13014DD06F13A8A13B2D1C60C7C164C34018AC083326364A8A74E3389F30B5F0A69C62493C5CC0359AF0B114C70E5E61300696785945C2B1A17E67C93507C3E7E4F260F903046D4134C8D421982E18F29507D243F7E7EB2B6B0434026F8A8026E8F77D710C46B46F947F96DF952192EF199570888C84A755542D3F897DCC2850C90BE2086221FC60E07B04769AC84CA26023B655428338495FA87B80E4A785F1075326837858C2E4150C52A0BEF4A111D008FCFF464013F4FF6FC4DFE2FDC230C43024624EB6F26223C6340C8C38C68806C8D7A8425C82B08ADFF13251B99B5AB98857EAC7F0AAC45E8D38F0B05316A1E360A673D80D6D58B9E1E4868DC7CC8D80541361EC8093C63052C4511A0C87C1783E1888D4D386A449DE28B95D67C0E9E16804FE0F22A009FAFD9ED4C1DCEF00074651A4C8D954398B98CAC0D65E9600A3DC47D4F52ADE9A2788D63D49A9EB4508FAB08C88280C88A31033949C768429D700EC305039E89034AE91A718A60953C3C80F1B4BC3A8091863B7263F7C3266F348A23847480396D344484ABDB363A8985B1F1A018DC0FB808026E8F701F47F79CB7F536108410B39477140148658710D7A16515EF5288557EFC2292DC22C76908B2C9C284564F783E9134531711CAB2C87642C549E3A825400E6A038C4B2F14911192601167E240994765CBB914C5B3B4D5366929FB80D66CBE6608E05B30DCCD4C005DE6FA0F4FB6B04FEFB10D0043DD4733E40C02AD32CC49904C6AF6F0C0EFE3ED9FF4BD2C16105D308A8F6AE227EE667C48BEFA75A5E453E55250A4A18664C6CDAC4710AD337B125312DAC2EA9118C2465ADDECC10A107A130752C11B64FDA36318D10A20849A7D87E889D76F04C937ED294EC916447CDA169D29E348CDF1EA3653258D904A58154B51AE7C097FAB7DA5C1CC8670F9E2451BD21A391FFDE42A8F7065A6E197EF2E324476FC6E6FF549A6C280B4F06B2C16C2658C88B547E7E700CEBDF6B30F76F10ABBBD9EB874EE80CF587425FFFED22A009FAED22B5B1E70521B169E18B6CD9904D3DB08441D5669E45ECBAC48E8167191886956CFA155E2658F02B4AAFDC82535C8B2991B168998DC172924400AD78391095859DB0BEE4A985C836D074F8664C688A82DAC78C256911624542991646646318BEFA992444E47A5E6060A6F294AB21F98661A4A79E416AD37D30478E22B22C3C2B456040DA343055114D0AD3CD61C8DF942E13C7390CDF04A74CC5AA60D344EA3FAA40A24459226F3E28073421345198F9788212D9C8C2F0ECE4DC813F5171F6C0BD49FD42C613F9C9CDCBB408B1B1E2443D1ECBC6A810B1826E40CE2273605B4486BCC3EB47723B893620764DD91BBBFCF5EBDE1D029AA0DF1D7E6FFDEAA8426CA694144E6239474583E180CED9C2934D40F9792882E72EFC1577D333FF3784AB9FA4990AA6DA1814821E8825D7970F862A627442135322D881E8D11C609A44586728B54764083127A42E3C6E44F25B47A93984C015A70F1C9226B12C4BA54B8230A46435A8A8BA75CA7EB46C731C66EB568451161C53DD342202525E4A91999FEA23A0898C2FDB8A1E35CBC6B24C55ECF2464712C32651AF7AAA182468A55289098849FB6172EFB12D5C536E3349546CA9248D60E760ABD74518B19F44F918723B528AF1C1187E50286E1960C7A0EA77E4BD15C927CF04C9B9EB9118F8F78661FA5B4FB73E4323F05E22A009FABD44F30DAE1531A0634ECA4B92A819A90A148A31A889882DF4C9D556E1CDBF89D2333F2113AFC0C6C40B9A126DB3906F2C119D0A3531141927F4266A381521FECB7B0F3EBE273F3554914B42F2721591EBC5A2E0886D22D31BB85E720151900C2A494CD32488AA985983AE6A0E37338D615B1E42CB564761E436C30F53205C2DAA3EBB4A9FD107713B2D151B5345EE860843920DCF37386474892E6540B1B2BE983D926782E4161324791FD7B27007107088C8C9266818E2AB9B5F924491BF3308020C47FE3EA87A016B4A21BDE5805AAD86191BB4346618D19CA22D6F2BEC3286E029A3183C124579825C32701D3F0FF187445FFE4D11D0043DC48BA38A8F88D7A4025018323652B8A2671E785F3BF4716AAFD0FDC89504AFFC8936AF1B2B8808E5113D9D21886D4C15F186D8B150FA40443D10F18586857C25A492149A484428D1ADD0B114A74854AD32088AE0E40661131B52CE6D928EAAC8D6E1E0219B941241CB77216BC74C13D64A908AF1EC345D4116373F9D71DB1F4FC366BB833345E9A45DBB9B5EB9EDC42318563531C24EE228C66C1AAECAD4DF8CA0E5E7FE40917938A058B125BE97E29A50523F3276033B32A53627C964482125E08A4ADC046FA040D232C136A1BF1AB1724D3F5D5D3D148D0C5E6C2BE28E7C9FB0562663864C1AD5C68CA963189D91187C4047BEFE363758EA93DC5435410FF187445F5E13F4FBB506CAAA0E2FC68E3C1591858643F22F79D4F6B0FA1FA7F79EABA8753F4226584B4E541C4136F1CEB05C0243E82AC9F73A22A393348563E38742D5268619128631860A55D34ACD11A90D3A79860F317D1FDBB6310D4BA52C06B622550AC3B6240FFDAF65DEF27321E6A4D45C883E49A1382A4362E21B2615DBA1D78496899368D9E51CAC86B94456037D56338E67D1E02EA1E7D95F12B56E41FBB4C3C018D864FCF749184C052337A48850A2D95852400656682B828E14410B491A547CE8F43D9E5DEBF37C671F4B7A3B71BA3AB16A1E516C60DA0E2DAD6D4C9A3899D832F13D8FC84E13C406BEEF13043E665003AF825FEEA3ADC1E1C85D67322CE39092E8DBAB924E0F96B6DBEA7631589DF97EAD1FFDBEFFDD08E8087A88E7BF22358012C586C9EE96EC9F49CAD809CB98D545C4777D8EEAD2C7309C066A918F617B2AF1614716569023B064D3CBC58E23953B15EEAC4AAA3593C38B6C2CAF44CA9434888369E7F1FD8144886C2A9A81EC81110501B1283654EC1CE208C94BEE59D20BB14160BC7929B72B7B6B31A4A2885418A9A219F9538C6C867EDFA533DBC6C4D99F2233F563E08C240ED7E23D750EAF2CF8339BEDF753329B1CA16E1C6F1A42AB1B4472334912E426516CABF7905F952DE870031E78751D0F2D5ECAF26295AA6F92326C9AD30D8C965CB4EF83E560D859369BBA05B6ED100601EA2271401884F841A06E50815FC3AB14C85A21C5EEB58CCF5B1C7DC05C5A7319B26A3F2048248A0369284DD043FC01D197FF8F0868821EE205228FE1A928C6904D40C3A46A49CA4136BF5EA072DFD5444B6F24E5D788A26178418CE954C1ACA868D5089B084D5F292DAC38C08A45C9E110DA794A519AC06A50A9904CA6192BD58A69B7916F1A496C3989EAC30CE82FF711861E51B988DFB38E7454C2F27AC8DA3572764820AA87FF804110A7898D00CBA860A9AA46E15283D0CB63D24235D745251E8D39F24086EFF6417A1FFF13E6B2AB89323E8D737E4E7AC68960BF7992201AD8AC3394AA25268A4CB5B958366079C1E78E97D7F1F49A0E3ABD2A664396967C9E49D906C60606A9EE7EAA664477A58C936F61C4E8499896A433845E2395D2303C97300AF18210370C89E208BF5626F22A44418DA8D0C3D471ED1CB3FF76349A92AC499E5234410FF107435FFE6D21A009FA6DC1B4F127092F5BA22E101DB291A16A88AB4699EA73D750B9FF0A22CB25322372618546212B5F741E0E9E15E1DB2E719C563968118D492ED98F1C7CBB9954DB7872E337C398BA1F8C98464C33C42DC080EC4E4E3622BCB08869C5D8923E08CAE0F7102F9D4FD7922759BDF4794646AFD064F4AFFF0313099A1C09A9CA76A6DC2C42234520D5889E472E97C688AA385640548E882D9F6A9BC1921E8BB14C6444AE9352A544E680DFE06C7E9492B2BD590EDA55B78788B44800256A361D7A31B8F7D55EFEF6E4F314CCB1F4167CB6DE6C13A64F4C93F563CAAB17535EFB0AD54227DD7186D4B0B14CDC743A8693A3E28610C6C4810F61007E481446548318378A28552A388E855B2B53AB1494CB48B5671DC71DB43B3B6D3E5CF63CD50D31917724E3FE3799F4C62F06FD4A8DC03B444013F43B04EC1D9F2E398EB48BAB76B87238D51A66E71DACFDFBD768AD2CA6266A07CBC20E51795E4947D896ADF2AEC20C69D756F9D56A36458FD380356A3A23A71F8A3D722E38139562212140295C193041DA206095775DEF72A7A254B959C8974BECD7F04BCFD2FDC25D94163DC6B0D26B34FA3DD84A6F9DC6B7724471486CD4880C0FCBC9409855496171D933AD2A66E8E0C421554BF2E152729EC78C7D1CCBC6DBF532F25B9FFAA66E7842CDC518B246881DF4AA829897AA297E316F2DCB4A065E18323263307DD26886A54D1AE22AB5EE7574AC5C467F4F37C54A9995AEC30EBBEF8B9DCE12C6065128517844E07B891A2584208CA8F91EBE2F698E80AA5755F968CFAF91AD54E82D75AB315CFDD913C949597CCAC5352CB2A2134FEE52FAD008BC2F0868821E6AD86B31B11D50B3A508C5C02E2FA3FBAF5F22DDFD0F32411FAE292233494C67955CCEB1255FEA4AA11F969927E540C173885A67D1BCCDD1D89BEE83911E0D664EE568456026052E1B7BC4A10B511F466D25E12BF7D0F7C29DF83D0BC9DA45D27688E5054AEA66D98D2AAF1B9A3515F12B15482CF1664026F4F18D3CA9B88C6B99B8A64D5E32E9BB7F8BC6AD3EF11FED4A950E3AF6F1629305FD01373CF8321DC670A2D864CAC856B61C97A641D2426E09A3D24FC7F2A574AC598B17982C5AB6921DF63F8A86E1A3A856ABEB25824AC32D635539E798308CF03C57917210FA54DD2ABE10B45BC3ECEFA7DF2FE396FBF8C169273179440341AA42D548D1103803D6AE1B8BAE7E9D46E0DD21A009FADDE1F796AF8EE3226E90C7364C6C7A293FFB537AFFF913F2B5D534671C2A7E11C310299DA572CC86E9A9220DCC0C419467B5A825A6CCA57DD6C7309AF7062347E018848E743FE9C4A1118BDC5B8EE34D4F9024B9A4046CB923B8102E23E87898CE7FFE1277D5938C355CE5F911BBB2D127E61E153C3B4E0A41E2760CA346362AE19327139555C9B86FD8E462F076B984FCEC33FE835DA9E8FF8A046686793D26D73FB20C3FDB465C2BB3D5F836A60CCF10F852961ED2608554FBBA58B6F8253A3ABAE8EC2B91CA37337BF783084D07D775955A45D41A42CC8A9C6563D04FC8DA97083A10920E70DD1ABEEFE2BA1ED4427AAA45ECB8C429BB6CCB11BBCD2430AB44A4C878A9C4296AE3EF7F1B3F2FFA951A0155C025E1863E860C81026B71E21164AA0646F50956DC713A4D95974949E01A9818B6E8A363EC50F2CCBE08CE88D336453F03A9D118D38FA275FB23309CF110B5135AB6D2FF4AD189657A3858EABF8D3E0211FD5954A48C5BAE19C764C36E2C6F19FEE247E87BEC368CE232325681B459C3080342C32690221649D39A01E92089A0F36119DF92021C9B4C18E1EF7C31B9399F4455B3BCE12125D81516F6C4FC685E273D8DE3092A7DECBA493313F2914A9D7891A3A477A9D865DD9A15BCB66431ABD675B3BCA39B7D0F3E8C6CF36855D62D690DCF4BD21AEA2B0893CD41D757A90D3FF054DA43A477AE572390EF6E0DD7B5E8AF54C0ED65FF6D26F1E963F7C531A4443D85E53A09394BD58C3E3402EF03029AA08718F47588B67904F96A48E703E7C1CAABC9FB15EC3043208FD0D219258E71A4A8431CEC6CA8D8397A83E18C9CBE37E99D2EC0488D549D4F446E97E494C5BC3FADD4145203F26E36B1C2B89434012083D4EF49F09E51AAB70844375D5D4E75D91D2C7CE0C78CB6BB690C639C5072D03522A7A8226609BEC37880A0C5772436C90511A51DBF4ECBCE9F8178406627B1804AEA26E5DA52C8B2DC35F9F9032FB136339E322673C6659894AA62472155439E0E0CCCC8C50A5DD6AE5CC6AB4B97B1AEAF48AAA99DAD77DA45798728EDB7E49DA518258AD647D12A820E937CB490B7EFB94AD9512A16943DAB44D18532940B559CD8E3A07DB6E1848366D31887E4440FEEDB0939BF8BFBDF102F2F7DF9FFE30868821EE209EEA0C8B0D8C1EA5F46FF5FCFC1E8BF8B9454048ACD5C9C2332C5AF593C3512D7359198F53923C94DDA93D65D4E84DCDC01CB4F614D958F48084E0CF6A58A43746FEF6213ABA61AC5425AD22B322E55E29852558912210B91DA6107E1DA27E879E4E758EB1EA521EEC18A42E2D8A6E648955FA022E85C5826104B53C32255F528CFFD068D73CF5111B52A7E5187E8A8436CD3A4EAC7FC74DE7216971D4CC7617CABC316C30C1AC2329ED140C16A221549297905337459B17C294B972DE7B5B53D6CBDD3EE348F184B184544D1EB298DD7095A0838C00F035CC93FBB1EBE5BC3AB5655AEBF522AE2B92EA55209AB6AF1DC530BD86CBBA95CFCF59398D694A159CC9F020F33258D0C742DE1107F4CF4E5DF04014DD043BC34BAC388B6682DD1E23FD27DDF0FC806CBB00C571916394146953227A64786F2692E1839DCE1B318BBF799307C17B01A3054A9B4549C0C729C2A3101439C3C32AA13CAC61E7285A410458C9406FA104ACA404AA4B12805D0660698DE2AE275F752F8EBD7C8066B958F4518B6E1D91E4E5C2518CC414B8AC34E61D75CBA677F95BE9967D2EDA5A8945D82813444536303B94C8A75DD7D3CB046CAB9338CCA54983E26472A92DC8F94AFA7094562A8B4772E86EFB262E91256AC5CCBAAAE02FB1E7A0C454FAC557DC26883D44618AE4F75483E3A21E824A511BA3545D441AD4AB95854117558EAE4F13B1EC5AD343276EE0EECB8D7565CFEF1BD688F6322AB8469669421933E3402EF07029AA08718752F10F25BC4DABF9D85B9EC09B212999915ECB8423A100F0B2166E97C22CE730EFDF63086EF7A32CEF493A8991395D19068A00D894213433A75C44A49213F5749808DFE2BA47023B966E24E9774A54D5C3BD4FF8F1CACB086D1FB086BEEB88C5CDF7CB2D26E4BDCEBE4C660888AC3C31B54713892233749F901CF8C3C99A7C77D9A6E63C440377149C9C835937CB16CEA15EC56ECB0CCACD1166D398B7228CE1819B2A14FB3DF4FD5492B8587197AAC5EF61ACB57AC21951FC6265B6E4BC937949953147BEB551B927F1ECC450B41BB818FEB5609A5D4BB56C5AF56085D0FB752A1A921CFC78FD89160653F1FFAF01574B78C60D20E53B9FAACA3D877462B8155C02483AD9BE66EF4FAD22F7C770868827E77F8BDE5ABDD2826E53D48CF0D1FA1A1DC8B6B270E72E9302215F9D46C715513E3E31A51630BBD4DFB31F6039FC3CF8CC6609C4A0D0CAAE806C97920539018FCBF6B331FB11D5296F889DC6FE0500EC9A29BAE1588BB9EE2B5BB2F2157594873EC4A2B44224965381E8D7191C88DA9645AF1A59CDC949B06447623CBDAF664C1265FA0373F15DB7112F37E4374C989C2A252A9502C5598D0DECCE89694DAC00BADBC327FCA4401B92091ED05525549CCAA956B78E9A557D974F3193839A99E94C29432612C3E1BC1FA1CB4283A06893A705DBCD0A51454A8887AA3E8920B628C9E6E8ED86B670E993B8BAE5A3F071E740E1DCB9A69D9762BB6D9A5811F7DF9305A6D298D076B30C53190E99022F9243124B735D14A6FFC0DF22D17903EE1BF1A014DD0433CFD4AB0B5F80704B79D473A86422A20B242D27E06CB2852336C52A18D6D54286647D3B4EFB5589BEC8167964979ED28767EDF9EB06328AD61C93DD763F90B68307AB084DC8C2642CBC1B3C50BBA82D9329E970A79DC3843CE2F92C6A3600DC31B3193EAD83DA8DA6D894F7352D74D245DC82D33C91D7B9248917F27136198B2513978DB313085F0E5B5A6C5BACE1E9E7CEA59B6DB6127622996C1A216D692F26D65869490F486042D567725B74839AEA8681AD780B5BD2C7FF8212E39F774F6DF691BEE58F414279F7C3EED85D9AC34B36C7AEC78BEF6D97D3878D30949EC6C2637B1D7B3E8898B75520024392A4DD043FC31FAAFBDBC26E8219EFA302EB2E68EB3697FE9B7A48D1405BBAAEC40337E86D8AC20042E5239276550C86D43FB51371264C712DA651CBF09D3B4DF5715414D52DD619954AA8CE1F5822992B90C912939DA8020CEB1B0A3C693AF1509429356CB6544631A2FDD4A97D14ACA3054235BE9B128472E9DC2F5AA84515248E285265557ACF50DD219B9B6A9D41D83E2CF284A4CF8E5E7A5729567E63FC7EC393B10063141244D053CC268809C072A0507095ABE7BAE45AD5A268C2A78E5327625A467F16B742F7A818BBEF469F6DB7D0BE2E63C3FBAEE41BE75DE2F08D2CD6466B6B1CFA15B72D5A78F2563BEDE306B60272069E8B27E3FE05D3FC20CF10AD497FFDF8C8026E8219EBDD87B9595B79EC9A8D5F711D5C06D9037F4497B3942DB25B084010D6A51134D333E4666C7F3F033F2985F2225D5851241BF8F2202B14B95E856542669897EC57CD936A98A0FB315F3FCF21E5E5C5924C80D57C31C9D8B69B47C8A52F3926BC5502E7A5280237914D127BBC9E65CE4E3D66A74556332F95672D92CB69552865242CE83D23931D3576E1D618C1F84546B1ED95C23B59A545BC6F89E90AF689D139216D2176256C5299E47B12AFBA93E71B11BBB5265C1A34FD1101B4C1AD3CCD147EEC32E7B4CA16B89C78597FE91BB1F7F062B34E9B52CB63E72677EFAF50F33A525B53E461E68B49E78440FF644D086D143FC09FAEFBEBC26E8219EFFA8FC289DB77E9EB6EE67708B31518BA93A753B5E5E55E489BD686046F4C41318BBEF95A4C61D4C352D1B8635B2EAE15F246AEFDF23B41B56B10D034B3C520351929804B6C8014D5E59D3C173AB622A66BBEAABD8D66C62577DF266A848DDB3C4093BE983225D606AB5AAEA6C1204892EB9BFD04FC3E84DC8340E53F969E5452D0D051441CBBE62B2112AA991409A184411E9548652A9ACFEB7747CF1DD324198E49C85A4E5BA42D083FFAEB8013923A2B0FC15B69B3089C6D0815A8DB11386B1ED4ED3C8B5D95CF4F1ABF9D3DF5EA1D00C1937C6B3463172CF599C78DC367CFE90E9A454383FA8E14E3C5F550E5AF60706FE1BE265A42FFF5F8A8026E8219EF868D5AF597DDB5719E5AEC48F5B70D32EA9A84CCA6FA06C5BD8D4706D9FDEDC6C261DFA4BACE62DA9490F5823549D3E84A0DFBF1C87E45A25041525604A75EF96EE263513D6563D1E79612985D4487C334B3E6F93B2A5E046CA5D7C0CC9338BD9536411F921AEEF532C970922E82DF4D35F28326DC60C2AA2B9B612937C395F5A300A1FAEFF92CACA810EE4A2FE50D61DAA1825F1790E4321DE55BD080000200049444154E39A3241FA778216A2762B2582FE0E76983A815DB7D8927CE89016EFE85444BE2D85D3DAC2DFAE798C6F5EFC0BFA1A62CC8A4F1CB4616F3191D9074EE5C6730EA04D3485D2AA4534E8030D0D03A5479799492B858D3E340243818026E8A14075836B46CF7F83BEFBAFA4D9EBA3660CC34B55C945652C2F4F299D22E57954532E85117BB2C9076E2448B7ABEE2292937DBDA7C7FB57CAE60EC8ED44CC278794CA14E2987B5F5C41D56C57A4D8D2E09092CDBCD057A90CE9112EFED58E1161F91695924F7FA9422D86FE728D8EDE025B6F3B87AA747B71C46F3AD98293FF249511C762C4A45ABA246E7AB1A83EC49323528D072229E556041D10E02B0BD44172FEF7083A5DAB61D77AF1BA5772FC2187B0C98809105A34B6E6F9F39DB7F1C39FDC42D06B31AE7D1316AE598DE742C64FE135E798FAA1FDB9E673BB336D586EA0196DD21F328EDD449F6DC836A56C23BE6FBBB843BC7AF5E5DF6F0434410FF10CC40F9C4AED859B49552B54ACE178A9320D6105DBCBD39FCED1E48944AD4834FD585AE65E8DE734131B2EA938A52A0C131DDDFB47D0E267AD2AB495877D8C6B782C2AF632EFA502E437C5F60D866563A59596EEE19EE1109942E711A657866A91427F91AA1FD15BF559B064057B1D7C206EE410DB268ED2610F74391FC83DC7D2BB3116A296AAC34011B444CB12398BCF731C84049E38D305F87144D57B3DA521043DF8251174BB6BB2D9A856AAA5B5EC3C67362B5E5DC315DFFA3E975DFE4D7EF7BBDF73D743CF1278FD3CF5E0EFB8E0BC9BB8FDC127C9BB25CCB441C3078FE198C3B763BB4D1A19D390A3BD2145168346D1ADCBE6A5EA0A2E8F3BEFDFFC0CF1F2D5977F9F11D0043DC41310FD6137AA2BE661CB0696DD8C6FD5C84435CC304BD1C99097CEDA76157BE77371B6389B309527107F641CA5145012DCA12C35DEC02A2B89643738067F27DDA8445961C5D4CC80BB9E5F40D91E456F254F6B730627AE25852D86494D34CB8E18FA07F8A55EE2BE6E2AC532A19DE585A5CBD9FD80BDE92D394AEB9CCE1818D245469A19AC4F6B88478704CB89902D88C45F235051B318EF47814F24042D8A0D71AE8B436A9277F6036A92D27003DC9A47E805940B450E9BBD3DF7DD761B15AF9B5D76DD96BBEF7880452F74B2D30EDB73F229FB73CE17CF63D6F65B72D1E7CFE2E9792F71DEB7AFE46B679FC1CC19DB70F2B57F2437A91DAFDAADBCB3278F1DC65EDBCE60C7A923D87C7833B6480E6D0F4BFA460696F2F70F4D497E0438327F52262AD98FF76F0B618857B7BEFC5023A0097A88118E7F369CAAF83D88A7853426150F0B439217524E6DE39921D9D0247DF08F31A61CAFFC306A460AD330A591F6EBDE424335CE0DBD0C935EB1EA585FB128FF436E14428C8EC3B26AC47D2FAC21CC657132160DB1386D48DF154735B89511AB32F05A894A7F2F6EB11B29D659DE5DA079DC44468CDF3469E725267142FA7279152DBF3E102167F9928D3F4971885E7A50A1B1A16B9D1074E4B9CAEBB926796ECFC7972792BE0A513564C133CFF38DCF1CCF9F6EFA0B857289033F30975B6FB983054FF533766433D75C7F2AB1EF93B61B696EC850ADF531624C3B76B6911FFCF82EBE77F5ED58ADA3A8A52D72EDAD984D368DAD29724695E9E3DB39F9C8BD9939B99946D5934195E7E0A53C3C33201BA7B12B29B135D11990A15ABBFF05D7D5043DC4935CFB512BA1E7629BB1EAE9A7A2C158BC2684A0A5896C444611F4B598538E53ADB15C23A5941BFFDF09FADFB148D2C04AC120BDFD827486FB5F5CCD0AD722C8E6B09D889C9485ABBD3B91039AEAC61249245BECA1DCDF8BE74397E897172EE2C80F9F841B1BCA8744352710125679E68177D9E0FBA0339D48E8FE8785E880ADA8A43284A445572D92BAA0E6614411B5DE121DCB5E63DEFD0F72E01E5B70EEA7BFC4D225FD4CD93CC3C9277D894257C0F8B12D5CFD834FA972F3AE354516BDFC0A63C78D64CE0E5B139936D7DF702BDFBFEA665A83566CF125C9655953ABD23A7238C5BCCDC87123C935E5D869F6243E7BC26E8C4CC50CB3930EE8A24591C839305C641BD854372E7D6804DE39029AA0DF3966EFE81585AB5A245656DDA22DF5D83EF0E8AEF29626AE255E1616A983AFC19CF24188C5D722A388CE198C2A8730C5A1A871BD822CE90F9884D0C97755EC2C79E228A06238FCE9D105782D63F01D090D4332B6C8E212273E6983E898E0578A14BBBBA895FA2984799E7C6131071E7918919D52EDBBAC7843828E09C59F44DE6B20921E8C9E93CE2852889244D0834E75838528CA6B43CC90DC9A4A4184529052E8A7D93229AC5EC5734F3EC175D79DCFD2970BFCF9B657B8FFA17F72F229473263FA445A1A0C5A9A436EFFDBDFC86787B3E76E07D0B16625B7FEE1377CFF47DFC049A579F6D9153493E2FC2F7C8D934EFD149F3DE7AB5C7AF5B59C7FC57759532A936A6A62ECA6DBD0D21EF295730F65C7F16DB47806D2D230CEC414EC1ED2E4C459E41DAD197DB2466010014DD043BC160A570FC712B20BC5C14ED201C9111A426992E290C7610BFBE06BB0A61C9FB47F32322A82960D3495E4186A825E5F78A1C4C76A335015331B067E9CE83764B4EB2A2177CD5F8C317C3C9EDC60421FC7B155946DC621761CA9AAC15AB18F425727AE5B664DA5818E52C8DEFBCFA5588E483989E9937436970E3242CE83C4FC3A414B9BAAA4E824A9381C685FA53AA3245AE7A44B8A4F59957657A056C1AE9508FBBB39E9880F302C6D33BAB51133DFCBEAD53E07EFFB151A1B263179B3164E3E651F86B75AF475F7F2CC8BCFB3EBAE0770EFDFFFC9E1871C4426E3F2D4530FF1E1138EE495975FA2C7ACB064D93226B68CA53DD54AA9ABC2AAD55D94FD98C52B56F29D9F3DC4F0995B307C6623271DB907A7EEBE15CD527B640694CC126933AFF2D1FAD0086C0C029AA03706B577F09AE0FAC994CB05CCC0252D41B37430117296AA3C89A08D80BCA4340EF801C6E4E314998BAE5808DA56E5D1923A18BA52C2F539E7C1D26531E9B74DD5DB45DE5D5A5B497C2CFF5ED553E4F9D5FD54446962DAA4CD5099F39B86A1BA86DBD2F3AF56A1DCD7435F7727A665F1F7C797B0FB8187337C780B962D291EC5FF6AD3D11CCC418B3A43EC3D37F8BE3EE71C4B014A42C8F225E725C52E89E74625F0A889C7B35B26EAEB66C72D3767E7ADA733AEB5816A7F3FF9F610C76EE513A75DC1A8F6ADB9E3CE5BD8620B87AF7CF9533CFFD44BA41B1BF9E7932F72E75F1E61FC98F1FCE52F5770C9A55770E10567D2BD76152F8B4DAA6973DF1FFE42F7E2251CBEEF41D8864DD3F0761E7FEA69FEF8BBF90423A7F25CE8921F9BE6CC0FEFC1E907CC62982853220BC39466BA43377FEF6029EA53FF1722A0097A88272DFEE31CFA562C53C51B29A9A88BBC817E2289839CA822F262283AF71252DB9EAE36097D33A7521CA225561280219471254D5B8D0183A224CD508DC1B7A018C5ACEAF129F417F0BD12C520A6E234E25A0D4A98908983646350F55B0CB0A5CF5FA5CCAA55AB946ED9F502E62F5ECB11C71EA3521BB69D5404268E49E2B9A11C945409F8E0C6A0BCFF863D054562E70D74E81EEC37385829A80A51028F6AA91FDBF318DBD8C8DCAD66B2F099C7297675B2E71EBBB0DB2ED329572B546B16E5628A334EFB1A1327D99CF0E18358FAF26A52D91C2B56F7F0DB9B6E67CE9C6DF9F6773EC96DB7DDCE2E3B6E4DE4D5F8F54D0FB272450F871F7200B5723F861571EB5F6EE598134E20D7DA4A5BD5E1873FFB33373FB914B3BD992DE64EE0DC53F666FF2D273242B091FBAB4E410FF1A7ECFFEEE535410FF1DCC6F71F40CFFC674899014EEC6346BE4A1724F95DE980EDA992EE759B7F9E31FB7D4DA5380245D0D2EA49F46D434DD072133030C2C454429C2F0A112CEB2BF15A6F0FB5B85911B86DD6A8192655D2F846063B0EC906D2E15B3A8E8865AA8F11B84AB1B262E56A0C3BCDF30B17B3CD0E7319397224966DAAAABF58FA184A45626C27052952711825043D48CE83EDAB948A230A14410FA634E4BB44D02AFF2CB6A241153C0F2A35361F3B9E7FDC71277BEE3297FEEE6E5E7AE515F6DB792E471CB51D815160D99290A71E5BC5EEBB6F45ADBC825A31E437BFF91D677CEAB3445696C99B3573F58FAE67FBEDB660D309E369691CC66B0BD788768ED809C8B7E6E92DF662DA0E37FDFE0FEA61E894A38FE08B675FC0C2650195FC1882116DCCDC6132577DE33866B66769B2920A497D68043606014DD01B83DA3B784DFCE429743DF4371ACC72D273500C2A25571B47CAA8DF97926EC364C5B88F30E5F02B54FFBED01215479438A629B3A477F1011F308D1E4C65AC57650CDC24549188BA59386A7B704D6F8D97D67651304C3CC7A212E6712C87C02F82E3E0463691E1908A4352614D751F17FDB3349335028FFEEE2ECAE52A1D7D551E7DF2394E3BED23A452367D85122D2D0D542A35957B0FD713B42FDD739583DD86F2BA6453302408939CF3A0D786AFB4CE49614A4D9425A502D5DE6E0ED9772FAEBCECBB9CF5E9CFF3D0FD8F512CF671C209C770CBCF7FCBD7BE7C3C86B994575F2971E5F7FEC2F84DC6B3EDAC49ECB0F5D674AE5EC71F6FFB2B63264EA4B7D8CD9C1D66B1CB6EDB532954F8D5F53772E2878F401CF59C6C23C56A05D72B6385214D99567AD7F443D624A886F8FD39CE38F76A9607CDB46FB50973E636F3EDAF1EC1845C9AACAA0B95BCCE7B2B881EB40891F9535D1E076492A249970D5CC348BAAFDB91DC24D4CE873A49D443CA1F45B54C9317CB1A88555B08A98D9453A579B03CDD88DA48CE16D9A5DC5C4571230D24D475A42069A0964AF59834C44346AE23FE2B725E2649676D38C077B194DFC1C7EEFFCCA99AA087782AA38E5FD3FB876FD15A5B4864C714CC16522164C22A8101A9D8C24DC3E2CC66CCFCF0AFC19CA68C8762A32A52006506FF6EF87950D89CE4BC078F444DA2B2CB9272301C4AB1C1D29E2A4BBB0B54CC349E6D2AFDB2944527FECCF201947B454232C9E74C7E1F62588ECA2D4B045D5CB79AEEAE4ED6167C5E5CD9C7891F3C5A59DA27A9147515E54297E49CE51922911E6E98D6D83082F6A46D95E711490E5A0A5324A551A9A8CDC352B54CBACF65E2F01C3BEEB025975F792D3BEF79223FFCF1EF69CC44CC99318CD1E336A1DD89F8C8BE5B53299578F0A52EBEF9E31B69C9DAFCE0C2CF31BCA19954DAA416F4629A0123478F52E5E8E96C036BD6AEA3211392B64772EB1F9FE5A73FFF2D3BED3699CF9E792CA15BE5E17F3C855BE9639B6DE772D6B997522A88F470187D61992D769BC60127EDC7A70E9A46ABDCCCA4DFA33DD03CF73D5A7312C18B8795638AD4519E4EA41FA4A86EE4A6EF43E0D26F6769940638194B7590376B3115DB206D4658F2A8D49803B3A6DAA7B94606978CDAD24CF91E666C52B60CD281811D9AF85903695BDC105631BC102FDD84257BCA86EC8A4A814E96A270B7DDA9DABA398C262B9AF728501E2C9695E4E4F5F1F611D004FDF6B1DAA833E3EEBFD0F5878B18567C8AC88928182DA4C5BA33128236484526153BA2BB7D3A630EF81E4EC32E4AAB26E5DEC48326421BF5D6FFF2A20DEB5112AA566A5DA425576859BCBCA29B1505173F9DA71C0B61259B849661FDC74774B113352C5B79339B7E8DAE95CBE8EFE96675BFCFEA121C73E4C16A4350D1F9808C6E43399DCA3F8B5A63E06B707370705350BEAB085A1AC0FA89539DA43CA41B4B10F8581DCBF8D89147B3AEA39F071E7D9A89336772D9F7AFA3219561EF1DE6926E4A31A9CD64DF591388A390627A34279F7901DBCF9EC5974FFF20EB962F66930993C9E5B2E4F216CFBCF018DB6C339347E73DCDBC47E7F3C9D33F486BE36876D8E144EC741385EA127EF1CBCB18D6DC44B53FA26BDD6A868D18C7E5DFF915CF3EB38A6AD1C268C8100F7398B2EB747E7CD10799D29C262FC657E67BABE6902D8A820569A34A26EC5237749FE154312875C6F42F5988E95718D5388678935184AD262D22018C3D0AF214E440D417910F2DACB80AE24298CE40569E7044C79D6C116484D8A54182A16267AC4872F1D2BDBD819A111019EB543A2EE8CC11ACAC52EE5F43DB84E1348C9F94E4DFD58DDD2008636C5B87D0EFE4D3AC09FA9DA0B531E7961E63CDEFCF6758CF0398A98062DCA83A55A7A31ABE696187E0DA117D8D9318BED3E7C94C3916EC4662533E0A495EF8DD2CE97F2914FC5796567F4D1178656D81D5BD253C2B4B3934A945F2182CDD4C447632687C9CFCF11B56FCA91F44E2F56C2711B45FA5F3B5457476ACA5BB0ABD6196C30ED95FA52FDE8CA06331F35776A2AF47D183E90CF5B3815CB31F0454C567C34D0A572AD59AF2953E785A1BB3274CA129D3CE074FFA1C97FDE43CFE70F7A374ACECE7D8433EC4F537FC80D33F7220E31A22D6ADEDE4BA5BEE61B7438FE59E3BEF62A71913B9FDD65F336AE4142EBFF43BDC7CF3EF39E4B0AD99386524AB96AEA3BFCB66CAA64DA4528D9CFE89AFF3D83F9F66ECF83C37DEFC03DC7285790F3F4357C75AF6DEFF103A3A03CE39EBDB84B51CFD55172F6F307597AD39FA986D38FDC839640397BC74087F0F8F582259B5C79BC693DCBE1FF3F83FEEA56BF1F364FA97329A1EAC7C1F5DC50CE5DC6638338F658FBD6790B65FA537DC8CBB6FBA95CCCA05D88198F405A46217DBB1E891272A274DCB88E14C9BB60D13B6DA92C84C618719B51C02A9963422D25E86FE5AC4F3F39EA6F8FC0334F57591732AD83997FE4244DADA1263EB6DD966FF9DB02C1BCB929E94EF2100FF0597D2043DD493EC2D62D9EFCE63F8BABF92725CCA718E7414A90F836B8ADF863C2342879FA369C671B4ED750E5813558BA7A479AB52196FF42885E6E51AEA4BF1A48445EB1314BCD8EFB2704D0F66A691A21B53F5C573437ABCC8065E442C8FCF1B3443FC57825665808AA0C5ABD9F26BF4AC7C9555AF2DA314A5E80B331C74D001181B44CE09A7BF2EAB53DE1A1B94720F46D212354B9E9940BC365C65575A1583A420A6542C12F8210D992CC76F3F9ECD86359273F23CF0E87CAEBDF9779CF089537869C1329E78783E9B4E68E48B9F3E816ACF3AEEFDC7032CEF0DF8F417CEE6F00F9C88E397B9E27B1771CFBD4F73C4078EE54B5FB9844AED65BEF08593D86EE6F65C72DEB57CF582D3952F75B968B368D112468D69A6B9D5564F162B96AFA3D8DB4FB11A71DE85DF27F41AC1CB91CBB75124C0CD5BEC7CC80CAEBCF82426A42DF2EFE64EFB062BC02B7790B22CBC541BDD86C9E2BB1E24F7F8B54C0856109B06153214320D44568506B3CAC3A55D69DF692F0ED87B1AE57233F32E3F9E1D534F53A285A23146A5DE6CBF4A94CD129A1E4EB08E55CE4CFAC7EFC95EC77D1447FCC009A8A4C5AA0058DDC17DB7DCC288C22236A9BE4CDAEE635593C5BA544C5BE833A650E581CC91D4C6EDC071C71F481498A4DFDB7BD4467F2EFEB7BC5013F450CF94DF85FBCC0D541EB91C3BEE51CD5453518013B9D4A48388FCDBB4107BFEB07D366D879D4F9CDE8EC8CC100415D229A9D8DB789D5642D0492357214A21FB2836D5E36B6F31E29F6B7B293B692A5E8C1BC8D691E430939CB36C144562AFF91F884572C8A2C63064C3A856A47BE5ABAC5BB59CEE52C46B3D2E279E7C8222F14AA54A63630ECF4B8CF5D713759844C4EB9BBE4A7F412FF9999C170F9A20051E65D7558649B2795AECEAE599C79F20DDB7861F5D760E5B4D1F492693E7F1675FE3C63F3E496FDF5A76DB692A7B6DBB3993C78C52B73891D3C5E94632F961F4F616F0AB2E66D6E0873FFE0D8F3EB2889AF872640B7CF90B1FE3E843F6E5739FBA880BBEFE6952D92C5E39C27152144B3D9856CCFC679FE385175EE188838FC28D2C3EF9D92F512AC4185507C7CAB1A6BF8F389F62FA213BF1D1930EE288EDC730ECBD26E8C8559BC9FD4686754B9752BAE92B6C5B7A82523C8AC78CDD78AC6F04A9C060845D60F3D1060FF64C259E309CB33FB13D950E83BE5F7F8871C6632C6E9CCD7D9D9B60D348BEDC4B4326C5844697A9F1227A228FC5B93DE96BD999233E74004EDAA54A96B8EA73E7955F6686F90C2D6E0706395E0B46F38CB719DD8C6462762D33332FF0626E1F9E586D71E1859F259349E1BCC7180CF5C7F7FDBEBE26E8219E019F107BF59DF4DD7A168D6617653722A3AAEE3CCAB62820E45131C2B13374DB6D0C3FF6228CD6C3098D1C50C65666F642D21B77BC4ED0D180FEDAC08B6DA5695EB0A48B0E334D119BB21712881D9BE49C55501FAA6A3FE99FF856872ADF362D2CAF42EFAAC5AC5DB694AE72C0AB9D654E3AE524C240042022AB4B941A83042D242C298E0D095ACE19AC1454B9673791D3557D5775E5F62AD21BD165B76D77C02B14B9E16737F2A32BCF62F26893864C063B358C42458A1C037ABA1662F47562C729666D3F173F3229D6623C57A47A36352FA4BFAF97AE9E3E6EBBE36E76DDF300EEB8E36F1C7FCCBE8C1DDEC294496D5CF1DDAB69696EE0A31F3911229752D1E5F91716D2D1D9C3E8F1E3C91A4D5CFFABDF2A23A9CD266FC194311369CD37B3BAB39B2B7EF8030A63C771D4B107F28D5377A17DE31F84DE700ADC183C5102F970E795E7B3973F8F8C5BE01E675F7ED5B10533E7ECC22E5B1A585D259E796105F3BB5A38F4804D396A778717EF5F4AEEE95B48971F635EE3CEFCB6631AB3666ECBB04A178E14012D9BCFF63CC7A60D4FB32A9ECABCC234B63FEE48B6D876734428FFE0CF7FC2E8E2C38CF75FA1279CC67DA56D9857C8D03661025B8C9B0AE51A85FEB574BB2BA8FA7D5C70E199CA43BB29FDDEE6E1DF6A6DFE6FFFBD26E8219E41D940CFBBF3A9FCF634D2D557A9D43C55E061C63E65274B1007646A11B94C96BE3022B3D36964B6398FC068C6762A18AA4865E39F0B239153A9085A35699226D778A458B0B6C0DA8247D56EA4AFEA2BBF66496D84A6A12480A6A83CC406F42DBA564B418DDA20340DD2A14BAD6B054B5F7A918E7E97A55D658E3CE6785A5A5AD6E799A54D9510AF1C4AE71C78EB497BD06F6330BDA108DA8B948D682DA851734BD85180DBD5C5AA050BB9F4BC2F70D58DF771E807F6606A7B062A7D4C9FBE19BDFD0141B91FBFB0964AA183719B6C46C3C8B1ACEA2CF0AB5FFE99BBEEBC17C7C9D3D036828F1E7D0433678CA310F6B0A6DBE3E28B7F49D7AA125B4D6BE7A69B2E60CDEA353CF9C4732C7BF5795E7AF1058E3CFC38FEF0873BB9E0A28B31530EF3EE7F86CBBF7B159FBFF0CB2C5BBA98E71E9BC761FBED4FEBF026AC5C23277CF3A7CCDE7947AEF9EA616CDAB4F137DA375AA6BEA497AA866A6270FB8F2F619BDAA388F1EB2FDDED58316257BE79C63EC843DA30F12B31AA2C5CEB33A1A989B6BCC3FDD7FF9A293D0FD3DEFF127FF766F1407657CEFFE2518C523D326D2A3D259EBAEE3C66B8F7417A184F9B3B707FB8299FFCEAA984CB16B1F2E66F31D95B41D94EF160EF8EDC5DDE8E5987CDE6C83D724CCC882777131DBEC37D773D854389A38ED84DA94BF2E29FAD8FB78D8026E8B70DD5C69D289B708DFE624A7FFA2CAC7C10A9FA9506ACD26BAF665B2293205B4DAC484B86CFEAD6B94C3DE63784CE584C45D0AADFF51BBCF9DB7B561C30F41C284189F0B1E98F2C1E5CF01A56D3487A2A21C5AA4F64584AA69594AD0839872A8A4EDA6DBD79E8A7FA0286E2D46792C6C328F7B070FE93ACEEEC634DAFCBE469B3D879D79D09FC88C077B1E4FC40521CB2AB2F46FC5ED21965E04B22EC0D2B05FD5A42D055BF8CEF96A8F47672EEA9C7B372C16BA4A398DEA6F15C7AF97534F906516105BFFFDDA52AE2BDFE873FE1B8438FA1A13124C86458DE1773F6972E22F67C769E330727DD44476F95E7EFBD9B934ED89FDD0EDA9A15EBFA38E7ECEB30BDD17CFA8CC3193BB18FE1ADA398B3ED0C7A3A57AAF6590DD976F20DADACECE8E2D2CBAFE643C79CC0CF7FF95B76DE6F67082B6C3E7E0CC3F30DFCF4FA9F70FE2517F2916FFD89747333179CB62773278931E97B7784D29751CCB530B9F97BE7B347F13EDABC753C9CDA9505AD7BF199334EA42B65D25E09B1AD92B2B935C8D3938687AFFC2C3BAF7B86D8C8F0337727966DB2075F3F632F8645FD94CC462A58CCFFCB4DCC9AFF1372B5152C6ADC99DFF907F191738F61C1CFBEC9B6C507185DADF2687A2B6E7B6D34D3F63A81A38E9F4263241D83E46F8CF19C022123707D53750C13AB83D4DB5BB6EF1D48FFCBAFA4097A8827309260D1AA5179F12ADC7BBFCEB0A842C51841D94ED360AC22ED8B57670EDF76A9A642CAF658DA77FF2EA98987534B87A4C4C2532A04FEE590EAC2015BCBF59AE437FE4314E14612074BAE187CD3E0E9251D744459DC6C236BBA45533CF8DAC11AC76463F1F5E3CD3F5586E12AE327F1B696C6B2B15B61D5C21759B5F879FC420F0BAB8D7CE48CCFD09C32A15C566DBC64C34F142CAE48B7020FDFADADCF392B82964AC101AF0DAF641008095965AA95027DAFAD65EB899B71ECE187F0EDEF5EC631271FCF0DBF7C84D5AB237A7A9FE313A7EEC3A66337E3EBE77F97899B8DE6F2B34F20D732828F9C7BB1CA935FF9D58FB3E396A3A9FA16CFAF2C72C7BD8F71C3357771DD3517D0D4BA827FDC3D8FBE8E51FCF5F687E8E8EE65DF5D6670DD759FE69EFB7FCBAE3B1FC4DF6F7F96CEEE356CB7DD4E7CF8F8AFE2C515CEFDE269FCE1E61BF8DCA73EC5A3F7CD63D3299BB2FF413B70F7FD0F538C46F1C7975FE2B493F7E7B4ED27BCA7AB4DBA4566FC02AE95E3E69B7EC3E66B1E6246F1290A768E27AC690493F764E79D0FA075744C688BBFF6301A82802E1B9EBEEAA3EC565C4B2908F852F518C6ED77109FDA6B1223E4DE6942C5A9B178DE0B180F5F417B71111DF11CBEEFCEE60BE77E08EF679FA1A9DC45D658C96F8AC7B230DE820B2F3A94E10D364E281D7294D90AD81EB1915515B37224A65BFA78270868827E27686DC4B9A2550D8D10D37D94EAEF3E49B6EB452A760B552B4353B40E2754A69D0496476805F4BB799C714731E2D00BA96546E39829550CF02F7237A5554AB419830BFFCD861624E67409E1C652681073FBBC1709DAC6E0655AE9E82BAEFF006DC49F8761788ACA43C3C68C6C5502DEB772298B9E7E9472E72A96780DCCDDE750369F3491946912879EAA0E9492725F0A5444DF3CB029385831B861046DD464F3B24A6FB55395CAB7DB3976DC720BB69EB12D9F3DF74CCEFCE2197CE3A25FD1909FC4A1874F65A7399B3365741B7FFEF353DCFAD7DF73D159A7E21A0D9CF2854BB9F8E2AF73C0D6C358F0E03DACEEEE61EB3DF6A310C0F9E7FE9AA99B8CE0C453B7C2AD5A2C5B9AE7E22B7E42D1B31991A972C5B74E65F369A358B9D4E39C33AFE5D565CF71DD0DDFE1F179F3F9F90DB771F24947D3B96621471FB63F77DDF17766CD9A819331E8EEEFE4F1A78BBC9C35F8C021DBF1D5FD676D0CC46FFA9A622C7E2865D59D27AC05FCF97B67B38DB99031D51EC2D861B59562913D93691F388191B3B6A318A41961B8ACF60C965CF73166F72E655534816F15F6E288D38FE6C0CD52495B2450000020004944415438D50CA203ED4D873C72CB1D8C5F742363DD85BC1CEEC3CFC35D38F903FBD27AF7B1B40625AA511357F7EFCBB09DF6E693C76F45DEA8608AB56A6C612A05928BAD9EC074DE7963275E13F4C622F7365F270189E88053FE6BACBDE51C9ABBEE2132CAAA03494E74BE468A50A46C7180159B78D8F464C632F6D84B305B0E2634C51B3A79B30DA38FA49C578EFFBCF3346886AF4A7531E8F37CEE98B790CCD8C9F491A2AB2071D8BBE8A9674A8C2EE5BDB2B92816A92161B18757E63FCEF29717D02916A30DC3F9D827CFA0E69BAA3555E057802A515021F04DB569B7BE947B40F7ACFA0ABA2E41B9821F5429B9FDE4CC88ABBE763A9DAF75D2D3E9B168F96A2A7199052FAEE5B0030E62F1E26748D9DD8C6C19C1ECADA6D35F2810BB21B7DFFF14F73CBD884B2FFD22D5154B68775C868F18CE9FFEF14F8EFCE011DCF8B387F8D5F5D7F1FBDBAEE0C9A79770EDF577538A435E79AD9396B0C2772F3F8B3DF69EC5F5D73EC0F5D7FD85595B4FE6F2EF7C9217172CE7A3275CC2965337E7ECB38EE77BDFFB1A975DFA4D962D5BC6C8D179C64D9ACCF7BF7F37FFE85EC9A107CFE6D2A3777D9BABE6ED9DD623867931E4251555EE63E51A97BFFDFA77EC917E82A9C17CC2AA4547F30816FA3319B9DFC96CBAE3741A039FA79F5B8B79DF5798DAB79027E2A3B8B9773C5FBBF818C635B96AD7314EA5E8B072DCF3E3EFB35BEF1D0C0B5FE576F743DC6BECC5215B3430ADE333B4B95D2CAEECCD8FDD2D39E5F39F64DBF698146542A3119714E958785E34F2B270DFE3DDD1B707CFFF89B334410FF134D6C40D21B671BC1AC66BB7B3F6AEAFD2182FC28A629C20AB22E9C8ACAAEE22693F8BE104F46543CA63F661DCBE3F2776864BB5B53A06930E49563871817B2BB73BD1F00ED27B80C10B4BD7F05A7F48D43A82E57D152A012AFFBC718784E6835E1E49F33DC3F7C81A111DCB17F3F4A30F51EAE9A6BBBFCAAEFB1FC18C39BB52096302AF841915307D71C9133545D2DE6AD0EB59550B0E347F75AB255CDF5515686EE73A2EFBE2695CF8C58B193366138EFAF007B9FC473F62EAA4496C366632DB6E3591C6C68011C35AF12A350CAFC6CA557DFCFD91677968FECB7CE5ABE76214D6322C1D92766C1E7F6E21071D7B30D75FFF0077FFF5CF5C71F9E758BAA89B2D664CC46CCC70C659E73379C4443E7FD68934B6BAA41C8B6A25522649BEEBF3DCFC97F8DC676E60E2844DD8739FE90C1F9562D3299B71CD35D7F389D34FC10FE0631FBF84E17B6DCB41FBCFE2BB1FDA6BE3607E9357F55423D5D731A3AA38238A298B57D7C003BFB89669EE4B6C9AEE245B79896A763A7F286ECAD1E79EC5C4D646EEB8F116A62CBF91B1C525DC6A9DCD93C5980B2FF930CD8D06B6EBAB660CBD91C953979DCD1CEF3EB527F18BEA59AC6ADE9A3999679963FD9811E52E9EF28FE3267712DFFCC627185E91BD458F3863E35B92EA30A47A5CB7FC7A9733AE09FA5D02F8562FAF50C189B3AA5ACBE87F85E57FFB222D7D77908F7C023F8B6BE789CC32E950E476594CA348351FB29CD16CFA815F638D9A4B6CA654659F10ACFC9FD0A9FD76095A92E052A21B9B4AA1F1B7879FC5193599DED861455F593579DD783B53296291CC49926E91540A5148CA8C092B65163CFF0C2F3E74972A2E09D3C339E2C4D34835B4889684D8EDC531AAB85570BD5891B3786EB89EB7DEAD4E5CEB6A5E8DAAEFB3D72EBB317D4213E31BF2B43799146A31E75CF84B56F676F3A1C3F6C6E8ED60FFDD77E65B977F93CDB79ACC991F3F99BFFEFE4F6C337B575E5CB29A6F5F750DE77EE10BCC9E3E857F3E703785420F471C7928855C9A8F7DEC12666F3181CF7DE238C2A2C5A8F60CE9E6027194230A1D8A45172753C2B2FB09FD18B76491B6F3D46A657EF8833BE92DD638FD531FE195258B88A23C6D6DEDCC7F7A35DFBFEA87586686C65DFF5F7BEF01675759ADFF7F773B7D5A2633C9249364D2494FE8810408254020107A1514A509285C2B5C51B0FDB162E17AD12B551451505069222DB450426F0984F46432993EA7EFF6FFAC77CF00FEAE7A31578573EE7BFC8C199253F6FBAC7D9EBDF67AD77A9E891C76C83CAEFC0713F4D67C99918952A495527695864BD9AAA5DF8597EE7D04565EC7BCD21A0A56995F1907326C971339F1D0E9DCF495F339C05C438391E3BBBD6790AB37F9FCA5A7E359267581DC0D853C7BF7DD8C7AFC1A86DBAFB035369D6FBF711CBB1D3E9F86753730CDBD87B6528E67AD45FC26B71B975D762AF552D228E794AB7B28ED8E26986E16439C77A495443F7608014DD03B04DB7B7F513E289030E2846503D32AD2F5C40FE1E96FD21876295122DF88631AAEFA92C57C13DB2A51C62597188E3162090D4BBE04D608354012DAF177B26855571EDCD1F95B197028356269B4B395C6D86D7F7A8AFA8933E923C6C6EE3E8ABE7823EEF8D68D123D7B3B471F6CCA33450D2DA0A7733BAF3F760FAFBFFC3C3937C6E499BB73E4B127D2D3DBAD7420F232F411C62895223951C99A0B8582EAE2901F21683F2CD1DB9DA5D4EFB1D3E8E1A4FD6EBE7AD9795CF28D9F71DF531BA9696AE582D30E266C7F95B6A6D1FCE28E3F306E562B272F3B98D54FAEA679C418B26597AF5FF12D0C27C1A5977F9ABADA46D24983D0F5B9EEF70F72FD0DBFE6A6AB2F67FAB811AC7AF24D9A1A7CA6CE1449D5563AF3A6BAC0AC5BDBCDA68D5B88DB0E93DBC633A2394DCEDD403C59A75A148B9EC78DBFB8931F5FFD7B468E984DFBD67E628E49326E327CFF091CBC7836571CB3F77B3F71DEC3339F6F2F31AD394ED6F748DA01714FBA62E2F4C64D1A0C8FE5577C92D9FDEB20BE959F7A87D357BB3F9F3F6F0F565EF571660DACC5770CBED77B32D3164E64C9D18B9415594D18D2BE761DAB6EF80E0B78938D5E0F4F9BFBF0E0C0122EB8703EEBEEF92E6D5D2B98501E6095D3C8ADBD87F2E9FFEF0C1CA78BB4E1E3969B942052BF1B128B6F236DD6E0907E0FABD14FF94B086882FE279F17223A6385AE92690C2C07B3E739FA6EFC18F5E5172864E204A5003B94DB4203C32860BA3E7133856F66E8370C1A0EFF3ED6E84520BBE1926DCB769F61A82CDA08DF0B418BBC67E4BA9DC3E0DA5FDF4FDBAE7B51882558B3B59B82FFCE66E38E40111A8E924355F295D29E271D1D22A064A0C6BF7BDE7A8E271FBA8F2D9BB7619B090E597224D367CD637B4F3FA16DE1CBF049B1A8C8F96D19D162311A4E291428F76F62FAA4193CFFD88B4C1AD9C0474EDC9F29D3C772D52FEEE2E777BF82E18CE04387CF6444711D53C7CC61F8A4A9C4471BBCFCDCF3EC3C7A26EB3776D1DDDF4DFFC000D7FEE257F4147C16EC7F10239B1BE9D8BC96071E5CCE19A79FC8474EDA8F526F179FFCD897B8F207FF4E53AB855F1CC935B73EC435D7DD4BB61B6276248BEAE713EC397F1A177FF1304C7F1BF17892FE9CC151C7FF1BA1398E7231ADCC6893A9906C7707D34F5CC0818BA673E9A1737704E2BFFA9AE52FF76076BE40C9AF61E61EB349A665332EC492B69C4D1B78E4FA8B99E06EA62E3D8C6F761F44BC6D169F38752E9BAFBE90C9D9B56C89D95CD3B194E33E7A303B4D1F4D6A0036AE7C90179FFD23BBB8EBA0D0C7869ABDB866531323A72FE0B367EECCAB7F7C88F0A91B98126E2517CF73E7F6391C74EE6718BD531386E1922866E85EDBCD6D8F3CC8BC23163273E468A577AE1F3B868026E81DC3ED3DBF4ABA380CD910B33D8AA44996B6C3BD97C3AA1BE98CE5A81103553F4D4114ECEC0112B2E79D1F4EE08251D7CD86BAE319B7E40B5899914A44493269C978A56D2ED27296B2C7DFFA0214557B9D4F9C7E0CBE7FDD1DCCDAEF10BC548C551BBB29FEAF6AD091E940547491E11B29770C0A2389BB77E093087A59FFEA73AC78E041063ABBC8A4EA386CD909A41BC7900B2D827216AF9853043D24C45F2816D4EFE57C8159A36D4E3BE6381CD75166B00D992279BF8F52A6895FDEFF263FFBF9439CB0FF78164D4EB3EAB94D6C0FEAC8D794D875E729AC797C0D4F3DFB227B2DD883B6B6B16CEDCE71E7F2A758BD711BC54296712DC338E7D8C338ECA0D9384E9EC2408EB0D84898F2F0623E5FFDFAFDDC7ACF724A658B45FBEE43C3B02CCF3EFD04935BF7E1D1875752DFD8CBCFFFF3226A1236EDDDF0F14F7E879EFE7A5C2F86E5942996B7E0040E7B9F7924072EDA89F3F6687BCFE7CD7B79E2750F6CA2F9B1EFD26667595D4CC08C0389373431B2FF657A9FFC15A3EB33F8561785DEA9FC3877388B3FBC0BA3682779FB8F18EFBEC9FADA18F7761D43F33813AFEF4D66974A38DE469CBA80E1DDABD9D638953F6D5CC8B32367F3D9F3F763565D407E4BC8CB3FFD1463BC97899BEDF4245A78313B1EB7716F6A5219D8FC388DC902EDE6249ECE4EE5924B8F241DDFF13BB4F78243353F4713F43F39BAAA575526BE905AB008DF17B08B2FD1F1DBCFD0D0F358E4AA62D4E0ABDA7289A457C60A2D3C234ED10E088218995DFF0D6BFED984660DF8F148BAD194AE8F209A34FC5B042D32738107A6435F68F08DEB6F67DEE225E4039BCD5BB6D0EB5BCA20E0DD850A516697B6394983653333D2F0F82B8F77E94C0F493045521E83FFE58484F901D6AF7C8A571E594EB6733B4DE32670E0B127D1175A38857EF2A51C652FC0EA2DD137D04B4F42748B7364D66CE6D28B8EC149268967C6E3F9363535A841979A8C8CC77BD4C4928A408B5E89FB966FA0409A0D3DDD6CE91D60F98A57097B363363EC704E5EB698FA5840DCF049A513340D6F220C02D209838194C34F7FF70C9F3C6E4F9A0A050A81CDAD4FADE3135FFA05BBB68D66C6B4312C3B697F72E52E1A6B62643B4D1EBEFF756EFED51FD9696AC0B7BF7C1EA5EE1E36AEEF6563A7C5EAAD796EBEFD16B0B3F4D3C869679EC6D1FBB471F8ECE1FFD0B3ED0B573FCD813DBF64726925AEDCA9A59A28943DD27681B0DCA39C6FEE491CCE539B32D48F1CC7173EB1989577FC07B56B1F618CDD4E10F4902FEF8C6D94B0ECCDC48D3EA5CBB2C59AC8E6DC789EDEDE4C7761181FFDF449CC9E9A202D13A6A590577EF32B7A5E7B9011897EEA8B5962E28CA394EA4AF4960AF426DB7883793CD73D96CBBE7134095D82DEE1B86B82DE61E8DEDB0B65233B1E8AA07A3442EB192242B48D6DF77D8D86553761F839CA665CB95C883891882809F18AF07AC94C12370DB699C3695DF615CC96C354E3BFA8CB891B4628A2EC6AD2F06F8CCF2A6D7E5F357BE40C8B2B6EB88399FB1D4C4EF4387A7BD89475295991F345A4132DC42A433092A34B79E65DDCFD1796FCB78494E4E9B2A32F62F56937CBAB8F3DCCF32B1EA72F5F60CACEBB3363B7DD31F359FACA0525A294CEFAB8BECB56AB0FAFB793C39BC773F8DEF37063218FBDF43A2BDF5CCBB0E666280EB070D6540E9ABF3389708030339C8BBE71134FAD952DD90C1BB76C2799A9510E3066AE9B0B3E7C3CF16217AF3F711F7BEF3C8DF1E3DB48A4EBC9FBD03AA296AF5D731B773CFC34171CB127979C720879B38EC5677E93ADB91807CD6EE4B0430FE05B57DFC45B6BB78AEE3DFBEEB633E77FFC14BEF8951FF1E48A97B8EEAACB9830A2482256A4CFAD657D579AF3FFED0A42D13989599CF6D1659C73F8747619937C6F27CD7B7CD6795FBB875D272729BCFA47761BD64DA6EB791A53D01136B2D69CC2ABB961BC981B8E93A9E3C2338E60FA883477FCD735C407DA49967AC8181E39B31F6C714649902BC6E9C8D5B2AED0C07AB791D1B3F7E094C3C73069AC436005384680513254C7C8C3B7FC8CEDEB9F674C720BB5564EB9AEE45C9B2DA53AD63196D7CB6319367B5F3E77D2346A7502FD1E23FADF9FA6097A87A17B6F2F2C49A7912268F117B4281A32B89D85EC1374DCF4EFD4945EC1A68827BBDFEA347FB7EF8945214C924C6409D3B3C81CF913BC9AA96A08C0F293944C4326C59563C95F7DA8B78B2C8D8AA6CDD5BF7D90DAC93B9368A8253B90E5F56D39CA9608330DC99146EF34F48EFFF328CCBB9D5AFEFB510849958B39124609BBD4CF9AD75EE6A9C71FA354F299376F1726B48D27E7BBE473399C01A93BF7D3431E6FA087CB4F389D2096E247D75CCDF91F3D85FA38B48C6C0227E0E2AFFD80A9B376E1B3A72C521E81B73EB989B3BF7223E5C428EC641ACBCB92A44CB6B79B96BA04138739CC1C534F2666B2C7827D39FDBCCF901EDECAAFAEFD3A3FBEEED7DC74DDCFB8FDC75F66FF5D67F27287C511675D4EAE2FC76DD77E812F7DED3BACEBAEC3355B280FF451EE7A934B3F730AC386195CFED5DF71FCB20339F6D0D1A493033CB6F24DFEF38627E8E86E249B8D939918E3C4E3E7F3995376656CFA1FAB4371EE976EE64B179FC8630FBCC0630F3DCD404F11279654834081E92A3D9071139B38EE9803A94BC7B17C7073257EF89D9BE9EDECC22DBA94EA8B94A48FB33C023B1C413C55C78419ADCCDD670C6D13628C340D25EC550CB3602508C5C04BAECA9EC743F7DDC77D4F75D23B90C42804CA5ACB2B974836D84CDD6512071C3E97F1B5627CA51F3B8A8026E81D45EE3DBE4E752A4B2962D064AA2884592E9032B7905F791BA567AE221D6C51150119F6289B8EFADD0E7C3539578AC588178A4AC2B238F56852077C95C06EC5347CE5EB27943E34C8F2970E49DAA0A58783D0A36CC578F0E54DBCD09EA36DFA548A258F17D7F7910B93CA1F31AA67876FEB70486943EADDD185232A820C11F7D0EFD1EBFEFA2314CB2CC3C096C985304F501860C3EBAFB0F2A1E524029339BBCDC7CCA4F08B7982813EC27291EEFE0EE6ED348DE3F73D88FFBCFD768E397129E312B5A48B05FABB3B1935651C6EC6E2A6FB1EA1A9DCC9C9471E419F0FCBCEBD922DF9243D2583BA4C12AFD0C391FBEDCA4B2B96B360E638BEF2E95359B1E2259E5BB581867133B8E5EEE594BA3B98BFC72E9C70E85C5A4D97782CC9FD6B03CEB8F0EB5C70EA31ECB7FB144E3AF30B307C278593E1664997B731B1C9E1CA2B3EC3399FBA8A96A6145FBCF068BC621FE75CF815B2DE287AF349E28914B3F79BC281FB4CE5DC23E7D0F08FE5673A722E0D0947D95E6D2F85B4E75CBA7A5C921834C7025A6A6C52A998D2B3B66216253FC0159F411F7A0A45E28E8327E7A6C8C51A36B665A9F6B8540CE2D226477EF0DC8D34CB6588AA1C26294BC79174678621BDB912FD259FDE6E0FC748D0506F924AD8D4A694CC8CD2DE88CE1EFDD811043441EF086A7FC76B444D4ECD518591A69CE8308B2251CC18C0E85B47FBEF3F4566E079CC720FA6635090C942C32216B8247D71CD0E31BD0CA6EF914BD69198FF059C396752B01D92AED4FD061BA3FFCA3129A713F9E4D0C3B5626CC895F8CA8F7FCBE1279CA83C015FDA384077C9A2E485984E4C7D6195D4A81AB0F1552D5A4C6177F461F9B63212756D11FF2F63FA52672FB2F1F91758F9E00334B64E61E2942978F91E4A035D2428D3DFBE8D733FF23172D91CB9ED5B98B9EB2EACEE29F1B33BEF6763470733C68DE2CA4F1D4FC237B9E791873860DF3D495B8EAA636F77037EF8CBA7B9F791959C78CA899CB1FF68AC810146A69398E52C99749A4E69DF4BD6F0F0336FF16F9FFB3ABFBCF91B8CAD6D64443040A96C70DF3A38E77357D06214B8E2B2CFF3F18B7F40A97694723BCF582EF6C05646267D2EFFF7CF70C1C597327DCA08BEFAD933E9DFDECD672EFD019B7BE378AAE3A6C4E9671FC3E2853BB1706A1335A68BA8FFA19C6A06FDA48C40C9BFCA5E853C5222A615F8AA53C753E52BB198120D6C4F8959E54CA14D54569A91EE2075E1B4558B9CDA331EBA729ACA8C5C49091822A06DC899E847FF53FE81D1FC67D2AFC3140D153BC4370A04A194326218651B433646E40D24F5362C7526FBA1741B0DF6BCCB9D617970A3DA3209ECE8FC8E9410C5AED6C330A400AD47BD77F4FBA3097A47917B8FAF0BDFD6878B6ABA6A96C30BD430871196F1DEBC99F5F77E8F5176077EA143E90ABB564289CEA43D710217CFC238040E091FBA62AD0C5BFA4DCCB10763F865E50DF7B70601A411CF1265BAB0846FC6E8F64D4EFFDC959C7AF639D8B114DBF201AFBCD58E53D3486FD1C550060111415BA18CA2DB7F9641BF7BD96F9741FEC21EE2BBB36D2111D7128353A112595791A0A783877E770703258BD9D36761147BC817DA09077AD86FF24CF699BF90BB573EC5019386D3366516675D7D072BFAE28435F524BAD7F2D19D5BF8F64797F085EB6E63FEDEBB71E4CE13A5AF8F6C6873F97FFD89EB6FBB9323971DC1E5A7ED8BD1DF45C271A8AD4D2B82ECECE923595BCBABABD772EEE7BF4BCEAA67FEDC299CB1782E13DB5A5995ABE3944F7E9D45BBCEE1D8C3F6E6F26FFF88CD03B5648B319AEBD2B89D6FF0D94F9CCCD8B67A3E7FF1773878D1CE9C7AD4CE18418EA2D9C4AFEE7E955B6E7F889A9A7ACE3AF3608E5B324FDDEA4B2D5E8D1899E6A0999908B544FB084A163694F6C4245933F2FEAB51B2B4D282E34486DC76648F562647027155977D0871563708C218E550CA6496DA91907AB19A0317053BD5E71E5D64879CC0239543303DF1CA32089D10DF120A8FA460A58C21E79E64D6CA744D8859FD8BAC41DC6AE5962F1E8976C9AF96DC6DB91886A7F4370CD7899E2A29B4A4D2FAB143086882DE21D8FE9E1749CE1291B33C2C75D64A7786B89AC89776033DCB7F42E1F99F31C26CC70D3D4A661A2B30487992D124C8C765D8C4265D36F16D979E86F98CD8FFAB98CD6D6037802935E4BFFC90AF9B081899483FB44DBF11E7FA7B56D253B699357736B91056AFEB64EB4089205D475E6D3ECA71465F36E9E8F89B72A3FF839EBF6C644A99447585843671CBC4280D90A2C4338FDECF9AB7B6B3EBC4A990EFA0A7B0911ABFC8BF1D761CE9783D37AF7C82630F9A85196BE0DCEFFE812DB1C9CA79A691ADCC4A6EE4DACBCE60C34040EFF62EF69F35516DE29D7FD97F504A36F389B38F655A7303996000694A7CF98DF54ABA473A5386A5E2CC9B360ECBCDB17920CEF35D393EFB85EF72FA01D3F8DC1947B32117E3E4CF7C8FADDBB37CE38B67E23809AEFCD1AFD8BAB95F89D9EFB7E74C2EF9C2523E7DE94F58F5C25B7CFEBC539931DE22F0F364CD26B6151BB9E8922B3874E9520E5AD8C2B28593A811C1AC7209C349293C22CAF4445E90D096ADE442446AD4D0EF18B80634C85D8D30B35C24079DCF4243BA810A91C26190023117360C35C12739AB5C0C230571D98C96734D08544858DCB5856807F78207E3163A39027190376284240870D424A1A887CB5362D2D819DAEAB551154C2EF9E2386F83278EE0018168489B1E9ECAD1E55C8F2B971D7903E9B0D33EB17F0F5FFCF9733541EF3876EFF1959243475B7FF285B4C4E8536E37CD2405E594E292EA7B92DEDB2FA6A6EB090CC3276FA6947E47C22F9113271243BA9FA5DC21E3B3218E78CD0DDF9BFAC3BE8E553F77F036F22F1F8E6C52DA52830CF34A0F386BC4D9520CB8F0CBD770DA47CFC0B04D725EC8B36BB6D24F92BC1189F66378481E67292190BF9E01454A797FFDE159059539E3273083B852A18C592E6630C09A375EE2A567563377C438C2EC46FAFCCDEC356D2227EEB4076698E467AF3CCDAE13473271EACE5C72E3FD3CD3279B54719CE216CE5ED8C625272EE0D7B7FF9E1933673267C6246E7DF02DBEFCD3BB39F4B023F8D87E23195F78835E3FC913ABB6B3A6A7ACCA1E3535359C71EC1286079D4C1B912455DFC26D2F77F1EF57FE9C0F1F30850B97CE531BB3373FB999AFFDF0D78C4CC137BE7C31ADE3E36C6FEFA0396331AC7624A79FFB353A73358CCCF4F08D8BCF205E2A73DF1F9FE2AE87573390184E7BA99D8F7FEA14962E1CCF4E0D4952A2DA2C59B0158DED4704ED826B53B0434A46995A378629E251494FB96567DCB8AADFBA8E64CD83D41788DE899C08D26A1995B7A24E1BA9F10FD6382463167DEFC109D1774C71544BCFE09D9C3C57F276C9900325156B88A34E1865C4C2AFAAF5D3C86248894262A72E1272C12D1288ED5528F74362EAE063198E2AB3A86C5C0EC77445111A0B59C33FB8F8FE1EBF79D5F0344DD0FF82284675C2A836278A1AF26512B2140A14C9C85A7AB1DEBA95CE3F5C41A3D54DB198C788C5D5449E6BCB1747BE28A2BB2CF98D85E58514CC3861CB5ED42CFE06566D1B864C8F85B5CA6C56CA09F2E5B7E53B2B99CEA038A9FC291ACC05CBE08B3FBA8354EB4EEC31B70D4C938D399F475EDD8C9B6A2070E284BE87657AEA4B2B9B48437DD2D28027C7FFB65EF4DB3DD2EF2E6ABC03AA6B97D5EDB2E3891C694C8D443B691BCFCFD1DDB185D71F7A9C098D4DF40D7461A661E9A2054C8D25A9F13D7ACBFDCA5C77E4849D58E35A5C79CBEFE8CF0E30BBB5892F7DE80446793ED7DCF15BCE3A6D29E9548A2FDEFA003FFAD3CBA4BD5A6EFCF431CCAE29F2FA86F5BC9A4D71EDEDCB39FE88A574AC7B83975F7A91C316CCE5F47DA78059CBC7BFF69F4CDA634F8E387026CDF492B01274166BB8E287B7F0D8EA2E8635D4326E784C79EAEDB1FF7E7CEFBBD72BCA690807F8F2858793B03CE2C9363E71F18FD95CAC258BC729A7EDC71EF3EA386EC14CD2865C5425F6AAA2ACAA03F29BDABC0D2C655B25B5DB444044E2B68767F8D8414CBD46D40E3D951FCBC5D6896AC35288928DBA77BF979A8A8A646555D62DFDF183175095302B612BC98C878AD562DE1B7565FC3767B3E800413276F9E4C1F348069142847CA31545742FD5694B9D6FEFBC8F64FA92FDCB5D8126E81DA5194DD03B8ADC3FE875B9C11A71DC5B47E9A99F917DE6670CA303CF2B508A67D468F19FB5DEF99EAAA78A13897C397B5B9730E2804F632666133A22BC14E5EAB2C3AE4A142A07932F6A747B1B88C469CCE68DDE02CBCEFF3A9FFDDC45D435D42801FD35ED03BCB1B5879C19C3B593B8382AFB7E878C658368A8A631748FFC4E5BE05F82C495FE595F7446A4C40161DC26EBE689DB0603EDED6C7AEC1132C904DB7205D58298B161DEE8619CB27057EA4A7DFCE2BE3F70F0D1C731BCB6254AE9CC027575352AC52B153D1E7BFA112E3CEA60AC7C8E177D9F73AEBA95DC8612DF39E764C60CEBE7E9D7DEE0F617FAC88C9BC73D37FC9423172F64C573AF72C159A7B0685499443CCDC32FBE8597ACA375FC6836BEF10AB3DB5A48A8E11F9B1FFEFE39963FF512FDEDED943D9B52AC8E58C266C608B8E8B40319D760D0DB5BC08DB5F2CDEBEE62E55BDD4C983C860F1DBB27472F18CBE88C18A5EA1AEC3FE8EBF27FEE6D3441BFCF210FFD3C8111C733039CECEBE4EEFF06E12BB7529B09E8712D1CC752B5C4B769310895CE83E85C88C1AAA885F565F662C4215FC76D9AA3BA3A1C21D5C0509B5192C5444327463479888BE707F41A31EE796E0DD7DFFB1C1F39EB38FCFE3299B8C9AA751B58DB53A6835A72B1464CDF1DAC9B0FAA6DFC37B38041F78CBF82A3BA7308A20D2755028D9B845E8954A988D5DBCF86671F63203740AF91C44DA6E5C699FA5217E71DBA1733EA2CFA4293A79E7D95E19906E6ED328FE67175ACDDB68D37DF7A8BB56BD773E6C74FA4B954A43148D29F88F3D8FA2CD44F7ECE0000200049444154F98E3263E3BD24CC553CBB21E089F67A5EDAE2D232AC9E1199180F3CF420A72C3B80C5936D1CDB25AC9FC065DFBB8D97576D27C8F6B1F7CC662E3AEB086C7A544D785D87CB6B9B3AD8D6D989E3E79937750CADCD0D140A457C5274F7E4A91B3E92555B7AF8C14FAEE3828BCE61EF69C3993326493AEE4823E4FB7C96E98FAF54043441BFDF91F3FA09AD34BD86A5062B129D0F3070D7D749F4BF8C5BCE49F561D01B303A50D3B4F0C2882C0DCBC12EE7F19219B65A33693BE42B18A3F71ED48F967A7792D0940D27B92D954A6208A56CB4B1E3A4D5A8F5C7BFFF3B82581DC71DB680A4ECC2DB266F760CF0C2E62C1DBE6C1A451DDC6ABB4A751BC834A46CB6A9662A5533FF737BAC3F0754363B25E9561B856648D970C95801357D034C88A5787AF99DACEBDA4EB759879F69A226EE606D5BC3998B66B2706C0D8E5987418CCDEDEB79E8B9C798B8EB2C56BFF52687CE5FC0C269B358EFC86698CDD7BEF83DD22D33E80D93CC9AD8C69E637CC6356CA5BD3BCEFAFC08AEFBDD2374F6F4637825962E398046BB8F836635622513DC78F74BFC66F9263C7B3485AE4EA60C2FF1FDCB4E27166C259673C97B31DC749A62394BCA28E2F66EC334124A9CFEA6FBD7B27CC573CC9B37819AFA0433674FA3ADB59145B35AA93307C5ACB451EAFBFD2DABD8CFD704FD7E874EDAAC4C5BDDDE0BD1394137E1C6FBD972D7B71815AEC52BF7ABCD1E65E2AAA6112513B5F014519BD84E19513CB28D3A7A9D49341C741EF6A483088C264CD9DC911E64D1831E1CDB961E5B4217D7F309136936955CCEBAF82AC64F9EC221471CC240292096761828F8BCF1D62636F67BF4953D4C2B8E614B2B97D450A52736FA918199779760DED1F418BCA0C8E693B2C492563BA9A59649FA65C60606BB8F68E6869BAFE3ADFE7E8A99568AF14670CB4CAA35B870E97C86E5B740BA9604068DDE00231B6BD95E2C61D6D4D05C5B839D1B6063A6898BBEFD7356777914E22D947C1BA7D8C9FC8601BE7ADA7E247C9F57D76CA5D78BD3950FB1620E69B3C8C2B96329F76CA0DD1DC985DFFC397EF34E749644FCBEC4D17BCFE0ACA37765DD2B6FF0DCE34FB3FBDC698C19952257EAA55FEAFF6583C64C3D66A1C4C997DF8A97A8A1C6EEE4DC338F62F2A416769B319626C724E5BB18D6FF466FFBFD3E39F5E7BFDF0868827E9F23A04C2764502B28AA8D1D19C7B6C32CC6BADBE9FDC35771BC7602E92D0D5D6246E4B6AD085A48D78811D8596CDFC229A5D50E538F91A466CEC9A4E69F831F1B85299B89A1130D3D8432A138E84F3828B42FFBF11D399F4F7FEB1ACA756338F8D88389C76CAC72C0F054C8FAFE40B5E06DDDDA4D4F7F5699C32A825624ADB6B030DE766D91FDC37709440F66FC6A807D7023AC6C9449042EBBB6B4302595E14B575DC556DF24A86FA5686430DC80E9ADC33968562B6F3D793F9B8C124BE6EFCCC1231BA82F9721D9805F3B8C7C6180965A876DE524C77EE96AB6378DA5148892922C7080C52D369F59381B0A1DA4E33E857C91AD5988D734D0940A4939657201F823E671C1D7FFC0BA7C968229651E9F51318B2316ECC3CDD7DE4A602598501FF0B54F1E43D9CF71E1B7AF615B39C567CF3A83D9C32C4EFFDA2FA81FDDCAD9272F64C2489B39D35AA889992AA699A106455D827E9FBF6595FBF19AA0DFE7D8C926615C0A075E0EC218453BAEFA5053C156FC977E45C793D762BB1D51F9A13CA0485A287688A04D0AAA7420FDD209CF26EEE5C95926F9D10B197EC0A5987593C0C8E01B32D9160D31A87D3E51A153CD192E452FA4DD33B9EC27BFE3B5ADFD2C5DB698496D2D84A51201F16823DE3070E58E7D906C865A6AFFCCFC7B6810E25D98CA7EBFEC5B4AA78064D152B50D5C9726C722ECEAE5C2EFFE9852C368480EA318C470EC04E59E2E6A6352DD2DCBEAA877BBF9FC718B99307624BF59BE92753D2E5D6FADE7E2938F628FF92D2CFECC8DACB26AF18334B6E713789DCC1AE6F0897D16D0D9BE86DDA70C23ECDD4ADEA82388D590A2C0B69E6E9EDA52A6CFD989DB1F788A3E11A04AFA50EC251504585E02CF8B633A718619FD7CE353A7B272E5D3FCFC8F4F32409AF1C393EC33B9810E3FC9BEFBCD67625D99DDA73711B70C3C31B436C5D035B2F58D0645F44323F0F723A009FAEFC7EC1FFA8AB2AAE486D8BEB4DF496D5732636973F508CBDB293C7F25BDCFFF96B89FC529F59130A4AB5AC672258B96B17021000F533C0E7DD15208C8CAA45E7A18F9702C4D8B2E20D6BA0746BA9520CC60A84C5AA5D17852172E9688C5E3644354CBDFADF73FC34F7E7D1F6366CC63FE7E0B993532855114A70E5F3965A82E0ED5DA2599B249A88621A2662BA5D7A112E877A6570A66D4631B97A9379131754C3CCBC32DE509F379CEFFDE2DB80DE308A4275C7AB0A52462C8C6A8110D675831EA8B1D7C6AD9029A86D772C94F7F494F6A2461BEC08C8638D3C68EE2AE575FA73FDE843510A3CE8742AA4029BB85F1758D746F58C34547EFC1AC06D8D6E3E1DAB58C1DD9C01F963FC3F54FB663D5A4D5E7F9761D1282985704BFA014DE4A561CCBED87623FD3DB26B169ED5ADC528954CA64EAA4111CB0680F268E6A60464B9AC90D0E2919891664C4A24CEE2E641250C9C1EA4DC27FE897E6FFD09B69827E9F831D8D824B563BD80AA7BAD654E33342DE8EFF32D995B7907BEEF7D416D761FA7970624A8E3450BA083E31D720A6349F8B146C08620D7805485825D67A696A26EDCFE8DD4EC51CB60718C3D5C6A16785140D9FB410AC2B9B837102D3A60F93B57D1E3FFDDD721E7AE635C68C6864C694494C9E3291444AC82CEAE61592577DDD7E340AAE2E3383757451E3B1D598B2AF26DCE4989076BB42998429C332E25E5E22DBB1991FFF76397EA2498D69DBA6F4474BBDDBC153E576B1E94A5063949992F4189E4EF2F89A4DF4256AF192719166C3C8F763D70DA3EC2748F65924DC806C3A209F0C09B239D515B2DB489BDD5A33DCF7C70730E31976DD6D771E7E7E2DABDD4612563F948BB85E1ADB4AA93ABF119628067935FA1C0B4AAA9D37ED24681D51CFAE9347B3F3F43686350D23D390624E8B43BD09C9D0C310861F720F91DDDDC129C01DF77C7C9F4F4EFDF1EF3B029AA0DFF710FCF503900452C60462EE1678E9267A1EFD31F54E0FB95C3F8129B7DF0E3157C850326297D0F0D5D49EA82188C595D48B0D338BE92468EF1FC58859279199730C467D1B7E22495EC472064B1ED22B2D03E192999765F0CF3068EFC9F2AB879FE7D11737B161F3369C545A5D14E47364E046DAF62C4F067C2D4A6602576AE222F2EFBBD8AE488C7A245C9FDE648CBE9849831FD01008413B148D32138625F9E8874E26EEC41508327028D660A23F11CA549CA4D0A2952D35EC3020085D4231A495963D99620BA5D41365EBB68C45CBE44628B39972F109294BF62EBA278288F48D7B79F596EAA2419C12316CAF88E9CB7B86F8A25DA1EE0CA44DD153C33AA2F857934ED0DC9024637B4A36B5A5B18ED14DB56A8C59ED1F0CCD74BC5D0192F789DCCE23D7759D417F80BF661FE843D304FD810E0F944B3E8E288A051DF8AFFF8E6D0FFE8816731394FA2985B66AD113329571703521269A0FA168F34AFB99E846D7E30AE1D5186CF73DB2F166C6CC3C92F4A4C33113D329261B285A320726536A91EE981A1DF6C46216A5AE5794DAB11F5012229381C5C1CD2F21542B1644ED734856ACE62409428F8C08A189D156FFF3584623E5D444759CBE15952EE4734CD320ADA695A302493412138DC60D8DBF28B303A2717929C944741C196DC98F7CE6A09E9A7A9EAC41DE4F9559E4C2E599F8BE41393055FBA11C9F9ACC547571280CED69CA1D8192DE8C2456FD207ADFB438C2F81EE2BD98AA91C1E5485FC2F20AC40C191672647E3B1AE953BAAF722711AD4875CEFC4D25930FF8C9A70FEF7D474013F4FB1E82BF7100421E5E806FCB5660489A5E8C55B730F0E055C406D6108B998A607CD3C63725FB8DC6879DD0231E9471C4BCB55C47681994CC3EFC544890B4E9E84D520E7662C2B42538BB2DC3AC15BF43E5861869E108E104B6AAC306410111FF15C19D282B1F942F55F9B610734CC9A80A35D9A2181CE4B0826E286F67DB8B2BD8F0CA354C1AB133C3F6FA77C2CC04BAED90786892F02C51E2C142FA58A2894735062D3B97CABC20226A2B28A83585A6B40CCA31C8D88750B964D8F2931C6C3D144A97632A0F66C0836A6EAEBC775C19EE1684BA95C101AA246404458278245E24C6BE8472BF227723F259715C71B909F291116E98A02406BB1E241CB9B8E431C47841843F4379BE307FD41F2E23FC43E3FDEA42F4413EC7F4B17DA011D004FD410ECF601A26596BC996B2B46C046EC1DCBA9CEEE537126E7B895A3A4561034F7A94CD48B3574A0F4EE0295D615386522401570236A2A017533A206E20FDD4263D5E0375A3A653BFD36E58ADB331336DE0B480D9A04A25422E41200E1D426E919980CA73076BD09E68750C119E2793786FE2AF7E84BE67EE2451EAA49CEAC21DC8D138E778EC7D2FA5109FAC24A22C374B188BABF63F718889EADA923A4B7921EA1A512A97EAAE40B253D9649432CC604FB8126092BAAF088FC8C69C64F2D2FF22346F284B30B962291991A1D283BC8F682DCB55668835AD482C88A0AC6ACFEAB3B009CD84EA9429ABF64643B5321A229A216F618934A741D9944B96341146770543C6096AC2F39D02872278FDD008EC08029AA07704B57FD56B064BA2CAF455B248CB410A0F1605ECAEA7C9AEB889D8FA7B70BC2E8AAE48594AA923CA2FA5AD4D39A1885EB01054108350B23D5309E763E6D53DBEE9C94462827E2F49393682A06122B1A669D48F9B8BD93806DB6EC6101523CB21B424F78C8A0C91D04F99A0D44158ECA6B4EE55B6AF7D01A77F1D56DF3AEACD3E1CA3487F902193ECA1AFE853B3FFB770667E32B230F07A3113494A463C1AC4192AADC806A392C75476E894E562A208171C25E216F5880C9520926148B958C649C7C8B945758CB2C928651AE1F081681092B429629A6542257CEFA87AB928FD498D3A65464342434A9C42D20557962C251B116935900E3CB12D1372177C074C033F167D86943C54295CFACC552B8B107E4939942853DFA18DC37FD579A33FA76A10D004FD010FA51AD2F64BEAF63B3493E444F7D780DA3087595C83FBF40DF4BDF22762412FB6D7AD6EC9A3163A07CF8C0D2A9545824BD2BAA7C87550B55DB2605F32615BBA26C41123AE3EA3E01A943D534D0E0E146298B15A12993A9C741A4B74407C9F72214B21D747C6DB8C13F42B764A482924F4702C297EF86A53CF0EC711943690A9F7D8589E43EB513760374E278C95D8FED61A4C291128E257A29714DCB2FAEFD671E3545B9FD4BFD5A6617F0F3DEBDFA4BFB313DF4AD03A6D1E89E175EAB8E3F27257EE163CBA366DA4BD7D1B3DFD79E2E97A9AC78D66644B73E464227716226E1F7874746CC32D9748043E8D4D2309E2B5AA94942BA35CA8950788EB31B0693D461010CF6448363663CA6460083D9D3D1472FDC4247B17BD12C7A1AEA9194B0C0FDE4E98A36ABDAC433F34023B828026E81D41ED5FF61AA167B1278A6EA35509403A1D24A3B64CA5B111F3B6C0D6E7D9FCE8CF31DA57D0686C477A14442FA36CC43143E92916828EF47F238296FF975A2F918591CAF44202A590178948CA3D7B10183876B431174926C91046A89A121CC9BE955E748813ED8DE1FB22A31A792B7A5210B76DC2B2473A99C2CD0F60587136DA539878C2B7E92D3673FF8D3F65B421033A01252B49D64A3360A7959EC67E4B8F61EC9489389ECB0B0FDF49D78B8F901A68C7714B84E9E16C2C25689EB517BB2C3992783C81D7BE9195BFFF25FEF6F5386651757B88ECAA5F76B1EB46B3D3FEC7317CA779AADADDFEFA2BBC78D70D3494DAC91B09DCDA56F63DEA2324468D15856699DD216D14B9E717D7D0B0F649EC5882556613C3763F84DD16EE45D8D9C193377E8F96FC66CAA275E2A4289B31BC781D8D6DD3997BC0129C54ADDA17103391BFE519F92F3B95F4075524029AA03FD0618B085A9C40E4365F5ABA645250E8526AC9FD56526DD4D588C346711585153731F0F25D64BCAD588840FF60378354654307D31F525693F281F44DBB58661CD78DDCEAD44C8565E08B2BB4F8E0D9268E6CDA495B9B6CE50DFE69887555549CC633D41CA4BA084836698A09A2D292B6F0FD003396A5E8264904192CB39B42CC677DDD1246EF71212FFDE1E70CEBDB489F339A6E6B0439AB8E6D41123F5587317C24479F7418AFDF791BC5177FC7C8A449A1A748B2BE8E4DBD2512C3C6D121FEE82DB339F9C88378E07B5F64A2D54F284A7DA14191128EED91CEF7290795D5FE68C61E7B296D931AD9B4E2517A1EF809C3DD6D6C1157927413ED99691CF9D1F328C662D418215EE766EEBAF2B3CC49B804E52C5B1A26F1277B1E071F7B3C63837E3A7FF925C6F5ADE24D7B04F95823AE99A4CE1CA0E859F48FD987034E3881926953636947910FF457EC037E709AA03FE00192C31B9ACB8BEE9CDF99D293BC58BA3B842B6352AA2876521E58C5D67BAF22BEFD0986C7BAC9CAC48A19236D2530CB723B1E1988AA0D35C357A24BEF6C69BD7B0630525F7FB70CFF3B9FFC0E68AA22AB860B25C38F3A3122FFBAC8EB2E6E0D5014D926258F1A27E69528382DBCD97820D6B65708CD466EB63E44BE7177EA9D849242ADF53A18B7D358C64C1C46FB4F2E614EB88255F1793C5A9CCF969A5AC64D18CFB06D9BD996EB649B3D8C93269834AFF809713BC69FEC9D79223E9B516DE319EBB8A4B63CC9DEED3F57032FB70FFF08A79FBA8CE2AB8FD27DEFF7C9A75BE90E6DA6E65E6585B91F079E760EA97175D4E1F2CA138F91FEDD15BCD0B080D1FE1B8CF43BB8AEE15C962C3D9811B1809E9F9E46ADED714D7A19E9917355DD7C9F37AF60467E1DB7D49EC8D4457B3067DE6ED458A2C5A71F1A811D434013F48EE1F6817955A0C63242D5B5A0FCEB4A9D60B4E3AE7B82ADCFDE436DCF93C4CB5D329281694AAD39505649A23F2DFDCB0969C753031A83331A8A60A3EE5DA1FEC86D63C85EE3FFA568D9948C46BD85A5A311F2684063A80CEB9A35E4EC3A0CBF1BDFF4A8A544C9AD656BEDC18CE85EC7DA5203BFAE398EC5C79EC8B451524C8E8B123596EFF3EC430F925C712DB6E1F3FBD49114C72DE2E443272A31A25ACFE3E9F602AF6EEC61FACAEF32B1FF351E482EE6A1D82E1C75E49EEC3E26A188B1DCD7CBC6FF3C9BFAB08FBB33CB98B2F71246995DB8775E4E776234AF596D2CCA2F676B6C26EBA69DC4B147CC5663F7F75FF525DA06B6F0447277A6955632DADFCC350D1FE7F0231633C2F1E9FFE929D4583E37644E61AF638EA0796492FEABAF6052C75D3CDCB894626A24277FE424629625CD8B1F98F3451F486521A009BAB2E2F5DF8F368C6AB8D2252D6D73AE2F8EE1628FD44F50EEC47BE9410AAF3D40D7B62748C7B792B245D2543C3E0D4C3F4360960895B55534FA21AD6CD2B7A0F2F2506AA8B9C83B2F52DA78D79F839C1ED428B53CC9CA230797C8EA28FA5D265D12F8A9E1948C3E7A1D9B7C364F6BDB3E782D47D3FFC7DF50B25AB83BB18896B135C4824DE41B2670C0FE87D060D93C70FD2D4CDC7C2D7DC9366E708EE0C0630E6671ABA38CA20DFAE83732F478063DDF3A8A616E8E9FD59D4DA16D573E7BE4785281B865DB643D8FE77EF06F4C2EBCC4D3E9FDD8D4BC903D674F2075FBF974382DDC1FDF8FC30AF7526F7A5C5FF3613E7BD662DC815ED6FCC799646B66F1A439830585FB68F536726DC3791CB1F4405A9C32D99F9C44C6F1B9327E21C77DF800DAC4DDE63F2EA0D95FC91DC38E635B3089F3CE5F46C6922E0F4DD095FE357BBF8E5F13F4FB85FC3FEA7343A9494B3521A984FC076951C97E4AE669973C0C115DDAFE04DB9EBF05B6AFA4C1EDA1A69CC7F2030A660B45710537CA988AACA50B448C6D85E0243996AC36F294FBF3524BB400531AFFD4349E585A398461D4CE27A3D8466853EBB5E3990E5DBE455FF35C46ED711899B67D59BF7D049B6FFA3273F22FF35A7C3AA659C6747C5E4FCEC618BE134B0F5DCC833FFE0E93BDE56C3666736FC3617CF8C38B98E29862844DDCE8501E8C5BCA0EEBBFB58CDA00EE6A3889C97367B26CE1580AA429173CBC789CA7AFBA8C9DB30FF3AC3D8BE589851C72D02246FCE674B61ACD3C38FC04E6792F32AFEB3E7E9D3C8645A77E849E477F4DDBEB37724FDD09AC8D4F6249EF2D8CF637727DFDB91CB1F42046D945B2FF7522B58EC7D5F6879937A591968E6719BEF129B6D7B4F08BC4329A9B46F1F9A32690144715431739FE51A7FBFFB5F7D1045DF1118F4A0A91ADD53B0F95B3853E9E212D7A268E7802660B94BAD7E0AFBE8BAEB5B763FAAB70C22231DB26663A940A051C3101308DA89F37907CD82190AC5AB274D59E27024DEFFC88CFB61AFE905173CB60A054209192294483925B269F77709AE750376101B1992762D44CC53392BCD1E9B1ED868F511B6EE0F1D442422F895B34D890D9854E1C3EF9E1053CFEDB6B59D07E3BF9603A77D51ECAD91F5BCC58E93691C93FAB1DAF94A23D4CB1E55B4790F15DEE6C388D390B16B078973ADC308563DA6C770D9EB9EA52E6E51FE749732E4FD6EECFBE7BEECAE8DF9F414FA285FB524B993E7114739EB984CD35B35835F163CC5A7B13A3FB9FE3C6968BF0EAC772F0E6AB199E7B836B336772F4514B19E564C9FED7C9343825BCA044A6BF87C049D1DFD8CA23B123B8DBDC8B530E9DC8D231A5C834414D69EA8746E0EF474013F4DF8FD907EA156F67B56FB3B310B68C4047A3CFAAE42059AD742B88BE841B623945C27023F96D2FE2AFFD2DE1FAE718E8969E8800215C51A416CF6602E966162381A8B54EEED47D6F682331BA6DB7C298AA6D4B0B483994917293BC68323B49EAC78EC3987534F191FB62C647E0D1AA3A3EE4B1B5A393ECF5CBC8C652DC913E996953F7666C4D8A7E33454D2264EEE45A1EBCE55BCCDA742F595AB92DBD8C93CF3C9A29A68765B91074937346D11342E715CB1851ECE4B7CD1FC7DE6509A7EE5947527AB37D19854FB0E23BE7D3EAADE5D1DA25AC8E4F67E9C259C46F3D9B7C660CF7B22F4B4E3D92E2D527D09A36B99B8359907F1C3F99E0BACCD12CDC674F46DEF969C6065BF851F20C8E3966192D4E9EEC4F4FA6D67179303E9F2DC134B2B2FE844BDE6D61E7DD7763D91E1986491FB88C7FEB3EE80FD477A6920E4613742545EB2F1DEBDBC43C48C86A4E7AE8213E538396F7868B6F7BB84A7D2DAE6ACE4660621573185E0F617613C5CE5728B7AFC4EB7B8D7CFF5A707B890D1ABE4AF61C480F74A440AFFAA495A6925154433166AC0927338944E33CD2A37725D63403E24D789934BE1323E6E6F0AD8C52A293E9BBF6AD9D94AE3D0E23D6C0CF9D935874CC91EC322E261A4DD4980186EBB2F1F9C7E8BEFF47D4387D3C64EDCD6E277C9A29633338A18BE99579655B8EF4E826567FFB3CF6F456F364389B0DD38FE1F0A3F726E379A40C93979E7A06FFDEAF924CC4F865EA78EADB66B25F9B45F1B79750488EE00E771FCEFEE471ACBEFA7CA6145EA797F1341B259E88CD6065F39E9C7AC4EEF4FEC7C76833B6F393DA7359BA6C29239C22FDD79C4A8DE3737DED39041317D09CF09838DC644A5392498D8EF26F2C63CB188EAA99EB8746604710D004BD23A87D905EF3361FAB5964352822A3D432DCA246BE7D35D3826F0483D6AFD1649E68CB4B2B5C5E1C400C690553E3254A23C3144D0A91342D0E501A584BE8E5F0CB65E584128AAD8A6561C607E54E93233113F558C93A8C5403A19DC137934AD253EAE1490F1C29527B5D84B19822733F88B3656B91AE6BCEA736E8E5CEE4FE34EDBA3B236B3D357597F2F2CCDB6D3F06F2F0F80F2E6786F727F2A9B1ACB576A665CFDDC91909B2ABD6F26677078DF39730A5B485DA877E4083DBCD4B35B371F7388EDA8606C26DED6C7BF931F6E20536FA0DDC103B9E23162F64CCC08BE41EF821FD619A7B634BB9E0DC251456FC02EFE95F3132D747776C22B7C7F6229C3E8763F79FCE86EF7C9496601BBF6EF938FB1DB284D176899E6B3F42261670A3BF94434F3F9979231C9CD0C1B05D6C99E60C6A949892618BA0ABAE417F90BE3295742C9AA02B295A7F33838E9C4EE431A496F1EE1EE677BF34724389FE46EAB943CF1B12E27FFB5DD43F88D3CB5FEA801E7AC741A9CD48EE48E96A0CF5552BE1A2C10B48203DD5439A156E918EB56B78F4B69F31C35F4BDC2F5034630CD835743B2D7418F5CCD97B31B3E6CD65DDCB4FF3CADDFFC5B4642FF19EB5A4E216EBFD7AB6A5A7B1C11EC71A6334179D75142B6FBE9A9AF66768087B09DC1CB6692A2D8C1C356C4F8EE319731AF9D6DD3973D90CF22B1FA6E7E93BC9F576F1C7F852CEBB6019E38BABB9EFFB97D0981849677C279EC8A539E8EC53199F2AF1EC773FC730C3E0F186B9CC39F244E6BABDACBFE9328C649E3F260E679F639631BE31CDF058A40F6D48DBA2C021A518A5C3213FFAA111F8FB11D004FDF763A65FF1F72030C8ED32F9FDB66E73B98497EDE5AE5FFE82FC40BFCADCA5CE5D3293748635F8B5A33012093EF6A1C3F1C29075ABD7F3F01DB7D2147395E594976AA4C76966BB9761544392334FD81723D7CFF2DFFF9ADE8E4D4AC83F70321465E8DDAC654B318EDD34966587CC67E791265D6B5EE7E6DBEEA1583B910D7D26975CB084D6449E477F730BEB37E4E8721B08EAEB38E5A3872B9794BBAEBD8E5CD9E679AF9165271FCAEE768915BFBC9A4E3FE465770CC79C70243BB566488BBB8D8CE5479AAC83043D38BCF3F760A69FAB1118444013B43E15FEB908A8CD4A318C8DD4406450C612FF44C3A06F5B07B7AD5CA736D862E26A2EAE298E38B3D88C6EAE63BF5D26911814EFDFDAE5F2E4F36BD8DAD183EBBA241C8B19D3C6B3DBA466EA5322431A2ABDE695AFBCC99B9BFBD8DA935765969853C3A449A3D879DA30C6254352851E6519F6D49A3CF7BC51A629E8E5C483A7918C99E48A2EF73CFC1AC592C58431B5EC337734861FB2B9BFC0EF9F594B4F21C3D18BC6322963D0BE653377AF580B569A0316CE644C5302CB2F624BD78612F0575279837DE33A83FEE79E64D5FBEE9AA0AB37B61F8C95FD3F045D7403A57627CE27B259D82D2E2706CA7A4BB633956EB5E87A4825DD1BC076032C2B413E8C1338A66AE513BA93E947D1FD10F53CA9B78B30D340C9209150F6869126B698E94A352794DE695BBD2E16E4307D4F65D859ACC8F144244B3D17331653F60192F4CBF1A4C33C6631A4944830605A24F21E19E98B31B2E46D9B946C7AAA1ABFA8E4B984BEF492BF23E02F0340D110BC26E80FC6C9587947A109BAF2625661471C15A145687F50274FFDB712C01B2C7F2835105F261065543C7236174128823CA1299428C3D243E2D842A051AD5BDED912B356A437DA8E9CB4D5DFC96B65C2521CBA65373449E8D4AACC3CB2C512A17FA90F836B0915A35C689444AA725517F54013476AEF9E8167CB3B55FA749C000007AF49444154E7B14A6508121492298A86419D2BAEDDE2A420C75D882E2FA2B91D88E58A0C0F6982AEB093F50377B89AA03F7021A9AE038A3838EA2019DABC7CDBCE44BC018736D58454853E2D5B49782ABF43D1F21B1C938EC9E8B610AED85C89C8BF19A76498C4431743FD9DB4B649A923CAC2232511E17C19418FF450A50E3ED4F4A206DB4331973510DF435B44A510130349896384922B078ECAEE45933A213AD7DE00A15143BB6DAB0E9551A2031D0A41CBE74BEE2DED87493518A47E55FE6142F63A83AEAEB3FA5FB71A4DD0FF3AACFF4F7E524488831E826FCF3A8A2053E4851D65C1832E2486D84819CAE944FE557907863E86F20B5482A7831D25B20937F80CC96095B6B5D84E49AD3BDA8C145383A10AB088EFC71561470EE4DE9FB90486C494C6935C29CA8496B8A3CB9125305C87C00EC847CDDF2455A51B06067DBCEBE4E22047A904B6E5A8E57971A5E217592A2ACF96B747E5FF4F9E007AD1FF2B043441FFAFE0D32FFE9F1010B294DC7950EE7FF0E9925E469B69CAE8D6083155061DE21B31650C20D9B318CA462D6B31559E10BA9347A47927DE85457C23A9E85F6ADACA7966889695F16B64121B6D4F8A216C48682A47440CC9C8835234E517A6D4DF09A91795F989484F85982571ADDD0A463305351128997427862F658C14D839558291CF97924CD45E281A24D10526B21B5315F3FF0926FDEF1A81BF888026687D62FC531178A7833AA2B1B715F106254CD51FCA84367AE6501FF5DB156BF5D742E4EF54A123DD3D495CFDC8DF50B441947CB564D9EF9EA48C4A0DD11B4B9A3C3805A99C5F877CB785C1230D6B3F72B3520FA155757150DB8631553E512EE3E2FCAD0E5ADE5B7ABB8784A4A26E956853307A44F7074352ADFF5498F59B5729029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D0085429029AA0AB34B07A591A018D40E523A009BAF263A857A011D008542902FF3F264F063D9ED894270000000049454E44AE426082 , 'asdc', 'ueb_key', 'ueb_secret', 'ECOMP-PORTAL-OUTBOX', 1), + (5, 'Policy', 'images/cache/portal1470452815_67021.png', NULL, NULL, 'http://policy.api.simpledemo.openecomp.org:8443/ecomp/policy#/Editor', NULL, 'http://policy.api.simpledemo.openecomp.org:8443/ecomp/api', '', '', NULL, 'okYTaDrhzibcbGVq5mjkVQ==', 'N', 'Y', 0x89504E470D0A1A0A0000000D49484452000001680000012C0806000000EE2C29AF0000200049444154785EEC9D077814451BC7FF77B94BEF8D143A842EBD188A056CA8F40E52444405C52E62C5F2D995265644451114456C6001A4F7DE413A2421BDE7FADDF7BC7399CBE648729BDC5DB82433CF1325D9D9D9D9FFCCFEF6DD77DE99514024A1805040282014F04805141E592B5129A18050402820148000B4E8044201A18050C043151080F6D08611D5120A0805840202D0A20F0805840242010F554000DA431B46544B282014100A08408B3E2014100A08053C540101680F6D18512DA18050402820002DFA805040282014F0500504A03DB46144B584024201A18000B4E8034201A18050C043151080F6D08611D5120A0805840202D0A20F0805840242010F554000DA431B46544B282014100A08408B3E2014100A08053C540101680F6D18512DA18050402820002DFA805040282014F0500504A03DB46144B584024201A18000B4E8034201A18050C043151080F6D08611D5120A0805840202D0A20F0805840242010F554000DA431B46544B282014100A08408B3E2014100A08053C540101680F6D18512DA18050402820002DFA805040282014F0500504A03DB46144B584024201A18000B4E8034201A18050C043151080F6D08611D5120A0805840202D0A20F0805840242010F554000DA431B46544B282014100A08408B3E2014100A08053C540101680F6D18512DA18050402820002DFA805040282014F0500504A03DB46144B584024201A18000B4E8034201A18050C043151080F6D08611D5120A0805840202D0A20F0805840242010F554000DA431B46544B282014100A08408B3E2014100A08053C540101680F6D18512DA18050402820002DFA805040282014F0500504A03DB46144B584024201A18000B4E8034201A18050C043151080F6D08611D5120A0805840202D0A20F0805840242010F554000DA431B46544B282014100A08408B3E2014100A08053C540185C562B17868DD44B584024201A1409D56C00668C1E93ADD0FC4CD0B058402D7580185E26A8786C26C36330B3A3D3D1D7BF7EE8556ABBDC6D51497170A0805840275470102735C5C1CBA75EBC66E5A0A6A0668B3D98C356BD6E0EDB7DF46DBB66DEB8E32E24E85024201A1C03556C06030E0C2850B8CC12A95EA6A40EB743AFCF8E38FD8BC7933FEF7BFFF5DE3EA8ACB0B0584024281BAA3406E6E2E060F1E8CAD5BB7222020004AA5D2066985C964B2141515E1871F7EC0CE9D3B05A0EB4EBF10772A14100A78800204E881030762C3860D080D0D2D65453340171414E0FBEFBFC79E3D7BF0FAEBAF7B4095451584024201A140DD5080003D68D020AC5DBB1611111150ABD5A52DE8FCFC7C01E8BAD117C45D0A0584021EA68014D09191911503FAB5D75EF3B0EA8BEA080584024281DAAB00F7419305ED10D0AFBEFA6AED5542DC995040282014F03005F2F2F2D820A14340EFDEBD1B02D01ED67AA23A4201A140AD5680003D64C81001E85ADDCAE2E6840242811AA900B938860E1D2A0FD0AFBCF24A8DBC495169A18050402850131520400F1B364C00BA26369EA8B350402850BB15900DE85DBB764158D0B5BB3388BB130A08053C4B0102F4F0E1C31D5BD004E8975F7ED9B36A2F6A2314100A08056AB10234483862C408C780A6A9DEB367CFAEC552885B130A080584029EA50059D023478E940768B916F4C90B19389394E559777A8D6A131CE083B64DA31116E4E7B006B4BAEBD1B369B89496EB306F5DC81011E28F4E2D63E1ADF2AAF0760D46338E9E4B45727A7E5D9045D63DC6460431ED1CA582223D8E9D4F43464E91A3ACE2B80B15080FF6C375CDEA21C0CFBBC252C982960DE8975E7A4956159FFFE41F9C49CA9695B7B6670AF6F7C1FD83BBA25BEB7887B7AAD519F1C2676B71392DCF61DEBA902122C40FAF4DBD05D4992B4AD9F91ABCB67803923304A0B94E31118198FBD89D0EBBC9B173E958F8D34E64E60A403B14CB8519C8607B6A5C2F348B0F7708E851A34639B6A077ECD801B9801EF3D20A84852831F016C756A30BEFD9E38A3A7DDE88AD7B7578704837DCD8A9B1C3FA156AF598F2C62F68D64885DE5D7D1CE6AFCD19761DD4E3F86903E63F7127A242032ABCD5F49C42CCF860B5D0AD58A53F376A909A61C6B2574738EC227B8E27E1FD65DBD0AB8B0F9A375639CC2F3238AFC081637A1C3C6EC08BF7DE88364DA21D027AF4E8D1AE07745CB4171EBF2FD8F9BBA9C125EC3EA4C30F7F14C907B4468F296FFE82AED77963D4DD1543A906CB22ABEABFFC53842D7B7498FFF89D880A7300E8EC42CC98B35AE856ACECC74BF371F6A25116A0771F4FC207CBB661E45DFEE8D6BE6E1B05B23AA60B32FDBD59837FB6685D0FE8175F7C5156F5C6BEFC2304A0010EE80706779567416BF4B8FFAD5F0568007040CF7BACBF2C403F3A778DD0CD0ED0DFBD32DCE1F34A16F407CBB70B403B54CA751938A05F9844167494430B7ACC98318E2DE8EDDBB7E385175E9055CB7B5E5929000D09A00775419F8E8D1C6A57A43560EADBBF551A34B42D596A4A167C7DBD111651FAABA5A2631555283FAF083326BD872F57963DEEF0DFF18B58BCF037BCF9E1F40AEF6BFE9BCBD1A75F2774EADED2E1FD4B337040CF7DF40E4486FA57782E0D703D36EFCF4AEB4685EA7406688AB4080D0B2A758DB42BD9888E094351A11626931941C1D63AF4EF3103F562C3F1D5AAB2239AE8F89A9DF32B75AFAECECC2DE86F5F1EEAB0E8BD279231E7FB1D02D00E95725D060EE8E727DE80D68D232B2C98967B1E3B76AC3C403FFFFCF3B26A39FED59F05A025809E4A80EED0D0A17604E807DEF9BDD2A02198DE79FDA3E8DDB7E355C0ACE898BB014D909BFFD6720C1BDBB7CA809E33E37659807E7CFE5F95D68DEE7FFFAE9358B36A1B9E7BE3DE52728CB8E559AC58FB1656FFBC155792333179FA401BA02B02B02701FA9B978638EC737B4FA660AE00B4439D5C998103FAB9897DD0BA9163408F1B37CE31A0B76DDB26DB821680B636277771DC3FB0336E906141D320E183EFFC5169D0108447DD3E0B770DE98DDB06F44042EB9297C16F3F6EC6D67F0FB25D18B8B5BB73F31164665843F982430218D8291DDAFB1F2E5F4C63FF26AB975BD0E74F27E3D8E173B63E7AE7905EB0B7A0A565D2714A3F2C598BB57FECC4F36F4E46A3A68E43BEA40F01B7A03F98719BAC41C227E6FF5D69DD2A0BE82DEB0F302D67BE369155F5F285341CDAF71FFB77EF9B3B62E7962338B4EF349E7C691CFB1B69F4DF894BA574B37FD0A5BAD1B1FA0DA3D1BE4B82533CE016B42C409F48C6DC1F760A0BDA29C52B77B20DD0137AA37563C72E8E7BEEB9471EA0E55AD0135E5B252C683B40CBB5A01F7CB76A8026984E9E3E8001815B7BD46DC8A29BFFD5533677C43FBFEFC4C7EFFF883B87F6868F8F1ADF7FFD0F1E7C6218EA378CC27BAF2E45971EAD10DF301A17CF5DC1D18367F1C25B9331E7F56588AA178AD6D735613DF14A5206FA0FEE692B73D3DA7DB8782E15DE3E6A767CE4845B6C8096FE5E996E6C03F423B7C9B2A09F58E07E40FFFDDB0EDC747B17787BAB199CC9F20E090B64B775DBDD3D30A6FFF336F7C6B143E730EF8D65886B1065D32D3B330F0F3C5EE276A0B620D714E9A6D3EAB1F2BB7F31EB7F93D0BD57DBCA4875555E0EE8252F0E76580E59D0F304A01DEAE4CA0C1CD0B308D00E2C688A831E3F7EBC3C403FF7DC73B2EA39F1F55F04A025809E32A0936C17C743EF553E1A81FB8BDFFD74067EFD61133A7469812ED7B7C23B2F2F61D6715474A80DA66F3CF725E21B4661D4C45BA15279E1A7EFFEC581DDA7980B22F9523A264DBB9BF9630946CBBEFC9B41FFF79FB6E08917C6A25E5C046BFF3E6DEEC7E29F5EB49559969FF9D8A1B3D8BCEE00EE1ED69B01BFB28903FAFD876F9505E8273FFCC7ED16B4F41ECA728D48DD1BE41AD9B5E5281E7A72984D377BF707B505BDE8487B473EFFCAE8C701FDF50B831C9E46809EBF6297B0A01D2AE5BA0C1CD0CF8EEF250BD013264C700C68DAF65BAE052D006D6D4CEEE2900BE842AD01D39C00340DE82D5EF82B62E222406E06EE4795BA23A450A03AF2630489C0203F761E250E0C02F4DB2F2D4154BD305B0F3D7DE2522940A7A76663E13B2B70E1DC15DBA0E2E675FB997F77C6ACD155EAD91CD0EF3D7C2BA21C0C12A6E714E1A96A06340D1E92054D2FAFFB1E1EC85E84F680FE74CE4A844786D8EE9FBE3CA4FE6B01E82A758D1A7F92DB002DD7829EF4BF5F85052D05F4DD1DD15BE620E1B4F72B1F2E26B5BE08D0DF7DF117D46A2F141668B1E9E867A5FCC55501F4CE2D474B7D9AD31342B0914671F0688791B73ECB20E432404FBF459605FDD4C2B5D56A41930606BD115AAD1E1FBDBB02C3C7F7C3C3E3DFB101982C6872138D9BD2DF06148502080C2A8948A1B6D8F0F75E787929E11FE8876F7E7D05FE01BE4E03885BD05F3D6F1DD8AC28ED230BFAC7DDC2827624940B8FDB007D4F4FB492E1E2983871A23C0B7AD6AC59B2AA79EF1BBF09404B007D1F01BA7D0387DA15E98C98EE24A0E922F4E09375F7C33F6F22363EB214A0C9D25DF9DD7ACCF9E2090685FB47BECE3EB3DB76688A796F2CC733AF4E60FF7E78C2BB6C00913ED1673FF519C64FBD1337DDD6C5760F0579453640E7E514A2B050C38ECD98F81EE67FFD14E6BFF9BDC310BC8A04E116F4BB04E8908A67A466E46AF07415014D7EF6990F2D6083AB238A7DE79306BF82662DEBE3A36F675E15C5C1EB4CE17959C503AD4B3F5F83E1F7F4C343E3DEB2017AC35F7BF1F64B5F63C28377D974532A14C8CB2DC48A6FD6B1A8116A8BF65D9AA3792B6BDF50AB55888C0E65FFB67F913AEC3C920C1CD05F3E37C0E169FB4E5DC1020F07340F79B4BF9994A40CD6BFAB2365A4E5203C32184AA5D2E9CB7140CF244037B4BA0DCB4B1466270BD05BB66C815C404F7EF377B7039A0669E8D3BA4D87A66CB08B125992F4F9CD53CBB68D9845420FD3C5B329A5A21B9C56594601DCC571DFDD1DD0EB3A398036E0E10F2A1F2E46D6EB82B7BEB745177CFBF91A165130FBBDA988880AB10D68DDFFA875D0887CC63CBA80A2067854023F8FF2BCFDD123B63209363F7DB7BED41DCF7C75227B0950993F2D5DCF2C414A0BBE7E1A6B57EFC2BAD5BB5D02E877A6F59305E8673E5A57250B9AEA4C9114DF2E5A53EAFEE83EF8318A78E1AE1F9E895C43F3DFFA9EFD7ACF94FEE8D1A71D9E796801EE9972872D0A83AC68D288273F7F5FCC787614D3EA9EFBFBE3C2D9142C5DF42708349422224370EFF4012CE285DAA247EFB655EAB31CD08B67DDEDB097EE2740FFB4C7E516344135A938228857A2B2B1F0FC3CEEAAB3BF191A0BD97CEC7387F7E88A0CF70E7D950DB6F3787867CAB4017A5C225ACA00F4A449931C5BD004E8679F7D5656BDEE7BEB0FB7039A20439608B712A962E4F37CFFB5A568531C6D40801E36AE2F7B00C822E10F9DAC9B7041260EE8C97711A0EB3B2CB14867C02373AA168DE0B0F06ACC705BD78731F5B121CCAAAC6AE216F4DB0FF59505E8991FAFAF32A0AB5AC7B2CEAB4C1C7459EE266E5D3B53270EE82F9EBDCB613104E80F57EE7539A0798865E36671B63AF4BCB13D8B82A96CAAAD807E66ECF5B2007DEFBDF7D62C40D36729019A4299468CEF671B88224093EF930F4CD15B8F06CECA02F4AAEF37B24F54F209F2B0B0CA761C47F94B00DD5E9E05AD35E091B9351FD0F4703AAB6909A06F466488839984B94598F9F1BF350ED0D457A571D2D49F125A356031E8CEA4CA009A5C1C0BDD0468BA07693F900E60D331FAD2223F3D256968287DD11C3D74D6F6770234B9CDE86BA447EF76CC0547892CE8D53BE661C5376BD9EFD263F405A2D71BD8DFA59A96F5DC1337C87DB17FF729C604AA0B31837FFDF4E9DB116F3CFF95CB2DE8A7C75EEFD0C541617693274F760CE8CD9B37CBB6A0A7BCBDDAAD163401E0ECA9CBE8757307BCF3F237F86DCB07AC21E402FA9BCF56B306211FAB8FAFB7D371A7E53D4C1CD0F7DE49809661416B0D9831AF6AE162CE3CD09E782E07F45B0F12A01DFBA09FFDC43300BD6DE32190A52837D1E4A0DC9C02963D20D00F9D7BB4927B6AB9F938A017CD74BCDCE8FEFF52AB0DD0524389A25FB41A1D9B364F69FBA6C378E695096C22D0D9FF92D0B899756213BDAC6EE93C1D770CBC9EB991C828EBD3AF23DAB46FCA004DF1E76495EFDD71823DFF335F9BC0DC6B143EFADA9C075859BFAED8CCC652522E67D89EFBA2221D2E9EBDC25C74F4E2D8B1E908068DBA8131A16B621B3C39752E1B68A7AFC0437B4F83267CD1CC5257BA389E1ED34396052D1BD03367CE94D579EE7F678DDB01CDDFCED2CF1F29A0C9274B6FCB75FB3FBACA829EF5F04216DF2B9D7127EBC62A9989037A52FFEB6403FAD1F9558B46A864D53C3E3B07F49B0FDC240BD0B33EDDE01116B42708CB01FDF933251124E5D58B00FDD1CFFBDCE2E2E0CF28BFB614D0347EE4E7EF638B6AE1CF31195FF6E70DBEF1297CB8E419D46F14CDBE9CC9974DE0264053E44BE3E671A081EAB96F2CC3CDB7776183D78F3D3F061DBA24B0B5547EF8FA1F982D16DC31A827222283995126AD0B019A5E8E8347DDC88ED158D6E3F77D80FFCD7B88C5B0A72667E2F12973F0E9F2E75C0AE8A74677770868B2A0A74C99E2D882DEB46913E4027AEABB7FBA0DD06471905834238B3E9FA8610BF28BD8E83901FAC9FBE7C2C7570D8D468F795F3EC91AC9DEC5A129D2E189297370FE4CB25B17B69102BA673BC70BF6D35A1C8F2DA8FA609727C0C15575E0807E63EA8DB200FDDC671B05A08BC5E780FEECE93B1C360701FAE355FBAB1DD054B1579F5984ED1B0FB13A92AB912C54724B7C3AE767AC5EB9051F7EF30C9AB5A86F8BE7A77CF680960E12F2630468E9809E743D95E9F7BCCDAC6ADABDA8459B866C5C8A002D758310A09F7B6461A9312B770C123E398A00ED78C1FEFBEFBF5F1EA09F79E619870D4E191E78EF2FB7015A0A615E99827C0D1BCDB5777194F5E6B6BF81F2062064DDA8834C25806E87C4B68E01ADD1193D0AD0B48A9B5E6760964E75A71240DF8008073BAA64E669F0DC679BAA0DD0641048E3995DA90DC55693B5C72393AA523607F4A74FDDEEF0F403A7D3AA0DD004C64F3E5889773E7EA41468A992653D877C0C497ACC1ED07FEE9ACFAC5FD26DDE9BCB59E40B8FCFA7095B46A309BFADD884ECAC7CFC779C9641B07E39DB5BD0F6809E396D013EF8FC31F8FAF93057CC03A3DF642F0C57BA389E1CD50D2D1A540C680AB3930DE8A79FB6861E394A0FBEFFB75B004DE172BF7CBF914D9290CE50A34F9D4F96CD6230910E12960768EA28B9D956BF1F9537FBFDA98E6EA94AC739A027DE41802E19CD2EAF3002F4E31F961F8D409F6B278F5EB8EA749AE8E0EC023B65D549CE92A2144E458996E67465E280FEDFFD7D6401FAF9CF373B05687A60AF2465DA6E81D6C7E08351F6F745911A3FFCF3161B50A290380A97A39996AE986462BF7A5E5534E580FEE4C9DB1C9E7E9000FDCB01B758D01466278D9D973E6B149AE9A5F242A32631AC8E14D14216B4343C8FE7AF08D0348393BEA429AC94C2179FFBDFBD6C708F7E28D69F0661972E5AC3BEB8932EA6A349421C0B67A4D0492ABF2C0B9A9EB3E9E3DF61FE6A0AA124A690CFFCA7F5EFB814D04F8C244057FCDC10A0A74E9DEAD882DEB87123E402FAA10FFE710BA073B2F3F1D1BB3FA25BCF36B8F5EE1EB6CE478D1B121A88BB87F7C6A963174B1DA34C74DEEF3F6E61B1A7947EFC761DCB47C97E9949873DBA121938A027DCDE5636A09F5858FE6017F9C2BEF8F05756035A458DD6B8A0CE467E33BE825A25AAE730AB1C4097E5337458B08C0C1CD0AF4FE92D0BD02F2CDAE214A0E933F7E09E53A8176B9D3840FD69FA33656F19458026838056AE1B30BC0F830B4513B9624CC39580FEF8895B1D2A4D80FEE4D7832E07F4AEAD47B1F68F5DA5AE6FFFAC499F43AEB7F43C9A424F3E609AD0C3DB8216986AD834062DDB3462BA4F7B7A386302A55BEEEA6E1BF07FFFD5A56C012A4AD7756ECEDA89D2A205BF202DC5BAA175C326318C0904E0E8D87056264F3C469D7EA7F564766D3BC662DCC9A27636F138E8C747749505E8071E78401EA09F7AEA2959759B3667AD5B002DEBE21E94C906E8DBDAE07A9916F4931FC91BECB28FA1CD4CCFC52F3F6CB4DD3DCD0EA45956146E44FFA6639DBAB564032CF610A0CE48D623F9FF78D817851AD9039A9F4717A1E3741E9FAC41D6E688F1B7300B837C783CF489F2F2BAD0BF098494DAB66FCA46E5CB4B1CD0AFDDD74B16A05FFC62ABD3802E2FC48D5C67FB779F6455A5A9DB836F78128B57BEC4264591AB833468DBBE09C2A3426CE162A4DDE6F5076CB7C7A77C93654779E918856F11D4794818ADDB617FAC2ADD995BD01F3D6E5D55B0A274F04C3A3E7503A01D5DB72E1FE7807E6C4417B4A8EFD8827EF0C10705A0DDD16138A0C7DFD64696054D83844F7D2C6FB04B0A68F291CD7EEA73A45FC9C6B07BFAB25B2178D034E321373D8D81236E004DDAA185E709C434B59816463A7EF83CB3BCC982F874EECFB8636022FBAC238BE4E63BBA62E0883E367F1E8519D1E02A9D4729F97206060CEB8D4FE6AC64BFD3570D7DCED267FE0B8F7D8C944B1957D585CAEDD8AD05CB4F1318DAB4B72E5F5A56B2017A722FD0EEDE15A5CC5C0D5E5CEC1E40D3A0F49CFF2D6383CD34A87478DF69F629FDC682E9EC339A2C673ADEBD671B6685D18C437A71D1025364155248187DF5B4EFDC1C4FBC388EADDB4DED41D65BFBCE09AC2C5AB294DC547C6D6EFB78E1CAF6CD4A01FA741A3EFDED90CB2DE8CAD6B92EE5B7017A78175916B42C406FD8B001722DE8E973D7090B5AB216C7F8DB5AE3FA368E7DD03493F0E98FE50D76D9AF84F6C0E837F0DE678F21AEBE756D824726BECBDC371307CDC6A2152F3020D0834FEB418C9C782B03299FF54680FEF7AFBD78ECB931080E0D002DD04FEB4A48D79126F74A504880CDCFCA0770CA0B8BFA68E9B357D565E4ADB3644FCDE5807E75724F5916F44B8BB7396D41FFB96A1B028A1733E25B7DD157C3B18367F1E093C398B57CE6D465B628120734696CEFE2208B9BD6D97E7AF67836D59E26634C19F13AF361523BCD59F4B86D09526A272A4B3AF8E42A402F7CCCF14C4EB2A03F1380AED6F70307F4A3C33BCBB2A01F7AE821C7163401FAC9279F9475230FCF5B2F002D01F43DB712A01DEF2842807EE61379835DF680BEBBE763A506A9C8DA5DF6E7FF3079E8ABB65042FB075F0A68FBA541ED17FAA786A7B5260E17EF2012131FC966699605E81BDA4E454060C9AA6CBC2E6CD6E6ADCF22F1C6F678E99D2915F6250EE857EE4D9405E897BFDCEE34A0695D12AA1B250ECCB27CC2A48D2340DB6FA3C50716EDF779A401A9F1035F8682C646D6BDCDAEED2A407FF8A8F56BAAA24480FEFCF7C3C2827624940B8FDB003DAC131264B838A64D9BE618D0FFFEFB2F9E78E20959D59CB1608300B404D0E36E69851EADADA3D515258DDE88999FCA1BECB2073459753470651F12275D1BA22240D392A28FCE1A0DB5B70A85051A0CEF37B394056DEFF3AEC8821ED66F26BEFDEDD572C3F3E42C45CA013D7BD2F5080FAA7809CEAC7C2D667FB5C3694097E583E6CB864E796410546A158BB9A7A8024780FE75C5263CFBFA24162E47101E7AF3332C4AA1BC8D78ED978CE56B7A3BEA33651DE72E8EF98FDCE4F0F4C36733F0F91F4704A01D2AE5BA0C1CD033867644F378EBEA85E5A58282024C9F3E5D1EA01F7FFC7159B57CF4C38D02D0A500DD12DD5BC903F4B39FC9F3A54A814900A04F685AAAF29199236D6D447EDE817D9E90654193CFF4DE690398AFF4E907E723BE41149B8DC5634A69F49BA6DFDAC2A29EFFCA664167A466B3C819BA1E01FE9E012F213C22F8AABAD0C4204AA78E5F446E4E21C64E2E3F4E9703FAE5893D6401FA95AF773A0D6836D5BA78F7715AFA9366A8D13E84EFCEFE0663EFBB831DFBE0B5EFD804277B40D38067C3C6F5D8A0DF8923E7F1FCA31F23B14F3B0C1A75235E7EF233B69428C5D1DA039A5665A45DC5695DE91FBF5987573E78C06516F4BC876F74F8BC12A017AD3E2A00ED5029D765E0807E64480759807EF8E1871D037AFDFAF5900BE8C7166E128096007A6C3F02743D872D4C71D0B316C9F3A5528812ADDBD034C13A018606ED687ABB343DF3CA782C78FB079B3B8116A7090B0F66DB6151A2995CE46AE0162DED9F476B1A50A20D66A9CC75AB77B1B5A0297D3E6F159B8545897CDD8F3C3B8AAD9D4031A294E87A6111C1A0BDF7688D14FBBAF0BFD1E0202FB33C5138A05F9AD05D16A05F5DB2CB2940F32552797DC22282D8DA1094A4C7482F02368567EDDB7982ADD5406D21D58DCEA1DFE9EF3C7197CEA2F9AB986E3C714DE9CB87F290AFFF8F9FB7DAB62D73D869CAC8C02DE8B9D36F7078FAE17399F84200DAA14EAECCC001FDF0600274C98E3B655D832CE8471E79441EA01F7BEC3159F57CFCA3CD02D012408FE9DB4236A09FFBC2395FAAAC06B2CB24C7E55095729D398703FAC5F1DD6401FAB56F763B056867EAEACA735D19073D679A35F6B7A244805EBCE698B0A01D09E5C2E31CD0D307B59705E81933663806F4BA75EB2017D04F7CBC45005A02E8D13727C806F4F38B9DF3A556A51F7932A05FB8A7AB2C40BFFEED1E01E8E2C6E716F4070FF576D81D08D05FFE795C00DAA152AECBC0013D6DD075681E57B1054D330989BB6BD7AE45646424D46A3514B4771A0085C964B25086EFBFFF1E04E8471F7D54562D9FFC64AB00B41DA0BBB574BCB335B9385EF8D2395FAAAC06B2CB44332D0BF2346CB5304F49DC827E7E5C175980FEDFD2BDB502D034E188260C39B3951307F4FB0F5A3700AE281D2140FF754200DA91502E3CCE01FDD0C076B2004DAE658780A60C7201FDD4A7DBE0A50482839CDFBFCB85BA547B513ABD05451A0B46DDD41C7201FDE257BBE0AD0602FCEBB676451A33747AE0B9B19D6501FA8DEFF609DD8A7B787E81194613F0DE033D1DF67902F4577F9F84BF9F023EDE56CB4C24F72AA0D15AA0D559F0D080B66826C382A6E83959802667B59CF4F9EAE3B8946E5D8CA8AE275FB51706F76A82368D1C2F26A4379AB168F5715CC92EAAEBB2B1FB0FF055B34E1CEC6FDD73B2BC54A03130C8A4E55837AE150908F6F7C653233A3894E2426A017EDA721639053A87794506D729E0EFA3C23DFD5AA07E5440C57DBBA080CD3F7108E87FFEF907E4AC1649282014100A0805AA47017231D30C6E5980966B41574FD5C55584024201A140ED5680C2EC64039A02A645120A080584024281EA5180004DCB3C3BB4A0FFFEFB6F0840574FA388AB0805840242015280004D3B59C90234CD09AF6DC962014C6633BB2D15859E882414100A08053C44010234ED05EB10D07FFDF5175BB4A3B6A5BC223DD6ECBE8CD8707FF46A13CDD6E51549282014A85E05B47A13FE3D988C2317722ABC70937A81B8B9631C22829CDFD9A47AEFB06A5723403FFBECB3E5039A32FCF8E38FA03549F57AEB1632B52529BD5468D5EF3E04D76B06A3AE0817F7AD46FA4C14CCF10000200049444154993DB058AC16B5484201A140F528E0A5F645E36E0311D5AC6B8517CC493E89F3BB7F85362FBD7A2AE60157E9D2A50B7EFBED374444445C3D93B0A8A80857AE5CC1E5CB97919B9B0BA3D1E8015576AE0A168B0539857AACDE978E941C03D4DEFE0CCADE0A3D125B84A06D832078ABBD9CBB48359D7DF6EC59346DDAB49AAE563B2F939797C7FA757878C53B2C7BFADD67656541A552213838D8D3AB7A55FDB40613FE3D928993A96604453580B76F60A93C26830E7919971017A0C7CDED221011E45DE3EEB1B215A629DD7E7E7EA857AF1E1A346880D0D050D6BEB6A9DE66B3D9A2D3E9909393036A7C82B5C964AAEC753C2A3FC139293D0FBFEFB880139772E01B148EC0F03818F51A146426C3D7CB885B3BC723B16D7CB5429A560B94BEFC9A356B06FA71946EB9E516F6F9E3EA643018B067CF1E242626BABA688F2BEF8F3FFE404A4A0ABA76EDCA340F0A0AF2B83ACAA9D0A2458B101B1B8BBBEEBA4B4E768FCA43CB1CFCBCE50CF69DCBAF10D04D239418D2BB19EA85F97B54FDDD55191F1F1F84848430EB392020004AA5B234A009C8E4DA2050D3434B80ABA989EA7EE67206BE5F7B08074E5D81CA2F148111F150AAD4CC82D615E4A030FB0AFCD5660CEFDB1677F66A536D03872D5AB4C0F8F1E36DD2D29BF3EEBBEF46AB56D6A541CB4B74DEA953A7D8E173E7CE21232303DDBA7573BA89C8AA1C3264085B83A536A7A4A424B6D60C7D467EF9E5972CA4A96DDBB615DE323D0B6BD6ACC1E0C1833D4A9AF7DE7B8F595AA3468DC292254B30618275B9D48A12F519D2A0776FC70B2B392ACB99E3851A3D16FDBA1B9B0FA75408E8B6F50370DFC06EA81F5DF12243CED4C553CE254B9980ECEDED0D5F5F5F663DD3EF3C29C882A65F086C66B3B9C6C3F97C722616ADDA8EDD472E42E11BC22C6782334F0CD285B9CC920EF00126DDDD03836E6A0F7535B83BA2A2A2909E5EE2577BEDB5D7D0A85123870F99F43C727710A0BB77EFEE741FA3AF26B2CEC98AAECD69E3C68D0C665F7CF105860F1F8E175F7C111D3A543C459AB4A1BCEEF87271466B699F910BE85F7EF9059B366DC2FBEFBFEFCCA59D3E37BF488705CB3760ED9E0B1502BA6393503C32FA46348AADD9EEA8CA08C6AD660236776FD0F90A4BB1B95C93AD662EC4C5942C2CFC6113761E3E0F957F38FCC3EAC14B75B51F8B20ADD714203FED2282FDBD30F2B6CE18DBBF1BD42AF7FAA4C3C2C2909D9D6D6BB7575E79058D1B37C6C48913D9DF6EBEF966DBB1499326D9FE2E3D6FCB962D3873E68CED98F43CB290E801A644AB6351E84E4C4C0C4E9F3E8DAFBFFEDA768C5F842044D7DCBF7F7F997D495A1F8A8F1F366C98AD9ECB962DC3983163D8EFD263F6F7C10BE6F9695B359E162E5CC840C92DBBF2AE575E999F7FFE399A376F5E4A37FBBAD0D8CAAC59B3D82879CB962DD917C3CB2FBF8C8E1D3BB27197B7DF7E1B77DC7107DE7AEB2D562D5E669F3E7D70E4C811964FDA1603060C6071AB94E83CD298D2FDF7DF8F3973E6808E539D08EE543EFDFCF9E79F6C0088121D979EC7B528AFEDEDDB972C2CDE67487FD295A79F7EFA091F7EF8A1ED77D29ADA9EEE99DA9AEA4575A47BB2D7D45EB7323B84937F2C28D261EED2F5F87BF7B90A01DDA969181E1BD7B74E019AA49582994B6D03B493DA5FF3D3D3B3F3F1C6177F61EFB18B5007109C63A0F42A5957D5BE82F442A2A88E9C943308095063CC1D5D31EAF62EF056ABDC762F3400400F0A4FB367CF660F1B01A07DFBF6F8F5D75F6DC7BEFAEA2BB46BD78E3DE8D2F356AD5A8503070E80CEA54470FBF6DB6FD9BF09DE645DD3DAB237DD7413A80C2A9FE7A773A589EA42F9E8B87DA2F36813619EE8C1A7BA5C7FFDF5AC23F5E8D103CB972F6787A5C7ECCF7BF5D557D93993274F66A3D3524380D793DC08655DEFB6DB6E03FD945726E946EE1FFB7AF2F3A86EE7CF9F67FAF23C742DD28E2045C7C8BD44C709E094A64C9982952B57B26353A74E65F748FAD3CF9D77DE8977DE79078181D6C12D02AF56AB657A5379348643962A7DAED2A42FFA3B819F804CAE2C4ABFFFFE7BA9F3E86F15B5BD7DFB1248E7CE9DCBEA4CBA503D29D1F5EC279A51DB926B8CFAC18E1D3BF0D24B2FB117367D4A57D4BEEE7A00F20BB5950274E3B8087755A5C6945B2B00AD3718F1D8BB2BB0FFC4E552C2FB06472224BAD1558DA1C9CF4241C625984D25D12AC101BE983CB82786F5EB08959B2C697AC8294A8627B2E438682B82774580963EA4654196E05B1E842B02B47D59041B821B954580B6076D45C7E81C3A5ED679FC5859D793739EA332EDF5B107B414DE540702AD14E652F8F363D41E94087C04480E7CCA5BD631CA2B6D43E979F6C7E877E98BDBBEFE151DB3D7906B432F66AA1B819DA78ADAD05DF41280AEBCB2351ED006A3096F2EFE0BFB4F5CB2DDBD4E6F445EA19659D21501DACF5B89A08092DDA4C382FC316DD40DE8DCAA4129477DE5652DFB0C7B084B73791AA0093C04489EC83A240BDF11A02BB2842B826959D7231FAB23EB9ACA243FBE347DF6D967CCF2A6E46A40930ED2411C7A71710BDA194073B0F3FBA0C140FA62910B688ABEFAE8A38F4AB9382E5CB8C05EA4E501DA5E37FA5AA0AF1D772501E8CA2B5BE3015DD62D6F3F74167397FE8BB4426585801E7B47674C1FE57857E4CACB7A6D004D616464A1F3A810FA44A741C0EDDBB733DFA37DAAC88296C2947CDE04215AB3D611A009066421F274DF7DF731BF2BA5B2CAA4E3F6D635BF1E3F26B74CFBFBA3D03A1A202360F3E44A0B5A7ABD8AAC6BCA57190B5A5AAE14D0D4BE34B6402E137B17873D84C9DD71FBEDB75708E8EA1E771280AE3C4904A03D04D0349045C1EA3C113CC9E749D11A15B938C8C7CB272D9015D5B97367F600F35491D54ED7A070330A3B9326F21793BF92E04089C2F17EFEF967067947802690F3F3789904688A3D961EE365929B87A029F7584565DA1F2BEBDEE5029A62536910977CB66455D2CFBBEFBE0B2F2FAF5216343FE60CA0EDDB9EEE83BE00DAB46903FBF6A5AF98071F7CF02A401F3E7C182B56ACB04DC4A1496714B54110961E23ABBC7EFDFAA5F4E6BAF16395C788BC3304A0E5E924CD25005D8D80FEF8E38FD974FAF292D447C81F7CCA2B3D8FAC4B0AD5937E8AF2F30882DC5A9503688AF5A5B2ED13019AA0CFCBEDD4A913CB42E5D3C34D7F976E2E4C616CFC5859804E4B4B63EBDDD22C3EFB32A93C3E59A7BC63E59549EBC6C4C7C797F2AD523D49031AE82398D25642D244D114A41D852ED24B822C4D02134F4B972E65BF13A00972B404827D5B906E3CF163D2F3E8D8B163C758F9BC9DA46D687F8CF24BDB5E0A68E931D289EA4D6D43F05EBC78311B7CE589A271A82D28D1DFE9386F277E4C0A61FB6B0A40571EA0EE3E4300BA1A01EDEEC6B42F9F5C1C83060DAAD65967F67E66AA1359AD04037BCB5AAE1EE595C907E7CA2AC7DEA2957B2D91CF7D0A080BBAF2DA0A40D762405714E151F9AE22EF0CFBC13E3AEBF5D75FC7E8D1A3D92CA9AAA4F2CA1C3972240B692B2B25272733F7847440AF2AD716E7B84E0101E8CA6B29005D8B015DF9EE20CE100AB84F0101E8CA6B2B002D005DF95E23CE100A3850805690A09983455A1DF8D23E851A1DBEF8653BB61CBA5CE14CC236F583D89C84FAD1D678734A34812C34C8AFCEADE52E002D002D60231470B9021A9D01BF6D3C84EFD6EC416A665EA9F2553EFE15025A5F5832998B4EF4F351E3F6C4D6B87F586F848704B8BCAE9E5CA000B400B427F74F51B71AAC8046ABC7AF1B0F63C96F3B909557C4965EF0F60B8297B70F5B0258A52E992446B769361940B37C690906A34EC39607A62DEA06DE781DEE1BD2ABCEC1993411801680AEC1081055F77405B43A03D66C3D8A4F566C46A1DE8280B05806E7B2160662F762B140AF2D4061560A60D4606CFFAE187D47578404FA79FAADBAA57E02D002D0A53AD60B2FBCC05671E3891645A28914220905AAAA804E6FC0BFBB4FB1D9BD053A335B02D82730EC6A485B2C30E88A509099C4E03CE68E2EB8E7AE1E08F4AF1B7B1396A5AF00B40074A97E413305690BF8B8B838F6F77DFBF6213333F3AAD986557D58AFC579B4DE35CDC0A3597972122D35BA79F3665BD64F3EF984E93170E04039A78B3C6528406BE66CD8730AEF2F59C72C6982B477406809A46975498316F9E9976C701E795B973AE9D690CA27002D007D15A0F932A574A0AC85766A1A81681123BA27E91A2115DD83FD14715A5294EF7A51D3EEDD93EA4BAB4E12A4DFFB7A1D8A0C1604473580DA2F9841DA6CD423E7CA39580C1A8CBAAD33C6DDD59D456D94EB0AF1A41B73635D04A005A02B05689AFE2CDD3A89A607D3BA1D34FD98AF64C757C12BEF184D7FA6058CC8A2A5A9D43CD17AD634F59BA648DB1FA3C92A044A822C5F5C9FCE23F8F2EBD2BAD4F46F5E26ADBD4CB0A57D086991FDC8C848765D5AE7E2E2C58BB8E1861B6CD7A6C587E8CB81EA4CEB3C376CD8904DD3A615DEA44B7CD209E402E2EB3BD3EFB496344DADA64933A4034D33A775A5F9312A9BD66016092048FFB1F90816AFDA8EEC023D82A21BB2C1C29C2B67A18601FD7BB5C1D4E17DEAACCFD9BE8FD46A405FC9352120AC6401227EF3FAA23C14E5A6635CFF2ED5BA9A5D4D784009AEB4180FCDC2A374E2C409B6D12D2D144FC97E76225FCF81AF97215D6E54EE31AE0B2F5B7A9E54B3B22C613E0D9C8ED16C45BE79009DC72DE1B2CE23C012C079E2D3C6695A7A454BBF4ACBE5E71280F992A3345B927EA7CD5D29D1BFE947BA746B4DE807EEACA334042F334F0B28550CCE753594AE22AD6B35A0690BAC8AD23D77751780B6138840429626ED1AC2D73E96EEC44210E59B0CD0A9B4D810ADB8C701CD77F8A063F680B63FB66BD72EDBBACD949FCAA53C54261D236B9A438EFE4FA0A5414C6E9DD2DFEEBDF75EB6625B5910AE08D074AED4E541F748207516D0F67017802EFB09E42178DFADD98DACDCC23A1D4A57E7007D29351B3B0E9D436E81A64240B74F8847F776D6253545B22A20DD2A8BF6D3A30132FAD4E74B98F22DBAA47AD131CAE3C8BAB60734B912A4ABF211DCF8EA6B748CB669E289E04D10E63BBB48AFCF8FD9FB992B0234B949C865C293B46C672C680168F94F9246A7C71F9B8FE2F2956C4C1C783DC282FDE59F5C4772D64A0BBA8EB49D5B6E530A68BA80FD20A1A32DB66815396E713BB2A0A97CE9B2A5E5DD90D48D51DE605F652D682948D7AF5F8F69D3A631DFB6B0A0DDD2ADCA2D94763FA2088FBA1C4A57E72CE8EAED62B5EB6AF680A61D5A3EFDF453B6EEF2B871E3D83AC763C78E2D75D3B4E03F1D237873570165A0C1383A466B18DB839DD6B4A605F0C99DC11385B2AD5EBD1AB4B6321DE389A04CE0A7813EFA37F7EFF2E3B4EF624580969E479B0ED00EDAB488FDF8F1E3591134E8497E76FA122040F36334B848D7B21F24DCB66D1B033A4FE472A1DD5FFCFCFCAEF25F0B1747ED7A3EAAFB6E84055DDD8A7BF8F50866FEFEFEA596E9E40BD4D322F694A43B93D3EF04263AC621CC8FD3DFE818258ACCE03BBF7009341A0DA48BDF53281BE5A1BFD1319EA4FBF5E9F57AD0CE31D244C709B0748CEACE13BD5C424242D8AFFCBC808000B6BBB8F43E28FA82AE4D0BFC4B8FD1801FF9E2EDC3ECC8E72DDDFC97AEC9973D955E93AE4175A563555D6AD5C3BB8BA89E9B15B001BABAF72773F37D89E2AF81024D9A34C1B973E7AEC195C5258502355F81B262BE15665A171080B1A00085972EC16234D4FC3B1577704D141833660C962D5B764DAE2D2E2A14A8B90A28A00E09464043EBEEF4525033409BCD6664EEDD834BDF2D857F5454CDBD4F5173A18050402850C314B098CDD0E9F468F7F26CE60ABB0AD0E49FBBB26533F4070F2261E4A81A767BA2BA4201A18050A0E62A60282AC2DEB91FA0EDDBEFDAC67F38A4152693C9420319C99B364271E23812460840D7DCA61635170A08056A9A0204E8DD73DE478BD7DF6083DA522B9A019A46EE2F6FF817EAFF4E2161F8C89A767FA2BE4201A18050A0C62A60D01461D7DC0FD06CF66B080F0F679144A52CE8FCFC7C0668EFFFFE43C2F01135F64645C585024201A1404D53802CE85DF3E6A0C9CBAFB065162A00F429240C1D5ED3EE4FD457282014100AD458050C1A0D76CD9F2B03D0A708D0C36AEC8D8A8A0B05840242819AA60003F4827972007D12094304A06B5A038BFA0A05840235570106E80FE7CB00F4C91302D035B79D45CD850242811AA8001B245CF8A14C400F1E52036F515459282014100AD44C059805FDD14219803E71020902D035B39545AD850242811AA90003F4C7B2007D1C0983E459D05F6C3E89E5BBCED648416A4BA5BB3589C2CCFEED11E2E75DE55BCA2CD062E1FAE3D8FCDF952A97214E745E01959712A3BB37C5C49E09552EEC485236E6AF3D8A7319F9552E439CE8BC0271A101987A634BF46A7EF5767B6595CE00FDC947322CE8E3C791307090AC1A26BEF507140AC0C75B212BBFC8E45A050C060B4C6660E5437D111B625DD2B32AE9545A1E262EDE0C2F2F40AD126D59150D5D718E566741427430964CEE53E5E296EF3987796B8FC15B0D2895A22DAB2CA41327D2AAA03A3D705FEF044CE9DD42564906AD16BB3EFD580EA08F2161804C40BFBD1A71D15E78FCBE60599510995CABC0F7BF1762CF613D563E78B3F380FE720B7A77F5C1A05BC59643AE6D25F9A53DFD663612A283B0E45E2701BDEE381E1C1B88668DAC6B5E8B54BD0A24A51A3177713EEEEB458096F73564D06AB0EBB34F6500FAD85124DC3D50D61D25BEFBA700B42CA5DC93C906E8A9373A09E87C4CFC7AAB00B47B9A4976A936404FEC25FB1CFB8CCBF79EC7BCF52704A0ABACA0F327DA00DDB339A6F46A2EAB4066412FFA4C06A08F12A007C82A34F1BDBF04A06529E59E4C3640DF7F83F3805EB24D00DA3DCD24BB5406E8A8202C99D853F6395703FA02E6FD2B005D65015D706209A09B614A4FB980D660D7178BE400FA0812EE9209E8F7FF168076418356B5081BA0A7F4711ED0DF6C1780AE6A43B8E83C1BA0272456B9C4E57B2F60DE8693C282AEB282CE9F6803742201BA99AC02998B63F11772017DB7AC4213DFFF47005A9652EEC95402E8DE2E00F40E0168F73493EC52AD800EC412A7017D4A005AB6EAAECF5802E8A6F2014D511C5F2E9601E823879170974C407FB05600DAF5ED2BBB441BA0EFEBE53CA0BFDD29002D5B79F764B4017AFCF555BEC0F27D17316F830074950574C189A5009DD85456892CCCEEAB2F6500FAF02124DC7997AC4213E7AE178096A5947B32D9003D3911B1C14E84D9A5E763E2D2DD02D0EE6926D9A5DA003DAEBBEC73EC332EDF7F09F336FE272CE82A2BE8FC8936405FDF0453AE6F22AB4006E8255FCB04F41DFD65159A387F8300B42CA5DC93C906E849D72336D8B7CA173995518089DFED1180AEB282AE3991013A32104BC676AD7281CB0F5CC6BC4DA705A0ABACA0F327DA00DDA331A6F4682CAB4016C5F1CD1219803E7410097201BD60A300B42CF9DD93C906E8893D9C07F4B2BD02D0EE6926D9A55A011D8025639C04F4E63302D0B255777D461BA0BB37AA1CA0BFFD4626A06FBF4356AD133FDC24002D4B29F764B2017A4277E701BD7C5F8D0674618106BBB71EC34DB777718FD8D550AA0DD0A3AB7E0FCB0F26615E0D0674DA956C9C3F938CEEBDDA5683E2EEB9442940776F24EB22CC825EFAAD0C401F3C8004B9805EB8B9D280FEEAA3DF90975B68AB74C76E2D70C32D9D65DD84A765D269F5F8FDA72D1836AE2F766E3E82A09000B4696FF539498FB9ABDE2580EE86D820275D1CDFEF7739A0CF9CBA8C3F7EDA72D5ED07870460D23479A19C72B54B49CAC01BCF7D89055F3F5DEE29C70E9D437E6E217AF46967CB43FDD1D575915B67FB7C36408FAAFAF3C000BDE5ACCB2DE84D6BF7E1C0EE53B62ADBB7213D0737F4EB84E0D080AB6EBFA2633CF3FC379763C6ACD1D8BFEB24D6ACDA86E7DEB857B68CF66D48D7EBD1BB2DA2EA85C92EC395196D80EED610532A03E8EF96CA01F47E24DC7ABBACFA267EBCB5D2801E71CBB3A5C43F7AF02CEA378CAE91968FD168C2B9FF9290D0BA21162FFC15317111B87388751698F4982C31AB90C906E87BBA2236C8A70A25584F39955188892B0EB81CD039D9F938F75F32BBC6E7F35761E8D89B111119026F1F35DA769037BA2DF7A6E4007AF5CF5B7125391393A797CC94A5FEE7EABAC8AD7399808E08C092911DAB5A04961F4AC6BCADE75C0E6802684C7C24125A3560752BC82FC289231770FFA383D9EF67FF4B427CC368F8F85C3DBD7CD6C30B3163D628C4C647967B5F04E64EDD5B5609D0C494156BDFB2954D75A167D13FA0EA464B951B00800DD05D1B604AB786B28A6216F4F26532007D80007D9BAC42133FD95625404BC5A44FD3AF3EFA1DDD7AB5B17DD690E03C4D9A7637EE1ADA9BFDCAFF4E0FD4ECF7A7B2BFBDF3F212F6694B292A260C1F7D3B131BFEDA8BC2420DE8E1A363743DFA749A7ECFDBB8E9B62E98FE8C7553DCA71F98C7CA9934F815F6BBFDB1F36752D8DFCBBBDE57AB5EC6BB2F7FC3CE7BFBA5AFE1E5E5053F7F1FD0DF29D1315ECF85EFACC086BFF7B2BF0704FAE2AB55B3593DD352B3917E259B1DA3F30202E54763D8003DAEB39316742126FE78D0E580967622E9434A6DF1D1BB2B589B53DB3FFDCA78D6F6E5B5EFC8F1B7E0E907E7DBDA97972B6DFBF95F3F55CA82961EA3F6A7BE30F3A10530994C080CF2C7BB9FCC40E3E6719876CFDBACCF50FA61C95AAC58B2D6566D7E1EB513F52D3AC6CF93F580543213B3A023FCB164849380DE76DE2D80EED3AF138328253240D6ADD98D944BE9EC0B84F49EF4D00044C784D99E357EFBD959F9080EF167CF07D774F7D6A3ECF01F2BB7324DA97DE918B7A0E3EA47B26394F8F34B7D46FADC53BF98FDD467A0E794AC65FEFC525DE818B52F7FEE795D785F9B347836167E3B933DFBD2E7BE924D5666F65280EE6A7DA1394A0CD0DF2F9701E8FDFBE403FAD3ED4E039A2A4E6F676A78EA007DDADCCFDE7E1CE2FCD8FC37BF67D6CFE6639FB346DCBC6EBFB5F1BE5987C53FBDC8AC583A975C26FD07F7C49BCF7F8537164CBBAA4CB2A20AF2351839E116DC3BF4559C3E71C956E68C49EFE1DEE903F0DFF14BD8B2FE0056EF98C72C8591B7CE6265C6C447300B82EA49293FAF08CF3DB2907D56DB5BD0F6C7BE5CF85BA97A366FD50023C6F763F59CF5BF49CCF2EEDF6306D6EC9CEFA82D6DC76D801EDBC97940FF74A8DA004DD62E694AF74F9FB594A456106F5F3A4660A7B6A076975AC9D23E43E757748C975D96052D3D26ED33D41694DE58301DBC5F90E54D7D66FE574F2128D8F58B4AD9003DBC83EC3E609F71F9A114CCDBEE7E40D375E919A4B6E2EDC4AD647B8BD6DE8266E74C7A0F8F3C3B8A3D8794E8D9E5CFB6F4187F467FF8E7CD522F602A73F2F401ECB92FEB7AFC1867027F46F97348D7A044CF5B59FDA2CA0D20B5A0BBD4C794CA00FA87EF6502BA9F55344729F1F39D6E013435064F6461F5EEDB010468A9E56D0F76E9434A30E51096363EFDDB1ED0D2878D3714019A37309DC3DFEA04D590B040B4EFDC1CF562C35158A0950D68A9FB83E04D1D840025FDE4AE32A0C774446CA0132E8ECC224C5C79B85A015D96BF98204B89ACDD6307CFDA1E7CDE16520893DF31B641146B0BFA74B677716467E641ABD5B3F2664C7C8FF51D4780B6777F507B10A0A53ED16A01F4D0EB1C3D7AE51E5F7EE40AE66DBFE0760BBA22403F30FA0D66E90604F8319F74598026B8F397B33DA0ED7DD004D9AA02BA3C78D3F3C78D21B701BA733CA674A92FAB2D0D3A1D76ADF84106A0F7ED45825C402FDAE51640F7EE5BFA136FFCD4FE78F989CFAE39A069E0E29BCF5683069B6EBDBB3BBAF56CEB19801EDDC17940FF7CE49A027AD7D6A3F879D906D69973730AD0AA6DA30A014DF9785BDC39A427E8E5C9A14F8393BFADD88CD4942C561E7D25D5184087FB63C9D092414C594FB7241303F48E8BD714D0F4727CE7E56FD0B8592CEE1ED61B1FBEB3A2940F5AFA85C4AB2EB5A06B15A03BC7CB6A4206E81F57C80474DF7EB20A4DFC62B7D3803E75FC2236ADDD8F9B6FEF82662DEAB34F9D675F9F68F33BF38AD09B70C4845BD82711F995922FA5B1F38A0AB578F08961080D0FC2A205BFE0E09E53CC1D21D782EE7B47578C9F7A272BF3E3F77F4483C6F5988BA341A3684C7974300C7A233E9BFB333445BA52839B645DFDF0CF5BB2017DE97C2A1E9D359AD593C0B2FECF3DAEB3A047B6776E90902CE85547AF29A02B72719465414B3BA8BD8565EFFE90EBE2209FEA132F8C65835DAB966FC0A7735656BF054D801E52F510B3E54752316FA7FB014D63472BBFFB178D9AC6B028ACB20602C9A7CFBF40A583848E004DCFE153B3C7A345EB86F8FBB71D786DE617A52CE803BB4F62CEEBCBF0C25B931DBA38EE4C7C14CFCC9EC08210E8CBEC9D9796B0F3AAC582EE1487297201ADD561D7CA1F65007AEF1E24DC2C13D05FEEA912A0FBF42BB190FD03FD70C32D9D586350A246FD62C12FB86B68C99AB8770DEB8D1347CEE3AD17BE6650A32880EB8B43A5A8A19AB5AC8FD0B040FCF9EB76D6184545DA4A019ADEF8345897969285479F1B839CAC7CBCF7CAB7E875730706E8837B4FE18917C7C162B660E79623AC9EE4E2B87368EF52803EB2FF0CB31A1E787C28F47AA3ED18758C796F2C43FD46F5583D7FF9611366BE3A810DB4B8C4C531E23AE72CE8AC224CFCE5D83505F41F2BB7E0CCC9CB4C5B6A8BE87A61155AD0D2B02F8A2EA03EC52D687A80776E39CA421DAD9FE2076C16F42FDF6F6483BE6326DFCE069638BCCF9F4EC682777E804AE585F8065158B57C23B3FA1A358DAD5E1747B81F960C7202D04753316FD725B758D0BC5D48531AF0A3F11E7A462849014D2F484AFCD926BF2F85E5D1E0380FA5ABC8C54180EEDEBB1D8A0A34F8FBF79D98F0C05D8C07F485959591CBCAFAF7AFBD3640DFDEED1176BCF5754D70EBDD3D585DF84B9D8CB6D52BB7B081407A0E9B348F6306DD98FECFBBDFC5D1310E533AC5C932769905FDF34F32017D535F5985267EB5B7D280A64F59FEE0D045E21A4431CB599AF80020FF5BEBF64D1019156A1B180C090D44FB2ED69D0A8E1D3A8BCCF45CF66F1F5F6F160D909A9CC9E0479690F501DD6F1BD8931EE3FE447AA02945C786A3651B6B60F9BE9D27405602257EBD0B675370F19C75DFBEC41BAC7E427277505D2A3A46F94E1EBBC05E00AC73ABBCD0F3C6F6AC9EE427250850DAB6F110FBBBDC641B241CDECE7940FF7ADCAD80A6766A9A100F5F3F1F68353A9C3A76D1D686FC7EA5EDCEFB059DD7B0490C8BBC909E476E8CE44BE9EC541AB4B52FB3BC7E415F6C9468509ACAA4FEC8274548DB90974BA182E42A91F60BF27BABD42AB9CD243B1F1B2424400F6C23FB1CFB8CCB8F11A02FBB1CD052BDA5CF1ABFBEB47D793B4ADB903FA3D456A429FD2E7DEEF933CAF5A617A5B47DE93A74ECF0BED3AC1F911B8CF70B7E3DFEFCDAF799DDDBAC515E94384BA4CF9AFD735865F18B4F319C0DBB0000200049444154B44571748CC5948E7201ADC5AE553FCB00F49EDD48B8E96659754CFC7A7FA5012DABE06ACAE4CE019FEAB8051BA087B5456C60D5378D3D95A5C1C4DF4EB815D0D5A1474DBF0603741801BA55956F65F9B134CCDB9DE4724057B94275F0441BA03BC4604A47ABF1E528310BFA97557200BD0B0937CA04F4920302D08E9477E3711BA087B6711ED0BF9F148076635BC929DA06E801D658E3AAA4E5C7D2316F8F007455B473D539A500DD214656B1069D16BB7EFD5506A077EF44429F1B65159AB8F4708D06B4AC9BF4E04C36400F6E85D880AA6F107A2A5B8B89ABFF1380BEC66D6D05B42F96DC296FA3D1B2AABBFC4406E6ED4D1116F4356C4B1BA0AF8BC694F6F564D5C4A0D761D7EFBFCB00F42E02F40DB20A4DFCEE8800B42CA5DC93C906E8412D101BE0848B8300BDE6B400B47B9A4976A90CD0A1046879FBD8950DE84CCCDB27002D5B7437642C05E8EBACE3608E127371ACFE4306A077EE40426F79DBBE272E3F2600ED4879371EB7017A4082F316F45F6705A0DDD856728AB602DA074BEE90B78F5D99803E998979FB5385052D477037E5B101BA5D14A6B48B92751506E83FD7C800F48EED48E8655DFBC2514AFCE18400B42391DC78DC06E8BB9B21D6DF0917478E0E13FF3E2700EDC6B69253B40DD0B7C9DB85A34C409FCAC2BC036902D0720477531E1BA0DB46624ADBF21788925EDEA0D763D75F7FCA0474CF9218E48AEE2171C54901683735B29C626D80BEB3A97316748E1613FFB920002D477437E661800EF1C192DBE4EDC25136A0B331EFA000B41B9BC961D13640B789900F68B2A0FFF95B06A0B76F43825C40FF784A00DA6173B92F830DD0FD9B3809681D26AE1580765F4BC92BD906E85BE52DF25E26A0FF2340A70B0B5A9EE46EC9550AD06D22645D83B938D6FE2303D0DBB62221B1A7AC4213579E168096A5947B32D9007D7B23E701BDFE92B0A0DDD34CB24BB502DA1B4BFAC95B43B84C409FCEC1BC431902D0B255777D461BA05B87634AEB70591760805EBF4E26A07BC8DBF63D71D559016859F2BB27930DD0B73544AC7FD567B69DCAD563E2BF9705A0DDD34CB24BB501FA66792BA09509E833B998773853005AB6EAAECF680374AB304C69256F5717E683FE77BD0C406FDD8284EE3D64D53AF1D7F388085362447FD7AF8D2BAB02753CD3BF3BB43879D68895B7D4771ED01B93715D4B357A75A9FAB2A575BC399CBEFD4FBE2B4042B03796DC246F7A7099803E9B877947B230F0163F663C8954FD0A64649BF1E39A22DCD73214535A86CAAA0003F4C60D3200BD65B36C40F7FFEB1272F46659151099DCA3808F5281E57DE310E357750BFA4C9E1E0F6CBD8242A3C53D9514A5CA56A05D980F3EEF2D6FF6595985AEBA908F3947B2201E4BD992BB25A39702B8BF6528262684C82A9F017AD3461980DEBC0909DDBACB2A746D721132742659794526F728E0E7A5C0AD7101F05729AA7C817C83199B5335C83388976D954574C189D482B17E2ADC10237FDB33FBCB5E2C34625F86165AB378D9BAA049AA5C845A01D0CBB66588BC09640CD05B36CB01F4462474E956E58A891385024201A18050A0720A30406FDB2A03D09B08D05D2B57BAC82D14100A08058402555680017AFB361980DEB801099DBB54F942E244A140752960B158401FF2791919C84A4F8351AF8752A140786C2C82C2C2A152A90085025577FE54D79D88EBD4750518A077EE281FD0050505B8BC750B52BF5C0CB3D100D6F345120A5C73058A3BA2055058CCB098CD5058E81705A05440A150C26CB1300813AE554A6BE402FD9B76C0A1FC2090B3FC4AEB79F4634B02DFD7BC894505A05028E0DBA4099A3CF50C222222A056ABD9DF28294C2693A5A8A808A9A9A9B87CF93272737361341A856C42816BA7004158AF8745A301B45A78E5E6409D9509EFCC4CA87373A0309B411634C1997A2AC19828AD54ABA1B258A0A4F38B13C1D91814047D44240C1191308584C2E2E707859F2FE05BF501B96B278EB8726D528040ECE7E7877AF5EAA17EFDFA080D0D655F7F36409BCD668B4EA76360CECECE06C1DA6412D119B5A913D4847BB1984D306667C3989303537616909509A4A743919101456161097009C83E3E30F8FA41EBED0DEFCC0C98743A1428BDA08B8F4390AF1F7C755AA8345AA8B41A28B5DA52B74F70B6444402111140743D788585C12B2404AA901028BD451C784DE82BB5AD8E3E3E3E08090941585818020202A0542A4B03DA6C3643AFD783404DD6335927220905DCA500EF5FC68202685392A14949863E351586D45418333260CCCC80456FDDF49525A512E6E060988343D88F29240486C040688C4644FCBB0E3ABD1E3941C1D0F4EA8DC0C828F8984D50E7E7C3AB201FCAEC1C78E5E7C12B2F0F8AFC3C40FA75A8544215150D556424D4D1D1F08989856F5C1C7C6362A00EB6C6B0724BC65D5A8872850204646F6F6F10A8A5EE0DD6FFC882A67FB04F46F2D915FF5BC826147087024529C9283C7F1E0567CF409392027D7A3AF4599930E65A37FFB525B274C3C3618E8884392A1A0808802228088AA06078F9FA322BC370603F14EBFE8141A984AE556BF8F7BD0521A1A10CAA068381191D0672931414C0929F0FE4E742999909655626149999405151C9F5140AA80283A08E88807778387CEBD54360B3E60868D4187EB1B1F0F29617D3EA0ECD4499B55B01EAAFF4437DDADE2850588ACD196135D7EE4E70ADEECE505888FCD3FF21F7E851E41C390C436E0E4C4545301615C1623094AE5678382C71F130C5C533382B7DFDA0F4F385CA3F805918F4E3EBEBCBFE6F361991B6E833E84F9D623E65EF21C350AF5367F6A9C8014D5F845AAD967D19D20F8D961B8A8A60D66860D669A1C8CA84322505CAA42480DC2AC5060A7B48BCBCE0E51F0095BF1FBCC32310D8AC1942AF6B8F90D6ADA10E0CBA56728AEBD66205CAFA5AB301BA16DFB7B8B56A5280BFE43569A9C8DAB717D9FBF7A1E0CC19180B0B61319960B11F7CF6F1016262616EDC18A6F8FA4040A075A08F60ECE3C33EF9E887A04CFFE790A68E9C7BFA342E7DB21006F253C7C42062DA2388898B431059D90A05FB1AA4B114B2A4B9354DB02E056C72E9E9F5301A0CCCCFADBC7C09CACB17A138778E457F481301DBFAA34250CB1608EBD819611D3B22A041C3127F61A908916A125D5CA6562B20005DAB9BD73D37C7414CD0351B8D6C902EEFD449E41C3C809CC3875074F162E90B2B14B0D0E71BFD040642D1A4294CF51BC01C5D0F0A5F5F366A4DBE377B20739F1C81D98B2C5A0264B1FBE2C2CA1F91FEC7EFCC1A56F5ED87F80183101919097F7F7FF6A9C8E2A48B7F08D6F443E32B1CD6E4FE90029B8FC110D429AF3239095E17CE4371F9122C3939CCBAA6E8117B70FB444723B463478477EC8CD0B6EDD80B4649A3F05E5EB6903EE1C7764F3FAC0BA50A40D7855676F21E39902946DEA4D1C2585800437E01728F1F43CE9143C83F791246F2F14A93B7372CE4B7F5F165111396F87858E2EBC3121AC6804C3F7C60845BC8DC4A2658D3710232C1563AAA4D7529C8CEC2E90FE723FFC001C0CB0B010F3C8406ED3BB010252A530A44DBCBC40ED8046229B0B91B845BD8DCF236190C0CD0CAD4142BACC962D7E9A0A0414C72D1482C6DA58F0F825AB44448BB760869D90A3E915150F9FB434523F36AEBB66402D64E76C63A76BA00741D6B70B9B7CBAD4F02AF36231DFACC4C14255D46C1850B283C77169AA424E6B6B02502504020CC0101B0909B8106F6222381A8682809522A95CD4DC12DE5B280CCAD643E7022851AD589A09ABA67172E7DB304FA9414A07113D47BE021C4C4C4203030D0666597779FE5019BCAE5C026384BFDD7645DB30147830126AD06484B8322231DA081C6BC5C280A0AA0A01794C48543163459D734C818D8B429FCE3EBC327228241DB9BFCE464610B60CBED8E75369F00749D6DFAD237CEC165D2EBA04B4B83E6CA15145DBA88A2E414689293A0B9920203455A4806D228B2822C624B6808FBBF223C1CA0FF878543EDEDCDDC16DC4AE6BE64FA5D6A2173204BADE4F2C04575D469B5B8F0E30AA4FEF13B2C14EF3C78281ADCDC97CDC0A2807F3E122EA759A503E33C8A89FF5F0A6CEEFEE056361B70341860D4E960C9CB85252B0B168ADBCECD8532271B0AD2C9EE8B42151808DF9858F8C7C7C32F3E1EFE71F12C3AC42F2E1E5EE48B17B096D364752E8F00749D6BF2921B6680B25860282C40C1B97328387B1645172F409B9E067D5616741919304BE391C9EA8B8880393C0216FA090B83323818CAE01078050430284B812CB59009CA04633E4B4A0E90A54DC32DFABC94149CFBF20BE4EDDDC3FCD9C1D36720BE6953E6DEB08F21AD6CD396056CEEBF960E3812A0B90F9BC39BFE4FD129E6DC1C6B485F4EB635A42F3303C8CA2A6D5DD38B2B2C0C3EE164514722A0491304346CC4AC6D5FFAEA10B0AE6CD3D5DAFC02D0B5B669AFBE31E9E73D4D0EC9397A1479278E337785213F1FC6FC3C16FE56CA4AA678E47AF560AE17C306F594814150F8FBC3CBDF1F6A0A6F2B0E7DE36E0B1E69C1FDCCDC8F2C8DF3E435AB8C3F96EA4E904CDBBF0FE7177D06435A1AD0A60D6226DC6B736FD843DF99A6B587B574C091EAC181CDDD1F521F36738768B5301516C24CE184458550A6A6C22B3D0DB89202486646521DD9CB2D3010AAA060665507B76A8DE0962D11D0A00194EAD23E7567EE499C5BF3141080AE796D56A91ADB66ED151522F7C40964EFDF8FEC03FB98854C11182CF4CD7EE66854141BD033366A0C0BF99069504FAD869A42DD24A16F3C26D9DE6D611F785F1520DBDF249BEDAAD1E0D29A3F90BC74295B12C967F418D4EFD587B937E8055119F7466544B49F23207DD1F170BEF2FCD734E8C880ADD382061CD917495626BC2E5D82F2D24520230390FAF269D20245AB50644B501042DA5D87B04E9D11D6A103BC838285755D9986AB057905A06B41239602088594198D309B4CD0A6A723FBE00164EFDB8BFCFF4EB14FF0526E031EFAE6E303456C1CCC8D1AC3D4B021E01FC0DC11F63E64F2F1961769C1A12C1DDC73A5B464B1E6255DC6D9AFBF42C1BEBD40541442C64D408376ED58ECB3B3EE8DAAD6D51ED6F6C0E62E101E1D6203360D389A4C50141640917419CACB97818B17009DAE24A44F522902764093A608EFD205611D3BC13F2E8E59D74AB50A8AE255FC846BA4AAADE8B9E709407B6EDB5458331B94E9D35FA301CDD8A309218517CE23F7D851F64353A94BB92BBC54B0F878036A6F202418888D87393E9EC18E66ED1194A533F6ECDD16DC8F2C0D7DB3ADBAE5C6491A2C7AC36040FA91C338BB601E4C14F6D6AD3BEA0D1884D8C68D59EC33D5DD13922D24B138F6BAAC093357CD70A401478A27D7EBA1484F63E17C484981222F97019B85F4D94DF2A10891E096AD10DCA60D0BE9A3D996E476A2B03E451953863D411B5187CA2B20A67A575EB36B7E06455AE8737260C8C9812E3313F967CF300BB9E8C2056BA445894F814D83869F3F2C01FE405838101BCBDC168A9050781547599435B027755BD803B932BE63578845D0D31616E2D29AD5B8B26C29E0E303BFC14311DBB317A2A2A3AF8A7D76C5355D558674C20CF7A34BDD217CB091FBB0B94F9BAC6B364126ED0A14A9A9B0646640595404057D05D10A7D92681AA5B737029B37476093A6086A9E00DFA8683608A9A6A52BA9FD45AA110A9439D59B2F9674A5508BAD4959D018C552A31ED59AC5338EFDB50508CFCD42784116FC32D3A04DA655E052A0A54127C9C3AAF55221D3DB0FE9F4E31B087368280B81A3F037F8F9C14BA5663F349D9AA22E54DED615B4C8C76C3D669D1CE2A5F482822D8A4F0B87172F1E5E5DEBDB5B006F830E26A5174C5E2A982D66B65646E35FBE05CE9E4672783492FADC0ABFE6AD1010140C259B61E851AD765565AC6E7E9ADDC856232B5ECFDA0CB389A6A45B63B0E92B81A69E1BF4D675438C06EB34749A2064214B3A3B0BCAEC6CB63E76A8B610D1BA2244E98BE06B92ACDF4EF1D7E1E12C7C8F061C8D91F590191C8EECE070E4FB07C1AC28FED2F070BD3CBB355D5B3B6A8A06417EE8533F823D6F5250B3D5ECE86DBD33390BBF5FC842C7D870D75E5D94566905582C2EC5DAA6A6407FFE2C74E7CFC13B3B0321857908D2E4C35FA729B5959339300886C828E8C322A0090D439E8F1FF2BCFD51E0EBCFAC6495DA9B0DF0B1D8646F1F2B8CD5DEF02A9E92AC2C863114927568D9035CFD4F31DDBB3EE932749BD681D656F4EF3F90458EE84E1D47836F3E829A1649EAD403598937C32F3A063EF449AFB0AE0256B39275CB2EF61FDB2C4702B6894D003291CB83AD23A287516F5D3384AC6B82362DC5EAA7D3205857C47EFCF36843832CA833D3A1CCCFB3EE3A539C742A6FE4F907B11F6D781454F10DE0DDB829BC1B3606CD7C64ADECE96FB79AD5B095AEADDE64C6FEA434BCD5BB150B43950E76B31D55A8E1379E4FC5A1423346B76B52E90B88139C53C03649A4B000DA93C7A0FBEF14F417CEB2B591CD05F930D9AD636C51AB610C8B80AE5E0CF451F5D82E2134B00716FE56128F6C8DB8F02D8E4F2640ABA1F252318B53E9A58492C0267963973CA7D50F66AB82144A6746C1F62DC85EFA250B4F0B9BF6187CAEEB84CCEFBF81FEAF3F60F20F80B9FF4084F4EC83B0F00878FBFAD602C0145BD67CA9DFE2DD6208D6F4C35C224603B3AAF5E4DED2E9A1B7ADD0A7835943A17C45405121BC7273E19D7E05DEE9A950A7A5D29649259D931E7EF2550705B1979E4FB304F8346F019FE62DA18E8A622F646B1FB856EDEFDC735453CF2E3218F1FEE68378B76773361BB6D482FD04E8C2C2426C387705C70D2A01E86A6865DBC83FADB6967C19DA13475174601F0C17CEB14F598B5E675D8A536209997D7CA06BD018BAD838E8A26360F60F601690978F2F543EBEF0A14922B4146771289CD587EC0D959AD6B4A091FE92352D6C037BFC5E3DC482620B1A190CC8DDBE05053F7CCBC2D17C060C855FFF01C879F16920330386FA0DA11C320A11AD5A233028987D0DD42A0BB0B8CDB90D2C8DBFA63D16AD6B8810ACADD6359B3443A17CF47FB6A4AA0E26AD967D81C1A0876FF225F8255F86F79564280B0A4AF76E5AD889D62E2137575C3C7CAEEB08BF36EDE09BD04A58D6D5C0017E0902F47B1BF7E38D6E8DD8AE2AA5B6BC2240D3A6B1EBCF26E3A4C9072385055DD234C533ED6C0ECECA828C03963E614D14736C6271B0BA9347A1D9BF17DA83FB61CECAB05D8F3D94C52BBF59542A18C323A18B6F004DC3C6D0474431CB97ADFC563C63CF9BC05CBC14A7756A3501D93A638FBD858BA15CFCB4556397ABDAA5084034953BE7E07E687F5AC696FEB45CD7115EBD6E84F993796C453C43C72EF01E3402016929306EDD04FF9E3720B0F78D564857B67DAA56CD6B731607377787144789306017478130EB9AD6BF2E5E039B7E67BE6C8A773719A1CECC60B0F649BA0475F1D88575853E73699BD9CF0FBEED3AC0AF4B37F8B668C3B605A3303F5A6AB5CACF02FB40A299AB66902BADA6F4C9EA686C0D59D01BF7E3F5CEF5CBDE34363F3F1FFF12A0CDBE18D156B838986390A640275D8621F9125471F150C735280E5F72F4F967B57DC84F489F9E3493CC989106DDF163CC8FAA3F79AC54C81441875C1666B537CC3EBE30C4C4401B5B1FBA9838906FD91A8F6C1DD0F3F6F6818F6FB1DBC2A704C8CC6F45502E8654C94083A3BA5647F7937F0D8BC50AE8ACD3A7A0FB693954278FC1141E01D07A15470EC144BEE8DE37C18FEE75F3BF6C1D0C655434EABDFF91D59F5E237DD1F2F5299DB3B89F4997542D7687988CB49B0C59D9D68D0AB8754DFF27EBDB4481009A42F8A624C1273909EA8C3478513CB6410F2585FA49D75BA1094AF51BC2A74D3BF8B4B90EEA7A3150F8F9B3D98F647997BC142BEA6BD6BA1AD252A13F730AEA060DA18E8967D017EE148000FDC1C67D78AD737DB664EE55BB7A73409F30F962445DB7A0A9C39B4DD09E3C8EDCC51FC3989C04DFEE890899FC109B8A6B75D1493A23B76CC8A2217F714E16CC140277E922F4E7CF407FEE344CA9A940F1483B1B13527BC3E4EF0F939F3F4CC121304446431F6DF527B305EB556A2B907D3894ADAE0BA9852CB5924B8DFCD6602B922C68B2F8B25253A0FD6939BC766F8785E29B556A28755A1849AB464DE17BE6141445855637CF4DFD103E78147C8BD781AED55674792C97B8454843BEE093D57F6D80D140EB6097F65B5BDD21D615FAC898506567C23BED0AD4A92950D11E8E5A0DBC0A0BA1D0EB4A59D74A5A08AB49337893DFBA7E43A8C223A0A490CDB0705BFCB57D1B509DC87D95BDF8136837FC0375424B040D1D0DDFD66DD9649B3AD96692B62440CF910BE8E17519D034384333F00EEF47FEF225305EBCC0769056F5E98BE0C123E01B1A566A8495DC15C6B42B30A5A7C2987A0546B2B82F5F80293909661AD82B4E168582597FC6A06018E9FFA1E130444432178685F6D82B5EE18D222C4A7CC8C551172CFC4DC57E4AAD8D4C837B1EE643AEAA2D582294850123373B0B85BFAD8472D33A2825DB6259945EEC6B83606D080E81B66357F8F6BD0DE131B108A0DD588A17F477BA1E35BD003B7748C9824F46161D422E11F261EBF556DFB56D3BB06277084582786565B2A810554E1603B63A2F976DC22B8D1051F8FA41151307557C7DA81B3686574C2CBC22A3D946BC5E926DC1D8347D9D0E39BFAC8071F5AF5090BBA5452B040E1A09DFB6D7313F785D4E04E8B972007DDCE48BE175D6C5618573D1AE6D285CB502A6CB1761F6F282F6BACEF0EE773B429B25C0DF3F0096DC6C182F5D80E1FC59182F5F84293303A6AC0C9873B26DAE0B66257B7B431F1E69FD098B609116E6A0600664859F1F0B7763B3F6D8564E3ED6752E282E9962948B07F628D2823EDB4B5C173622D7D2FE6C5DEFB9202F0FB91BD741F9D76FF0A2D9749244DA6AEBC5A2B04317285BB743786C3C42C3C3E1439FDD5EE4DBAC596E1DF7376419112236FF7549FCB57D848841AF6510A7F5AF09D84A722715E4C12733033ED95950676740491BF24A1259D7F4E3151109755C7DA81A35818AC2F922A3A1D5E99075EE2CF46BD7C0F7C06E284D2678356A82C0E163E1DFA96B1D734F956E7502F4BC4D325C1C04E8617511D0DC723EB817052BBE8589A6DA9ACDC86DD711BA6E8908F5F5454056069417CEC194960A4B411ECCF9F9B0684AAF6D419FE0BAA87AD090BB22321A165F3F16FEA6A0D0265B7445692B9906F5D80F597F3CD28206F88A5D15B5CE4AAE8848346DDD6C4651413EB2F7EF8162D5F750A5A596FA12D1D48B456EF7DEEC333B242A0AA1E111F0A3CD5DC9075D3CC5D9FDD0ABA157B08F10217708A8AB9BADB1D7B65D6668B20CB9447874089F3CA38399DC1E9A22280B0BA0CEC9826FDA15F8A45D812A37A794750D6F1F288BC3F994E11150346A8A82D070E499CD50EFDD89C09347A1341AA18CAB8FA029D3E1DBA2B5DB16BBF2F4D62240CF9703E863265F0CAD6B80263853F4C0D1832858F635CC17CF5B07088382A08D89876F7616545A0D144603406B224806502C5E2AE8A3A2A1896B80C2D878188343016F6F2829F4CDB738FEB838D282BB2EAC16329FB157126D61756DD742B745659E8EE2B6D06A34C83CFB1F14CBBE82FAC2395602B9890AE2EA233BF146F8356C8CD0C828048784C22FA018CEB53D8AA3323ACACD2B05368DBD14C761B3BD268BF770249788BED87F6D28768710B8597488566B0B0B5515E4C32FE512FCAF24C33B2589C1D796A86D680B342F154CDEDE30F8F94395970B75A135EC4F41BBA64F7F12BE2DDBD4494813A03F940BE821750CD066B309FAD3A790FFF90258922E3BECDAA6804006E482468DA189AD0FB38F759121DBBA16148BCCA22D7C6D6E0B1ADCB3F9908BFDA4D5B1C890C39BF1C00CD65D5334C8A6493A5F7F0AD5B1C3CC6991DBA00932FBDE8EA0E87A088F8C42504828DBED9B74AF5571D01ED226D23544C8F5C736D3B5C560170F38DAE2AFAD96365BF0C968648B3BF9A52621E0E279F85F3A072FDA12CCC17D31483FFC147CEAA0254D805E2807D0478DBE182C13D045855A68B43A0FE94E55AB067542BFF42468BFFA1896CB763B5153589005285478411B1C0A4D7C431451F85B58048B2AA019792A6F8AB690FA90A5037BC5F1C8CC8F4C33B468D69E6BA7D5AAD52A0405FAFDBFBDF3008FA2DAE2F83F7D534880449A020A22F60E4840408AA4808A58F0292A3E8C140141A58874E9080822D828FA0011450445514A22A0204BB161C702811084501292EC6E92F79DBBDC65B26C92BBB39BD9C97BE77E5F3ED89DB97377FE77E63767CE3DE75E9F5EEDC952CACBA3398BEDFA44F4732DEA13B2CE4E934F7FDD2A847F63C591FA8D70AA5922626A26208E6EE4D8589121E94CC0A9E8D6F7F30F0460890847748CF92621A2688DDCBC7C918DE9CFA28535BD5DCA19FACE0D389E7587882CC773F388D01C2334D748C4F1A388CA3A8CC8CCBF6039FE0FA2838A11EEA1DB82292AE4FE47E1A8DF182567EF177F9E8751C70A090E465434196ACE85822B2A04E8F95B147CD0DF7B01E8F90B5663F7DE5F2B6ADBBCDB4B4A105662478FFC9FD0B8F8142CCE99114A95ACA2106CB35BB0BF3802A783C2702A380245C10485B0B3E9D261622E5EE79F73404F264C0867C5390772A5E8D0A07E2D0C7AF21EC4C645EB3EFEB17F4EE2B537D762FF1F87751FC3AF15455C6F311CB6025C6ACB46883D1FDF144522343C122111D10809A389F94344B243A0D292AFBBB6319EEC77B75F4FDB1F07FBF6DBDFB1EC9D0D3876FC5C04913F8E5BFA189423E09C42C439F993336780FA4C84F8151789BFE2624A8EB10BAB3BB8D88ED8E242C4C2817A4185681B968F8B424A4FCA46C7B321083F86D4C0A7E117232784E658A1368C7F00FBAA595C6C34BA776B83962DAF563A14017A812AA0EFBC522D5125ADEF74444706E186ABAA66880C5D5821B602D4CF3B826A79271173261FE1793658F21D08B39DCBAC729400C7118AC325E13858AD06F29BD4454854C4D9013D9A45CD99C156FA35BBF22FAA5FFEB023FB583126BF9086F8F838A50BC1D34E070E6663C2C425A8573B048DEA53E240E08B00344D689F9F87429B4DACE8425993A194DA7E16CE81FA955FED29142EAC97660E0CD44F28B3DD0D9BAC7877E5665CD3340C71D58C9A40EA9C61730ED6CE5C0211DE576043C48F99B830EF24EAA21009410E846A6E0F7B6810F2A3C2608B0E437E4C148E45554776543C0A23AAE6245879F925D8F3830D5D5313D1B54B2BA56B8400FDEA56450BFA0E45403FD1773AEAD50AC1E07F3B97E1A94AC519C85F8282FC429C3A91879339A75178E20C824F1620F474212CB93644E6D91193E780E58C1D4167AFC1E2F82814F5B809A1B5AA39012DE07CEECC8DF485AEF8280FD6EF6C98E42BA00F64E385494BD0FAE608DCD9292AE0DDE87C9DA68845070A0B9C596F1476181E118AD050E703D1489DDD051935F3048282C331DB8480DEB8D18A77DFDB8C86E9E67E00001894494441543EFF8A41E3866AAFD7FEECF052EB38163B23721C874F2274F92E716F099B3B0828B484222F260C6762C2504070AE168E92B84884D78C415C8D18C4C5452322325C844D06B2AFF5689379C481D90B4FA38B97807E4D05D0DF392CE8AA08E8BEFF0380B6DB1CC8CF2F407E5E210AF269E219FAA3D84F3B82CFD81156E84044810331A76C88CE73A0A44E2C42DA5C0A4B02A56007F6E291807EC147401F3C908D892602B4B889CF3E4045F85709101C1C24FE020D67FA6D12D0334D08E84D1BAD581940406B812616277014A3202717451B7F4648E649E4C685233736028591A1B05B425014158E104B1822C2C3106E0983253202515116444653D62C256605F661EC0BA0535313D145D1822EB03BF0BA0AA0BFF502D0FDAA38A0497CB2A2C50ACD8E22D8ED34E94C110A690E8342BBB0DE68E0ACC85E04388A10161484A8B868C4D58A4374B5489735A7A713FD5147027A828F803E70201B934D0868A911DDE8668A7891807ED1A4807ECF4480A6FB8906A04F669D405E4E2EECF4B619162CDE88222268D2AF3084478489C1B4F070E71B122D18E15C34422E1251F9EE427FDC8FF218D2822640A72A029A5C1C6F2A01DA6E4117450BBA7FBFAAEBE2D07608419ACCB44F567F89C399FFE0A1B414016CBAB808D0B6429AC7C019D369B1842326360A9648CAF80BEC1A7812D0E327F8E683260B7AF264F3B838CABA59A86F263DB70873973CEBCFFBC9EB634940CF78D17C3EE84D9BAC78DF4480A6689282021B724F9E41C1D9882FB110B18073A8B09245886AA8762A5C67975435D7863BA05308D0A9EA3EE885DB147CD0DFD82D485504F4804A06F4BB6F6DC0E2F96B111DED0C679AB3E419D4BD30017BBEFE19C3FBBF5C2A72416EA3FDD67DB00D2F4F7BF7BC7A15DD89542F2BF3181EEDD75500BB5864173AE7DFA50B8D404E6E0DBAB008CEDA550F2A3A76656C97801E37210D357D1824CC3C908D293A004DC0ECD9750C6AD4AC264E6FE088FBD1B2EDB5429B76D73C810B6AD7709D76EF4177A1437233B14D3C045347A16682736053BBAD3C9DCC06E869260474BAC9002DDD1CE44A74D00AE6414102C602CAAEF0D3B3095A5578922FED752B2DE8E4D444A428029A5C1C8B54019D72855A14C7C0FE956B4113A0A9DCF77047F1EFAD573E8E2DFB5E1780DEB2710F068EE8E1D265C023D3D16748775C755D2301E8DCD3F9E7D52BEFE63F7DEA8CB0A063AA4522A59BF3A9F7CDAE5FE0B0533C69096AC4C7A2C125755C3E50BA9608DADFEDFEADD4619B5ED550C43F1A5124A0C712A06BEA8FE2C83C988DA93A013D67F20A4C7EB9BF385DEA83E726F5120FD17B3B0EC7CA0D535C32BCFED26A5C7E7543DCDAE1060168AD253CE2C97902EE54AFBC427D4E7D2FFB7DFFAF993899E3CC44A3D764EA7BF7F2EDAE5F4BC504D7B930BEC2762AEA3B69414F9D613E0B3A7DB315AB4C6241938E72C057C651D377EEF3CA54554BB9ACEBC405E8944424AB02DAE1C0621540EFB55BA00AE8412602348925A1A007D074E313A00930543E5BBB1D5347BF853BEF6B233E47464508EB9020202FA8158B3FC391C3C7C5F61FBED92F1217464C7CB494E558D1CDEECB7609E831E37DB4A00F66635A25035ADB3F7A01AD85FEDE9D3F63D60BCBD1B8E945A85E23465864D437ED3ADFE49294FAF0E77D7F8BD8DCEC2339F8F3F7C31830F43EB4B8552D36B5ACBE91809E6246406FB2E283F70317C5519666DAE88EFF3520BB9FB30474923780B63BB0E44B0517C71EBB05C98A16F4600301BDF895B578F3E535655AD065017AD9C2F5983FE33D51AFBCE20EE85E778F47FBA49BD1332D455413EE8F43C7F058FF3B5C87496E31109FEC98233E2F9CB70675EAC5BBAC6F5FC0AB5A57027A941F003DC347407FB16137664F5C8E79FF19E6D1822E0BD0546FDEF4F7307BE1900A2D5B2DA0E74C7E0794C94A6F4DD56B563BCF2AA7F6A80FE72C7E06D562A384E5AD7D00AB6AEC693F023482C331D98480CED864C56A1302DA17BDAB5A5D09E8CE29894852B5A0ED0EBCAD0AE82445400F3100D01FBFBF15F5EA5F809D5FEEC398E9BDC52BB22717873BA0572CFE5CD4A37D474EEE25EA51D9B5FD2711FBDCEAB6EB4AF5BB27405F50ABBA184DA6927DF8385AB5BFCE94807EDE0F807E5127A0FB3E3005575C7B09C8DD90D22D11F73FD249844AB9BB38DC01FDF8BD1371CD8D978A7AF4207CA44FAAA847EE0E59BA746F5DAA9FDC01FDFDDEFD88BFC0E9DA292CA089E71DA506102B1BD0934C08E82F18D001E7B916D09DBD00F47F5400BDDB6E41D2E56A3EE8A79FAC7C1FF43F4772D0A94B0B217A932B1A887F5500FDE76F87CEABF7D3F77F62E4A0F90222D2AF2D7BD313A09F1AF900A2A29CCBD253A1412D0904FADCF6EA3434BAEC22B1EDD60ED7E39E073B20B6BAFE946B6FAF2C69418F1CE7BB8B63E614EFA338C8553179E4620C18769FF8E91736A8E5F2BF5704E8514F2DC0B0F10F8B7A752F4A404C356782CCAF3F3AE743F9FCA31D48A85DA3543FB903BA76BD78DCD8BCA94BB6C8280B2E6A58CBF599004D83BC34A776C34BEAA0EFD3DD41757C2DD2829E38DD7C3EE82F365BF1215BD0BE76B14FF525A06F4F4944E714B5280E1A245CFA95828B8300DD5911D0CF18006852CA134CDD0709E50022EDEFEE83D6AA5DD6364F80FEEDA703E7B946C8C27BAC7F57F1B0D0BA38DC7BB4BC6D3EF5BEA6B204F4737E00F42C9D80D60E126ACFCB1DD0DA814095680CF701623AB63BA057BEBD110BDF1FE57A70BBF7BDD68276D7BCBC6D15F58F04F40B2605F41A0674455D58A9DBB580BEDD0B402F5301F42EBB05B73755B3A0870EA85C0BFAE3555B8590A977B72E25280DC88D7DFAB552DF692306D2D7EF425E5EFE79F5CA83371DF3930FB6E18921DD85CF92CAA3778D455EAE333D5500E2E18EF8F3F743B8AF67475C7C693DF17A3EACEF5CD7F6071F4F466AB756220C8FEA2E5E3DB6522F0409E811E3D250C387288E4399D998AD03D0D95939220C72E838A725EC0E68EDE767C7F544F3565789AFA8DE2BD35762EC8B69E7D573388AF055C6B7F8FDE783CE70474D79A2C7244C9ADBDFF516336DCC5BD8B96D9F6B0F314878FB4DAEBEFF27FB0486F49E85FC33CE19175BB4BECAD5BFCF3EF192685FCF8C7412D0E3A799CF82DE9A6E4520009D73EC94087D3DFECF29D44C882DD54F957A1398F0E012D09D9213D14911D0850E07962B01DA664127450B7A582503DADFDA5328DDD2373E11376CAFFE5D51BD86337E57164F0381E5FD06772B9942C7EEEDD9A19445E7EF73D01E4F027AF8D834D4F0210EFAD0C16CBC34D57B1747659CDB86755F63E91B9F62E0F0FB85CBA4569D73B1D42A96B7F637B95BC9DEF66F59E727013DCE8C80DE6CC5DA55C646711CFC2B1BEF2C5A8F5EFDEF100FCF63474F8AFB8CC22169DBD123392E296F68DE14741FCAF048DA264353698A857DDFEC2F25BBDC46061485B9D25BADBC2EC865291FBE141E2B5DA0DAF04BD91ED5A37249937AE7DDF7FEBE8E25A03B7A0368BB03EF6C57707158BD00F4F02A06E8BFF61F16373F95EE0FB547D32B1BFA04E8A9A39688812E59FEFE230BDD7AB4F38B9F53E5A291801EE623A00F9B08D0F49093A5636A7397D54DDF790BE837E67E88DA756B9E5DA710C2BA6BD8A88E6BC05845634FFB48408F3529A03F3218D0145143209403F152331A079A33658548F4AA5D375E44D14C98D5474C86F4F66BEB70C5359708781384BB3FD81EAB5764B800BDEFBB3F109F108BE726F612F75397C4C178B84FAA00345D1714563969E4225C7BE3A5221B91004D6F4F140EFBD9DA1D3879C2191F4FE3481FBDBF55D42BEBBED77B1D94554F0BE88E8A1634F9A0DF55057447450B7A44150374451D411714CD1BE029E1C1535D4A035FFD4E866B53F3C42B85EBC3A822013DD40F809E63120BBA3CEDF272F3854B431BEB5C91D6ABDF4987CDE64CD3BFB871DD52C0AFA86E59DB25A0C79810D0DB365B611640D338C2DE9DBFA0FFB3F708AB973EAF7C6B83C835A090594A4EBAEC8A06221C72D1AAD1E78D3168A19FD27210868E7DD8D5F734A651BF612D91854AF378C831244A446A72797DD7C3C2DB87BADE6B425B4F02BA437222BC01F44A1540EFB459D051D107FDDCC0CAF541FB43ACFFE56348403F4B80F6C1074D16F4DC69E670715485FE92801E3DD57C3EE86DE9567C6C120BBAAC815E02B476905F05D09E069DE9812DC710C862BEA8412D3CD83B091F2C4F170964A3A7F51613FE7FBA663B766CF91E1D529AA1634AF34ABFC4B480EE90AC1EC5F1DE0E05170701BA8322A04732A02BBDB3CB6B4002FA9931BEF9A009D02F33A095FB52027A944901BDAE8A02FAB6EBFAE0E2C6CE37D04EA9CD71C77D6D5CE1979E004DAE8E0617D776F51BAD2A44EE904307FF41DEE93398396119E62F1B2E129A32FFCEC6964D7B71FDCD97E1C616972BF7B59E1D25A0DB2727C21B40BFAF02E8AFBD00F4F30C683DFDE7B73A12D04FFB01D0F318D0CAFD2201FDBC0901FD65BA1546039A9284268E58245C1904C823878EE1C509CB7073CB2BF0EAAC559830BB0F12DB5E2BC25229DEBD2C0BBA7B876158FCC118D10F1116E714A4B27802F4AEED3F62D5E6692E88BB77A0FB203E65FB6ADD1FCA1DEEE58E5A40B7F7C2825EA502E81D8516DCA668418F1914581707AD8442E174B2D0C08176D4DF4B5D3DEEEE29E142EE6844ACB38A053D78741AAAFB10C59175301BF3A7FBD7C541A174B22F643FD1EC76349B1D85D2D1E010CD52E89ED823B7D179934544AFB0142E4759829E2653D26EA32880FC3305E78DD297D7877AAE1109E81153CCE7E2D89E6EC5271F181BC52135ECF7D0541CCDCAC105756AE095FF0C135FD3140D1FAFDAE69299C261292263E7B61F5C619414F238FDD541E27B6DF82CF997DB77BE5984ADD2B1E531E5C1A81ECDAF220B0D1252DBE4E7166DAF1E23C264FB3F34557CA63059F79C0A3DFD5F511D09E8764989B84D11D0857607567FADE0E22040B75304F4D800039A468FAD5FFD284685A9D0D35926915424A2EAF6AA00E8A7FC00E8057E06F49D6D9EC6AC3787A051930B21FB893E5318160DDCDCD769840849D4CE48487D42BE49E9BB6CD1FA6A74B9A73506FF7B961885F7349F0AF92FE5B6B2E6DBA82C400F3729A03F0D10A055EFA9B2F6F36425FBFB7EF6F537AAD4D702BA9D1780FE5005D0DB0B2D68AB08E8F12600B476A4F744CE69BCB5E063116E73ED4D4DC4BC1BF44AB375F35EB18C0E8DFE535CE6B7BBCFAD44DE29B585784253ECE68EADDFBBF46F7DDBF5C2BAD35E349486FCEBD9701DAA3773C252D196AFB3A3A974BAA77DA48B63A01F00FD9A9F01FDFC53F3C572474F3CD54D845A757BA09D6B647DF9A2F57865FA7B689678A5887796912F14A7FCC7AF87D07FE8BDE27429DDBB41A33A98F2FC12D18FF49AAC8DE0A0FEA5C996562DDBEC9A44CBD3844833C6BE2DDAF6573F91055D121C8E612604F48E742BD6575140533F5DA9993296AE857B1E6A6F58D8AADEFBD0BD9E0474DBA444B4F502D06B5500FD9517809E60324093505A2B8A42712896B2E60571C2BAA6F932283599C2E32894EEC3151948BE2B110FF64EC6DC292B047C699F8DEB76E286669761C0881E6262797A2D2338D320832C54C75668C77303E6056C850F09E8017E00F4EB7E063459C9CFA4BD040A7BA242206ED8A8AEF83FB986E875935E69C94A769FEFDBFD82F734CA4FFBC8B4FBC7BA4F2817D0FE0EB592801E6A52407F5645014D092C2BDF76BA27A8D0020FF29AF1173C8D388E04741B2F01FD910AA0BF2CB4A08DA2053DB10A00FAFA669789C99124BC656A32C565EEDEF11386F59B8BB7D68C1329DB23A73C269257F67DEBF485BDF9FE683C76F77801684F596874419901D0FD7D04F49183D978C3CF80A61903972CF858A4C3CBAC407973C8B792B21664280BD0EBD76EC7DFFBB3F0F8A0BB44F201B59174674B24B7181410403F6342407F9D6EC5E75514D046C0D3883624A06F4D4A441B2F2CE875AA80BE5511D093AA00A0B53E2C4F3E4AB2E616AE1A7DDE5A77324D58029A06BADE5BBA115B36EEC5B817D344DAA95900DDCF0F807ED3CF80A6C13B5A458532F7126A55C7ED5D6F11F706E99A4B96D28629C2D7BC7CE17A8C9AFA6F11FAA49DF04A7B23490B5A6B096BB3D7B42BED787271549605FDB44901BD81016D0487CB6C430BE85BBD00F4272A80DE566841EBCBD4264B9AF25460A3383CA598BABB38FC0568EA0D8A1220B7C6D03E7330FDD581B46CA1292CE8BEA3D310E743A2CA91CC6C2CF233A0098AE44EA231026DA815C19456D4888EB1880C3FD273D2DC7EC247AC02E80792468A745E5A717DDCCCB452F5CA1A24AC2C400F9E6CBE288E9D19566C64409B02D0AD9312D13A492D5185A238D6EF5488E2D85A68412B45404F3301A02FBFFA62B11415150ADD5A307315A6CD1F203E6BA706A5CFB43EDD90C7678BC9E1EFEAD10E4FF69C26328E96AC1E839E778C1193C30F19F520260C7D037BADBF8818CB5EDD9C2E0E5AF4925627A6623640F7199D86581F009D9D998DC57E0434BD59C8370FD28B1EA4B29F526E71BA236491DB28E98016E17DF88E316255162A8BE77F849B6EB95C58E2940A2CDD54031F9D8101C3EFF7B856E59A955F883E9485E668A09570FCB91AB8F4410F3221A0AD19566C62409B02D0AD9212D14A11D036BB039FA9007A4BA105898A809E116040D3725634D22F4BC20571229E52161AF8BBF3FEB6C21D21CBD64D7BC53C00B2CC7B7BA898649E66C6A2350865916E0C19A3A9AD27B77DB7E737AC5BB50DC3263C12900B420E12A6F901D06FF911D0E492D0F6857B3F49D8926872DBF40503852B845C23CFF6712E23F640AFDB856B64CC9057316EE613E23BD94F721B7D275D20EE7D48DBA87F694C81067EFDD54F12D0034C08E85D19566C664007E47E948D4A174762522212BD00F4065540DFD244CDC5317370605D1C01ED85B3D108724DC240FC1609E8DEA37CB3A08F6666E3ED19FE4D5409841E65B5591971D02541E1E86F4240EFCEB0227D75601255CCD4E781FC2D12D02D3B27A2A52AA01D0E6C5201F4170516DCA26841CF6240BB168D0DC4052101FDD828DF7CD0E4E258CA8056EE4261410785A39F49019DC18056EECBCAD85102FA162F004D3EE874AB820F3AA3C082168A807E69F074445A827055937339F39571C2663DE6E71FEF0025AC04AAFC71D0816339C5E8E5070B7AD98C25A8151F8C06F54203753A95D66EFA67BB444291BFCA9E1F6C08098F405F13027A4F86155FACDE8CA68D42512D3AD85FA7CCC7F1428133F925D8F79B1D2D3A27E216550BDAEE40860AA0D30B2C68AEE8E2583A6D218E671DF3E2A7F3AEFE562022D2827F3DFB0862AAC7EA3E744EF631AC5EB012B9274EEB3EC6FF5BC5EA0935D0F3B9DEA63BED9FAC3F20E3838DB0E53B97F9E2121805424243D132B9356EB8AD99D20FB0391CD8A20AE8668A80B615DA50525CACF40378A7CA522008E1967011BAA6B7501FDA6D769450DC2017250582828285EE662B458E2238ECB44001F76560FB2608A161212050AB148AE2D8BA4BC1C5B1B9C0829B1401ADD230EFC30AB002AC002B50BE02345BE3972A80DE4480BE542D8A834567055801568015F05D0172716CAF08D0E9FB0F634D4E092EA95BCBF716F908AC002BC00AB0024A0A388A8A91F9D79F187FE345888F8F47585898CB6D1954545454929B9B8B1F0E1CC6C63FB270A6A000C5EC5B561296776205580156C0570508C80D6AC6A16BD3FAA859B3E6F980CECFCFC7D1A3479195958553A74E89A5D279D0C857D9B93E2BC00AB002E52B4003FC91919148484840DDBA75111B1B8BD0D0D073167471717189DD6E475E5E9E8073015BD07C4DB102AC002B6098026441C7C4C408385B2C1601671999154480266BD9E170883F726FB0F56C58DF7043AC002BF07FAC80043159CDF4476BAB6AC366F507D0FE1F8BCAA7CE0AB002AC80110A30A08D5099DB60055801564087020C681DA2711556801560058C5080016D84CADC062BC00AB0023A146040EB108DABB002AC002B6084020C682354E6365801568015D0A100035A87685C851560055801231460401BA132B7C10AB002AC800E0518D03A44E32AAC002BC00A18A10003DA0895B90D56801560057428C080D6211A576105580156C0080518D046A8CC6DB002AC002BA0430106B40ED1B80A2BC00AB0024628C0803642656E8315600558011D0A30A07588C655580156801530420106B4112A731BAC002BC00AE8508001AD4334AEC20AB002AC80110A30A08D5099DB60055801564087020C681DA2711556801560058C5080016D84CADC062BC00AB0023A146040EB108DABB002AC002B6084020C682354E6365801568015D0A100035A87685C851560055801231460401BA132B7C10AB002AC800E0518D03A44E32AAC002BC00A18A10003DA0895B90D56801560057428C080D6211A576105580156C0080518D046A8CC6DB002AC002BA0430106B40ED1B80A2BC00AB0024628C0803642656E8315600558011D0A30A07588C655580156801530420106B4112A731BAC002BC00AE8508001AD4334AEC20AB002AC80110A30A08D5099DB60055801564087020C681DA2711556801560058C5080016D84CADC062BC00AB0023A146040EB108DABB002AC002B6084020C682354E6365801568015D0A100035A87685C851560055801231460401BA132B7C10AB002AC800E0518D03A44E32AAC002BC00A18A10003DA0895B90D56801560057428C080D6211A576105580156C0080518D046A8CC6DB002AC002BA0430106B40ED1B80A2BC00AB0024628C0803642656E8315600558011D0AFC1776FEC638DDA41D8D0000000049454E44AE426082 , 'Default', 'ueb_key', 'ueb_secret', 'ECOMP-PORTAL-OUTBOX', 1), + (6, 'Virtual Infrastructure Deployment', 'images/cache/portal-345993588_92550.png', NULL, NULL, 'http://vid.api.simpledemo.openecomp.org:8080/vid/vidhome.htm', NULL, 'http://vid.api.simpledemo.openecomp.org:8080/vid/api', '?', '?', NULL, 'okYTaDrhzibcbGVq5mjkVQ==', 'N', 'Y', 0x89504E470D0A1A0A0000000D49484452000001680000012C0806000000EE2C29AF0000200049444154785EED9D079855C5F987BFA54957AA882E282088051535D244EC0876A3222A2AC1462C11A3F2370A0AA8281883062504BB066C815829828A801A4540015B0451A42ABDB848F93FBF91B3DE7B97652B7BCFCCBEF33CFBECEEBDE7CC7CF37E737E3367CECC77328C040108400002B12490114BAB300A02108000040C81A61140000210882901043AA68EC12C0840000208346D00021080404C0920D031750C664100021040A0690310800004624A00818EA963300B02108000024D1B8000042010530208744C1D8359108000041068DA0004200081981240A063EA18CC820004208040D30620000108C49400021D53C7601604200001049A360001084020A60410E8983A06B32000010820D0B4010840000231258040C7D43198050108400081A60D40000210882901043AA68EC12C0840000208346D00021080404C0920D031750C664100021040A0690310800004624A00818EA963300B02108000024D1B8000042010530208744C1D8359108000041068DA0004200081981240A063EA18CC820004208040D30620000108C49400021D53C7601604200001049A360001084020A60410E8983A06B32000010820D0B4010840000231258040C7D43198050108400081A60D40000210882901043AA68EC12C0840000208346D00021080404C0920D031750C664100021040A0690310800004624A00818EA963300B02108000024D1B8000042010530208744C1D8359108000041068DA0004200081981240A063EA18CC820004208040D30620000108C49400021D53C7601604200001049A360001084020A60410E8983A06B32000010820D0B4010840000231258040C7D43198050108400081A60D40000210882901043AA68EC12C0840000208346D00021080404C0920D031750C664100021040A0690310800004624A00818EA963300B02108000024D1B8000042010530208744C1D8359108000041068DA0004200081981240A063EA18CC820004208040D30620000108C49400021D53C7601604200001049A360001084020A60410E8983A06B32000010820D0B4010840000231258040C7D43198050108400081A60D40000210882901043AA68EC12C0840000208346D00021080404C0920D031750C6641000210C8D8B871E33630400002108040FC08646CDBB6ADD408F4EAD5ABAD4C9932F1F3021641000210D801815225D04B962CB12A55AAD010200001087841A05409F40F3FFC60D5AB57F7C23118090108400081A60D40000210882901043AA68EC12C084000024902FDD4B41FECE5E94B774AA5FF59FBDBA199D5BC24C71487976EC36808945A024902FDE0846FEDB559CB770AA3EF194DAC7DD31A5E0243A0BD741B4643A0D412608AA3D4BA9E8A43000271279024D0CFBCBFC89EFF68719E531C8737F073250423E8B83747EC83000412092409F490B716D82B3397ED94D05D6736B176FB33C5413382000420B0AB0930C5B1AB09933F0420008142124812E827A7FE602F7EBC64A759DD7966133B6ADFDD0B595C7A4F638A23BDFC291D021028188124817E78E2773666C6CE97D9F53BAB89B56DC21447C1307334042000818213608AA3E0CC3803021080408910C816E8A5ABB7D9C4CFCD14DA2EA420D1671E9E615576FB9525531C25D2A628040210282602D9023DFA13B38F977F61AD1BD6B41E2FCDB46F7B9F6815CBF91F9AF38BC56607EC854017537B211B0840A004092409F46D6FBF6DB37B75B0F7E6AF70E2DCAAC16F73CD0FCD5A6D0BD6FE6255CB97B116B52AD8B94DAA5AB709CBECE993EADAFC35BF58BDCAE5EC9C3796D898CEF56CF20F1BEDB87D2AD947CBB2AC56C5B2A688D3B52A95B1B92B3659FBFA954AB07A66087489E2A6300840A018092409F4F1076EB6BAFDC759A5F2656DD59D1D938A397FEC12CBAC5A2E49A02F1CBBD44676DC3349A05BD4AE60F7B5A965D316FF6C99D5CAD9F8051B6CE2C28DF6E3CF5BAC41B57236E2F8BAC5687EDE5921D07933E2080840209E049204FAEC96664F4DFFDE2E3D223387B50BD76DB6BA95CBDAC08F57DA21B52A58AF293FD9ECAE0DAC4AF90C27D07B552967E7BFB9C4469C50D75ABFB0D06675CDB455595B6DC2771BECED1F7EB6EE0756B36BDF596EB32F6A50A22410E812C54D611080403112C821D0C598772CB242A063E1068C8000040A41205BA0376C321BF34978AF273CEFA80C2B5FF65732ACE228440BE1140840206D0458079D36F4140C01084060E70410685A48A924F0B7BFFDCD264F9E6C071E78A0DD7CF3CDB6FBEEC51FBE60CB962D76DE79E7D9BFFFFDEF9D32D6CB8C7BF6EC99744C6EE75C73CD3576EFBDF7DA1E7BECB1C33C478F1E6D679F7DB6FBEEA1871EB2F6EDDBDB61871D56641F47BC0E3AE820EBDDBB77915FBE7CE9A597DA3FFFF94FAB50A142A16D7BE38D371C87366DDA14288F49932659870E1DAC4C99F82F2346A00BE45A0E0E81409F3E7DAC65CB9676D65967D9BA75EB6CFAF4E976ECB1C7167BD50A22D02FBFFCB2FDF18F7FCCD38665CB96599D3A752C2363C7DBC9CE39E79CEC0E61EDDAB556B162452B5FBE7C9EF9EEEC80FBEFBFDF0E3FFC703BE9A4934C79CE9831C3097F51D2A2458BAC7EFDFA45C9C20A2BD037DD74930D1C38B0C85C8A647C3E4F46A0F3098AC3C22170C71D77B851D7A9A79E9A542909EAC5175FEC8443CF2B9E7BEE392B5BB6AC1BDDEA77B972E56CF3E6CDF6F0C30FDBFAF5EBEDAEBBEE7202DFAA552BEBD6AD9BFDE52F7F7102B66DDB36AB51A386F5EDDBD78DA03552DBBA75AB13CB7FFDEB5F39406A04BD2381D6B923478E74E75F79E5953662C40827E283070F769FA9CC7DF6D9C724DACF3CF38C4978E6CF9F6FFBEDB79FDD77DF7DF6EAABAF5AD3A64D4DA3DECB2EBBCCD925FBAA54A9E28E57521DDF7BEF3D67DB01071C601D3B76B47DF7DD37C946E5D5BA75EB1CA22C5E5DBA74B1CCCC4CFBEEBBEFEC85175E70769D7BEEB956A95225AB5BB7AEF5E8D1C3A64D9BE67E2BA903515D2FB9E4127BEAA9A71CD7E1C387DBCC9933DD685A9DC9A04183ECDB6FBFB5FEFDFB5BF5EAD5DDDDCD9D77DE99835BA2402B5FD5F5ABAFBE72C7457720BD7AF572EC656BDBB66DEDC71F7FB42953A6381FAB8356C7F3873FFCC1715CBD7AB5FDE94F7FB2430E39C4EEB9E71EEBDCB9B3F3B1923AA9264D9AB8BF2FBAE8225737B50171555B12C70F3EF8C0B50F7D76F4D147DBFFFEF73FBBFBEEBB5D5B58BC78B1F3654113025D50621C1F0481010306D8279F7CE244FA8A2BAE7075BAFAEAAB9DF84A2474B10E1B36CC6EBDF5D6A4FA5E78E185EE62DCB871A31364DDFA2B49602444895315A9236809EA934F3E99E3D65A02AD119DC44249827AE491473AE1FDEB5FFF6AFA5E2226018B047ADCB8714E647EF7BBDF25D9973882D6744724D0BFFFFDEFEDC5175F74236FD557222FE1934D4F3FFDB4CBE3EF7FFFBB9D76DA6939045ADF492C35724EE475DD75D7D99021435C7D366DDA6462DAAF5F3F27D012612589A3044DE2A4CE4CE22BD1534728811647899FCE4B4C3A479CA34EA45DBB76D6B061C3A46352055A9D9F3A9A7FFCE31F6E0AA359B366AE43489D2EDAD9085A763DFBECB34EA035FD251157DD24DC8F3CF288ABA33A4EE51D2509F5D0A143ED965B6EC916707580127E7D5EB972E5425F330874A1D171620804341FA90B5BA3535DCCA973BB8F3FFEB89BA3D6A8F3DA6BAF35895224D0121A898B92845DA3494D3F442955A06FB8E1062750A9F3AEB98DA0958FA663F6DA6B2FD3DCB35224D01AA15E70C1056E54DCBD7B7737F255CA4DA0BB76ED9A3D7A57672091AE55AB961B753FF0C003EEDC51A346B9BB81D41174A29F5F7FFD75577F3153F9E2122509B538260AB4BE133795A10E43234B8DF023811E3F7EBCEB104F3CF1C4A4E6A40E45A367A568547AFCF1C7EF54A0D529A8037AE79D77DCB99AC67AEDB5D74C3EDC73CF3D9DC0EAFB4481163FD5435C0F3DF450676B24D09A27DF7BEFBD5D99E2A539F3D4BAE93BDD81A8038DA6927497F2C4134FB8CEE2FCF3CF7777130F3EF8A01B7517342509F48A152B0A7A7EEC8FAF59B366B68D2CB38BBDBB4AC4405D94D11CAEFED645A751D68E2E3E19A4D153345296D0E902D6C82F51A0256E8D1B37B6A38E3AAAD8047AE5CA95EE81E082050B5C99128044818E0A927D9AB691E01654A0AFBAEA2A37E25492A81C77DC7139043A91978E8B38258EBE131D97CA517717CB972F777724D1C83A12E82FBFFCD23EFCF043BBFCF2CB937CAF291189FDCE52EA087A47021D9DAFBB113DDC9458270AB446BAA79C724AB678268EA07724D0EA841F7BECB1A48E4953195F7FFD758E29B344DB773492CF4F6367049D1F4A1C1314014D4348A0759BFAE9A79F5A8B162DECFAEBAF3789C5983163DCADAAA62B340570F0C107BB51902EE4F7DF7FDF4D03E86FDDBA270AB4FED7ADAF4445F3AABAF5BFEDB6DB925671147404AD919D845923F11B6FBCD11E7DF4D16C81D6A84DA3448D4835BAD3E850237309811E786A24F8CA2BAF644F71E43682D67CA9EE10347DA0FAA803481D41EB7B7548E2356BD62C97A718CD9933C79521E19B3A75AABBFB10AF548196C06B6AA8418306D9771C91408B95F86A84A9C194F8AA3CB1D31CB0E67755374D3FE9D8C49497406BCA481DAB58687A46D342EAC8F46C60B7DD76B34E9D3AB9ECD4396B8E5BD31AB367CF767712FA7B4702BD66CD1AD3BCB63A1BCD93FFF4D34FCE07AA836C974F7497A472C4453C357216FFA8732AC8C58440178416C7064340A2118D0C135744E4F6B90458B7F089A3C9E8B34428FA4C295AC29578CC8E8E8FCE8DCE8BFE8F1E2CA6E69398C78E6C8D3E8B6C557EAA5FEA798975D677FAFFF9E79FCF758AA320BC72E3A232A272538F49E526BB732B3362A4EF73AB5FF4799447A24FF4775467D993CA2CFA2C9551E2B2BCC4F3537D987A5C6AD905B9887208B4EA9CCB0A9E82E41BCB6399E288A55B302A8D04BEFFFE7BB70A4349A358CD67EF8A35E169ACA2D74527BFD57BCA3CFB79F3561BF4EE37B6E8F693AC42D9F82FE42E087D04BA20B438B63410D0148FE6A0B50C4C73CA5AB5408A0F812481DEEFBEB76CDEAD27DADC656B6DF9BA4DD6A151AD6C4B35EFA6B58BBA1DF8F9E79FDD7C979EAEEAC185FED71A51CD95699E48437CFDAF792B3DDD3EF3CC33DDFCD5860D1BDC13CDE8964BE72B1F2D458916E9EB182D4BC9CACA72652B1FDD4E285F7DA627A32A4FF9143421D00525C6F11080403A092409F4B275599679EF5B6EE4BCB65FF222FEFFFEF7BF6ECDA5567AE81648B743BA356AD4A8917B70102D44D7F21BED12FAF39FFFEC045A02ABA7B4126309ADD66E6A82FEDD77DF75EB0CA3759C9AFF6ADEBCB95B485EAF5E3DB714470F1E162E5CE8167A6B725E1D8496BAA84CED642AE80E29043A9D4D8DB22100818212C831073D78F2377663BB4656B64CF256D28F3EFAC8B4665473547ADAAADD387AEABDFFFEFBDBAA55ABDCAD919E324BBCAB55AB66679C7186136889A8D6251E73CC316ED1BD9ED06A6792D639EA69B046D37A1A3B77EE5CF7A45A4F40F53B9A84D712966FBEF9C68DC0C78E1DEB9E866A81BBF2296842A00B4A8CE321008174126015473AE95336042000819D1040A0691E10800004624A00818EA963300B021080409240EB619E7611E9815ED5AA55DDAA0B45A8D2CE2B45ABD2C339C50DD04A0AFDE8819EE20468894EB49632CE4813E7A065BB7E14C12BAE49DB47B5C32BBF3173B5253835A04C71D74DCF066457F4FC20357FADB4D143E01DA52FBEF8C27D9C177305A7513E7A9641824069269043A015C54B1787045A1788566868CBA9B6BE2ACA96B636EA619DF6FD2B5A93A27D69F585B66E6AC5469C53A2402B8297D67D6A758A02A2E83BD5574B04B536F484134EB037DF7CD33DEC548018EDC157D272430544D777A79F7EBAE3A3285D8A68250E7A98AACF274C98E0E232A8E3D203506D1356795A8AA82DA75A7AA80032DA22AA73B42A45DCF5E0554161B49450F10B74BEECD183586DADD5F2426DCFD59662F1D7AA16D9A6F2E4336D6955D017C517506C051DA380318A52A687B68A68A6E3B5ED542124D5E1469D5594AF1E048B83DA42547785AE94CDEAC4552F7D2F16DAD6AB108FB25D11D8548602E8285E81F251EC03D910EDCA52E7AFB6A4B815F3E6CD73211915874151DEB41D58E2AE87C962A8F08DF2C3C71F7FEC98C8663DA056601D715084340D22947F648B56FE6820A1BCB5C5560F97359810BFDC82DCC7B9CD625BE926B04381D6084617A72E420984566A684FBB02AB68B99B0446610725D4DAAFAE2577DABB1EF7942AD08A9DA00B5D9F6B59A04687AAAF56986894A7D082123D8D18A3D0870A5EA33B0A45175327A52581BA8B9050EB78E5276E123EDD7D28908D045AE22D6E1268C54A50BE1220899AA25F291E80BED77A6F2D558CB69B6A1DB946C5B251DFC907EA10140B41211915E376E9D2A556BB766D17E74002267193684ABC155652F629C9A75A65235BF5B7444CC2AAF8B75AF2A8E03CB7DF7EBBF3E9C9279FECCE579C07896A62E72B51543D141FE188238E308582D49D978454E2AD7C159F409D85CA57A84A89A692F252A728A6EA84541FD9AFF8063A473131D41189AB96574AB83540500728C1958D8A4FA1A872126889BA56F928EA9B96668AAD6C136FD55BAB8DD4F12AB2596A2C87B8B757EC8340A99D837EFBEDB75DE42E2509A20276FFF2CB2FEE7F858CD4F240ADD5960068599F8443499D9136D548B0156C45AF4D9238456BC1B5D450EBB5D5C9693427B1D4765A8D5C25D61A792B088C924675FA91B84AACD5112A088EEE46D459A82C95AB7325E8DAC0A3602E2A5F1D66B4645122A7202D0AE7A8BC14B94B235B8DD015B92B8A0D106D02529017E529115647A20E401D93469A2A53C165F4B7C4508163947F9487EEA0C44382AA0D462A471D8C6C175309B6045165EB188D86B56C32124789A7363B296F754AB249DFAB23126BD92F5E1AEDAACE9A5A93C8EA0E409D8B3A27F9450CC54A62AF3A8ABBEE7634D2572C604DA768E9A78ED19D8882EE48F44910F08940A915E8743849C2A48D373ECCD7EF4A3E1A592BD29846DAD1C87A579647DE10F0950002EDABE7B01B0210089E00021DBC8BA9200420E02B812481D6DB8D434B9A138D125BBD43F32EF58140D804184187ED5F6A070108784C0081F6D879980E0108844D2087406FD9BA2D4724BB501030C5118A27A907044A07812481EE39E633BBEC884CEB39FA539B78651BDBBDE26F3B03B53C4C6B59A34D0F05C1A3B5BE5A179CDB6BC7B55141AF454F4DDAD4A06DE4DA2451987253F343A00BE2358E850004D24D2049A05B0E996C1F5E7B8C8D9EB3D89AD6AE6A87D5AF9E6D9F3621684BB43674BCF5D65B6E1DAB767069E75C93264DDCAE3AED0C536C676D858E5E63AF0CB4A9429B34B449415B87B5414431A2B57B4DDB8CB541449B0824A0DAC1A7EDCEDAFAACA4E3B56B51C768A79A369068D384DE1E2C9BF45D7E13029D5F521C070108C481409240676DDE6AD5FBBE69D52A94B31FFB9E92649FC4308AB52031D63666C544D0AE31EDECD2E60BC53DE8D7AF9F7B8DBD624F68C79BB6DF2A69E7DAFCF9F3DD2E37ED4CD3CE33E5A11D631264C5F950BC05ED3E53D20EB448A0B56B4C82AF2DC5DA55A6D1B4768C699BF2C08103F3FD6615043A0E4D0E1B200081FC12C831073DEEABE5764AD33A39CED7565C05B2D1765C05C351901B05F151DC0AFDFEECB3CFDCD65AC54E50AC0A1DAF2DC31AED8E1933C68DB425E8C3860D7379286684A63624D08AE9A1EDD2DA82AC91B93A03C583508A5EB5A511B7B6F00E1F3EDC89BB5E95A500398A0791DF8440E79714C74100027120E0C52A0E6D9196786B34AED80C0D1A3428143B04BA50D8380902104813012F04BAB8D820D0C545927C20008192208040970465CA80000420500802087421A0710A0420008192209024D05A8D115A5200F72831C5119A77A90F04C226C0083A6CFF523B0840C0630208B4C7CEC3740840206C023904FAF365EBDC16EFFAD52B065773A638827369A12BA477362686A22D74469C586402DA613C69D2246BD5AA5591F30A2D8324813EFFB9E976EFA9CD6DC0C4AFECDE8ECDAD5EB5DD5C7DB50E596F6B563C0DBD2F4E2F19CD2D45AF338A2328043A8E5E29799BF47670BDC19C142F027AB72529994092401FF3E8549B70456B7BE4FDF9767AF37AB67FED2AD9476B37A0E26668B38876F4DD7DF7DDEEA5A3EAF524E07ABF5CE3C68DDD4E42357E8D50264E9CE8DE7EADB73A77EBD6CDBD9C349D09814E27FDF894ADB795472105E263159620D039DB4092402BD468D53E6F58A39A556C4EAF0E49474B7815284923E9050B16B8DF3D7AF4703137B4055CAB2514752E12E8112346B8A0491A711F76D8616E6BB8822AA53321D0E9A41F9FB211E8F4FA42033D4D6B282546B144A0F310687DFDE5F275D6AC4ED51C476A7A4391E4A2ADD653A74E75C18BF47AFBAD5BB7BAC8744AD3A64D73236AFD2F2197384BC4EBD4A9136B815610A7281CAA22E7A90E152A54C8C1418D28B7F94B71C8C8C870771AAA2F299E0410E8F4FA4561841F78E00177579D18461881CE8740EF0AD729EA9C46D9E94E3B1B417FF2C9272E509342A67EF4D1473674E8501B356A9475E9D2C545E8D38FEE10F4604902AC8EEACA2BAF74C7D4AE5DDBFAF4E9636BD6ACB19B6FBED956AF5EED824029ACEA8409135C1C6DDD3D2C5AB4C83A75EAE442A516477CEB74F3F4B57C043AFD9E9348EB7A4A4C08749A043AFDCDE1570B7626D01A358F1B37CECDAF2BEEB446FE125AFDADBB028535BDE79E7B5C4C6C8DB6155255E2AC39F6D1A347DBE0C1839D40EB2EE3F2CB2FB7962D5BDADCB973DD485A3FB366CD722155DBB66DEBEE3C24DAA4F41040A0D3C33DAF52116804DAAA57FFED25048938D6AD5B6755AB5635FDD6685F3DBC42A4469FAF5FBFDE854ED58FA63F3495A1E334E2D6D446E5CA95DDE74AFA4CC72969AE4DC7EA1889B7460D3A0E81CEEB72DD75DF23D0BB8E6D517246A011E85C05BA280D8B73FD228040C7D35F08741E02FDF9E79FC7D37345B0AA79F3E6D967B38AA30820033A15818EA733116846D08CA0E3796D96A8557A5D5AD7AE5D4BB44C0ACB9B00028D4023D0795F27A5E288993367DAA1871E5A2AEA1AF74AEA398D5651E93576A464023962716CDDB6CDCA646404C989298E20DD4AA520102C812481DEB465AB55EBF3A6952B9361EBFB774AAAF4800103AC7EFDFAD6BD7BF7A4CFB5A350EB86F5C66FAD6448779AB772832D5F97654767D6B08E8F7F6063BBFF168005814EB777281F021028088124815E9BB5D9F61F34C9BAB5CCB4FB3BFDF6704D19EA4DDB999999F6D34F3F3941AE56AD9A7BBBB7DEE67DDE79E7B92D9B5AEF3B64C8103BEDB4D35C5C8E74A5E3864FB30FBF5F651B523A19043A5D1EA15C0840A030049204FADC673EB6D7BE58EAF259D0FBC4EC687691406B67DC871F7E68471F7DB4CD9933C7962C59628D1A35729B37B4A9A366CD9A367EFC78B79EF898638E298C3DBBF41C047A97E225730840A098092409F4D2B559D6E6D129B677F54AF6CE556DAC4CC254B476DA69A345F43BDA8CA10D17FAD1E60B4DF62B66876258A46EE32C66BB0B951D025D286C9C040108A489006F544913788A85000420901701043A2F427C0F010840204D0410E83481A75808400002791140A0F322C4F710800004D2442049A0B5842EB454AB56ADEC2AF1903034EF521F08844D801174D8FEA576108080C70410688F9D87E9108040D80410E8B0FD4BED2000018F092409F4DC656BADDDA3536DFDA62D967577E7A46AE98D20F3E6CDCB7EF16BF4A691E820C5924E8CBD9C2E265FFDB8DE662E5A6D671D54CF0E1BF2AECDED751C73D0E972468CCBCDEDC5BF313679A7A6E9FA9C346992DBE54B0A87409240EFF697D76DD59D1DEDFFC67E6EB316AFB1B7AF6C935DD3912347BAD7405D70C1056E3BB7760F2E5CB8D06DF1AE57AF9E6B18DA45F8EDB7DFDAF1C71FEF5E1795AE74F5E84F6DE4CC1F6CF55DA72699C043C27479245EE5BEFCF2CB76D96597C5CBA862B266D5AA55BC4EAD9858C6219B24819EB374AD1DF9F07BA690A3A923E80F3EF8C045B3D3BBF6147B63ECD8B1AE2128AEEED9679FEDEA2281D68B5157AC58E1E272C42D21D071F3487AEC09F98D2A08747ADAD4AE2A9539E85D45967C634B200481D69258DDD12A068EEE60A38440C7B6D915CA30047A3BB665CB9659DDBA757340D4DC5EF486EEC42F57AE5CE90247EDE89CC48B456F11E72DDE856A9BBBECA44481966F468D1A65CD9A35B3962D5BBA32A74D9B666DDAFC36BD976A885ECD3479F2646BDDBAF50EEF14259CB9050BD3F4E082050BAC478F1EEE6DEF854D0A4C3678F060EBD2A58B356CD810812E2CC8989F87406F77905EB973F8E187DB4D37DD6477DC71875D77DD75F6ECB3CF9A2EE68B2FBED8CD59F6EEDDDB1E7CF0417BFAE9A79DE8CE9A35CB5E7AE92517BD4FF3F11D3B76B42953A658BB76EDEC9C73CEB15EBD7A59DFBE7DDD05F9C4134FD825975C62F7DD779F2B51F9DE7AEBAD2EEFB66DDBC6BC9984655EEA085A7E79ECB1C7AC7FFFFEB6DF7EFBB90EB943870E56A3460D173AF79B6FBE7142AC51AB845CBE97303EFFFCF3EE554DEFBCF38EA983EFD3A78F55AC58D1962E5DEA62A32F5FBEDCBD624D0FD4D5564E3EF9640772F6ECD9A629C3134E38C11DDBA2450B77AC3A7DC55DBFF1C61BF3055C22AD69C6C4C4083A5FE8BC390881DEEE2A8D86C78D1BE72ECADAB56BBBF9F69E3D7BDAD0A143DDC525D11D346890B56FDFDE5AB5FAF52D2DFA5C6F94C9CACA7217982E565D987AD79D1E940E1C38D0162D5AE4E6E875BE8ED7C5AFEFDF7BEF3DF7D203AD7C89C39B68BC69B1C56068EA085A235EBD68425305F2D58B2FBEE844531DB646B9EBD7AF77A176F500BC69D3A6B661C306F7105C3E9460EB6F75C037DC70838D1831C2BA75EB961D9637BA03D36F897724D0071F7CB0EBA40F39E410F7807DC68C19EED98EF292A8173621D0852517CFF310E8ED7E89960DEA628C045331AFA38B4A17A5DE2023418E56A8E8C2D6C3D2CE9D3BDB6BAFBD66A79F7E7A763C6C65AB63A3F3D5014471B3A3DB5F95A9D1B77E482547202E73D01A317FF9E597D91D7E711040A08B83627CF240A0E3E30B2C2921027111E85D515D047A57504D5F9E0874FAD853729A0820D069024FB10526804017181927F84EE0D5575FB5AE5DBBFA5E8D1DDACF083A2CB72609F49AACCDF6F58FEB6DF3D66D7674E61E61D5D4CCD8A8129C4B0B5D216DB0D283C050921E424E9F3E9DADDEA138747B3D92047ACCDC2576EC7EB5ACDE80F1493B09B5AC68F1E2C5A6DE590F35F424FBEBAFBF764FB9B506533B07F5E4398E2F8A4DF417021D58EBA53A10089C40BE045A0C860F1FEE56253468D0C01A376EEC461FC3860DB3ABAFBE3A5BA0759C845B4BCEB4A44CAB21B49E54C22D01D78A06C54190A05F7FFDF5258E16812E71E4140801081481409240BFFAF952B7CCDFC7480000071A4944415408FFBCE7A6E788C53171E24427CE5A642F81D6FACD175E78C1054F8A46D0D10E2A6DF0D0C27EDD76299D71C6192E129ED608FFE73FFF71427FD5555715C1ECC29D8A40178E1B67410002E92190E321E1A62DBF8A6A85B2658A649176D669E386C4392E09818E8B27B0030210C80F015671E48712C740000210480301043A0DD02912021080407E0820D0F9A1C43110800004D24000814E03748A84000420901F0208747E28710C04200081341040A0D3009D2221000108E48700029D1F4A1C03010840200D0410E83440A74808400002F92180406FA7B4CFBD136DE32F5BF2C3AC588E295726C396DE7E52B1E44526108040980410E8ED7EADD56F7C897BF8F5CB8EB2560D6A9478B914080108F8410081CEA740972F9B61B7B46F6CF74F9E67BF6CDF0E5F5417BFD2ED486BBB6FCDA266C3F9108040A00410E87C0A7493DA556C5DD6665BB236CB9DD1B375436BD3A0862D58B5D1AAED56CE9AD4AA62F5AAEE66173D3FC3BA1F9969FBD6A8EC824EED2C21D0815E55540B02C5440081CEA74047BC1BD6A8640B566EB4DE1D1ADB8C456BAC53B3BA56AB72799BB36CAD8D9AB9D8F6D9A3A2CD5AB4C6F4F283BC12029D1721BE8740E9268040E753A035C571418BFA3672D622EBD2A2BE7DBA648DD5AE52C1366CDA6295CA97B5951B7FB1792B3658950A656DF9BA4DD6B1591D7BFD8B658CA04BF7F545ED2150240208743E05BA489473399911F4AEA04A9E10088700029D4681FEA0675BDBBF7695705A13358100048A950002BD1DE7D8AF96DBA52FCC742FCC2D8934E0E466764DAB86255114654000029E1240A03D751C66430002E11340A0C3F731358400043C2580407BEA38CC860004C227804087EF636A080108784A0081F6D471980D0108844F00810EDFC7D4100210F0940002EDA9E3301B0210089F00021DBE8FA9210420E0290104DA53C761360420103E01043A7C1F53430840C0530208B4A78EC36C0840207C020874F83EA686108080A70410684F1D87D9108040F80410E8F07D4C0D2100014F0920D09E3A0EB3210081F00920D0E1FB981A4200029E1240A03D751C66430002E11340A0C3F731358400043C2580407BEA38CC860004C227804087EF636A080108784A0081F6D471980D0108844F00810EDFC7D4100210F0940002EDA9E3301B0210089F00021DBE8FA9210420E0290104DA53C761360420103E01043A7C1F53430840C0530208B4A78EC36C0840207C020874F83EA686108080A70410684F1D87D9108040F80410E8F07D4C0D2100014F0920D09E3A0EB3210081F00920D0E1FB981A4200029E1240A03D751C66430002E11340A0C3F731358400043C2580407BEA38CC860004C227804087EF636A080108784A0081F6D471980D0108844F00810EDFC7D4100210F0940002EDA9E3301B0210089F00021DBE8FA9210420E0290104DA53C761360420103E01043A7C1F53430840C05302199EDA8DD9108000048227804007EF622A080108F84A0081F6D573D80D0108044F00810EDEC554100210F0950002EDABE7B01B0210089E00021DBC8BA9200420E02B0104DA57CF61370420103C01043A781753410840C0570208B4AF9EC36E08402078020874F02EA682108080AF0410685F3D87DD108040F00410E8E05D4C052100015F0920D0BE7A0EBB210081E00920D0C1BB980A420002BE1240A07DF51C76430002C11340A0837731158400047C258040FBEA39EC8600048227804007EF622A080108F84A0081F6D573D80D0108044F00810EDEC554100210F0950002EDABE7B01B0210089E00021DBC8BA9200420E02B0104DA57CF61370420103C01043A781753410840C0570208B4AF9EC36E08402078020874F02EA682108080AF0410685F3D87DD108040F00410E8E05D4C052100015F0920D0BE7A0EBB210081E00920D0C1BB980A420002BE1240A07DF51C76430002C11340A0837731158400047C258040FBEA39EC8600048227804007EF622A080108F84A0081F6D573D80D0108044F00810EDEC554100210F0950002EDABE7B01B0210089E00021DBC8BA9200420E02B0104DA57CF61370420103C01043A781753410840C0570208B4AF9EC36E08402078020874F02EA682108080AF0410685F3D87DD108040F00410E8E05D4C052100015F0920D0BE7A0EBB210081E00920D0C1BB980A420002BE1240A07DF51C76430002C11340A0837731158400047C258040FBEA39EC8600048227804007EF622A080108F84A0081F6D573D80D0108044F00810EDEC554100210F0950002EDABE7B01B0210089E00021DBC8BA9200420E02B0104DA57CF61370420103C01043A781753410840C0570208B4AF9EC36E08402078020874F02EA682108080AF0410685F3D87DD108040F00410E8E05D4C052100015F0920D0BE7A0EBB210081E00920D0C1BB980A420002BE1240A07DF51C76430002C11340A0837731158400047C258040FBEA39EC8600048227804007EF622A080108F84A0081F6D573D80D0108044F00810EDEC554100210F0950002EDABE7B01B0210089EC0FF036DA3CE30CB0602C40000000049454E44AE426082 , 'Default', 'ueb_key', 'ueb_secret', 'ECOMP-PORTAL-OUTBOX', 1); + +-- ASDC users + +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 (2,NULL,NULL,'Jimmy',NULL,'Hendrix',NULL,NULL,NULL,'admin@openecomp.org',NULL,NULL,NULL,'jh0003',NULL,'jh0003','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); +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 (3,NULL,NULL,'Carlos',NULL,'Santana',NULL,NULL,NULL,'designer@openecomp.org',NULL,NULL,NULL,'cs0008',NULL,'cs0008','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); +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 (4,NULL,NULL,'Joni',NULL,'Mitchell',NULL,NULL,NULL,'tester@openecomp.org',NULL,NULL,NULL,'jm0007',NULL,'jm0007','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); +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 (5,NULL,NULL,'Steve',NULL,'Regev',NULL,NULL,NULL,'ops@openecomp.org',NULL,NULL,NULL,'op0001',NULL,'op0001','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); +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 (6,NULL,NULL,'David',NULL,'Shadmi',NULL,NULL,NULL,'governor@openecomp.org',NULL,NULL,NULL,'gv0001',NULL,'gv0001','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); +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 (7,NULL,NULL,'Teddy',NULL,'Isashar',NULL,NULL,NULL,'pm1@openecomp.org',NULL,NULL,NULL,'pm0001',NULL,'pm0001','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); +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 (8,NULL,NULL,'Eden',NULL,'Rozin',NULL,NULL,NULL,'ps1@openecomp.org',NULL,NULL,NULL,'ps0001',NULL,'ps0001','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); + +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,999,null,2); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,999,null,3); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,999,null,4); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,999,null,5); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (2,999,null,4); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (3,16,null,4); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (4,16,null,4); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (5,16,null,4); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (6,16,null,4); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (7,16,null,4); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (8,16,null,4); + + +-- VID users + +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 (9,NULL,NULL,'vid1',NULL,'user',NULL,NULL,NULL,'vid1@openecomp.org',NULL,NULL,NULL,'vid1',NULL,'vid1','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); +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 (10,NULL,NULL,'vid2',NULL,'user',NULL,NULL,NULL,'vid2@openecomp.org',NULL,NULL,NULL,'vid2',NULL,'vid2','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); +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 (11,NULL,NULL,'vid3',NULL,'user',NULL,NULL,NULL,'vid3@openecomp.org',NULL,NULL,NULL,'vid3',NULL,'vid3','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); + +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,999,null,6); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (9,16,null,6); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (10,16,null,6); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (11,16,null,6); + +-- fn_roles for the on boarded apps +insert into fn_role values(1000,'System Administrator','Y',1,2,999); -- SDK +insert into fn_role values(1001,'Standard User','Y',1,2,16); -- SDK +insert into fn_role values(1002,'System Administrator','Y',1,3,999); -- DMaap +insert into fn_role values(1003,'Standard User','Y',1,3,16); -- DMaap +insert into fn_role values(1004,'System Administrator','Y',1,4,999); -- SDC +insert into fn_role values(1005,'Standard User','Y',1,4,16); -- SDC +insert into fn_role values(1006,'Policy Super Admin','Y',1,5,999); -- Policy +insert into fn_role values(1007,'Standard User','Y',1,5,16); -- Policy +insert into fn_role values(1008,'System Administrator','Y',1,6,999); -- VID +insert into fn_role values(1009,'Standard User','Y',1,6,16); -- VID + + +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,1000,NULL,2); +Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,1001,NULL,2); + +INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (1,1002,NULL,3); +INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (1,1004,NULL,4); +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 (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 (10,1008,NULL,6); +INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (10,1009,NULL,6); + +-- new 1610.2 +-- Ignore errors if the application is not onboarded in this environment + +INSERT IGNORE INTO `fn_app_contact_us` (app_id, contact_name, contact_email, url, active_yn, description) VALUES ( + (select min(app_id) from fn_app where app_name like "%SDC%" and enabled = "Y"), + "SDC Team","sdc@lists.openecomp.org","",NULL, + "Service Design and Creation (SDC)."); + INSERT IGNORE INTO `fn_app_contact_us` (app_id, contact_name, contact_email, url, active_yn, description) VALUES ( + (select min(app_id) from fn_app where app_name like "%Policy%"), + "Policy Team","policy@lists.openecomp.org","",NULL, + "Policy."); +INSERT IGNORE INTO `fn_app_contact_us` (app_id, contact_name, contact_email, url, active_yn, description) VALUES ( + (select min(app_id) from fn_app where app_name like "%DMaaP Bus%"), + "DBC Team","portal@lists.openecomp.org","",NULL, + "DBC."); +INSERT IGNORE INTO `fn_app_contact_us` (app_id, contact_name, contact_email, url, active_yn, description) VALUES ( + (select min(app_id) from fn_app where app_name like "%Virtual Infrastructure%"), + "Portal Team","portal@lists.openecomp.org","",NULL, + "Virtual Infrastructure Design."); +INSERT IGNORE INTO `fn_app_contact_us` (app_id, contact_name, contact_email, url, active_yn, description) VALUES ( + (select min(app_id) from fn_app where app_name like "%Demo%"), + "Portal Team","portal@lists.openecomp.org","",NULL, + "Demo Application"); +-- end new 1610.2 + +-- +-- Data for table fn_menu_functional +-- +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (175,1,'Manage',NULL,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (1,2,'Design',175,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (316,11,'Administration',1,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (2,8,'ECOMP Platform Management',175,'','N',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (3,5,'Technology Insertion',175,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (5,7,'Performance Management',175,'','N',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (6,6,'Technology Management',175,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (7,4,'Capacity Planning',175,'','N',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (8,3,'Operations Planning',175,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (11,1,'Product Design',1,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (12,2,'Resource/Service Design & Onboarding',1,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (13,3,'Orchestration (recipe/Process) Design',1,'','N',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (14,4,'Service Graph visualizer',1,'','N',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (15,5,'Distribution',1,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (16,6,'Testing',1,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (17,7,'Simulation',1,'','N',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (18,8,'Certification',1,'','N',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (19,9,'Policy Creation/Management',1,'http://policy.api.simpledemo.openecomp.org:8443/ecomp/policy#/Editor','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (20,10,'Catalog Browser',1,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (24,5,'Create/Manage Policy',12,'http://policy.api.simpledemo.openecomp.org:8443/ecomp/policy#/Editor','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (56,1,'Policy Engineering',8,'http://policy.api.simpledemo.openecomp.org:8443/ecomp/policy#/Editor','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (115,1,'Test/Approve a Resource or Service',16,'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal#/dashboard','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (130,1,'Favorites',175,'','y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (139,2,'Approve a Service for distribution',12,'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal#/dashboard','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (142,3,'Create a License model',12,'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal#/onboardVendor','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (145,1,'Distribute a Service',15,'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal#/dashboard','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (148,1,'User Management / Category Management',316,'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal#/adminDashboard','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (178,2,'Support',NULL,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (181,1,'Contact Us',178,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (184,2,'Get Access',178,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (301,1,'Create a Product',11,'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal#/dashboard','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (304,2,'Create a Vendor Software Product',11,'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal#/onboardVendor','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (307,1,'Manage a Resource/Service',20,'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal#/catalog','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (310,2,'Manage a Product',20,'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal#/catalog','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (313,3,'View a Resource/Service/Product',20,'http://sdc.api.simpledemo.openecomp.org:8181/sdc1/portal#/catalog','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (317,1,'Message Bus Management',6,'http://portal.api.simpledemo.openecomp.org:8989/ECOMPDBCAPP/dbc#/dmaap','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (318,1,'Infrastructure Provisioning',3,'','Y',NULL); +INSERT INTO `fn_menu_functional` (`menu_id`,`column_num`,`text`,`parent_menu_id`,`url`,`active_yn`,`image_src`) VALUES (319,1,'Infrastructure VNF Provisioning',318,'http://vid.api.simpledemo.openecomp.org:8080/vid/vidhome.htm','Y',NULL); +-- +-- Data for table fn_menu_functional_ancestors +-- +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (1,175,175,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (2,178,178,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (3,11,11,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (4,12,12,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (5,13,13,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (6,14,14,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (7,15,15,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (8,16,16,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (9,17,17,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (10,18,18,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (11,19,19,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (12,20,20,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (13,316,316,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (14,318,318,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (15,317,317,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (16,56,56,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (17,301,301,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (18,304,304,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (19,24,24,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (20,139,139,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (21,142,142,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (22,145,145,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (23,115,115,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (24,307,307,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (25,310,310,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (26,313,313,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (27,1,1,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (28,2,2,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (29,3,3,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (30,5,5,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (31,6,6,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (32,7,7,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (33,8,8,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (34,130,130,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (35,181,181,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (36,184,184,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (37,148,148,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (38,319,319,0); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (64,11,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (65,12,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (66,13,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (67,14,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (68,15,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (69,16,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (70,17,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (71,18,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (72,19,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (73,20,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (74,316,1,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (75,318,3,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (76,317,6,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (77,56,8,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (78,301,11,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (79,304,11,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (80,24,12,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (81,139,12,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (82,142,12,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (83,145,15,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (84,115,16,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (85,307,20,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (86,310,20,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (87,313,20,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (88,1,175,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (89,2,175,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (90,3,175,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (91,5,175,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (92,6,175,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (93,7,175,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (94,8,175,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (95,130,175,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (96,181,178,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (97,184,178,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (98,148,316,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (99,319,318,1); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (127,301,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (128,304,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (129,24,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (130,139,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (131,142,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (132,145,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (133,115,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (134,307,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (135,310,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (136,313,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (137,148,1,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (138,319,3,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (139,11,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (140,12,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (141,13,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (142,14,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (143,15,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (144,16,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (145,17,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (146,18,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (147,19,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (148,20,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (149,316,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (150,318,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (151,317,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (152,56,175,2); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (158,301,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (159,304,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (160,24,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (161,139,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (162,142,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (163,145,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (164,115,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (165,307,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (166,310,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (167,313,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (168,148,175,3); +INSERT INTO `fn_menu_functional_ancestors` (`id`,`menu_id`,`ancestor_menu_id`,`depth`) VALUES (169,319,175,3); + +-- new 1610.2 which one? add-on 3rd script +insert IGNORE into fn_menu_functional_roles (menu_id, app_id, role_id) +( +select a.menu_id, b.app_id, b.role_id from +( +select a.menu_id from fn_menu_functional a where upper(text) like '%POLICY%' +) a, +( +select * from fn_role where app_id = (select app_id from fn_app where app_name = 'Policy') +) b +); + + +insert IGNORE into fn_menu_functional_roles (menu_id, app_id, role_id) +( +select a.menu_id, b.app_id, b.role_id from +( +select a.menu_id from fn_menu_functional a where url like '%sdc1%' +) a, +( +select * from fn_role where app_id = (select app_id from fn_app where app_name = 'SDC') +) b +); + +insert IGNORE into fn_menu_functional_roles (menu_id, app_id, role_id) +( +select a.menu_id, b.app_id, b.role_id from +( +select a.menu_id from fn_menu_functional a where url like '%vid%' +) a, +( +select * from fn_role where app_id = (select app_id from fn_app where app_name = 'Virtual Infrastructure Deployment') +) b +); + +insert IGNORE into fn_menu_functional_roles (menu_id, app_id, role_id) +( +select a.menu_id, b.app_id, b.role_id from +( +select a.menu_id from fn_menu_functional a where url like '%DBC%' +) a, +( +select * from fn_role where app_id = (select app_id from fn_app where app_name = 'DMaaP Bus Ctrl') +) b +); + +insert IGNORE into fn_menu_functional_roles (menu_id, app_id, role_id) +( +select a.menu_id, b.app_id, b.role_id from +( +select a.menu_id from fn_menu_functional a where url like '%SDK%' +) a, +( +select * from fn_role where app_id = (select app_id from fn_app where app_name = 'xDemo App') +) b +); +-- end new + +INSERT INTO `fn_common_widget_data` (`id`,`CATEGORY`,`HREF`,`TITLE`,`content`,`event_date`,`SORT_ORDER`) VALUES (6,'NEWS','http://about.att.com/innovationblog/next_att_labs','What\s Next at AT&T Labs? AI Set to Revolutionize the Network',NULL,NULL,10); +INSERT INTO `fn_common_widget_data` (`id`,`CATEGORY`,`HREF`,`TITLE`,`content`,`event_date`,`SORT_ORDER`) VALUES (7,'NEWS','http://about.att.com/innovationblog/ecomp_code','Code, Community and Commitment – the 3 Cs of Open Source',NULL,NULL,20); +INSERT INTO `fn_common_widget_data` (`id`,`CATEGORY`,`HREF`,`TITLE`,`content`,`event_date`,`SORT_ORDER`) VALUES (8,'NEWS','http://about.att.com/story/orange_testing_att_open_source_ecomp_platform.html','Orange Testing AT&Ts Open Source ECOMP Platform for Building Software-Defined Network Capabilities',NULL,NULL,30); +INSERT INTO `fn_common_widget_data` (`id`,`CATEGORY`,`HREF`,`TITLE`,`content`,`event_date`,`SORT_ORDER`) VALUES (9,'NEWS', 'http://about.att.com/innovationblog/linux_foundation','Opening up ECOMP: Our Network Operating System for SDN',NULL,NULL,40); +INSERT INTO `fn_common_widget_data` (`id`,`CATEGORY`,`HREF`,`TITLE`,`content`,`event_date`,`SORT_ORDER`) VALUES (10,'EVENTS',NULL,'OpenECOMP Launches into Open Source',NULL,'2017-02-14',1); +INSERT INTO `fn_common_widget_data` (`id`,`CATEGORY`,`HREF`,`TITLE`,`content`,`event_date`,`SORT_ORDER`) VALUES (11,'IMPORTANTRESOURCES','http://about.att.com/content/dam/snrdocs/ecomp.pdf','ECOMP White Paper',NULL,NULL,1); +INSERT INTO `fn_common_widget_data` (`id`,`CATEGORY`,`HREF`,`TITLE`,`content`,`event_date`,`SORT_ORDER`) VALUES (12,'IMPORTANTRESOURCES','https://openecomp.atlassian.net/wiki/display/DW/Developer+Wiki+for+OpenECOMP','OpenECOMP Wiki',NULL,NULL,2); +INSERT INTO `fn_common_widget_data` (`id`,`CATEGORY`,`HREF`,`TITLE`,`content`,`event_date`,`SORT_ORDER`) VALUES (13,'IMPORTANTRESOURCES','https://openecomp.atlassian.net/wiki/display/DW/Portal+and+Dashboard','OpenECOMP Wiki, Portal',NULL,NULL,3); +INSERT INTO `fn_common_widget_data` (`id`,`CATEGORY`,`HREF`,`TITLE`,`content`,`event_date`,`SORT_ORDER`) VALUES (14,'IMPORTANTRESOURCES','https://openecomp.atlassian.net/wiki/display/DW/Portal+and+Dashboard','OpenECOMP User Guide',NULL,NULL,4); + diff --git a/ecomp-portal-BE/ecomp-portal-resources/sql scripts/EcompPortalDDLMySql_1610_Complete_OS.sql b/ecomp-portal-BE/ecomp-portal-resources/sql scripts/EcompPortalDDLMySql_1610_Complete_OS.sql new file mode 100644 index 00000000..cf3d80be --- /dev/null +++ b/ecomp-portal-BE/ecomp-portal-resources/sql scripts/EcompPortalDDLMySql_1610_Complete_OS.sql @@ -0,0 +1,1499 @@ +-- --------------------------------------------------------------------------------------------------------------- +-- This is the 1610.2 Open Source Version of 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 +-- run_time timestamp without time zone +); +-- +-- 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, +-- create_date timestamp without time zone not null, + parent_folder_id integer, + public_yn character varying(1) default 'n' not null +-- public_yn character varying(1) default 'n'::character varying 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 +-- read_only_yn character varying(1) default 'n'::character varying 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', +-- active_yn character(1) default 'y'::bpchar, + 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, +-- public_yn character varying(1) default 'n'::character varying not null, + report_xml text, + create_id numeric(11,0), + create_date timestamp default now(), +-- create_date timestamp without time zone, + maint_id numeric(11,0), + maint_date timestamp default now(), +-- maint_date timestamp without time zone, + menu_id character varying(500), + menu_approved_yn character varying(1) default 'n' not null, +-- menu_approved_yn character varying(1) default 'n'::character varying not null, + owner_id numeric(11,0), + folder_id integer default 0, + dashboard_type_yn character varying(1) default 'n', +-- dashboard_type_yn character varying(1) default 'n'::character varying, + dashboard_yn character varying(1) default 'n' +-- dashboard_yn character varying(1) default 'n'::character varying +); +-- +-- 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 +-- read_only_yn character varying(1) default 'n'::character varying 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, +-- dwnld_start_time timestamp without time zone not null, + record_ready_time timestamp default now(), +-- record_ready_time timestamp without time zone, + 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(), +-- sent_date timestamp without time zone default now(), + access_flag character varying(1) default 'y' not null, +-- access_flag character varying(1) default 'y'::character varying not null, + touch_date timestamp default now() +-- touch_date timestamp without time zone +); +-- +-- 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, +-- run_date timestamp without time zone, + 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_yn character(1) default 'n'::bpchar, + error_code numeric(11,0), + deleted_yn character(1) default 'n', +-- deleted_yn character(1) default 'n'::bpchar, + 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, +-- log_time timestamp without time zone 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(), +-- start_date timestamp without time zone, + end_date timestamp default now(), +-- end_date timestamp without time zone, + run_date timestamp default now(), +-- run_date timestamp without time zone, + 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', +-- encrypt_yn character(1) default 'n'::bpchar, + attachment_yn character(1) default 'y' +-- attachment_yn character(1) default 'y'::bpchar +); +-- +-- 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 +-- run_time timestamp without time zone +); +-- +-- 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, +-- large_data_source_yn character varying(1) default 'n'::character varying 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(25), + middle_name character varying(25), + last_name character varying(25), + 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, +-- last_login_date timestamp without time zone, + active_yn character varying(1) default 'y' not null, +-- active_yn character varying(1) default 'y'::character varying not null, + created_id int(11), + created_date timestamp default now(), +-- created_date timestamp without time zone default now(), + modified_id int(11), + modified_date timestamp default now(), +-- modified_date timestamp without time zone default now(), + is_internal_yn character(1) default 'n' not null, +-- is_internal_yn character(1) default 'n'::bpchar 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, +-- active_yn character varying(1) default 'y'::character varying 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, +-- action_time timestamp without time zone, + 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, +-- audit_date timestamp without time zone 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_start_date timestamp without time zone not null, + broadcast_end_date timestamp not null default now(), +-- broadcast_end_date timestamp without time zone not null, + active_yn character(1) default 'y' not null, +-- active_yn character(1) default 'y'::bpchar 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 +-- message_date_time timestamp without time zone +); +-- +-- 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(), +-- created_date timestamp without time zone, + updated_date timestamp default now() +-- updated_date timestamp without time zone +); +-- +-- name: fn_chat_users; type: table +-- +create table fn_chat_users ( + chat_room_id integer, + user_id integer, + last_activity_date_time timestamp, +-- last_activity_date_time timestamp without time zone, + 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, +-- active_yn character varying(1) default 'y'::character varying 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', +-- menu_set_cd character varying(10) default 'app'::character varying, + separator_yn character(1) default 'n', +-- separator_yn character(1) default 'n'::bpchar, + 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 +); + +create table fn_widget ( + widget_id int(11) primary key not null auto_increment, + wdg_name varchar(100) not null default '?', + app_id int(11) not null, + wdg_width int(4) not null default '0', + wdg_height int(4) not null default '0', + wdg_url varchar(256) not null default '?', + key fk_fn_user__ref_201_fn_app_idx (app_id), + constraint fk_fn_user__ref_202_fn_app foreign key (app_id) references fn_app (app_id) +); +-- ------------------ 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) +); + +-- +-- NAME: KPI_API_STATS; TYPE: TABLE +-- +create table kpi_api_stats ( + api_type varchar(64), + total_api int(11), + comment varchar(256) +); + +-- +-- NAME: KPI_SERVICE_SUPPORTED; TYPE: TABLE +-- +create table kpi_service_supported ( + service_type varchar(100), + total_count int(11) +); + +-- +-- NAME: KPI_USER_STORY_STATS1; TYPE: TABLE +-- +create table kpi_user_story_stats1 ( + release_key varchar(50), + delivered int(11), + in_progress int(11), + IST_progress_readiness varchar(50), + E2E_progress_readiness varchar(50), + Key_Highlights varchar(200) +); + +-- +-- NAME: KPI_DRVOLUMES; TYPE: TABLE +-- +create table kpi_drvolumes ( + day date, + feedid int(11), + filespublished int(11), + bytespublished bigint(20), + filesdelivered int(11), + bytesdelivered bigint(20), + filesexpired int(11), + bytesexpired bigint(20), + PRIMARY KEY (day, feedid) +); + +-- +-- NAME: KPI_DRSUMM; TYPE: TABLE +-- +create table kpi_drsumm ( + day date PRIMARY KEY, + totalfeeds int(11), + activefeeds int(11), + activesubs int(11) +); + +-- +-- NAME: DEMO_KPI_SOURCECODE_STATS; TYPE: TABLE +-- +create table demo_kpi_sourcecode_stats ( + day date, + repo_name varchar(75), + category varchar(32), + total_lines int(11), + inserts int(11), + deletes int(11), + since date, + category1 varchar(50) +); + +-- FACELIFT - Table for Events, News and Resources + +create table fn_common_widget_data( + id int auto_increment, + CATEGORY varchar(100), + HREF varchar(500), + TITLE varchar(200), + content varchar(10000), + event_date varchar(200), + 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 if not exists 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), + unique key uk_1_fn_pers_user_app_sel_user_app (user_id, app_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 + +-- ---------------------------------------------------------- +-- 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); +-- ------------------ 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-BE/ecomp-portal-resources/sql scripts/EcompPortalDMLMySql_1610_Complete_OS.sql b/ecomp-portal-BE/ecomp-portal-resources/sql scripts/EcompPortalDMLMySql_1610_Complete_OS.sql new file mode 100644 index 00000000..8e1a4dfb --- /dev/null +++ b/ecomp-portal-BE/ecomp-portal-resources/sql scripts/EcompPortalDMLMySql_1610_Complete_OS.sql @@ -0,0 +1,225 @@ +-- --------------------------------------------------------------------------------------------------------------- +-- This is the default data for the 1610 Open Source 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 ('1','test role function'); +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 ('menu_test','Test 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_doclib','Document Library Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('doclib','Document Library'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('doclib_admin','Document Library Admin'); +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 ('menu_concept','CoNCEPT'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_itracker','iTracker Menu'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('view_reports','View Raptor reports'); +Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_itracker_admin','Itracker Admin/Support menu'); + +-- 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 + +-- -- 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_MENU_SET +Insert into fn_lu_menu_set (MENU_SET_CD,MENU_SET_NAME) values ('APP','Application Menu'); + +-- 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 ('zkau','menu_home'); +Insert into fn_restricted_url (restricted_url, function_cd) values ('itracker_assign.htm','menu_itracker'); +Insert into fn_restricted_url (restricted_url, function_cd) values ('itracker_byassignee.htm','menu_itracker'); +Insert into fn_restricted_url (restricted_url, function_cd) values ('itracker_create.htm','menu_itracker'); +Insert into fn_restricted_url (restricted_url, function_cd) values ('itracker_update.htm','menu_itracker'); +Insert into fn_restricted_url (restricted_url, function_cd) values ('manage_license.htm','menu_itracker'); +Insert into fn_restricted_url (restricted_url, function_cd) values ('support_ticket.htm','menu_itracker'); +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); + +-- 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,'doclib'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'doclib_admin'); +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_itracker'); +Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_itracker_admin'); +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 (1,'menu_test'); +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_itracker'); +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'); + +-- 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'); + +-- 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); + +-- cr_raptor_action_img +Insert into cr_raptor_action_img (IMAGE_ID, IMAGE_LOC) values ('DELETE', '/static/fusion/raptor/img/deleteicon.gif'); +Insert into cr_raptor_action_img (IMAGE_ID, IMAGE_LOC) values ('CALENDAR', '/static/fusion/raptor/img/Calendar-16x16.png'); + +-- 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,999,NULL,1); + +commit; \ No newline at end of file diff --git a/ecomp-portal-BE/pom.xml b/ecomp-portal-BE/pom.xml new file mode 100644 index 00000000..5ad4780c --- /dev/null +++ b/ecomp-portal-BE/pom.xml @@ -0,0 +1,612 @@ + + 4.0.0 + org.openecomp.portal + ecompportal + war + 1.0.0 + + + 4.2.0.RELEASE + 4.3.11.Final + 0.0.1 + 1.0.0 + UTF-8 + + false + **.js + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + false + org.umlgraph.doclet.UmlGraphDoc + + org.umlgraph + umlgraph + 5.6 + + -views + true + + + + + + + nexus + dav:https://ecomp-nexus:8443/repository/portal-javadoc/${projectversion} + + + + + + nexus-snapshots + Nexus Maven Central - Snapshots + https://ecomp-nexus:8443/repository/maven-snapshots/ + + + + nexus + Nexus Maven Central - Releases + https://ecomp-nexus:8443/repository/maven-releases/ + + + + oss-snapshots + oss Central - Snapshots + https://oss.sonatype.org/service/local/repositories/releases/content/ + + + central + Maven 2 repository 2 + http://repo2.maven.org/maven2/ + + + + + src/main/java + ecompportal + + + + org.codehaus.mojo + sonar-maven-plugin + 3.2 + + + org.apache.maven.plugins + maven-site-plugin + 3.6 + + + org.apache.maven.wagon + wagon-webdav-jackrabbit + 2.10 + + + + + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + + + + + maven-war-plugin + 2.6 + + war + false + + + true + + + ${build.number} + ${maven.build.timestamp} + + + + + + + + maven-resources-plugin + 3.0.1 + + + + copy-custom-properties1 + process-resources + + copy-resources + + + true + ${basedir}/war/WEB-INF/conf + + + ${basedir}/../../overrides + + system.properties + + + + + + + copy-custom-properties2 + process-resources + + copy-resources + + + true + ${basedir}/war/WEB-INF/fusion/conf + + + ${basedir}/../../overrides + + fusion.properties + + + + + + + copy-custom-properties3 + process-resources + + copy-resources + + + true + ${basedir}/src/main/resources + + + ${basedir}/../../overrides + + portal.properties + openid-connect.properties + openid-keystore.jwks + + + + + + + + + + + + src/test/java + + **/*Test*.* + + + + + + + src/main/resources + + **/*.xml + **/*.ccf + **/*.properties + **/*.jwks + + + + src/test/resources + + **/*.xml + **/*.properties + + + + + src/main/java + + **/*.xml + **/*.properties + + + + + + + + + com.att.eelf + eelf-core + ${eelf.version} + + + com.google.code.gson + gson + 2.5 + + + + + org.springframework + spring-core + ${springframework.version} + + + org.springframework + spring-web + ${springframework.version} + + + org.springframework + spring-webmvc + ${springframework.version} + + + org.springframework + spring-tx + ${springframework.version} + + + org.springframework + spring-context-support + ${springframework.version} + + + org.springframework + spring-orm + ${springframework.version} + + + org.springframework + spring-test + ${springframework.version} + + + org.springframework.boot + spring-boot-starter + 1.3.0.RELEASE + + + org.slf4j + log4j-over-slf4j + + + ch.qos.logback + logback-classic + + + + + + + org.hibernate + hibernate-core + ${hibernate.version} + + + + + + + org.hibernate + hibernate-validator + 5.1.3.Final + + + + javax.servlet + javax.servlet-api + 3.1.0 + + + javax.servlet.jsp + javax.servlet.jsp-api + 2.3.1 + + + javax.servlet + jstl + 1.2 + + + + + org.apache.tiles + tiles-core + 3.0.5 + + + org.apache.tiles + tiles-jsp + 3.0.5 + + + org.apache.cxf + cxf-rt-rs-client + 3.0.0-milestone1 + + + + + com.fasterxml.jackson.core + jackson-annotations + 2.6.3 + + + com.fasterxml.jackson.core + jackson-core + 2.6.3 + + + com.fasterxml.jackson.core + jackson-databind + 2.6.3 + + + + mysql + mysql-connector-java + 5.1.22 + + + + + org.elasticsearch + elasticsearch + 2.2.0 + + + io.searchbox + jest + 2.0.0 + + + + org.apache.jcs + jcs + 1.3 + + + * + * + + + + + + + org.apache.tomcat + tomcat-websocket + 8.0.28 + provided + + + + + + commons-lang + commons-lang + 2.6 + + + + org.apache.poi + poi + 3.5-FINAL + + + commons-logging + commons-logging + + + log4j + log4j + + + + + org.apache.poi + poi-ooxml + 3.5-FINAL + + + commons-logging + commons-logging + + + log4j + log4j + + + + + org.apache.poi + poi-scratchpad + 3.5-FINAL + + + commons-logging + commons-logging + + + log4j + log4j + + + + + org.apache.poi + poi-contrib + 3.5-FINAL + + + commons-logging + commons-logging + + + log4j + log4j + + + + + + + + org.quartz-scheduler + quartz + 2.2.1 + + + + c3p0 + c3p0 + + + + + + commons-codec + commons-codec + 1.9 + + + + com.att.nsa + cambriaClient + 0.0.1 + + + commons-logging + commons-logging + + + log4j + log4j + + + log4j + apache-log4j-extras + + + org.slf4j + slf4j-log4j12 + + + + + + org.openecomp.ecompsdkos + ecompFW + ${projectversion} + + + commons-logging + commons-logging + + + log4j + log4j + + + log4j + apache-log4j-extras + + + org.slf4j + slf4j-log4j12 + + + + + + org.openecomp.ecompsdkos + ecompSDK-core + ${projectversion} + + + + org.openecomp.ecompsdkos + ecompSDK-workflow + ${projectversion} + + + + + + org.apache.httpcomponents + httpclient + 4.5.2 + + + + + junit + junit + 4.11 + test + + + + commons-beanutils + commons-beanutils + 1.9.2 + + + + + org.mitre + openid-connect-client + 1.2.2 + + + org.codehaus.jackson + jackson-mapper-asl + + + + + + org.springframework.security + spring-security-taglibs + 3.2.8.RELEASE + + + org.springframework + * + + + + + + + diff --git a/ecomp-portal-BE/resources/META-INF/MANIFEST.MF b/ecomp-portal-BE/resources/META-INF/MANIFEST.MF new file mode 100644 index 00000000..718b0a8a --- /dev/null +++ b/ecomp-portal-BE/resources/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Class-Path: /WEB-INF/conf diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/LoginStrategy.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/LoginStrategy.java new file mode 100644 index 00000000..69bf5ec9 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/LoginStrategy.java @@ -0,0 +1,27 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/authentication/OpenIdConnectLoginStrategy.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/OpenIdConnectLoginStrategy.java new file mode 100644 index 00000000..75ade471 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/OpenIdConnectLoginStrategy.java @@ -0,0 +1,91 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portal.utils.EcompPortalUtils; +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.util.SystemProperties; +import org.springframework.util.StringUtils; + +public class OpenIdConnectLoginStrategy implements LoginStrategy { + + 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)); + + 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, "Exception occurred in preHandle() while redirecting, Details: " + EcompPortalUtils.getStackTrace(e)); + } + } + return false; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/SimpleLoginStrategy.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/SimpleLoginStrategy.java new file mode 100644 index 00000000..eb09dc08 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/authentication/SimpleLoginStrategy.java @@ -0,0 +1,101 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.utils.EPSystemProperties; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +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.crossapi.ECOMPSSO; +import org.openecomp.portalsdk.core.util.SystemProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; + +public class SimpleLoginStrategy implements LoginStrategy{ + + @Autowired + private EPLoginService loginService; + + 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 = null; + try{ + orgUserId = ECOMPSSO.getUserIdFromCookie(request); + } catch(Exception ex){ + logger.error(EELFLoggerDelegate.errorLogger, "Error getting User ID: '" + ex.getLocalizedMessage() + "'."); + } + + + 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(), ""); + 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, "Exception occurred in preHandle() while redirecting, Details: " + EcompPortalUtils.getStackTrace(e)); + } + } + + return false; + + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/command/EPLoginBean.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/command/EPLoginBean.java new file mode 100644 index 00000000..e3bb1433 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/command/EPLoginBean.java @@ -0,0 +1,186 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/command/PostSearchBean.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/command/PostSearchBean.java new file mode 100644 index 00000000..0f58807b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/command/PostSearchBean.java @@ -0,0 +1,373 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java new file mode 100644 index 00000000..5bcb4303 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java @@ -0,0 +1,311 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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.controller.LogoutController; +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 }, 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("/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, EcompPortalUtils.getStackTrace(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 addTileDefinitions() { + List definitions = new ArrayList(); + 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 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} + * @throws Exception + */ + + @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 + */ + // 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, EcompPortalUtils.getStackTrace(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 + */ + @Autowired + public void setSchedulerRegistryAdapter(final RegistryAdapter schedulerRegistryAdapter) { + this.schedulerRegistryAdapter = schedulerRegistryAdapter; + } + + + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java new file mode 100644 index 00000000..c1bc7cfa --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java @@ -0,0 +1,60 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java new file mode 100644 index 00000000..3eb88f9b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java @@ -0,0 +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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +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") }; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/ECOMPLogoutController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/ECOMPLogoutController.java new file mode 100644 index 00000000..13242c2e --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/ECOMPLogoutController.java @@ -0,0 +1,112 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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 +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/src/main/java/org/openecomp/portalapp/controller/EPFusionBaseController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPFusionBaseController.java new file mode 100644 index 00000000..f34fd078 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPFusionBaseController.java @@ -0,0 +1,106 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portal.utils.EcompPortalUtils; +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 { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPFusionBaseController.class); + + + + @Override + public boolean isAccessible() { + return true; + } + + public boolean isRESTfulCall() { + return true; + } + + @ModelAttribute("menu") + public Map messages(HttpServletRequest request) { + HttpSession session = null; + Map model = new HashMap(); + session = request.getSession(); + EPUser user = EPUserUtils.getUserSession(request); + if (session != null && user != null) { + @SuppressWarnings("unchecked") + Set menuResult = (Set) session + .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)); + try { + model = setMenu(menuResult); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + } + + return model; + } + + public Map setMenu(Set menuResult) throws Exception { + ObjectMapper mapper = new ObjectMapper(); + List> childItemList = new ArrayList>(); + ; + List parentList = new ArrayList(); + ; + Map model = new HashMap(); + for (MenuData menu : menuResult) { + MenuData parentData = new MenuData(); + parentData.setLabel(menu.getLabel()); + parentData.setAction(menu.getAction()); + parentData.setImageSrc(menu.getImageSrc()); + parentList.add(parentData); + List tempList = new ArrayList(); + 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", childItemList != null ? mapper.writeValueAsString(childItemList) : ""); + model.put("parentList", parentList != null ? mapper.writeValueAsString(parentList) : ""); + return model; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPRestrictedBaseController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPRestrictedBaseController.java new file mode 100644 index 00000000..286678cc --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPRestrictedBaseController.java @@ -0,0 +1,52 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/controller/EPRestrictedRESTfulBaseController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPRestrictedRESTfulBaseController.java new file mode 100644 index 00000000..69504a13 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPRestrictedRESTfulBaseController.java @@ -0,0 +1,54 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/controller/EPUnRestrictedBaseController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPUnRestrictedBaseController.java new file mode 100644 index 00000000..7f23ce4c --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/EPUnRestrictedBaseController.java @@ -0,0 +1,42 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/controller/LoginController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/LoginController.java new file mode 100644 index 00000000..632f9178 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/LoginController.java @@ -0,0 +1,356 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.controller; + +import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID; + +import java.net.URLDecoder; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.SharedContextService; +import org.openecomp.portalapp.portal.utils.EPSystemProperties; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalapp.service.EPProfileService; +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.crossapi.PortalTimeoutHandler; +import org.openecomp.portalsdk.core.util.CipherUtil; +import org.openecomp.portalsdk.core.util.SystemProperties; +import org.openecomp.portalsdk.core.web.support.AppUtils; +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{ + + 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"; + + @Autowired + EPProfileService service; + @Autowired + private EPLoginService loginService; + @Autowired + private SharedContextService sharedContextService; + + String viewName = "login"; + private String welcomeView; + + public String getWelcomeView() { + return welcomeView; + } + + public void setWelcomeView(String welcomeView) { + this.welcomeView = welcomeView; + } + + @RequestMapping(value = {"/login.htm" }, method = RequestMethod.GET) + public ModelAndView login(HttpServletRequest request, HttpServletResponse response) { + Map model = new HashMap(); + + String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM); + + String loginPage; + + if (authentication == null || authentication.equals("") || authentication.trim().equals("OIDC")) + loginPage = "openIdLogin"; + else + loginPage = getViewName(); + + return new ModelAndView(loginPage,"model", model); + } + + @SuppressWarnings("rawtypes") + @RequestMapping(value = {"/open_source/login" }, method = RequestMethod.POST) + public @ResponseBody 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 = EPUserUtils.getFullURL(request); + if (commandBean.getUser() == null) { + String loginErrorMessage = (commandBean.getLoginErrorMessage() != null) ? commandBean.getLoginErrorMessage() + : "login.error.external.invalid"; + + logger.info(EELFLoggerDelegate.debugLogger, "loginId = " + loginId + " does not exist in the the DB."); + logger.info(EELFLoggerDelegate.errorLogger, "loginId = " + loginId + " does not exist in the the DB."); + 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(), + null); + + try{ + logger.info(EELFLoggerDelegate.debugLogger, "******************* store user info into share context begins"); + String sessionId = request.getSession().getId(); + List existingSC = getSharedContextService().getSharedContexts(sessionId); + if(existingSC==null || existingSC.size()==0){ + 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.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + logger.info(EELFLoggerDelegate.errorLogger, "failed the shared context adding process " + e.getMessage()); + logger.info(EELFLoggerDelegate.debugLogger, "********************** failed the shared context adding process " + e.getMessage()); + } + logger.info(EELFLoggerDelegate.debugLogger, "********************* 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(); + + } + + } + + @RequestMapping(value = {"/processSingleSignOn" }, method = RequestMethod.GET) + public ModelAndView processSingelSignOn(HttpServletRequest request, HttpServletResponse response) throws Exception{ + + Map model = new HashMap(); + HashMap additionalParamsMap = new HashMap(); + EPLoginBean commandBean = new EPLoginBean(); + MDC.put(MDC_KEY_REQUEST_ID, EPUserUtils.getRequestId(request)); + String orgUserId = ""; + //get userId from cookie + orgUserId = SessionCookieUtil.getUserIdFromCookie(request, response); + logger.info(EELFLoggerDelegate.debugLogger, "******************** process_singelSignOn process begins"); + logger.info(EELFLoggerDelegate.debugLogger, "******************* We get the 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("redirectUrl")!=null && request.getParameter("redirectUrl").length()!=0){ + return new ModelAndView("redirect:" + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl=" + request.getParameter("redirectUrl")); + }else{ + return new ModelAndView("redirect:" + DEFAULT_FAILURE_VIEW + ".htm"); + } + } + else { + + StopWatch stopWatch = new StopWatch("LoginController.Login"); + stopWatch.start(); + + try { + logger.info(EELFLoggerDelegate.metricsLogger, "Operation findUser is started to locate " + orgUserId + " in the database."); + logger.info(EELFLoggerDelegate.debugLogger, "Operation findUser is started to locate " + orgUserId + " in the database."); + commandBean.setLoginId(orgUserId); + commandBean.setOrgUserId(orgUserId); + commandBean = getLoginService().findUserWithoutPassword(commandBean, (String)request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY), additionalParamsMap); + + stopWatch.stop(); + MDC.put(EPSystemProperties.MDC_TIMER, stopWatch.getTotalTimeMillis() + "ms"); + logger.info(EELFLoggerDelegate.metricsLogger, "Operation findUser is completed."); + 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, "Exception occurred while performing findUser " + orgUserId + ". Details: " + EcompPortalUtils.getStackTrace(e)); + logger.info(EELFLoggerDelegate.debugLogger, "Exception occurred while performing findUser " + orgUserId + ". Details: " + EcompPortalUtils.getStackTrace(e)); + logger.info(EELFLoggerDelegate.metricsLogger, "Operation findUser is failed."); + } finally { + MDC.remove(EPSystemProperties.MDC_TIMER); + } + + sbAdditionalInfo.append("Login attempt is succeeded. "); + String fullURL = EPUserUtils.getFullURL(request); + if (commandBean.getUser() == null) { + logger.info(EELFLoggerDelegate.debugLogger, "loginId = " + orgUserId + " does not exist in the the DB."); + logger.info(EELFLoggerDelegate.errorLogger, "loginId = " + orgUserId + " does not exist in the the DB."); + logger.info(EELFLoggerDelegate.debugLogger, "loginId = " + orgUserId + " does not exist in the the DB."); + + 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("redirectUrl")!=null && request.getParameter("redirectUrl").length()!=0){ + return new ModelAndView("redirect:" + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl=" + request.getParameter("redirectUrl")); + }else{ + return new ModelAndView("redirect:" + DEFAULT_FAILURE_VIEW + ".htm"); + } + } + else { + + sbAdditionalInfo.append(String.format("Login-Id: %s, Login-Method: %s, Request-URL: %s", orgUserId, "", fullURL)); + logger.info(EELFLoggerDelegate.debugLogger, "*********************** now set up user session for " + orgUserId); + + EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(), commandBean.getBusinessDirectMenu(), ""); + logger.info(EELFLoggerDelegate.debugLogger, "*********************** now set up user session for " + orgUserId + " finished"); + + //Store user's information into share context + try{ + logger.info(EELFLoggerDelegate.debugLogger, "******************* store user info into share context begins"); + + String sessionId = request.getSession().getId(); + List existingSC = getSharedContextService().getSharedContexts(sessionId); + if(existingSC==null || existingSC.size()==0){ + 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.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + logger.info(EELFLoggerDelegate.errorLogger, "failed the shared context adding process " + e.getMessage()); + logger.info(EELFLoggerDelegate.debugLogger, "********************** failed the shared context adding process " + e.getMessage()); + + } + + logger.info(EELFLoggerDelegate.debugLogger, "********************* PresetUp the EP service cookie and intial sessionManagement"); + + SessionCookieUtil.preSetUp(request, response); + SessionCookieUtil.setUpUserIdCookie(request, response, orgUserId); + logger.info(EELFLoggerDelegate.debugLogger, "********************* PresetUp the EP service cookie and intial sessionManagement completed"); + logger.info(EELFLoggerDelegate.errorLogger, commandBean.getUser().getOrgUserId() + " exists in the the system."); + logger.info(EELFLoggerDelegate.debugLogger, commandBean.getUser().getOrgUserId() + " exists in the the system."); + + String redirect = "redirectUrl"; + + //get redirectUrl from URL parameter + if(request.getParameter(redirect)!=null && request.getParameter(redirect).length()!=0){ + String forwardUrl = URLDecoder.decode(request.getParameter(redirect),"UTF-8"); + //clean cookie + Cookie cookie2 = new Cookie(redirect, ""); + cookie2.setMaxAge(0); + cookie2.setDomain(EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN)); + cookie2.setPath("/"); + response.addCookie(cookie2); + return new ModelAndView("redirect:" + forwardUrl); + } + + //first check if redirectUrl exists or not + if(WebUtils.getCookie(request, redirect)!=null){ + String forwardUrl = WebUtils.getCookie(request, redirect).getValue(); + //clean cookie + Cookie cookie2 = new Cookie(redirect, ""); + cookie2.setMaxAge(0); + cookie2.setDomain(EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN)); + cookie2.setPath("/"); + response.addCookie(cookie2); + + return new ModelAndView("redirect:" + forwardUrl); + } + } + } + + // if user has been authenticated, now take them to the welcome page. + //return new ModelAndView("redirect:" + DEFAULT_SUCCESS_VIEW + ".htm"); + logger.info(EELFLoggerDelegate.debugLogger, "********************** Now return to application home page"); + + return new ModelAndView("redirect:" + SystemProperties.getProperty(EPSystemProperties.FE_URL)); + + // + // Re-enable for BE/FE separation. For 1607, at last minute we decided to go out + // without BE/FE separation. + // + //return new ModelAndView("redirect:" + SystemProperties.getProperty(EPSystemProperties.FE_URL)); + + } + + public 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 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 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/src/main/java/org/openecomp/portalapp/controller/LoginService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/LoginService.java new file mode 100644 index 00000000..f69916a0 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/LoginService.java @@ -0,0 +1,36 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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, HttpServletResponse response); + + public @ResponseBody String loginValidate(HttpServletRequest request, HttpServletResponse response) throws Exception; + + public ModelAndView processSingelSignOn(HttpServletRequest request, HttpServletResponse response) throws Exception; + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/OpenCollaborationController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/OpenCollaborationController.java new file mode 100644 index 00000000..e360cce8 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/OpenCollaborationController.java @@ -0,0 +1,48 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.controller; + +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.openecomp.portalapp.portal.domain.EPUser; +import org.openecomp.portalapp.util.EPUserUtils; +import org.openecomp.portalsdk.core.controller.RestrictedBaseController; +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 OpenCollaborationController extends RestrictedBaseController{ + + @RequestMapping(value = {"/opencollaboration" }, method = RequestMethod.GET) + public ModelAndView view(HttpServletRequest request) { + Map model = new HashMap(); + EPUser user = (EPUser) EPUserUtils.getUserSession(request); + + model.put("name",(user.getFirstName() + " " + (user.getLastName() != null? user.getLastName().substring(0,1): "" ))); + return new ModelAndView("collaboration","model", model); + } + +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/PeerBroadcastSocket.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/PeerBroadcastSocket.java new file mode 100644 index 00000000..92dc9294 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/PeerBroadcastSocket.java @@ -0,0 +1,106 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 channelMap = new Hashtable(); + public Map sessionMap = new Hashtable(); + ObjectMapper mapper = new ObjectMapper(); + + @OnMessage + public void message(String message, Session session) { + try { + // JSONObject jsonObject = new JSONObject(message); + @SuppressWarnings("unchecked") + Map 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/src/main/java/org/openecomp/portalapp/controller/UserProfileController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/UserProfileController.java new file mode 100644 index 00000000..d7e50ebf --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/UserProfileController.java @@ -0,0 +1,77 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.controller; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.openecomp.portalapp.portal.logging.aop.EPAuditLog; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalapp.service.EPProfileService; +import org.openecomp.portalsdk.core.domain.Profile; +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.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.servlet.ModelAndView; + +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +@Controller +@RequestMapping("/") +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPAuditLog +public class UserProfileController extends EPRestrictedBaseController { + + @Autowired + EPProfileService service; + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserProfileController.class); + + @RequestMapping(value = {"/user_profile" }, method = RequestMethod.GET) + public ModelAndView ProfileSearch(HttpServletRequest request) { + Map model = new HashMap(); + ObjectMapper mapper = new ObjectMapper(); + + try { + List profileList = service.findAll(); + model.put("customerInfo", mapper.writeValueAsString(profileList)); + } catch (JsonGenerationException e) { + logger.error(EELFLoggerDelegate.errorLogger, "Encountered an JsonGenerationException while performing the ProfileSearch, Details:" + EcompPortalUtils.getStackTrace(e)); + } catch (JsonMappingException e) { + logger.error(EELFLoggerDelegate.errorLogger, "Encountered an JsonMappingException while performing the ProfileSearch, Details:" + EcompPortalUtils.getStackTrace(e)); + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger, "Encountered an IOException while performing the ProfileSearch, Details:" + EcompPortalUtils.getStackTrace(e)); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Encountered an Exception while performing the ProfileSearch, Details:" + EcompPortalUtils.getStackTrace(e)); + } + + return new ModelAndView("user_profile", "model", model); + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/WelcomeController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/WelcomeController.java new file mode 100644 index 00000000..264f0f59 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/WelcomeController.java @@ -0,0 +1,89 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 WelcomeController extends EPRestrictedBaseController{ + String viewName; + + @RequestMapping(value = {"/welcome" }, method = RequestMethod.GET) + public ModelAndView welcome(HttpServletRequest request) { + return new ModelAndView(getViewName()); + } + + @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" }, 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 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/src/main/java/org/openecomp/portalapp/controller/sessionmgt/SessionCommunicationController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/sessionmgt/SessionCommunicationController.java new file mode 100644 index 00000000..0348fb8d --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/controller/sessionmgt/SessionCommunicationController.java @@ -0,0 +1,64 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.service.sessionmgt.ManageService; +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.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@RequestMapping("/auxapi") +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPAuditLog +public class SessionCommunicationController extends EPRestrictedRESTfulBaseController { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionCommunicationController.class); + + @Autowired + ManageService manageService; + + protected boolean isAuxRESTfulCall(){ + return true; + } + + @RequestMapping(value={"/getSessionSlotCheckInterval"}, method = RequestMethod.GET, produces = "application/json") + public Integer getSessionSlotCheckInterval(HttpServletRequest request, HttpServletResponse response) throws Exception { + return manageService.fetchSessionSlotCheckInterval(); + } + + @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/src/main/java/org/openecomp/portalapp/kpidash/controller/KpiDashboardController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/controller/KpiDashboardController.java new file mode 100644 index 00000000..b3a4f0cb --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/controller/KpiDashboardController.java @@ -0,0 +1,268 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.kpidash.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.kpidash.model.KpiApiStats; +import org.openecomp.portalapp.kpidash.model.KpiServiceSupported; +import org.openecomp.portalapp.kpidash.model.KpiUserStoryStats; +import org.openecomp.portalapp.kpidash.service.KpiDashboardService; +import org.openecomp.portalapp.portal.domain.EPUser; +import org.openecomp.portalapp.portal.logging.aop.EPAuditLog; +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 +//@RequestMapping("/") +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPAuditLog +//public class KpiDashboardController extends EPUnRestrictedBaseController { +public class KpiDashboardController extends EPRestrictedBaseController { + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(KpiDashboardController.class); + + @Autowired + KpiDashboardService service; + + @SuppressWarnings("unchecked") + @RequestMapping(value = { "/portalApi/get_user_stories_stats" }, method = RequestMethod.GET, produces = "application/json") + public List getUserStories(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List userStories = null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + userStories = (List) service.getUserStories(); + EcompPortalUtils.logAndSerializeObject("/portalApi/get_user_stories_stats", "GET result =", userStories); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getUserApps operation, Details: " + EcompPortalUtils.getStackTrace(e)); + } + return userStories; + } + + @RequestMapping(value = { "/portalApi/save_user_stories_stats" }, method = RequestMethod.GET, produces = "application/json") + public void saveUserStories(@RequestBody KpiUserStoryStats kpiUserStoryStats) { + service.saveUserStories(kpiUserStoryStats); + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = { "/portalApi/update_user_stories_stats" }, method = RequestMethod.POST) + public List updateUserStories(@RequestBody KpiUserStoryStats kpiUserStoryStats) { + service.updateUserStories(kpiUserStoryStats); + return (List) service.getUserStories(); + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = { "/portalApi/get_user_api_stats" }, method = RequestMethod.GET, produces = "application/json") + public List getUserApis(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List apiStats = null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + apiStats = (List) service.getUserApis(); + EcompPortalUtils.logAndSerializeObject("/portalApi/get_user_api_stats", "GET result =", apiStats); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getUserApps operation, Details: " + EcompPortalUtils.getStackTrace(e)); + } + return apiStats; + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = { "/portalApi/get_kpi_service_supported" }, method = RequestMethod.GET, produces = "application/json") + public List getKpiServiceSupported(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List kpiServiceSupported = null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + kpiServiceSupported = (List) service.getKpiServiceSupported(); + EcompPortalUtils.logAndSerializeObject("/portalApi/get_kpi_service_supported", "GET result =", kpiServiceSupported); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getUserApps operation, Details: " + EcompPortalUtils.getStackTrace(e)); + } + return kpiServiceSupported; +// return (List) service.getKpiServiceSupported(); + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = { "/portalApi/update_user_api_stats" }, method = RequestMethod.POST) + public List updateUserApis(@RequestBody KpiApiStats kpiApiStats) { + service.updateUserApis(kpiApiStats); + return (List) service.getUserApis(); + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = { "/portalApi/execute_get_published_delivered" }, method = RequestMethod.GET, produces = "application/json") + public List getPublishedDelivered(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List publishedDelivered = null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + publishedDelivered = service.executeGetBytesPublishedDelivered(); + EcompPortalUtils.logAndSerializeObject("/portalApi/execute_get_published_delivered", "GET result =", publishedDelivered); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getLOCStatsCat operation, Details: " + EcompPortalUtils.getStackTrace(e)); + } + return publishedDelivered; + // return service.executeGetBytesPublishedDelivered(); + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = { "/portalApi/execute_get_feed_stats" }, method = RequestMethod.GET, produces = "application/json") + public List getFeedStats(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List feedStats= null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + feedStats = service.executeGetFeedStats(); + EcompPortalUtils.logAndSerializeObject("/portalApi/execute_get_feed_stats", "GET result =", feedStats); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getLOCStatsCat operation, Details: " + EcompPortalUtils.getStackTrace(e)); + } + return feedStats; +// return service.executeGetFeedStats(); + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = { "/portalApi/get_loc_stats_cat" }, method = RequestMethod.GET, produces = "application/json") + public List getLOCStatsCat(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List LOCStatsCat = null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + LOCStatsCat = service.getLOCStatsCat(); + EcompPortalUtils.logAndSerializeObject("/portalApi/get_loc_stats_cat", "GET result =", LOCStatsCat); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getLOCStatsCat operation, Details: " + EcompPortalUtils.getStackTrace(e)); + } + return LOCStatsCat; + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = { "/portalApi/get_loc_stats" }, method = RequestMethod.GET, produces = "application/json") + public List getLOCStats(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List LOCStats = null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + LOCStats = service.getLOCStats(); + EcompPortalUtils.logAndSerializeObject("/portalApi/get_loc_stats", "GET result =", LOCStats); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getLOCStats operation, Details: " + EcompPortalUtils.getStackTrace(e)); + } + return LOCStats; + } + + @RequestMapping(value = { "/portalApi/get_geo_map_url" }, method = RequestMethod.GET, produces = "text/plain") + public String getGeoMapUrl(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + String geoMapUrl = null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + geoMapUrl = service.getGeoMapUrl(); + EcompPortalUtils.logAndSerializeObject("/portalApi/get_geo_map_url", "GET result =", geoMapUrl); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getGeoMapUrl operation, Details: " + EcompPortalUtils.getStackTrace(e)); + } + + return geoMapUrl; + } + + @RequestMapping(value = { "/portalApi/get_rcloud_a_url" }, method = RequestMethod.GET, produces = "text/plain") + public String getRCloudAUrl(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + String rcloudUrl = null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + rcloudUrl = service.getRCloudAUrl(); + EcompPortalUtils.logAndSerializeObject("/portalApi/get_rcloud_a_url", "GET result =", rcloudUrl); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getGeoMapUrl operation, Details: " + EcompPortalUtils.getStackTrace(e)); + } + + return rcloudUrl; + } + + @RequestMapping(value = { "/portalApi/get_geo_map_api_url" }, method = RequestMethod.GET, produces = "text/plain") + public String getGeoMapApiUrl(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + String geoMapApiUrl = null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + geoMapApiUrl = service.getGeoMapApiUrl(); + EcompPortalUtils.logAndSerializeObject("/portalApi/get_geo_map_api_url", "GET result =", geoMapApiUrl); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getGeoMapApiUrl operation, Details: " + EcompPortalUtils.getStackTrace(e)); + } + + return geoMapApiUrl; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiApiStats.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiApiStats.java new file mode 100644 index 00000000..fb646ef5 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiApiStats.java @@ -0,0 +1,74 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.kpidash.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.openecomp.portalsdk.core.domain.support.DomainVo; + +@Entity +@Table(name = "kpi_api_stats") +public class KpiApiStats extends DomainVo { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "api_type") + private String apiType; + + @Column(name = "total_api") + private Long totalApi; + + @Column(name = "comment") + private String comment; + + public KpiApiStats() { + } + + public String getApiType() { + return apiType; + } + + public void setApiType(String apiType) { + this.apiType = apiType; + } + + public Long getTotalApi() { + return totalApi; + } + + public void setTotalApi(Long totalApi) { + this.totalApi = totalApi; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiServiceSupported.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiServiceSupported.java new file mode 100644 index 00000000..1e768390 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiServiceSupported.java @@ -0,0 +1,60 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.kpidash.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.openecomp.portalsdk.core.domain.support.DomainVo; + +@Entity +@Table(name = "kpi_service_supported") +public class KpiServiceSupported extends DomainVo { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "service_type") + private String serviceType; + + @Column(name = "total_count") + private Long totalCount; + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(Long totalCount) { + this.totalCount = totalCount; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiUserStoryStats.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiUserStoryStats.java new file mode 100644 index 00000000..e4337cca --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpiUserStoryStats.java @@ -0,0 +1,107 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.kpidash.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.openecomp.portalsdk.core.domain.support.DomainVo; + +@Entity +@Table(name = "kpi_user_story_stats1") +public class KpiUserStoryStats extends DomainVo { + /** + * + */ + private static final long serialVersionUID = -1193197465342848502L; + + @Id + @Column(name = "release_key") + private String releaseKey; + + @Column(name = "delivered") + private Long delivered; + + @Column(name = "in_progress") + private Long inProgress; + + @Column(name = "IST_progress_readiness") + private String ISTProgressReadiness; + + @Column(name = "E2E_progress_readiness") + private String E2EProgressReadiness; + + @Column(name = "Key_Highlights") + private String KeyHighlights; + + public KpiUserStoryStats() { + } + + public String getReleaseKey() { + return releaseKey; + } + + public void setReleaseKey(String releaseKey) { + this.releaseKey = releaseKey; + } + + public Long getDelivered() { + return delivered; + } + + public void setDelivered(Long delivered) { + this.delivered = delivered; + } + + public Long getInProgress() { + return inProgress; + } + + public void setInProgress(Long inProgress) { + this.inProgress = inProgress; + } + + public String getISTProgressReadiness() { + return ISTProgressReadiness; + } + + public void setISTProgressReadiness(String iSTProgressReadiness) { + ISTProgressReadiness = iSTProgressReadiness; + } + + public String getE2EProgressReadiness() { + return E2EProgressReadiness; + } + + public void setE2EProgressReadiness(String e2eProgressReadiness) { + E2EProgressReadiness = e2eProgressReadiness; + } + + public String getKeyHighlights() { + return KeyHighlights; + } + + public void setKeyHighlights(String keyHighlights) { + KeyHighlights = keyHighlights; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpidashProperties.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpidashProperties.java new file mode 100644 index 00000000..a6f81f4f --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/model/KpidashProperties.java @@ -0,0 +1,33 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.kpidash.model; + +import org.openecomp.portalsdk.core.util.SystemProperties; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; + +@Configuration +@PropertySource(value = { "${container.classpath:}/WEB-INF/conf/kpidash.properties" }) + +public class KpidashProperties extends SystemProperties { + public static final String GEO_MAP_URL = "url.sectiona"; + public static final String RCLOUD_A_URL = "url.sectionb"; + public static final String GEO_API_URL = "url.geomapapiurl"; +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/service/KpiDashboardService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/service/KpiDashboardService.java new file mode 100644 index 00000000..14892f67 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/service/KpiDashboardService.java @@ -0,0 +1,56 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.kpidash.service; + +import java.util.List; + +import org.openecomp.portalapp.kpidash.model.KpiApiStats; +import org.openecomp.portalapp.kpidash.model.KpiUserStoryStats; + +@SuppressWarnings("rawtypes") +public interface KpiDashboardService { + public List getUserStories(); + + public void saveUserStories(KpiUserStoryStats kpiUserStoryStats); + + public void updateUserStories(KpiUserStoryStats kpiUserStoryStats); + + public List getUserApis(); + + public void saveUserApis(KpiApiStats kpiApiStats); + + public void updateUserApis(KpiApiStats kpiApiStats); + + public List getKpiServiceSupported(); + + public List executeGetBytesPublishedDelivered(); + + public List executeGetFeedStats(); + + public List getLOCStatsCat(); + + public List getLOCStats(); + + public String getGeoMapUrl(); + + public String getRCloudAUrl(); + + public String getGeoMapApiUrl(); +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/service/KpiDashboardServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/service/KpiDashboardServiceImpl.java new file mode 100644 index 00000000..edbc54af --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/kpidash/service/KpiDashboardServiceImpl.java @@ -0,0 +1,180 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.kpidash.service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import org.openecomp.portalapp.kpidash.model.KpiApiStats; +import org.openecomp.portalapp.kpidash.model.KpiServiceSupported; +import org.openecomp.portalapp.kpidash.model.KpiUserStoryStats; +import org.openecomp.portalapp.kpidash.model.KpidashProperties; +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.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; + +@SuppressWarnings("rawtypes") +@Service("kpiDashboardService") +@Transactional +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPMetricsLog +public class KpiDashboardServiceImpl implements KpiDashboardService { + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(KpiDashboardServiceImpl.class); + + @Autowired + private DataAccessService dataAccessService; + + @Override + public void saveUserStories(KpiUserStoryStats kpiUserStoryStats) { + dataAccessService.saveDomainObject(kpiUserStoryStats, null); + } + + @Override + public void updateUserStories(KpiUserStoryStats kpiUserStoryStats) { + dataAccessService.saveDomainObject(kpiUserStoryStats, null); + } + + @Override + public List getUserStories() { + return dataAccessService.getList(KpiUserStoryStats.class, null); + } + + @Override + public List getUserApis() { + return dataAccessService.getList(KpiApiStats.class, null); + } + + @Override + public void saveUserApis(KpiApiStats kpiApiStats) { + // TODO Auto-generated method stub + + } + + @Override + public void updateUserApis(KpiApiStats kpiApiStats) { + dataAccessService.saveDomainObject(kpiApiStats, null); + } + + @Override + public List getKpiServiceSupported() { + return dataAccessService.getList(KpiServiceSupported.class, null); + } + + @Override + public List executeGetBytesPublishedDelivered() { + List list = dataAccessService.executeNamedQuery("getBytesPublishedDelivered", null, null); + List newStringList = new ArrayList(); + if (list != null && list.size() > 0) { + Object[] retunVals = (Object[]) list.get(0); // current entry in + // VSPEntAdmin table + newStringList.add((String) retunVals[0]); + newStringList.add((String) retunVals[1]); + } + return newStringList; + } + + @Override + public List executeGetFeedStats() { + List list = dataAccessService.executeNamedQuery("getDataRouterFeedStats", null, null); + List newLongList = new ArrayList(); + if (list != null && list.size() > 0) { + Object[] retunVals = (Object[]) list.get(0); // current entry in + // VSPEntAdmin table + newLongList.add((Long) retunVals[0]); + newLongList.add((Long) retunVals[1]); + newLongList.add((Long) retunVals[2]); + } + return newLongList; + } + + @Override + public List getLOCStatsCat() { + List list = dataAccessService.executeNamedQuery("getLOCStatsCat", null, null); + List newStringList = new ArrayList(); + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size(); i++) { + /* Object[] retunVals = (Object[]) list.get(i); */// current + // entry in + // VSPEntAdmin + // table + newStringList.add((String) list.get(i)); + } + } + return newStringList; + }; + + @Override + public List getLOCStats() { + List list = dataAccessService.executeNamedQuery("getLOCStats", null, null); + List newLongList = new ArrayList(); + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size(); i++) { + /* Object[] retunVals = (Object[]) list.get(i); */// current + // entry in + // VSPEntAdmin + // table + newLongList.add(((BigDecimal) list.get(i)).longValue()); + } + } + return newLongList; + }; + + @Override + public String getGeoMapUrl() { + String newURL = ""; + try { + newURL = KpidashProperties.getProperty(KpidashProperties.GEO_MAP_URL); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + return newURL; + } + + @Override + public String getRCloudAUrl() { + String newURL = ""; + try { + newURL = KpidashProperties.getProperty(KpidashProperties.RCLOUD_A_URL); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + return newURL; + } + + @Override + public String getGeoMapApiUrl() { + String newURL = ""; + try { + newURL = KpidashProperties.getProperty(KpidashProperties.GEO_API_URL); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + return newURL; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/model/Result.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/model/Result.java new file mode 100644 index 00000000..009d0fb3 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/model/Result.java @@ -0,0 +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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/controller/AppCatalogController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/AppCatalogController.java new file mode 100644 index 00000000..684c299f --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/AppCatalogController.java @@ -0,0 +1,124 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; + +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.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.portal.ecomp.model.AppCatalogItem; +import org.openecomp.portalapp.util.EPUserUtils; + +@RestController +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPAuditLog +public class AppCatalogController extends EPRestrictedBaseController { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppCatalogController.class); + + @Autowired + AdminRolesService adminRolesService; + @Autowired + EPAppService appService; + @Autowired + 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. + * + * @return List of items suitable for display + */ + @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.GET, produces = "application/json") + public List getAppCatalog(HttpServletRequest request, HttpServletResponse response) + throws IOException { + EPUser user = EPUserUtils.getUserSession(request); + List 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("/portalApi/getAppCatalog", "GET result =", appCatalog); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Failed in getAppCatalog", 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 + * @param selectRequest + * JSON with data including application ID + * @param response + * @return FieldsValidator + * @throws IOException + */ + @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, "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/src/main/java/org/openecomp/portalapp/portal/controller/AppContactUsController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/AppContactUsController.java new file mode 100644 index 00000000..308ab2f2 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/AppContactUsController.java @@ -0,0 +1,224 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.EPSystemProperties; +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 + * @return + */ + @RequestMapping(value = "/feedback", method = RequestMethod.GET, produces = "application/json") + public PortalRestResponse getPortalDetails(HttpServletRequest request) { + PortalRestResponse portalRestResponse = null; + try { + final String ticketUrl = SystemProperties.getProperty(EPSystemProperties.USH_TICKET_URL); + final String portalInfoUrl = SystemProperties.getProperty(EPSystemProperties.PORTAL_INFO_URL); + final String feedbackEmail = SystemProperties.getProperty(EPSystemProperties.FEEDBACK_EMAIL_ADDRESS); + HashMap map = new HashMap(); + map.put(EPSystemProperties.USH_TICKET_URL, ticketUrl); + map.put(EPSystemProperties.PORTAL_INFO_URL, portalInfoUrl); + map.put(EPSystemProperties.FEEDBACK_EMAIL_ADDRESS, feedbackEmail); + JSONObject j = new JSONObject(map); + String contactUsPortalResponse = j.toString(); + portalRestResponse = new PortalRestResponse(PortalRestStatusEnum.OK, "success", + contactUsPortalResponse); + } catch (Exception e) { + return new PortalRestResponse(PortalRestStatusEnum.ERROR, FAILURE, e.getMessage()); + } + return portalRestResponse; + } + + /** + * Answers the contents of the contact-us table, extended with the + * application name. + * + * @param request + * @return + */ + @RequestMapping(value = "/list", method = RequestMethod.GET, produces = "application/json") + public PortalRestResponse> getAppContactUsList(HttpServletRequest request) { + PortalRestResponse> portalRestResponse = null; + try { + List contents = contactUsService.getAppContactUs(); + portalRestResponse = new PortalRestResponse>(PortalRestStatusEnum.OK, "success", + contents); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "getAppContactUsList failed", e); + portalRestResponse = new PortalRestResponse>(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 + * @return + */ + @RequestMapping(value = "/allapps", method = RequestMethod.GET, produces = "application/json") + public PortalRestResponse> getAppsAndContacts(HttpServletRequest request) { + PortalRestResponse> portalRestResponse = null; + try { + List contents = contactUsService.getAppsAndContacts(); + portalRestResponse = new PortalRestResponse>(PortalRestStatusEnum.OK, "success", + contents); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "getAllAppsAndContacts failed", e); + portalRestResponse = new PortalRestResponse>(PortalRestStatusEnum.ERROR, + e.getMessage(), null); + } + return portalRestResponse; + } + + /** + * Sorts by category name. + */ + private Comparator appCategoryFunctionsItemComparator = new Comparator() { + @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 + * @return + */ + @RequestMapping(value = "/functions", method = RequestMethod.GET, produces = "application/json") + public PortalRestResponse> getAppCategoryFunctions(HttpServletRequest request) { + PortalRestResponse> portalRestResponse = null; + try { + List contents = contactUsService.getAppCategoryFunctions(); + // logger.debug(EELFLoggerDelegate.debugLogger, + // "getAppCategoryFunctions: result list size is " + + // contents.size()); + Collections.sort(contents, appCategoryFunctionsItemComparator); + portalRestResponse = new PortalRestResponse>(PortalRestStatusEnum.OK, + "success", contents); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "getAppCategoryFunctions failed", e); + // TODO build JSON error + portalRestResponse = new PortalRestResponse>(PortalRestStatusEnum.ERROR, + e.getMessage(), null); + } + return portalRestResponse; + } + + /** + * Accepts a new application's contact us details. + * + * @param contactUs + * @return + */ + @RequestMapping(value = "/save", method = RequestMethod.POST, produces = "application/json") + public PortalRestResponse save(@RequestBody AppContactUsItem contactUs) { + + if (contactUs == null || contactUs.getAppName() == null) + return new PortalRestResponse(PortalRestStatusEnum.ERROR, FAILURE, + "AppName cannot be null or empty"); + + String saveAppContactUs = FAILURE; + try { + saveAppContactUs = contactUsService.saveAppContactUs(contactUs); + } catch (Exception e) { + return new PortalRestResponse(PortalRestStatusEnum.OK, saveAppContactUs, e.getMessage()); + } + return new PortalRestResponse(PortalRestStatusEnum.ERROR, saveAppContactUs, ""); + } + + @RequestMapping(value = "/saveAll", method = RequestMethod.POST, produces = "application/json") + public PortalRestResponse save(@RequestBody List contactUsList) { + + String saveAppContactUs = FAILURE; + try { + saveAppContactUs = contactUsService.saveAppContactUs(contactUsList); + } catch (Exception e) { + return new PortalRestResponse(PortalRestStatusEnum.OK, saveAppContactUs, e.getMessage()); + } + return new PortalRestResponse(PortalRestStatusEnum.ERROR, saveAppContactUs, ""); + } + + /** + * Deletes the specified application's contact-us details entry from the + * table. + * + * @param id + * @return + */ + @RequestMapping(value = "/delete/{appid}", method = RequestMethod.POST, produces = "application/json") + public PortalRestResponse delete(@PathVariable("appid") Long id) { + + String saveAppContactUs = FAILURE; + try { + saveAppContactUs = contactUsService.deleteContactUs(id); + } catch (Exception e) { + return new PortalRestResponse(PortalRestStatusEnum.OK, saveAppContactUs, e.getMessage()); + } + return new PortalRestResponse(PortalRestStatusEnum.ERROR, saveAppContactUs, ""); + } + +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/AppsController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/AppsController.java new file mode 100644 index 00000000..f460ce4d --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/AppsController.java @@ -0,0 +1,470 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.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.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.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.json.JSONObject; +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.UserRole; +import org.openecomp.portalapp.portal.domain.UserRoles; +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.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; + +@RestController +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPAuditLog +public class AppsController extends EPRestrictedBaseController { + + static final String FAILURE = "failure"; + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsController.class); + + @Autowired + AdminRolesService adminRolesService; + @Autowired + EPAppService appService; + @Autowired + PersUserAppService persUserAppService; + @Autowired + UserService userService; + + /** + * RESTful service method to fetch all Applications available to watch for + * current user + * + * @return + */ + @RequestMapping(value = { "/portalApi/userApps" }, method = RequestMethod.GET, produces = "application/json") + public List getUserApps(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List ecompApps = null; + + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getUserApps"); + } else { + ecompApps = appService.transformAppsToEcompApps(appService.getUserApps(user)); + EcompPortalUtils.logAndSerializeObject("/portalApi/userApps", "GET result =", ecompApps); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, + "Exception occurred while performing getUserApps operation, Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + return ecompApps; + } + + /** + * Create new application's contact us details. + * + * @param contactUs + * @return + */ + @RequestMapping(value = "/portalApi/saveNewUser", method = RequestMethod.POST, produces = "application/json") + public PortalRestResponse saveNewUser(HttpServletRequest request,@RequestBody EPUser newUser) { + EPUser user = EPUserUtils.getUserSession(request); + if (newUser == null) + return new PortalRestResponse(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(PortalRestStatusEnum.ERROR, FAILURE, + "UnAuthorized"); + } + + String checkDuplicate = request.getParameter("isCheck"); + String saveNewUser = FAILURE; + try { + saveNewUser = userService.saveNewUser(newUser,checkDuplicate); + } catch (Exception e) { + return new PortalRestResponse(PortalRestStatusEnum.ERROR, saveNewUser, e.getMessage()); + } + return new PortalRestResponse(PortalRestStatusEnum.OK, saveNewUser, ""); + } + + /** + * RESTful service method to fetch all applications accessible to the + * current user, with personalizations. + * + * @return + */ + @RequestMapping(value = { "/portalApi/persUserApps" }, method = RequestMethod.GET, produces = "application/json") + public List getPersUserApps(HttpServletRequest request, HttpServletResponse response) throws IOException { + EPUser user = EPUserUtils.getUserSession(request); + List ecompApps = null; + try { + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getPersUserApps"); + } else { + List apps = null; + if (adminRolesService.isSuperAdmin(user)) + apps = appService.getPersAdminApps(user); + else + apps = appService.getPersUserApps(user); + ecompApps = appService.transformAppsToEcompApps(apps); + EcompPortalUtils.logAndSerializeObject("/portalApi/userPersApps", "GET result =", ecompApps); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Failed in getPersUserApps", 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 + * + * @return + */ + @RequestMapping(value = { "/portalApi/adminApps" }, method = RequestMethod.GET, produces = "application/json") + public List getAdminApps(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List adminApps = null; + + try { + if (!adminRolesService.isAccountAdmin(user)) { + EcompPortalUtils.setBadPermissions(user, response, "getAdminApps"); + } else { + adminApps = appService.getAdminApps(user); + EcompPortalUtils.logAndSerializeObject("/portalApi/adminApps", "GET result =", adminApps); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, + "Exception occurred while performing getAdminApps operation, Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + return adminApps; + } + + /** + * RESTful service method to fetch Applications in which the logged in user + * is an Administrator + * + * @return + */ + @RequestMapping(value = { + "/portalApi/appsForSuperAdminAndAccountAdmin" }, method = RequestMethod.GET, produces = "application/json") + public List getAppsForSuperAdminAndAccountAdmin(HttpServletRequest request, + HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List adminApps = null; + + try { + if (!adminRolesService.isSuperAdmin(user) && !adminRolesService.isAccountAdmin(user)) { + EcompPortalUtils.setBadPermissions(user, response, "getAdminApps"); + } else { + adminApps = appService.getAppsForSuperAdminAndAccountAdmin(user); + EcompPortalUtils.logAndSerializeObject("/portalApi/appsForSuperAdminAndAccountAdmin", "GET result =", + adminApps); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, + "Exception occurred while performing getAppsForSuperAdminAndAccountAdmin operation, Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + return adminApps; + } + + /** + * RESTful service method to fetch Application Administrators to Super + * Administrator user. Attention: Users which have Super Administrator roles + * only are not included! + * + * @return + */ + @RequestMapping(value = { "/portalApi/accountAdmins" }, method = RequestMethod.GET, produces = "application/json") + public List getAppsAdministrators(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List admins = null; + + try { + if (!adminRolesService.isSuperAdmin(user)) { + EcompPortalUtils.setBadPermissions(user, response, "getAppsAdministrators"); + } else { + admins = appService.getAppsAdmins(); + EcompPortalUtils.logAndSerializeObject("/portalApi/accountAdmins", "GET result =", admins); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, + "Exception occurred while performing getAppsAdministrators operation, Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + return admins; + } + + @RequestMapping(value = { "/portalApi/availableApps" }, method = RequestMethod.GET, produces = "application/json") + public List getApps(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List apps = null; + try { + if (!adminRolesService.isSuperAdmin(user)) { + EcompPortalUtils.setBadPermissions(user, response, "getApps"); + } else { + apps = appService.getAllApps(false); + EcompPortalUtils.logAndSerializeObject("/portalApi/availableApps", "GET result =", apps); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, + "Exception occurred while performing getApps operation, Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + return apps; + } + + /** + * Gets all apps, both active and inactive; i.e., all on-boarded apps, + * regardless of enabled status. + * + * @param request + * @param response + * @return List of applications + */ + // This API returns + @RequestMapping(value = { + "/portalApi/allAvailableApps" }, method = RequestMethod.GET, produces = "application/json") + public List getAllApps(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List apps = null; + try { + if (!adminRolesService.isSuperAdmin(user)) { + EcompPortalUtils.setBadPermissions(user, response, "getApps"); + } else { + apps = appService.getAllApps(true); + EcompPortalUtils.logAndSerializeObject("/portalApi/availableApps", "GET result =", apps); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Failed in getAllApps", e); + } + + return apps; + } + + @RequestMapping(value = { "/portalApi/appsFullList" }, method = RequestMethod.GET, produces = "application/json") + public List getAppsFullList(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List ecompApps = null; + if (user == null) { + EcompPortalUtils.setBadPermissions(user, response, "getAppsFullList"); + } else { + ecompApps = appService.getEcompAppAppsFullList(); + EcompPortalUtils.logAndSerializeObject("/portalApi/appsFullList", "GET result =", ecompApps); + } + + return ecompApps; + } + + @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 { + // Check database. + userAndRoles = appService.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.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); + } + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Failed to get user names and roles", e); + } + + EcompPortalUtils.logAndSerializeObject("/portalApi/userProfile", "getUserProfile result =", userAndRoles); + return userAndRoles; + } + + @RequestMapping(value = { "/portalApi/currentUserProfile/{loginId}" }, method = RequestMethod.GET, produces = "application/json") + public String getCurrentUserProfile(HttpServletRequest request, @PathVariable("loginId") String loginId) { + + Map map = new HashMap(); + 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(); + } + + @RequestMapping(value = { "/portalApi/appRoles/{appId}" }, method = { + RequestMethod.GET }, produces = "application/json") + public List getAppRoles(HttpServletRequest request, @PathVariable("appId") Long appId) { + List roleList = null; + try { + roleList = appService.getAppRoles(appId); + EcompPortalUtils.logAndSerializeObject("/portalApi/appRoles/" + appId, "GET result =", roleList); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, + "Exception occurred while performing getAppRoles operation, Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + return roleList; + } + + @RequestMapping(value = { "/portalApi/onboardingApps" }, method = RequestMethod.GET, produces = "application/json") + public List getOnboardingApps(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List onboardingApps = null; + try { + if (!adminRolesService.isSuperAdmin(user)) { + EcompPortalUtils.setBadPermissions(user, response, "getOnboardingApps"); + } else { + onboardingApps = appService.getOnboardingApps(); + EcompPortalUtils.logAndSerializeObject("/portalApi/onboardingApps", "GET result =", + "onboardingApps of size " + onboardingApps.size()); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, + "Exception occurred while performing getOnboardingApps operation, Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + return onboardingApps; + } + + @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, + "Exception occurred while performing putOnboardingApps operation, Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + EcompPortalUtils.logAndSerializeObject("/portalApi/onboardingApps", "PUT result =", response.getStatus()); + 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, + "Exception occurred while performing postOnboardingApps operation, Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + EcompPortalUtils.logAndSerializeObject("/portalApi/onboardingApps", "POST result =", response.getStatus()); + 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, EcompPortalUtils.getStackTrace(e)); + } + + EcompPortalUtils.logAndSerializeObject("/portalApi/onboardingApps" + appId, "DELETE result =", + response.getStatus()); + return fieldsValidator; + } +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/DashboardController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/DashboardController.java new file mode 100644 index 00000000..74b85acb --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/DashboardController.java @@ -0,0 +1,361 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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.portal.utils.EPSystemProperties; +import org.openecomp.portalapp.util.EPUserUtils; +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.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. + */ +@RestController +@RequestMapping("/portalApi/dashboard") +public class DashboardController extends EPRestrictedBaseController { + + private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DashboardController.class); + + @Autowired + private DashboardSearchService searchService; + + 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. + * + * @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 getWidgetData(HttpServletRequest request, + @RequestParam String resourceType) { + if (!isValidResourceType(resourceType)) + return new PortalRestResponse(PortalRestStatusEnum.ERROR, + "Unexpected resource type " + resourceType, null); + return new PortalRestResponse(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 saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) { + logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta); + if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals("")) + return new PortalRestResponse(PortalRestStatusEnum.ERROR, "ERROR", + "Category cannot be null or empty"); + if (!isValidResourceType(commonWidgetMeta.getCategory())) + return new PortalRestResponse(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(PortalRestStatusEnum.ERROR, err, null); + } + return new PortalRestResponse(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 saveWidgetData(@RequestBody CommonWidget commonWidget) { + logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget); + if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().equals("")) + return new PortalRestResponse(PortalRestStatusEnum.ERROR, "ERROR", + "Category cannot be null or empty"); + String err = validateCommonWidget(commonWidget); + if (err != null) + return new PortalRestResponse(PortalRestStatusEnum.ERROR, err, null); + return new PortalRestResponse(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 deleteWidgetData(@RequestBody CommonWidget commonWidget) { + logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget); + return new PortalRestResponse(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 = "/search", method = RequestMethod.GET, produces = "application/json") + public PortalRestResponse>> 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>()); + } else if (searchString == null || searchString.length() == 0) { + return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "searchPortal: String string is null", + new HashMap>()); + } else { + logger.debug(EELFLoggerDelegate.debugLogger, "searchPortal: user {}, search string '{}'", + user.getLoginId(), searchString); + Map> 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>()); + } + } + + /** + * Gets all active users. + * + * @param request + * @return Rest response wrapped around a list of String + */ + @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json") + public PortalRestResponse> getActiveUsers(HttpServletRequest request) { + List activeUsers = null; + List onlineUsers = new ArrayList<>(); + try { + EPUser user = EPUserUtils.getUserSession(request); + String userId = user.getOrgUserId(); + + activeUsers = searchService.getRelatedUserVOs(userId); + HashSet usersSet = CollaborateList.getInstance().getAllUserName(); + for (Object[] users : activeUsers) { + if (usersSet.contains(users[0])) { + onlineUsers.add(users); + } + } + return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", onlineUsers); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "getActiveUsers failed", e); + return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null); + } + // 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> getOnlineUserUpdateRate(HttpServletRequest request) { + PortalRestResponse portalRestResponse = null; + try { + String updateRate = SystemProperties.getProperty(EPSystemProperties.ONLINE_USER_UPDATE_RATE); + String updateDuration = SystemProperties.getProperty(EPSystemProperties.ONLINE_USER_UPDATE_DURATION); + Integer rateInMiliSec = Integer.valueOf(updateRate)*1000; + Integer durationInMiliSec = Integer.valueOf(updateDuration)*1000; + Map results = new HashMap(); + 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> getWindowWidthThresholdForRightMenu(HttpServletRequest request) { + PortalRestResponse portalRestResponse = null; + try { + String windowWidthString = SystemProperties.getProperty(EPSystemProperties.WINDOW_WIDTH_THRESHOLD_RIGHT_MENU); + Integer windowWidth = Integer.valueOf(windowWidthString); + Map results = new HashMap(); + 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> getWindowWidthThresholdForLeftMenu(HttpServletRequest request) { + PortalRestResponse portalRestResponse = null; + try { + String windowWidthString = SystemProperties.getProperty(EPSystemProperties.WINDOW_WIDTH_THRESHOLD_LEFT_MENU); + Integer windowWidth = Integer.valueOf(windowWidthString); + Map results = new HashMap(); + 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> 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/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java new file mode 100644 index 00000000..d6052bcb --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java @@ -0,0 +1,243 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 getWidgetData(HttpServletRequest request, + @RequestParam String resourceType) { + return new PortalRestResponse(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 saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) { + logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta); + if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals("")) + return new PortalRestResponse(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(PortalRestStatusEnum.ERROR, err, null); + } + return new PortalRestResponse(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 saveWidgetData(@RequestBody CommonWidget commonWidget) { + logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget); + if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().equals("")) + return new PortalRestResponse(PortalRestStatusEnum.ERROR, "ERROR", + "Cateogry cannot be null or empty"); + String err = validateCommonWidget(commonWidget); + if (err != null) + return new PortalRestResponse(PortalRestStatusEnum.ERROR, err, null); + return new PortalRestResponse(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 deleteWidgetData(@RequestBody CommonWidget commonWidget) { + logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget); + return new PortalRestResponse(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>> 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>()); + } else if (searchString == null || searchString.trim().length() == 0) { + return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "searchPortal: String string is null", + new HashMap>()); + } else { + logger.debug(EELFLoggerDelegate.debugLogger, "searchPortal: user {}, search string '{}'", + user.getLoginId(), searchString); + Map> 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>()); + } + } + + /** + * 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 getActiveUsers(HttpServletRequest request) { + List activeUsers = null; + List onlineUsers = new ArrayList<>(); + try { + EPUser user = EPUserUtils.getUserSession(request); + String userId = user.getOrgUserId(); + + activeUsers = searchService.getRelatedUsers(userId); + HashSet 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> 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/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java new file mode 100644 index 00000000..08804a07 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java @@ -0,0 +1,128 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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("/auxapi") +@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 getFavoritesForUser(HttpServletRequest request, HttpServletResponse response) throws Exception { + String loginId = ""; + String userAgent = ""; + List 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 getFunctionalMenuItemsForUser(HttpServletRequest request, HttpServletResponse response) throws Exception { + String loginId = ""; + String userAgent = ""; + List 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/src/main/java/org/openecomp/portalapp/portal/controller/FunctionalMenuController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/FunctionalMenuController.java new file mode 100644 index 00000000..6c69fde9 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/FunctionalMenuController.java @@ -0,0 +1,436 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.controller; + +import java.text.SimpleDateFormat; +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.apache.cxf.transport.http.HTTPException; +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.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.FunctionalMenuItemJson; +import org.openecomp.portalapp.portal.utils.EPSystemProperties; +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.service.UserProfileService; +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 FunctionalMenuController extends EPRestrictedBaseController { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuController.class); + + @Autowired + AdminRolesService adminRolesService; + @Autowired + FunctionalMenuService functionalMenuService; + @Autowired + SharedContextService sharedContextService; + + @Autowired + UserProfileService service; + + @Autowired + SearchService searchService; + + /** + * RESTful service method to fetch all the FunctionalMenuItems. + * + * @return + */ + @RequestMapping(value = { "/portalApi/functionalMenu" }, method = RequestMethod.GET, produces = "application/json") + public List getMenuItems(HttpServletRequest request, HttpServletResponse response) { + // TODO: should only the superuser be allowed to use this API? + List menuItems = null; + try{ + menuItems = functionalMenuService.getFunctionalMenuItems(); + functionalMenuService.assignHelpURLs(menuItems); + EcompPortalUtils.logAndSerializeObject("/portalApi/functionalMenu", "result =", menuItems); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while calling functionalMenu. Details: " + + EcompPortalUtils.getStackTrace(e)); + } + return menuItems; + } + + + /** + * RESTful service method to fetch all the FunctionalMenuItems, both active and inactive, + * for the EditFunctionalMenu feature. + * Can only be accessed by the portal admin. + * + * @return + */ + @RequestMapping(value = { "/portalApi/functionalMenuForEditing" }, method = RequestMethod.GET, produces = "application/json") + public List getMenuItemsForEditing(HttpServletRequest request, HttpServletResponse response) { + // TODO: should only the superuser be allowed to use this API? + EPUser user = EPUserUtils.getUserSession(request); + List menuItems = null; + try{ + if (!adminRolesService.isSuperAdmin(user)) { + EcompPortalUtils.setBadPermissions(user, response, "getFunctionalMenuItemDetails"); + } else { + menuItems = functionalMenuService.getFunctionalMenuItems(true); + } + EcompPortalUtils.logAndSerializeObject("/portalApi/functionalMenuForEditing", "result =", menuItems); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while calling functionalMenuForEditing. Details: " + + EcompPortalUtils.getStackTrace(e)); + } + return menuItems; + } + + /** + * RESTful service method to fetch all FunctionalMenuItems associated with an application. + * + * @return + */ + @RequestMapping(value = { "/portalApi/functionalMenuForApp/{appId}" }, method = RequestMethod.GET, produces = "application/json") + public List getMenuItemsForApp(HttpServletRequest request, @PathVariable("appId") Integer appId) throws HTTPException { + // TODO: should only the superuser be allowed to use this API? + List menuItems = null; + try{ + menuItems = functionalMenuService.getFunctionalMenuItemsForApp(appId); + functionalMenuService.assignHelpURLs(menuItems); + EcompPortalUtils.logAndSerializeObject("/portalApi/functionalMenuForApp/"+appId, "result =", menuItems); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while calling functionalMenuForApp. Details: " + + EcompPortalUtils.getStackTrace(e)); + } + return menuItems; + } + + /** + * RESTful service method to fetch all FunctionalMenuItems associated with the applications + * and roles that a user has access to. + * + * @return + */ + + @RequestMapping(value = { "/portalApi/functionalMenuForUser/{userId}" }, method = RequestMethod.GET, produces = "application/json") + public List getMenuItemsForUser(HttpServletRequest request, @PathVariable("userId") String userId) throws HTTPException { + // TODO: should only the superuser be allowed to use this API? + List menuItems = null; + try{ + menuItems = functionalMenuService.getFunctionalMenuItemsForUser(userId); + functionalMenuService.assignHelpURLs(menuItems); + EcompPortalUtils.logAndSerializeObject("/portalApi/functionalMenuForUser/"+userId, "result =", menuItems); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while calling functionalMenuForUser. Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + return menuItems; + } + + /** + * RESTful service method to fetch all FunctionalMenuItems associated with the applications + * and roles that the authenticated user has access to. + * + * @return + */ + + @RequestMapping(value = { "/portalApi/functionalMenuForAuthUser" }, method = RequestMethod.GET, produces = "application/json") + public List getMenuItemsForAuthUser(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List 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("/portalApi/functionalMenuForUser/"+orgUserId, "result =", menuItems); + } + functionalMenuService.assignHelpURLs(menuItems); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while calling getMenuItemsForAuthUser. Details: " + + EcompPortalUtils.getStackTrace(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. + * + * @return + */ + + @RequestMapping(value = { "/portalApi/functionalMenuItemDetails/{menuId}" }, method = RequestMethod.GET, produces = "application/json") + public FunctionalMenuItem getFunctionalMenuItemDetails(HttpServletRequest request, @PathVariable("menuId") Integer menuId, HttpServletResponse response) throws HTTPException { + // 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("/portalApi/functionalMenuItemDetails/"+menuId, "result =", menuItem); + } + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while calling functionalMenuItemDetails. Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + return menuItem; + } + + /** + * RESTful service method to create a new menu item. + * Requirement: you must be the Ecomp portal super admin user. + */ + + @RequestMapping(value={"/portalApi/functionalMenuItem"}, method = RequestMethod.POST) + public FieldsValidator createFunctionalMenuItem(HttpServletRequest request, @RequestBody FunctionalMenuItemJson 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("/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. + */ + + @RequestMapping(value={"/portalApi/functionalMenuItem"}, method = RequestMethod.PUT) + public FieldsValidator editFunctionalMenuItem(HttpServletRequest request, @RequestBody FunctionalMenuItemJson 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("/portalApi/functionalMenuItem", "PUT result =", response.getStatus()); + } + + 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("/portalApi/functionalMenuItem", "DELETE result =", response.getStatus()); + } + + 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("/portalApi/regenerateAncestorTable", "GET result =", response.getStatus()); + } + + 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("/portalApi/setFavoriteItem", "Post result =", response.getStatus()); + + return fieldsValidator; + } + + + @RequestMapping(value={"/portalApi/getFavoriteItems"}, method = RequestMethod.GET,produces = "application/json") + public List getFavoritesForUser(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List favorites = functionalMenuService.getFavoriteItems(user.getId()); + FieldsValidator fieldsValidator = new FieldsValidator(); + response.setStatus(fieldsValidator.httpStatusCode.intValue()); + EcompPortalUtils.logAndSerializeObject("/portalApi/getFavoriteItems", "GET result =", response.getStatus()); + + return favorites; + } + + @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("/deleteFavoriteItem", "DELETE result =", response.getStatus()); + + return fieldsValidator; + } + + @RequestMapping(value = {"/portalApi/functionalMenuStaticInfo" }, method = RequestMethod.GET,produces = "application/json") + public String functionalMenuStaticInfo(HttpServletRequest request, HttpServletResponse response) { + + /*Getting first name, last name, and email from session*/ + logger.debug(EELFLoggerDelegate.debugLogger, "getting functionalMenuStaticInfo values from session"); + Map map = new HashMap(); + String sessionId = request.getSession().getId(); + SharedContext userIdSC = null , firstNameSC = null, lastNameSC = null, emailSC = null; + String userIdStr= null, firstNameStr= null, lastNameStr = null, emailStr = null; + EPUser user = EPUserUtils.getUserSession(request); + String contact_us_link = null; + String last_login = null; + try{ + contact_us_link = SystemProperties.getProperty(EPSystemProperties.CONTACT_US_URL); + SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); + Date lastLoginDate = user.getLastLoginDate(); + last_login =sdf.format(lastLoginDate);// sdf.parse(lastLoginDate.); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "CONTACT_US_URL is missing in property file! Details: " + EcompPortalUtils.getStackTrace(e)); + } + + try{ + if (user!=null) { + firstNameStr = user.getFirstName(); + lastNameStr = user.getLastName(); + userIdStr = user.getOrgUserId(); + emailStr = user.getEmail(); + /*if(emailStr==null || emailStr.equals("")){ + EPUser userResult = searchService.searchUsersByUserId(user); //.searchUserByUserId(userIdStr); + emailStr = userResult.getEmail(); + } */ + } else { + logger.warn(EELFLoggerDelegate.errorLogger, "Unable to locate the user information in the session. LoginId: " + MDC.get(EPSystemProperties.MDC_LOGIN_ID)); + } + + /*If failed getting from session, then get the values from Shared Context*/ + if(firstNameStr==null) + firstNameSC = sharedContextService.getSharedContext(sessionId,EPSystemProperties.USER_FIRST_NAME); + if(lastNameStr==null) + lastNameSC = sharedContextService.getSharedContext(sessionId,EPSystemProperties.USER_LAST_NAME); + if(emailStr==null) + emailSC = sharedContextService.getSharedContext(sessionId,EPSystemProperties.USER_EMAIL); + if(userIdStr==null) + userIdSC = sharedContextService.getSharedContext(sessionId,EPSystemProperties.USER_ORG_USERID); + + /*Getting Contact Us link from properties file*/ + + 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", userIdStr!=null?userIdStr:(userIdSC!=null?userIdSC.getCvalue():null)); + map.put("last_login",last_login); + map.put("contact_us_link",contact_us_link); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while getting values : " + EcompPortalUtils.getStackTrace(e)); + } + + JSONObject j = new JSONObject(map); + String fnMenuStaticResponse = ""; + try { + fnMenuStaticResponse = j.toString(); + // response.getWriter().write(fnMenuStaticResponse); + EcompPortalUtils.logAndSerializeObject("/portalApi/functionalMenuStaticInfo", "GET result =", fnMenuStaticResponse); + } catch(Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while writing the result to the HttpServletResponse object. Details: " + + EcompPortalUtils.getStackTrace(e)); + } + return fnMenuStaticResponse; + } + + @RequestMapping(value = {"/portalApi/resetFunctionalMenuStaticInfo" }, method = RequestMethod.GET,produces = "application/json") + public PortalRestResponse> resetFunctionalMenuStaticInfo(HttpServletRequest request, HttpServletResponse response) { + PortalRestResponse portalRestResponse = null; + try { + // get current user + EPUser user = EPUserUtils.getUserSession(request); + String userId = user.getOrgUserId(); + StringBuffer criteria = new StringBuffer(); + criteria.append(" where org_user_id = '").append(userId).append("'"); + // retrieve latest user info from EPUser + List list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null); + EPUser updatedUser = (EPUser)list.get(0); + EPUserUtils.setUserSession(request, updatedUser, new HashSet(), new HashSet(), SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)); + return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", null); + } + catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "getOnlineUserUpdateRate failed", e); + return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null); + } + + } +} + diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/GetAccessController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/GetAccessController.java new file mode 100644 index 00000000..5fe22194 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/GetAccessController.java @@ -0,0 +1,70 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.openecomp.portalapp.controller.EPUnRestrictedBaseController; +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.portalsdk.core.logging.logic.EELFLoggerDelegate; +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 +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPAuditLog +public class GetAccessController extends EPUnRestrictedBaseController { + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(GetAccessController.class); + + @Autowired + GetAccessService getAccessService; + + /** + * Sorts the list by ECOMP function name. + */ + private Comparator getAccessComparator = new Comparator() { + public int compare(GetAccessResult o1, GetAccessResult o2) { + return o1.getEcompFunction().compareTo(o2.getEcompFunction()); + } + }; + + @RequestMapping(value = { "/portalApi/getAppList" }, method = RequestMethod.GET, produces = "application/json") + public List getAppList(HttpServletRequest request) throws IOException { + List appsList = null; + appsList = getAccessService.getAppAccessList(); + Collections.sort(appsList, getAccessComparator); + EcompPortalUtils.logAndSerializeObject("/portalApi/getAppList", "result =", appsList); + return appsList; + } +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/HealthCheckController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/HealthCheckController.java new file mode 100644 index 00000000..a3870517 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/HealthCheckController.java @@ -0,0 +1,234 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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.EPSystemProperties; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +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 com.google.gson.Gson; + +/* + * This controller checks the health status and returns JSON response. + * It does not require + */ +@RestController +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPAuditLog +public class HealthCheckController extends EPRestrictedBaseController { + + 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"; + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HealthCheckController.class); + + @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(EPSystemProperties.RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR)); + return healthStatus; + } + + try { + boolean overallStatus = true; + + List statusCollection = new ArrayList(); + + 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(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(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(EPAppMessagesEnum.BeDaoSystemError); + } + + if (!HealthMonitor.isClusterStatusOk()) { + dbInfo.dbClusterStatus = "Problem, check the logs for more details"; + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + } + else { + dbInfo.dbClusterStatus = statusOk; + } + + if (!HealthMonitor.isDatabasePermissionsOk()) { + dbInfo.dbPermissions = "Problem, check the logs for more details"; + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + } + else { + dbInfo.dbPermissions = statusOk; + } + statusCollection.add(dbInfo); + + HealthStatusInfo uebInfo = new HealthStatusInfo("UEB"); + if (!HealthMonitor.isUebUp()) { + uebInfo.healthCheckStatus = statusDown; + uebInfo.description = "Check the logs for more details"; + EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebConnectionError); + } + statusCollection.add(uebInfo); + + String json = ""; + try { + json = new Gson().toJson(statusCollection); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(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(EPSystemProperties.RESPONSE_CODE, Integer.toString(healthStatus.statusCode)); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing the healthcheck. Details: " + + EcompPortalUtils.getStackTrace(e)); + } + + EcompPortalUtils.logAndSerializeObject("/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("/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("/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("/portalApi/ping", "GET result =", + response.getStatus()); + + return healthStatus; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/ManifestController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/ManifestController.java new file mode 100644 index 00000000..ae8dc57b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/ManifestController.java @@ -0,0 +1,93 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.openecomp.portalapp.portal.logging.aop.EPAuditLog; +import org.openecomp.portalapp.portal.service.ManifestService; +import org.openecomp.portalsdk.core.controller.RestrictedBaseController; +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.stereotype.Controller; +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; + + + +/** + * 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 +@EnableAspectJAutoProxy +@RequestMapping("/") +@EPAuditLog +@Controller +public class ManifestController extends RestrictedBaseController { + + private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManifestController.class); + + @Autowired + ManifestService manifestService; + + /** + * Gets the webapp manifest contents as a JSON object. + * + * @param request + * @return A map of key-value pairs. On success: + * + *
+	 * { "manifest" : { "key1": "value1", "key2": "value2" } }
+	 *         
+ * + * On failure: + * + *
+	 * { "error": "message" }
+	 *         
+ */ + @RequestMapping(value = { "/portalApi/manifest" }, method = RequestMethod.GET, produces = "application/json") + @ResponseBody + public Map getManifest(HttpServletRequest request) { + Map response = new HashMap(); + 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; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java new file mode 100644 index 00000000..951c0534 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java @@ -0,0 +1,117 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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 getPortalAdmins(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List 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; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/SharedContextRestController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/SharedContextRestController.java new file mode 100644 index 00000000..d2f94e52 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/SharedContextRestController.java @@ -0,0 +1,335 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.EPSystemProperties; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +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.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; + +/** + * 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. + * + * TODO: This extends EPRestrictedRESTfulBaseController which is an exact copy + * of org.openecomp.portalsdk.core.controller.RestrictedRESTfulBaseController. + */ + +@RestController +@RequestMapping("/context") +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPAuditLog +public class SharedContextRestController extends EPRestrictedRESTfulBaseController { + /** + * Access to the database + */ + @Autowired + SharedContextService contextService; + + /** + * Logger for debug etc. + */ + 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 ctxtId + * 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. + */ + @RequestMapping(value = { "/get" }, method = RequestMethod.GET, produces = "application/json") + public String getContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey) throws Exception { + String jsonResponse = ""; + + 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); + if (context == null) { + jsonResponse = convertResponseToJSON(context); + } else { + jsonResponse = mapper.writeValueAsString(context); + } + + return jsonResponse; + } + + /** + * Gets user information for the specified context (RESTful service method). + * + * @param ctxtId + * ID that identifies the context, usually the ECOMP Portal + * session key. + * + * @return JSON with user's first name, last name and email address; null if + * none found + */ + @RequestMapping(value = { "/get_user" }, method = RequestMethod.GET, produces = "application/json") + public String getUserContext(HttpServletRequest request, @RequestParam String context_id) throws Exception { + String jsonResponse = ""; + List listSharedContext = new ArrayList(); + try{ + logger.debug(EELFLoggerDelegate.debugLogger, "getUserContext for ID " + context_id); + if (context_id == null) { + throw new Exception("Received null for contextId"); + } + try{ + SharedContext firstNameContext = contextService.getSharedContext(context_id, EPSystemProperties.USER_FIRST_NAME); + SharedContext lastNameContext = contextService.getSharedContext(context_id, EPSystemProperties.USER_LAST_NAME); + SharedContext emailContext = contextService.getSharedContext(context_id, EPSystemProperties.USER_EMAIL); + SharedContext userIdContext = contextService.getSharedContext(context_id, EPSystemProperties.USER_ORG_USERID); + if (firstNameContext != null) + listSharedContext.add(firstNameContext); + if (lastNameContext != null) + listSharedContext.add(lastNameContext); + if (emailContext != null) + listSharedContext.add(emailContext); + if (userIdContext != null) + listSharedContext.add(userIdContext); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Error while getting SharedContext values from database ... ",e); + } + jsonResponse = convertResponseToJSON(listSharedContext); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Error while running getUserContext request ... ", e); + } + return jsonResponse; + } + + /** + * Tests for presence of the specified key in the specified context (RESTful + * service method). + * + * @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. + */ + @RequestMapping(value = { "/check" }, method = RequestMethod.GET, produces = "application/json") + public String checkContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey) throws Exception { + String jsonResponse = ""; + + 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"; + + jsonResponse = convertResponseToJSON(response); + + return jsonResponse; + } + + /** + * Removes the specified key in the specified context (RESTful service + * method). + * + * @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. + */ + @RequestMapping(value = { "/remove" }, method = RequestMethod.GET, produces = "application/json") + public String removeContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey) throws Exception { + String jsonResponse = ""; + + 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"; + } + + jsonResponse = convertResponseToJSON(response); + + return jsonResponse; + } + + /** + * Clears all key-value pairs in the specified context (RESTful service + * method). + * + * @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. + */ + @RequestMapping(value = { "/clear" }, method = RequestMethod.GET, produces = "application/json") + public String clearContext(HttpServletRequest request, @RequestParam String context_id) throws Exception { + String jsonResponse = ""; + + logger.debug(EELFLoggerDelegate.debugLogger, "clearContext for " + context_id); + if (context_id == null) { + throw new Exception("Received null for contextId"); + } + + int count = contextService.deleteSharedContexts(context_id); + 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 userJson + * JSON block with these tag-value pairs: + *
    + *
  • context_id: ID that identifies the context + *
  • ckey: Key for the key-value pair to store + *
  • cvalue: Value to store + *
+ * @return JSON with result indicating whether the value was added (key not + * previously known) or replaced (key previously known). + */ + @RequestMapping(value = { "/set" }, method = RequestMethod.POST, produces = "application/json") + public String setContext(HttpServletRequest request, @RequestBody String userJson) throws Exception { + String jsonResponse = ""; + + @SuppressWarnings("unchecked") + Map 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("Received null for contextId and/or key"); + } + + logger.debug(EELFLoggerDelegate.debugLogger, "setContext for 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"; + jsonResponse = convertResponseToJSON(response); + + return jsonResponse; + } + + /** + * Creates a two-element JSON object tagged "response". + * + * @param responseBody + * @return + * @throws JsonProcessingException + */ + private String convertResponseToJSON(String responseBody) throws JsonProcessingException { + Map responseMap = new HashMap(); + responseMap.put("response", responseBody); + String response = mapper.writeValueAsString(responseMap); + return response; + } + + /** + * Converts list of SharedContext objects to a JSON array. + * + * @param contextList + * @return + * @throws JsonProcessingException + */ + private String convertResponseToJSON(List 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 responseBody + * @return tag "response" with collection of context object's fields + * @throws JsonProcessingException + */ + private String convertResponseToJSON(SharedContext context) throws JsonProcessingException { + Map responseMap = new HashMap(); + responseMap.put("response", context); + String responseBody = mapper.writeValueAsString(responseMap); + return responseBody; + } + + @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/src/main/java/org/openecomp/portalapp/portal/controller/UserRolesController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/UserRolesController.java new file mode 100644 index 00000000..24370fbb --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/UserRolesController.java @@ -0,0 +1,336 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.controller; + +import java.util.ArrayList; +import java.util.Arrays; +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.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.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.EcompPortalUtils; +import org.openecomp.portalapp.util.EPUserUtils; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.openecomp.portalsdk.core.restful.domain.EcompRole; +import org.openecomp.portalsdk.core.service.RoleService; +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 { + + static final String FAILURE = "failure"; + + @Autowired + SearchService searchService; + @Autowired + AdminRolesService adminRolesService; + @Autowired + UserRolesService userRolesService; + @Autowired + ApplicationsRestClientService applicationsRestClientService; + @Autowired + RoleService roleService; + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserRolesController.class); + + /** + * RESTful service method to fetch users in the WebPhone external service + * + * @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() > 0) { + //searchResult = searchService.searchUsersInPhoneBook(searchString); + searchResult = searchService.searchUsersInFnTable(searchString); + } else { + logger.info(EELFLoggerDelegate.errorLogger, "getPhoneBookSearchResult - too short search string: " + searchString); + } + } + EcompPortalUtils.logAndSerializeObject("/portalApi/queryUsers", "result =", searchResult); + + return searchResult; + } + + /** + * RESTful service method to fetch applications where user is admin + * + * @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("orgUserId") 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 orgUserId"); + response.setStatus(HttpServletResponse.SC_BAD_REQUEST); + } + } + + StringBuilder adminAppRoles = new StringBuilder(); + if(result != null && 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."); + } + logger.info(EELFLoggerDelegate.errorLogger, adminAppRoles.toString()); + + EcompPortalUtils.logAndSerializeObject("/portalApi/adminAppsRoles", "get result =", result); + + return result; + } + + @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 && 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.append("}."); + } else { + newAppRoles.append("User '" + newAppsListWithAdminRoles.orgUserId + "' has no Apps with Admin Role."); + } + 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); + } + EcompPortalUtils.logAndSerializeObject("/portalApi/adminAppsRoles", "put result =", changesApplied); + + return fieldsValidator; + } + + @RequestMapping(value = { "/portalApi/userAppRoles" }, method = { RequestMethod.GET }, produces = "application/json") + public List getAppRolesForUser(HttpServletRequest request, @RequestParam("orgUserId") String orgUserId, @RequestParam("app") Long appid, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List 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); + 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 userId"); + 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 { + if (result==null) { + result = new ArrayList(); + } + sbUserApps.append("User '" + orgUserId + "' and appid " + appid + " has no roles"); + } + logger.info(EELFLoggerDelegate.errorLogger, sbUserApps.toString()); + + EcompPortalUtils.logAndSerializeObject("/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.append("} assigned for the app '" + newAppRolesForUser.appName + "'."); + } else { + sbUserApps.append("' has no roles assigned for the app '" + newAppRolesForUser.appName + "'."); + } + } + logger.info(EELFLoggerDelegate.errorLogger, sbUserApps.toString()); + + EPUser user = EPUserUtils.getUserSession(request); + + boolean changesApplied = false; + if (!adminRolesService.isAccountAdmin(user)) { + EcompPortalUtils.setBadPermissions(user, response, "putAppWithUserRoleStateForUser"); + } else { + changesApplied = userRolesService.setAppWithUserRoleStateForUser(user, newAppRolesForUser); + if (changesApplied == false) { + logger.debug(EELFLoggerDelegate.debugLogger, "putAppWithUserRoleStateForUser - Set new User Roles failure"); + } + } + + EcompPortalUtils.logAndSerializeObject("/portalApi/userAppRoles", "put result =", changesApplied); + + return fieldsValidator; + } + + @RequestMapping(value = { "/portalApi/updateRemoteUserProfile" }, method = { RequestMethod.GET }, produces = "application/json") + public PortalRestResponse 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(PortalRestStatusEnum.OK, updateRemoteUserFlag, e.getMessage()); + } + return new PortalRestResponse(PortalRestStatusEnum.ERROR, updateRemoteUserFlag, ""); + + } + + @RequestMapping(value = { "/portalApi/app/{appId}/users" }, method = { RequestMethod.GET }, produces = "application/json") + public List getUsersFromAppEndpoint(HttpServletRequest request, @PathVariable("appId") Long appId) throws HTTPException { + try { + List appUsers = userRolesService.getUsersFromAppEndpoint(appId); + return appUsers; + } catch(Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing UserRolesController.getUsersFromAppEndpoint. Details: " + EcompPortalUtils.getStackTrace(e)); + return new ArrayList(); + } + } + + @RequestMapping(value = { "/portalApi/app/{appId}/roles" }, method = { RequestMethod.GET }, produces = "application/json") + public List testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId) throws HTTPException { + EcompRole[] appRoles = applicationsRestClientService.get(EcompRole[].class, appId, "/roles"); + List rolesList = Arrays.asList(appRoles); + EcompPortalUtils.logAndSerializeObject("/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 importRolesFromRemoteApplication(HttpServletRequest request, @PathVariable("appId") Long appId) throws HTTPException { + List rolesList = userRolesService.importRolesFromRemoteApplication(appId); + EcompPortalUtils.logAndSerializeObject("/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//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//roles returned array. expected size 1 recieved size = " + roles.length; + logger.error(EELFLoggerDelegate.errorLogger, msg); + throw new Exception(msg); + } + + EcompPortalUtils.logAndSerializeObject("/portalApi/app/{appId}/user/{orgUserId}/roles", "response for appId='" + appId + "' and orgUserId='" + orgUserId + "'", roles[0]); + return roles[0]; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/WidgetsController.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/WidgetsController.java new file mode 100644 index 00000000..ddadef93 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/controller/WidgetsController.java @@ -0,0 +1,134 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.controller; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.cxf.common.util.StringUtils; +import org.openecomp.portalapp.controller.EPRestrictedBaseController; +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.WidgetService; +import org.openecomp.portalapp.portal.transport.FieldsValidator; +import org.openecomp.portalapp.portal.transport.OnboardingWidget; +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 WidgetsController extends EPRestrictedBaseController { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsController.class); + + @Autowired + AdminRolesService adminRolesService; + @Autowired + WidgetService widgetService; + + @RequestMapping(value = { "/portalApi/widgets" }, method = RequestMethod.GET, produces = "application/json") + public List getOnboardingWidgets(HttpServletRequest request, HttpServletResponse response) { + EPUser user = EPUserUtils.getUserSession(request); + List 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("/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("/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("/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("/portalApi/widgets/" + widgetId, "DELETE result =", response.getStatus()); + return fieldsValidator; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java new file mode 100644 index 00000000..ae55f6f2 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java @@ -0,0 +1,88 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java new file mode 100644 index 00000000..3b4179d9 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java @@ -0,0 +1,96 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.domain; + +import java.util.ArrayList; +import java.util.List; + +public class AdminUserApplications { + private List apps = new ArrayList(); + + 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 getApps() { + return apps; + } + public void setApps(List 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/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java new file mode 100644 index 00000000..cb5303c4 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java @@ -0,0 +1,86 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUsTransportModel.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUsTransportModel.java new file mode 100644 index 00000000..e348311f --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUsTransportModel.java @@ -0,0 +1,84 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.domain; + +/** + * An easily serializable-as-JSON version of + * {@link org.openecomp.portalapp.portal.domain.AppContactUs}, with the + * application ID instead of the EPApp object. + */ +public class AppContactUsTransportModel { + + private Long appId; + private String appName; + private String description; + private String contactEmail; + private String url; + private String activeYN; + + 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 getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getActiveYN() { + return activeYN; + } + + public void setActiveYN(String activeYN) { + this.activeYN = activeYN; + } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } + + public Long getAppId() { + return appId; + } + + public void setAppId(Long appId) { + this.appId = appId; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java new file mode 100644 index 00000000..52005e88 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java @@ -0,0 +1,63 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java new file mode 100644 index 00000000..90d8e964 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java @@ -0,0 +1,76 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java new file mode 100644 index 00000000..8897151c --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java @@ -0,0 +1,319 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.domain; + +import javax.persistence.Lob; + +import org.apache.commons.lang.StringUtils; +import org.openecomp.portalsdk.core.domain.support.DomainVo; + + +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 SortedSet widgets = new TreeSet(); +*/ + + 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 SortedSet getWidgets() { + return widgets; + } + + public void setWidgets(SortedSet widgets) { + this.widgets = widgets; + } + + public void addWidget(Widget widget) { + this.widgets.add(widget); + } + + public void removeWidget(Long widgetId) { + for (Widget widget: widgets) { + if (widget.getId().equals(widgetId)) { + widgets.remove(widget); + break; + } + } + } + */ + + 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; + } + + @Override + public String toString() { + String str = "["+getId()+":"+getName()+"]"; + return str; + } + + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java new file mode 100644 index 00000000..db440897 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java @@ -0,0 +1,204 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 roleFunctions = new TreeSet(); + + private SortedSet childRoles = new TreeSet(); + + @JsonIgnore + private SortedSet parentRoles = new TreeSet(); + + public EPRole() {} + + public String getName() { + return name; + } + + public boolean getActive() { + return active; + } + + public SortedSet getRoleFunctions() { + return roleFunctions; + } + + public Integer getPriority() { + return priority; + } + + public SortedSet getChildRoles() { + return childRoles; + } + + public SortedSet getParentRoles() { + return parentRoles; + } + + public void setName(String name) { + this.name = name; + } + + public void setActive(boolean active) { + this.active = active; + } + + public void setRoleFunctions(SortedSet roleFunctions) { + this.roleFunctions = roleFunctions; + } + + public void setPriority(Integer priority) { + this.priority = priority; + } + + public void setChildRoles(SortedSet childRoles) { + this.childRoles = childRoles; + } + + public void setParentRoles(SortedSet 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 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 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 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() { + String str = "[id: "+getId()+", appId: "+appId+", appRoleId: "+appRoleId+"]"; + return str; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java new file mode 100644 index 00000000..d70daa9b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java @@ -0,0 +1,602 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portalsdk.core.domain.support.DomainVo; + +public class EPUser extends DomainVo { + + 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 final long ECOMP_PORTAL_ID = 1L; + private static final String ECOMP_PORTAL_NAME = "ECOMP"; + private boolean isGuest = false; + + private SortedSet userApps = new TreeSet(); + private SortedSet pseudoRoles = new TreeSet(); + + 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; + } + + 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 getPseudoRoles() { + return pseudoRoles; + } + + public void setPseudoRoles(SortedSet 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 pseudoRoles) { + this.pseudoRoles = pseudoRoles; + } + + public SortedSet getEPUserApps() { + return userApps; + } + + public void setEPUserApps(SortedSet userApps) { + this.userApps = userApps; + } + + public void addUserApp(EPUserApp userApp) { + userApps.add(userApp); + } + + public void addAppRoles(EPApp app, SortedSet roles) { + if (roles != null) { + // add all + SortedSet userApps = new TreeSet(); + // this.userApps.removeAll(this.userApps); + Iterator 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 getAppEPRoles(EPApp app) { + SortedSet roles = new TreeSet(); + SortedSet apps = getEPUserApps(); + Iterator appsItr = apps.iterator(); + EPUserApp userApp = null; + // getting default app + while (appsItr.hasNext()) { + EPUserApp tempUserApp = (EPUserApp) appsItr.next(); + if (tempUserApp.getApp().getId().equals(app)) { + userApp = tempUserApp; + roles.add((EPRole) userApp.getRole()); + } + } + return roles; + } + + /** + * Attention! Not for use in ECOMP + */ + public SortedSet getAppRoles(EPApp app) { + SortedSet roles = new TreeSet(); + SortedSet apps = getEPUserApps(); + Iterator 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 getEPRoles() { + EPApp app = new EPApp(); + app.setId(new Long(ECOMP_PORTAL_ID)); + app.setName(ECOMP_PORTAL_NAME); + return getAppEPRoles(app); + } + + /** + * Attention! Not for use in ECOMP + */ + public void setEPRoles(SortedSet roles) { + EPApp app = new EPApp(); + app.setId(new Long(ECOMP_PORTAL_ID)); + app.setName(ECOMP_PORTAL_NAME); + addAppRoles(app, roles); + } + + /** + * Attention! Not for use in ECOMP + */ + public void removeEPRole(Long roleId) { + SortedSet apps = getEPUserApps(); + Iterator appsItr = apps.iterator(); + // getting default app + while (appsItr.hasNext()) { + EPUserApp tempUserApp = (EPUserApp) appsItr.next(); + if (tempUserApp.equals(new Long(ECOMP_PORTAL_ID)) && tempUserApp.getRole().getId().equals(roleId)) { + appsItr.remove(); + } + } + } + + /** + * Attention! Not for use in ECOMP + */ + public void addEPRole(EPRole role) { + if (role != null) { + SortedSet roles = getEPRoles(); + if (roles == null) { + roles = new TreeSet(); + } + roles.add(role); + setEPRoles(roles); + } + } + + public boolean isGuest() { + return isGuest; + } + + public void setGuest(boolean isGuest) { + this.isGuest = isGuest; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java new file mode 100644 index 00000000..f4647fca --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java @@ -0,0 +1,119 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java new file mode 100644 index 00000000..2564a178 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java @@ -0,0 +1,143 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.domain; + +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; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java new file mode 100644 index 00000000..a7dab37e --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java @@ -0,0 +1,70 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.domain; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; + +@Entity +@IdClass(GetAccessResultId.class) +public class GetAccessResult { + + @Id + @Column(name="ecomp_function") + private String ecompFunction; + + @Id + @Column(name="app_name") + private String appName; + + @Column(name="app_mots_id",nullable=true) + private Integer appMotsId; + + @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 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; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java new file mode 100644 index 00000000..83abda54 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java @@ -0,0 +1,64 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java new file mode 100644 index 00000000..4288d920 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java @@ -0,0 +1,79 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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; + } + +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java new file mode 100644 index 00000000..c68f1b8b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java @@ -0,0 +1,161 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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. + */ + 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 + */ + 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 + */ + 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 + */ + 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 + */ + 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 + */ + public String getCvalue() { + return cvalue; + } + + /** + * Sets the value of the key-value pair. + * + * @param cvalue + */ + public void setCvalue(final String cvalue) { + this.cvalue = cvalue; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java new file mode 100644 index 00000000..cce4cb23 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java @@ -0,0 +1,77 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java new file mode 100644 index 00000000..d0b5df92 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java @@ -0,0 +1,91 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java new file mode 100644 index 00000000..60ee4321 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java @@ -0,0 +1,111 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portalapp.portal.utils.EPSystemProperties; +import org.openecomp.portalsdk.core.util.SystemProperties; + +public class UserRoles implements Serializable { + private static final long serialVersionUID = 1L; + + private static final HashMap rolesDictionary; + + static { + rolesDictionary = new HashMap(); + rolesDictionary.put(Long.valueOf(SystemProperties.getProperty(SystemProperties.SYS_ADMIN_ROLE_ID)).longValue(), "superAdmin"); + rolesDictionary.put(Long.valueOf(SystemProperties.getProperty(EPSystemProperties.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.getRoleId()); + } + + public void addRole(Long roleId) { + String normalizedRole = normalizeRole(roleId); + if (!getRoles().contains(normalizedRole)) { + this.roles.add(normalizedRole); + } + } + + 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 roles = new ArrayList(); + + 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 getRoles() { + return roles; + } + + public void setRoles(List roles) { + this.roles = roles; + } + + public void setGuestSession(boolean guestSession) { + this.guestSession = guestSession; + } + + public boolean getGuestSession() { + return this.guestSession; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java new file mode 100644 index 00000000..309b0c87 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java @@ -0,0 +1,104 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCatalogItem.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCatalogItem.java new file mode 100644 index 00000000..e0f516d9 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCatalogItem.java @@ -0,0 +1,159 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 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 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 + "]"; + } + +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCategoryFunctionsItem.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCategoryFunctionsItem.java new file mode 100644 index 00000000..16aca032 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCategoryFunctionsItem.java @@ -0,0 +1,84 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppContactUsItem.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppContactUsItem.java new file mode 100644 index 00000000..c8dd8f0c --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppContactUsItem.java @@ -0,0 +1,104 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 apps table on the Contact Us page. + */ +@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; + } + + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/CommonWidgetsEnum.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/CommonWidgetsEnum.java new file mode 100644 index 00000000..6270751b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/CommonWidgetsEnum.java @@ -0,0 +1,36 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestResponse.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestResponse.java new file mode 100644 index 00000000..4f92e75e --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestResponse.java @@ -0,0 +1,60 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.ecomp.model; + +public class PortalRestResponse { + + 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; + }; +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestStatusEnum.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestStatusEnum.java new file mode 100644 index 00000000..eceabacb --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestStatusEnum.java @@ -0,0 +1,35 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.ecomp.model; + +public enum PortalRestStatusEnum{ + OK("ok"), + ERROR("error"); + + private String value; + private PortalRestStatusEnum(String value){ + this.value = value; + } + + @Override + public String toString() { + return value; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/SearchResultItem.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/SearchResultItem.java new file mode 100644 index 00000000..0fadab80 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ecomp/model/SearchResultItem.java @@ -0,0 +1,92 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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{ + + /** + * + */ + private static final long serialVersionUID = 1598343426058929653L; + + @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/src/main/java/org/openecomp/portalapp/portal/interceptor/PortalResourceInterceptor.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/interceptor/PortalResourceInterceptor.java new file mode 100644 index 00000000..87ba2a44 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/interceptor/PortalResourceInterceptor.java @@ -0,0 +1,95 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.interceptor; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.openecomp.portalapp.controller.sessionmgt.SessionCommunicationController; +import org.openecomp.portalapp.portal.controller.ExternalAppsRestfulController; +import org.openecomp.portalapp.portal.controller.SharedContextRestController; +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.utils.EcompPortalUtils; +import org.openecomp.portalapp.service.sessionmgt.ManageService; +import org.openecomp.portalapp.service.sessionmgt.RemoteWebServiceCallService; +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.crossapi.PortalTimeoutHandler; +import org.openecomp.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.method.HandlerMethod; + +import com.fasterxml.jackson.databind.ObjectMapper; + +public class PortalResourceInterceptor extends ResourceInterceptor { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PortalResourceInterceptor.class); + + @Autowired + public RemoteWebServiceCallService remoteWebServiceCallService; + + @Autowired + public ManageService manageService; + + @Autowired + private EPEELFLoggerAdvice epAdvice; + + static ObjectMapper mapper = new ObjectMapper(); + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) + throws Exception { + + if (handler instanceof HandlerMethod) { + HandlerMethod method = (HandlerMethod) handler; + Object controllerObj = method.getBean(); + /** + * These classes provide REST endpoints used by other application + * servers, NOT by an end user's browser. + */ + 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("uebkey"), + request.getHeader("username"), request.getHeader("password"))) { + throw new UrlAccessRestrictedException(); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Error authenticating RESTful service. Details: " + EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeRestApiAuthenticationError); + throw new UrlAccessRestrictedException(); + } + } + } + + handleSessionUpdates(request); + return true; + } + + protected void handleSessionUpdates(HttpServletRequest request) { + PortalTimeoutHandler.handleSessionUpdatesNative(request, null, null, null, null, manageService); + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/interceptor/SessionTimeoutInterceptor.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/interceptor/SessionTimeoutInterceptor.java new file mode 100644 index 00000000..cd0a3037 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/interceptor/SessionTimeoutInterceptor.java @@ -0,0 +1,97 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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; + + 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 see) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(see)); + return loginStrategy.login(request, response); + } + + } + + 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; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/HealthMonitor.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/HealthMonitor.java new file mode 100644 index 00000000..6b71eeb7 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/HealthMonitor.java @@ -0,0 +1,393 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.EPSystemProperties; +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.EnableAspectJAutoProxy; +import org.springframework.transaction.annotation.Transactional; + +@Transactional +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPMetricsLog +public class HealthMonitor { + + @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; + public static boolean isSuspended = false; + + Thread healthMonitorThread; + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HealthMonitor.class); + + 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, "==> Health Monitor thread started"); + + long sleepInterval = (Long.valueOf(SystemProperties.getProperty(EPSystemProperties.HEALTH_POLL_INTERVAL_SECONDS)) * 1000); + long numIntervalsBetweenAlerts = Long.valueOf(SystemProperties.getProperty(EPSystemProperties.HEALTHFAIL_ALERT_EVERY_X_INTERVALS)); + logger.debug(EELFLoggerDelegate.debugLogger, "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){ + // Write a Log entry that will generate an alert + EPLogUtil.logEcompError(EPAppMessagesEnum.BeHealthCheckMySqlError); + logger.debug(EELFLoggerDelegate.debugLogger, "Database down, logging to error log to trigger alert."); + numIntervalsDatabaseHasBeenDown++; + } + else { + numIntervalsDatabaseHasBeenDown = 0; + } + } + + dbClusterStatusOk = this.checkClusterStatus(); + if (dbClusterStatusOk == false) { + + if ((numIntervalsClusterNotHealthy % numIntervalsBetweenAlerts) == 0){ + EPLogUtil.logEcompError(EPAppMessagesEnum.BeHealthCheckMySqlError); + logger.debug(EELFLoggerDelegate.debugLogger, "Cluster nodes appear to be down, logging to error log to trigger alert."); + numIntervalsClusterNotHealthy++; + } + else { + numIntervalsClusterNotHealthy = 0; + } + } + + dbPermissionsOk = this.checkDatabaseAndPermissions(); + if (dbPermissionsOk == false) { + + if ((numIntervalsDatabasePermissionsIncorrect % numIntervalsBetweenAlerts) == 0){ + EPLogUtil.logEcompError(EPAppMessagesEnum.BeHealthCheckMySqlError); + logger.debug(EELFLoggerDelegate.debugLogger, "Database permissions don't seem correct, logging to error log to trigger alert."); + 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){ + // Write a Log entry that will generate an alert + EPLogUtil.logEcompError(EPAppMessagesEnum.BeHealthCheckUebClusterError); + logger.debug(EELFLoggerDelegate.debugLogger, "UEB down, logging to error log to trigger alert"); + 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. + // + Thread.sleep(sleepInterval); + } + } + + @PostConstruct + public void initHealthMonitor() { + + healthMonitorThread = new Thread("EP HealthMonitor thread") { + public void run(){ + try { + monitorEPHealth(); + } catch (InterruptedException e) { + logger.debug(EELFLoggerDelegate.debugLogger, "<== Health Monitor thread exiting..." + EcompPortalUtils.getStackTrace(e)); + } catch(Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred in Healthcheck monitor thread." + EcompPortalUtils.getStackTrace(e)); + } + } + }; + if (healthMonitorThread != null) { + healthMonitorThread.start(); + } + } + + @PreDestroy + public void closeHealthMonitor() + { + this.healthMonitorThread.interrupt(); + } + + + 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 queryList = query.list(); + if (queryList != null) { + isUp = true; + } + localSession.close(); + } + } + catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + isUp = false; + } + + 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 queryList = query.list(); + if (queryList != null) { + isUp = true; + } + } + } + catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "checkClusterStatus() exception msg = " + e.getMessage()); + if ((e.getCause() != null) && (e.getCause().getMessage() != null)) { + logger.error(EELFLoggerDelegate.errorLogger, "checkClusterStatus() exception msg = " + e.getCause().getMessage()); + } + logger.error(EELFLoggerDelegate.errorLogger, "Exception inside checkClusterStatus() exception = " + EcompPortalUtils.getStackTrace(e)); + isUp = false; + } + finally { + if (localSession != null) { + localSession.close(); + } + } + + return isUp; + + } + + + private boolean checkDatabaseAndPermissions() { + + 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 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, "checkDatabaseAndPermissions() 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, "checkDatabaseAndPermissions() exception msg = " + e.getMessage()); + if ((e.getCause() != null) && (e.getCause().getMessage() != null)) { + logger.error(EELFLoggerDelegate.errorLogger, "checkDatabaseAndPermissions() exception msg = " + e.getCause().getMessage()); + } + logger.error(EELFLoggerDelegate.errorLogger, "Exception inside checkDatabaseAndPermissions() exception = " + EcompPortalUtils.getStackTrace(e)); + 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, "Exception inside CheckIfUebUp exception = " + EcompPortalUtils.getStackTrace(e)); + } + + return uebUp; + + + } + + /* + private boolean checkIfFeUp() { + boolean frontenndUp = false; + try { + String url = SystemProperties.getProperty(EPSystemProperties.FE_URL); + if(StringUtils.isEmpty(url)) + { + logger.debug(EELFLoggerDelegate.debugLogger, "The front end URL is empty. Cannot check the status"); + return frontenndUp; + } + + url = url.replace("index.html", "app/healthCheck.json"); + + URL frontEndURL = new URL(url); + + HttpURLConnection con = (HttpURLConnection) frontEndURL.openConnection(); + + // optional default is GET + con.setRequestMethod("GET"); + + int responseCode = con.getResponseCode(); + logger.debug(EELFLoggerDelegate.debugLogger, "Fronend response code : " + responseCode); + + if(responseCode == 200) + { + frontenndUp = true; + } + + } + catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while trying to access font end" + EcompPortalUtils.getStackTrace(e)); + } + + return frontenndUp; + } + */ +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/UserContextListener.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/UserContextListener.java new file mode 100644 index 00000000..8255914f --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/UserContextListener.java @@ -0,0 +1,49 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.listener; + +import java.util.HashMap; + +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + +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/src/main/java/org/openecomp/portalapp/portal/listener/UserSessionListener.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/UserSessionListener.java new file mode 100644 index 00000000..9b48c622 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/listener/UserSessionListener.java @@ -0,0 +1,125 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ + +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.portalapp.portal.utils.EcompPortalUtils; +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, "Exception occurred while executing sessionDestroyed. Details: " + EcompPortalUtils.getStackTrace(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/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPAuditLog.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPAuditLog.java new file mode 100644 index 00000000..15a4c7f0 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPAuditLog.java @@ -0,0 +1,31 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java new file mode 100644 index 00000000..a03f5153 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java @@ -0,0 +1,341 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.logging.aop; + +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_KEY_REQUEST_ID; +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.Date; +import java.util.UUID; + +import javax.servlet.http.HttpServletRequest; + +import org.openecomp.portalapp.portal.domain.EPUser; +import org.openecomp.portalapp.portal.utils.EPSystemProperties; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalapp.util.EPUserUtils; +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 { + + 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"); + + public void loadServletRequestBasedDefaults(HttpServletRequest req, SecurityEventTypeEnum securityEventType) { + try { + this.setHttpRequestBasedDefaultsIntoGlobalLoggingContext(req, securityEventType, req.getServletPath()); + } catch(Exception e) { + adviceLogger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + } + + public Object[] before(SecurityEventTypeEnum securityEventType, Object[] args, Object[] passOnArgs) { + String className = ""; + if (passOnArgs[0]!=null) { + className = passOnArgs[0].toString(); + } + + String methodName = ""; + if (passOnArgs[1]!=null) { + methodName = passOnArgs[1].toString(); + } + + //Initialize Request defaults only for controller methods. + MDC.put(className + methodName + EPSystemProperties.METRICSLOG_BEGIN_TIMESTAMP, getCurrentDateTimeUTC()); + MDC.put(EPSystemProperties.TARGET_ENTITY, EPSystemProperties.ECOMP_PORTAL_BE); + MDC.put(EPSystemProperties.TARGET_SERVICE_NAME, methodName); + if (securityEventType!=null) { + MDC.put(className + methodName + EPSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, getCurrentDateTimeUTC()); + HttpServletRequest req = null; + if (args[0]!=null && args[0] instanceof HttpServletRequest ) { + req = (HttpServletRequest)args[0]; + this.setHttpRequestBasedDefaultsIntoGlobalLoggingContext(req, securityEventType, methodName); + } + } + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(className); + + //StopWatch stopWatch = new StopWatch("Metrics for " + className + "." + methodName); + //stopWatch.start(); + + logger.debug(EELFLoggerDelegate.debugLogger, "Entered executing " + methodName +"."); + + return new Object[] {""}; + } + + public void after(SecurityEventTypeEnum securityEventType, String statusCode, String responseCode, Object[] args, Object[] returnArgs, Object[] passOnArgs) { + //ClassName + String className = ""; + if (passOnArgs[0]!=null) { + className = passOnArgs[0].toString(); + } + + //Method Name + String methodName = ""; + if (passOnArgs[1]!=null) { + methodName = passOnArgs[1].toString(); + } + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(className); + /*/ + StopWatch stopWatch = (StopWatch)returnArgs[0]; + if (stopWatch!=null && stopWatch.isRunning()) { + stopWatch.stop(); + MDC.put(SystemProperties.MDC_TIMER, stopWatch.getTotalTimeMillis() + "ms"); + } + /**/ + + if (MDC.get(EPSystemProperties.TARGET_SERVICE_NAME) == null || MDC.get(EPSystemProperties.TARGET_SERVICE_NAME) == "") { + MDC.put(EPSystemProperties.TARGET_SERVICE_NAME, methodName); + } + + if (MDC.get(EPSystemProperties.TARGET_ENTITY) == null || MDC.get(EPSystemProperties.TARGET_ENTITY) == "") { + MDC.put(EPSystemProperties.TARGET_ENTITY, EPSystemProperties.ECOMP_PORTAL_BE); + } + + MDC.put(EPSystemProperties.METRICSLOG_BEGIN_TIMESTAMP, MDC.get(className + methodName + EPSystemProperties.METRICSLOG_BEGIN_TIMESTAMP)); + MDC.put(EPSystemProperties.METRICSLOG_END_TIMESTAMP, getCurrentDateTimeUTC()); + this.calculateDateTimeDifference(MDC.get(EPSystemProperties.METRICSLOG_BEGIN_TIMESTAMP), MDC.get(EPSystemProperties.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[0]!=null && args[0] instanceof HttpServletRequest && + securityEventType==SecurityEventTypeEnum.INCOMING_REST_MESSAGE && + (MDC.get(EPSystemProperties.FULL_URL)==null || MDC.get(EPSystemProperties.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(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE); + if (externalAPIResponseCode==null || externalAPIResponseCode=="" || externalAPIResponseCode.trim().equalsIgnoreCase("200")) { + MDC.put(EPSystemProperties.RESPONSE_CODE, responseCode); + MDC.put(EPSystemProperties.STATUS_CODE, statusCode); + } else { + MDC.put(EPSystemProperties.RESPONSE_CODE, externalAPIResponseCode); + MDC.put(EPSystemProperties.STATUS_CODE, "ERROR"); + } + + logger.debug(EELFLoggerDelegate.debugLogger, "Finished executing " + methodName + "."); + logger.info(EELFLoggerDelegate.metricsLogger, methodName + " operation is completed."); + + //Log security message, if necessary + if (securityEventType!=null) { + MDC.put(EPSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, MDC.get(className + methodName + EPSystemProperties.AUDITLOG_BEGIN_TIMESTAMP)); + MDC.put(EPSystemProperties.AUDITLOG_END_TIMESTAMP, getCurrentDateTimeUTC()); + this.calculateDateTimeDifference(MDC.get(EPSystemProperties.AUDITLOG_BEGIN_TIMESTAMP), MDC.get(EPSystemProperties.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(MDC_KEY_REQUEST_ID); + MDC.remove(EPSystemProperties.PARTNER_NAME); + MDC.remove(Configuration.MDC_SERVICE_NAME); + MDC.remove(EPSystemProperties.MDC_LOGIN_ID); + MDC.remove(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE); + } + + //clear when finishes audit logging + MDC.remove(EPSystemProperties.FULL_URL); + MDC.remove(EPSystemProperties.PROTOCOL); + MDC.remove(EPSystemProperties.STATUS_CODE); + MDC.remove(className + methodName + EPSystemProperties.AUDITLOG_BEGIN_TIMESTAMP); + MDC.remove(EPSystemProperties.AUDITLOG_BEGIN_TIMESTAMP); + MDC.remove(EPSystemProperties.AUDITLOG_END_TIMESTAMP); + MDC.remove(EPSystemProperties.RESPONSE_CODE); + } + MDC.remove(className + methodName + EPSystemProperties.METRICSLOG_BEGIN_TIMESTAMP); + MDC.remove(EPSystemProperties.METRICSLOG_BEGIN_TIMESTAMP); + MDC.remove(EPSystemProperties.METRICSLOG_END_TIMESTAMP); + MDC.remove(EPSystemProperties.MDC_TIMER); + MDC.remove(EPSystemProperties.TARGET_ENTITY); + MDC.remove(EPSystemProperties.TARGET_SERVICE_NAME); + } + + 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(EPSystemProperties.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(EPSystemProperties.MDC_LOGIN_ID); + if (loginId==null || loginId=="" || loginId== EPSystemProperties.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(EPSystemProperties.FULL_URL); + if (fullURL!=null && fullURL!="") { + additionalInfoAppender.append(" Request-URL:" + MDC.get(EPSystemProperties.FULL_URL)); + } + + auditMessage = AuditLogFormatter.getInstance().createMessage( MDC.get(EPSystemProperties.PROTOCOL), + securityEventType.name(), + MDC.get(EPSystemProperties.MDC_LOGIN_ID), + additionalInfoAppender.toString()); + + logger.info(EELFLoggerDelegate.auditLogger, auditMessage); + } + + 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(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 = EPSystemProperties.ECOMP_PORTAL_FE; + } + MDC.put(EPSystemProperties.PARTNER_NAME, accessingClient); + + //Load loginId into MDC context. + String loginId = ""; + try { + loginId = UserUtils.getUserIdFromCookie(req); + } catch (Exception e) { + adviceLogger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + if (loginId == null || loginId == "") { + EPUser user = EPUserUtils.getUserSession(req); + if (user != null) { + loginId = user.getLoginId(); + } + + if (loginId==null || loginId=="") { + loginId = "Unknown"; + } + } + MDC.put(EPSystemProperties.MDC_LOGIN_ID, loginId); + + //Rest URL & Protocol + String restURL = ""; + MDC.put(EPSystemProperties.FULL_URL, EPSystemProperties.UNKNOWN); + MDC.put(EPSystemProperties.PROTOCOL, EPSystemProperties.HTTP); + restURL = UserUtils.getFullURL(req); + if (restURL!=null && restURL!="") { + MDC.put(EPSystemProperties.FULL_URL, restURL); + if (restURL.toLowerCase().contains("https")) { + MDC.put(EPSystemProperties.PROTOCOL, EPSystemProperties.HTTPS); + } + } + + //Rest Path + MDC.put(MDC_SERVICE_NAME, restMethod); + String restPath = req.getServletPath(); + if (restPath!=null && restPath!="") { + MDC.put(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(EPSystemProperties.CLIENT_IP_ADDRESS, clientIPAddress); + } else if(securityEventType==SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH) { + MDC.put(EPSystemProperties.TARGET_ENTITY, "Phonebook"); + MDC.put(EPSystemProperties.TARGET_SERVICE_NAME, "search"); + } + } else { + MDC.put(MDC_SERVICE_NAME, restMethod); + MDC.put(EPSystemProperties.PARTNER_NAME, EPSystemProperties.ECOMP_PORTAL_FE); + } + + MDC.put(MDC_SERVICE_INSTANCE_ID, ""); + MDC.put(MDC_ALERT_SEVERITY, AlarmSeverityEnum.INFORMATIONAL.toString()); + try { + MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName()); + MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress()); + MDC.put(MDC_INSTANCE_UUID, SystemProperties.getProperty(SystemProperties.INSTANCE_UUID)); + } catch (Exception e) { + adviceLogger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + } + + private String getCurrentDateTimeUTC() { + String currentDateTime = ecompLogDateFormat.format(new Date()); + return currentDateTime; + } + + 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 ms", endDate.getTime() - beginDate.getTime()); + MDC.put(SystemProperties.MDC_TIMER, timeDifference); + } catch(Exception e) { + adviceLogger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + } + } + + public String getInternalResponseCode() { + return MDC.get(EPSystemProperties.RESPONSE_CODE); + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAspect.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAspect.java new file mode 100644 index 00000000..80ae9262 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAspect.java @@ -0,0 +1,204 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.UserProfileController.*(..))") + public void userProfileIncomingAuditMessages() {} + + /* + * Point-cut expression to handle UserProfileController INCOMING_REST_MESSAGES + */ + @Pointcut("execution(public * org.openecomp.portalapp.controller.WelcomeController.*(..))") + public void welcomeIncomingAuditMessages() {} + + /* + * Point-cut expression to handle INCOING 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, EcompPortalUtils.getStackTrace(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/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPMetricsLog.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPMetricsLog.java new file mode 100644 index 00000000..cc325a12 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPMetricsLog.java @@ -0,0 +1,31 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/logging/format/ApplicationCodes.properties b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/format/ApplicationCodes.properties new file mode 100644 index 00000000..2533dfa8 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/format/ApplicationCodes.properties @@ -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/src/main/java/org/openecomp/portalapp/portal/logging/format/EPAppMessagesEnum.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/format/EPAppMessagesEnum.java new file mode 100644 index 00000000..aae56e93 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/format/EPAppMessagesEnum.java @@ -0,0 +1,260 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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; + +/** + * + * @author rc580q + * 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."), + + ; + + 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/src/main/java/org/openecomp/portalapp/portal/logging/format/EPErrorCodesEnum.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/format/EPErrorCodesEnum.java new file mode 100644 index 00000000..39771e3d --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/format/EPErrorCodesEnum.java @@ -0,0 +1,95 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.logging.format; + +import com.att.eelf.i18n.EELFResolvableErrorEnum; +import com.att.eelf.i18n.EELFResourceManager; + +/** + * + * @author rc580q + * 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, + ; + + /** + * 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/src/main/java/org/openecomp/portalapp/portal/logging/logic/EPLogUtil.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/logic/EPLogUtil.java new file mode 100644 index 00000000..489a68a8 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/logging/logic/EPLogUtil.java @@ -0,0 +1,76 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.web.support.UserUtils; +import org.slf4j.MDC; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; + +public class EPLogUtil { + private static EELFLogger errorLogger = EELFManager.getInstance().getErrorLogger(); + 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("Failed to log the error code. Details: " + UserUtils.getStackTrace(e)); + } finally { + MDC.remove("ErrorCode"); + MDC.remove("ErrorDescription"); + MDC.remove("ClassName"); + MDC.remove(MDC_ALERT_SEVERITY); + } + } + + public 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(); + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesService.java new file mode 100644 index 00000000..c399d891 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesService.java @@ -0,0 +1,52 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +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); + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesServiceImpl.java new file mode 100644 index 00000000..508bd3d6 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesServiceImpl.java @@ -0,0 +1,318 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +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.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.utils.EPSystemProperties; +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; +import org.springframework.transaction.annotation.Transactional; + +@Service("adminRolesService") +@Transactional +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPMetricsLog +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; + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AdminRolesServiceImpl.class); + + @Autowired + private SessionFactory sessionFactory; + @Autowired + private DataAccessService dataAccessService; + @Autowired + SearchService searchService; + @Autowired + EPAppService appsService; + + @PostConstruct + private void init() { + try { + SYS_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPSystemProperties.SYS_ADMIN_ROLE_ID)); + ACCOUNT_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPSystemProperties.ACCOUNT_ADMIN_ROLE_ID)); + ECOMP_APP_ID = Long.valueOf(SystemProperties.getProperty(EPSystemProperties.ECOMP_APP_ID)); + } catch(Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + } + + @Override + @SuppressWarnings("unchecked") + public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(String orgUserId) { + AppsListWithAdminRole appsListWithAdminRole = null; + + try { + List userList = dataAccessService.getList(EPUser.class, " where org_user_id = '" + orgUserId + "'", null, + null); + HashMap appsUserAdmin = new HashMap(); + if (userList.size() > 0) { + EPUser user = userList.get(0); + List 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, EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + } + for (EPUserApp userApp : userAppList) { + appsUserAdmin.put(userApp.getAppId(), userApp.getUserId()); + } + } + + appsListWithAdminRole = new AppsListWithAdminRole(); + appsListWithAdminRole.orgUserId = orgUserId; + List appsList = null; + try { + appsList = dataAccessService.getList(EPApp.class, " where enabled = 'Y'", null, null); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(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, "Exception occurred while performing AdminRolesServiceImpl.getAppsWithAdminRoleStateForUser operation, Details:" + + EcompPortalUtils.getStackTrace(e)); + } + + return appsListWithAdminRole; + } + + private static final Object syncRests = new Object(); + + @Override + @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 apps = appsService.getAppsFullList(); + HashMap enabledApps = new HashMap(); + for (EPApp app : apps) { + if (app.getEnabled().booleanValue()) { + enabledApps.put(app.getId(), app); + } + } + List newAppsWhereUserIsAdmin = new ArrayList(); + 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 localUserList = dataAccessService.getList(EPUser.class, " where org_user_id='" + orgUserId + "'", + null, null); + List oldAppsWhereUserIsAdmin = new ArrayList(); + 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(); + result = true; + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + logger.error(EELFLoggerDelegate.errorLogger, "setAppsWithAdminRoleStateForUser: exception in point 2 = " + + EcompPortalUtils.getStackTrace(e)); + try { + transaction.rollback(); + } catch (Exception ex) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeExecuteRollbackError); + logger.error(EELFLoggerDelegate.errorLogger, "setAppsWithAdminRoleStateForUser: exception in point 3 = " + + EcompPortalUtils.getStackTrace(ex)); + } + } finally { + try { + localSession.close(); + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoCloseSessionError); + logger.error(EELFLoggerDelegate.errorLogger, "setAppsWithAdminRoleStateForUser: exception in point 4 = " + + EcompPortalUtils.getStackTrace(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 userRoleList = dataAccessService.executeSQLQuery(sql, UserIdRoleId.class, null); + if (userRoleList != null && userRoleList.size() > 0) { + return true; + } + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing isSuperAdmin operation, Details: " + + EcompPortalUtils.getStackTrace(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(EPAppMessagesEnum.BeDaoSystemError); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing isAccountAdmin operation, Details: " + + EcompPortalUtils.getStackTrace(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(EPAppMessagesEnum.BeDaoSystemError); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing isUser operation, Details: " + + EcompPortalUtils.getStackTrace(e)); + } + return false; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsService.java new file mode 100644 index 00000000..c81f2938 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsService.java @@ -0,0 +1,55 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 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 getAppsAndContacts() throws Exception; + + public List getAppCategoryFunctions() throws Exception; + + public String saveAppContactUs(List contactUs) throws Exception; + + public String saveAppContactUs(AppContactUsItem contactUs) throws Exception; + + public String deleteContactUs(Long id) throws Exception; + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsServiceImpl.java new file mode 100644 index 00000000..7a2f6206 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsServiceImpl.java @@ -0,0 +1,178 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; + +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.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.openecomp.portalsdk.core.service.DataAccessService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +/** + * 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; + } + + + @SuppressWarnings("unchecked") + @Override + public List getAppContactUs() throws Exception { + List contactUsItemList = (List) getDataAccessService() + .executeNamedQuery("getAppContactUsItems", null, null); + Collections.sort(contactUsItemList, new AppContactUsItemCompare()); + return contactUsItemList; + } + + + @SuppressWarnings("unchecked") + @Override + public List getAppsAndContacts() throws Exception { + List contactUsItemList = (List) 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 { + @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 getAppCategoryFunctions() throws Exception { + @SuppressWarnings("unchecked") + // This named query requires no parameters. + List list = (List) 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 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 map = new HashMap(); + 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 map = new HashMap(); + 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/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientService.java new file mode 100644 index 00000000..2ed9820d --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientService.java @@ -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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import org.apache.cxf.transport.http.HTTPException; + +public interface ApplicationsRestClientService { + public T get(Class clazz, long app, String restPath) throws HTTPException; + public T post(Class clazz, long appId, Object payload, String restPath) throws HTTPException ; + public T put(Class clazz, long appId, Object payload, String restPath) throws HTTPException ; +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java new file mode 100644 index 00000000..c18fe304 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java @@ -0,0 +1,267 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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.EPSystemProperties; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.openecomp.portalsdk.core.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.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 EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ApplicationsRestClientServiceImpl.class); + + @Autowired + private AppsCacheService appsCacheService; + Gson gson = null; + + @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() { + 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(EPSystemProperties.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(EPAppMessagesEnum.BeIncorrectHttpStatusError); + throw new HTTPException(status, errMsg, url); + } + } + + private static boolean isHttpSuccess(int status){ + return status / 100 == 2; + } + + @EPMetricsLog + private WebClient createClientForApp(long appId, String restPath) { + logger.debug(EELFLoggerDelegate.debugLogger, "creating client for appId=" + appId + "; restPath=" + restPath); + EPApp externalApp = appsCacheService.getApp(appId); + if(externalApp != null){ + String appBaseUri = externalApp.getAppRestEndpoint(); + String username = externalApp.getUsername(); + String encriptedPwd = externalApp.getAppPassword(); + String decreptedAppPwd = ""; + + //Set local context + MDC.put(EPSystemProperties.PROTOCOL, EPSystemProperties.HTTP); + if (appBaseUri!=null && appBaseUri.contains("https")) { + MDC.put(EPSystemProperties.PROTOCOL, EPSystemProperties.HTTPS); + } + MDC.put(EPSystemProperties.FULL_URL, appBaseUri + restPath); + MDC.put(EPSystemProperties.TARGET_ENTITY, externalApp.getName()); + MDC.put(EPSystemProperties.TARGET_SERVICE_NAME, restPath); + + try { + decreptedAppPwd = CipherUtil.decrypt(encriptedPwd, SystemProperties.getProperty(SystemProperties.Decryption_Key)); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Unable to decrypt App name = " + externalApp, EcompPortalUtils.getStackTrace(e)); + logger.error(EELFLoggerDelegate.errorLogger, "Unable to decrypt App name = " + externalApp, EcompPortalUtils.getStackTrace(e)); + } + logger.debug(EELFLoggerDelegate.debugLogger, String.format("App %d found, baseUri=[%s], Headers: [%s=%s, %s=%s]", appId, appBaseUri, APP_USERNAME_HEADER, username, PASSWORD_HEADER, encriptedPwd)); + WebClient client = createClientForPath(appBaseUri, restPath); + 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, EPSystemProperties.ECOMP_PORTAL_BE); + + return client; + } + return null; + } + + @Override + public T get(Class clazz, long appId, String restPath) throws HTTPException { + + WebClient webClient = null; + Response response = null; + T t = null; + + webClient = createClientForApp(appId, restPath); + EcompPortalUtils.logAndSerializeObject(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(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeRestApiGeneralError); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the GET REST API call, Details: " + EcompPortalUtils.getStackTrace(e)); + } + + if (response!=null) { + verifyResponse(response); + String str = response.readEntity(String.class); + EcompPortalUtils.logAndSerializeObject(restPath, "GET result =", str); + try { t = gson.fromJson(str, clazz); } catch(Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput); + } + } + + return t; + } + + @Override + public T post(Class clazz, long appId, Object payload, String restPath) throws HTTPException { + WebClient client = null; + Response response = null; + T t = null; + + client = createClientForApp(appId, restPath); + EcompPortalUtils.logAndSerializeObject(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(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeRestApiGeneralError); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the POST REST API call, Details: " + EcompPortalUtils.getStackTrace(e)); + } + + if (response!=null) { + verifyResponse(response); + + //String contentType = response.getHeaderString("Content-Type"); + if(clazz != null) { + String str = response.readEntity(String.class); + EcompPortalUtils.logAndSerializeObject(restPath, "POST result =", str); + try { t = gson.fromJson(str, clazz); } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput); + } + } + } + return t; + } + + @Override + public T put(Class clazz, long appId, Object payload, String restPath) throws HTTPException { + WebClient client = null; + Response response = null; + T t = null; + + client = createClientForApp(appId, restPath); + EcompPortalUtils.logAndSerializeObject(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(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeRestApiGeneralError); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the PUT REST API call, Details: " + EcompPortalUtils.getStackTrace(e)); + } + + if (response!=null) { + verifyResponse(response); + String str = response.readEntity(String.class); + EcompPortalUtils.logAndSerializeObject(restPath, "PUT result =", str); + try { t = gson.fromJson(str, clazz); } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput); + } + } + return t; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java new file mode 100644 index 00000000..dc3ac56d --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java @@ -0,0 +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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ + +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/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java new file mode 100644 index 00000000..7bbff768 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java @@ -0,0 +1,104 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 appsMap; + + @PostConstruct + public void init() { + this.refreshAppsMap(); + } + + private Map refreshAppsMap() { + long now = System.currentTimeMillis(); + + if(noNeedToUpdate(now)) + return null; + + synchronized (this) { + if(noNeedToUpdate(now)) + return null; + List allApps = appsService.getAppsFullList(); + Map newAppsMap = new HashMap(); + 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/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchService.java new file mode 100644 index 00000000..3daeb852 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchService.java @@ -0,0 +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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.List; +import java.util.Map; + +import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem; +import org.openecomp.portalapp.portal.transport.CommonWidget; +import org.openecomp.portalapp.portal.transport.CommonWidgetMeta; + +public interface DashboardSearchService { + public Map> searchResults(String userId, String searchString); + public List getRelatedUsers(String userId); + public List getRelatedUserVOs(String orgUserId); + + 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/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchServiceImpl.java new file mode 100644 index 00000000..bf0fc447 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchServiceImpl.java @@ -0,0 +1,238 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem; +import org.openecomp.portalapp.portal.transport.CommonWidget; +import org.openecomp.portalapp.portal.transport.CommonWidgetMeta; +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.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +@Component +@Transactional +public class DashboardSearchServiceImpl implements DashboardSearchService{ + + private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DashboardSearchServiceImpl.class); + + @Autowired + private DataAccessService dataAccessService; + + @SuppressWarnings("unchecked") + public Map> searchResults(String orgUserId, String searchString){ + + Map params = new HashMap<>(); + params.put("userId", orgUserId); + params.put("searchQuery", searchString); + // Named query is stored in a *.hbm.xml file, mapped to SearchResultItem + @SuppressWarnings("unchecked") + List list = dataAccessService.executeNamedQuery("searchPortal", params, null); + Map> finalJson = null; + if (list.size() > 0) { + finalJson = new HashMap>(); + for (SearchResultItem thisResult : list) { + List thisList = finalJson.get(thisResult.getCategory().toLowerCase()); + if (thisList == null) + thisList = new ArrayList(); + thisList.add(thisResult); + finalJson.put(thisResult.getCategory().toLowerCase(), thisList); + } + } + return finalJson; + + } + + @SuppressWarnings("unchecked") + @Override + public List getRelatedUsers(String orgUserId) { + + Map params = new HashMap<>(); + + params.put("org_user_id", orgUserId); + + List activeUsers = null; + + try{ + activeUsers = dataAccessService.executeNamedQuery("relatedUsers", params, null); + } + catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + + return activeUsers; + } + + @SuppressWarnings("unchecked") + @Override + public List getRelatedUserVOs(String orgUserId) { + + Map params = new HashMap<>(); + + params.put("org_user_id", orgUserId); + + List activeUsers = null; + + try{ + activeUsers = dataAccessService.executeNamedQuery("relatedUserVOs", params, null); + } + catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + + return activeUsers; + } + + + @SuppressWarnings("unchecked") + @Override + public CommonWidgetMeta getWidgetData(String resourceType) { + + List widgetItems = null; + try{ + Map params = new HashMap<>(); + params.put("cat", resourceType); + widgetItems = (List)dataAccessService.executeNamedQuery("getCommonWidgetItem", params, null); + + /*widgetItems2 = new ArrayList(); + + for(int i = 0; i < widgetItems.size(); i++){ + CommonWidget2 item = (CommonWidget2)widgetItems.get(i); + widgetItems2.add(new CommonWidget2(item.getCategory(), item.getHref(), item.getTitle(), item.getSortOrder())); + }*/ + } + catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + return new CommonWidgetMeta(resourceType, widgetItems); + } + + @Override + public String saveWidgetDataBulk(CommonWidgetMeta commonMetaWidgetData) { + + try{ + for(CommonWidget widgetData : commonMetaWidgetData.getItems()){ + widgetData.setCategory(commonMetaWidgetData.getCategory()); + dataAccessService.saveDomainObject(widgetData, null); + } + + return "success"; + } + catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + return e.getMessage(); + } + } + + @Override + public String saveWidgetData(CommonWidget commonWidgetData) { + + try{ + + dataAccessService.saveDomainObject(commonWidgetData, null); + return "success"; + } + catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + return e.getMessage(); + } + } + + @Override + public String deleteWidgetData(CommonWidget eventWidget) { + try{ + dataAccessService.deleteDomainObject(eventWidget, null); + return "success"; + } + catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + return e.getMessage(); + } + } + +/* @Override + public EventWidgetMeta getEventWidgetData() { + List widgetItems = null; + try{ + Map params = new HashMap<>(); + widgetItems = (List)dataAccessService.executeNamedQuery("getEventWidgetData", params, null); + + widgetItems2 = new ArrayList(); + + for(int i = 0; i < widgetItems.size(); i++){ + CommonWidget2 item = (CommonWidget2)widgetItems.get(i); + widgetItems2.add(new CommonWidget2(item.getCategory(), item.getHref(), item.getTitle(), item.getSortOrder())); + } + } + catch(Exception e){ + e.printStackTrace(); + } + return new EventWidgetMeta("EVENTS", widgetItems); + } + + @Override + public String saveEventWidgetDataBulk(EventWidgetMeta eventsWidgetData) { + try{ + for(EventWidget widgetData : eventsWidgetData.getItems()){ + widgetData.setCategory(eventsWidgetData.getCategory()); + dataAccessService.saveDomainObject(widgetData, null); + } + + return "success"; + } + catch(Exception e){ + e.printStackTrace(); + return e.getMessage(); + } + } + + @Override + public String saveEventWidgetData(EventWidget eventWidget) { + try{ + dataAccessService.saveDomainObject(eventWidget, null); + return "success"; + } + catch(Exception e){ + e.printStackTrace(); + return e.getMessage(); + } + } + + @Override + public String deleteEventWidgetData(EventWidget eventWidget) { + try{ + dataAccessService.deleteDomainObject(eventWidget, null); + return "success"; + } + catch(Exception e){ + e.printStackTrace(); + return e.getMessage(); + } + } + + */ +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAppService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAppService.java new file mode 100644 index 00000000..4614a2c8 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAppService.java @@ -0,0 +1,164 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.transport.FieldsValidator; +import org.openecomp.portalapp.portal.transport.LocalRole; +import org.openecomp.portalapp.portal.transport.OnboardingApp; +import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem; + +public interface EPAppService { + + /** + * Get all applications adminId is an admin + * + * @param adminId + * - the admin + * @return the admin's applications + */ + List getUserAsAdminApps(EPUser user); + + List getUserByOrgUserIdAsAdminApps(String attuid); + + /** + * Gets all rows and all fields from the fn_app table. + * + * @return list of EPApp objects + */ + List getAppsFullList(); + + /** + * Gets all rows and most fields from the fn_app table. + * + * @return list of EcompApp objects. + */ + List getEcompAppAppsFullList(); + + /** + * Get apps with app app admins + * + * @return + */ + List getAppsAdmins(); + + /** + * Get all apps from fn_app table (index, name, title only). If all is true, + * return active and inactive apps; otherwise, just active apps. + * + * @return List of AppsResponse objects. + */ + List getAllApps(Boolean all); + + UserRoles getUserProfile(String loginId); + + List getAppRoles(Long appId); + + List getAdminApps(EPUser user); + + List getAppsForSuperAdminAndAccountAdmin(EPUser user); + + List getUserRemoteApps(String id); + + /** + * 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 UID + * @return the user's list of applications, which may be empty. + */ + List 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 UID + * @return the user's personalized list of applications, which may be empty. + */ + List 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 UID + * @return the user's personalized list of applications, which may be empty. + */ + List 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 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 getUserAppCatalog(EPUser user); + + List getOnboardingApps(); + + List getEnabledNonOpenOnboardingApps(); + + FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user); + + FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user); + + FieldsValidator deleteOnboardingApp(EPUser user, Long onboardingAppId); + + List transformAppsToEcompApps(List appsList); + + EPApp getApp(Long appId); + + void writeAppsImagesToDiskCacheIfNecessary(); + +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAppServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAppServiceImpl.java new file mode 100644 index 00000000..fd84ec35 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAppServiceImpl.java @@ -0,0 +1,1218 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Base64; +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeSet; + +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.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.onboarding.crossapi.PortalApiConstants; +import org.openecomp.portalsdk.core.onboarding.crossapi.PortalApiProperties; +import org.openecomp.portalsdk.core.onboarding.ueb.Helper; +import org.openecomp.portalsdk.core.onboarding.ueb.TopicManager; +import org.openecomp.portalsdk.core.service.DataAccessService; +import org.openecomp.portalsdk.core.util.CipherUtil; +import org.openecomp.portalsdk.core.util.SystemProperties; +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.EcompApp; +import org.openecomp.portalapp.portal.domain.UserRole; +import org.openecomp.portalapp.portal.domain.UserRoles; +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.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.EPSystemProperties; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem; +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; + +@Service("epAppService") +@Transactional +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPMetricsLog +public class EPAppServiceImpl implements EPAppService { + + private String ECOMP_APP_ID = "1"; + private String SUPER_ADMIN_ROLE_ID = "1"; + private String ACCOUNT_ADMIN_ROLE_ID = "999"; + private String RESTRICTED_APP_ROLE_ID = "900"; + + private static final String PATH_SEPARATOR = "/"; + private static final String webappsBaseFullPath = System.getProperty("catalina.base") + PATH_SEPARATOR + + "wtpwebapps"; + private static final String imageCacheRelativePath = "images" + PATH_SEPARATOR + "cache"; + private String ecompportalPath = null; + private static final Long DUBLICATED_FIELD_VALUE_ECOMP_ERROR = new Long( + EPSystemProperties.DUBLICATED_FIELD_VALUE_ECOMP_ERROR); + + private static final String urlField = "url"; + + private static final String nameField = "name"; + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPAppServiceImpl.class); + + @Autowired + AdminRolesService adminRolesService; + @Autowired + private SessionFactory sessionFactory; + @Autowired + private DataAccessService dataAccessService; + @Autowired + EPUebHelper epUebHelper; + + private String constructImagesCachePath() { + String filePath = System.getProperty("catalina.base"); + File eclipseWebAppDir = new File(webappsBaseFullPath); + + if (eclipseWebAppDir.exists()) { + // Eclipse webapps + filePath += PATH_SEPARATOR + "wtpwebapps"; + } else { + filePath += PATH_SEPARATOR + "webapps"; + } + filePath += PATH_SEPARATOR + SystemProperties.getProperty(EPSystemProperties.ECOMP_CONTEXT_ROOT);; + + return filePath.toString(); + // return SystemProperties.getProperty(SystemProperties.TEMP_PATH); + } + + @PostConstruct + private void init() { + ecompportalPath = constructImagesCachePath(); + writeAppsImagesToDiskCacheIfNecessary(); + + SUPER_ADMIN_ROLE_ID = SystemProperties.getProperty(EPSystemProperties.SYS_ADMIN_ROLE_ID); + ACCOUNT_ADMIN_ROLE_ID = SystemProperties.getProperty(EPSystemProperties.ACCOUNT_ADMIN_ROLE_ID); + ECOMP_APP_ID = SystemProperties.getProperty(EPSystemProperties.ECOMP_APP_ID); + RESTRICTED_APP_ROLE_ID = SystemProperties.getProperty(EPSystemProperties.RESTRICTED_APP_ROLE_ID); + } + + @Override + public List 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 adminApps = dataAccessService.executeSQLQuery(sql, EPApp.class, null); + return adminApps; + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + return null; + } + } else { + logger.error(EELFLoggerDelegate.errorLogger, + "getUserAsAdminApps: only Account Admin may invoke this function!"); + return new ArrayList(); + } + } + + @Override + public List 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 adminApps = dataAccessService.executeSQLQuery(sql, EPApp.class, null); + return adminApps; + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + return null; + } + } + + @Override + public List getAppsFullList() { + @SuppressWarnings("unchecked") + List apps = dataAccessService.getList(EPApp.class, null); + // Write the image to disk in case if it is missing + for (EPApp app : apps) + writeAppImageToDiskCacheIfNecessary(app); + return apps; + } + + @Override + public List getEcompAppAppsFullList() { + return transformAppsToEcompApps(getAppsFullList()); + } + + @Override + public List transformAppsToEcompApps(List appsList) { + List ecompAppList = new ArrayList(); + 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.setRestrictedApp(app.isRestrictedApp()); + ecompAppList.add(ecompApp); + } + return ecompAppList; + } + + @Override + public EPApp getApp(Long appId) { + try { + @SuppressWarnings("unchecked") + List apps = dataAccessService.getList(EPApp.class, " where id = " + appId, null, null); + return (apps.size() > 0) ? apps.get(0) : null; + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + return null; + } + } + + @SuppressWarnings("unchecked") + @Override + public List 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'"; + 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 (ArrayList) dataAccessService.executeSQLQuery(sql, + AppIdAndNameTransportModel.class, null); + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while fetching the adminApps for user " + + user.getLoginId() + ". Details: " + EcompPortalUtils.getStackTrace(e)); + } + } + return new ArrayList(); + } + + @SuppressWarnings("unchecked") + @Override + public List 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'"; + } 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'"; + } + sql = String.format(format, user.getId()); + // sql += " AND app.APP_REST_ENDPOINT IS NOT NULL AND + // app.APP_REST_ENDPOINT <> ''"; + logQuery(sql); + try { + return (ArrayList) dataAccessService.executeSQLQuery(sql, + AppIdAndNameTransportModel.class, null); + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while fetching the adminApps for user " + + user.getLoginId() + ". Details: " + EcompPortalUtils.getStackTrace(e)); + } + } + return new ArrayList(); + } + + private void logQuery(String sql) { + logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql); + } + + public DataAccessService getDataAccessService() { + return dataAccessService; + } + + public void setDataAccessService(DataAccessService dataAccessService) { + this.dataAccessService = dataAccessService; + } + + @Override + public List getAppsAdmins() { + String sql = "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 userrole.ROLE_ID = " + + ACCOUNT_ADMIN_ROLE_ID + " AND apps.ENABLED = 'Y'"; + logQuery(sql); + try { + @SuppressWarnings("unchecked") + List adminApps = dataAccessService.executeSQLQuery(sql, AdminUserApp.class, null); // DataAccessService + // does + // not + // use + // generic + // types. + return aggregateRowsResultsByUserId(adminApps); + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + return null; + } + } + + private List aggregateRowsResultsByUserId(List adminApps) { + HashMap adminUserApplications = new HashMap(); + 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.values()); + } + + @Override + public List 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 apps = all + ? (List) dataAccessService.getList(EPApp.class, " where id != " + ECOMP_APP_ID, "name", null) + : (List) dataAccessService.getList(EPApp.class, " where enabled = 'Y'", "name", null); + List appsModified = new ArrayList(); + for (EPApp app : apps) { + appsModified.add(new AppsResponse(app.getId(), app.getName(), app.isRestrictedApp(), app.getEnabled())); + + // Write the image to disk in case if it is missing + writeAppImageToDiskCacheIfNecessary(app); + } + return appsModified; + } + + @Override + public UserRoles getUserProfile(String loginId) { + String format = "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 = \"%s\";"; + String sql = String.format(format, loginId); + logQuery(sql); + @SuppressWarnings("unchecked") + List userRoleList = dataAccessService.executeSQLQuery(sql, UserRole.class, null); + ArrayList usersRolesList = aggregateUserProfileRowsResultsByRole(userRoleList); + if (usersRolesList == null || usersRolesList.size() < 1) + return null; + + return usersRolesList.get(0); + } + + private ArrayList aggregateUserProfileRowsResultsByRole(List userRoleList) { + HashMap userRoles = new HashMap(); + 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.getRoleId()); + } + return new ArrayList(userRoles.values()); + } + + private boolean isRestrictedApp(Long appId) { + EPApp app = getApp(appId); + return app.isRestrictedApp(); + } + + // For the functional menu edit + @Override + public List getAppRoles(Long appId) { + String sql = ""; + if (isRestrictedApp(appId)) { + sql = "SELECT ROLE_ID, ROLE_NAME from FN_ROLE where ROLE_ID = '" + RESTRICTED_APP_ROLE_ID + "'"; + } else { + sql = "SELECT ROLE_ID, ROLE_NAME from FN_ROLE where APP_ID = '" + appId + "'"; + } + logQuery(sql); + @SuppressWarnings("unchecked") + List appRoles = dataAccessService.executeSQLQuery(sql, LocalRole.class, null); + return appRoles; + } + + private String userAppsQuery(EPUser user) { + StringBuilder query = new StringBuilder(); + if (adminRolesService.isSuperAdmin(user)) { + query.append("SELECT * FROM FN_APP where FN_APP.ENABLED = 'Y'"); + } 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(); + } + + @Override + public List getUserApps(EPUser user) { + List openApps = getOpenApps(); + for (EPApp app : openApps) { + // Write the image to disk in case if it is missing + writeAppImageToDiskCacheIfNecessary(app); + } + + if (user.isGuest()) { + return openApps; + } else { + String sql = userAppsQuery(user); + logQuery(sql); + + TreeSet distinctApps = new TreeSet(); + + @SuppressWarnings("unchecked") + List adminApps = dataAccessService.executeSQLQuery(sql, EPApp.class, null); + for (EPApp app : adminApps) { + // Write the image to disk in case if it is missing + writeAppImageToDiskCacheIfNecessary(app); + + distinctApps.add(app); + } + + for (EPApp app : openApps) { + distinctApps.add(app); + } + + List userApps = new ArrayList(); + userApps.addAll(distinctApps); + return userApps; + } + } + + @Override + public List getPersAdminApps(EPUser user) { + final Map params = new HashMap<>(); + params.put("userId", user.getId()); + // Named query is stored in EP.hbm.xml, mapped to EPApp + @SuppressWarnings("unchecked") + List list = dataAccessService.executeNamedQuery("getPersAdminApps", params, null); + // Why is this necessary? + for (EPApp app : list) + writeAppImageToDiskCacheIfNecessary(app); + return list; + } + + @Override + public List getPersUserApps(EPUser user) { + final Map params = new HashMap<>(); + params.put("userId", user.getId()); + // Named query is stored in EP.hbm.xml, mapped to EPApp + @SuppressWarnings("unchecked") + List list = dataAccessService.executeNamedQuery("getPersUserApps", params, null); + // Why is this necessary? + for (EPApp app : list) + writeAppImageToDiskCacheIfNecessary(app); + return list; + } + + /* + * (non-Javadoc) + * @see org.openecomp.portalapp.portal.service.EPAppService#getAppCatalog(org.openecomp.portalapp.portal.domain.EPUser) + */ + @Override + public List getUserAppCatalog(EPUser user) { + final Map params = new HashMap<>(); + params.put("userId", user.getId()); + // Named query is stored in EP.hbm.xml, mapped to AppCatalogItem + @SuppressWarnings("unchecked") + List 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 getAdminAppCatalog(EPUser user) { + final Map params = new HashMap<>(); + params.put("userId", user.getId()); + // Named query is stored in EP.hbm.xml, mapped to AppCatalogItem + @SuppressWarnings("unchecked") + List list = dataAccessService.executeNamedQuery("getAdminAppCatalog", params, null); + return list; + } + + private List getOpenApps() { + @SuppressWarnings("unchecked") + List openApps = dataAccessService.getList(EPApp.class, " where open='Y' and enabled='Y'", null, null); + return openApps; + } + + @Override + public List getOnboardingApps() { + @SuppressWarnings("unchecked") + List apps = (List) dataAccessService.getList(EPApp.class, " where id!=" + ECOMP_APP_ID, null, + null); + List onboardingAppsList = new ArrayList(); + for (EPApp app : apps) { + OnboardingApp onboardingApp = new OnboardingApp(); + createOnboardingFromApp(app, onboardingApp); + onboardingAppsList.add(onboardingApp); + } + return onboardingAppsList; + } + + @Override + public List getEnabledNonOpenOnboardingApps() { + @SuppressWarnings("unchecked") + List apps = (List) dataAccessService.getList(EPApp.class, + " where enabled = true and open = false and id!=" + ECOMP_APP_ID, null, null); + List onboardingAppsList = new ArrayList(); + for (EPApp app : apps) { + OnboardingApp onboardingApp = new OnboardingApp(); + createOnboardingFromApp(app, onboardingApp); + onboardingAppsList.add(onboardingApp); + } + return onboardingAppsList; + } + + private 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; + } + + @SuppressWarnings("unchecked") + private void validateOnboardingApp(OnboardingApp onboardingApp, FieldsValidator fieldsValidator) { + boolean dublicatedUrl = false; + boolean dublicatedName = false; + List 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 (!dublicatedUrl && app.getUrl().equalsIgnoreCase(onboardingApp.url)) { + dublicatedUrl = true; + if (dublicatedName) { + break; + } + } + if (!dublicatedName && app.getName().equalsIgnoreCase(onboardingApp.name)) { + 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; + } + } + + @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; + } + + @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; + } + 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(); + + // 2) 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(); + + // 3) 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(); + + // 4) 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(); + + // 5) 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(); + + // 6) Remove any widgets associated with this app + sql = "delete from fn_widget where app_id='" + appid + "'"; + logQuery(sql); + query = localSession.createSQLQuery(sql); + query.executeUpdate(); + + // Remove any selections in the personalization table + sql = "delete from fn_pers_user_app_sel 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) { + EPLogUtil.logEcompError(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. + private 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 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 + private 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) { + EcompPortalUtils.rollbackTransaction(transaction, + "updateApp rollback, exception = " + EcompPortalUtils.getStackTrace(e)); + } finally { + EcompPortalUtils.closeLocalSession(localSession, "updateApp"); + } + if (!result) { + fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + + } else { + 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(); + 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(); + boolean isProductionBuild = EcompPortalUtils.isProductionBuild(); + String appMailboxName = null; + + int maxNumAttemptsToCreateATopic = 3; + boolean successfullyCreatedMailbox = false; + for (int i = 0; i < maxNumAttemptsToCreateATopic; i++) { + if (isProductionBuild) { + appMailboxName = "ECOMP-PORTAL-OUTBOX-" + (int) (Math.random() * 100000.0); + } else { + appMailboxName = "ECOMP-PORTAL-OUTBOX-TEST-" + (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) { + String stackTrace = EcompPortalUtils.getStackTrace(e); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebConnectionError, e.getMessage()); + if (e.getStatusCode() == 409) { + logger.error(EELFLoggerDelegate.errorLogger, + "Topic/mailbox " + appMailboxName + + " already exists. Will try using a different name, Details: " + + stackTrace); + } else { + logger.error(EELFLoggerDelegate.errorLogger, + "HttpException when onboarding App: " + stackTrace); + } + } + } + + 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 subcriber of it's 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) { + String stackTrace = EcompPortalUtils.getStackTrace(e); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebRegisterOnboardingAppError, + e.getMessage()); + logger.error(EELFLoggerDelegate.errorLogger, + "Error when configuring Publisher/Subscriber for App's new mailbox " + + stackTrace); + 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.debug(EELFLoggerDelegate.debugLogger, "exception: " + e.toString()); + logger.debug(EELFLoggerDelegate.debugLogger, "exception.cause: " + e.getCause()); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebRegisterOnboardingAppError, e.getMessage()); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + EcompPortalUtils.rollbackTransaction(transaction, + "updateApp rollback, exception = " + EcompPortalUtils.getStackTrace(e)); + } finally { + EcompPortalUtils.closeLocalSession(localSession, "updateApp"); + } + if (!result) { + fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + } + } + } + + private 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 = this.decryptedPassword(app.getAppPassword(), app); + onboardingApp.uebTopicName = app.getUebTopicName(); + onboardingApp.uebKey = app.getUebKey(); + onboardingApp.uebSecret = app.getUebSecret(); + onboardingApp.setRestrictedApp(app.isRestrictedApp()); + + if (app.getThumbnail() != null) { + onboardingApp.thumbnail = new String(Base64.getEncoder().encode(app.getThumbnail())); + // Write the image to disk in case if it is missing + writeAppImageToDiskCacheIfNecessary(app); + } + } + + private EPApp createAppFromOnboarding(EPApp app, OnboardingApp onboardingApp, Session localSession) { + logger.debug(EELFLoggerDelegate.debugLogger, "LR: entering createAppFromOnboarding"); + 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.setRestrictedApp(onboardingApp.restrictedApp); + if (!StringUtils.isEmpty(onboardingApp.thumbnail)) { + logger.debug(EELFLoggerDelegate.debugLogger, "LR: onboarding thumbnail is NOT empty"); + String[] splitBase64Thumbnail = onboardingApp.thumbnail.split("base64,"); + if (splitBase64Thumbnail != null) { + logger.debug(EELFLoggerDelegate.debugLogger, + "LR: 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, "LR: finished calling decode"); + deleteOldImageFromDisk(app); + saveNewImageToDisk(app, onboardingApp, decodedImage); + app.setThumbnail(decodedImage); + } + } else if (app.getThumbnail() != null) { + // The thumbnail that came in from the json is empty; the previous + // thumbnail is NOT empty. Must delete it. + logger.debug(EELFLoggerDelegate.debugLogger, "LR: onboarding thumbnail is empty; db thumbnail is NOT null"); + deleteOldImageFromDisk(app); + app.setThumbnail(null); + } else { + logger.debug(EELFLoggerDelegate.debugLogger, "LR: onboarding thumbnail is empty; db thumbnail is null"); + } + return app; + } + + private void deleteOldImageFromDisk(EPApp app) { + if (app.getImageUrl() != null) { + String oldImageFullFilePath = ecompportalPath + PATH_SEPARATOR + app.getImageUrl(); + try { + File oldFile = new File(oldImageFullFilePath); + if (oldFile.exists() && oldFile.delete()) { + app.setImageUrl(null); + logger.debug(EELFLoggerDelegate.debugLogger, + "old file " + oldImageFullFilePath + " was successfully deleted"); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "old file " + oldImageFullFilePath + " delete failure", + EcompPortalUtils.getStackTrace(e)); + } + } + } + + // No need to optimize this code since it happens only when adding/modifying + // an application. + private void saveNewImageToDisk(EPApp app, OnboardingApp onboardingApp, byte[] decodedImage) { + // Notice!!! + // using separator did not worked on WINDOWS as the database was saved + // as assets\images\tmp\ which the UI did not understand thus ichanged + // it to "/" + String imageFileName = constructImageName(onboardingApp); + String imageRelativeFilePath = imageCacheRelativePath + PATH_SEPARATOR + imageFileName; + String imageFullFilePath = ecompportalPath + PATH_SEPARATOR + imageRelativeFilePath; + logger.debug(EELFLoggerDelegate.debugLogger, + "saving app " + onboardingApp.name + " image to " + imageFullFilePath); + + FileOutputStream osf = null; + try { + // Base64 Image example: 'data:image/png;base64,AAAFBfj42Pj4' + logger.info(EELFLoggerDelegate.debugLogger, "Saving new image: " + decodedImage); + osf = writeImageAsBase64(decodedImage, imageFullFilePath); + app.setImageUrl(imageRelativeFilePath); + logger.debug(EELFLoggerDelegate.debugLogger, + "saveBlobImageToDisk onboardingAppImageUrl = " + imageRelativeFilePath); + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger, "failed to save image to " + imageFullFilePath, + EcompPortalUtils.getStackTrace(e)); + } finally { + if (osf != null) { + try { + osf.close(); + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger, + "failed to close outpoot stream for image " + imageFullFilePath, + EcompPortalUtils.getStackTrace(e)); + } + } + } + } + + private FileOutputStream writeImageAsBase64(byte[] decodedImage, String imageFullFilePath) + throws FileNotFoundException, IOException { + FileOutputStream osf; + File of = new File(imageFullFilePath); + osf = new FileOutputStream(of); + osf.write(decodedImage); + osf.flush(); + return osf; + } + + private 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, "Unable to decrypt, App name = " + app.getName(), + EcompPortalUtils.getStackTrace(e)); + } + } + return result; + } + + private 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, "Unable to encrypt, App name = " + app, + EcompPortalUtils.getStackTrace(e)); + } + } + return result; + } + + public void writeAppsImagesToDiskCacheIfNecessary() { + List apps = getAppsFullList(); + for (EPApp app : apps) { + String imageFullFilePath = ecompportalPath + PATH_SEPARATOR + app.getImageUrl(); + File f = new File(imageFullFilePath); + if (f.exists() && !f.isDirectory()) { + continue;// logger.debug("verified existence."); + } + + if (app.getThumbnail() == null) { + logger.debug(EELFLoggerDelegate.debugLogger, + "no thumbnail blob available for this app, cannot write to disk " + app.getName()); + continue; + } + + FileOutputStream osf = null; + try { + logger.info(EELFLoggerDelegate.debugLogger, + "Rewriting image for " + app.getName() + " from db to: " + imageFullFilePath); + osf = writeImageAsBase64(app.getThumbnail(), imageFullFilePath); + logger.debug(EELFLoggerDelegate.debugLogger, "missing, wrote to disk."); + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger, "failed to save image to " + imageFullFilePath, + EcompPortalUtils.getStackTrace(e)); + } finally { + try { + if (osf != null) + osf.close(); + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger, + "writeAppsImagesToDiskCacheIfNecessary: failed to close output stream for image " + + imageFullFilePath, + EcompPortalUtils.getStackTrace(e)); + } + } + } + } + + private void writeAppImageToDiskCacheIfNecessary(EPApp app) { + if (app == null || app.getImageUrl() == null) { + return; + } + + String imageFullFilePath = ecompportalPath + PATH_SEPARATOR + app.getImageUrl(); + File f = new File(imageFullFilePath); + + // Image file + if (f.exists() && !f.isDirectory()) { + return;// logger.debug("verified existence."); + } + + if (app.getThumbnail() == null) { + logger.debug(EELFLoggerDelegate.debugLogger, + "no thumbnail blob available for this app, cannot write to disk " + app.getName()); + return; + } + + FileOutputStream osf = null; + try { + logger.info(EELFLoggerDelegate.debugLogger, + "Rewriting image for " + app.getName() + " from db to: " + imageFullFilePath); + osf = writeImageAsBase64(app.getThumbnail(), imageFullFilePath); + logger.debug(EELFLoggerDelegate.debugLogger, "missing, wrote to disk."); + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger, "failed to save image to " + imageFullFilePath, + EcompPortalUtils.getStackTrace(e)); + } finally { + try { + if (osf != null) + osf.close(); + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger, + "writeAppsImagesToDiskCacheIfNecessary: failed to close output stream for image " + + imageFullFilePath, + EcompPortalUtils.getStackTrace(e)); + } + } + } + + @Override + public List 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 distinctApps = new TreeSet(); + + @SuppressWarnings("unchecked") + List adminApps = dataAccessService.executeSQLQuery(query.toString(), EPApp.class, null); + for (EPApp app : adminApps) { + // Write the image to disk in case if it is missing + writeAppImageToDiskCacheIfNecessary(app); + + distinctApps.add(app); + } + + List userApps = new ArrayList(); + userApps.addAll(distinctApps); + return userApps; + + } + +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAuditService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAuditService.java new file mode 100644 index 00000000..7983467b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAuditService.java @@ -0,0 +1,26 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.Date; + +public interface EPAuditService { + public Date getGuestLastLogin(String attuid); +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAuditServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAuditServiceImpl.java new file mode 100644 index 00000000..9d478fc1 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPAuditServiceImpl.java @@ -0,0 +1,74 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + + +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.service.DataAccessService; +import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; + +@Service("epAuditService") +@Transactional +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPMetricsLog +public class EPAuditServiceImpl implements EPAuditService { + + @Autowired + private DataAccessService dataAccessService; + + @Override + /* get the guest last login time with attuid as param. + * If record not found in table, return null. + * + */ + public Date getGuestLastLogin(String attuid) { + Map params = new HashMap<>(); + params.put("attuid", attuid); + List list = getDataAccessService().executeNamedQuery("getGuestLastLogin", params, null); + Date date=null; + if(list!=null){ + if(list.size()==1) /* if list only contains one item, meaning this is the first time user logs in or record not found in db*/ + 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; + } + + public DataAccessService getDataAccessService() { + return dataAccessService; + } + + public void setDataAccessService(DataAccessService dataAccessService) { + this.dataAccessService = dataAccessService; + } + + +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLdapService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLdapService.java new file mode 100644 index 00000000..8418bec1 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLdapService.java @@ -0,0 +1,31 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 orgUserId) throws Exception; + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLdapServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLdapServiceImpl.java new file mode 100644 index 00000000..7cf5965a --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLdapServiceImpl.java @@ -0,0 +1,287 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.EPSystemProperties; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +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 orgUserId) 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(EPSystemProperties.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) { + String stackTrace = EcompPortalUtils.getStackTrace(ne); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing the LDAP search. Details: " + stackTrace); + } catch(Exception e) { + String stackTrace = EcompPortalUtils.getStackTrace(e); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing the LDAP search. Details: " + stackTrace); + } + 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) { + String stackTrace = EcompPortalUtils.getStackTrace(e); + logger.error(EELFLoggerDelegate.errorLogger, "An error occurred while processing the following user from POST with an userId of " + user.getOrgUserId()); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occcurred while processing LDAP search results, Details: " + stackTrace); + } catch(Exception e) { + String stackTrace = EcompPortalUtils.getStackTrace(e); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occcurred while processing LDAP search results, Details: " + stackTrace); + } + + return user; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLoginService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLoginService.java new file mode 100644 index 00000000..4d0337a5 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLoginService.java @@ -0,0 +1,42 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 { + + // validate user exists in the system + @SuppressWarnings("rawtypes") + EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFilename, HashMap additionalParams) throws Exception; + + @SuppressWarnings("rawtypes") + EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFilename, HashMap additionalParams, boolean matchPassword) throws Exception; + + public EPUser findUserWithoutPwd(String loginId); + + @SuppressWarnings("rawtypes") + public EPLoginBean findUserWithoutPassword(EPLoginBean bean, String menuPropertiesFilename, HashMap additionalParams ) throws Exception; +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLoginServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLoginServiceImpl.java new file mode 100644 index 00000000..48e06be6 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPLoginServiceImpl.java @@ -0,0 +1,235 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.Set; + +import org.openecomp.portalapp.command.EPLoginBean; +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.portalapp.portal.logging.format.EPAppMessagesEnum; +import org.openecomp.portalapp.portal.logging.logic.EPLogUtil; +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.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); + + @SuppressWarnings("unused") + private MenuBuilder menuBuilder; + + @Autowired + private DataAccessService dataAccessService; + + + @SuppressWarnings("rawtypes") + public EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFilename, HashMap additionalParams ) throws Exception { + return findUser(bean, menuPropertiesFilename, additionalParams, true); + } + + @SuppressWarnings("rawtypes") + public EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFilename, 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()); + } + + if (user != null) { + + // raise an error if the 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(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(EPAppMessagesEnum.BeUserInactiveWarning, user.getLoginId()); + } + +/* + * Original SDK from QUANTUM + boolean hasActiveRole = false; + Iterator roles = user.getRoles().iterator(); + while (roles.hasNext()) { + Role role = (Role) roles.next(); + hasActiveRole = true; + if (role.getActive()) { + break; + } + } + */ + + // raise an error if no active roles exist for the user + if (!userHasActiveRoles(user.getEPUserApps())) { + bean.setLoginErrorMessage(SystemProperties.MESSAGE_KEY_LOGIN_ERROR_USER_INACTIVE); + } + + // 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); + + // update the audit log of the user + // Check for the client device type and set log attributes appropriately + + // save the above changes to the User and their audit trail + + // create the application menu based on the user's privileges + Set appMenu = getMenuBuilder().getMenu(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_SET_NAME), dataAccessService); + bean.setMenu(appMenu != null ? appMenu : new HashSet()); + Set businessDirectMenu = getMenuBuilder().getMenu(SystemProperties.getProperty(SystemProperties.BUSINESS_DIRECT_MENU_SET_NAME), dataAccessService); + bean.setBusinessDirectMenu(businessDirectMenu != null ? businessDirectMenu : new HashSet()); + + bean.setUser(userCopy); + } + + } else { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeUserMissingError, bean.getOrgUserId()); + } + + + return bean; + } + + private boolean userHasActiveRoles(Set userApps) { + for (EPUserApp userApp : userApps) { + if (userApp.getRole().getActive()) { + return true; + } + } + return false; + } + + @SuppressWarnings("rawtypes") + public EPLoginBean findUserWithoutPassword(EPLoginBean bean, String menuPropertiesFilename, HashMap additionalParams ) throws Exception { + return findUser(bean, menuPropertiesFilename, additionalParams, false); + } + + public EPUser findUser(String loginId, String password) { + List list = null; + + StringBuffer criteria = new StringBuffer(); + criteria.append(" where login_id = '").append(loginId).append("'") + .append(" and login_pwd = '").append(password).append("'"); + + try { + list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null); + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + String stackTrace = EcompPortalUtils.getStackTrace(e); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing findUser operation. Details: " + stackTrace); + } + + return (list == null || list.size() == 0) ? null : (EPUser) list.get(0); + } + + @Override + public EPUser findUserWithoutPwd(String loginId) { + List list = null; + + StringBuffer criteria = new StringBuffer(); + criteria.append(" where login_id = '").append(loginId).append("'"); + + try { + list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null); + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + String stackTrace = EcompPortalUtils.getStackTrace(e); + String message = "Exception occurred while performing findUser: '" + loginId + "'. Details: "; + logger.error(EELFLoggerDelegate.errorLogger, message + stackTrace); + } + + return (list == null || list.size() == 0) ? null : (EPUser)list.get(0); + } + + + public EPUser findUser(EPLoginBean bean) { + List list = null; + + StringBuffer criteria = new StringBuffer(); + criteria.append(" where org_user_id = '").append(bean.getOrgUserId()).append("'"); + + try { + list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null); + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + String stackTrace = EcompPortalUtils.getStackTrace(e); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing findUser operation. Details: " + stackTrace); + } + + return (list == null || list.size() == 0) ? null : (EPUser)list.get(0); + } + + + public MenuBuilder getMenuBuilder() { + return new MenuBuilder(); + } + + + public void setMenuBuilder(MenuBuilder menuBuilder) { + this.menuBuilder = menuBuilder; + } + + + public DataAccessService getDataAccessService() { + return dataAccessService; + } + + + public void setDataAccessService(DataAccessService dataAccessService) { + this.dataAccessService = dataAccessService; + } + + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPRoleService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPRoleService.java new file mode 100644 index 00000000..91aa77b1 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPRoleService.java @@ -0,0 +1,32 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +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); + + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPRoleServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPRoleServiceImpl.java new file mode 100644 index 00000000..467b9007 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/EPRoleServiceImpl.java @@ -0,0 +1,149 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +import org.openecomp.portalapp.portal.domain.EPRole; +import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; +import org.openecomp.portalsdk.core.domain.RoleFunction; +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; + +@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 getRoleFunctions() { + //List msgDB = getDataAccessService().getList(Profile.class, null); + return getDataAccessService().getList(RoleFunction.class, null); + } + + @SuppressWarnings("unchecked") + public List getAvailableChildRoles(Long roleId) { + List availableChildRoles = (List)getDataAccessService().getList(EPRole.class,null); + if(roleId==null || roleId==0){ + return availableChildRoles; + } + + EPRole currentRole = (EPRole)getDataAccessService().getDomainObject(EPRole.class,roleId,null); + Set allParentRoles = new TreeSet(); + allParentRoles = getAllParentRolesAsList(currentRole, allParentRoles); + + + Iterator 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 getAllParentRolesAsList(EPRole role, Set allParentRoles) { + Set parentRoles = role.getParentRoles(); + allParentRoles.addAll(parentRoles); + Iterator 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 roles = (List)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; + } + + public void saveRole(EPRole domainRole) { + getDataAccessService().saveDomainObject(domainRole, null); + } + + public void deleteRole(EPRole domainRole) { + getDataAccessService().deleteDomainObject(domainRole, null); + } + + @SuppressWarnings("unchecked") + public List 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/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuService.java new file mode 100644 index 00000000..9de45996 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuService.java @@ -0,0 +1,50 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.List; + +import org.openecomp.portalapp.portal.domain.EPUser; +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.FunctionalMenuItemJson; + +public interface FunctionalMenuService { + List getFunctionalMenuItems (EPUser user); + // return all active menu items + List getFunctionalMenuItems (); + // return all active menu items. If all is true, return all active and inactive menu items. + List getFunctionalMenuItems(Boolean all); + List getFunctionalMenuItemsForApp (Integer appId); + List getFunctionalMenuItemsForUser (String userId); + FunctionalMenuItem getFunctionalMenuItemDetails (Integer menuid); + FieldsValidator createFunctionalMenuItem (FunctionalMenuItemJson menuItemJson); + FieldsValidator editFunctionalMenuItem (FunctionalMenuItemJson menuItemJson); + FieldsValidator deleteFunctionalMenuItem (Long menuId); + FieldsValidator regenerateAncestorTable (); + //Methods relevant to favorites + FieldsValidator setFavoriteItem(FavoritesFunctionalMenuItem menuItemJson); + List getFavoriteItems(Long userId); + FieldsValidator removeFavoriteItem (Long userId, Long menuId); + //Assign URLs under Help Menu + void assignHelpURLs(List menuItems); +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuServiceImpl.java new file mode 100644 index 00000000..30aaf5d3 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuServiceImpl.java @@ -0,0 +1,862 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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.logging.aop.EPMetricsLog; +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.FunctionalMenuItemJson; +import org.openecomp.portalapp.portal.transport.FunctionalMenuRole; +import org.openecomp.portalapp.portal.utils.EPSystemProperties; +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(EPSystemProperties.ACCOUNT_ADMIN_ROLE_ID)); + RESTRICTED_APP_ROLE_ID = SystemProperties.getProperty(EPSystemProperties.RESTRICTED_APP_ROLE_ID); + } catch(Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + } + + public List getFunctionalMenuItems(EPUser user) { + List menuItems = new ArrayList(); + return menuItems; + } + + public List getFunctionalMenuItems() { + return getFunctionalMenuItems(false); + } + + public List 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 " + + "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 " + + " FROM fn_menu_functional m " + + " WHERE m.url='' " + + activeWhereClause; //" AND UPPER(m.active_yn) = 'Y' "; + logQuery(sql); + + @SuppressWarnings("unchecked") + List 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 " + + activeWhereClause //" AND UPPER(m.active_yn) = 'Y' " + + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID + "' "; + logQuery(sql); + @SuppressWarnings("unchecked") + List menuItems2 = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null); + for (FunctionalMenuItem menuItem : menuItems2) { + menuItem.restrictedApp = true; + menuItems.add(menuItem); + } + + return menuItems; + } + + public List 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 menuItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null); + + return menuItems; + } + + public List 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 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 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 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 roleItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuRole.class, null); + if (roleItems.size() > 0) { + Integer appid = roleItems.get(0).appId; + menuItem.appid = appid; + List roles = new ArrayList(); + for (FunctionalMenuRole roleItem : roleItems) { + logger.debug(EELFLoggerDelegate.debugLogger, "LR: app_id: " + roleItem.appId + "; role_id: " + roleItem.roleId + "\n"); + roles.add(roleItem.roleId); + } + menuItem.roles = roles; + } + + return menuItem; + } + + private FieldsValidator menuItemFieldsChecker(FunctionalMenuItemJson menuItemJson) { + FieldsValidator fieldsValidator = new FieldsValidator(); + try { + // TODO: validate all the fields + @SuppressWarnings("unchecked") + List 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(EPSystemProperties.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.roles == null || menuItemJson.roles.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, "Exception occurred while validating the FunctionalMenuItems. Details: " + EcompPortalUtils.getStackTrace(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(FunctionalMenuItemJson 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.roles = menuItemJson.roles; + 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) { + EcompPortalUtils.rollbackTransaction(transaction, + "createFunctionalMenuItem rollback, exception = " + e); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } 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(FunctionalMenuItemJson menuItemJson, Session localSession) { + logger.debug(EELFLoggerDelegate.debugLogger, "entering addRoles."); + List roles = menuItemJson.roles; + 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 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 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 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 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(FunctionalMenuItemJson 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.roles != null && !menuItemJson.roles.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.roles = menuItemJson.roles; + 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.roles == null || menuItemJson.roles.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) { + EcompPortalUtils.rollbackTransaction(transaction, + "createFunctionalMenuItem rollback, exception = " + e); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } 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) { + EcompPortalUtils.rollbackTransaction(transaction, + "deleteFunctionalMenuItem rollback, exception = " + e); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } 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) { + EcompPortalUtils.rollbackTransaction(transaction, + "regenerateAncestorTable rollback, exception = " + e); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + 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) { + EcompPortalUtils.rollbackTransaction(transaction,"setFavoriteItem rollback, exception = " + e); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } finally { + EcompPortalUtils.closeLocalSession(localSession, "setFavoriteItem"); + } + + if(result) { + } + else { + fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + + return fieldsValidator; + } + + public List 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 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 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, "Exception occurred in FunctionalMenuServiceImpl.getFavoriteItems. Details: " + EcompPortalUtils.getStackTrace(e)); + List menuItems = new ArrayList(); + 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) { + EcompPortalUtils.rollbackTransaction(transaction,"removeFavoriteItem rollback, exception = " + e); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } finally { + EcompPortalUtils.closeLocalSession(localSession, "removeFavoriteItem"); + } + + if(result) { + } + else { + fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + + return fieldsValidator; + } + + @Override + public void assignHelpURLs(List menuItems) { + try { + String user_guide_link = SystemProperties.getProperty(EPSystemProperties.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. Details: " + EcompPortalUtils.getStackTrace(e)); + } + + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/GetAccessService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/GetAccessService.java new file mode 100644 index 00000000..c4ddc75e --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/GetAccessService.java @@ -0,0 +1,32 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.List; + +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 getAppAccessList(); +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/GetAccessServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/GetAccessServiceImpl.java new file mode 100644 index 00000000..a4e36337 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/GetAccessServiceImpl.java @@ -0,0 +1,50 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.List; + +import org.openecomp.portalapp.portal.domain.GetAccessResult; +import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; +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("getAccessService") +@Transactional +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPMetricsLog +public class GetAccessServiceImpl implements GetAccessService{ + + @Autowired + private DataAccessService dataAccessService; + + @SuppressWarnings("unchecked") + @Override + public List getAppAccessList() { + List appAccessList = (List) dataAccessService + .executeNamedQuery("getAppAccessFunctionRole", null, null); + return appAccessList; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ManifestService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ManifestService.java new file mode 100644 index 00000000..263811dc --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ManifestService.java @@ -0,0 +1,34 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/service/ManifestServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ManifestServiceImpl.java new file mode 100644 index 00000000..fe2895d8 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/ManifestServiceImpl.java @@ -0,0 +1,65 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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("manifestService") +@EnableAspectJAutoProxy +@EPMetricsLog +public class ManifestServiceImpl implements ManifestService { + + + @Autowired + ServletContext context; + + + // * (non-Javadoc) + // * + + 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/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppService.java new file mode 100644 index 00000000..8096bc3c --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppService.java @@ -0,0 +1,24 @@ +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 select + * True or false + */ + void setPersUserAppValue(EPUser user, EPApp app, boolean select, boolean pending); + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppServiceImpl.java new file mode 100644 index 00000000..5a67dee7 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppServiceImpl.java @@ -0,0 +1,117 @@ +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; + + + @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 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 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 && !adminUserHasAppRole) { + // The special case: portal admin, no role + 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 + } + } + } + +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminService.java new file mode 100644 index 00000000..5cf52e51 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminService.java @@ -0,0 +1,31 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 getPortalAdmins (); + FieldsValidator createPortalAdmin(String orgUserId); + FieldsValidator deletePortalAdmin(Long userId); +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminServiceImpl.java new file mode 100644 index 00000000..d8e427fd --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminServiceImpl.java @@ -0,0 +1,179 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +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.openecomp.portalapp.portal.domain.EPUser; +import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog; +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.EPSystemProperties; +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("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; + + @PostConstruct + private void init() { + SYS_ADMIN_ROLE_ID = SystemProperties.getProperty(SystemProperties.SYS_ADMIN_ROLE_ID); + ECOMP_APP_ID = SystemProperties.getProperty(EPSystemProperties.ECOMP_APP_ID); + } + + public List getPortalAdmins() { + 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.role_id=" + SYS_ADMIN_ROLE_ID; + logQuery(sql); + + @SuppressWarnings("unchecked") + List portalAdmins = dataAccessService.executeSQLQuery(sql, PortalAdmin.class, null); + logger.debug(EELFLoggerDelegate.debugLogger, portalAdmins.toString()); + return portalAdmins; + + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing getPortalAdmins operation, Details: " + EcompPortalUtils.getStackTrace(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 localUserList = dataAccessService.getList(EPUser.class, " where org_user_id='" + orgUserId + "'", + null, null); + if (localUserList.size() > 0) { + user = localUserList.get(0); + } else { + 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); + } + } + 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); + } +// logger.debug(EELFLoggerDelegate.debugLogger, "after saving menu object, new id: " + userId); + + transaction.commit(); + result = true; + } catch (Exception e) { + EcompPortalUtils.rollbackTransaction(transaction, + "createPortalAdmin rollback, exception = " + e); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } 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; + } + + public FieldsValidator deletePortalAdmin(Long userId) { + FieldsValidator fieldsValidator = new FieldsValidator(); + logger.debug(EELFLoggerDelegate.debugLogger, "LR: 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 = true; + } catch (Exception e) { + EcompPortalUtils.rollbackTransaction(transaction, + "deletePortalAdmin rollback, exception = " + e); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } finally { + EcompPortalUtils.closeLocalSession(localSession, "deletePortalAdmin"); + } + if (result) { + } else { + logger.debug(EELFLoggerDelegate.debugLogger, "LR: deletePortalAdmin: no result. setting httpStatusCode to " + + HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + return fieldsValidator; + } + + private void logQuery(String sql) { + logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql); + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java new file mode 100644 index 00000000..5254e20b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java @@ -0,0 +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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +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 searchUsersInFnTable(String searchString); + + public List searchUsersByName(EPUser attrUser); + + public List searchUsersByUserId(EPUser attrUser); + + public EPUser searchUserByUserId(String orgUserId); + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java new file mode 100644 index 00000000..020b7496 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java @@ -0,0 +1,188 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 searchUsersInFnTable(String searchString) { + String orgUserId = null; + List 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 resultOfSearch = new ArrayList(), 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, "searchUsersInPhoneBook Exception = " + EcompPortalUtils.getStackTrace(e)); + } + return result; + } + + + @SuppressWarnings("rawtypes") + public List searchUsersByUserId(EPUser attrUser) { + List foundUsers = new ArrayList(); + 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, "searchInPhoneBookWithToken Exception = " + EcompPortalUtils.getStackTrace(e)); + } + return foundUsers; + } + + @SuppressWarnings("rawtypes") + public List searchUsersByName(EPUser attrUser) { + List foundUsers = new ArrayList(); + 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, "searchInPhoneBookWithToken Exception = " + EcompPortalUtils.getStackTrace(e)); + } + return foundUsers; + } + + private List removeWrongFirstNames(List 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 removeWrongLastNames(List 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 cutSearchResultToMaximumSize(List resultOfSearch) { + for (int i = resultOfSearch.size() - 1; i >= maxSizeOfSearchResult; i--) { + resultOfSearch.remove(i); + } + return resultOfSearch; + } + + + @SuppressWarnings("rawtypes") + @Override + public EPUser searchUserByUserId(String orgUserId) { + List foundUsers = new ArrayList(); + 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, "searchInPhoneBookWithToken Exception = " + EcompPortalUtils.getStackTrace(e)); + } + return foundUsers.get(0); + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SharedContextService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SharedContextService.java new file mode 100644 index 00000000..647c9d1b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SharedContextService.java @@ -0,0 +1,98 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 via Hibernate. + */ +public interface SharedContextService { + + /** + * Gets all shared context objects for the specified context ID. + * + * @return List of SharedContext objects + */ + List 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 in the database with the specified context + * ID, key and value. + * + * @param context + * SharedContext object to save. + * @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 to the database. + * + * @param context + * SharedContext object to save. + */ + void saveSharedContext(SharedContext context); + + /** + * Deletes the specified shared context from the database. + * + * @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 that are older (judged from creation + * timestamp) than the specified value. + * + * @param ageInSeconds + * Expiration threshold in seconds + */ + void expireSharedContexts(int ageInSeconds); + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SharedContextServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SharedContextServiceImpl.java new file mode 100644 index 00000000..02e6f8bf --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/SharedContextServiceImpl.java @@ -0,0 +1,173 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.openecomp.portalapp.portal.domain.SharedContext; +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; + +/** + * 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; + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SharedContextServiceImpl.class); + + /* + * (non-Javadoc) + * + * @see org.openecomp.portalsdk.core.service.SharedContextService#getSharedContexts() + */ + @Override + @SuppressWarnings("unchecked") + public List getSharedContexts(String contextId) { + List restrictionsList = new ArrayList(); + Criterion contextIdCrit = Restrictions.eq("context_id", contextId); + restrictionsList.add(contextIdCrit); + List contexts = (List) 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 restrictionsList = new ArrayList(); + Criterion contextIdCrit = Restrictions.eq("context_id", contextId); + Criterion keyCrit = Restrictions.eq("ckey", key); + restrictionsList.add(contextIdCrit); + restrictionsList.add(keyCrit); + @SuppressWarnings("unchecked") + List contexts = (List) 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 + */ + @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 contexts = getSharedContexts(contextId); + if (contexts == null) + return 0; + + 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); + 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/src/main/java/org/openecomp/portalapp/portal/service/UserRolesService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserRolesService.java new file mode 100644 index 00000000..d0964a88 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserRolesService.java @@ -0,0 +1,58 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.List; + +import org.apache.cxf.transport.http.HTTPException; +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.transport.AppWithRolesForUser; +import org.openecomp.portalapp.portal.transport.RoleInAppForUser; +import org.openecomp.portalapp.portal.transport.UserApplicationRoles; + +public interface UserRolesService { + + public List getAppRolesForUser(Long appId, String userId); + + public boolean setAppWithUserRoleStateForUser(EPUser user, AppWithRolesForUser newAppRolesForUser); + + public List getUsersFromAppEndpoint(Long appId) throws HTTPException; + + public List 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 getCachedAppRolesForUser(Long appId, Long userId); + + public String updateRemoteUserProfile(String orgUserId, Long appId); + + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserRolesServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserRolesServiceImpl.java new file mode 100644 index 00000000..340c2d1a --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserRolesServiceImpl.java @@ -0,0 +1,656 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +import javax.annotation.PostConstruct; + +import org.apache.commons.lang.StringUtils; +import org.apache.cxf.transport.http.HTTPException; +import org.hibernate.Query; +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.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.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.FunctionalMenuItem; +import org.openecomp.portalapp.portal.transport.FunctionalMenuRole; +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.EPSystemProperties; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +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.UserProfileService; +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; +import org.springframework.transaction.annotation.Transactional; + +import com.fasterxml.jackson.core.JsonProcessingException; +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 implements UserRolesService { + private static Long ACCOUNT_ADMIN_ROLE_ID = 999L; + + private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserRolesServiceImpl.class); + + @Autowired + private SessionFactory sessionFactory; + @Autowired + private DataAccessService dataAccessService; + @Autowired + SearchService searchService; + @Autowired + EPAppService appsService; + @Autowired + EPLdapService ldapService; + @Autowired + ApplicationsRestClientService applicationsRestClientService; + @Autowired + EPRoleService epRoleService; + @Autowired + UserProfileService userProfileService; + + @PostConstruct + private void init() { + try { + ACCOUNT_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPSystemProperties.ACCOUNT_ADMIN_ROLE_ID)); + } catch(Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + } + + private static HashMap hashMapFromEcompRoles(EcompRole[] ecompRoles) { + HashMap result = new HashMap(); + 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; + } + + private void createLocalUserIfNecessary(String orgUserId) { + if (StringUtils.isEmpty(orgUserId)) { + logger.error(EELFLoggerDelegate.errorLogger, "createLocalUserIfNecessary : empty orgUserId!"); + return; + } + Session localSession = null; + Transaction transaction = null; + try { + localSession = sessionFactory.openSession(); + transaction = localSession.beginTransaction(); + @SuppressWarnings("unchecked") + List userList = localSession.createQuery("from " + EPUser.class.getName() + " where org_user_id='" + orgUserId + "'").list(); + if (userList.size() == 0) { + EPUser client = searchService.searchUserByUserId(orgUserId); + if (client == null) { + String msg = "cannot create user " + orgUserId + ", because he cannot be found in phonebook"; + logger.error(EELFLoggerDelegate.errorLogger, msg); + } else { + client.setLoginId(orgUserId); + client.setActive(true); + localSession.save(client); + } + } + transaction.commit(); + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + EcompPortalUtils.rollbackTransaction(transaction, "searchOrCreateUser rollback, exception = " + e); + } finally { + EcompPortalUtils.closeLocalSession(localSession, "searchOrCreateUser"); + } + } + + private static void syncUserRoles(SessionFactory sessionFactory, String orgUserId, Long appId, EcompRole[] userAppRoles) throws Exception { + HashMap newUserAppRolesMap = hashMapFromEcompRoles(userAppRoles); + boolean result = false; + Session localSession = null; + Transaction transaction = null; + + try { + localSession = sessionFactory.openSession(); + transaction = localSession.beginTransaction(); + @SuppressWarnings("unchecked") + List userList = localSession.createQuery("from " + EPUser.class.getName() + " where org_user_id='" + orgUserId + "'").list(); + if (userList.size() > 0) { + EPUser client = userList.get(0); + @SuppressWarnings("unchecked") + List userRoles = localSession + .createQuery("from " + EPUserApp.class.getName() + " where app.id=" + appId + " and userId=" + client.getId()).list(); + for (EPUserApp userRole : userRoles) { + if (! userRole.getRoleId().equals(ACCOUNT_ADMIN_ROLE_ID)) { + + Long userAppRoleId = userRole.getAppRoleId(); + if (!newUserAppRolesMap.containsKey(userAppRoleId)) { + localSession.delete(userRole); + } else { + newUserAppRolesMap.remove(userAppRoleId); + } + } + } + Collection newRolesToAdd = newUserAppRolesMap.values(); + if (newRolesToAdd.size() > 0) { + EPApp app = (EPApp) localSession.get(EPApp.class, appId); + @SuppressWarnings("unchecked") + List roles = localSession.createQuery("from " + EPRole.class.getName() + " where appId=" + appId).list(); + HashMap rolesMap = new HashMap(); + for (EPRole role : roles) { + rolesMap.put(role.getAppRoleId(), role); + } + for (EcompRole userRole : newRolesToAdd) { + EPUserApp userApp = new EPUserApp(); + userApp.setUserId(client.getId()); + userApp.setApp(app); + userApp.setRole(rolesMap.get(userRole.getId())); + localSession.save(userApp); + } + } + } + transaction.commit(); + result = true; + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + EcompPortalUtils.rollbackTransaction(transaction, "Exception occurred in syncUserRoles, Details: " + EcompPortalUtils.getStackTrace(e)); + } finally { + localSession.close(); + if (!result) { + throw new Exception("Exception occurred in syncUserRoles while closing database session for app: '" + appId + "'."); + } + } + } + + // Called when getting the list of roles for the user + private List constructRolesInAppForUserGet(EcompRole[] appRoles, EcompRole[] userAppRoles) { + List rolesInAppForUser = new ArrayList(); + + Set userAppRolesMap = new HashSet(); + if (userAppRoles!=null) { + for (EcompRole ecompRole : userAppRoles) { + userAppRolesMap.add(ecompRole.getId()); + } + } else { + String message = String.format("UserRolesServiceImpl.constructRolesInAppForUserGet has received userAppRoles list empty."); + logger.info(EELFLoggerDelegate.errorLogger, message); + } + + 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 { + String message = String.format("UserRolesServiceImpl.constructRolesInAppForUser has received appRoles list empty."); + logger.info(EELFLoggerDelegate.errorLogger, message); + } + return rolesInAppForUser; + } + public List getAppRolesForUser(Long appId, String orgUserId) { + List rolesInAppForUser = null; + try { + EcompRole[] 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) { + syncAppRoles(sessionFactory, appId, appRoles); + EcompRole[] userAppRoles; + try { + userAppRoles = applicationsRestClientService.get(EcompRole[].class, appId, String.format("/user/%s/roles", orgUserId)); + if (userAppRoles == null) { + if (EcompPortalUtils.getExternalAppResponseCode() == 400) { + EcompPortalUtils.setExternalAppResponseCode(200); + logger.error(EELFLoggerDelegate.errorLogger, "400 returned from /user/{userid}/roles, assuming user doesn't exist, app is framework SDK based, and things are ok. Overriding to 200 until framework SDK returns a useful response."); + logger.debug(EELFLoggerDelegate.debugLogger, "400 returned from /user/{userid}/roles, assuming user doesn't exist, app is framework SDK based, and things are ok. Overriding to 200 until framework SDK returns a useful response."); + } + } + // If the remote application isn't down we MUST to sync user roles here in case we have this user here! + syncUserRoles(sessionFactory, orgUserId, appId, userAppRoles); + } catch (Exception e) { + // TODO: we may need to check if user exists, maybe remote app is down. + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + logger.error(EELFLoggerDelegate.errorLogger, "LR: user " + orgUserId + " does not exist in remote application: " + appId + "."); + userAppRoles = new EcompRole[0]; + } + rolesInAppForUser = constructRolesInAppForUserGet(appRoles, userAppRoles); + // Test this error case, for generating an external app error +// EcompPortalUtils.setResponseCode(404); + } + } catch (Exception e) { + String message = String.format("Received an exception while performing getAppRolesForUser for the User %s, and for the AppId %s, Details: %s", + orgUserId, Long.toString(appId), EcompPortalUtils.getStackTrace(e)); + logger.error(EELFLoggerDelegate.errorLogger, message); + } + return rolesInAppForUser; + + } + + // copies of methods in GetAppsWithUserRoleState + private void syncAppRoles(SessionFactory sessionFactory, Long appId, EcompRole[] appRoles) throws Exception { + logger.debug(EELFLoggerDelegate.debugLogger, "entering syncAppRoles for appId: "+appId); + HashMap newRolesMap = hashMapFromEcompRoles(appRoles); + boolean result = false; + 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 currentAppRoles = localSession.createQuery("from " + EPRole.class.getName() + " where appId=" + appId).list(); + List obsoleteRoles = new ArrayList(); + 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 newRolesToAdd = newRolesMap.values(); + for (EcompRole role : newRolesToAdd) { + logger.debug(EELFLoggerDelegate.debugLogger, "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); + } + if (obsoleteRoles.size() > 0) { + logger.debug(EELFLoggerDelegate.debugLogger, "we have obsolete roles to delete"); + for (EPRole role : obsoleteRoles) { + logger.debug(EELFLoggerDelegate.debugLogger, "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 userRoles = localSession + .createQuery("from " + EPUserApp.class.getName() + " where app.id=" + appId + " and role_id=" + roleId).list(); + + logger.debug(EELFLoggerDelegate.debugLogger, "number of userRoles to delete: "+userRoles.size()); + for (EPUserApp userRole : userRoles) { + logger.debug(EELFLoggerDelegate.debugLogger, "about to delete userRole: "+userRole.toString()); + localSession.delete(userRole); + logger.debug(EELFLoggerDelegate.debugLogger, "finished deleting userRole: "+userRole.toString()); + } + + // Delete from fn_menu_functional_roles + @SuppressWarnings("unchecked") + List funcMenuRoles = localSession + .createQuery("from " + FunctionalMenuRole.class.getName() + " where roleId=" + roleId).list(); + int numMenuRoles = funcMenuRoles.size(); + logger.debug(EELFLoggerDelegate.debugLogger, "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 funcMenuRoles2 = localSession + .createQuery("from " + FunctionalMenuRole.class.getName() + " where menuId=" + menuId).list(); + int numMenuRoles2 = funcMenuRoles2.size(); + logger.debug(EELFLoggerDelegate.debugLogger, "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, "There is exactly 1 menu item for this role, so emptying the url"); + @SuppressWarnings("unchecked") + List 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); + } + } + } + + // Delete from fn_role_function + String sql = "DELETE FROM fn_role_function WHERE role_id="+roleId; + logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql); + Query 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 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(); + + logger.debug(EELFLoggerDelegate.debugLogger, "about to delete the role: "+role.toString()); + localSession.delete(role); + logger.debug(EELFLoggerDelegate.debugLogger, "deleted the role"); + } + } + logger.debug(EELFLoggerDelegate.debugLogger, "about to commit the transaction"); + transaction.commit(); + logger.debug(EELFLoggerDelegate.debugLogger, "committed the transaction"); + result = true; + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError); + EcompPortalUtils.rollbackTransaction(transaction, "Exception occurred in syncAppRoles, Details: " + EcompPortalUtils.getStackTrace(e)); + } finally { + localSession.close(); + if (!result) { + throw new Exception("Exception occurred in syncAppRoles while closing database session for app: '" + appId + "'."); + } + } + } + + // Called when updating the list of roles for the user + private RolesInAppForUser constructRolesInAppForUserUpdate(String orgUserId, Long appId, Set userRolesInRemoteApp) { + RolesInAppForUser result; + result = new RolesInAppForUser(); + result.appId = appId; + result.orgUserId = orgUserId; + 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; + } + + 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 boolean remoteUserShouldBeCreated(List roleInAppForUserList) { + for (RoleInAppForUser roleInAppForUser : roleInAppForUserList) { + if (roleInAppForUser.isApplied.booleanValue()) { + return true; + } + } + return false; + } + + private Set postUsersRolesToRemoteApp(List roleInAppForUserList, ObjectMapper mapper, + ApplicationsRestClientService applicationsRestClientService, Long appId, String orgUserId) throws JsonProcessingException, HTTPException { + Set updatedUserRoles = constructUsersEcompRoles(roleInAppForUserList); + String userRolesAsString = mapper.writeValueAsString(updatedUserRoles); + applicationsRestClientService.post(EcompRole.class, appId, userRolesAsString, String.format("/user/%s/roles", orgUserId)); + // 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 updatedUserRoles; + } + + private Set constructUsersEcompRoles(List roleInAppForUserList) { + Set existingUserRoles = new TreeSet(); + for (RoleInAppForUser roleInAppForUser : roleInAppForUserList) { + if (roleInAppForUser.isApplied) { + EcompRole ecompRole = new EcompRole(); + ecompRole.setId(roleInAppForUser.roleId); + ecompRole.setName(roleInAppForUser.roleName); + existingUserRoles.add(ecompRole); + } + } + return existingUserRoles; + } + + 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 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 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) { + // TODO Auto-generated catch block + e.printStackTrace(); + return "failure"; + } + + return "success"; + + } + + private static final Object syncRests = new Object(); + + @Override + public boolean setAppWithUserRoleStateForUser(EPUser user, AppWithRolesForUser newAppRolesForUser) { + boolean result = false; + String orgUserId = ""; + if (newAppRolesForUser != null && newAppRolesForUser.orgUserId != null) { + orgUserId = newAppRolesForUser.orgUserId.trim(); + } + Long appId = newAppRolesForUser.appId; + List roleInAppForUserList = newAppRolesForUser.appRoles; + if (orgUserId.length() > 0) { + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + try { + EPApp app = appsService.getApp(appId); + EPUser remoteAppUser = getUserFromRemoteApp(orgUserId, app, applicationsRestClientService); + if (remoteAppUser == null) { + if (remoteUserShouldBeCreated(roleInAppForUserList)) { + createNewUserOnRemoteApp(orgUserId, app, applicationsRestClientService, searchService, mapper); + // If we succeed, we know that the new user was persisted on remote app. + remoteAppUser = getUserFromRemoteApp(orgUserId, app, applicationsRestClientService); + if (remoteAppUser == null) { + logger.error(EELFLoggerDelegate.errorLogger, "Failed to persist new user: " + orgUserId + " in remote app. appId = " + appId); +// return null; + } + } + } + if (remoteAppUser != null) { + Set userRolesInRemoteApp = postUsersRolesToRemoteApp(roleInAppForUserList, mapper, applicationsRestClientService, appId, orgUserId); + RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId, appId, userRolesInRemoteApp); + result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser); + } + } catch (Exception e) { + String message = String.format("Failed to create user or update user roles for the User %s, and for the AppId %s, Details: %s", + orgUserId, Long.toString(appId), EcompPortalUtils.getStackTrace(e)); + logger.error(EELFLoggerDelegate.errorLogger, message); + result = false; + } + + } + return result; + } + + // This is for a single app + private boolean applyChangesInUserRolesForAppToEcompDB(RolesInAppForUser rolesInAppForUser) { + boolean result = false; + String orgUserId = rolesInAppForUser.orgUserId; + Long appId = rolesInAppForUser.appId; + synchronized (syncRests) { + if (rolesInAppForUser != null) { + createLocalUserIfNecessary(orgUserId); + } + + if (rolesInAppForUser != null) { + EcompRole[] userAppRoles = new EcompRole[rolesInAppForUser.roles.size()]; + for (int i = 0; i < rolesInAppForUser.roles.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, orgUserId, appId, userAppRoles); + result = true; + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "applyChangesInUserRolesForAppToEcompDB syncUserRoles, orgUserId = " + orgUserId); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + } + } + return result; + } + + @Override + public List getUsersFromAppEndpoint(Long appId) throws HTTPException { + RemoteUserWithRoles[] remoteUsers = applicationsRestClientService.get(RemoteUserWithRoles[].class, appId, "/users"); + ArrayList userApplicationRoles = new ArrayList(); + for (RemoteUserWithRoles remoteUser : remoteUsers) { + UserApplicationRoles userWithRemoteAppRoles = convertToUserApplicationRoles(appId, remoteUser); + if(userWithRemoteAppRoles.roles!=null && userWithRemoteAppRoles.roles.size()>0) { + userApplicationRoles.add(userWithRemoteAppRoles); + } else { + logger.debug(EELFLoggerDelegate.debugLogger, "User " + userWithRemoteAppRoles.orgUserId + " doesn't have any roles assigned to any app."); + } + } + + return userApplicationRoles; + } + + private UserApplicationRoles convertToUserApplicationRoles(Long appId, RemoteUserWithRoles remoteUser) { + UserApplicationRoles userWithRemoteAppRoles = new UserApplicationRoles(); + userWithRemoteAppRoles.appId = appId; + userWithRemoteAppRoles.orgUserId = remoteUser.loginId; + userWithRemoteAppRoles.firstName = remoteUser.firstName; + userWithRemoteAppRoles.lastName = remoteUser.lastName; + userWithRemoteAppRoles.roles = remoteUser.roles; + return userWithRemoteAppRoles; + } + + 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 importRolesFromRemoteApplication(Long appId) throws HTTPException { + EPRole[] appRolesFull = applicationsRestClientService.get(EPRole[].class, appId, "/rolesFull"); + List 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; + } + + @Override + public List 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 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/src/main/java/org/openecomp/portalapp/portal/service/UserService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserService.java new file mode 100644 index 00000000..8fcd5669 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserService.java @@ -0,0 +1,34 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java new file mode 100644 index 00000000..0b4a8809 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java @@ -0,0 +1,260 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalsdk.core.FusionObject.Utilities; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.openecomp.portalsdk.core.service.DataAccessService; +import org.openecomp.portalsdk.core.util.CipherUtil; +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 users=new ArrayList(); + List filterdUsers=new ArrayList(); + 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, EcompPortalUtils.getStackTrace(e)); + }finally{ + try { + in.close(); + con.disconnect(); + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(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 users=new ArrayList(); + List filterdUsers=new ArrayList(); + 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, EcompPortalUtils.getStackTrace(e)); + }finally{ + try { + in.close(); + con.disconnect(); + } catch (IOException e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(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, "", e); + throw new Exception(e); + } + return "success"; + }; + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/WidgetService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/WidgetService.java new file mode 100644 index 00000000..afec3389 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/WidgetService.java @@ -0,0 +1,36 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 getOnboardingWidgets(EPUser user, boolean managed); + + FieldsValidator setOnboardingWidget(EPUser user, OnboardingWidget onboardingWidget); + + FieldsValidator deleteOnboardingWidget(EPUser user, Long onboardingWidgetId); + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/WidgetServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/WidgetServiceImpl.java new file mode 100644 index 00000000..62ff9e5f --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/service/WidgetServiceImpl.java @@ -0,0 +1,275 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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.EPSystemProperties; +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; +import org.springframework.transaction.annotation.Transactional; + +@Service("widgetService") +@Transactional +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPMetricsLog +public class WidgetServiceImpl implements WidgetService { + + 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(EPSystemProperties.DUBLICATED_FIELD_VALUE_ECOMP_ERROR); + + private static final String urlField = "url"; + + private static final String nameField = "name"; + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetServiceImpl.class); + + @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(EPSystemProperties.ECOMP_APP_ID); + ACCOUNT_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPSystemProperties.ACCOUNT_ADMIN_ROLE_ID)); + LONG_ECOMP_APP_ID = Long.valueOf(SystemProperties.getProperty(EPSystemProperties.ECOMP_APP_ID)); + } catch(Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(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 getOnboardingWidgets(EPUser user, boolean managed) { + List onboardingWidgets = new ArrayList(); + 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 userRoles = dataAccessService.getList(EPUserApp.class, + " where id = " + 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 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(EPAppMessagesEnum.BeDaoSystemError); + 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(EPAppMessagesEnum.BeDaoSystemError); + 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/src/main/java/org/openecomp/portalapp/portal/transport/AllAppsWithRolesForUser.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AllAppsWithRolesForUser.java new file mode 100644 index 00000000..6939a100 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AllAppsWithRolesForUser.java @@ -0,0 +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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.transport; + +import java.util.List; + +public class AllAppsWithRolesForUser { + + public String orgUserId; + + public List apps; + + public static class AppWithUserRoles { + + public Long appId; + + public String appName; + + public List appRoles; + + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppCatalogPersonalization.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppCatalogPersonalization.java new file mode 100644 index 00000000..4ad2594a --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppCatalogPersonalization.java @@ -0,0 +1,38 @@ +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; + } + +} \ No newline at end of file diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppNameIdIsAdmin.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppNameIdIsAdmin.java new file mode 100644 index 00000000..d04e8406 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppNameIdIsAdmin.java @@ -0,0 +1,31 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.transport; + +public class AppNameIdIsAdmin { + + public Long id; + + public String appName; + + public Boolean isAdmin; + + public Boolean restrictedApp; +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppWithRolesForUser.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppWithRolesForUser.java new file mode 100644 index 00000000..fe996fdd --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppWithRolesForUser.java @@ -0,0 +1,34 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.transport; + +import java.util.List; + +public class AppWithRolesForUser { + + public String orgUserId; + + public Long appId; + + public String appName; + + public List appRoles; + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppsListWithAdminRole.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppsListWithAdminRole.java new file mode 100644 index 00000000..907bf7e5 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/AppsListWithAdminRole.java @@ -0,0 +1,34 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.transport; + +import java.util.ArrayList; + +public class AppsListWithAdminRole { + + public String orgUserId; + + public ArrayList appsRoles; + + public AppsListWithAdminRole() { + appsRoles = new ArrayList(); + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidget.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidget.java new file mode 100644 index 00000000..706d6baf --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidget.java @@ -0,0 +1,140 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 + * @author aw3218 + */ +@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/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidgetMeta.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidgetMeta.java new file mode 100644 index 00000000..dba1127c --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidgetMeta.java @@ -0,0 +1,50 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.transport; + +import java.util.List; + +public class CommonWidgetMeta { + + private String category; + private List items; + + public CommonWidgetMeta(){ + + } + + public CommonWidgetMeta(String category, List items){ + this.category = category; + this.items = items; + } + + public String getCategory() { + return category; + } + public void setCategory(String category) { + this.category = category; + } + public List getItems() { + return items; + } + public void setItems(List items) { + this.items = items; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/EventWidget.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/EventWidget.java new file mode 100644 index 00000000..26d694fd --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/EventWidget.java @@ -0,0 +1,139 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.transport; +/*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 + * @author aw3218 + *//* +@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/src/main/java/org/openecomp/portalapp/portal/transport/EventWidgetMeta.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/EventWidgetMeta.java new file mode 100644 index 00000000..60e9aa01 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/EventWidgetMeta.java @@ -0,0 +1,52 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.transport; +/*package org.openecomp.portalapp.portal.transport; + +import java.util.List; + +public class EventWidgetMeta { + + private String category; + private List items; + + public EventWidgetMeta(){ + + } + + public EventWidgetMeta(String category, List items){ + this.category = category; + this.items = items; + } + + public String getCategory() { + return category; + } + public void setCategory(String category) { + this.category = category; + } + public List getItems() { + return items; + } + public void setItems(List items) { + this.items = items; + } +} +*/ diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItem.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItem.java new file mode 100644 index 00000000..1a8691d8 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItem.java @@ -0,0 +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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItemJson.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItemJson.java new file mode 100644 index 00000000..7d829b6b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItemJson.java @@ -0,0 +1,57 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/transport/FieldsValidator.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FieldsValidator.java new file mode 100644 index 00000000..ca559970 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FieldsValidator.java @@ -0,0 +1,49 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 List fields = new ArrayList(); + + public void addProblematicFieldName(String name) { + fields.add(new FieldName(name)); + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItem.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItem.java new file mode 100644 index 00000000..022c0af6 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItem.java @@ -0,0 +1,90 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 { + 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; + + @Transient + public List 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/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItemJson.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItemJson.java new file mode 100644 index 00000000..a985150b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItemJson.java @@ -0,0 +1,52 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 FunctionalMenuItemJson 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; + + public List 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/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuRole.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuRole.java new file mode 100644 index 00000000..1792477d --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuRole.java @@ -0,0 +1,49 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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; + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/LocalRole.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/LocalRole.java new file mode 100644 index 00000000..586a3885 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/LocalRole.java @@ -0,0 +1,42 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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(); + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java new file mode 100644 index 00000000..fa070b9b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java @@ -0,0 +1,83 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.transport; + +public class OnboardingApp { + + public Long id; + + public String name; + + public String imageUrl; + + 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 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/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingWidget.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingWidget.java new file mode 100644 index 00000000..0a23786f --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingWidget.java @@ -0,0 +1,65 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdmin.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdmin.java new file mode 100644 index 00000000..ebf20447 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdmin.java @@ -0,0 +1,53 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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; + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdminUserRole.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdminUserRole.java new file mode 100644 index 00000000..23134298 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdminUserRole.java @@ -0,0 +1,48 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/transport/RemoteRole.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RemoteRole.java new file mode 100644 index 00000000..0e6c4ff0 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RemoteRole.java @@ -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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.transport; + +public class RemoteRole { + + public Long id; + + public String name; + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RemoteUserWithRoles.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RemoteUserWithRoles.java new file mode 100644 index 00000000..48456747 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RemoteUserWithRoles.java @@ -0,0 +1,63 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.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 { + + public Long orgId; + + public Long managerId; + + public String firstName; + + public String middleInitial; + + public String lastName; + + public String phone; + + public String email; + + public String hrid; + + public String orgUserid; + + public String orgCode; + + public String orgManagerUserId; + + public String jobTitle; + + public String loginId; + + public Boolean active; + + public List roles = new ArrayList(); + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RoleInAppForUser.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RoleInAppForUser.java new file mode 100644 index 00000000..a74614ce --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RoleInAppForUser.java @@ -0,0 +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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +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; + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RolesInAppForUser.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RolesInAppForUser.java new file mode 100644 index 00000000..1c3862db --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/RolesInAppForUser.java @@ -0,0 +1,33 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 roles = new ArrayList(); + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/UserApplicationRoles.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/UserApplicationRoles.java new file mode 100644 index 00000000..f9fd4138 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/UserApplicationRoles.java @@ -0,0 +1,41 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 { + + public Long appId; + + public String orgUserId; + + public String firstName; + + public String lastName; + + public List roles = new ArrayList(); + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/UserWithNameSurnameTitle.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/UserWithNameSurnameTitle.java new file mode 100644 index 00000000..6c6cc415 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/transport/UserWithNameSurnameTitle.java @@ -0,0 +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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +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; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java new file mode 100644 index 00000000..25766997 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java @@ -0,0 +1,218 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.openecomp.portalsdk.core.onboarding.crossapi.PortalApiConstants; +import org.openecomp.portalsdk.core.onboarding.crossapi.PortalApiProperties; +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.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 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"); + String stackTrace = EcompPortalUtils.getStackTrace(e); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while refreshing the publisher list. Details: " + stackTrace); + } + + //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()); + String stackTrace = EcompPortalUtils.getStackTrace(e); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while initializing the publisher. Details: " + stackTrace); + } + + 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) { + String stackTrace = EcompPortalUtils.getStackTrace(e); + logger.error(EELFLoggerDelegate.errorLogger, "Exception while adding a publisher. Details: " + stackTrace); + } + } + + public boolean checkAvailability() { + + // + // Test existence of topic at UEB url + // + // + // + boolean available = true; + LinkedList 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; + String stackTrace = EcompPortalUtils.getStackTrace(e); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing the UEB Healthcheck. Details: " + stackTrace); + } + } + } + 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); + String stackTrace = EcompPortalUtils.getStackTrace(e); + sentMsgSuccessfully = false; + logger.warn(EELFLoggerDelegate.errorLogger, "Warning! could not successfully publish a UEB msg to " + + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME) + " exception : " + stackTrace); + } + + return sentMsgSuccessfully; + } + +} + + diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java new file mode 100644 index 00000000..5dfd822d --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java @@ -0,0 +1,27 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/utils/CustomLoggingFilter.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/CustomLoggingFilter.java new file mode 100644 index 00000000..852779a1 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/CustomLoggingFilter.java @@ -0,0 +1,60 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.utils; + +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; + +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 { + + /** + * Custom Filter is added to strip out the continuous U-EB logging messages + * But make sure we log the ERROR & WARNING Level messages. + */ + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(CustomLoggingFilter.class); + + @Override + public FilterReply decide(ILoggingEvent event) { + try { + if ((event.getLevel() != Level.ERROR || event.getLevel() != Level.WARN) && + (event.getThreadName().equalsIgnoreCase("UEBConsumerThread")) && + (event.getLoggerName().contains("com.att.nsa") || event.getLoggerName().contains("org.apache.http")) + ) { + return FilterReply.DENY; + } else { + return FilterReply.NEUTRAL; + } + } catch(Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + return FilterReply.NEUTRAL; + } + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EPSystemProperties.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EPSystemProperties.java new file mode 100644 index 00000000..57eb921f --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EPSystemProperties.java @@ -0,0 +1,77 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.utils; + +import org.openecomp.portalsdk.core.util.SystemProperties; +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) + }) + +public class EPSystemProperties extends SystemProperties { + + public static final String LOGIN_URL_NO_RET_VAL = "login_url_no_ret_val"; + public static final String HOME_PAGE_INDEX_HTML = "home_page"; + 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 IDLE_CONNECTION_TEST_PERIOD = "hb.idle_connection_test_period"; + public static final String DB_RECONNECT = "hb.db_reconnect"; + 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 CONTACT_US_URL = "contact_us_link"; + 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 USER_LAST_LOGIN = "USER_LAST_LOGIN"; + public static final String ELASTIC_SEARCH_URL = "elastic_search_url"; + + public static final String EXTERNAL_API_RESPONSE_CODE = "External_API_ResponseCode"; + public static final String COOKIE_DOMAIN = "cookie_domain"; + + + public static final String USH_TICKET_URL = "ush_ticket_url"; + 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 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 ECOMP_CONTEXT_ROOT = "context_root"; + + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java new file mode 100644 index 00000000..6ec14511 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java @@ -0,0 +1,248 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.portal.utils; + + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletResponse; + +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.util.SystemProperties; +import org.slf4j.MDC; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class EcompPortalUtils { + private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EcompPortalUtils.class); + + /** + * @param orgUserId + * @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]+$"); + } + + public static List parsingByRegularExpression(String source, String regex) { + List tokens = new ArrayList(); + if (source != null && source.length() > 0) { + String[] parsed = source.split(regex); + for (String token : parsed) { + if (token.length() > 0) { + tokens.add(token); + } + } + } + return tokens; + } + + public static String jsonErrorMessageResponse(int errorCode, String errorMessage) { + return "{\"error\":{\"code\":" + errorCode + "," + "\"message\":\"" + errorMessage + "\"}}"; + } + + public static String jsonMessageResponse(String message) { + return String.format("{\"message\":\"%s\"}", message); + } + + public static void logAndSerializeObject(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, "JsonProcessingException occurred while parsing the response, Details:" + EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput); + } catch(Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while parsing the response, Details:" + EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput); + } + } + + public static void rollbackTransaction(Transaction transaction, String errorMessage) { + logger.error(EELFLoggerDelegate.errorLogger, errorMessage); + try { + if(transaction != null) { + transaction.rollback(); + } + } catch (Exception e) { + EPLogUtil.logEcompError(EPAppMessagesEnum.BeExecuteRollbackError); + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing a rollback transaction, Details: " + EcompPortalUtils.getStackTrace(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(EPAppMessagesEnum.BeDaoCloseSessionError); + logger.error(EELFLoggerDelegate.errorLogger, errorMessage + ", closeLocalSession exception: " + EcompPortalUtils.getStackTrace(e)); + } + } + + // 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"; + + /** + * Set response status to Unauthorized if user == null and to Forbidden in all (!) other cases. + * Logging is not performed if invocator == null + * @param user + * @param response + * @param invocator - may be null + */ + public static void setBadPermissions(EPUser user, HttpServletResponse response, String invocator) { + if (user == null) { + String loginUrl = SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL); + response.setHeader(GLOBAL_LOGIN_URL, loginUrl); + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); + MDC.put(EPSystemProperties.RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_UNAUTHORIZED)); + } else { + response.setStatus(HttpServletResponse.SC_FORBIDDEN); + MDC.put(EPSystemProperties.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(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE); + int responseCodeInt = 0; + try { + if (responseCode != null && responseCode != "") { + responseCodeInt = Integer.valueOf(responseCode); + } + } catch (Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred in getResponseCode(). Details: "+EcompPortalUtils.getStackTrace(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(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE, responseCodeString); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred in setResponseCode(). Details: "+EcompPortalUtils.getStackTrace(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, "Exception occurred in getHTTPStatusString(). Details: "+EcompPortalUtils.getStackTrace(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 responseString = ""; + 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, "Exception occurred in getFEErrorString(). Details: "+EcompPortalUtils.getStackTrace(e)); + } + 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; + } + + private static final Object stackTraceLock = new Object(); + public static String getStackTrace(Throwable t) { + synchronized(stackTraceLock) { + StringWriter sw = new StringWriter (); + PrintWriter pw = new PrintWriter (sw); + t.printStackTrace (pw); + return sw.toString (); + } + } + + public static String getMyIpAdddress() { + InetAddress ip; + String localIp; + try { + ip = InetAddress.getLocalHost(); + localIp = ip.getHostAddress(); + } catch (UnknownHostException e) { + localIp = "unknown"; + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(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, EcompPortalUtils.getStackTrace(e)); + } + return hostName; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EcompVersion.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EcompVersion.java new file mode 100644 index 00000000..595ae24f --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/EcompVersion.java @@ -0,0 +1,33 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/portal/utils/HashMapFromList.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/HashMapFromList.java new file mode 100644 index 00000000..c9a55328 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/HashMapFromList.java @@ -0,0 +1,100 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 + * 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 hashMap(List list, String name) and returns + * hash map created from list. + * + * @param + */ +public class HashMapFromList { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HashMapFromList.class); + + public HashMap hashMap(List list, String name) { + HashMap result = new HashMap(); + 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) { + String stackTrace = EcompPortalUtils.getStackTrace(e1); + logger.error(EELFLoggerDelegate.errorLogger, "Object of class " + object.getClass().getName() + ", field " + parmName + ". Details: ", stackTrace); + return new HashMap(); + } + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(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) { + String stackTrace = EcompPortalUtils.getStackTrace(e2); + logger.error(EELFLoggerDelegate.errorLogger, "Object of class " + object.getClass().getName() + ", method " + getterName + ". Details: ", stackTrace); + return new HashMap(); + } + } + } catch (Exception e3) { + String stackTrace = EcompPortalUtils.getStackTrace(e3); + logger.error(EELFLoggerDelegate.errorLogger, "Object of class " + object.getClass().getName() + ", bad field '" + name + "' or method '" + getterName + "()'. Details: " + stackTrace); + return new HashMap(); + } + } + } + if (list.size() != result.size()) { + logger.warn(EELFLoggerDelegate.errorLogger, "Duplicated or empty keys were found!!!"); + } + return result; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/ParallelExecutor.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/ParallelExecutor.java new file mode 100644 index 00000000..19b3fc8c --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/portal/utils/ParallelExecutor.java @@ -0,0 +1,83 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 { + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ParallelExecutor.class); + + protected static abstract class ThreadOperation { + public abstract T execute(List parms); + } + + protected abstract ThreadOperation getThreadOperation(); + + private static class CallableOperationThread implements Callable { + + List parms; + + private ThreadOperation operation; + + public CallableOperationThread(ThreadOperation operation, List parms) { + this.parms = parms; + this.operation = operation; + } + + @Override + public T call() throws Exception { + return this.operation.execute(this.parms); + } + + } + + public List performAllOperations(int ThreadPoolSize, List> listOfParms) { + List result = new ArrayList(); + if (ThreadPoolSize > 0 && listOfParms != null) { + ExecutorService executor = Executors.newFixedThreadPool(ThreadPoolSize); + List> list = new ArrayList>(); + for (List parms : listOfParms) { + CallableOperationThread getter = new CallableOperationThread(this.getThreadOperation(), parms); + Future submit = executor.submit(getter); + list.add(submit); + } + for (Future future : list) { + try { + if (future != null) { + result.add(future.get()); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + } + } + executor.shutdown(); + } + return result; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java new file mode 100644 index 00000000..7e1ad889 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java @@ -0,0 +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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +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/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java new file mode 100644 index 00000000..9b34c87a --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java @@ -0,0 +1,57 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 map = new HashMap(); + 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/src/main/java/org/openecomp/portalapp/scheduler/Register.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/Register.java new file mode 100644 index 00000000..c09721c6 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/Register.java @@ -0,0 +1,86 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.scheduler; + +import java.util.ArrayList; +import java.util.List; + +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +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 scheduleTriggers = new ArrayList(); + 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, EcompPortalUtils.getStackTrace(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, EcompPortalUtils.getStackTrace(ies)); + logger.info(EELFLoggerDelegate.debugLogger, ("Session Cron not available")); + } + + } + + public List getScheduleTriggers() { + return scheduleTriggers; + } + + public void setScheduleTriggers(List scheduleTriggers) { + this.scheduleTriggers = scheduleTriggers; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java new file mode 100644 index 00000000..b26df58b --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java @@ -0,0 +1,100 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 allTriggers = new ArrayList(); + + List coreTriggers = addCoreTriggers(); + final Trigger[] extTriggerArray = registry.getTriggers(); + + allTriggers.addAll(Arrays.asList(extTriggerArray)); + allTriggers.addAll(coreTriggers); + + return allTriggers.toArray(trigger); + + } + + public List addCoreTriggers() { + // On startup of the application after crash recovery, invoke workflow + // schedule trigger + List 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/src/main/java/org/openecomp/portalapp/scheduler/SessionMgtRegistry.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/SessionMgtRegistry.java new file mode 100644 index 00000000..177b4299 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/scheduler/SessionMgtRegistry.java @@ -0,0 +1,89 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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 { + + EELFLoggerDelegate logger = null; + + 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() { + logger = EELFLoggerDelegate.getLogger(SessionMgtRegistry.class); + Map map = new HashMap(); + return jobDetailFactoryBean(groupName, jobName, TimeoutHandler.class, map); + } + + @SuppressWarnings("static-access") + public CronTriggerFactoryBean cronTriggerFactoryBean() throws ParseException { + logger = EELFLoggerDelegate.getLogger(SessionMgtRegistry.class); + 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/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java new file mode 100644 index 00000000..2432061e --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java @@ -0,0 +1,35 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.service; + +import org.openecomp.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/src/main/java/org/openecomp/portalapp/service/EPProfileService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/EPProfileService.java new file mode 100644 index 00000000..98415662 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/EPProfileService.java @@ -0,0 +1,36 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.service; + +import java.util.List; + +import org.openecomp.portalapp.portal.domain.EPUser; +import org.openecomp.portalsdk.core.domain.Profile; + + +public interface EPProfileService { + List findAll(); + + Profile getProfile(int id); + + EPUser getUser(String id); + + void saveUser(EPUser user); +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/EPProfileServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/EPProfileServiceImpl.java new file mode 100644 index 00000000..9dcc8dc9 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/EPProfileServiceImpl.java @@ -0,0 +1,76 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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; + +@Service("epProfileService") +@Transactional +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPMetricsLog +public class EPProfileServiceImpl implements EPProfileService { + + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPProfileServiceImpl.class); + + @Autowired + private ProfileDao profileDao; + + @Autowired + private DataAccessService dataAccessService; + + @SuppressWarnings("unchecked") + public List findAll() { + // List msgDB = getDataAccessService().getList(Profile.class, null); + 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/src/main/java/org/openecomp/portalapp/service/sessionmgt/CoreTimeoutHandler.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/CoreTimeoutHandler.java new file mode 100644 index 00000000..dace543c --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/CoreTimeoutHandler.java @@ -0,0 +1,166 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalsdk.core.domain.sessionmgt.TimeoutVO; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.openecomp.portalsdk.core.onboarding.crossapi.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 sessionMap = new Hashtable(); + 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, "************************ Session Management: Error while destroying session for " + session.getId() + " Details: " + EcompPortalUtils.getStackTrace(e)); + } + + } + + public String gatherSessionExtenstions() { + + Map sessionTimeoutMap = new Hashtable(); + 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, "************************ 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, "************************ Session Management: Error during JsonSessionTimout conversion. Details: " + EcompPortalUtils.getStackTrace(e)); + } + } + + return jsonMap; + + } + + + public void updateSessionExtensions(String sessionTimeoutMapStr) throws Exception { + + //Map sessionTimeoutMap = mapper.readValue(sessionTimeoutMapStr, Map.class); + Map sessionTimeoutMap; + try{ + TypeReference> typeRef + = new TypeReference>() {}; + + sessionTimeoutMap = mapper.readValue(sessionTimeoutMapStr, typeRef); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, "************************ Session Management: Error while to parse update session extension in portal", 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, "************************ Session Management: " + " updated session max idle time"); + session.setMaxInactiveInterval((int)(maxTimeoutTimeMilliSec-lastAccessedTimeMilliSec)/1000); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "************************ Session Management: " + EcompPortalUtils.getStackTrace(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/src/main/java/org/openecomp/portalapp/service/sessionmgt/ManageService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/ManageService.java new file mode 100644 index 00000000..a485176f --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/ManageService.java @@ -0,0 +1,101 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.openecomp.portalsdk.core.onboarding.crossapi.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 { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManageService.class); + + @Autowired + EPAppService appService; + + @Autowired + 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 appList = appService.getEnabledNonOpenOnboardingApps(); + for (OnboardingApp onApp : appList) { + sessionCommunication.pingSession(onApp, sessionMap); + } + updateSessionExtensions(sessionMap); + sessionCommunication.clear(false); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred in extendSessionTimeOuts(). Details: " + EcompPortalUtils.getStackTrace(e)); + } + } + + public String gatherSessionExtenstions() { + return PortalTimeoutHandler.gatherSessionExtensions(); + } + + public void updateSessionExtensions(String sessionTimeoutMapStr) throws Exception { + PortalTimeoutHandler.updateSessionExtensions(sessionTimeoutMapStr); + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/RemoteWebServiceCallService.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/RemoteWebServiceCallService.java new file mode 100644 index 00000000..15693a60 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/RemoteWebServiceCallService.java @@ -0,0 +1,44 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.service.sessionmgt; + +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 requesUserName + * 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; + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/RemoteWebServiceCallServiceImpl.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/RemoteWebServiceCallServiceImpl.java new file mode 100644 index 00000000..e2b2dd5d --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/RemoteWebServiceCallServiceImpl.java @@ -0,0 +1,83 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.service.sessionmgt; + +import java.util.List; + +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.openecomp.portalsdk.core.service.WebServiceCallServiceImpl; +import org.openecomp.portalsdk.core.util.CipherUtil; +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 +@EPMetricsLog +public class RemoteWebServiceCallServiceImpl extends WebServiceCallServiceImpl implements RemoteWebServiceCallService { + + 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; + } + + /** + * 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/src/main/java/org/openecomp/portalapp/service/sessionmgt/SessionCommunication.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/SessionCommunication.java new file mode 100644 index 00000000..57fdd8a0 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/SessionCommunication.java @@ -0,0 +1,274 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.EPSystemProperties; +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 = "Unknwon"; + int responseCode = 0; + + try { + if (app != null && app.name != null && app.name != "") { + 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)); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeRestApiAuthenticationError); + } catch (Exception e) { + responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR; + String message = String.format( + "SessionCommunication.sendGet encountered an Exception. AppName: %s, Details: %s", appName, + EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeHttpConnectionError, e.getMessage()); + logger.error(EELFLoggerDelegate.errorLogger, message); + } finally { + EcompPortalUtils.setExternalAppResponseCode(responseCode); + } + return appResponse; + } + + @EPAuditLog + public Boolean pingSession(OnboardingApp app, String sessionTimeoutMap) throws Exception { + String appName = "Unknwon"; + int responseCode = 0; + try { + if (app != null && app.name != null && app.name != "") { + appName = app.name; + } + + String url = app.restUrl + "/updateSessionTimeOuts"; + String encriptedPwdDB = app.appPassword; + String appUserName = app.username; + // String decreptedPwd = CipherUtil.decrypt(encriptedPwdDB, + // SystemProperties.getProperty(SystemProperties.Decryption_Key)); + + 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); + logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeRestApiAuthenticationError); + } catch (Exception e) { + responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR; + String message = String.format( + "SessionCommunication.pingSession encountered an Exception. AppName: %s, Details: %s", appName, + EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeHttpConnectionError, e.getMessage()); + logger.error(EELFLoggerDelegate.errorLogger, message); + } finally { + EcompPortalUtils.setExternalAppResponseCode(responseCode); + } + + return true; + } + + @EPAuditLog + public Boolean timeoutSession(OnboardingApp app, String portalJSessionId) throws Exception { + String appName = "Unknwon"; + int responseCode = 0; + try { + if (app != null && app.name != null && app.name != "") { + 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, EcompPortalUtils.getStackTrace(e)); + logger.error(EELFLoggerDelegate.errorLogger, message); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeRestApiAuthenticationError); + } catch (Exception e) { + responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR; + String message = String.format( + "SessionCommunication.timeoutSession encountered an Exception. AppName: %s, Details: %s", appName, + EcompPortalUtils.getStackTrace(e)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeHttpConnectionError, e.getMessage()); + logger.error(EELFLoggerDelegate.errorLogger, message); + } finally { + EcompPortalUtils.setExternalAppResponseCode(responseCode); + } + return true; + } + + @EPMetricsLog + private void setLocalMDCContext(OnboardingApp app, String restPath, String url) { + setRequestId(); + MDC.put(EPSystemProperties.PROTOCOL, EPSystemProperties.HTTP); + if (url!=null && url.contains("https")) { + MDC.put(EPSystemProperties.PROTOCOL, EPSystemProperties.HTTPS); + } + MDC.put(EPSystemProperties.FULL_URL, url); + MDC.put(EPSystemProperties.TARGET_ENTITY, app.name); + MDC.put(EPSystemProperties.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(EPSystemProperties.PARTNER_NAME, EPSystemProperties.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(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE); + if (bAll) { + MDC.remove(Configuration.MDC_KEY_REQUEST_ID); + MDC.remove(Configuration.MDC_SERVICE_NAME); + MDC.remove(EPSystemProperties.PARTNER_NAME); + } + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/TimeoutHandler.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/TimeoutHandler.java new file mode 100644 index 00000000..84dcf3fa --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/service/sessionmgt/TimeoutHandler.java @@ -0,0 +1,252 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.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 org.openecomp.portalsdk.core.domain.sessionmgt.TimeoutVO; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.openecomp.portalsdk.core.onboarding.crossapi.PortalApiConstants; +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 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 { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(TimeoutHandler.class); + + ObjectMapper mapper = new ObjectMapper(); + + /** + * Supports static call {@link #timeoutSessions(HttpSession)} + */ + private static List onboardedAppList = null; + + @Autowired + 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 appList = appService.getEnabledNonOpenOnboardingApps(); + onboardedAppList = appList; + TypeReference> typeRef = new TypeReference>() { + }; + String portalJsonSessionStr; + Map 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(EPAppMessagesEnum.BeInvalidJsonInput); + 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> appSessionTimeOutMap = new Hashtable>(); + // 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 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(EPAppMessagesEnum.BeInvalidJsonInput); + 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 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, "Exception occurred while processing sessionTimeOutMap object to a String. Details: " + + EcompPortalUtils.getStackTrace(je)); + EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput); + } + 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(EPAppMessagesEnum.BeInvalidJsonInput); + } + 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; + } + +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/FunctionalMenuHandler.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/FunctionalMenuHandler.java new file mode 100644 index 00000000..a726674c --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/FunctionalMenuHandler.java @@ -0,0 +1,126 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portalapp.portal.utils.EcompPortalUtils; +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 { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuHandler.class); + + @Autowired + AdminRolesService adminRolesService; + + @Autowired + FunctionalMenuService functionalMenuService; + + @Autowired + SearchService searchSvc; + + @Autowired + DataAccessService dataAccessService; + + @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 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, "UebException occurred while responding to the Ueb message, Details:" + EcompPortalUtils.getStackTrace(e)); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while responding to the Ueb message, Details:" + EcompPortalUtils.getStackTrace(e)); + } + + return true; + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java new file mode 100644 index 00000000..b8289538 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java @@ -0,0 +1,75 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.uebhandler; + +import java.util.concurrent.ConcurrentLinkedQueue; + +import javax.annotation.PostConstruct; + +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.crossapi.PortalApiConstants; +import org.openecomp.portalsdk.core.onboarding.crossapi.PortalApiProperties; +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.Configuration; +import org.springframework.context.annotation.EnableAspectJAutoProxy; + +// +// 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 { + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(InitUebHandler.class); + + //@Autowired + MainUebHandler mainUebHandler; + + public InitUebHandler() { + + } + + //@PostConstruct + public void initUeb() { + + try { + String enableListenerThread = PortalApiProperties.getProperty(PortalApiConstants.UEB_LISTENERS_ENABLE); + if (enableListenerThread.equalsIgnoreCase("true")) { + ConcurrentLinkedQueue inboxQueue = new ConcurrentLinkedQueue(); + 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, EcompPortalUtils.getStackTrace(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/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java new file mode 100644 index 00000000..de085419 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java @@ -0,0 +1,115 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portalapp.portal.utils.EcompPortalUtils; +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"); + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MainUebHandler.class); + + ConcurrentLinkedQueue inboxQueue = null; + + @Autowired + FunctionalMenuHandler funcMenuHandler; + + @Autowired + WidgetNotificationHandler widgetNotificationHandler; + + @Async + public void runHandler(ConcurrentLinkedQueue 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, "UebMainHandler interrupted during sleep" + EcompPortalUtils.getStackTrace(e)); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred during sleep" + EcompPortalUtils.getStackTrace(e)); + } + } + } +} diff --git a/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java new file mode 100644 index 00000000..a066b124 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java @@ -0,0 +1,93 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.portalapp.portal.utils.EcompPortalUtils; +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 { + 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 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 publishEP exception" + EcompPortalUtils.getStackTrace(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/src/main/java/org/openecomp/portalapp/util/EPUserUtils.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/util/EPUserUtils.java new file mode 100644 index 00000000..0b79a2b4 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/util/EPUserUtils.java @@ -0,0 +1,308 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +package org.openecomp.portalapp.util; + +import java.io.Serializable; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +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.utils.EcompPortalUtils; +import org.openecomp.portalsdk.core.FusionObject; +import org.openecomp.portalsdk.core.domain.RoleFunction; +import org.openecomp.portalsdk.core.domain.UrlsAccessible; +import org.openecomp.portalsdk.core.exception.SessionExpiredException; +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 implements Serializable, FusionObject { + private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUserUtils.class); + + public static final String KEY_USER_ROLES_CACHE = "userRoles"; + + public static final String WJ_HEADER_USER_NAME = "iv-user"; + public static final String WJ_HEADER_USER_GROUP = "iv-groups"; + + private static DataAccessService dataAccessService; + + private static final long serialVersionUID = 1L; + + 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)); + } + + @SuppressWarnings("rawtypes") + public static void setUserSession(HttpServletRequest request, EPUser user, Set applicationMenuData, + Set businessDirectMenuData, String loginMethod) { + HttpSession session = request.getSession(true); + + EPUserUtils.clearUserSession(request); // let's clear the current user + // session to avoid any + // conflicts during the set + + session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user); + + getRoleFunctions(request); + + // 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()); + 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)); + } + + public 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)); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public static Set getRoleFunctions(HttpServletRequest request) { + HashSet roleFunctions = null; + + HttpSession session = request.getSession(); + roleFunctions = (HashSet) session + .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME)); + + if (roleFunctions == null) { + HashMap roles = 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; + } + + @SuppressWarnings("rawtypes") + public static HashMap getRoles(HttpServletRequest request) { + HashMap roles = null; + + // HttpSession session = request.getSession(); + 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), + getAllUserRoles(user)); + } + + return roles; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public 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); + } + } + + return roles; + } + + @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); + } + } + } + + } + + @SuppressWarnings({ "unchecked", "rawtypes", "unused" }) + public static boolean isUrlAccessible(HttpServletRequest request, String currentUrl) { + boolean isAccessible = false; + + Map params = new HashMap(); + params.put("current_url", currentUrl); + + List list = getDataAccessService().executeNamedQuery("restrictedUrls", params, null); + + // loop through the list of restricted URL's + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size(); i++) { + /* + * Object[] restrictedUrl = (Object[])list.get(i); + * + * String url = (String)restrictedUrl[0]; String functionCd = + * (String)restrictedUrl[1]; + */ + UrlsAccessible urlFunctions = (UrlsAccessible) list.get(i); + + String url = (String) urlFunctions.getUrl(); + String functionCd = (String) urlFunctions.getFunctionCd(); + + if (EPUserUtils.isAccessible(request, functionCd)) { + isAccessible = true; + } + } + return isAccessible; + } + + return true; + } + + public static boolean hasRole(HttpServletRequest request, String roleKey) { + return getRoles(request).keySet().contains(new Long(roleKey)); + } + + public static boolean hasRole(EPUser user, String roleKey) { + return getAllUserRoles(user).keySet().contains(new Long(roleKey)); + } + + public static boolean isAccessible(HttpServletRequest request, String functionKey) { + return getRoleFunctions(request).contains(functionKey); + } + + public static DataAccessService getDataAccessService() { + return dataAccessService; + } + + @Autowired + public void setDataAccessService(DataAccessService dataAccessService) { + EPUserUtils.dataAccessService = dataAccessService; + } + + public static int getUserId(HttpServletRequest request) { + return getUserIdAsLong(request).intValue(); + } + + 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; + } + + public static String getRequestId(HttpServletRequest request) { + Enumeration 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, "HEADER!!!! Exception : " + EcompPortalUtils.getStackTrace(e)); + } + + return (requestId.isEmpty() ? UUID.randomUUID().toString() : requestId); + } + + 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/src/main/java/org/openecomp/portalapp/util/SessionCookieUtil.java b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/util/SessionCookieUtil.java new file mode 100644 index 00000000..69fc9b21 --- /dev/null +++ b/ecomp-portal-BE/src/main/java/org/openecomp/portalapp/util/SessionCookieUtil.java @@ -0,0 +1,129 @@ +/*- + * ================================================================================ + * 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. + * ================================================================================ + */ +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.EPSystemProperties; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.openecomp.portalsdk.core.onboarding.crossapi.PortalApiConstants; +import org.openecomp.portalsdk.core.onboarding.crossapi.PortalTimeoutHandler; +import org.openecomp.portalsdk.core.util.CipherUtil; +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(EPSystemProperties.getProperty(EPSystemProperties.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(EPSystemProperties.getProperty(EPSystemProperties.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, "Could not reset the session timeout. Details: " + EcompPortalUtils.getStackTrace(e)); + } + + } + +} diff --git a/ecomp-portal-BE/src/main/resources/cache.ccf b/ecomp-portal-BE/src/main/resources/cache.ccf new file mode 100644 index 00000000..6f5c6f92 --- /dev/null +++ b/ecomp-portal-BE/src/main/resources/cache.ccf @@ -0,0 +1,30 @@ +# DEFAULT CACHE REGION +jcs.default=DC +jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes +jcs.default.cacheattributes.MaxObjects=1000 +jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache +jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes +jcs.default.elementattributes.IsEternal=true +jcs.default.elementattributes.IsSpool=true + + +# MEMORY SHRINKING CONFIGURATION (Commented) +#jcs.default.cacheattributes.UseMemoryShrinker=true +#jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600 +#jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 +#jcs.default.cacheattributes.MaxSpoolPerRun=500 +#jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes +#jcs.default.elementattributes.IsEternal=false + + +# AUXILLARY CACHE CONFIGURATION +jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory +jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes +jcs.auxiliary.DC.attributes.DiskPath=c:/projects/fusion/war/WEB-INF/cache + + +# PRE-DEFINED REGION FOR LOOKUP DATA +jcs.region.lookUpObjectCache=DC +jcs.region.lookUpObjectCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes +jcs.region.lookUpObjectCache.cacheattributes.MaxObjects=4000 +jcs.region.lookUpObjectCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache diff --git a/ecomp-portal-BE/src/main/resources/logback.xml b/ecomp-portal-BE/src/main/resources/logback.xml new file mode 100644 index 00000000..0c0d7647 --- /dev/null +++ b/ecomp-portal-BE/src/main/resources/logback.xml @@ -0,0 +1,285 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${applicationLoggerPattern} + + + + + + + + + + + + ${logDirectory}/${generalLogName}.log + + + ${logDirectory}/${generalLogName}.log.%d{yyyy-MM-dd}.zip + + 30 + + + ${applicationLoggerPattern} + + + + + + 256 + + true + + + + + + + + + + + + + + + + + + + ${logDirectory}/${auditLogName}.log + + + ${logDirectory}/${auditLogName}.log.%d{yyyy-MM-dd}.zip + + 30 + + + ${auditLoggerPattern} + + + + 256 + + + + + ${logDirectory}/${metricsLogName}.log + + + ${logDirectory}/${metricsLogName}.log.%d{yyyy-MM-dd}.zip + + 30 + + + ${metricsLoggerPattern} + + + + + + 256 + + + + + ${logDirectory}/${errorLogName}.log + + + ${logDirectory}/${errorLogName}.log.%d{yyyy-MM-dd}.zip + + 30 + + + ${errorLoggerPattern} + + + + + 256 + + + + + ${debugLogDirectory}/${debugLogName}.log + + + ${logDirectory}/${debugLogName}.log.%d{yyyy-MM-dd}.zip + + 30 + + + ${defaultLoggerPattern} + + + + + 256 + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ecomp-portal-BE/src/main/resources/openid-connect.properties b/ecomp-portal-BE/src/main/resources/openid-connect.properties new file mode 100644 index 00000000..79d3b9b4 --- /dev/null +++ b/ecomp-portal-BE/src/main/resources/openid-connect.properties @@ -0,0 +1,22 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### +authentication_server_url = http://localhost:8383/openid-connect-server-webapp/ +ecomp_openid_connect_client = http://localhost:8080/ecompportal/openid_connect_login +ecomp_redirect_uri = http://localhost:8080/ecompportal/welcome.htm diff --git a/ecomp-portal-BE/src/main/resources/openid-keystore.jwks b/ecomp-portal-BE/src/main/resources/openid-keystore.jwks new file mode 100644 index 00000000..caad4aaa --- /dev/null +++ b/ecomp-portal-BE/src/main/resources/openid-keystore.jwks @@ -0,0 +1,12 @@ +{ + "keys": [ + { + "alg": "RSA256", + "d": "GIW2b3-ig8rk-Pm3cD5VqRSxtKBJfNhuBCSNe1N6-_kGrk3M5MWgqEbJCzdoZz8M8fclE8sV11b9_-iQx2iVjaw77gHsGe-IUucSNEeW2VtvbpvgCklw-B3CathBMOuHzqCbafj-J6zJ9uxGUFhgUKkLWZJ1iSuIw7WfKoBx_jU", + "e": "AQAB", + "n": "qYJqXTXsDroPYyQBBmSolK3bJtrSerEm-nrmbSpfn8Rz3y3oXLydvUqj8869PkcEzoJIY5Xf7xDN1Co_qyT9qge-3C6DEwGVHXOwRoXRGQ_h50Vsh60MB5MIuDN188EeZnQ30dtCTBB9KDTSEA2DunplhwLCq4xphnMNUaeHdEk", + "kty": "RSA", + "kid": "rsa1" + } + ] +} diff --git a/ecomp-portal-BE/src/main/resources/portal.properties b/ecomp-portal-BE/src/main/resources/portal.properties new file mode 100644 index 00000000..a1982632 --- /dev/null +++ b/ecomp-portal-BE/src/main/resources/portal.properties @@ -0,0 +1,44 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### +portal.api.impl.class = org.openecomp.portalsdk.core.onboarding.client.OnBoardingApiServiceImpl +portal.api.prefix = /api +max.idle.time = 5 +user.attribute.name = user_attribute + +# Global Log On for single sign on +ecomp_redirect_url = https://localhost:8080/ecompportal/login.htm + +testing=testing + +# URL of the ECOMP Portal REST API +ecomp_rest_url = http://localhost:8080/ecompportal/auxapi + +ueb_listeners_enable = true + +ueb_app_key = EkrqsjQqZt4ZrPh6 +ueb_app_secret = KDwJDKdiVVkaz6gIBlRbyxbk +ueb_app_mailbox_name = ECOMP-PORTAL-INBOX-DEV-LOCAL + +ueb_url_list = todo_ueb_url +ecomp_portal_inbox_name = ECOMP-PORTAL-INBOX-DEV-LOCAL + +# Consumer group name for UEB topic. +# Use the special tag to generate a unique one for each sdk-app server. +ueb_app_consumer_group_name = {UUID} diff --git a/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java new file mode 100644 index 00000000..3ea6fd59 --- /dev/null +++ b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java @@ -0,0 +1,262 @@ +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/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java new file mode 100644 index 00000000..6c0de97e --- /dev/null +++ b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java @@ -0,0 +1,107 @@ +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 responseMap, jsonMap; + + logger.info("Get on empty context"); + response = SharedContextRestClient.getJson(properties, "get", cxid, key); + // Should not exist - just generated the UUID + Map 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) 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) 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 stringMap = new HashMap(); + 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/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java new file mode 100644 index 00000000..593f3d0f --- /dev/null +++ b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java @@ -0,0 +1,62 @@ +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/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties new file mode 100644 index 00000000..f81db022 --- /dev/null +++ b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties @@ -0,0 +1,9 @@ + +hostname= localhost +# port = 80 +secure = true +appname = ecompportal +restpath = context +uebkey = xgnLrmNmkfCRnIwa +username = Default +password = AppPassword!1 diff --git a/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java new file mode 100644 index 00000000..69959835 --- /dev/null +++ b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java @@ -0,0 +1,17 @@ +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/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java new file mode 100644 index 00000000..5f07575b --- /dev/null +++ b/ecomp-portal-BE/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java @@ -0,0 +1,14 @@ +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-BE/war/META-INF/MANIFEST.MF b/ecomp-portal-BE/war/META-INF/MANIFEST.MF new file mode 100644 index 00000000..254272e1 --- /dev/null +++ b/ecomp-portal-BE/war/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/ecomp-portal-BE/war/WEB-INF/conf/cache.ccf b/ecomp-portal-BE/war/WEB-INF/conf/cache.ccf new file mode 100644 index 00000000..b8a2363d --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/conf/cache.ccf @@ -0,0 +1,30 @@ +# DEFAULT CACHE REGION +jcs.default=DC +jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes +jcs.default.cacheattributes.MaxObjects=1000 +jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache +jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes +jcs.default.elementattributes.IsEternal=true +jcs.default.elementattributes.IsSpool=true + + +# MEMORY SHRINKING CONFIGURATION (Commented) +#jcs.default.cacheattributes.UseMemoryShrinker=true +#jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600 +#jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 +#jcs.default.cacheattributes.MaxSpoolPerRun=500 +#jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes +#jcs.default.elementattributes.IsEternal=false + + +# AUXILLARY CACHE CONFIGURATION +jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory +jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes +jcs.auxiliary.DC.attributes.DiskPath=fusion/cache + + +# PRE-DEFINED REGION FOR LOOKUP DATA +jcs.region.lookUpObjectCache=DC +jcs.region.lookUpObjectCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes +jcs.region.lookUpObjectCache.cacheattributes.MaxObjects=4000 +jcs.region.lookUpObjectCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache diff --git a/ecomp-portal-BE/war/WEB-INF/conf/kpidash.properties b/ecomp-portal-BE/war/WEB-INF/conf/kpidash.properties new file mode 100644 index 00000000..eebfff76 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/conf/kpidash.properties @@ -0,0 +1,22 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### +url.sectiona = kpi-dashboard/views/DCAE_DASH/dcae_locations.html +url.sectionb = https://rtodo_url/mini.html?notebook=c131ea997453e75303588699936d1896 +url.geomapapiurl = https://todo_url:8080/dcae-services?vnfLocation= diff --git a/ecomp-portal-BE/war/WEB-INF/conf/quartz.properties b/ecomp-portal-BE/war/WEB-INF/conf/quartz.properties new file mode 100644 index 00000000..f95f469f --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/conf/quartz.properties @@ -0,0 +1,55 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### +################################################################################# +# Quartz configurations for Quantum Work Flow # +################################################################################# + +org.quartz.scheduler.instanceId = AUTO + +################################################################################# +# Main configurations +org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool +org.quartz.threadPool.threadCount = 30 + +============================================================================ +# Configure JobStore +#============================================================================ + +org.quartz.jobStore.misfireThreshold = 60000 + +org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX +org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate +org.quartz.jobStore.useProperties = false +#org.quartz.jobStore.dataSource = myDS +org.quartz.jobStore.tablePrefix = FN_QZ_ + +org.quartz.jobStore.isClustered = true +org.quartz.jobStore.clusterCheckinInterval = 20000 + +#============================================================================ +# Configure Datasources +#============================================================================ + +#org.quartz.dataSource.myDS.driver = com.mysql.jdbc.Driver +#org.quartz.dataSource.myDS.URL = jdbc:mysql://localhost:3306/portal +#org.quartz.dataSource.myDS.user = todo +#org.quartz.dataSource.myDS.password = todo +#org.quartz.dataSource.myDS.maxConnections = 5 +#org.quartz.dataSource.myDS.validationQuery=select 0 from dual diff --git a/ecomp-portal-BE/war/WEB-INF/conf/raptor.properties b/ecomp-portal-BE/war/WEB-INF/conf/raptor.properties new file mode 100644 index 00000000..0c32ef65 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/conf/raptor.properties @@ -0,0 +1,185 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### +##C## Mention the name of the framework. At present RAPTOR supports FUSION +system=fusion +##C## Determines the priority for the debug message. +debug_level=5 +##C## Determines the number of records can be downloaded in excel when you select "download all" option. +download_limit=65000 +csv_download_limit=10 +##C## Determines the number of records to be displayed in a single page. +default_page_size=50 +##C## Determines the list size in the form field. +form_fields_list_size=99000 +##C## Determines the scheduler interval +#scheduler_interval=0 => disabled +scheduler_interval=0 +##C## System Name +system_name=RAPTOR +##C## This is used for Bread crumbs. +base_title=ANALYSIS +##C## whether to allow SQL-based report definition (security risk); super users are always allowed to create SQL-based reports +allow_sql_based_reports=no +##C## Determines whether to include disclaimer page at the bottom of each screen +show_disclaimer=yes +disclaimer_positioned_top_in_csvexcel=yes +##C## Determines whether to display the form page as a separate page before running the report +display_form_before_run=yes +##C## Determines whether to include the form page on the report data page +include_form_with_data=yes +##C## Determines whether to cache chart data in the session => faster re-display if the data volume does not get too large +cache_chart_data=yes +##C## Determines whether to cache report data for the currently displayed page in the session => faster re-display + ##C## if the data volume does not get too large +cache_cur_page_data=yes +##C## Determines Chart width +default_chart_width=700 +##C## Determines Chart height +default_chart_height=420 +##C## Determines whether to permit report deletion only by report owner or by everyone with "write" access +delete_only_by_owner=yes +##C## Determines whether to log each report execution and update time and user ID +enable_report_log=yes +##C## Determines whether to cache user roles info in memory (saves many DB reads, but does not account for roles + ##C## assigned after the cache was loaded) +cache_user_roles=yes +##C## Determines whether to convert month formats (e.g. MM/YYYY) to the last day of the month (true) or + ##C## first day (false) - like 12/2003 is converted to either 12/31/2003 or 12/01/2003 +month_format_use_last_day=no +##C## Determines whether to print the report title in the download files +print_title_in_download=yes +##C## Determines whether to show report description when the report is run and in the quick links +show_descr_at_runtime=no +##C## Determines whether to skip labels on the Line chart axis when they overlap +#DEPRECATED skip_chart_labels_to_fit=no +##C## Determines whether to show chart types that are purpose and/or data specific +show_nonstandard_charts=yes +##C## Determines whether to allow the user to change the chart type at runtime +allow_runtime_chart_sel=yes +##C## Determines whether to display the report title as chart title as well +display_chart_title=yes +##C## Determines whether to merge/blank multi-level row headings in cross-tab report +merge_crosstab_row_headings=yes +##C## Determines whether to display chart when displaying the report at first or just a "Show Chart" button +display_chart_by_default=yes +##C## Determines whether to print the form field values in the download files +print_params_in_download=yes +##C## Determines the limitation to the characters in chart label. +skip_chart_labels_limit=30 +##C## Determines whether to users with read-only rights for a report can copy it +can_copy_on_read_only=yes +##C## Determines the no of decimals to be displayed in Totals column +#max_decimals_on_totals=-1 => don't truncate, display all decimal digits +max_decimals_on_totals=2 +##C## Determines which JFreeChart to use. +jfree_version=latest +#jfree_version=0.9.11 +# Added this restriction so that heavily used system which contain +# more than 1000 users can enable this feature not to display whole +# users in the drop down menu +display_all_users=yes +##Sheet name +sheet_name=raptor +#shell_script_name=/home/sundar/test.sh +#download_query_folder=/titan/PROJECT3/RAPTOR/raptor/dwnld/query/ +## this directory is mentioned if the flat file is downloaded using shell script +shell_script_dir=/titan/PROJECT3/RAPTOR/raptor/dwnld/ +flat_file_lower_limit=1 +flat_file_upper_limit=200000 +## whatever request mentioned here would be parsed in sql and request parameter would be filled +request_get_params=c_master,isEmbedded +print_footer_in_download=yes +## footer mentioned here appears in downloaded excel +footer_first_line=AT&T Proprietary +footer_second_line=Use Pursuant to Company Instructions +## to run report in popup window +report_in_popup_window=yes +## to run each report in new popup window if the above is selected +popup_in_new_window=yes +## "Yes" allows the request param to be passed to the drill down report +pass_request_param_in_drilldown=yes +## Show PDF download icon +show_pdf_download=yes +# Show Folder Tree +show_folder_tree=no +#Show folder tree only for Admin Users +show_folder_tree_only_to_admin_users=no +#folder tree should be minimized +folder_tree_minimized=yes +## whatever session mentioned here would be parsed in sql and session parameter would be filled +session_params=login_id +display_formfield_info=yes +customize_formfield_info=yes +#schedule limit for end users +schedule_limit=10 +# customized query if you need any restrictions for schedule and security tab for fusion +#schedule_custom_query_for_users=getAllUsersByCustomer +#schedule_custom_query_for_roles=getAllRolesByCustomer +# customized query if you need any restrictions for schedule and security tab for prisms example +#schedule_custom_query_for_users=SELECT au.user_id, au.first_name||' '||au.last_name user_name FROM app_user au order by 2 +schedule_custom_query_for_users=SELECT au.user_id id, au.first_name||' '||au.last_name name FROM app_user au where user_id = 1 order by 2 +#schedule_custom_query_for_roles=SELECT ar.role_id, ar.descr role_name FROM app_role ar order by 2 +schedule_date_pattern=MM/dd/yyyy hh:mm:ss a +## This is used to display in right format in chart timestamp axis as we give in the sql +#chart_yearly_format=yyyy +#chart_monthly_format=MMM-yyyy +#chart_daily_format=MM-dd-yyyy +chart_hourly_format=MM/dd HH +#chart_minute_format=HH:mm +chart_minute_format=MM-dd-yyyy-HH:mm +#chart_second_format=HH:mm:ss +chart_second_format=MM-dd-yyyy +#chart_millisecond_format=HH:mm:ss.S +schedule_help_text=This form is used to schedule a specific Reporting Platform report to be delivered to one or more email addresses associated with your Company's Business Direct user logins. Note that report output delivered via email does not include the capability to drill down/back up to additional data levels. So, select the appropriate data level report for the scheduled report. View the status of scheduled report requests in the My Schedules menu item. +use_loginid_in_schedYN=Y +session_params_for_scheduling=login_id +session_date_formfield_auto_incr=yes +display_session_param_pdfexcel=login_id;Login Id +session_params_for_displaying_in_scheduling=login_id;Login Id +application_server=tomcat +#gmap properties +gmap_key=ABQIAAAAToJSSetKBMjBJx8MiRw4ghQiU0SbbKnm8C5eu25cpyLwgkLzyRShrQTbgZtqnKAqZU9JwcSq1bKwiA +PROJECT-FOLDER=/Users/sundar/git/st_quantum/quantum/target/quantum-1.0 +# +MARKET-SHAPEFILE-FOLDER=resources/files +# output folder for files generated on server side +OUTPUT-FOLDER=resources/temp +# tile size in pixel +TILE-SIZE=256 +#check if map is disabled or not +map_allowed=Y +max_drilldown_level=2 +admin_role_equiv_to_super_role=N +show_loading_during_formfield_chain=Y +show_print_icon=N +globally_nowrap=N +calendar_output_date_format=MM/dd/yyyy +memory_threshold_percentage=99 +print_params_in_csv_download=yes +notitle_in_dashboard=yes +generate_store_sched_reports=yes +show_excel_2007_download=yes +print_excel_in_landscape=yes +show_animated_chart_option=yes +show_animated_chart_only=no +adjust_content_based_on_height=yes +custom_submit_button_text=Run Button +customize_formfield_layout=yes +db_type=postgresql diff --git a/ecomp-portal-BE/war/WEB-INF/conf/raptor_app_fusion.properties b/ecomp-portal-BE/war/WEB-INF/conf/raptor_app_fusion.properties new file mode 100644 index 00000000..09fe0cec --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/conf/raptor_app_fusion.properties @@ -0,0 +1,36 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### +temp_folder_path=/Users/sundar/git/st_quantum/quantum/target/quantum-1.0/temp/ +upload_folder_path=/Users/sundar/git/st_quantum/quantum/target/quantum-1.0/files/ +excel_template_path=/Users/sundar/git/st_quantum/quantum/target/quantum-1.0/files/raptor_template/ +temp_folder_url=temp/ +upload_folder_url=upload/ +smtp_server=todo_url +default_email_sender=dev-local@email.com +error_page=error_page.jsp +jsp_context_path=raptor/ +img_folder_url=static/fusion/raptor/images/ +base_folder_url=static/fusion/raptor/ +direct_access_url=http://localhost:8080/quantum/raptor_email_attachment.htm?action=raptor&source_page=report_run&display_content=y +base_action_url=raptor.htm?action= +base_action_param=c_master= +super_role_id=1 +admin_role_ids=1 +quick_links_menu_ids=HOME,CUSTOMER,REPORTS diff --git a/ecomp-portal-BE/war/WEB-INF/conf/raptor_db_fusion.properties b/ecomp-portal-BE/war/WEB-INF/conf/raptor_db_fusion.properties new file mode 100644 index 00000000..497fa16d --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/conf/raptor_db_fusion.properties @@ -0,0 +1,19 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### diff --git a/ecomp-portal-BE/war/WEB-INF/conf/raptor_pdf.properties b/ecomp-portal-BE/war/WEB-INF/conf/raptor_pdf.properties new file mode 100644 index 00000000..548cf3bf --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/conf/raptor_pdf.properties @@ -0,0 +1,49 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### +## pdf file specific properties +pdf_data_font_size=9 +pdf_data_font_family=Arial +#reduce the font size from html config +pdf_data_font_size_offset=2 +pdf_data_alternate_color=true +#data row background(white), alternate(light light blue/gray) +pdf_data_background_alternate_hex_code=#EDEDED +pdf_data_default_background_hex_code=#FFFFFF +#header font (white) background (gray) +pdf_data_table_header_font_hex_code=#FFFFFF +pdf_data_table_header_background_hex_code=#8A9BB3 +#footer header +pdf_footer_font_size=9 +pdf_footer_font_family=Arial +pdf_att_proprietary=xxxx +pdf_att_proprierary_font_size=7 +pdf_date_timezone=GMT +pdf_date_pattern=MM/dd/yyyy hh:mm:ss a +##page number position at 1 - footer middle, 0 -- header right, 2 - both +pdf_page_number_position=1 +pdf_word_before_page_number=Page +pdf_word_after_page_number= +pdf_coverpage_firstcolumn_size=0.3 +pdf_image_auto_rotate=false +display_create_owner_info=true +#session_info=customer,customerId +display_loginid_for_downloaded_by=false +# please use false if you want landscape to be default. +is_default_orientation_portrait=true diff --git a/ecomp-portal-BE/war/WEB-INF/conf/sql.properties b/ecomp-portal-BE/war/WEB-INF/conf/sql.properties new file mode 100644 index 00000000..954330d3 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/conf/sql.properties @@ -0,0 +1,295 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### +#SQL Statements for PostgreSQL + +#ReportLoader.java + +load.custom.report.xml = SELECT cr.report_xml FROM cr_report cr WHERE rep_id=?::int + +db.update.report.xml = SELECT cr.rep_id, cr.report_xml FROM cr_report cr WHERE rep_id=? FOR UPDATE + +update.custom.report.rec = UPDATE cr_report SET title='[Utils.oracleSafe(rw.getReportName())]', descr='[Utils.oracleSafe(rw.getReportDescr())]', public_yn='[(rw.isPublic()]', menu_id='[rw.getMenuID()]', menu_approved_yn='[(rw.isMenuApproved()]', owner_id=[rw.getOwnerID()], maint_id=[rw.getUpdateID()], maint_date=TO_DATE('[rw.getUpdateDate()]', '[Globals.getOracleTimeFormat()]'), dashboard_type_yn='[(rw.isDashboardType()]', dashboard_yn= '[(rw.getReportType().equals(AppConstants.RT_DASHBOARD)]' WHERE rep_id = [rw.getReportID()] + +is.report.already.scheduled = select rep_id from cr_report_schedule where rep_id = ?::int + +create.custom.report.rec = INSERT INTO cr_report(rep_id, title, descr, public_yn, menu_id, menu_approved_yn, report_xml, owner_id, create_id, create_date, maint_id, maint_date, dashboard_type_yn, dashboard_yn, folder_id) VALUES([rw.getReportID()], '[Utils.oracleSafe(rw.getReportName())]', '[Utils.oracleSafe(rw.getReportDescr())]', '[rw.isPublic()]', '[rw.getMenuID()]', '[rw.isMenuApproved()]', '', [rw.getOwnerID()], [rw.getCreateID()], TO_DATE('[rw.getCreateDate()]', '[Globals.getOracleTimeFormat()]'), [rw.getUpdateID()], TO_DATE('[rw.getUpdateDate()]', '[Globals.getOracleTimeFormat()]'), '[rw.isDashboardType()]', '[rw.getReportType().equals(AppConstants.RT_DASHBOARD)]',[rw.getFolderId()]) + +get.user.report.names = SELECT cr.rep_id, cr.title FROM cr_report cr WHERE coalesce(cr.owner_id, cr.create_id) = [userID] + +get.report.owner.id = SELECT coalesce(cr.owner_id, cr.create_id) AS owner FROM cr_report cr WHERE rep_id = ?::int + +delete.report.record.log = DELETE FROM cr_report_log WHERE rep_id = [reportID] + +delete.report.record.users = DELETE FROM cr_report_schedule_users WHERE rep_id = [reportID] + +delete.report.record.schedule = DELETE FROM cr_report_schedule WHERE rep_id = [reportID] + +delete.report.record.access = DELETE FROM cr_report_access WHERE rep_id = [reportID] + +delete.report.record.email = DELETE FROM cr_report_email_sent_log WHERE rep_id = [reportID] + +delete.report.record.favorite = DELETE FROM cr_favorite_reports WHERE rep_id = [reportID] + +delete.report.record.report = DELETE FROM cr_report WHERE rep_id = [reportID] + +load.quick.links = SELECT cr.rep_id, cr.title, cr.descr FROM (SELECT rep_id, MIN(read_only_yn) read_only_yn FROM ((SELECT ua.rep_id, ua.read_only_yn FROM cr_report_access ua WHERE ua.user_id = [userID]) UNION ALL (SELECT ra.rep_id, ra.read_only_yn FROM cr_report_access ra WHERE ra.role_id IN ([roleList.toString()]))) report_access GROUP BY rep_id) ra LEFT JOIN cr_report cr ON cr.rep_id = ra.rep_id WHERE cr.menu_id LIKE '%[nvls(menuId)]%' AND cr.menu_approved_yn = 'Y' AND (coalesce(cr.owner_id, cr.create_id) = [userID] OR cr.public_yn = 'Y' OR ra.read_only_yn IS NOT NULL) ORDER BY cr.title + +load.folder.reports = SELECT cr.rep_id, cr.rep_id report_id, [rep_title_sql] || CASE WHEN cr.public_yn = 'Y' THEN '' ELSE '[PRIVATE_ICON]' END||cr.title||'' title, cr.descr, au.first_name||' '||au.last_name owner_name, TO_CHAR(cr.create_date, 'MM/DD/YYYY') create_date, CASE WHEN coalesce(cr.owner_id, cr.create_id) = [userID] THEN 'N' ELSE coalesce(ra.read_only_yn, 'Y') END read_only_yn, CASE WHEN coalesce(cr.owner_id, cr.create_id) = [userID] THEN 'Y' ELSE 'N' END user_is_owner_yn FROM cr_report cr JOIN app_user au ON coalesce(cr.owner_id, cr.create_id) = au.user_id AND cr.folder_id= '[folderId]' LEFT JOIN (SELECT rep_id, MIN(read_only_yn) read_only_yn FROM ((SELECT ua.rep_id, ua.read_only_yn FROM cr_report_access ua WHERE ua.user_id = [userID]) UNION ALL(SELECT ra.rep_id, ra.read_only_yn FROM cr_report_access ra WHERE ra.role_id IN ([roleList.toString()]))) report_access GROUP BY rep_id) ra ON cr.rep_id = ra.rep_id +#If roleList.toString() is '' PostgreSQL returns an error - needs to be null instead of empty + +load.folder.reports.user = AND coalesce(cr.owner_id, cr.create_id) = [userID] + +load.folder.reports.publicsql = AND (coalesce(cr.owner_id, cr.create_id) = [userID] OR cr.public_yn = 'Y' OR ra.read_only_yn IS NOT NULL) + +load.quick.download.links = SELECT a.file_name, b.title,to_char(a.dwnld_start_time, 'Dy DD-Mon-YYYY HH24:MI:SS') as time, a.dwnld_start_time FROM cr_report_dwnld_log a, cr_report b where a.user_id = [userID] and a.rep_id = b.rep_id and (a.dwnld_start_time) >= to_date(to_char(now()- interval '1 day', 'mm/dd/yyyy'), 'mm/dd/yyyy') and a.record_ready_time is not null order by a.dwnld_start_time + +load.reports.to.schedule = SELECT cr.rep_id, Initcap(cr.title), cr.descr FROM cr_report cr LEFT OUTER JOIN (SELECT rep_id, MIN(read_only_yn) read_only_yn FROM ((SELECT ua.rep_id, ua.read_only_yn FROM cr_report_access ua WHERE ua.user_id = [userID]) UNION ALL (SELECT ra.rep_id, ra.read_only_yn FROM cr_report_access ra WHERE ra.role_id IN ([roleList.toString()]))) report_access GROUP BY rep_id) ra ON cr.rep_id = ra.rep_id AND (cr.public_yn = 'Y' OR ra.read_only_yn IS NOT NULL or cr.owner_id = [userID] )ORDER BY Initcap(cr.title) + +load.reports.to.add.in.dashboard = SELECT cr.rep_id, cr.title, cr.descr FROM cr_report cr LEFT OUTER JOIN (SELECT rep_id, MIN(read_only_yn) read_only_yn FROM ((SELECT ua.rep_id, ua.read_only_yn FROM cr_report_access ua WHERE ua.user_id = [userID]) UNION ALL (SELECT ra.rep_id, ra.read_only_yn FROM cr_report_access ra WHERE ra.role_id IN ([roleList.toString()]))) report_access GROUP BY rep_id) ra ON cr.rep_id = ra.rep_id AND (coalesce(cr.owner_id, cr.create_id) = [userID] OR cr.public_yn = 'Y' OR ra.read_only_yn IS NOT NULL) AND (cr.dashboard_yn = 'N' or cr.dashboard_yn is null) ORDER BY cr.title + +load.my.recent.links = select rep_id, title, descr, form_fields from ( select row_number() OVER () AS rnum, rep_id, title, descr, form_fields from (select cr.rep_id, cr.title, a.form_fields, cr.descr, a.log_time, a.user_id, a.action, a.action_value from cr_report_log a, cr_report cr where user_id = [userID] AND action = 'Report Execution Time' and a.rep_id = cr.rep_id order by log_time desc) AS x) AS y where rnum <= 6 AND rnum >= 1 + +create.report.log.entry = INSERT INTO cr_report_log (rep_id, log_time, user_id, action, action_value, form_fields) VALUES([reportID], now(), [userID], '[action]' , '[executionTime]', '[form_fields]') + +create.report.log.entry.exec.time = INSERT INTO cr_report_log (rep_id, log_time, user_id, action, action_value, form_fields) VALUES([reportID], now()+'1 second', [userID], '[action]' , '[executionTime]', '[formFields]') + +clear.report.log.entries = DELETE FROM cr_report_log WHERE rep_id = ? and user_id = ? + +load.report.log.entries = SELECT x.log_time, x.user_id, (CASE WHEN x.action = 'Report Execution Time' THEN ''||x.action||'' ELSE x.action END) action, (CASE WHEN x.action = 'Report Execution Time' THEN action_value ELSE 'N/A' END) time_taken, (CASE WHEN x.action = 'Report Execution Time' THEN '\"Run' ELSE 'N/A' END) run_image, x.name FROM (SELECT rl.rep_id, TO_CHAR(rl.log_time, 'Month DD, YYYY HH:MI:SS AM') log_time, rl.action_value, fuser.last_name ||', '||fuser.first_name name, rl.user_id, rl.action, rl.form_fields FROM cr_report_log rl, fn_user fuser WHERE rl.rep_id = [nvls(reportId)] and rl.action != 'Report Run' and fuser.user_id = rl.user_id ORDER BY rl.log_time DESC) x WHERE LIMIT 100 + +does.user.can.schedule.report = select crs.sched_user_id, count(*) from cr_report_schedule crs where sched_user_id = [userId] group by crs.sched_user_id having count(*) >= [Globals.getScheduleLimit()] + +does.user.can.schedule = select crs.schedule_id from cr_report_schedule crs where schedule_id = [scheduleId] + +get.system.date.time = select to_char(now(),'MM/dd/yyyy HH24:mi:ss') + +get.next.day.date.time = select to_char(now()+'1 day','MM/dd/yyyy HH24:mi:ss') + +get.next.fifteen.minutes.date.time = select to_char(now()+'15 min','MM/dd/yyyy HH24:mi:ss') + +get.next.thirty.minutes.date.time = select to_char(now()+'30 min','MM/dd/yyyy HH24:mi:ss') + +get.template.file = select template_file from cr_report_template_map where report_id = [reportId] + +load.pdf.img.lookup = select image_id, image_loc from cr_raptor_pdf_img + +load.action.img.lookup = select image_id, image_loc from cr_raptor_action_img + + +#ActionHandler.java + +report.values.map.def.a = SELECT x FROM (SELECT DISTINCT + +report.values.map.def.b = TO_CHAR([colName], '[nvl(displayFormat, AppConstants.DEFAULT_DATE_FORMAT)]') + +report.values.map.def.c = [colName] + +report.values.map.def.d = x FROM [rdef.getTableById(tableId).getTableName()] WHERE [colName] IS NOT NULL ORDER BY 1) xx LIMIT <= [Globals.getDefaultPageSize()] + +test.sched.cond.popup = SELECT 1 WHERE EXISTS ([sql]) + +download.all.email.sent = Select user_id, rep_id from CR_REPORT_EMAIL_SENT_LOG where gen_key='[pdfAttachmentKey.trim()]' and log_id =[report_email_sent_log_id.trim()] and (now() - sent_date) < '1 day' limit 1 + +download.all.gen.key = select schedule_id from cr_report_email_sent_log u where U.GEN_KEY = '[pdfAttachmentKey]' + +download.all.retrieve = SELECT au.user_id FROM (SELECT rs.schedule_id, rs.rep_id FROM cr_report_schedule rs WHERE rs.enabled_yn='Y' AND rs.run_date IS NOT NULL AND rs.schedule_id = [scheduleId]) x, cr_report r, app_user au WHERE x.rep_id = r.rep_id AND au.user_id IN (SELECT rsu.user_id FROM cr_report_schedule_users rsu WHERE rsu.schedule_id = x.schedule_id and rsu.schedule_id = [scheduleId] UNION SELECT ur.user_id FROM fn_user_role ur WHERE ur.role_id IN (SELECT rsu2.role_id FROM cr_report_schedule_users rsu2 WHERE rsu2.schedule_id = x.schedule_id and rsu2.schedule_id = [scheduleId])) + +download.all.insert = insert into cr_report_dwnld_log (user_id,rep_id,file_name,dwnld_start_time,filter_params) values (?,?,?,?,?) + +#ReportWrapper.java + +report.wrapper.format = SELECT coalesce(cr.owner_id, cr.create_id) owner_id, cr.create_id, TO_CHAR(cr.create_date, '[Globals.getOracleTimeFormat()]') create_date, maint_id, TO_CHAR(cr.maint_date, '[Globals.getOracleTimeFormat()]') update_date, cr.menu_id, cr.menu_approved_yn FROM cr_report cr WHERE cr.rep_id= [reportID] + +generate.subset.sql = SELECT [colNames.toString()] FROM (SELECT row_number() OVER () AS rnum, [colNames.toString()] FROM ([reportSQL]) AS x ) AS y + +report.sql.only.first.part = SELECT row_number() OVER () AS rnum, [colNames.toString()] FROM (SELECT row_number() OVER () AS rnum, [colNames.toString()] FROM ( + +report.sql.only.second.part.a = WHERE rnum <= [endRow] + +report.sql.only.second.part.b = AND rnum >= [startRow] ORDER BY rnum + +report.sql.only.second.part.b.noorderby = AND rnum >= [startRow] + +generate.sql.visual.select = SELECT + +generate.sql.visual.count = COUNT(*) cnt + +generate.sql.visual.dual = +#No DUAL table in PostgreSQL so this is blank + +#ReportRuntime.java + +load.crosstab.report.data = SELECT row_number() OVER () AS rnum, [colNames.toString()] FROM ( [reportSQL] + +#RaptorRunHandler.java + +generate.sql.handler = SELECT row_number() OVER () AS rnum, x.* from ([sql]) AS x LIMIT 2 + +generate.sql.select = SELECT [colNames.toString()] FROM (SELECT row_number() OVER () AS rnum, [colNames.toString()] FROM ([sql]) AS y) AS x + +#ReportSchedule.java + +load.schedule.data = SELECT rs.enabled_yn, TO_CHAR(rs.start_date, 'MM/DD/YYYY') start_date, TO_CHAR(rs.end_date, 'MM/DD/YYYY') end_date, TO_CHAR(rs.run_date, 'MM/DD/YYYY') run_date, coalesce(TO_CHAR(rs.run_date, 'HH'), '12') run_hour, coalesce(TO_CHAR(rs.run_date, 'MI'), '00') run_min, coalesce(TO_CHAR(rs.run_date, 'AM'), 'AM') run_ampm, rs.recurrence, rs.conditional_yn, rs.notify_type, rs.max_row, rs.initial_formfields, rs.schedule_id, coalesce(TO_CHAR(rs.end_date, 'HH'), '11') end_hour, coalesce(TO_CHAR(rs.end_date, 'MI'), '45') end_min, coalesce(TO_CHAR(rs.end_date, 'AM'), 'PM') end_ampm, encrypt_yn, attachment_yn FROM cr_report_schedule rs WHERE rs.rep_id = [reportID] + +load.schedule.getid = SELECT rsu.user_id, fuser.last_name||', '||fuser.first_name, fuser.login_id FROM cr_report_schedule_users rsu, fn_user fuser WHERE rsu.rep_id = [reportID] AND rsu.schedule_id = [getScheduleID()] and rsu.user_id IS NOT NULL and rsu.user_id = fuser.user_id + +load.schedule.users = SELECT rsu.role_id FROM cr_report_schedule_users rsu WHERE rsu.rep_id = [reportID] AND rsu.schedule_id = [getScheduleID()] AND rsu.role_id IS NOT NULL + +new.schedule.data = SELECT nextval('SEQ_CR_REPORT_SCHEDULE') AS sequence + +execute.update = DELETE FROM cr_report_schedule_users WHERE rep_id = [reportID] and schedule_id = [getScheduleID()] + +execute.update.users = INSERT INTO cr_report_schedule_users (schedule_id, rep_id, user_id, role_id, order_no) VALUES([getScheduleID()], [reportID], [emailToUsers.get(i)).getId()], NULL, [(i + 1)]) + +execute.update.roles = INSERT INTO cr_report_schedule_users (schedule_id, rep_id, user_id, role_id, order_no) VALUES([getScheduleID()], [reportID], NULL, [emailToRoles.get(i)).getId()], [((emailToUsers.size() + i + 1)]) + +execute.update.activity = INSERT into cr_schedule_activity_log (schedule_id, notes, run_time) values ([getScheduleID()],'Submitted:Schedule',TO_DATE('[getRunDate()] [getRunHour()]:[getRunMin()] [getRunAMPM()]', 'MM/DD/YYYY HH:MI AM')) + +delete.schedule.data = SELECT 1 FROM cr_report_schedule WHERE rep_id = [reportID] and sched_user_id = [getScheduleUserID()] and schedule_id = [getScheduleID()] + +delete.schedule.data.users = DELETE FROM cr_report_schedule_users WHERE rep_id = [reportID] and schedule_id = [getScheduleID()] + +delete.schedule.data.id = DELETE FROM cr_report_schedule where rep_id = [reportID] and sched_user_id = [getScheduleUserID()] and schedule_id = [getScheduleID()] + +load.cond.sql = SELECT condition_large_sql FROM cr_report_schedule WHERE schedule_id=?::int + +load.cond.sql.select = SELECT condition_sql FROM cr_report_schedule WHERE schedule_id = [scheduleId] + +persist.cond.sql.update = update cr_report_schedule set condition_large_sql = '' where schedule_id = [scheduleId] +#EMPTY CLOB() changed to '' + +persist.cond.sql.large = SELECT condition_large_sql FROM cr_report_schedule cr WHERE schedule_id=? FOR UPDATE + +persist.cond.sql.set = update cr_report_schedule set condition_sql = ? where schedule_id = [scheduleId] + +#DataCache.java + +get.data.view.actions = SELECT ts.web_view_action FROM cr_table_source ts WHERE ts.web_view_action IS NOT NULL + +get.public.report.id.names = SELECT rep_id, title FROM cr_report WHERE public_yn = 'Y' ORDER BY title + +get.private.accessible.names.a = SELECT cr.rep_id, cr.title FROM cr_report cr WHERE cr.rep_id not in (select rep_id from cr_report_access cra where user_id = '[user_id]' + +get.private.accessible.names.if = OR role_id in ( + +get.private.accessible.names.b = ) AND public_yn = 'N' and cr.owner_id = '[user_id]' order by 2 + +get.group.accessible.names.a = SELECT cr.rep_id, cr.title FROM cr_report cr WHERE cr.rep_id in (select rep_id from cr_report_access cra where user_id = '[user_id]' + +get.group.accessible.names.b = ) AND public_yn = 'N' order by 2 + +get.report.table.sources.a = SELECT table_name, display_name, pk_fields, web_view_action, large_data_source_yn, filter_sql FROM cr_table_source + +get.report.table.sources.where = where SOURCE_DB= '[dBInfo]' + +get.report.table.sources.if = where SOURCE_DB is null or SOURCE_DB = '[AppConstants.DB_LOCAL]' + +get.report.table.sources.else = ORDER BY table_name + +grab.report.table.a = SELECT ts.table_name, ts.display_name, ts.pk_fields, ts.web_view_action, ts.large_data_source_yn, ts.filter_sql FROM cr_table_source ts WHERE + +grab.report.table.if = ts.SOURCE_DB= '[dBInfo]' + +grab.report.table.else = (ts.SOURCE_DB is null or ts.SOURCE_DB = '[AppConstants.DB_LOCAL]') + +grab.report.table.b = except SELECT ts.table_name, ts.display_name, ts.pk_fields, ts.web_view_action, ts.large_data_source_yn, ts.filter_sql from cr_table_source ts where table_name in (select table_name from cr_table_role where role_id not IN [sb.toString()]) and + +grab.report.table.c = ORDER BY 1 + +get.report.table.crjoin = SELECT src_table_name, dest_table_name, join_expr FROM cr_table_join + +get.report.table.joins = SELECT tj.src_table_name, tj.dest_table_name, tj.join_expr FROM cr_table_join tj WHERE ((EXISTS (SELECT 1 FROM cr_table_role trs WHERE trs.table_name=tj.src_table_name AND trs.role_id IN [sb.toString()])) OR (NOT EXISTS (SELECT 1 FROM cr_table_role trs WHERE trs.table_name=tj.src_table_name))) AND ((EXISTS (SELECT 1 FROM cr_table_role trd WHERE trd.table_name=tj.dest_table_name AND trd.role_id IN [sb.toString()])) OR (NOT EXISTS (SELECT 1 FROM cr_table_role trd WHERE trd.table_name=tj.dest_table_name))) + +generate.report.table.col = SELECT a.table_name, a.column_name, a.data_type, a.label FROM user_column_def a WHERE a.table_name = '[tableName.toUpperCase()]' ORDER BY a.column_id + +generate.db.user.sql.a = SELECT utc.table_name, utc.column_name, utc.data_type, + +generate.db.user.sql.if = utc.column_name FROM user_tab_columns utc + +generate.db.user.sql.else = coalesce(x.label, utc.column_name) FROM user_tab_columns utc + +generate.db.user.sql.b = WHERE utc.table_name = '[tableName.toUpperCase()]' + +generate.db.user.sql.c = AND utc.table_name = x.table_name AND utc.column_name = x.column_name + +generate.db.user.sql.d = ORDER BY utc.column_id + +#SearchHandler.java + +load.report.search.result = SELECT cr.rep_id, cr.rep_id report_id, [rep_title_sql] || CASE WHEN cr.public_yn = 'Y' THEN '' ELSE '[PRIVATE_ICON]' END || cr.title ||'' title, cr.descr, au.first_name||' '||au.last_name owner_name, TO_CHAR(cr.create_date, 'MM/DD/YYYY') create_date, CASE WHEN coalesce(cr.owner_id, cr.create_id) = [userID] THEN 'N' ELSE coalesce(ra.read_only_yn, 'Y') END read_only_yn, CASE WHEN coalesce(cr.owner_id, cr.create_id) = [userID] THEN 'Y' ELSE 'N' END user_is_owner_yn, case when report_xml like '%N%' then 'N' when report_xml like '%Y%' or 1 = (select distinct 1 from cr_report_schedule where rep_id = cr.rep_id) then 'Y' else 'N' end FROM cr_report cr JOIN fn_user au ON coalesce (cr.owner_id, cr.create_id) = au.user_id AND TO_CHAR(cr.rep_id, 'FM99999999') like coalesce('%[fReportID]%', TO_CHAR(cr.rep_id, 'FM99999999')) AND UPPER(cr.title) LIKE UPPER('%[fReportName]%') LEFT JOIN(SELECT rep_id, MIN(read_only_yn) read_only_yn FROM ((SELECT ua.rep_id, ua.read_only_yn FROM cr_report_access ua WHERE ua.user_id = [userID]) UNION ALL (SELECT ra.rep_id, ra.read_only_yn FROM cr_report_access ra WHERE ra.role_id IN ([roleList.toString()]))) report_access GROUP BY rep_id) ra ON ra.rep_id = cr.rep_id + +load.report.search.instr = WHERE cr.menu_id LIKE '%[menuId]%' + +load.report.search.result.user = WHERE coalesce(cr.owner_id, cr.create_id) = [userID] + +load.report.search.result.public = WHERE (coalesce(cr.owner_id, cr.create_id) = [userID] OR cr.public_yn = 'Y' OR ra.read_only_yn IS NOT NULL) + +load.report.search.result.fav = WHERE cr.rep_id in (select rep_id from cr_favorite_reports where user_id = [userID] + +load.report.search.result.sort = ORDER BY CASE coalesce(cr.owner_id, cr.create_id) WHEN [userID] THEN ' ' WHEN 'upper(au.first_name||' '||au.last_name)' ELSE 'upper(cr.title)' END + +load.folder.report.result = SELECT cr.rep_id, cr.rep_id report_id, [rep_title_sql] || CASE WHEN cr.public_yn = 'Y' THEN '' ELSE '[PRIVATE_ICON]' END || cr.title || '' title, cr.descr, au.first_name||' '||au.last_name owner_name, TO_CHAR(cr.create_date, 'MM/DD/YYYY') create_date, CASE WHEN coalesce(cr.owner_id, cr.create_id) = [userID] THEN 'N' ELSE coalesce(ra.read_only_yn, 'Y') END read_only_yn, CASE WHEN coalesce(cr.owner_id, cr.create_id) = [userID] THEN 'Y' ELSE 'N' END user_is_owner_yn FROM cr_report cr JOIN fn_user au ON coalesce (cr.owner_id, cr.create_id) = au.user_id AND TO_CHAR(cr.rep_id, 'FM99999999') like coalesce('%[fReportID]%', TO_CHAR(cr.rep_id, 'FM99999999')) AND UPPER(cr.title) LIKE UPPER('%[fReportName]%') LEFT JOIN(SELECT rep_id, MIN(read_only_yn) read_only_yn FROM ((SELECT ua.rep_id, ua.read_only_yn FROM cr_report_access ua WHERE ua.user_id = [userID]) UNION ALL (SELECT ra.rep_id, ra.read_only_yn FROM cr_report_access ra WHERE ra.role_id IN ([roleList.toString()]))) report_access GROUP BY rep_id) ra ON ra.rep_id = cr.rep_id + +load.folder.report.result.sort = ORDER BY CASE coalesce(cr.owner_id, cr.create_id) WHEN [userID] THEN ' ' WHEN '(au.first_name||' '||au.last_name)' ELSE 'cr.title' END + +#WizardProcessor.java + +process.filter.add.edit = '[argValue]' + +#ReportDefinition.java + +persist.report.adhoc = SELECT nextval('[Globals.getAdhocReportSequence()]') AS sequence + +#Globals.java + +initialize.roles = SELECT 1 WHERE EXISTS (SELECT 1 FROM cr_table_role) + +initialize.version = SELECT cr_raptor.get_version + +# scheduler + + +scheduler.available.schedules = SELECT x.rep_id, x.schedule_id, x.conditional_yn, x.condition_large_sql, x.notify_type, x.max_row, x.initial_formfields, x.processed_formfields, r.title, x.user_id FROM ( SELECT rs.rep_id, rs.schedule_id, rs.sched_user_id user_id, rs.conditional_yn, rs.condition_large_sql, rs.notify_type, rs.max_row, rs.initial_formfields, rs.processed_formfields FROM cr_report_schedule rs WHERE rs.enabled_yn='Y' AND rs.start_date <= [currentDate] AND (rs.end_date >= [currentDate] or rs.end_date is null ) AND rs.run_date IS NOT NULL ) x, cr_report r WHERE x.rep_id = r.rep_id + +random.string = select ( 'Z' || round(random() * 1000000000000)) + + +scheduler.user.emails = SELECT au.user_id FROM (SELECT rs.schedule_id, rs.rep_id FROM cr_report_schedule rs WHERE rs.enabled_yn='Y' AND rs.start_date <= now() AND rs.end_date >= now() AND rs.run_date IS NOT NULL AND rs.schedule_id = [p_schedule_id] ) x, cr_report r, fn_user au WHERE x.rep_id = r.rep_id AND au.user_id IN (SELECT rsu.user_id FROM cr_report_schedule_users rsu WHERE rsu.schedule_id = x.schedule_id and rsu.schedule_id = [p_schedule_id] UNION SELECT ur.user_id FROM fn_user_role ur WHERE ur.role_id IN (SELECT rsu2.role_id FROM cr_report_schedule_users rsu2 WHERE rsu2.schedule_id = x.schedule_id and rsu2.schedule_id = [p_schedule_id])) + + +# my logins + +app.query = SELECT APP_ID, ML_APP_NAME, MOTS_ID from fn_app where ((enabled = 'Y' and open = 'N') or app_id = 1 ) + +user.log.query = SELECT DISTINCT IFNULL(ORG_USER_ID, '') CUID, '' AWID, CONCAT('"',IFNULL(ORG_USER_ID, ''),'"') APPLICATIONUSERID, CONCAT('"',IFNULL(FIRST_NAME, ''),'"') FIRST_NAME, CONCAT('"',substr(IFNULL(MIDDLE_NAME, ''), 0, 1),'"') MIDDLE_INITIAL, CONCAT('"',IFNULL(LAST_NAME, ''),'"') LAST_NAME, IFNULL(DATE_FORMAT(LAST_LOGIN_DATE, '%Y/%m/%d'), '') LAST_LOGON_DATE, DATE_FORMAT(CREATED_DATE, '%Y/%m/%d') ACCOUNT_ACTIVATION_DATE, IFNULL(DATE_FORMAT(MODIFIED_DATE, '%Y/%m/%d'), '') LAST_DATE_ACCOUNT_MODIFIED, '' LAST_PASSWORD_CHANGE_DATE, CONCAT('"',IFNULL(FIRST_NAME, ''),' ',IFNULL(MIDDLE_NAME, ''),' ',IFNULL(LAST_NAME, ''),'"') FULL_USER_NAME, '' NT_ID, IFNULL(EMAIL, '') EMAIL FROM FN_USER FU, FN_USER_ROLE FUR, FN_ROLE FR WHERE FU.USER_ID = FUR.USER_ID and FUR.ROLE_ID = FR.ROLE_ID and ((FUR.APP_ID = 1 and FUR.APP_ID = ? and FR.ROLE_NAME <> 'Standard User') or (FUR.APP_ID = ? and FUR.APP_ID <> 1)) and FU.ACTIVE_YN = 'Y' and FU.org_user_id is not null order by 1 + +profile.log.query = SELECT DISTINCT CONCAT('"' , ROLE_NAME , '"') PROFILE_NAME, '""' SECURITY_SETTINGS FROM FN_ROLE FR, FN_USER_ROLE FUR WHERE FUR.ROLE_ID = FR.ROLE_ID and FR.ACTIVE_YN = 'Y' and ((FUR.APP_ID = 1 and FUR.APP_ID = ? and FR.ROLE_NAME <> 'Standard User') or (FUR.APP_ID = ? and FUR.APP_ID <> 1)) ORDER BY 1 + +user.profile.log.query = SELECT DISTINCT IFNULL(ORG_USER_ID, '') CUID, '' AWID, CONCAT('"' , IFNULL(ORG_USER_ID, '') , '"') APPLICATIONUSERID , CONCAT('"' , ROLE_NAME , '"') PROFILE_NAME FROM FN_USER A, FN_USER_ROLE B, FN_ROLE C WHERE A.USER_ID = B.USER_ID AND B.ROLE_ID = C.ROLE_ID AND A.ACTIVE_YN = 'Y' AND C.ACTIVE_YN = 'Y' AND a.ORG_USER_ID is not null AND ((B.APP_ID = 1 and B.APP_ID = ? and C.ROLE_NAME <> 'Standard User') or (B.APP_ID = ? and B.APP_ID <> 1)) ORDER BY 1 + +all.accounts.log.query = SELECT DISTINCT IFNULL(ORG_USER_ID, '') CUID, (case when A.ACTIVE_YN='Y' then 'ACTIVE' else 'INACTIVE' end) ACTIVE_YN, CONCAT('"' , IFNULL(ORG_USER_ID, '') , '"') APPLICATIONUSERID , IFNULL(DATE_FORMAT(LAST_LOGIN_DATE, '%Y/%m/%d'), '') LAST_LOGON_DATE, '' LAST_PASSWORD_CHANGE_DATE, CONCAT('"' , ROLE_NAME , '"') PROFILE_NAME FROM FN_USER A, FN_USER_ROLE B, FN_ROLE C WHERE A.USER_ID = B.USER_ID AND B.ROLE_ID = C.ROLE_ID AND a.ORG_USER_ID is not null AND ((B.APP_ID = 1 and B.APP_ID = ? and C.ROLE_NAME <> 'Standard User') or (B.APP_ID = ? and B.APP_ID <> 1)) ORDER BY 1 + +# basic sql + +seq.next.val = SELECT nextval('[sequenceName]') AS id + +current.date = now() + +nvl = IFNULL diff --git a/ecomp-portal-BE/war/WEB-INF/conf/system.properties b/ecomp-portal-BE/war/WEB-INF/conf/system.properties new file mode 100644 index 00000000..d5e9c21b --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/conf/system.properties @@ -0,0 +1,102 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### + +db.driver = com.mysql.jdbc.Driver +db.connectionURL = jdbc:mysql://portal.api.simpledemo.openecomp.org:3306/portal +db.userName = xxxx +db.password = xxxxxxx + +db.hib.dialect = org.hibernate.dialect.MySQLDialect +db.min_pool_size = 5 +db.max_pool_size = 10 +hb.dialect = org.hibernate.dialect.MySQLDialect +hb.show_sql = false +hb.db_reconnect = true +hb.idle_connection_test_period = 3600 + + +app_display_name = app_display_name +files_path = /demeter/WebApps/dev/ECOMP_APP/files +context_root = ECOMPPORTAL +# menu settings +menu_query_name = menuData +menu_properties_file_location = /WEB-INF/fusion/menu/ +application_menu_set_name = APP +application_menu_attribute_name = applicationMenuData +application_menu_properties_name = menu.properties +business_direct_menu_set_name = BD +business_direct_menu_properties_name = bd.menu.properties +business_direct_menu_attribute_name = businessDirectMenuData + +application_user_id = 30000 +post_default_role_id = 1 + +#Enable Fusion Mobile capabilities for the application +mobile_enable = false + +cache_config_file_path = /WEB-INF/conf/cache.ccf +cache_switch = 1 +cache_load_on_startup = false + +user_name = fullName +decryption_key = xxxxxx + + +#Cron Schedules +cron_site_name = one +log_cron = 0 * * * * ? * +sessiontimeout_feed_cron = 0 0/5 * * * ? * + +#Front end URL +frontend_url = http://portal.openecomp.org:8080/ecompportal/applicationsHome + +#cookie domain PLEASE DO NOT REMOVE THIS VALUE FOR OPEN SOUCE REFACTOR +cookie_domain = openecomp.org + +# An Unique 128-bit value defined to identify a specific version of +# ECOMP Portal deployed on a specific virtual machine. +# This value must be generated and updated at the time of +# the deployment. +# Online Unique UUID generator - https://www.uuidgenerator.net/ +instance_uuid = 90bc9497-10e6-49fe-916b-dcdfaa972383 + +ecomp_shared_context_rest_url= http://todo_enter_be_hostname:9000/ecompportal/context + +elastic_search_url = http://todo_enter_elastic_search_hostname:9200 +contact_us_link = http://todo_enter_contact_us_hostname +user_guide_link = http://todo_enter_user_guide_link + +# Contact Us page properties +ush_ticket_url = http://todo_enter_ush_ticket_url +feedback_email_address = portal@lists.openecomp.org +portal_info_url = https://todo_enter_portal_info_url + +#Online user bar refresh interval, in seconds +online_user_update_rate = 5 + +#Online user bar refresh total duration, in seconds +online_user_update_duration = 30 + +#authenticate user server +authenticate_user_server=http://todo_enter_auth_server_hostname:8383/openid-connect-server-webapp/allUsers + +#window width threshold to collapse left/right menu when page onload +window_width_threshold_left_menu = 1400 +window_width_threshold_right_menu = 1350 \ No newline at end of file diff --git a/ecomp-portal-BE/war/WEB-INF/defs/definitions.xml b/ecomp-portal-BE/war/WEB-INF/defs/definitions.xml new file mode 100644 index 00000000..603e1144 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/defs/definitions.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/.DS_Store b/ecomp-portal-BE/war/WEB-INF/fusion/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7fb274c0db3053557ec160374d035df819050f09 GIT binary patch literal 6148 zcmeHK%}N6?5Kh{vTRpgfg5GlT(nD+gIl5Fmc_~!%pi+0~qJecIyW18ig?$JA-$UQU zC-6C(Nm5a&CqbmlER%0Cnb|O3mSn>iMJi4OHcff{Y;9F5V!ggO96HX*YJGeEC?4G0-rYYu zK0O=4IeeR17A%h71q@qzua(4+iqF9_iXKG~5(C5lF)(=y*qzRqo4nGfB4U6T_$33l zKL}7n&th&+ZynI!?<0EIVO&a;>sH0g}% znc+QlW^QjNT+a@Ep~D&X3{p!B5CdNsD4MQ|=l|Z%_y4a+)FTFnfr(;(mv&pb4JgT; ztz*UESt~%#Kv6I*H~5hPhCYfR7LVd(P%YpWXaIT^bA#Xkp&tQF12x3JpEB?c_?KHa literal 0 HcmV?d00001 diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/conf/fusion.properties b/ecomp-portal-BE/war/WEB-INF/fusion/conf/fusion.properties new file mode 100644 index 00000000..242a21d5 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/conf/fusion.properties @@ -0,0 +1,82 @@ +### +# ================================================================================ +# 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. +# ================================================================================ +### +# domain settings +#domain_class_location = + +# validator settings +#default_error_message = Default error message + +login_url_no_ret_val = http://localhost:9000/ecompportal/login.htm + +user_attribute_name = user + +# User Session settings +#user_attribute_name = user +roles_attribute_name = roles +role_functions_attribute_name = role_functions +#client_device_attribute_name = client_device +#client_device_emulation = false +#client_device_type_to_emulate = + +# menu settings +menu_query_name = menuData +#menu_properties_file_location = /WEB-INF/fusion/menu/ +application_menu_set_name = APP +application_menu_attribute_name = applicationMenuData +#application_menu_properties_name = menu.properties +business_direct_menu_set_name = BD +#business_direct_menu_properties_name = bd.menu.properties +business_direct_menu_attribute_name = businessDirectMenuData + +# RAPTOR config settings +#raptor_config_file_path = /WEB-INF/conf/ + +# ECOMP settings +ecomp_app_id = 1 +# Role settings +sys_admin_role_id = 1 +account_admin_role_id = 999 +restricted_app_role_id = 900 +#sys_admin_role_function_delete_from_ui = true + +# Profile Search settings +#profile_search_report_id=181 +#callable_profile_search_report_id=386 + + +# Home Page index html + +home_page = /index.html + +authentication_mechanism = DBAUTH + +login.error.hrid.empty = Login failed, please contact system administrator. +login.error.hrid.not-found = User not found, please contact system administrator. +login.error.user.inactive = Account is disabled, please contact system administrator. + +# +# Number of seconds to poll health (database operational, etc.) +# +health_poll_interval_seconds = 5 +# +# If a component is down a log entry will be written that triggers an alert. This parameter specifies how often this alert should be triggered +# if the component remains down. For example a value of 30, would translate to 30 * 60 seconds = 1800 seconds, or every 30 minutes +# +health_fail_alert_every_x_intervals = 30 diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/defs/definitions.xml b/ecomp-portal-BE/war/WEB-INF/fusion/defs/definitions.xml new file mode 100644 index 00000000..f11b39a0 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/defs/definitions.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/.gitignore b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/collaborateList.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/collaborateList.jsp new file mode 100644 index 00000000..21497518 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/collaborateList.jsp @@ -0,0 +1,101 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> + + + + + + + + + + + +<%@ include file="/WEB-INF/fusion/jsp/popup_modal.html" %> +
+
+

Collaborate List

+
+ + + + + + + + + + + + + + + + + + + + + + +
User IDLast NameFirst NameEmailATTUIDOnline/Offline
{{rowData.id}}{{rowData.lastName}}{{rowData.firstName}}{{rowData.email}}{{rowData.sbcid}} + Offline + Online +
+
+
+ +
+ + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz/ebz_footer.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz/ebz_footer.jsp new file mode 100644 index 00000000..ae72af66 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz/ebz_footer.jsp @@ -0,0 +1,63 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> + +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + +
+
+ +
+ +
+ +
+
+
+ + +
+
+
+ +
+ +
+
+
+
+
+
diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz/ebz_header.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz/ebz_header.jsp new file mode 100644 index 00000000..e4cd224c --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz/ebz_header.jsp @@ -0,0 +1,303 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> + <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + <%@ page isELIgnored ="false" %> + <%@ page import="org.openecomp.portalsdk.core.util.SystemProperties" %> + + + + + + +
+
+
+
+
+ +
+ +
+ Manage +
+
+ Support + +
+ +
+
+ <%--
+ + +
+
${ociUserName}
+
+ +
+
--%> + + + + +
+
+
+ + + + + + + + <%-- + + + + --%> +
+
+ + + + + + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz_template.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz_template.jsp new file mode 100644 index 00000000..32010111 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz_template.jsp @@ -0,0 +1,44 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%> + + + + <%@ include file="/WEB-INF/fusion/jsp/meta.jsp" %> + + + +
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+ + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz_template_noheader_nofooter.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz_template_noheader_nofooter.jsp new file mode 100644 index 00000000..c3f9fef9 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/ebz_template_noheader_nofooter.jsp @@ -0,0 +1,35 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%> + + + <%@ include file="/WEB-INF/fusion/jsp/meta.jsp" %> + +
+ +
+
+ +
+
+ +
+ + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/include.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/include.jsp new file mode 100644 index 00000000..e4ca6e4b --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/include.jsp @@ -0,0 +1,30 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ page import="org.openecomp.portalsdk.core.util.SystemProperties" %> +<%@ page import="org.openecomp.portalsdk.core.web.support.AppUtils" %> + +<%@ page import="java.util.LinkedHashMap" %> + + +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/jcs_admin.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/jcs_admin.jsp new file mode 100644 index 00000000..bf56c56b --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/jcs_admin.jsp @@ -0,0 +1,149 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%-- <%@ include file="/WEB-INF/fusion/jsp/include.jsp"%> --%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + + + + + + + + + + + +
+

Cache Regions

+ These are the regions which are currently defined in the cache. 'Items' and 'Bytes' refer to the elements currently in memory (not spooled). + You can clear all items for a region by clicking on the Clear icon next to the desired region below. You can also clear all regions which + empties the entire cache.

+ +
+
+
Cache Name
+
# of Items
+
Bytes
+
Status
+
Memory Hits
+
Aux Hits
+
Not Found Misses
+
Expired Misses
+
Clear?
+
Items
+
+
+
+ +
{{region.size}}
+
{{region.byteCount}}
+
{{region.status}}
+
{{region.hitCountRam}}
+
{{region.hitCountAux}}
+
{{region.missCountNotFound}}
+
{{region.missCountExpired}}
+
+
+
+
+
+
+ +
Key
+
Eternal?
+
Created
+
Max Life
+
Expires
+
Clear?
+
+
+
+ + +
{{item.eternal}}
+
{{item.createTime}}
+
{{item.maxLifeSeconds}}
+
{{item.expiresInSeconds}}
+
+
+
+
+
+
+
+ + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/meta.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/meta.jsp new file mode 100644 index 00000000..1899b79f --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/meta.jsp @@ -0,0 +1,35 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> + + + + + + + + + + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal.html b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal.html new file mode 100644 index 00000000..82c5616f --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal.html @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal_role.html b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal_role.html new file mode 100644 index 00000000..eae53e4f --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal_role.html @@ -0,0 +1,257 @@ + + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal_rolefunction.html b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal_rolefunction.html new file mode 100644 index 00000000..958333de --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/popup_modal_rolefunction.html @@ -0,0 +1,87 @@ + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/post_search.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/post_search.jsp new file mode 100644 index 00000000..3e0b16ab --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/post_search.jsp @@ -0,0 +1,370 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ page import="java.util.*" %> +<%@ page import="com.fasterxml.jackson.databind.ObjectMapper" %> +<%@ page import="org.json.JSONObject" %> + +<%-- <%@ include file="/WEB-INF/fusion/jsp/include.jsp"%> --%> + +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + + + + + + + + +
+ +

WEBPHONE Search

+ <%--

+
+

--%> +
+ Please enter search criteria below:
+ +
+ Last Name:
+ +
+ +
+ First Name:
+ +
+ +
+ ATTUID:
+ +
+ +
+ Manager ATTUID:
+ +
+
+
+ Organization:
+ +
+ +
+ Email:
+ +
+
+ +
+ + + +
+
+ {{noResultsString}} +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
NoNameATTUIDOrganizationPhoneEmailImport?
+ {{$index + 1}} + +
+ {{profile.lastName}}, {{profile.firstName}} +
+ + +
+ {{profile.sbcid}} + + {{profile.orgCode}} + + {{profile.phone}} + + {{profile.email}} + +
+
+ +
+
+
+ Exists +
+
+
+ Rows Per Page: + +
+
+ Current Page: + +
+
+ Total Page(s): + +
+ +
+ +
+ +
+ + + + +
+ diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/profile.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/profile.jsp new file mode 100644 index 00000000..7e10a213 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/profile.jsp @@ -0,0 +1,442 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ page import="org.openecomp.portalsdk.core.domain.User"%> +<%@ page import="org.openecomp.portalsdk.core.web.support.UserUtils"%> + +<%@page import="org.openecomp.portalsdk.core.web.support.ControllerProperties"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + + + + + + + + + + + + + + + + + + + + + +<%@ include file="/WEB-INF/fusion/jsp/include.jsp"%> + +
+

+ + +

Profile Edit

+
+ +

Profile Edit

+
+
+

+
+ +
+ + Please edit the profile details below: 

+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+
+
+ +
+ +
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + +
NameRemove?
{{ role.name }} + +
+ + +
+ + + + + + + + + + + + + + +
Role
+
+ +
+
{{ availableRole.name }}
+
+ +
+ + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/profile_search.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/profile_search.jsp new file mode 100644 index 00000000..e7ad5762 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/profile_search.jsp @@ -0,0 +1,100 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> + + + + + + + + + + + +<%@ include file="/WEB-INF/fusion/jsp/popup_modal.html" %> +
+
+

Profile Search

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
User IDLast NameFirst NameEmailATTUIDManager ATTUIDEditActive?
{{rowData.id}}{{rowData.lastName}}{{rowData.firstName}}{{rowData.email}}{{rowData.sbcid}}{{rowData.managerId}} +
+ +
+
+
+
+ +
+ + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/role.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/role.jsp new file mode 100644 index 00000000..e1c100db --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/role.jsp @@ -0,0 +1,298 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> + +<%@ include file="/WEB-INF/fusion/jsp/include.jsp"%> --%> + +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + + + + + + + + + +<%@ include file="/WEB-INF/fusion/jsp/popup_modal_role.html" %> + +
+ +
+
+

+ + +

Role Edit

+
+ +

Role Create

+
+
+

+
+ +
+ +
+ Please edit the role details below: 
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+ +
+
+ + +
+ + + + + + + + + + + + + + +
NameRemove?
{{ roleFunction.name }} +
+
+ Manage Role Functions

+ +
+ + +
+ + + + + + + + + + + + + + +
NameRemove?
{{ role.name }} +
+
+ +
+ + + + + + + + + + + + + + +
Role
+
+ +
+
{{ availableRole.name }}
+
+
+ + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/role_function_list.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/role_function_list.jsp new file mode 100644 index 00000000..51aea051 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/role_function_list.jsp @@ -0,0 +1,225 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> + +<%-- <%@ include file="/WEB-INF/fusion/jsp/include.jsp" %> --%> + +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + + + + + + + + + +<%@ include file="/WEB-INF/fusion/jsp/popup_modal_rolefunction.html" %> +
+
+ +

Role Functions

+ + +

+ +
+ +
+ 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. +
+
+ + + + + + + + + + + + + + + + + +
NameCodeEdit?Delete?
{{ availableRoleFunction.name }}{{ availableRoleFunction.code }} + +
+
+ +
+
+
+ + + + + + +
+ +
+
+ +
+
+
+
+ +
+
+ + +
+ +
+ + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/role_list.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/role_list.jsp new file mode 100644 index 00000000..f35d975e --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/role_list.jsp @@ -0,0 +1,147 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> + +<%-- <%@ include file="/WEB-INF/fusion/jsp/include.jsp" %> --%> + +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + + + + + + + +
+

Roles

+
+
+Click on a Role to view its details. + +
+
+ + + + + + + + + + + + + + + + + + +
NamePriorityActive?Delete?
{{ availableRole.name }}{{ availableRole.priority }} +
+ +
+
+
+
+
+ +
+ +
+ +
+ + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/usage_list.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/usage_list.jsp new file mode 100644 index 00000000..11e2439e --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/usage_list.jsp @@ -0,0 +1,99 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> + +<%-- <%@ include file="/WEB-INF/fusion/jsp/include.jsp" %> --%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + + + + + + + + + + +
+
+

+ Usage +

+
+
+ The following shows all users currently logged into the application. Click the icon to expel a user from the application. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current User Sessions
User IdUser NameEmailLast Access Time (minutes)Time Remaining (minutes)Expel?
{{user.id}}{{user.lastName}}{{user.email}}{{user.lastAccess}}{{user.remaining}}
Current Session
+
+
+
+
+ + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/jsp/webrtc/collaboration.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/webrtc/collaboration.jsp new file mode 100644 index 00000000..b0480d45 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/jsp/webrtc/collaboration.jsp @@ -0,0 +1,529 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
+
+ + +
+ + +
+ --> + + +
+ + + +
+ +
+ +
+ + + +
+ + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/orm/EP.hbm.xml b/ecomp-portal-BE/war/WEB-INF/fusion/orm/EP.hbm.xml new file mode 100644 index 00000000..1ed165b5 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/orm/EP.hbm.xml @@ -0,0 +1,558 @@ + + + + + + + + + + + + seq_fn_widget + + + + + + + + + + + + + + + + + + + + + + + + + + + seq_fn_user + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + seq_fn_app + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + seq_fn_role + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + app + + + + + + + + + + + + + + + + + seq_fn_pers_user_app_sel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/orm/Fusion.hbm.xml b/ecomp-portal-BE/war/WEB-INF/fusion/orm/Fusion.hbm.xml new file mode 100644 index 00000000..53c45b79 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/orm/Fusion.hbm.xml @@ -0,0 +1,372 @@ + + + + + + + + + + + + seq_fn_user + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + seq_fn_role + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + seq_fn_menu + + + + + + + + + + + + + + + + + + + + + + + seq_fn_menu + + + + + + + + + + + + + + + + + + + + + + + + + + + + seq_fn_broadcast_message + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select distinct functionCd from MenuData + + + + from MenuData where menuSetCode = :menu_set_cd and parentMenu is null + + + FROM UrlsAccessible A where upper(A.urlsAccessibleKey.url) = upper(:current_url) + + + + select firstName, lastName from User where id = :user_id + + + + select email from User where id = :user_id + + + + select id, firstName, lastName from User where active = true order by lastName, firstName + + + + select name from Role where id = :role_id + + + + select id, name from Role order by name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + from CommonWidget where category = :cat order by sortOrder, title + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/orm/Workflow.hbm.xml b/ecomp-portal-BE/war/WEB-INF/fusion/orm/Workflow.hbm.xml new file mode 100644 index 00000000..69c19db7 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/orm/Workflow.hbm.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/raptor/report_search.jsp b/ecomp-portal-BE/war/WEB-INF/fusion/raptor/report_search.jsp new file mode 100644 index 00000000..e1895d2c --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/raptor/report_search.jsp @@ -0,0 +1,20 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +Hello world diff --git a/ecomp-portal-BE/war/WEB-INF/jsp/error.jsp b/ecomp-portal-BE/war/WEB-INF/jsp/error.jsp new file mode 100644 index 00000000..c79aa89a --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/jsp/error.jsp @@ -0,0 +1,20 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +${errMsg} diff --git a/ecomp-portal-BE/war/WEB-INF/jsp/index.jsp b/ecomp-portal-BE/war/WEB-INF/jsp/index.jsp new file mode 100644 index 00000000..4726ce19 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/jsp/index.jsp @@ -0,0 +1,21 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + diff --git a/ecomp-portal-BE/war/WEB-INF/jsp/login.jsp b/ecomp-portal-BE/war/WEB-INF/jsp/login.jsp new file mode 100644 index 00000000..bdffc734 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/jsp/login.jsp @@ -0,0 +1,152 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ 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" %> + +" /> + + + + + + + Login + + + + + + + + + + + + + + + + + + <% + String frontUrl = SystemProperties.getProperty(EPSystemProperties.FE_URL); + %> +
+
+ +
+
+ +
+ + +
+
+ + +
+
+                + +
+
+
+






+
+ + + + diff --git a/ecomp-portal-BE/war/WEB-INF/jsp/oid-admin.jsp b/ecomp-portal-BE/war/WEB-INF/jsp/oid-admin.jsp new file mode 100644 index 00000000..93fd69ce --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/jsp/oid-admin.jsp @@ -0,0 +1,72 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> +<%@ taglib prefix="o" tagdir="/WEB-INF/tags"%> + + +
+
+
+ +

Hello ${ userInfo.name }

+ +
+

This page requires that the user be logged in with a valid account and the ROLE_ADMIN Spring Security authority. + If you are reading this page, you are currently logged in as an administrator.

+ +

The authorization provider will assign your account a set of authorities depending on how it's configured. + Your current login has the following Spring Security authorities:

+ +
    + + +
  • ${ auth }
  • +
    +
+ +
+
+

Administrators

+ +

Logged in users are assigned the ROLE_USER authority by default, but the following users + (identified by issuer/subject pairs) will also be given ROLE_ADMIN:

+ + + + + + + + + + + + +
IssuerSubject
${ admin.issuer }${ admin.subject }
+
+ +
+
+
+ + + diff --git a/ecomp-portal-BE/war/WEB-INF/jsp/oid-home.jsp b/ecomp-portal-BE/war/WEB-INF/jsp/oid-home.jsp new file mode 100644 index 00000000..9fd11036 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/jsp/oid-home.jsp @@ -0,0 +1,102 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> +<%@ taglib prefix="o" tagdir="/WEB-INF/tags"%> +<%@ page session="false" %> + + +
+
+
+ +

+ Hello world! +

+ +
+

+ + You are currently logged in. + + + You are NOT currently logged in. + +

+ +

This example application is configured with several pages requiring different levels of access. + This page does not require the user to be logged in. Use the tabs in the navbar above to navigate to + pages with different access requirements. +

+ +
    +
  • User, requires the user to be logged in with the ROLE_USER Spring Security authority.
  • +
  • Admin, requires the user to be logged in with the ROLE_ADMIN Spring Security authority. + See below for the currently configured list of admin accounts.
  • + +
  • Logout, log out directly and return to this page.
  • +
    + +
  • Log in, log in directly and return to this page.
  • +
    +
+ + +
+ +
+

Client Filter Configuration

+ +

This authorization filter for this client has been configured with the following components:

+ +
    +
  • Issuer service: ${ issuerServiceClass }
  • +
  • Server configuration service: ${ serverConfigurationServiceClass }
  • +
  • Client configuration service: ${ clientConfigurationServiceClass }
  • +
  • Auth request options service: ${ authRequestOptionsServiceClass }
  • +
  • Auth request URI builder: ${ authRequestUriBuilderClass }
  • +
+
+ +
+

Administrators

+ +

Logged in users are assigned the ROLE_USER authority by default, but the following users + (identified by issuer/subject pairs) will also be given ROLE_ADMIN:

+ + + + + + + + + + + + +
IssuerSubject
${ admin.issuer }${ admin.subject }
+
+
+
+
+ + + diff --git a/ecomp-portal-BE/war/WEB-INF/jsp/oid-login.jsp b/ecomp-portal-BE/war/WEB-INF/jsp/oid-login.jsp new file mode 100644 index 00000000..cf2f9bcc --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/jsp/oid-login.jsp @@ -0,0 +1,76 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> +<%@ taglib prefix="o" tagdir="/WEB-INF/tags"%> + +
+
+
+ +

Welcome to ECOMP Portal OpenId Login

+ +

+ Please provide the URI for your OpenId Authorization Server. Make sure the OpenId Connect Server is Running on the following location +

+ +

+ If you do not have one of your own, for a quick start up, you can clone from this github location - It's an open source OpenID Connect Server. +

+ +

+ Simply clone on your local, go to sub-project directory called 'openid-connect-server-webapp' and do + + mvn jetty:run + +

+ +

+ Choose a different port using the jetty plugin inside pom.xml, if the default 8080 is already taken by your Application. +

+ + + +
+
+ +
+
+ + +
+
+
+
+
+
+ + diff --git a/ecomp-portal-BE/war/WEB-INF/jsp/oid-user.jsp b/ecomp-portal-BE/war/WEB-INF/jsp/oid-user.jsp new file mode 100644 index 00000000..112415b0 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/jsp/oid-user.jsp @@ -0,0 +1,139 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> +<%@ taglib prefix="o" tagdir="/WEB-INF/tags"%> + + +
+
+
+ +

Hello ${ userInfo.name }

+ +
+

This page requires that the user be logged in with a valid account and the ROLE_USER Spring Security authority. + If you are reading this page, you are currently logged in.

+ + + +

The authorization provider will create a Principal object based on the iss and sub + claims associated with your ID token. This value can be used as a globally unique username within the application + (though it's not meant to be human-readable). + Your Principal is: ${ user }

+ +

The authorization provider will assign your account a set of authorities depending on how it's configured. + Your current login has the following Spring Security authorities:

+ +
    + + +
  • ${ auth }
  • +
    +
+ +

ID Token

+ +

Your ID Token has the following set of claims:

+ + + + + + + + + + + +
NameValue
+ +

The ID Token header contains the following claims:

+ + + + + + + + + + +
NameValue
+ +

User Info

+ +

The call to the User Info Endpoint returned the following set of claims:

+ + + + + + + + + + +
NameValue
+ +
+ +
+
+
+ + + + diff --git a/ecomp-portal-BE/war/WEB-INF/jsp/welcome.jsp b/ecomp-portal-BE/war/WEB-INF/jsp/welcome.jsp new file mode 100644 index 00000000..054c38fe --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/jsp/welcome.jsp @@ -0,0 +1,695 @@ +<%-- + ================================================================================ + 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. + ================================================================================ + --%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ Welcome ${sessionScope.user.firstName} ${sessionScope.user.lastName}  + (Last Login:  ${lastLogin}) +
+ +
+

Network

+

Visualization

+ +
+ + +
+

+ You can toggle between the Image Slider and Carousel controls by clicking on the respective radio button below: +

+ Slider
+ Carousel + +
+
+ +
+ +
+
+ Drive test analytics + MTSA - Nationwide DL throughput for iOS devices over cellular network + Location based services county level drive test + Network demand data by LATA (2020 forecast) + Linear regression prediction of LBS/E911 drive test accuracy + SDN Simulator - SNRC Traffic + (Click on Image to Rotate) +
+
+
+
+
+
+ Drive test analytics +
+

Drive test analytics

+
+
+
+ MTSA - Nationwide DL throughput for iOS devices over cellular network +
+

Nationwide DL throughput for iOS devices over cellular network

+
+
+
+ Network demand data by LATA (2020 forecast) +
+

Network demand data by LATA (2020 forecast)

+
+
+
+ Location based services county level drive test +
+

Location based services county level drive test

+
+
+
+ SDN Simulator - SNRC Traffic +
+

SDN Simulator - SNRC Traffic

+
+
+
+ Linear regression prediction of LBS/E911 drive test accuracy +
+

Linear regression prediction of LBS/E911 drive test accuracy

+
+
+
+ + +
+ Example Frame +
+
+ +
+
+
+
+
+ +
+ + + + +
+ +
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ + + +
+
Monday
+ + + + + + +
+
+
+ + + +
+
Monday
+ + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Contacts + +
Developer Program + +
ZK Framework + +
JQuery + +
RNC Visualization + +
Heat Map + +
Animated Map + +
Process Management + +
Chat Session + +
+
+
+
+
+
+ + + + + + + + +
+ +
+ + +
+ +
+
+
+
+ +
+ + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/oid-context.xml b/ecomp-portal-BE/war/WEB-INF/oid-context.xml new file mode 100644 index 00000000..33458d6d --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/oid-context.xml @@ -0,0 +1,455 @@ + + + + + + + + + + + classpath:openid-connect.properties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + openid + email + address + profile + phone + + + + + + ${ecomp_openid_connect_client} + + + + + + + + + + + + + + + + + + + + openid + email + address + profile + phone + + + + + + ${ecomp_openid_connect_client} + + + + + + + + + + + + + + + + + + + openid + email + address + profile + phone + + + + + + ${ecomp_openid_connect_client} + + + + + + + + + + + + + openid + email + address + profile + phone + + + + + + ${ecomp_openid_connect_client} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/tags/copyright.tag b/ecomp-portal-BE/war/WEB-INF/tags/copyright.tag new file mode 100644 index 00000000..f06786c6 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/tags/copyright.tag @@ -0,0 +1 @@ +Powered by MITREid Connect ${project.version} © 2014 The MITRE Corporation and MIT KIT. diff --git a/ecomp-portal-BE/war/WEB-INF/tags/footer.tag b/ecomp-portal-BE/war/WEB-INF/tags/footer.tag new file mode 100644 index 00000000..8b47824a --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/tags/footer.tag @@ -0,0 +1,12 @@ +<%@ attribute name="js" required="false"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="o" tagdir="/WEB-INF/tags"%> + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/tags/header.tag b/ecomp-portal-BE/war/WEB-INF/tags/header.tag new file mode 100644 index 00000000..6f8c5c3d --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/tags/header.tag @@ -0,0 +1,59 @@ +<%@attribute name="title" required="false"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ tag import="com.google.gson.Gson" %> + + + + + + + + Simple Web App - ${title} + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ecomp-portal-BE/war/WEB-INF/tags/topbar.tag b/ecomp-portal-BE/war/WEB-INF/tags/topbar.tag new file mode 100644 index 00000000..5109523a --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/tags/topbar.tag @@ -0,0 +1,96 @@ +<%@attribute name="pageName" required="false"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%> +<%@ taglib prefix="o" tagdir="/WEB-INF/tags"%> + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ecomp-portal-BE/war/WEB-INF/web.xml b/ecomp-portal-BE/war/WEB-INF/web.xml new file mode 100644 index 00000000..8c920d12 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/web.xml @@ -0,0 +1,87 @@ + + + + + fusion + + + + + + + + contextConfigLocation + /WEB-INF/oid-context.xml + + + + + org.springframework.web.context.ContextLoaderListener + + + + + + org.openecomp.portalapp.portal.listener.UserSessionListener + + + + CorsFilter + org.apache.catalina.filters.CorsFilter + + cors.allowed.methods + GET,POST,HEAD,OPTIONS,PUT,DELETE + + + cors.allowed.headers + EPService,JSESSIONID,X-ECOMP-RequestID,X-Widgets-Type,Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers + + + + + CorsFilter + /* + + + + springSecurityFilterChain + org.springframework.web.filter.DelegatingFilterProxy + + + + + springSecurityFilterChain + /* + + + diff --git a/ecomp-portal-BE/war/images/cache/README.txt b/ecomp-portal-BE/war/images/cache/README.txt new file mode 100644 index 00000000..65bb14cc --- /dev/null +++ b/ecomp-portal-BE/war/images/cache/README.txt @@ -0,0 +1 @@ +image cache \ No newline at end of file diff --git a/ecomp-portal-BE/war/index.jsp b/ecomp-portal-BE/war/index.jsp new file mode 100644 index 00000000..b39156c5 --- /dev/null +++ b/ecomp-portal-BE/war/index.jsp @@ -0,0 +1,22 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + +<%-- Redirected because we can't set the welcome page to a virtual URL. --%> +<%-- + --%> + + + ecompportal-BE index.jsp + + +

ECOMP Portal Core

+ This is the ecompportal-BE application, page index.jsp. + + <% + + response.sendRedirect("welcome.htm"); + + %> + + + + \ No newline at end of file diff --git a/ecomp-portal-BE/war/static/ebz/angular_js/angular-sanitize.js b/ecomp-portal-BE/war/static/ebz/angular_js/angular-sanitize.js new file mode 100644 index 00000000..87100fdb --- /dev/null +++ b/ecomp-portal-BE/war/static/ebz/angular_js/angular-sanitize.js @@ -0,0 +1,647 @@ +/** + * @license AngularJS v1.2.25 + * (c) 2010-2014 Google, Inc. http://angularjs.org + * License: MIT + */ +(function(window, angular, undefined) {'use strict'; + +var $sanitizeMinErr = angular.$$minErr('$sanitize'); + +/** + * @ngdoc module + * @name ngSanitize + * @description + * + * # ngSanitize + * + * The `ngSanitize` module provides functionality to sanitize HTML. + * + * + *
+ * + * See {@link ngSanitize.$sanitize `$sanitize`} for usage. + */ + +/* + * HTML Parser By Misko Hevery (misko@hevery.com) + * based on: HTML Parser By John Resig (ejohn.org) + * Original code by Erik Arvidsson, Mozilla Public License + * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js + * + * // Use like so: + * htmlParser(htmlString, { + * start: function(tag, attrs, unary) {}, + * end: function(tag) {}, + * chars: function(text) {}, + * comment: function(text) {} + * }); + * + */ + + +/** + * @ngdoc service + * @name $sanitize + * @kind function + * + * @description + * The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are + * then serialized back to properly escaped html string. This means that no unsafe input can make + * it into the returned string, however, since our parser is more strict than a typical browser + * parser, it's possible that some obscure input, which would be recognized as valid HTML by a + * browser, won't make it through the sanitizer. + * The whitelist is configured using the functions `aHrefSanitizationWhitelist` and + * `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider `$compileProvider`}. + * + * @param {string} html Html input. + * @returns {string} Sanitized html. + * + * @example + + + +
+ Snippet: + + + + + + + + + + + + + + + + + + + + + + + + + +
DirectiveHowSourceRendered
ng-bind-htmlAutomatically uses $sanitize
<div ng-bind-html="snippet">
</div>
ng-bind-htmlBypass $sanitize by explicitly trusting the dangerous value +
<div ng-bind-html="deliberatelyTrustDangerousSnippet()">
+</div>
+
ng-bindAutomatically escapes
<div ng-bind="snippet">
</div>
+
+
+ + it('should sanitize the html snippet by default', function() { + expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()). + toBe('

an html\nclick here\nsnippet

'); + }); + + it('should inline raw snippet if bound to a trusted value', function() { + expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()). + toBe("

an html\n" + + "click here\n" + + "snippet

"); + }); + + it('should escape snippet without any filter', function() { + expect(element(by.css('#bind-default div')).getInnerHtml()). + toBe("<p style=\"color:blue\">an html\n" + + "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + + "snippet</p>"); + }); + + it('should update', function() { + element(by.model('snippet')).clear(); + element(by.model('snippet')).sendKeys('new text'); + expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()). + toBe('new text'); + expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe( + 'new text'); + expect(element(by.css('#bind-default div')).getInnerHtml()).toBe( + "new <b onclick=\"alert(1)\">text</b>"); + }); +
+
+ */ +function $SanitizeProvider() { + this.$get = ['$$sanitizeUri', function($$sanitizeUri) { + return function(html) { + var buf = []; + htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) { + return !/^unsafe/.test($$sanitizeUri(uri, isImage)); + })); + return buf.join(''); + }; + }]; +} + +function sanitizeText(chars) { + var buf = []; + var writer = htmlSanitizeWriter(buf, angular.noop); + writer.chars(chars); + return buf.join(''); +} + + +// Regular Expressions for parsing tags and attributes +var START_TAG_REGEXP = + /^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/, + END_TAG_REGEXP = /^<\/\s*([\w:-]+)[^>]*>/, + ATTR_REGEXP = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g, + BEGIN_TAG_REGEXP = /^/g, + DOCTYPE_REGEXP = /]*?)>/i, + CDATA_REGEXP = //g, + SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + // Match everything outside of normal chars and " (quote character) + NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g; + + +// Good source of info about elements and attributes +// http://dev.w3.org/html5/spec/Overview.html#semantics +// http://simon.html5.org/html-elements + +// Safe Void Elements - HTML5 +// http://dev.w3.org/html5/spec/Overview.html#void-elements +var voidElements = makeMap("area,br,col,hr,img,wbr"); + +// Elements that you can, intentionally, leave open (and which close themselves) +// http://dev.w3.org/html5/spec/Overview.html#optional-tags +var optionalEndTagBlockElements = makeMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"), + optionalEndTagInlineElements = makeMap("rp,rt"), + optionalEndTagElements = angular.extend({}, + optionalEndTagInlineElements, + optionalEndTagBlockElements); + +// Safe Block Elements - HTML5 +var blockElements = angular.extend({}, optionalEndTagBlockElements, makeMap("address,article," + + "aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5," + + "h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")); + +// Inline Elements - HTML5 +var inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap("a,abbr,acronym,b," + + "bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s," + + "samp,small,span,strike,strong,sub,sup,time,tt,u,var")); + + +// Special Elements (can contain anything) +var specialElements = makeMap("script,style"); + +var validElements = angular.extend({}, + voidElements, + blockElements, + inlineElements, + optionalEndTagElements); + +//Attributes that have href and hence need to be sanitized +var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap"); +var validAttrs = angular.extend({}, uriAttrs, makeMap( + 'abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,'+ + 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,'+ + 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,'+ + 'scope,scrolling,shape,size,span,start,summary,target,title,type,'+ + 'valign,value,vspace,width')); + +function makeMap(str) { + var obj = {}, items = str.split(','), i; + for (i = 0; i < items.length; i++) obj[items[i]] = true; + return obj; +} + + +/** + * @example + * htmlParser(htmlString, { + * start: function(tag, attrs, unary) {}, + * end: function(tag) {}, + * chars: function(text) {}, + * comment: function(text) {} + * }); + * + * @param {string} html string + * @param {object} handler + */ +function htmlParser( html, handler ) { + if (typeof html !== 'string') { + if (html === null || typeof html === 'undefined') { + html = ''; + } else { + html = '' + html; + } + } + var index, chars, match, stack = [], last = html, text; + stack.last = function() { return stack[ stack.length - 1 ]; }; + + while ( html ) { + text = ''; + chars = true; + + // Make sure we're not in a script or style element + if ( !stack.last() || !specialElements[ stack.last() ] ) { + + // Comment + if ( html.indexOf("", index) === index) { + if (handler.comment) handler.comment( html.substring( 4, index ) ); + html = html.substring( index + 3 ); + chars = false; + } + // DOCTYPE + } else if ( DOCTYPE_REGEXP.test(html) ) { + match = html.match( DOCTYPE_REGEXP ); + + if ( match ) { + html = html.replace( match[0], ''); + chars = false; + } + // end tag + } else if ( BEGING_END_TAGE_REGEXP.test(html) ) { + match = html.match( END_TAG_REGEXP ); + + if ( match ) { + html = html.substring( match[0].length ); + match[0].replace( END_TAG_REGEXP, parseEndTag ); + chars = false; + } + + // start tag + } else if ( BEGIN_TAG_REGEXP.test(html) ) { + match = html.match( START_TAG_REGEXP ); + + if ( match ) { + // We only have a valid start-tag if there is a '>'. + if ( match[4] ) { + html = html.substring( match[0].length ); + match[0].replace( START_TAG_REGEXP, parseStartTag ); + } + chars = false; + } else { + // no ending tag found --- this piece should be encoded as an entity. + text += '<'; + html = html.substring(1); + } + } + + if ( chars ) { + index = html.indexOf("<"); + + text += index < 0 ? html : html.substring( 0, index ); + html = index < 0 ? "" : html.substring( index ); + + if (handler.chars) handler.chars( decodeEntities(text) ); + } + + } else { + html = html.replace(new RegExp("(.*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'), + function(all, text){ + text = text.replace(COMMENT_REGEXP, "$1").replace(CDATA_REGEXP, "$1"); + + if (handler.chars) handler.chars( decodeEntities(text) ); + + return ""; + }); + + parseEndTag( "", stack.last() ); + } + + if ( html == last ) { + throw $sanitizeMinErr('badparse', "The sanitizer was unable to parse the following block " + + "of html: {0}", html); + } + last = html; + } + + // Clean up any remaining tags + parseEndTag(); + + function parseStartTag( tag, tagName, rest, unary ) { + tagName = angular.lowercase(tagName); + if ( blockElements[ tagName ] ) { + while ( stack.last() && inlineElements[ stack.last() ] ) { + parseEndTag( "", stack.last() ); + } + } + + if ( optionalEndTagElements[ tagName ] && stack.last() == tagName ) { + parseEndTag( "", tagName ); + } + + unary = voidElements[ tagName ] || !!unary; + + if ( !unary ) + stack.push( tagName ); + + var attrs = {}; + + rest.replace(ATTR_REGEXP, + function(match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) { + var value = doubleQuotedValue + || singleQuotedValue + || unquotedValue + || ''; + + attrs[name] = decodeEntities(value); + }); + if (handler.start) handler.start( tagName, attrs, unary ); + } + + function parseEndTag( tag, tagName ) { + var pos = 0, i; + tagName = angular.lowercase(tagName); + if ( tagName ) + // Find the closest opened tag of the same type + for ( pos = stack.length - 1; pos >= 0; pos-- ) + if ( stack[ pos ] == tagName ) + break; + + if ( pos >= 0 ) { + // Close all the open elements, up the stack + for ( i = stack.length - 1; i >= pos; i-- ) + if (handler.end) handler.end( stack[ i ] ); + + // Remove the open elements from the stack + stack.length = pos; + } + } +} + +var hiddenPre=document.createElement("pre"); +var spaceRe = /^(\s*)([\s\S]*?)(\s*)$/; +/** + * decodes all entities into regular string + * @param value + * @returns {string} A string with decoded entities. + */ +function decodeEntities(value) { + if (!value) { return ''; } + + // Note: IE8 does not preserve spaces at the start/end of innerHTML + // so we must capture them and reattach them afterward + var parts = spaceRe.exec(value); + var spaceBefore = parts[1]; + var spaceAfter = parts[3]; + var content = parts[2]; + if (content) { + hiddenPre.innerHTML=content.replace(//g, '>'); +} + +/** + * create an HTML/XML writer which writes to buffer + * @param {Array} buf use buf.jain('') to get out sanitized html string + * @returns {object} in the form of { + * start: function(tag, attrs, unary) {}, + * end: function(tag) {}, + * chars: function(text) {}, + * comment: function(text) {} + * } + */ +function htmlSanitizeWriter(buf, uriValidator){ + var ignore = false; + var out = angular.bind(buf, buf.push); + return { + start: function(tag, attrs, unary){ + tag = angular.lowercase(tag); + if (!ignore && specialElements[tag]) { + ignore = tag; + } + if (!ignore && validElements[tag] === true) { + out('<'); + out(tag); + angular.forEach(attrs, function(value, key){ + var lkey=angular.lowercase(key); + var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background'); + if (validAttrs[lkey] === true && + (uriAttrs[lkey] !== true || uriValidator(value, isImage))) { + out(' '); + out(key); + out('="'); + out(encodeEntities(value)); + out('"'); + } + }); + out(unary ? '/>' : '>'); + } + }, + end: function(tag){ + tag = angular.lowercase(tag); + if (!ignore && validElements[tag] === true) { + out(''); + } + if (tag == ignore) { + ignore = false; + } + }, + chars: function(chars){ + if (!ignore) { + out(encodeEntities(chars)); + } + } + }; +} + + +// define ngSanitize module and register $sanitize service +angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider); + +/* global sanitizeText: false */ + +/** + * @ngdoc filter + * @name linky + * @kind function + * + * @description + * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and + * plain email address links. + * + * Requires the {@link ngSanitize `ngSanitize`} module to be installed. + * + * @param {string} text Input text. + * @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in. + * @returns {string} Html-linkified text. + * + * @usage + + * + * @example + + + +
+ Snippet: + + + + + + + + + + + + + + + + + + + + + +
FilterSourceRendered
linky filter +
<div ng-bind-html="snippet | linky">
</div>
+
+
+
linky target +
<div ng-bind-html="snippetWithTarget | linky:'_blank'">
</div>
+
+
+
no filter
<div ng-bind="snippet">
</div>
+ + + it('should linkify the snippet with urls', function() { + expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()). + toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' + + 'another@somewhere.org, and one more: ftp://127.0.0.1/.'); + expect(element.all(by.css('#linky-filter a')).count()).toEqual(4); + }); + + it('should not linkify snippet without the linky filter', function() { + expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()). + toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' + + 'another@somewhere.org, and one more: ftp://127.0.0.1/.'); + expect(element.all(by.css('#escaped-html a')).count()).toEqual(0); + }); + + it('should update', function() { + element(by.model('snippet')).clear(); + element(by.model('snippet')).sendKeys('new http://link.'); + expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()). + toBe('new http://link.'); + expect(element.all(by.css('#linky-filter a')).count()).toEqual(1); + expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()) + .toBe('new http://link.'); + }); + + it('should work with the target property', function() { + expect(element(by.id('linky-target')). + element(by.binding("snippetWithTarget | linky:'_blank'")).getText()). + toBe('http://angularjs.org/'); + expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank'); + }); + + + */ +angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) { + var LINKY_URL_REGEXP = + /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/, + MAILTO_REGEXP = /^mailto:/; + + return function(text, target) { + if (!text) return text; + var match; + var raw = text; + var html = []; + var url; + var i; + while ((match = raw.match(LINKY_URL_REGEXP))) { + // We can not end in these as they are sometimes found at the end of the sentence + url = match[0]; + // if we did not match ftp/http/mailto then assume mailto + if (match[2] == match[3]) url = 'mailto:' + url; + i = match.index; + addText(raw.substr(0, i)); + addLink(url, match[0].replace(MAILTO_REGEXP, '')); + raw = raw.substring(i + match[0].length); + } + addText(raw); + return $sanitize(html.join('')); + + function addText(text) { + if (!text) { + return; + } + html.push(sanitizeText(text)); + } + + function addLink(url, text) { + html.push(''); + addText(text); + html.push(''); + } + }; +}]); + + +})(window, window.angular); diff --git a/ecomp-portal-BE/war/static/ebz/angular_js/angular.js b/ecomp-portal-BE/war/static/ebz/angular_js/angular.js new file mode 100644 index 00000000..132234b6 --- /dev/null +++ b/ecomp-portal-BE/war/static/ebz/angular_js/angular.js @@ -0,0 +1,22024 @@ +/** + * @license AngularJS v1.2.25 + * (c) 2010-2014 Google, Inc. http://angularjs.org + * License: MIT + */ +(function(window, document, undefined) {'use strict'; + +/** + * @description + * + * This object provides a utility for producing rich Error messages within + * Angular. It can be called as follows: + * + * var exampleMinErr = minErr('example'); + * throw exampleMinErr('one', 'This {0} is {1}', foo, bar); + * + * The above creates an instance of minErr in the example namespace. The + * resulting error will have a namespaced error code of example.one. The + * resulting error will replace {0} with the value of foo, and {1} with the + * value of bar. The object is not restricted in the number of arguments it can + * take. + * + * If fewer arguments are specified than necessary for interpolation, the extra + * interpolation markers will be preserved in the final string. + * + * Since data will be parsed statically during a build step, some restrictions + * are applied with respect to how minErr instances are created and called. + * Instances should have names of the form namespaceMinErr for a minErr created + * using minErr('namespace') . Error codes, namespaces and template strings + * should all be static strings, not variables or general expressions. + * + * @param {string} module The namespace to use for the new minErr instance. + * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance + */ + +function minErr(module) { + return function () { + var code = arguments[0], + prefix = '[' + (module ? module + ':' : '') + code + '] ', + template = arguments[1], + templateArgs = arguments, + stringify = function (obj) { + if (typeof obj === 'function') { + return obj.toString().replace(/ \{[\s\S]*$/, ''); + } else if (typeof obj === 'undefined') { + return 'undefined'; + } else if (typeof obj !== 'string') { + return JSON.stringify(obj); + } + return obj; + }, + message, i; + + message = prefix + template.replace(/\{\d+\}/g, function (match) { + var index = +match.slice(1, -1), arg; + + if (index + 2 < templateArgs.length) { + arg = templateArgs[index + 2]; + if (typeof arg === 'function') { + return arg.toString().replace(/ ?\{[\s\S]*$/, ''); + } else if (typeof arg === 'undefined') { + return 'undefined'; + } else if (typeof arg !== 'string') { + return toJson(arg); + } + return arg; + } + return match; + }); + + message = message + '\nhttp://errors.angularjs.org/1.2.25/' + + (module ? module + '/' : '') + code; + for (i = 2; i < arguments.length; i++) { + message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' + + encodeURIComponent(stringify(arguments[i])); + } + + return new Error(message); + }; +} + +/* We need to tell jshint what variables are being exported */ +/* global angular: true, + msie: true, + jqLite: true, + jQuery: true, + slice: true, + push: true, + toString: true, + ngMinErr: true, + angularModule: true, + nodeName_: true, + uid: true, + VALIDITY_STATE_PROPERTY: true, + + lowercase: true, + uppercase: true, + manualLowercase: true, + manualUppercase: true, + nodeName_: true, + isArrayLike: true, + forEach: true, + sortedKeys: true, + forEachSorted: true, + reverseParams: true, + nextUid: true, + setHashKey: true, + extend: true, + int: true, + inherit: true, + noop: true, + identity: true, + valueFn: true, + isUndefined: true, + isDefined: true, + isObject: true, + isString: true, + isNumber: true, + isDate: true, + isArray: true, + isFunction: true, + isRegExp: true, + isWindow: true, + isScope: true, + isFile: true, + isBlob: true, + isBoolean: true, + isPromiseLike: true, + trim: true, + isElement: true, + makeMap: true, + map: true, + size: true, + includes: true, + indexOf: true, + arrayRemove: true, + isLeafNode: true, + copy: true, + shallowCopy: true, + equals: true, + csp: true, + concat: true, + sliceArgs: true, + bind: true, + toJsonReplacer: true, + toJson: true, + fromJson: true, + toBoolean: true, + startingTag: true, + tryDecodeURIComponent: true, + parseKeyValue: true, + toKeyValue: true, + encodeUriSegment: true, + encodeUriQuery: true, + angularInit: true, + bootstrap: true, + snake_case: true, + bindJQuery: true, + assertArg: true, + assertArgFn: true, + assertNotHasOwnProperty: true, + getter: true, + getBlockElements: true, + hasOwnProperty: true, +*/ + +//////////////////////////////////// + +/** + * @ngdoc module + * @name ng + * @module ng + * @description + * + * # ng (core module) + * The ng module is loaded by default when an AngularJS application is started. The module itself + * contains the essential components for an AngularJS application to function. The table below + * lists a high level breakdown of each of the services/factories, filters, directives and testing + * components available within this core module. + * + *
+ */ + +// The name of a form control's ValidityState property. +// This is used so that it's possible for internal tests to create mock ValidityStates. +var VALIDITY_STATE_PROPERTY = 'validity'; + +/** + * @ngdoc function + * @name angular.lowercase + * @module ng + * @kind function + * + * @description Converts the specified string to lowercase. + * @param {string} string String to be converted to lowercase. + * @returns {string} Lowercased string. + */ +var lowercase = function(string){return isString(string) ? string.toLowerCase() : string;}; +var hasOwnProperty = Object.prototype.hasOwnProperty; + +/** + * @ngdoc function + * @name angular.uppercase + * @module ng + * @kind function + * + * @description Converts the specified string to uppercase. + * @param {string} string String to be converted to uppercase. + * @returns {string} Uppercased string. + */ +var uppercase = function(string){return isString(string) ? string.toUpperCase() : string;}; + + +var manualLowercase = function(s) { + /* jshint bitwise: false */ + return isString(s) + ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);}) + : s; +}; +var manualUppercase = function(s) { + /* jshint bitwise: false */ + return isString(s) + ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);}) + : s; +}; + + +// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish +// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods +// with correct but slower alternatives. +if ('i' !== 'I'.toLowerCase()) { + lowercase = manualLowercase; + uppercase = manualUppercase; +} + + +var /** holds major version number for IE or NaN for real browsers */ + msie, + jqLite, // delay binding since jQuery could be loaded after us. + jQuery, // delay binding + slice = [].slice, + push = [].push, + toString = Object.prototype.toString, + ngMinErr = minErr('ng'), + + /** @name angular */ + angular = window.angular || (window.angular = {}), + angularModule, + nodeName_, + uid = ['0', '0', '0']; + +/** + * IE 11 changed the format of the UserAgent string. + * See http://msdn.microsoft.com/en-us/library/ms537503.aspx + */ +msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]); +if (isNaN(msie)) { + msie = int((/trident\/.*; rv:(\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]); +} + + +/** + * @private + * @param {*} obj + * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, + * String ...) + */ +function isArrayLike(obj) { + if (obj == null || isWindow(obj)) { + return false; + } + + var length = obj.length; + + if (obj.nodeType === 1 && length) { + return true; + } + + return isString(obj) || isArray(obj) || length === 0 || + typeof length === 'number' && length > 0 && (length - 1) in obj; +} + +/** + * @ngdoc function + * @name angular.forEach + * @module ng + * @kind function + * + * @description + * Invokes the `iterator` function once for each item in `obj` collection, which can be either an + * object or an array. The `iterator` function is invoked with `iterator(value, key)`, where `value` + * is the value of an object property or an array element and `key` is the object property key or + * array element index. Specifying a `context` for the function is optional. + * + * It is worth noting that `.forEach` does not iterate over inherited properties because it filters + * using the `hasOwnProperty` method. + * + ```js + var values = {name: 'misko', gender: 'male'}; + var log = []; + angular.forEach(values, function(value, key) { + this.push(key + ': ' + value); + }, log); + expect(log).toEqual(['name: misko', 'gender: male']); + ``` + * + * @param {Object|Array} obj Object to iterate over. + * @param {Function} iterator Iterator function. + * @param {Object=} context Object to become context (`this`) for the iterator function. + * @returns {Object|Array} Reference to `obj`. + */ +function forEach(obj, iterator, context) { + var key; + if (obj) { + if (isFunction(obj)) { + for (key in obj) { + // Need to check if hasOwnProperty exists, + // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function + if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) { + iterator.call(context, obj[key], key); + } + } + } else if (isArray(obj) || isArrayLike(obj)) { + for (key = 0; key < obj.length; key++) { + iterator.call(context, obj[key], key); + } + } else if (obj.forEach && obj.forEach !== forEach) { + obj.forEach(iterator, context); + } else { + for (key in obj) { + if (obj.hasOwnProperty(key)) { + iterator.call(context, obj[key], key); + } + } + } + } + return obj; +} + +function sortedKeys(obj) { + var keys = []; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + keys.push(key); + } + } + return keys.sort(); +} + +function forEachSorted(obj, iterator, context) { + var keys = sortedKeys(obj); + for ( var i = 0; i < keys.length; i++) { + iterator.call(context, obj[keys[i]], keys[i]); + } + return keys; +} + + +/** + * when using forEach the params are value, key, but it is often useful to have key, value. + * @param {function(string, *)} iteratorFn + * @returns {function(*, string)} + */ +function reverseParams(iteratorFn) { + return function(value, key) { iteratorFn(key, value); }; +} + +/** + * A consistent way of creating unique IDs in angular. The ID is a sequence of alpha numeric + * characters such as '012ABC'. The reason why we are not using simply a number counter is that + * the number string gets longer over time, and it can also overflow, where as the nextId + * will grow much slower, it is a string, and it will never overflow. + * + * @returns {string} an unique alpha-numeric string + */ +function nextUid() { + var index = uid.length; + var digit; + + while(index) { + index--; + digit = uid[index].charCodeAt(0); + if (digit == 57 /*'9'*/) { + uid[index] = 'A'; + return uid.join(''); + } + if (digit == 90 /*'Z'*/) { + uid[index] = '0'; + } else { + uid[index] = String.fromCharCode(digit + 1); + return uid.join(''); + } + } + uid.unshift('0'); + return uid.join(''); +} + + +/** + * Set or clear the hashkey for an object. + * @param obj object + * @param h the hashkey (!truthy to delete the hashkey) + */ +function setHashKey(obj, h) { + if (h) { + obj.$$hashKey = h; + } + else { + delete obj.$$hashKey; + } +} + +/** + * @ngdoc function + * @name angular.extend + * @module ng + * @kind function + * + * @description + * Extends the destination object `dst` by copying all of the properties from the `src` object(s) + * to `dst`. You can specify multiple `src` objects. + * + * @param {Object} dst Destination object. + * @param {...Object} src Source object(s). + * @returns {Object} Reference to `dst`. + */ +function extend(dst) { + var h = dst.$$hashKey; + forEach(arguments, function(obj) { + if (obj !== dst) { + forEach(obj, function(value, key) { + dst[key] = value; + }); + } + }); + + setHashKey(dst,h); + return dst; +} + +function int(str) { + return parseInt(str, 10); +} + + +function inherit(parent, extra) { + return extend(new (extend(function() {}, {prototype:parent}))(), extra); +} + +/** + * @ngdoc function + * @name angular.noop + * @module ng + * @kind function + * + * @description + * A function that performs no operations. This function can be useful when writing code in the + * functional style. + ```js + function foo(callback) { + var result = calculateResult(); + (callback || angular.noop)(result); + } + ``` + */ +function noop() {} +noop.$inject = []; + + +/** + * @ngdoc function + * @name angular.identity + * @module ng + * @kind function + * + * @description + * A function that returns its first argument. This function is useful when writing code in the + * functional style. + * + ```js + function transformer(transformationFn, value) { + return (transformationFn || angular.identity)(value); + }; + ``` + */ +function identity($) {return $;} +identity.$inject = []; + + +function valueFn(value) {return function() {return value;};} + +/** + * @ngdoc function + * @name angular.isUndefined + * @module ng + * @kind function + * + * @description + * Determines if a reference is undefined. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is undefined. + */ +function isUndefined(value){return typeof value === 'undefined';} + + +/** + * @ngdoc function + * @name angular.isDefined + * @module ng + * @kind function + * + * @description + * Determines if a reference is defined. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is defined. + */ +function isDefined(value){return typeof value !== 'undefined';} + + +/** + * @ngdoc function + * @name angular.isObject + * @module ng + * @kind function + * + * @description + * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not + * considered to be objects. Note that JavaScript arrays are objects. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is an `Object` but not `null`. + */ +function isObject(value){return value != null && typeof value === 'object';} + + +/** + * @ngdoc function + * @name angular.isString + * @module ng + * @kind function + * + * @description + * Determines if a reference is a `String`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `String`. + */ +function isString(value){return typeof value === 'string';} + + +/** + * @ngdoc function + * @name angular.isNumber + * @module ng + * @kind function + * + * @description + * Determines if a reference is a `Number`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `Number`. + */ +function isNumber(value){return typeof value === 'number';} + + +/** + * @ngdoc function + * @name angular.isDate + * @module ng + * @kind function + * + * @description + * Determines if a value is a date. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `Date`. + */ +function isDate(value) { + return toString.call(value) === '[object Date]'; +} + + +/** + * @ngdoc function + * @name angular.isArray + * @module ng + * @kind function + * + * @description + * Determines if a reference is an `Array`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is an `Array`. + */ +var isArray = (function() { + if (!isFunction(Array.isArray)) { + return function(value) { + return toString.call(value) === '[object Array]'; + }; + } + return Array.isArray; +})(); + +/** + * @ngdoc function + * @name angular.isFunction + * @module ng + * @kind function + * + * @description + * Determines if a reference is a `Function`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `Function`. + */ +function isFunction(value){return typeof value === 'function';} + + +/** + * Determines if a value is a regular expression object. + * + * @private + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `RegExp`. + */ +function isRegExp(value) { + return toString.call(value) === '[object RegExp]'; +} + + +/** + * Checks if `obj` is a window object. + * + * @private + * @param {*} obj Object to check + * @returns {boolean} True if `obj` is a window obj. + */ +function isWindow(obj) { + return obj && obj.document && obj.location && obj.alert && obj.setInterval; +} + + +function isScope(obj) { + return obj && obj.$evalAsync && obj.$watch; +} + + +function isFile(obj) { + return toString.call(obj) === '[object File]'; +} + + +function isBlob(obj) { + return toString.call(obj) === '[object Blob]'; +} + + +function isBoolean(value) { + return typeof value === 'boolean'; +} + + +function isPromiseLike(obj) { + return obj && isFunction(obj.then); +} + + +var trim = (function() { + // native trim is way faster: http://jsperf.com/angular-trim-test + // but IE doesn't have it... :-( + // TODO: we should move this into IE/ES5 polyfill + if (!String.prototype.trim) { + return function(value) { + return isString(value) ? value.replace(/^\s\s*/, '').replace(/\s\s*$/, '') : value; + }; + } + return function(value) { + return isString(value) ? value.trim() : value; + }; +})(); + + +/** + * @ngdoc function + * @name angular.isElement + * @module ng + * @kind function + * + * @description + * Determines if a reference is a DOM element (or wrapped jQuery element). + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element). + */ +function isElement(node) { + return !!(node && + (node.nodeName // we are a direct element + || (node.prop && node.attr && node.find))); // we have an on and find method part of jQuery API +} + +/** + * @param str 'key1,key2,...' + * @returns {object} in the form of {key1:true, key2:true, ...} + */ +function makeMap(str) { + var obj = {}, items = str.split(","), i; + for ( i = 0; i < items.length; i++ ) + obj[ items[i] ] = true; + return obj; +} + + +if (msie < 9) { + nodeName_ = function(element) { + element = element.nodeName ? element : element[0]; + return (element.scopeName && element.scopeName != 'HTML') + ? uppercase(element.scopeName + ':' + element.nodeName) : element.nodeName; + }; +} else { + nodeName_ = function(element) { + return element.nodeName ? element.nodeName : element[0].nodeName; + }; +} + + +function map(obj, iterator, context) { + var results = []; + forEach(obj, function(value, index, list) { + results.push(iterator.call(context, value, index, list)); + }); + return results; +} + + +/** + * @description + * Determines the number of elements in an array, the number of properties an object has, or + * the length of a string. + * + * Note: This function is used to augment the Object type in Angular expressions. See + * {@link angular.Object} for more information about Angular arrays. + * + * @param {Object|Array|string} obj Object, array, or string to inspect. + * @param {boolean} [ownPropsOnly=false] Count only "own" properties in an object + * @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array. + */ +function size(obj, ownPropsOnly) { + var count = 0, key; + + if (isArray(obj) || isString(obj)) { + return obj.length; + } else if (isObject(obj)) { + for (key in obj) + if (!ownPropsOnly || obj.hasOwnProperty(key)) + count++; + } + + return count; +} + + +function includes(array, obj) { + return indexOf(array, obj) != -1; +} + +function indexOf(array, obj) { + if (array.indexOf) return array.indexOf(obj); + + for (var i = 0; i < array.length; i++) { + if (obj === array[i]) return i; + } + return -1; +} + +function arrayRemove(array, value) { + var index = indexOf(array, value); + if (index >=0) + array.splice(index, 1); + return value; +} + +function isLeafNode (node) { + if (node) { + switch (node.nodeName) { + case "OPTION": + case "PRE": + case "TITLE": + return true; + } + } + return false; +} + +/** + * @ngdoc function + * @name angular.copy + * @module ng + * @kind function + * + * @description + * Creates a deep copy of `source`, which should be an object or an array. + * + * * If no destination is supplied, a copy of the object or array is created. + * * If a destination is provided, all of its elements (for array) or properties (for objects) + * are deleted and then all elements/properties from the source are copied to it. + * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned. + * * If `source` is identical to 'destination' an exception will be thrown. + * + * @param {*} source The source that will be used to make a copy. + * Can be any type, including primitives, `null`, and `undefined`. + * @param {(Object|Array)=} destination Destination into which the source is copied. If + * provided, must be of the same type as `source`. + * @returns {*} The copy or updated `destination`, if `destination` was specified. + * + * @example + + +
+
+ Name:
+ E-mail:
+ Gender: male + female
+ + +
+
form = {{user | json}}
+
master = {{master | json}}
+
+ + +
+
+ */ +function copy(source, destination, stackSource, stackDest) { + if (isWindow(source) || isScope(source)) { + throw ngMinErr('cpws', + "Can't copy! Making copies of Window or Scope instances is not supported."); + } + + if (!destination) { + destination = source; + if (source) { + if (isArray(source)) { + destination = copy(source, [], stackSource, stackDest); + } else if (isDate(source)) { + destination = new Date(source.getTime()); + } else if (isRegExp(source)) { + destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]); + destination.lastIndex = source.lastIndex; + } else if (isObject(source)) { + destination = copy(source, {}, stackSource, stackDest); + } + } + } else { + if (source === destination) throw ngMinErr('cpi', + "Can't copy! Source and destination are identical."); + + stackSource = stackSource || []; + stackDest = stackDest || []; + + if (isObject(source)) { + var index = indexOf(stackSource, source); + if (index !== -1) return stackDest[index]; + + stackSource.push(source); + stackDest.push(destination); + } + + var result; + if (isArray(source)) { + destination.length = 0; + for ( var i = 0; i < source.length; i++) { + result = copy(source[i], null, stackSource, stackDest); + if (isObject(source[i])) { + stackSource.push(source[i]); + stackDest.push(result); + } + destination.push(result); + } + } else { + var h = destination.$$hashKey; + if (isArray(destination)) { + destination.length = 0; + } else { + forEach(destination, function(value, key) { + delete destination[key]; + }); + } + for ( var key in source) { + result = copy(source[key], null, stackSource, stackDest); + if (isObject(source[key])) { + stackSource.push(source[key]); + stackDest.push(result); + } + destination[key] = result; + } + setHashKey(destination,h); + } + + } + return destination; +} + +/** + * Creates a shallow copy of an object, an array or a primitive + */ +function shallowCopy(src, dst) { + if (isArray(src)) { + dst = dst || []; + + for ( var i = 0; i < src.length; i++) { + dst[i] = src[i]; + } + } else if (isObject(src)) { + dst = dst || {}; + + for (var key in src) { + if (hasOwnProperty.call(src, key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) { + dst[key] = src[key]; + } + } + } + + return dst || src; +} + + +/** + * @ngdoc function + * @name angular.equals + * @module ng + * @kind function + * + * @description + * Determines if two objects or two values are equivalent. Supports value types, regular + * expressions, arrays and objects. + * + * Two objects or values are considered equivalent if at least one of the following is true: + * + * * Both objects or values pass `===` comparison. + * * Both objects or values are of the same type and all of their properties are equal by + * comparing them with `angular.equals`. + * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal) + * * Both values represent the same regular expression (In JavaScript, + * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual + * representation matches). + * + * During a property comparison, properties of `function` type and properties with names + * that begin with `$` are ignored. + * + * Scope and DOMWindow objects are being compared only by identify (`===`). + * + * @param {*} o1 Object or value to compare. + * @param {*} o2 Object or value to compare. + * @returns {boolean} True if arguments are equal. + */ +function equals(o1, o2) { + if (o1 === o2) return true; + if (o1 === null || o2 === null) return false; + if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN + var t1 = typeof o1, t2 = typeof o2, length, key, keySet; + if (t1 == t2) { + if (t1 == 'object') { + if (isArray(o1)) { + if (!isArray(o2)) return false; + if ((length = o1.length) == o2.length) { + for(key=0; key 2 ? sliceArgs(arguments, 2) : []; + if (isFunction(fn) && !(fn instanceof RegExp)) { + return curryArgs.length + ? function() { + return arguments.length + ? fn.apply(self, curryArgs.concat(slice.call(arguments, 0))) + : fn.apply(self, curryArgs); + } + : function() { + return arguments.length + ? fn.apply(self, arguments) + : fn.call(self); + }; + } else { + // in IE, native methods are not functions so they cannot be bound (note: they don't need to be) + return fn; + } +} + + +function toJsonReplacer(key, value) { + var val = value; + + if (typeof key === 'string' && key.charAt(0) === '$') { + val = undefined; + } else if (isWindow(value)) { + val = '$WINDOW'; + } else if (value && document === value) { + val = '$DOCUMENT'; + } else if (isScope(value)) { + val = '$SCOPE'; + } + + return val; +} + + +/** + * @ngdoc function + * @name angular.toJson + * @module ng + * @kind function + * + * @description + * Serializes input into a JSON-formatted string. Properties with leading $ characters will be + * stripped since angular uses this notation internally. + * + * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON. + * @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace. + * @returns {string|undefined} JSON-ified string representing `obj`. + */ +function toJson(obj, pretty) { + if (typeof obj === 'undefined') return undefined; + return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null); +} + + +/** + * @ngdoc function + * @name angular.fromJson + * @module ng + * @kind function + * + * @description + * Deserializes a JSON string. + * + * @param {string} json JSON string to deserialize. + * @returns {Object|Array|string|number} Deserialized thingy. + */ +function fromJson(json) { + return isString(json) + ? JSON.parse(json) + : json; +} + + +function toBoolean(value) { + if (typeof value === 'function') { + value = true; + } else if (value && value.length !== 0) { + var v = lowercase("" + value); + value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]'); + } else { + value = false; + } + return value; +} + +/** + * @returns {string} Returns the string representation of the element. + */ +function startingTag(element) { + element = jqLite(element).clone(); + try { + // turns out IE does not let you set .html() on elements which + // are not allowed to have children. So we just ignore it. + element.empty(); + } catch(e) {} + // As Per DOM Standards + var TEXT_NODE = 3; + var elemHtml = jqLite('
').append(element).html(); + try { + return element[0].nodeType === TEXT_NODE ? lowercase(elemHtml) : + elemHtml. + match(/^(<[^>]+>)/)[1]. + replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); }); + } catch(e) { + return lowercase(elemHtml); + } + +} + + +///////////////////////////////////////////////// + +/** + * Tries to decode the URI component without throwing an exception. + * + * @private + * @param str value potential URI component to check. + * @returns {boolean} True if `value` can be decoded + * with the decodeURIComponent function. + */ +function tryDecodeURIComponent(value) { + try { + return decodeURIComponent(value); + } catch(e) { + // Ignore any invalid uri component + } +} + + +/** + * Parses an escaped url query string into key-value pairs. + * @returns {Object.} + */ +function parseKeyValue(/**string*/keyValue) { + var obj = {}, key_value, key; + forEach((keyValue || "").split('&'), function(keyValue) { + if ( keyValue ) { + key_value = keyValue.replace(/\+/g,'%20').split('='); + key = tryDecodeURIComponent(key_value[0]); + if ( isDefined(key) ) { + var val = isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true; + if (!hasOwnProperty.call(obj, key)) { + obj[key] = val; + } else if(isArray(obj[key])) { + obj[key].push(val); + } else { + obj[key] = [obj[key],val]; + } + } + } + }); + return obj; +} + +function toKeyValue(obj) { + var parts = []; + forEach(obj, function(value, key) { + if (isArray(value)) { + forEach(value, function(arrayValue) { + parts.push(encodeUriQuery(key, true) + + (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true))); + }); + } else { + parts.push(encodeUriQuery(key, true) + + (value === true ? '' : '=' + encodeUriQuery(value, true))); + } + }); + return parts.length ? parts.join('&') : ''; +} + + +/** + * We need our custom method because encodeURIComponent is too aggressive and doesn't follow + * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path + * segments: + * segment = *pchar + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * pct-encoded = "%" HEXDIG HEXDIG + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ +function encodeUriSegment(val) { + return encodeUriQuery(val, true). + replace(/%26/gi, '&'). + replace(/%3D/gi, '='). + replace(/%2B/gi, '+'); +} + + +/** + * This method is intended for encoding *key* or *value* parts of query component. We need a custom + * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be + * encoded per http://tools.ietf.org/html/rfc3986: + * query = *( pchar / "/" / "?" ) + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * pct-encoded = "%" HEXDIG HEXDIG + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ +function encodeUriQuery(val, pctEncodeSpaces) { + return encodeURIComponent(val). + replace(/%40/gi, '@'). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); +} + + +/** + * @ngdoc directive + * @name ngApp + * @module ng + * + * @element ANY + * @param {angular.Module} ngApp an optional application + * {@link angular.module module} name to load. + * + * @description + * + * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive + * designates the **root element** of the application and is typically placed near the root element + * of the page - e.g. on the `` or `` tags. + * + * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp` + * found in the document will be used to define the root element to auto-bootstrap as an + * application. To run multiple applications in an HTML document you must manually bootstrap them using + * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other. + * + * You can specify an **AngularJS module** to be used as the root module for the application. This + * module will be loaded into the {@link auto.$injector} when the application is bootstrapped and + * should contain the application code needed or have dependencies on other modules that will + * contain the code. See {@link angular.module} for more information. + * + * In the example below if the `ngApp` directive were not placed on the `html` element then the + * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}` + * would not be resolved to `3`. + * + * `ngApp` is the easiest, and most common, way to bootstrap an application. + * + + +
+ I can add: {{a}} + {{b}} = {{ a+b }} +
+
+ + angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) { + $scope.a = 1; + $scope.b = 2; + }); + +
+ * + */ +function angularInit(element, bootstrap) { + var elements = [element], + appElement, + module, + names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'], + NG_APP_CLASS_REGEXP = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/; + + function append(element) { + element && elements.push(element); + } + + forEach(names, function(name) { + names[name] = true; + append(document.getElementById(name)); + name = name.replace(':', '\\:'); + if (element.querySelectorAll) { + forEach(element.querySelectorAll('.' + name), append); + forEach(element.querySelectorAll('.' + name + '\\:'), append); + forEach(element.querySelectorAll('[' + name + ']'), append); + } + }); + + forEach(elements, function(element) { + if (!appElement) { + var className = ' ' + element.className + ' '; + var match = NG_APP_CLASS_REGEXP.exec(className); + if (match) { + appElement = element; + module = (match[2] || '').replace(/\s+/g, ','); + } else { + forEach(element.attributes, function(attr) { + if (!appElement && names[attr.name]) { + appElement = element; + module = attr.value; + } + }); + } + } + }); + if (appElement) { + bootstrap(appElement, module ? [module] : []); + } +} + +/** + * @ngdoc function + * @name angular.bootstrap + * @module ng + * @description + * Use this function to manually start up angular application. + * + * See: {@link guide/bootstrap Bootstrap} + * + * Note that ngScenario-based end-to-end tests cannot use this function to bootstrap manually. + * They must use {@link ng.directive:ngApp ngApp}. + * + * Angular will detect if it has been loaded into the browser more than once and only allow the + * first loaded script to be bootstrapped and will report a warning to the browser console for + * each of the subsequent scripts. This prevents strange results in applications, where otherwise + * multiple instances of Angular try to work on the DOM. + * + * + * + * + *
+ * + * + * + * + * + * + * + *
{{heading}}
{{fill}}
+ *
+ *
+ * + * var app = angular.module('multi-bootstrap', []) + * + * .controller('BrokenTable', function($scope) { + * $scope.headings = ['One', 'Two', 'Three']; + * $scope.fillings = [[1, 2, 3], ['A', 'B', 'C'], [7, 8, 9]]; + * }); + * + * + * it('should only insert one table cell for each item in $scope.fillings', function() { + * expect(element.all(by.css('td')).count()) + * .toBe(9); + * }); + * + *
+ * + * @param {DOMElement} element DOM element which is the root of angular application. + * @param {Array=} modules an array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * See: {@link angular.module modules} + * @returns {auto.$injector} Returns the newly created injector for this app. + */ +function bootstrap(element, modules) { + var doBootstrap = function() { + element = jqLite(element); + + if (element.injector()) { + var tag = (element[0] === document) ? 'document' : startingTag(element); + //Encode angle brackets to prevent input from being sanitized to empty string #8683 + throw ngMinErr( + 'btstrpd', + "App Already Bootstrapped with this Element '{0}'", + tag.replace(//,'>')); + } + + modules = modules || []; + modules.unshift(['$provide', function($provide) { + $provide.value('$rootElement', element); + }]); + modules.unshift('ng'); + var injector = createInjector(modules); + injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', '$animate', + function(scope, element, compile, injector, animate) { + scope.$apply(function() { + element.data('$injector', injector); + compile(element)(scope); + }); + }] + ); + return injector; + }; + + var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/; + + if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) { + return doBootstrap(); + } + + window.name = window.name.replace(NG_DEFER_BOOTSTRAP, ''); + angular.resumeBootstrap = function(extraModules) { + forEach(extraModules, function(module) { + modules.push(module); + }); + doBootstrap(); + }; +} + +var SNAKE_CASE_REGEXP = /[A-Z]/g; +function snake_case(name, separator) { + separator = separator || '_'; + return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) { + return (pos ? separator : '') + letter.toLowerCase(); + }); +} + +function bindJQuery() { + // bind to jQuery if present; + jQuery = window.jQuery; + // Use jQuery if it exists with proper functionality, otherwise default to us. + // Angular 1.2+ requires jQuery 1.7.1+ for on()/off() support. + if (jQuery && jQuery.fn.on) { + jqLite = jQuery; + extend(jQuery.fn, { + scope: JQLitePrototype.scope, + isolateScope: JQLitePrototype.isolateScope, + controller: JQLitePrototype.controller, + injector: JQLitePrototype.injector, + inheritedData: JQLitePrototype.inheritedData + }); + // Method signature: + // jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) + jqLitePatchJQueryRemove('remove', true, true, false); + jqLitePatchJQueryRemove('empty', false, false, false); + jqLitePatchJQueryRemove('html', false, false, true); + } else { + jqLite = JQLite; + } + angular.element = jqLite; +} + +/** + * throw error if the argument is falsy. + */ +function assertArg(arg, name, reason) { + if (!arg) { + throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required")); + } + return arg; +} + +function assertArgFn(arg, name, acceptArrayAnnotation) { + if (acceptArrayAnnotation && isArray(arg)) { + arg = arg[arg.length - 1]; + } + + assertArg(isFunction(arg), name, 'not a function, got ' + + (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg)); + return arg; +} + +/** + * throw error if the name given is hasOwnProperty + * @param {String} name the name to test + * @param {String} context the context in which the name is used, such as module or directive + */ +function assertNotHasOwnProperty(name, context) { + if (name === 'hasOwnProperty') { + throw ngMinErr('badname', "hasOwnProperty is not a valid {0} name", context); + } +} + +/** + * Return the value accessible from the object by path. Any undefined traversals are ignored + * @param {Object} obj starting object + * @param {String} path path to traverse + * @param {boolean} [bindFnToScope=true] + * @returns {Object} value as accessible by path + */ +//TODO(misko): this function needs to be removed +function getter(obj, path, bindFnToScope) { + if (!path) return obj; + var keys = path.split('.'); + var key; + var lastInstance = obj; + var len = keys.length; + + for (var i = 0; i < len; i++) { + key = keys[i]; + if (obj) { + obj = (lastInstance = obj)[key]; + } + } + if (!bindFnToScope && isFunction(obj)) { + return bind(lastInstance, obj); + } + return obj; +} + +/** + * Return the DOM siblings between the first and last node in the given array. + * @param {Array} array like object + * @returns {DOMElement} object containing the elements + */ +function getBlockElements(nodes) { + var startNode = nodes[0], + endNode = nodes[nodes.length - 1]; + if (startNode === endNode) { + return jqLite(startNode); + } + + var element = startNode; + var elements = [element]; + + do { + element = element.nextSibling; + if (!element) break; + elements.push(element); + } while (element !== endNode); + + return jqLite(elements); +} + +/** + * @ngdoc type + * @name angular.Module + * @module ng + * @description + * + * Interface for configuring angular {@link angular.module modules}. + */ + +function setupModuleLoader(window) { + + var $injectorMinErr = minErr('$injector'); + var ngMinErr = minErr('ng'); + + function ensure(obj, name, factory) { + return obj[name] || (obj[name] = factory()); + } + + var angular = ensure(window, 'angular', Object); + + // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap + angular.$$minErr = angular.$$minErr || minErr; + + return ensure(angular, 'module', function() { + /** @type {Object.} */ + var modules = {}; + + /** + * @ngdoc function + * @name angular.module + * @module ng + * @description + * + * The `angular.module` is a global place for creating, registering and retrieving Angular + * modules. + * All modules (angular core or 3rd party) that should be available to an application must be + * registered using this mechanism. + * + * When passed two or more arguments, a new module is created. If passed only one argument, an + * existing module (the name passed as the first argument to `module`) is retrieved. + * + * + * # Module + * + * A module is a collection of services, directives, controllers, filters, and configuration information. + * `angular.module` is used to configure the {@link auto.$injector $injector}. + * + * ```js + * // Create a new module + * var myModule = angular.module('myModule', []); + * + * // register a new service + * myModule.value('appName', 'MyCoolApp'); + * + * // configure existing services inside initialization blocks. + * myModule.config(['$locationProvider', function($locationProvider) { + * // Configure existing providers + * $locationProvider.hashPrefix('!'); + * }]); + * ``` + * + * Then you can create an injector and load your modules like this: + * + * ```js + * var injector = angular.injector(['ng', 'myModule']) + * ``` + * + * However it's more likely that you'll just use + * {@link ng.directive:ngApp ngApp} or + * {@link angular.bootstrap} to simplify this process for you. + * + * @param {!string} name The name of the module to create or retrieve. + * @param {!Array.=} requires If specified then new module is being created. If + * unspecified then the module is being retrieved for further configuration. + * @param {Function=} configFn Optional configuration function for the module. Same as + * {@link angular.Module#config Module#config()}. + * @returns {module} new module with the {@link angular.Module} api. + */ + return function module(name, requires, configFn) { + var assertNotHasOwnProperty = function(name, context) { + if (name === 'hasOwnProperty') { + throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context); + } + }; + + assertNotHasOwnProperty(name, 'module'); + if (requires && modules.hasOwnProperty(name)) { + modules[name] = null; + } + return ensure(modules, name, function() { + if (!requires) { + throw $injectorMinErr('nomod', "Module '{0}' is not available! You either misspelled " + + "the module name or forgot to load it. If registering a module ensure that you " + + "specify the dependencies as the second argument.", name); + } + + /** @type {!Array.>} */ + var invokeQueue = []; + + /** @type {!Array.} */ + var runBlocks = []; + + var config = invokeLater('$injector', 'invoke'); + + /** @type {angular.Module} */ + var moduleInstance = { + // Private state + _invokeQueue: invokeQueue, + _runBlocks: runBlocks, + + /** + * @ngdoc property + * @name angular.Module#requires + * @module ng + * + * @description + * Holds the list of modules which the injector will load before the current module is + * loaded. + */ + requires: requires, + + /** + * @ngdoc property + * @name angular.Module#name + * @module ng + * + * @description + * Name of the module. + */ + name: name, + + + /** + * @ngdoc method + * @name angular.Module#provider + * @module ng + * @param {string} name service name + * @param {Function} providerType Construction function for creating new instance of the + * service. + * @description + * See {@link auto.$provide#provider $provide.provider()}. + */ + provider: invokeLater('$provide', 'provider'), + + /** + * @ngdoc method + * @name angular.Module#factory + * @module ng + * @param {string} name service name + * @param {Function} providerFunction Function for creating new instance of the service. + * @description + * See {@link auto.$provide#factory $provide.factory()}. + */ + factory: invokeLater('$provide', 'factory'), + + /** + * @ngdoc method + * @name angular.Module#service + * @module ng + * @param {string} name service name + * @param {Function} constructor A constructor function that will be instantiated. + * @description + * See {@link auto.$provide#service $provide.service()}. + */ + service: invokeLater('$provide', 'service'), + + /** + * @ngdoc method + * @name angular.Module#value + * @module ng + * @param {string} name service name + * @param {*} object Service instance object. + * @description + * See {@link auto.$provide#value $provide.value()}. + */ + value: invokeLater('$provide', 'value'), + + /** + * @ngdoc method + * @name angular.Module#constant + * @module ng + * @param {string} name constant name + * @param {*} object Constant value. + * @description + * Because the constant are fixed, they get applied before other provide methods. + * See {@link auto.$provide#constant $provide.constant()}. + */ + constant: invokeLater('$provide', 'constant', 'unshift'), + + /** + * @ngdoc method + * @name angular.Module#animation + * @module ng + * @param {string} name animation name + * @param {Function} animationFactory Factory function for creating new instance of an + * animation. + * @description + * + * **NOTE**: animations take effect only if the **ngAnimate** module is loaded. + * + * + * Defines an animation hook that can be later used with + * {@link ngAnimate.$animate $animate} service and directives that use this service. + * + * ```js + * module.animation('.animation-name', function($inject1, $inject2) { + * return { + * eventName : function(element, done) { + * //code to run the animation + * //once complete, then run done() + * return function cancellationFunction(element) { + * //code to cancel the animation + * } + * } + * } + * }) + * ``` + * + * See {@link ngAnimate.$animateProvider#register $animateProvider.register()} and + * {@link ngAnimate ngAnimate module} for more information. + */ + animation: invokeLater('$animateProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#filter + * @module ng + * @param {string} name Filter name. + * @param {Function} filterFactory Factory function for creating new instance of filter. + * @description + * See {@link ng.$filterProvider#register $filterProvider.register()}. + */ + filter: invokeLater('$filterProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#controller + * @module ng + * @param {string|Object} name Controller name, or an object map of controllers where the + * keys are the names and the values are the constructors. + * @param {Function} constructor Controller constructor function. + * @description + * See {@link ng.$controllerProvider#register $controllerProvider.register()}. + */ + controller: invokeLater('$controllerProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#directive + * @module ng + * @param {string|Object} name Directive name, or an object map of directives where the + * keys are the names and the values are the factories. + * @param {Function} directiveFactory Factory function for creating new instance of + * directives. + * @description + * See {@link ng.$compileProvider#directive $compileProvider.directive()}. + */ + directive: invokeLater('$compileProvider', 'directive'), + + /** + * @ngdoc method + * @name angular.Module#config + * @module ng + * @param {Function} configFn Execute this function on module load. Useful for service + * configuration. + * @description + * Use this method to register work which needs to be performed on module loading. + * For more about how to configure services, see + * {@link providers#providers_provider-recipe Provider Recipe}. + */ + config: config, + + /** + * @ngdoc method + * @name angular.Module#run + * @module ng + * @param {Function} initializationFn Execute this function after injector creation. + * Useful for application initialization. + * @description + * Use this method to register work which should be performed when the injector is done + * loading all modules. + */ + run: function(block) { + runBlocks.push(block); + return this; + } + }; + + if (configFn) { + config(configFn); + } + + return moduleInstance; + + /** + * @param {string} provider + * @param {string} method + * @param {String=} insertMethod + * @returns {angular.Module} + */ + function invokeLater(provider, method, insertMethod) { + return function() { + invokeQueue[insertMethod || 'push']([provider, method, arguments]); + return moduleInstance; + }; + } + }); + }; + }); + +} + +/* global angularModule: true, + version: true, + + $LocaleProvider, + $CompileProvider, + + htmlAnchorDirective, + inputDirective, + inputDirective, + formDirective, + scriptDirective, + selectDirective, + styleDirective, + optionDirective, + ngBindDirective, + ngBindHtmlDirective, + ngBindTemplateDirective, + ngClassDirective, + ngClassEvenDirective, + ngClassOddDirective, + ngCspDirective, + ngCloakDirective, + ngControllerDirective, + ngFormDirective, + ngHideDirective, + ngIfDirective, + ngIncludeDirective, + ngIncludeFillContentDirective, + ngInitDirective, + ngNonBindableDirective, + ngPluralizeDirective, + ngRepeatDirective, + ngShowDirective, + ngStyleDirective, + ngSwitchDirective, + ngSwitchWhenDirective, + ngSwitchDefaultDirective, + ngOptionsDirective, + ngTranscludeDirective, + ngModelDirective, + ngListDirective, + ngChangeDirective, + requiredDirective, + requiredDirective, + ngValueDirective, + ngAttributeAliasDirectives, + ngEventDirectives, + + $AnchorScrollProvider, + $AnimateProvider, + $BrowserProvider, + $CacheFactoryProvider, + $ControllerProvider, + $DocumentProvider, + $ExceptionHandlerProvider, + $FilterProvider, + $InterpolateProvider, + $IntervalProvider, + $HttpProvider, + $HttpBackendProvider, + $LocationProvider, + $LogProvider, + $ParseProvider, + $RootScopeProvider, + $QProvider, + $$SanitizeUriProvider, + $SceProvider, + $SceDelegateProvider, + $SnifferProvider, + $TemplateCacheProvider, + $TimeoutProvider, + $$RAFProvider, + $$AsyncCallbackProvider, + $WindowProvider +*/ + + +/** + * @ngdoc object + * @name angular.version + * @module ng + * @description + * An object that contains information about the current AngularJS version. This object has the + * following properties: + * + * - `full` – `{string}` – Full version string, such as "0.9.18". + * - `major` – `{number}` – Major version number, such as "0". + * - `minor` – `{number}` – Minor version number, such as "9". + * - `dot` – `{number}` – Dot version number, such as "18". + * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". + */ +var version = { + full: '1.2.25', // all of these placeholder strings will be replaced by grunt's + major: 1, // package task + minor: 2, + dot: 25, + codeName: 'hypnotic-gesticulation' +}; + + +function publishExternalAPI(angular){ + extend(angular, { + 'bootstrap': bootstrap, + 'copy': copy, + 'extend': extend, + 'equals': equals, + 'element': jqLite, + 'forEach': forEach, + 'injector': createInjector, + 'noop': noop, + 'bind': bind, + 'toJson': toJson, + 'fromJson': fromJson, + 'identity': identity, + 'isUndefined': isUndefined, + 'isDefined': isDefined, + 'isString': isString, + 'isFunction': isFunction, + 'isObject': isObject, + 'isNumber': isNumber, + 'isElement': isElement, + 'isArray': isArray, + 'version': version, + 'isDate': isDate, + 'lowercase': lowercase, + 'uppercase': uppercase, + 'callbacks': {counter: 0}, + '$$minErr': minErr, + '$$csp': csp + }); + + angularModule = setupModuleLoader(window); + try { + angularModule('ngLocale'); + } catch (e) { + angularModule('ngLocale', []).provider('$locale', $LocaleProvider); + } + + angularModule('ng', ['ngLocale'], ['$provide', + function ngModule($provide) { + // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it. + $provide.provider({ + $$sanitizeUri: $$SanitizeUriProvider + }); + $provide.provider('$compile', $CompileProvider). + directive({ + a: htmlAnchorDirective, + input: inputDirective, + textarea: inputDirective, + form: formDirective, + script: scriptDirective, + select: selectDirective, + style: styleDirective, + option: optionDirective, + ngBind: ngBindDirective, + ngBindHtml: ngBindHtmlDirective, + ngBindTemplate: ngBindTemplateDirective, + ngClass: ngClassDirective, + ngClassEven: ngClassEvenDirective, + ngClassOdd: ngClassOddDirective, + ngCloak: ngCloakDirective, + ngController: ngControllerDirective, + ngForm: ngFormDirective, + ngHide: ngHideDirective, + ngIf: ngIfDirective, + ngInclude: ngIncludeDirective, + ngInit: ngInitDirective, + ngNonBindable: ngNonBindableDirective, + ngPluralize: ngPluralizeDirective, + ngRepeat: ngRepeatDirective, + ngShow: ngShowDirective, + ngStyle: ngStyleDirective, + ngSwitch: ngSwitchDirective, + ngSwitchWhen: ngSwitchWhenDirective, + ngSwitchDefault: ngSwitchDefaultDirective, + ngOptions: ngOptionsDirective, + ngTransclude: ngTranscludeDirective, + ngModel: ngModelDirective, + ngList: ngListDirective, + ngChange: ngChangeDirective, + required: requiredDirective, + ngRequired: requiredDirective, + ngValue: ngValueDirective + }). + directive({ + ngInclude: ngIncludeFillContentDirective + }). + directive(ngAttributeAliasDirectives). + directive(ngEventDirectives); + $provide.provider({ + $anchorScroll: $AnchorScrollProvider, + $animate: $AnimateProvider, + $browser: $BrowserProvider, + $cacheFactory: $CacheFactoryProvider, + $controller: $ControllerProvider, + $document: $DocumentProvider, + $exceptionHandler: $ExceptionHandlerProvider, + $filter: $FilterProvider, + $interpolate: $InterpolateProvider, + $interval: $IntervalProvider, + $http: $HttpProvider, + $httpBackend: $HttpBackendProvider, + $location: $LocationProvider, + $log: $LogProvider, + $parse: $ParseProvider, + $rootScope: $RootScopeProvider, + $q: $QProvider, + $sce: $SceProvider, + $sceDelegate: $SceDelegateProvider, + $sniffer: $SnifferProvider, + $templateCache: $TemplateCacheProvider, + $timeout: $TimeoutProvider, + $window: $WindowProvider, + $$rAF: $$RAFProvider, + $$asyncCallback : $$AsyncCallbackProvider + }); + } + ]); +} + +/* global JQLitePrototype: true, + addEventListenerFn: true, + removeEventListenerFn: true, + BOOLEAN_ATTR: true +*/ + +////////////////////////////////// +//JQLite +////////////////////////////////// + +/** + * @ngdoc function + * @name angular.element + * @module ng + * @kind function + * + * @description + * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element. + * + * If jQuery is available, `angular.element` is an alias for the + * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element` + * delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite." + * + *
jqLite is a tiny, API-compatible subset of jQuery that allows + * Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most + * commonly needed functionality with the goal of having a very small footprint.
+ * + * To use jQuery, simply load it before `DOMContentLoaded` event fired. + * + *
**Note:** all element references in Angular are always wrapped with jQuery or + * jqLite; they are never raw DOM references.
+ * + * ## Angular's jqLite + * jqLite provides only the following jQuery methods: + * + * - [`addClass()`](http://api.jquery.com/addClass/) + * - [`after()`](http://api.jquery.com/after/) + * - [`append()`](http://api.jquery.com/append/) + * - [`attr()`](http://api.jquery.com/attr/) + * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData + * - [`children()`](http://api.jquery.com/children/) - Does not support selectors + * - [`clone()`](http://api.jquery.com/clone/) + * - [`contents()`](http://api.jquery.com/contents/) + * - [`css()`](http://api.jquery.com/css/) + * - [`data()`](http://api.jquery.com/data/) + * - [`empty()`](http://api.jquery.com/empty/) + * - [`eq()`](http://api.jquery.com/eq/) + * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name + * - [`hasClass()`](http://api.jquery.com/hasClass/) + * - [`html()`](http://api.jquery.com/html/) + * - [`next()`](http://api.jquery.com/next/) - Does not support selectors + * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData + * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces or selectors + * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors + * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors + * - [`prepend()`](http://api.jquery.com/prepend/) + * - [`prop()`](http://api.jquery.com/prop/) + * - [`ready()`](http://api.jquery.com/ready/) + * - [`remove()`](http://api.jquery.com/remove/) + * - [`removeAttr()`](http://api.jquery.com/removeAttr/) + * - [`removeClass()`](http://api.jquery.com/removeClass/) + * - [`removeData()`](http://api.jquery.com/removeData/) + * - [`replaceWith()`](http://api.jquery.com/replaceWith/) + * - [`text()`](http://api.jquery.com/text/) + * - [`toggleClass()`](http://api.jquery.com/toggleClass/) + * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers. + * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces + * - [`val()`](http://api.jquery.com/val/) + * - [`wrap()`](http://api.jquery.com/wrap/) + * + * ## jQuery/jqLite Extras + * Angular also provides the following additional methods and events to both jQuery and jqLite: + * + * ### Events + * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event + * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM + * element before it is removed. + * + * ### Methods + * - `controller(name)` - retrieves the controller of the current element or its parent. By default + * retrieves controller associated with the `ngController` directive. If `name` is provided as + * camelCase directive name, then the controller for this directive will be retrieved (e.g. + * `'ngModel'`). + * - `injector()` - retrieves the injector of the current element or its parent. + * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current + * element or its parent. + * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the + * current element. This getter should be used only on elements that contain a directive which starts a new isolate + * scope. Calling `scope()` on this element always returns the original non-isolate scope. + * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top + * parent element is reached. + * + * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery. + * @returns {Object} jQuery object. + */ + +JQLite.expando = 'ng339'; + +var jqCache = JQLite.cache = {}, + jqId = 1, + addEventListenerFn = (window.document.addEventListener + ? function(element, type, fn) {element.addEventListener(type, fn, false);} + : function(element, type, fn) {element.attachEvent('on' + type, fn);}), + removeEventListenerFn = (window.document.removeEventListener + ? function(element, type, fn) {element.removeEventListener(type, fn, false); } + : function(element, type, fn) {element.detachEvent('on' + type, fn); }); + +/* + * !!! This is an undocumented "private" function !!! + */ +var jqData = JQLite._data = function(node) { + //jQuery always returns an object on cache miss + return this.cache[node[this.expando]] || {}; +}; + +function jqNextId() { return ++jqId; } + + +var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g; +var MOZ_HACK_REGEXP = /^moz([A-Z])/; +var jqLiteMinErr = minErr('jqLite'); + +/** + * Converts snake_case to camelCase. + * Also there is special case for Moz prefix starting with upper case letter. + * @param name Name to normalize + */ +function camelCase(name) { + return name. + replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) { + return offset ? letter.toUpperCase() : letter; + }). + replace(MOZ_HACK_REGEXP, 'Moz$1'); +} + +///////////////////////////////////////////// +// jQuery mutation patch +// +// In conjunction with bindJQuery intercepts all jQuery's DOM destruction apis and fires a +// $destroy event on all DOM nodes being removed. +// +///////////////////////////////////////////// + +function jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) { + var originalJqFn = jQuery.fn[name]; + originalJqFn = originalJqFn.$original || originalJqFn; + removePatch.$original = originalJqFn; + jQuery.fn[name] = removePatch; + + function removePatch(param) { + // jshint -W040 + var list = filterElems && param ? [this.filter(param)] : [this], + fireEvent = dispatchThis, + set, setIndex, setLength, + element, childIndex, childLength, children; + + if (!getterIfNoArguments || param != null) { + while(list.length) { + set = list.shift(); + for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) { + element = jqLite(set[setIndex]); + if (fireEvent) { + element.triggerHandler('$destroy'); + } else { + fireEvent = !fireEvent; + } + for(childIndex = 0, childLength = (children = element.children()).length; + childIndex < childLength; + childIndex++) { + list.push(jQuery(children[childIndex])); + } + } + } + } + return originalJqFn.apply(this, arguments); + } +} + +var SINGLE_TAG_REGEXP = /^<(\w+)\s*\/?>(?:<\/\1>|)$/; +var HTML_REGEXP = /<|&#?\w+;/; +var TAG_NAME_REGEXP = /<([\w:]+)/; +var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi; + +var wrapMap = { + 'option': [1, ''], + + 'thead': [1, '', '
'], + 'col': [2, '', '
'], + 'tr': [2, '', '
'], + 'td': [3, '', '
'], + '_default': [0, "", ""] +}; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +function jqLiteIsTextNode(html) { + return !HTML_REGEXP.test(html); +} + +function jqLiteBuildFragment(html, context) { + var elem, tmp, tag, wrap, + fragment = context.createDocumentFragment(), + nodes = [], i, j, jj; + + if (jqLiteIsTextNode(html)) { + // Convert non-html into a text node + nodes.push(context.createTextNode(html)); + } else { + tmp = fragment.appendChild(context.createElement('div')); + // Convert html into DOM nodes + tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase(); + wrap = wrapMap[tag] || wrapMap._default; + tmp.innerHTML = '
 
' + + wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1>") + wrap[2]; + tmp.removeChild(tmp.firstChild); + + // Descend through wrappers to the right content + i = wrap[0]; + while (i--) { + tmp = tmp.lastChild; + } + + for (j=0, jj=tmp.childNodes.length; j -1); +} + +function jqLiteRemoveClass(element, cssClasses) { + if (cssClasses && element.setAttribute) { + forEach(cssClasses.split(' '), function(cssClass) { + element.setAttribute('class', trim( + (" " + (element.getAttribute('class') || '') + " ") + .replace(/[\n\t]/g, " ") + .replace(" " + trim(cssClass) + " ", " ")) + ); + }); + } +} + +function jqLiteAddClass(element, cssClasses) { + if (cssClasses && element.setAttribute) { + var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ') + .replace(/[\n\t]/g, " "); + + forEach(cssClasses.split(' '), function(cssClass) { + cssClass = trim(cssClass); + if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) { + existingClasses += cssClass + ' '; + } + }); + + element.setAttribute('class', trim(existingClasses)); + } +} + +function jqLiteAddNodes(root, elements) { + if (elements) { + elements = (!elements.nodeName && isDefined(elements.length) && !isWindow(elements)) + ? elements + : [ elements ]; + for(var i=0; i < elements.length; i++) { + root.push(elements[i]); + } + } +} + +function jqLiteController(element, name) { + return jqLiteInheritedData(element, '$' + (name || 'ngController' ) + 'Controller'); +} + +function jqLiteInheritedData(element, name, value) { + // if element is the document object work with the html element instead + // this makes $(document).scope() possible + if(element.nodeType == 9) { + element = element.documentElement; + } + var names = isArray(name) ? name : [name]; + + while (element) { + for (var i = 0, ii = names.length; i < ii; i++) { + if ((value = jqLite.data(element, names[i])) !== undefined) return value; + } + + // If dealing with a document fragment node with a host element, and no parent, use the host + // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM + // to lookup parent controllers. + element = element.parentNode || (element.nodeType === 11 && element.host); + } +} + +function jqLiteEmpty(element) { + for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) { + jqLiteDealoc(childNodes[i]); + } + while (element.firstChild) { + element.removeChild(element.firstChild); + } +} + +////////////////////////////////////////// +// Functions which are declared directly. +////////////////////////////////////////// +var JQLitePrototype = JQLite.prototype = { + ready: function(fn) { + var fired = false; + + function trigger() { + if (fired) return; + fired = true; + fn(); + } + + // check if document already is loaded + if (document.readyState === 'complete'){ + setTimeout(trigger); + } else { + this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9 + // we can not use jqLite since we are not done loading and jQuery could be loaded later. + // jshint -W064 + JQLite(window).on('load', trigger); // fallback to window.onload for others + // jshint +W064 + } + }, + toString: function() { + var value = []; + forEach(this, function(e){ value.push('' + e);}); + return '[' + value.join(', ') + ']'; + }, + + eq: function(index) { + return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]); + }, + + length: 0, + push: push, + sort: [].sort, + splice: [].splice +}; + +////////////////////////////////////////// +// Functions iterating getter/setters. +// these functions return self on setter and +// value on get. +////////////////////////////////////////// +var BOOLEAN_ATTR = {}; +forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) { + BOOLEAN_ATTR[lowercase(value)] = value; +}); +var BOOLEAN_ELEMENTS = {}; +forEach('input,select,option,textarea,button,form,details'.split(','), function(value) { + BOOLEAN_ELEMENTS[uppercase(value)] = true; +}); + +function getBooleanAttrName(element, name) { + // check dom last since we will most likely fail on name + var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()]; + + // booleanAttr is here twice to minimize DOM access + return booleanAttr && BOOLEAN_ELEMENTS[element.nodeName] && booleanAttr; +} + +forEach({ + data: jqLiteData, + removeData: jqLiteRemoveData +}, function(fn, name) { + JQLite[name] = fn; +}); + +forEach({ + data: jqLiteData, + inheritedData: jqLiteInheritedData, + + scope: function(element) { + // Can't use jqLiteData here directly so we stay compatible with jQuery! + return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']); + }, + + isolateScope: function(element) { + // Can't use jqLiteData here directly so we stay compatible with jQuery! + return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate'); + }, + + controller: jqLiteController, + + injector: function(element) { + return jqLiteInheritedData(element, '$injector'); + }, + + removeAttr: function(element,name) { + element.removeAttribute(name); + }, + + hasClass: jqLiteHasClass, + + css: function(element, name, value) { + name = camelCase(name); + + if (isDefined(value)) { + element.style[name] = value; + } else { + var val; + + if (msie <= 8) { + // this is some IE specific weirdness that jQuery 1.6.4 does not sure why + val = element.currentStyle && element.currentStyle[name]; + if (val === '') val = 'auto'; + } + + val = val || element.style[name]; + + if (msie <= 8) { + // jquery weirdness :-/ + val = (val === '') ? undefined : val; + } + + return val; + } + }, + + attr: function(element, name, value){ + var lowercasedName = lowercase(name); + if (BOOLEAN_ATTR[lowercasedName]) { + if (isDefined(value)) { + if (!!value) { + element[name] = true; + element.setAttribute(name, lowercasedName); + } else { + element[name] = false; + element.removeAttribute(lowercasedName); + } + } else { + return (element[name] || + (element.attributes.getNamedItem(name)|| noop).specified) + ? lowercasedName + : undefined; + } + } else if (isDefined(value)) { + element.setAttribute(name, value); + } else if (element.getAttribute) { + // the extra argument "2" is to get the right thing for a.href in IE, see jQuery code + // some elements (e.g. Document) don't have get attribute, so return undefined + var ret = element.getAttribute(name, 2); + // normalize non-existing attributes to undefined (as jQuery) + return ret === null ? undefined : ret; + } + }, + + prop: function(element, name, value) { + if (isDefined(value)) { + element[name] = value; + } else { + return element[name]; + } + }, + + text: (function() { + var NODE_TYPE_TEXT_PROPERTY = []; + if (msie < 9) { + NODE_TYPE_TEXT_PROPERTY[1] = 'innerText'; /** Element **/ + NODE_TYPE_TEXT_PROPERTY[3] = 'nodeValue'; /** Text **/ + } else { + NODE_TYPE_TEXT_PROPERTY[1] = /** Element **/ + NODE_TYPE_TEXT_PROPERTY[3] = 'textContent'; /** Text **/ + } + getText.$dv = ''; + return getText; + + function getText(element, value) { + var textProp = NODE_TYPE_TEXT_PROPERTY[element.nodeType]; + if (isUndefined(value)) { + return textProp ? element[textProp] : ''; + } + element[textProp] = value; + } + })(), + + val: function(element, value) { + if (isUndefined(value)) { + if (nodeName_(element) === 'SELECT' && element.multiple) { + var result = []; + forEach(element.options, function (option) { + if (option.selected) { + result.push(option.value || option.text); + } + }); + return result.length === 0 ? null : result; + } + return element.value; + } + element.value = value; + }, + + html: function(element, value) { + if (isUndefined(value)) { + return element.innerHTML; + } + for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) { + jqLiteDealoc(childNodes[i]); + } + element.innerHTML = value; + }, + + empty: jqLiteEmpty +}, function(fn, name){ + /** + * Properties: writes return selection, reads return first value + */ + JQLite.prototype[name] = function(arg1, arg2) { + var i, key; + var nodeCount = this.length; + + // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it + // in a way that survives minification. + // jqLiteEmpty takes no arguments but is a setter. + if (fn !== jqLiteEmpty && + (((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2) === undefined)) { + if (isObject(arg1)) { + + // we are a write, but the object properties are the key/values + for (i = 0; i < nodeCount; i++) { + if (fn === jqLiteData) { + // data() takes the whole object in jQuery + fn(this[i], arg1); + } else { + for (key in arg1) { + fn(this[i], key, arg1[key]); + } + } + } + // return self for chaining + return this; + } else { + // we are a read, so read the first child. + // TODO: do we still need this? + var value = fn.$dv; + // Only if we have $dv do we iterate over all, otherwise it is just the first element. + var jj = (value === undefined) ? Math.min(nodeCount, 1) : nodeCount; + for (var j = 0; j < jj; j++) { + var nodeValue = fn(this[j], arg1, arg2); + value = value ? value + nodeValue : nodeValue; + } + return value; + } + } else { + // we are a write, so apply to all children + for (i = 0; i < nodeCount; i++) { + fn(this[i], arg1, arg2); + } + // return self for chaining + return this; + } + }; +}); + +function createEventHandler(element, events) { + var eventHandler = function (event, type) { + if (!event.preventDefault) { + event.preventDefault = function() { + event.returnValue = false; //ie + }; + } + + if (!event.stopPropagation) { + event.stopPropagation = function() { + event.cancelBubble = true; //ie + }; + } + + if (!event.target) { + event.target = event.srcElement || document; + } + + if (isUndefined(event.defaultPrevented)) { + var prevent = event.preventDefault; + event.preventDefault = function() { + event.defaultPrevented = true; + prevent.call(event); + }; + event.defaultPrevented = false; + } + + event.isDefaultPrevented = function() { + return event.defaultPrevented || event.returnValue === false; + }; + + // Copy event handlers in case event handlers array is modified during execution. + var eventHandlersCopy = shallowCopy(events[type || event.type] || []); + + forEach(eventHandlersCopy, function(fn) { + fn.call(element, event); + }); + + // Remove monkey-patched methods (IE), + // as they would cause memory leaks in IE8. + if (msie <= 8) { + // IE7/8 does not allow to delete property on native object + event.preventDefault = null; + event.stopPropagation = null; + event.isDefaultPrevented = null; + } else { + // It shouldn't affect normal browsers (native methods are defined on prototype). + delete event.preventDefault; + delete event.stopPropagation; + delete event.isDefaultPrevented; + } + }; + eventHandler.elem = element; + return eventHandler; +} + +////////////////////////////////////////// +// Functions iterating traversal. +// These functions chain results into a single +// selector. +////////////////////////////////////////// +forEach({ + removeData: jqLiteRemoveData, + + dealoc: jqLiteDealoc, + + on: function onFn(element, type, fn, unsupported){ + if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters'); + + var events = jqLiteExpandoStore(element, 'events'), + handle = jqLiteExpandoStore(element, 'handle'); + + if (!events) jqLiteExpandoStore(element, 'events', events = {}); + if (!handle) jqLiteExpandoStore(element, 'handle', handle = createEventHandler(element, events)); + + forEach(type.split(' '), function(type){ + var eventFns = events[type]; + + if (!eventFns) { + if (type == 'mouseenter' || type == 'mouseleave') { + var contains = document.body.contains || document.body.compareDocumentPosition ? + function( a, b ) { + // jshint bitwise: false + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + events[type] = []; + + // Refer to jQuery's implementation of mouseenter & mouseleave + // Read about mouseenter and mouseleave: + // http://www.quirksmode.org/js/events_mouse.html#link8 + var eventmap = { mouseleave : "mouseout", mouseenter : "mouseover"}; + + onFn(element, eventmap[type], function(event) { + var target = this, related = event.relatedTarget; + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !contains(target, related)) ){ + handle(event, type); + } + }); + + } else { + addEventListenerFn(element, type, handle); + events[type] = []; + } + eventFns = events[type]; + } + eventFns.push(fn); + }); + }, + + off: jqLiteOff, + + one: function(element, type, fn) { + element = jqLite(element); + + //add the listener twice so that when it is called + //you can remove the original function and still be + //able to call element.off(ev, fn) normally + element.on(type, function onFn() { + element.off(type, fn); + element.off(type, onFn); + }); + element.on(type, fn); + }, + + replaceWith: function(element, replaceNode) { + var index, parent = element.parentNode; + jqLiteDealoc(element); + forEach(new JQLite(replaceNode), function(node){ + if (index) { + parent.insertBefore(node, index.nextSibling); + } else { + parent.replaceChild(node, element); + } + index = node; + }); + }, + + children: function(element) { + var children = []; + forEach(element.childNodes, function(element){ + if (element.nodeType === 1) + children.push(element); + }); + return children; + }, + + contents: function(element) { + return element.contentDocument || element.childNodes || []; + }, + + append: function(element, node) { + forEach(new JQLite(node), function(child){ + if (element.nodeType === 1 || element.nodeType === 11) { + element.appendChild(child); + } + }); + }, + + prepend: function(element, node) { + if (element.nodeType === 1) { + var index = element.firstChild; + forEach(new JQLite(node), function(child){ + element.insertBefore(child, index); + }); + } + }, + + wrap: function(element, wrapNode) { + wrapNode = jqLite(wrapNode)[0]; + var parent = element.parentNode; + if (parent) { + parent.replaceChild(wrapNode, element); + } + wrapNode.appendChild(element); + }, + + remove: function(element) { + jqLiteDealoc(element); + var parent = element.parentNode; + if (parent) parent.removeChild(element); + }, + + after: function(element, newElement) { + var index = element, parent = element.parentNode; + forEach(new JQLite(newElement), function(node){ + parent.insertBefore(node, index.nextSibling); + index = node; + }); + }, + + addClass: jqLiteAddClass, + removeClass: jqLiteRemoveClass, + + toggleClass: function(element, selector, condition) { + if (selector) { + forEach(selector.split(' '), function(className){ + var classCondition = condition; + if (isUndefined(classCondition)) { + classCondition = !jqLiteHasClass(element, className); + } + (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className); + }); + } + }, + + parent: function(element) { + var parent = element.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + + next: function(element) { + if (element.nextElementSibling) { + return element.nextElementSibling; + } + + // IE8 doesn't have nextElementSibling + var elm = element.nextSibling; + while (elm != null && elm.nodeType !== 1) { + elm = elm.nextSibling; + } + return elm; + }, + + find: function(element, selector) { + if (element.getElementsByTagName) { + return element.getElementsByTagName(selector); + } else { + return []; + } + }, + + clone: jqLiteClone, + + triggerHandler: function(element, event, extraParameters) { + + var dummyEvent, eventFnsCopy, handlerArgs; + var eventName = event.type || event; + var eventFns = (jqLiteExpandoStore(element, 'events') || {})[eventName]; + + if (eventFns) { + + // Create a dummy event to pass to the handlers + dummyEvent = { + preventDefault: function() { this.defaultPrevented = true; }, + isDefaultPrevented: function() { return this.defaultPrevented === true; }, + stopPropagation: noop, + type: eventName, + target: element + }; + + // If a custom event was provided then extend our dummy event with it + if (event.type) { + dummyEvent = extend(dummyEvent, event); + } + + // Copy event handlers in case event handlers array is modified during execution. + eventFnsCopy = shallowCopy(eventFns); + handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent]; + + forEach(eventFnsCopy, function(fn) { + fn.apply(element, handlerArgs); + }); + + } + } +}, function(fn, name){ + /** + * chaining functions + */ + JQLite.prototype[name] = function(arg1, arg2, arg3) { + var value; + for(var i=0; i < this.length; i++) { + if (isUndefined(value)) { + value = fn(this[i], arg1, arg2, arg3); + if (isDefined(value)) { + // any function which returns a value needs to be wrapped + value = jqLite(value); + } + } else { + jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3)); + } + } + return isDefined(value) ? value : this; + }; + + // bind legacy bind/unbind to on/off + JQLite.prototype.bind = JQLite.prototype.on; + JQLite.prototype.unbind = JQLite.prototype.off; +}); + +/** + * Computes a hash of an 'obj'. + * Hash of a: + * string is string + * number is number as string + * object is either result of calling $$hashKey function on the object or uniquely generated id, + * that is also assigned to the $$hashKey property of the object. + * + * @param obj + * @returns {string} hash string such that the same input will have the same hash string. + * The resulting string key is in 'type:hashKey' format. + */ +function hashKey(obj, nextUidFn) { + var objType = typeof obj, + key; + + if (objType == 'function' || (objType == 'object' && obj !== null)) { + if (typeof (key = obj.$$hashKey) == 'function') { + // must invoke on object to keep the right this + key = obj.$$hashKey(); + } else if (key === undefined) { + key = obj.$$hashKey = (nextUidFn || nextUid)(); + } + } else { + key = obj; + } + + return objType + ':' + key; +} + +/** + * HashMap which can use objects as keys + */ +function HashMap(array, isolatedUid) { + if (isolatedUid) { + var uid = 0; + this.nextUid = function() { + return ++uid; + }; + } + forEach(array, this.put, this); +} +HashMap.prototype = { + /** + * Store key value pair + * @param key key to store can be any type + * @param value value to store can be any type + */ + put: function(key, value) { + this[hashKey(key, this.nextUid)] = value; + }, + + /** + * @param key + * @returns {Object} the value for the key + */ + get: function(key) { + return this[hashKey(key, this.nextUid)]; + }, + + /** + * Remove the key/value pair + * @param key + */ + remove: function(key) { + var value = this[key = hashKey(key, this.nextUid)]; + delete this[key]; + return value; + } +}; + +/** + * @ngdoc function + * @module ng + * @name angular.injector + * @kind function + * + * @description + * Creates an injector function that can be used for retrieving services as well as for + * dependency injection (see {@link guide/di dependency injection}). + * + + * @param {Array.} modules A list of module functions or their aliases. See + * {@link angular.module}. The `ng` module must be explicitly added. + * @returns {function()} Injector function. See {@link auto.$injector $injector}. + * + * @example + * Typical usage + * ```js + * // create an injector + * var $injector = angular.injector(['ng']); + * + * // use the injector to kick off your application + * // use the type inference to auto inject arguments, or use implicit injection + * $injector.invoke(function($rootScope, $compile, $document){ + * $compile($document)($rootScope); + * $rootScope.$digest(); + * }); + * ``` + * + * Sometimes you want to get access to the injector of a currently running Angular app + * from outside Angular. Perhaps, you want to inject and compile some markup after the + * application has been bootstrapped. You can do this using the extra `injector()` added + * to JQuery/jqLite elements. See {@link angular.element}. + * + * *This is fairly rare but could be the case if a third party library is injecting the + * markup.* + * + * In the following example a new block of HTML containing a `ng-controller` + * directive is added to the end of the document body by JQuery. We then compile and link + * it into the current AngularJS scope. + * + * ```js + * var $div = $('
{{content.label}}
'); + * $(document.body).append($div); + * + * angular.element(document).injector().invoke(function($compile) { + * var scope = angular.element($div).scope(); + * $compile($div)(scope); + * }); + * ``` + */ + + +/** + * @ngdoc module + * @name auto + * @description + * + * Implicit module which gets automatically added to each {@link auto.$injector $injector}. + */ + +var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m; +var FN_ARG_SPLIT = /,/; +var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/; +var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; +var $injectorMinErr = minErr('$injector'); +function annotate(fn) { + var $inject, + fnText, + argDecl, + last; + + if (typeof fn === 'function') { + if (!($inject = fn.$inject)) { + $inject = []; + if (fn.length) { + fnText = fn.toString().replace(STRIP_COMMENTS, ''); + argDecl = fnText.match(FN_ARGS); + forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){ + arg.replace(FN_ARG, function(all, underscore, name){ + $inject.push(name); + }); + }); + } + fn.$inject = $inject; + } + } else if (isArray(fn)) { + last = fn.length - 1; + assertArgFn(fn[last], 'fn'); + $inject = fn.slice(0, last); + } else { + assertArgFn(fn, 'fn', true); + } + return $inject; +} + +/////////////////////////////////////// + +/** + * @ngdoc service + * @name $injector + * @kind function + * + * @description + * + * `$injector` is used to retrieve object instances as defined by + * {@link auto.$provide provider}, instantiate types, invoke methods, + * and load modules. + * + * The following always holds true: + * + * ```js + * var $injector = angular.injector(); + * expect($injector.get('$injector')).toBe($injector); + * expect($injector.invoke(function($injector){ + * return $injector; + * }).toBe($injector); + * ``` + * + * # Injection Function Annotation + * + * JavaScript does not have annotations, and annotations are needed for dependency injection. The + * following are all valid ways of annotating function with injection arguments and are equivalent. + * + * ```js + * // inferred (only works if code not minified/obfuscated) + * $injector.invoke(function(serviceA){}); + * + * // annotated + * function explicit(serviceA) {}; + * explicit.$inject = ['serviceA']; + * $injector.invoke(explicit); + * + * // inline + * $injector.invoke(['serviceA', function(serviceA){}]); + * ``` + * + * ## Inference + * + * In JavaScript calling `toString()` on a function returns the function definition. The definition + * can then be parsed and the function arguments can be extracted. *NOTE:* This does not work with + * minification, and obfuscation tools since these tools change the argument names. + * + * ## `$inject` Annotation + * By adding an `$inject` property onto a function the injection parameters can be specified. + * + * ## Inline + * As an array of injection names, where the last item in the array is the function to call. + */ + +/** + * @ngdoc method + * @name $injector#get + * + * @description + * Return an instance of the service. + * + * @param {string} name The name of the instance to retrieve. + * @return {*} The instance. + */ + +/** + * @ngdoc method + * @name $injector#invoke + * + * @description + * Invoke the method and supply the method arguments from the `$injector`. + * + * @param {!Function} fn The function to invoke. Function parameters are injected according to the + * {@link guide/di $inject Annotation} rules. + * @param {Object=} self The `this` for the invoked method. + * @param {Object=} locals Optional object. If preset then any argument names are read from this + * object first, before the `$injector` is consulted. + * @returns {*} the value returned by the invoked `fn` function. + */ + +/** + * @ngdoc method + * @name $injector#has + * + * @description + * Allows the user to query if the particular service exists. + * + * @param {string} Name of the service to query. + * @returns {boolean} returns true if injector has given service. + */ + +/** + * @ngdoc method + * @name $injector#instantiate + * @description + * Create a new instance of JS type. The method takes a constructor function, invokes the new + * operator, and supplies all of the arguments to the constructor function as specified by the + * constructor annotation. + * + * @param {Function} Type Annotated constructor function. + * @param {Object=} locals Optional object. If preset then any argument names are read from this + * object first, before the `$injector` is consulted. + * @returns {Object} new instance of `Type`. + */ + +/** + * @ngdoc method + * @name $injector#annotate + * + * @description + * Returns an array of service names which the function is requesting for injection. This API is + * used by the injector to determine which services need to be injected into the function when the + * function is invoked. There are three ways in which the function can be annotated with the needed + * dependencies. + * + * # Argument names + * + * The simplest form is to extract the dependencies from the arguments of the function. This is done + * by converting the function into a string using `toString()` method and extracting the argument + * names. + * ```js + * // Given + * function MyController($scope, $route) { + * // ... + * } + * + * // Then + * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); + * ``` + * + * This method does not work with code minification / obfuscation. For this reason the following + * annotation strategies are supported. + * + * # The `$inject` property + * + * If a function has an `$inject` property and its value is an array of strings, then the strings + * represent names of services to be injected into the function. + * ```js + * // Given + * var MyController = function(obfuscatedScope, obfuscatedRoute) { + * // ... + * } + * // Define function dependencies + * MyController['$inject'] = ['$scope', '$route']; + * + * // Then + * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); + * ``` + * + * # The array notation + * + * It is often desirable to inline Injected functions and that's when setting the `$inject` property + * is very inconvenient. In these situations using the array notation to specify the dependencies in + * a way that survives minification is a better choice: + * + * ```js + * // We wish to write this (not minification / obfuscation safe) + * injector.invoke(function($compile, $rootScope) { + * // ... + * }); + * + * // We are forced to write break inlining + * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) { + * // ... + * }; + * tmpFn.$inject = ['$compile', '$rootScope']; + * injector.invoke(tmpFn); + * + * // To better support inline function the inline annotation is supported + * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) { + * // ... + * }]); + * + * // Therefore + * expect(injector.annotate( + * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}]) + * ).toEqual(['$compile', '$rootScope']); + * ``` + * + * @param {Function|Array.} fn Function for which dependent service names need to + * be retrieved as described above. + * + * @returns {Array.} The names of the services which the function requires. + */ + + + + +/** + * @ngdoc service + * @name $provide + * + * @description + * + * The {@link auto.$provide $provide} service has a number of methods for registering components + * with the {@link auto.$injector $injector}. Many of these functions are also exposed on + * {@link angular.Module}. + * + * An Angular **service** is a singleton object created by a **service factory**. These **service + * factories** are functions which, in turn, are created by a **service provider**. + * The **service providers** are constructor functions. When instantiated they must contain a + * property called `$get`, which holds the **service factory** function. + * + * When you request a service, the {@link auto.$injector $injector} is responsible for finding the + * correct **service provider**, instantiating it and then calling its `$get` **service factory** + * function to get the instance of the **service**. + * + * Often services have no configuration options and there is no need to add methods to the service + * provider. The provider will be no more than a constructor function with a `$get` property. For + * these cases the {@link auto.$provide $provide} service has additional helper methods to register + * services without specifying a provider. + * + * * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the + * {@link auto.$injector $injector} + * * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by + * providers and services. + * * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by + * services, not providers. + * * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`, + * that will be wrapped in a **service provider** object, whose `$get` property will contain the + * given factory function. + * * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class` + * that will be wrapped in a **service provider** object, whose `$get` property will instantiate + * a new object using the given constructor function. + * + * See the individual methods for more information and examples. + */ + +/** + * @ngdoc method + * @name $provide#provider + * @description + * + * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions + * are constructor functions, whose instances are responsible for "providing" a factory for a + * service. + * + * Service provider names start with the name of the service they provide followed by `Provider`. + * For example, the {@link ng.$log $log} service has a provider called + * {@link ng.$logProvider $logProvider}. + * + * Service provider objects can have additional methods which allow configuration of the provider + * and its service. Importantly, you can configure what kind of service is created by the `$get` + * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a + * method {@link ng.$logProvider#debugEnabled debugEnabled} + * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the + * console or not. + * + * @param {string} name The name of the instance. NOTE: the provider will be available under `name + + 'Provider'` key. + * @param {(Object|function())} provider If the provider is: + * + * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using + * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created. + * - `Constructor`: a new instance of the provider will be created using + * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`. + * + * @returns {Object} registered provider instance + + * @example + * + * The following example shows how to create a simple event tracking service and register it using + * {@link auto.$provide#provider $provide.provider()}. + * + * ```js + * // Define the eventTracker provider + * function EventTrackerProvider() { + * var trackingUrl = '/track'; + * + * // A provider method for configuring where the tracked events should been saved + * this.setTrackingUrl = function(url) { + * trackingUrl = url; + * }; + * + * // The service factory function + * this.$get = ['$http', function($http) { + * var trackedEvents = {}; + * return { + * // Call this to track an event + * event: function(event) { + * var count = trackedEvents[event] || 0; + * count += 1; + * trackedEvents[event] = count; + * return count; + * }, + * // Call this to save the tracked events to the trackingUrl + * save: function() { + * $http.post(trackingUrl, trackedEvents); + * } + * }; + * }]; + * } + * + * describe('eventTracker', function() { + * var postSpy; + * + * beforeEach(module(function($provide) { + * // Register the eventTracker provider + * $provide.provider('eventTracker', EventTrackerProvider); + * })); + * + * beforeEach(module(function(eventTrackerProvider) { + * // Configure eventTracker provider + * eventTrackerProvider.setTrackingUrl('/custom-track'); + * })); + * + * it('tracks events', inject(function(eventTracker) { + * expect(eventTracker.event('login')).toEqual(1); + * expect(eventTracker.event('login')).toEqual(2); + * })); + * + * it('saves to the tracking url', inject(function(eventTracker, $http) { + * postSpy = spyOn($http, 'post'); + * eventTracker.event('login'); + * eventTracker.save(); + * expect(postSpy).toHaveBeenCalled(); + * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track'); + * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track'); + * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 }); + * })); + * }); + * ``` + */ + +/** + * @ngdoc method + * @name $provide#factory + * @description + * + * Register a **service factory**, which will be called to return the service instance. + * This is short for registering a service where its provider consists of only a `$get` property, + * which is the given service factory function. + * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to + * configure your service in a provider. + * + * @param {string} name The name of the instance. + * @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand + * for `$provide.provider(name, {$get: $getFn})`. + * @returns {Object} registered provider instance + * + * @example + * Here is an example of registering a service + * ```js + * $provide.factory('ping', ['$http', function($http) { + * return function ping() { + * return $http.send('/ping'); + * }; + * }]); + * ``` + * You would then inject and use this service like this: + * ```js + * someModule.controller('Ctrl', ['ping', function(ping) { + * ping(); + * }]); + * ``` + */ + + +/** + * @ngdoc method + * @name $provide#service + * @description + * + * Register a **service constructor**, which will be invoked with `new` to create the service + * instance. + * This is short for registering a service where its provider's `$get` property is the service + * constructor function that will be used to instantiate the service instance. + * + * You should use {@link auto.$provide#service $provide.service(class)} if you define your service + * as a type/class. + * + * @param {string} name The name of the instance. + * @param {Function} constructor A class (constructor function) that will be instantiated. + * @returns {Object} registered provider instance + * + * @example + * Here is an example of registering a service using + * {@link auto.$provide#service $provide.service(class)}. + * ```js + * var Ping = function($http) { + * this.$http = $http; + * }; + * + * Ping.$inject = ['$http']; + * + * Ping.prototype.send = function() { + * return this.$http.get('/ping'); + * }; + * $provide.service('ping', Ping); + * ``` + * You would then inject and use this service like this: + * ```js + * someModule.controller('Ctrl', ['ping', function(ping) { + * ping.send(); + * }]); + * ``` + */ + + +/** + * @ngdoc method + * @name $provide#value + * @description + * + * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a + * number, an array, an object or a function. This is short for registering a service where its + * provider's `$get` property is a factory function that takes no arguments and returns the **value + * service**. + * + * Value services are similar to constant services, except that they cannot be injected into a + * module configuration function (see {@link angular.Module#config}) but they can be overridden by + * an Angular + * {@link auto.$provide#decorator decorator}. + * + * @param {string} name The name of the instance. + * @param {*} value The value. + * @returns {Object} registered provider instance + * + * @example + * Here are some examples of creating value services. + * ```js + * $provide.value('ADMIN_USER', 'admin'); + * + * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 }); + * + * $provide.value('halfOf', function(value) { + * return value / 2; + * }); + * ``` + */ + + +/** + * @ngdoc method + * @name $provide#constant + * @description + * + * Register a **constant service**, such as a string, a number, an array, an object or a function, + * with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be + * injected into a module configuration function (see {@link angular.Module#config}) and it cannot + * be overridden by an Angular {@link auto.$provide#decorator decorator}. + * + * @param {string} name The name of the constant. + * @param {*} value The constant value. + * @returns {Object} registered instance + * + * @example + * Here a some examples of creating constants: + * ```js + * $provide.constant('SHARD_HEIGHT', 306); + * + * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']); + * + * $provide.constant('double', function(value) { + * return value * 2; + * }); + * ``` + */ + + +/** + * @ngdoc method + * @name $provide#decorator + * @description + * + * Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator + * intercepts the creation of a service, allowing it to override or modify the behaviour of the + * service. The object returned by the decorator may be the original service, or a new service + * object which replaces or wraps and delegates to the original service. + * + * @param {string} name The name of the service to decorate. + * @param {function()} decorator This function will be invoked when the service needs to be + * instantiated and should return the decorated service instance. The function is called using + * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable. + * Local injection arguments: + * + * * `$delegate` - The original service instance, which can be monkey patched, configured, + * decorated or delegated to. + * + * @example + * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting + * calls to {@link ng.$log#error $log.warn()}. + * ```js + * $provide.decorator('$log', ['$delegate', function($delegate) { + * $delegate.warn = $delegate.error; + * return $delegate; + * }]); + * ``` + */ + + +function createInjector(modulesToLoad) { + var INSTANTIATING = {}, + providerSuffix = 'Provider', + path = [], + loadedModules = new HashMap([], true), + providerCache = { + $provide: { + provider: supportObject(provider), + factory: supportObject(factory), + service: supportObject(service), + value: supportObject(value), + constant: supportObject(constant), + decorator: decorator + } + }, + providerInjector = (providerCache.$injector = + createInternalInjector(providerCache, function() { + throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- ')); + })), + instanceCache = {}, + instanceInjector = (instanceCache.$injector = + createInternalInjector(instanceCache, function(servicename) { + var provider = providerInjector.get(servicename + providerSuffix); + return instanceInjector.invoke(provider.$get, provider); + })); + + + forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); }); + + return instanceInjector; + + //////////////////////////////////// + // $provider + //////////////////////////////////// + + function supportObject(delegate) { + return function(key, value) { + if (isObject(key)) { + forEach(key, reverseParams(delegate)); + } else { + return delegate(key, value); + } + }; + } + + function provider(name, provider_) { + assertNotHasOwnProperty(name, 'service'); + if (isFunction(provider_) || isArray(provider_)) { + provider_ = providerInjector.instantiate(provider_); + } + if (!provider_.$get) { + throw $injectorMinErr('pget', "Provider '{0}' must define $get factory method.", name); + } + return providerCache[name + providerSuffix] = provider_; + } + + function factory(name, factoryFn) { return provider(name, { $get: factoryFn }); } + + function service(name, constructor) { + return factory(name, ['$injector', function($injector) { + return $injector.instantiate(constructor); + }]); + } + + function value(name, val) { return factory(name, valueFn(val)); } + + function constant(name, value) { + assertNotHasOwnProperty(name, 'constant'); + providerCache[name] = value; + instanceCache[name] = value; + } + + function decorator(serviceName, decorFn) { + var origProvider = providerInjector.get(serviceName + providerSuffix), + orig$get = origProvider.$get; + + origProvider.$get = function() { + var origInstance = instanceInjector.invoke(orig$get, origProvider); + return instanceInjector.invoke(decorFn, null, {$delegate: origInstance}); + }; + } + + //////////////////////////////////// + // Module Loading + //////////////////////////////////// + function loadModules(modulesToLoad){ + var runBlocks = [], moduleFn, invokeQueue, i, ii; + forEach(modulesToLoad, function(module) { + if (loadedModules.get(module)) return; + loadedModules.put(module, true); + + try { + if (isString(module)) { + moduleFn = angularModule(module); + runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); + + for(invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; i < ii; i++) { + var invokeArgs = invokeQueue[i], + provider = providerInjector.get(invokeArgs[0]); + + provider[invokeArgs[1]].apply(provider, invokeArgs[2]); + } + } else if (isFunction(module)) { + runBlocks.push(providerInjector.invoke(module)); + } else if (isArray(module)) { + runBlocks.push(providerInjector.invoke(module)); + } else { + assertArgFn(module, 'module'); + } + } catch (e) { + if (isArray(module)) { + module = module[module.length - 1]; + } + if (e.message && e.stack && e.stack.indexOf(e.message) == -1) { + // Safari & FF's stack traces don't contain error.message content + // unlike those of Chrome and IE + // So if stack doesn't contain message, we create a new string that contains both. + // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here. + /* jshint -W022 */ + e = e.message + '\n' + e.stack; + } + throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}", + module, e.stack || e.message || e); + } + }); + return runBlocks; + } + + //////////////////////////////////// + // internal Injector + //////////////////////////////////// + + function createInternalInjector(cache, factory) { + + function getService(serviceName) { + if (cache.hasOwnProperty(serviceName)) { + if (cache[serviceName] === INSTANTIATING) { + throw $injectorMinErr('cdep', 'Circular dependency found: {0}', + serviceName + ' <- ' + path.join(' <- ')); + } + return cache[serviceName]; + } else { + try { + path.unshift(serviceName); + cache[serviceName] = INSTANTIATING; + return cache[serviceName] = factory(serviceName); + } catch (err) { + if (cache[serviceName] === INSTANTIATING) { + delete cache[serviceName]; + } + throw err; + } finally { + path.shift(); + } + } + } + + function invoke(fn, self, locals){ + var args = [], + $inject = annotate(fn), + length, i, + key; + + for(i = 0, length = $inject.length; i < length; i++) { + key = $inject[i]; + if (typeof key !== 'string') { + throw $injectorMinErr('itkn', + 'Incorrect injection token! Expected service name as string, got {0}', key); + } + args.push( + locals && locals.hasOwnProperty(key) + ? locals[key] + : getService(key) + ); + } + if (isArray(fn)) { + fn = fn[length]; + } + + // http://jsperf.com/angularjs-invoke-apply-vs-switch + // #5388 + return fn.apply(self, args); + } + + function instantiate(Type, locals) { + var Constructor = function() {}, + instance, returnedValue; + + // Check if Type is annotated and use just the given function at n-1 as parameter + // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); + Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype; + instance = new Constructor(); + returnedValue = invoke(Type, instance, locals); + + return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance; + } + + return { + invoke: invoke, + instantiate: instantiate, + get: getService, + annotate: annotate, + has: function(name) { + return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name); + } + }; + } +} + +/** + * @ngdoc service + * @name $anchorScroll + * @kind function + * @requires $window + * @requires $location + * @requires $rootScope + * + * @description + * When called, it checks current value of `$location.hash()` and scrolls to the related element, + * according to rules specified in + * [Html5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document). + * + * It also watches the `$location.hash()` and scrolls whenever it changes to match any anchor. + * This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`. + * + * @example + + +
+ Go to bottom + You're at the bottom! +
+
+ + function ScrollCtrl($scope, $location, $anchorScroll) { + $scope.gotoBottom = function (){ + // set the location.hash to the id of + // the element you wish to scroll to. + $location.hash('bottom'); + + // call $anchorScroll() + $anchorScroll(); + }; + } + + + #scrollArea { + height: 350px; + overflow: auto; + } + + #bottom { + display: block; + margin-top: 2000px; + } + +
+ */ +function $AnchorScrollProvider() { + + var autoScrollingEnabled = true; + + this.disableAutoScrolling = function() { + autoScrollingEnabled = false; + }; + + this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) { + var document = $window.document; + + // helper function to get first anchor from a NodeList + // can't use filter.filter, as it accepts only instances of Array + // and IE can't convert NodeList to an array using [].slice + // TODO(vojta): use filter if we change it to accept lists as well + function getFirstAnchor(list) { + var result = null; + forEach(list, function(element) { + if (!result && lowercase(element.nodeName) === 'a') result = element; + }); + return result; + } + + function scroll() { + var hash = $location.hash(), elm; + + // empty hash, scroll to the top of the page + if (!hash) $window.scrollTo(0, 0); + + // element with given id + else if ((elm = document.getElementById(hash))) elm.scrollIntoView(); + + // first anchor with given name :-D + else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) elm.scrollIntoView(); + + // no element and hash == 'top', scroll to the top of the page + else if (hash === 'top') $window.scrollTo(0, 0); + } + + // does not scroll when user clicks on anchor link that is currently on + // (no url change, no $location.hash() change), browser native does scroll + if (autoScrollingEnabled) { + $rootScope.$watch(function autoScrollWatch() {return $location.hash();}, + function autoScrollWatchAction() { + $rootScope.$evalAsync(scroll); + }); + } + + return scroll; + }]; +} + +var $animateMinErr = minErr('$animate'); + +/** + * @ngdoc provider + * @name $animateProvider + * + * @description + * Default implementation of $animate that doesn't perform any animations, instead just + * synchronously performs DOM + * updates and calls done() callbacks. + * + * In order to enable animations the ngAnimate module has to be loaded. + * + * To see the functional implementation check out src/ngAnimate/animate.js + */ +var $AnimateProvider = ['$provide', function($provide) { + + + this.$$selectors = {}; + + + /** + * @ngdoc method + * @name $animateProvider#register + * + * @description + * Registers a new injectable animation factory function. The factory function produces the + * animation object which contains callback functions for each event that is expected to be + * animated. + * + * * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction` + * must be called once the element animation is complete. If a function is returned then the + * animation service will use this function to cancel the animation whenever a cancel event is + * triggered. + * + * + * ```js + * return { + * eventFn : function(element, done) { + * //code to run the animation + * //once complete, then run done() + * return function cancellationFunction() { + * //code to cancel the animation + * } + * } + * } + * ``` + * + * @param {string} name The name of the animation. + * @param {Function} factory The factory function that will be executed to return the animation + * object. + */ + this.register = function(name, factory) { + var key = name + '-animation'; + if (name && name.charAt(0) != '.') throw $animateMinErr('notcsel', + "Expecting class selector starting with '.' got '{0}'.", name); + this.$$selectors[name.substr(1)] = key; + $provide.factory(key, factory); + }; + + /** + * @ngdoc method + * @name $animateProvider#classNameFilter + * + * @description + * Sets and/or returns the CSS class regular expression that is checked when performing + * an animation. Upon bootstrap the classNameFilter value is not set at all and will + * therefore enable $animate to attempt to perform an animation on any element. + * When setting the classNameFilter value, animations will only be performed on elements + * that successfully match the filter expression. This in turn can boost performance + * for low-powered devices as well as applications containing a lot of structural operations. + * @param {RegExp=} expression The className expression which will be checked against all animations + * @return {RegExp} The current CSS className expression value. If null then there is no expression value + */ + this.classNameFilter = function(expression) { + if(arguments.length === 1) { + this.$$classNameFilter = (expression instanceof RegExp) ? expression : null; + } + return this.$$classNameFilter; + }; + + this.$get = ['$timeout', '$$asyncCallback', function($timeout, $$asyncCallback) { + + function async(fn) { + fn && $$asyncCallback(fn); + } + + /** + * + * @ngdoc service + * @name $animate + * @description The $animate service provides rudimentary DOM manipulation functions to + * insert, remove and move elements within the DOM, as well as adding and removing classes. + * This service is the core service used by the ngAnimate $animator service which provides + * high-level animation hooks for CSS and JavaScript. + * + * $animate is available in the AngularJS core, however, the ngAnimate module must be included + * to enable full out animation support. Otherwise, $animate will only perform simple DOM + * manipulation operations. + * + * To learn more about enabling animation support, click here to visit the {@link ngAnimate + * ngAnimate module page} as well as the {@link ngAnimate.$animate ngAnimate $animate service + * page}. + */ + return { + + /** + * + * @ngdoc method + * @name $animate#enter + * @kind function + * @description Inserts the element into the DOM either after the `after` element or within + * the `parent` element. Once complete, the done() callback will be fired (if provided). + * @param {DOMElement} element the element which will be inserted into the DOM + * @param {DOMElement} parent the parent element which will append the element as + * a child (if the after element is not present) + * @param {DOMElement} after the sibling element which will append the element + * after itself + * @param {Function=} done callback function that will be called after the element has been + * inserted into the DOM + */ + enter : function(element, parent, after, done) { + if (after) { + after.after(element); + } else { + if (!parent || !parent[0]) { + parent = after.parent(); + } + parent.append(element); + } + async(done); + }, + + /** + * + * @ngdoc method + * @name $animate#leave + * @kind function + * @description Removes the element from the DOM. Once complete, the done() callback will be + * fired (if provided). + * @param {DOMElement} element the element which will be removed from the DOM + * @param {Function=} done callback function that will be called after the element has been + * removed from the DOM + */ + leave : function(element, done) { + element.remove(); + async(done); + }, + + /** + * + * @ngdoc method + * @name $animate#move + * @kind function + * @description Moves the position of the provided element within the DOM to be placed + * either after the `after` element or inside of the `parent` element. Once complete, the + * done() callback will be fired (if provided). + * + * @param {DOMElement} element the element which will be moved around within the + * DOM + * @param {DOMElement} parent the parent element where the element will be + * inserted into (if the after element is not present) + * @param {DOMElement} after the sibling element where the element will be + * positioned next to + * @param {Function=} done the callback function (if provided) that will be fired after the + * element has been moved to its new position + */ + move : function(element, parent, after, done) { + // Do not remove element before insert. Removing will cause data associated with the + // element to be dropped. Insert will implicitly do the remove. + this.enter(element, parent, after, done); + }, + + /** + * + * @ngdoc method + * @name $animate#addClass + * @kind function + * @description Adds the provided className CSS class value to the provided element. Once + * complete, the done() callback will be fired (if provided). + * @param {DOMElement} element the element which will have the className value + * added to it + * @param {string} className the CSS class which will be added to the element + * @param {Function=} done the callback function (if provided) that will be fired after the + * className value has been added to the element + */ + addClass : function(element, className, done) { + className = isString(className) ? + className : + isArray(className) ? className.join(' ') : ''; + forEach(element, function (element) { + jqLiteAddClass(element, className); + }); + async(done); + }, + + /** + * + * @ngdoc method + * @name $animate#removeClass + * @kind function + * @description Removes the provided className CSS class value from the provided element. + * Once complete, the done() callback will be fired (if provided). + * @param {DOMElement} element the element which will have the className value + * removed from it + * @param {string} className the CSS class which will be removed from the element + * @param {Function=} done the callback function (if provided) that will be fired after the + * className value has been removed from the element + */ + removeClass : function(element, className, done) { + className = isString(className) ? + className : + isArray(className) ? className.join(' ') : ''; + forEach(element, function (element) { + jqLiteRemoveClass(element, className); + }); + async(done); + }, + + /** + * + * @ngdoc method + * @name $animate#setClass + * @kind function + * @description Adds and/or removes the given CSS classes to and from the element. + * Once complete, the done() callback will be fired (if provided). + * @param {DOMElement} element the element which will have its CSS classes changed + * removed from it + * @param {string} add the CSS classes which will be added to the element + * @param {string} remove the CSS class which will be removed from the element + * @param {Function=} done the callback function (if provided) that will be fired after the + * CSS classes have been set on the element + */ + setClass : function(element, add, remove, done) { + forEach(element, function (element) { + jqLiteAddClass(element, add); + jqLiteRemoveClass(element, remove); + }); + async(done); + }, + + enabled : noop + }; + }]; +}]; + +function $$AsyncCallbackProvider(){ + this.$get = ['$$rAF', '$timeout', function($$rAF, $timeout) { + return $$rAF.supported + ? function(fn) { return $$rAF(fn); } + : function(fn) { + return $timeout(fn, 0, false); + }; + }]; +} + +/** + * ! This is a private undocumented service ! + * + * @name $browser + * @requires $log + * @description + * This object has two goals: + * + * - hide all the global state in the browser caused by the window object + * - abstract away all the browser specific features and inconsistencies + * + * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser` + * service, which can be used for convenient testing of the application without the interaction with + * the real browser apis. + */ +/** + * @param {object} window The global window object. + * @param {object} document jQuery wrapped document. + * @param {function()} XHR XMLHttpRequest constructor. + * @param {object} $log console.log or an object with the same interface. + * @param {object} $sniffer $sniffer service + */ +function Browser(window, document, $log, $sniffer) { + var self = this, + rawDocument = document[0], + location = window.location, + history = window.history, + setTimeout = window.setTimeout, + clearTimeout = window.clearTimeout, + pendingDeferIds = {}; + + self.isMock = false; + + var outstandingRequestCount = 0; + var outstandingRequestCallbacks = []; + + // TODO(vojta): remove this temporary api + self.$$completeOutstandingRequest = completeOutstandingRequest; + self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; }; + + /** + * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` + * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. + */ + function completeOutstandingRequest(fn) { + try { + fn.apply(null, sliceArgs(arguments, 1)); + } finally { + outstandingRequestCount--; + if (outstandingRequestCount === 0) { + while(outstandingRequestCallbacks.length) { + try { + outstandingRequestCallbacks.pop()(); + } catch (e) { + $log.error(e); + } + } + } + } + } + + /** + * @private + * Note: this method is used only by scenario runner + * TODO(vojta): prefix this method with $$ ? + * @param {function()} callback Function that will be called when no outstanding request + */ + self.notifyWhenNoOutstandingRequests = function(callback) { + // force browser to execute all pollFns - this is needed so that cookies and other pollers fire + // at some deterministic time in respect to the test runner's actions. Leaving things up to the + // regular poller would result in flaky tests. + forEach(pollFns, function(pollFn){ pollFn(); }); + + if (outstandingRequestCount === 0) { + callback(); + } else { + outstandingRequestCallbacks.push(callback); + } + }; + + ////////////////////////////////////////////////////////////// + // Poll Watcher API + ////////////////////////////////////////////////////////////// + var pollFns = [], + pollTimeout; + + /** + * @name $browser#addPollFn + * + * @param {function()} fn Poll function to add + * + * @description + * Adds a function to the list of functions that poller periodically executes, + * and starts polling if not started yet. + * + * @returns {function()} the added function + */ + self.addPollFn = function(fn) { + if (isUndefined(pollTimeout)) startPoller(100, setTimeout); + pollFns.push(fn); + return fn; + }; + + /** + * @param {number} interval How often should browser call poll functions (ms) + * @param {function()} setTimeout Reference to a real or fake `setTimeout` function. + * + * @description + * Configures the poller to run in the specified intervals, using the specified + * setTimeout fn and kicks it off. + */ + function startPoller(interval, setTimeout) { + (function check() { + forEach(pollFns, function(pollFn){ pollFn(); }); + pollTimeout = setTimeout(check, interval); + })(); + } + + ////////////////////////////////////////////////////////////// + // URL API + ////////////////////////////////////////////////////////////// + + var lastBrowserUrl = location.href, + baseElement = document.find('base'), + newLocation = null; + + /** + * @name $browser#url + * + * @description + * GETTER: + * Without any argument, this method just returns current value of location.href. + * + * SETTER: + * With at least one argument, this method sets url to new value. + * If html5 history api supported, pushState/replaceState is used, otherwise + * location.href/location.replace is used. + * Returns its own instance to allow chaining + * + * NOTE: this api is intended for use only by the $location service. Please use the + * {@link ng.$location $location service} to change url. + * + * @param {string} url New url (when used as setter) + * @param {boolean=} replace Should new url replace current history record ? + */ + self.url = function(url, replace) { + // Android Browser BFCache causes location, history reference to become stale. + if (location !== window.location) location = window.location; + if (history !== window.history) history = window.history; + + // setter + if (url) { + if (lastBrowserUrl == url) return; + lastBrowserUrl = url; + if ($sniffer.history) { + if (replace) history.replaceState(null, '', url); + else { + history.pushState(null, '', url); + // Crazy Opera Bug: http://my.opera.com/community/forums/topic.dml?id=1185462 + baseElement.attr('href', baseElement.attr('href')); + } + } else { + newLocation = url; + if (replace) { + location.replace(url); + } else { + location.href = url; + } + } + return self; + // getter + } else { + // - newLocation is a workaround for an IE7-9 issue with location.replace and location.href + // methods not updating location.href synchronously. + // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172 + return newLocation || location.href.replace(/%27/g,"'"); + } + }; + + var urlChangeListeners = [], + urlChangeInit = false; + + function fireUrlChange() { + newLocation = null; + if (lastBrowserUrl == self.url()) return; + + lastBrowserUrl = self.url(); + forEach(urlChangeListeners, function(listener) { + listener(self.url()); + }); + } + + /** + * @name $browser#onUrlChange + * + * @description + * Register callback function that will be called, when url changes. + * + * It's only called when the url is changed from outside of angular: + * - user types different url into address bar + * - user clicks on history (forward/back) button + * - user clicks on a link + * + * It's not called when url is changed by $browser.url() method + * + * The listener gets called with new url as parameter. + * + * NOTE: this api is intended for use only by the $location service. Please use the + * {@link ng.$location $location service} to monitor url changes in angular apps. + * + * @param {function(string)} listener Listener function to be called when url changes. + * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous. + */ + self.onUrlChange = function(callback) { + // TODO(vojta): refactor to use node's syntax for events + if (!urlChangeInit) { + // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera) + // don't fire popstate when user change the address bar and don't fire hashchange when url + // changed by push/replaceState + + // html5 history api - popstate event + if ($sniffer.history) jqLite(window).on('popstate', fireUrlChange); + // hashchange event + if ($sniffer.hashchange) jqLite(window).on('hashchange', fireUrlChange); + // polling + else self.addPollFn(fireUrlChange); + + urlChangeInit = true; + } + + urlChangeListeners.push(callback); + return callback; + }; + + /** + * Checks whether the url has changed outside of Angular. + * Needs to be exported to be able to check for changes that have been done in sync, + * as hashchange/popstate events fire in async. + */ + self.$$checkUrlChange = fireUrlChange; + + ////////////////////////////////////////////////////////////// + // Misc API + ////////////////////////////////////////////////////////////// + + /** + * @name $browser#baseHref + * + * @description + * Returns current + * (always relative - without domain) + * + * @returns {string} The current base href + */ + self.baseHref = function() { + var href = baseElement.attr('href'); + return href ? href.replace(/^(https?\:)?\/\/[^\/]*/, '') : ''; + }; + + ////////////////////////////////////////////////////////////// + // Cookies API + ////////////////////////////////////////////////////////////// + var lastCookies = {}; + var lastCookieString = ''; + var cookiePath = self.baseHref(); + + /** + * @name $browser#cookies + * + * @param {string=} name Cookie name + * @param {string=} value Cookie value + * + * @description + * The cookies method provides a 'private' low level access to browser cookies. + * It is not meant to be used directly, use the $cookie service instead. + * + * The return values vary depending on the arguments that the method was called with as follows: + * + * - cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify + * it + * - cookies(name, value) -> set name to value, if value is undefined delete the cookie + * - cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that + * way) + * + * @returns {Object} Hash of all cookies (if called without any parameter) + */ + self.cookies = function(name, value) { + /* global escape: false, unescape: false */ + var cookieLength, cookieArray, cookie, i, index; + + if (name) { + if (value === undefined) { + rawDocument.cookie = escape(name) + "=;path=" + cookiePath + + ";expires=Thu, 01 Jan 1970 00:00:00 GMT"; + } else { + if (isString(value)) { + cookieLength = (rawDocument.cookie = escape(name) + '=' + escape(value) + + ';path=' + cookiePath).length + 1; + + // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum: + // - 300 cookies + // - 20 cookies per unique domain + // - 4096 bytes per cookie + if (cookieLength > 4096) { + $log.warn("Cookie '"+ name + + "' possibly not set or overflowed because it was too large ("+ + cookieLength + " > 4096 bytes)!"); + } + } + } + } else { + if (rawDocument.cookie !== lastCookieString) { + lastCookieString = rawDocument.cookie; + cookieArray = lastCookieString.split("; "); + lastCookies = {}; + + for (i = 0; i < cookieArray.length; i++) { + cookie = cookieArray[i]; + index = cookie.indexOf('='); + if (index > 0) { //ignore nameless cookies + name = unescape(cookie.substring(0, index)); + // the first value that is seen for a cookie is the most + // specific one. values for the same cookie name that + // follow are for less specific paths. + if (lastCookies[name] === undefined) { + lastCookies[name] = unescape(cookie.substring(index + 1)); + } + } + } + } + return lastCookies; + } + }; + + + /** + * @name $browser#defer + * @param {function()} fn A function, who's execution should be deferred. + * @param {number=} [delay=0] of milliseconds to defer the function execution. + * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`. + * + * @description + * Executes a fn asynchronously via `setTimeout(fn, delay)`. + * + * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using + * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed + * via `$browser.defer.flush()`. + * + */ + self.defer = function(fn, delay) { + var timeoutId; + outstandingRequestCount++; + timeoutId = setTimeout(function() { + delete pendingDeferIds[timeoutId]; + completeOutstandingRequest(fn); + }, delay || 0); + pendingDeferIds[timeoutId] = true; + return timeoutId; + }; + + + /** + * @name $browser#defer.cancel + * + * @description + * Cancels a deferred task identified with `deferId`. + * + * @param {*} deferId Token returned by the `$browser.defer` function. + * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully + * canceled. + */ + self.defer.cancel = function(deferId) { + if (pendingDeferIds[deferId]) { + delete pendingDeferIds[deferId]; + clearTimeout(deferId); + completeOutstandingRequest(noop); + return true; + } + return false; + }; + +} + +function $BrowserProvider(){ + this.$get = ['$window', '$log', '$sniffer', '$document', + function( $window, $log, $sniffer, $document){ + return new Browser($window, $document, $log, $sniffer); + }]; +} + +/** + * @ngdoc service + * @name $cacheFactory + * + * @description + * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to + * them. + * + * ```js + * + * var cache = $cacheFactory('cacheId'); + * expect($cacheFactory.get('cacheId')).toBe(cache); + * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined(); + * + * cache.put("key", "value"); + * cache.put("another key", "another value"); + * + * // We've specified no options on creation + * expect(cache.info()).toEqual({id: 'cacheId', size: 2}); + * + * ``` + * + * + * @param {string} cacheId Name or id of the newly created cache. + * @param {object=} options Options object that specifies the cache behavior. Properties: + * + * - `{number=}` `capacity` — turns the cache into LRU cache. + * + * @returns {object} Newly created cache object with the following set of methods: + * + * - `{object}` `info()` — Returns id, size, and options of cache. + * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns + * it. + * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss. + * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache. + * - `{void}` `removeAll()` — Removes all cached values. + * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory. + * + * @example + + +
+ + + + +

Cached Values

+
+ + : + +
+ +

Cache Info

+
+ + : + +
+
+
+ + angular.module('cacheExampleApp', []). + controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) { + $scope.keys = []; + $scope.cache = $cacheFactory('cacheId'); + $scope.put = function(key, value) { + if ($scope.cache.get(key) === undefined) { + $scope.keys.push(key); + } + $scope.cache.put(key, value === undefined ? null : value); + }; + }]); + + + p { + margin: 10px 0 3px; + } + +
+ */ +function $CacheFactoryProvider() { + + this.$get = function() { + var caches = {}; + + function cacheFactory(cacheId, options) { + if (cacheId in caches) { + throw minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId); + } + + var size = 0, + stats = extend({}, options, {id: cacheId}), + data = {}, + capacity = (options && options.capacity) || Number.MAX_VALUE, + lruHash = {}, + freshEnd = null, + staleEnd = null; + + /** + * @ngdoc type + * @name $cacheFactory.Cache + * + * @description + * A cache object used to store and retrieve data, primarily used by + * {@link $http $http} and the {@link ng.directive:script script} directive to cache + * templates and other data. + * + * ```js + * angular.module('superCache') + * .factory('superCache', ['$cacheFactory', function($cacheFactory) { + * return $cacheFactory('super-cache'); + * }]); + * ``` + * + * Example test: + * + * ```js + * it('should behave like a cache', inject(function(superCache) { + * superCache.put('key', 'value'); + * superCache.put('another key', 'another value'); + * + * expect(superCache.info()).toEqual({ + * id: 'super-cache', + * size: 2 + * }); + * + * superCache.remove('another key'); + * expect(superCache.get('another key')).toBeUndefined(); + * + * superCache.removeAll(); + * expect(superCache.info()).toEqual({ + * id: 'super-cache', + * size: 0 + * }); + * })); + * ``` + */ + return caches[cacheId] = { + + /** + * @ngdoc method + * @name $cacheFactory.Cache#put + * @kind function + * + * @description + * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be + * retrieved later, and incrementing the size of the cache if the key was not already + * present in the cache. If behaving like an LRU cache, it will also remove stale + * entries from the set. + * + * It will not insert undefined values into the cache. + * + * @param {string} key the key under which the cached data is stored. + * @param {*} value the value to store alongside the key. If it is undefined, the key + * will not be stored. + * @returns {*} the value stored. + */ + put: function(key, value) { + if (capacity < Number.MAX_VALUE) { + var lruEntry = lruHash[key] || (lruHash[key] = {key: key}); + + refresh(lruEntry); + } + + if (isUndefined(value)) return; + if (!(key in data)) size++; + data[key] = value; + + if (size > capacity) { + this.remove(staleEnd.key); + } + + return value; + }, + + /** + * @ngdoc method + * @name $cacheFactory.Cache#get + * @kind function + * + * @description + * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object. + * + * @param {string} key the key of the data to be retrieved + * @returns {*} the value stored. + */ + get: function(key) { + if (capacity < Number.MAX_VALUE) { + var lruEntry = lruHash[key]; + + if (!lruEntry) return; + + refresh(lruEntry); + } + + return data[key]; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#remove + * @kind function + * + * @description + * Removes an entry from the {@link $cacheFactory.Cache Cache} object. + * + * @param {string} key the key of the entry to be removed + */ + remove: function(key) { + if (capacity < Number.MAX_VALUE) { + var lruEntry = lruHash[key]; + + if (!lruEntry) return; + + if (lruEntry == freshEnd) freshEnd = lruEntry.p; + if (lruEntry == staleEnd) staleEnd = lruEntry.n; + link(lruEntry.n,lruEntry.p); + + delete lruHash[key]; + } + + delete data[key]; + size--; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#removeAll + * @kind function + * + * @description + * Clears the cache object of any entries. + */ + removeAll: function() { + data = {}; + size = 0; + lruHash = {}; + freshEnd = staleEnd = null; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#destroy + * @kind function + * + * @description + * Destroys the {@link $cacheFactory.Cache Cache} object entirely, + * removing it from the {@link $cacheFactory $cacheFactory} set. + */ + destroy: function() { + data = null; + stats = null; + lruHash = null; + delete caches[cacheId]; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#info + * @kind function + * + * @description + * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}. + * + * @returns {object} an object with the following properties: + *
    + *
  • **id**: the id of the cache instance
  • + *
  • **size**: the number of entries kept in the cache instance
  • + *
  • **...**: any additional properties from the options object when creating the + * cache.
  • + *
+ */ + info: function() { + return extend({}, stats, {size: size}); + } + }; + + + /** + * makes the `entry` the freshEnd of the LRU linked list + */ + function refresh(entry) { + if (entry != freshEnd) { + if (!staleEnd) { + staleEnd = entry; + } else if (staleEnd == entry) { + staleEnd = entry.n; + } + + link(entry.n, entry.p); + link(entry, freshEnd); + freshEnd = entry; + freshEnd.n = null; + } + } + + + /** + * bidirectionally links two entries of the LRU linked list + */ + function link(nextEntry, prevEntry) { + if (nextEntry != prevEntry) { + if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify + if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify + } + } + } + + + /** + * @ngdoc method + * @name $cacheFactory#info + * + * @description + * Get information about all the caches that have been created + * + * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info` + */ + cacheFactory.info = function() { + var info = {}; + forEach(caches, function(cache, cacheId) { + info[cacheId] = cache.info(); + }); + return info; + }; + + + /** + * @ngdoc method + * @name $cacheFactory#get + * + * @description + * Get access to a cache object by the `cacheId` used when it was created. + * + * @param {string} cacheId Name or id of a cache to access. + * @returns {object} Cache object identified by the cacheId or undefined if no such cache. + */ + cacheFactory.get = function(cacheId) { + return caches[cacheId]; + }; + + + return cacheFactory; + }; +} + +/** + * @ngdoc service + * @name $templateCache + * + * @description + * The first time a template is used, it is loaded in the template cache for quick retrieval. You + * can load templates directly into the cache in a `script` tag, or by consuming the + * `$templateCache` service directly. + * + * Adding via the `script` tag: + * + * ```html + * + * ``` + * + * **Note:** the `script` tag containing the template does not need to be included in the `head` of + * the document, but it must be below the `ng-app` definition. + * + * Adding via the $templateCache service: + * + * ```js + * var myApp = angular.module('myApp', []); + * myApp.run(function($templateCache) { + * $templateCache.put('templateId.html', 'This is the content of the template'); + * }); + * ``` + * + * To retrieve the template later, simply use it in your HTML: + * ```html + *
+ * ``` + * + * or get it via Javascript: + * ```js + * $templateCache.get('templateId.html') + * ``` + * + * See {@link ng.$cacheFactory $cacheFactory}. + * + */ +function $TemplateCacheProvider() { + this.$get = ['$cacheFactory', function($cacheFactory) { + return $cacheFactory('templates'); + }]; +} + +/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE! + * + * DOM-related variables: + * + * - "node" - DOM Node + * - "element" - DOM Element or Node + * - "$node" or "$element" - jqLite-wrapped node or element + * + * + * Compiler related stuff: + * + * - "linkFn" - linking fn of a single directive + * - "nodeLinkFn" - function that aggregates all linking fns for a particular node + * - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node + * - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList) + */ + + +/** + * @ngdoc service + * @name $compile + * @kind function + * + * @description + * Compiles an HTML string or DOM into a template and produces a template function, which + * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together. + * + * The compilation is a process of walking the DOM tree and matching DOM elements to + * {@link ng.$compileProvider#directive directives}. + * + *
+ * **Note:** This document is an in-depth reference of all directive options. + * For a gentle introduction to directives with examples of common use cases, + * see the {@link guide/directive directive guide}. + *
+ * + * ## Comprehensive Directive API + * + * There are many different options for a directive. + * + * The difference resides in the return value of the factory function. + * You can either return a "Directive Definition Object" (see below) that defines the directive properties, + * or just the `postLink` function (all other properties will have the default values). + * + *
+ * **Best Practice:** It's recommended to use the "directive definition object" form. + *
+ * + * Here's an example directive declared with a Directive Definition Object: + * + * ```js + * var myModule = angular.module(...); + * + * myModule.directive('directiveName', function factory(injectables) { + * var directiveDefinitionObject = { + * priority: 0, + * template: '
', // or // function(tElement, tAttrs) { ... }, + * // or + * // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... }, + * transclude: false, + * restrict: 'A', + * scope: false, + * controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... }, + * controllerAs: 'stringAlias', + * require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'], + * compile: function compile(tElement, tAttrs, transclude) { + * return { + * pre: function preLink(scope, iElement, iAttrs, controller) { ... }, + * post: function postLink(scope, iElement, iAttrs, controller) { ... } + * } + * // or + * // return function postLink( ... ) { ... } + * }, + * // or + * // link: { + * // pre: function preLink(scope, iElement, iAttrs, controller) { ... }, + * // post: function postLink(scope, iElement, iAttrs, controller) { ... } + * // } + * // or + * // link: function postLink( ... ) { ... } + * }; + * return directiveDefinitionObject; + * }); + * ``` + * + *
+ * **Note:** Any unspecified options will use the default value. You can see the default values below. + *
+ * + * Therefore the above can be simplified as: + * + * ```js + * var myModule = angular.module(...); + * + * myModule.directive('directiveName', function factory(injectables) { + * var directiveDefinitionObject = { + * link: function postLink(scope, iElement, iAttrs) { ... } + * }; + * return directiveDefinitionObject; + * // or + * // return function postLink(scope, iElement, iAttrs) { ... } + * }); + * ``` + * + * + * + * ### Directive Definition Object + * + * The directive definition object provides instructions to the {@link ng.$compile + * compiler}. The attributes are: + * + * #### `priority` + * When there are multiple directives defined on a single DOM element, sometimes it + * is necessary to specify the order in which the directives are applied. The `priority` is used + * to sort the directives before their `compile` functions get called. Priority is defined as a + * number. Directives with greater numerical `priority` are compiled first. Pre-link functions + * are also run in priority order, but post-link functions are run in reverse order. The order + * of directives with the same priority is undefined. The default priority is `0`. + * + * #### `terminal` + * If set to true then the current `priority` will be the last set of directives + * which will execute (any directives at the current priority will still execute + * as the order of execution on same `priority` is undefined). + * + * #### `scope` + * **If set to `true`,** then a new scope will be created for this directive. If multiple directives on the + * same element request a new scope, only one new scope is created. The new scope rule does not + * apply for the root of the template since the root of the template always gets a new scope. + * + * **If set to `{}` (object hash),** then a new "isolate" scope is created. The 'isolate' scope differs from + * normal scope in that it does not prototypically inherit from the parent scope. This is useful + * when creating reusable components, which should not accidentally read or modify data in the + * parent scope. + * + * The 'isolate' scope takes an object hash which defines a set of local scope properties + * derived from the parent scope. These local properties are useful for aliasing values for + * templates. Locals definition is a hash of local scope property to its source: + * + * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is + * always a string since DOM attributes are strings. If no `attr` name is specified then the + * attribute name is assumed to be the same as the local name. + * Given `` and widget definition + * of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect + * the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the + * `localName` property on the widget scope. The `name` is read from the parent scope (not + * component scope). + * + * * `=` or `=attr` - set up bi-directional binding between a local scope property and the + * parent scope property of name defined via the value of the `attr` attribute. If no `attr` + * name is specified then the attribute name is assumed to be the same as the local name. + * Given `` and widget definition of + * `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the + * value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected + * in `localModel` and any changes in `localModel` will reflect in `parentModel`. If the parent + * scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You + * can avoid this behavior using `=?` or `=?attr` in order to flag the property as optional. + * + * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope. + * If no `attr` name is specified then the attribute name is assumed to be the same as the + * local name. Given `` and widget definition of + * `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to + * a function wrapper for the `count = count + value` expression. Often it's desirable to + * pass data from the isolated scope via an expression to the parent scope, this can be + * done by passing a map of local variable names and values into the expression wrapper fn. + * For example, if the expression is `increment(amount)` then we can specify the amount value + * by calling the `localFn` as `localFn({amount: 22})`. + * + * + * + * #### `controller` + * Controller constructor function. The controller is instantiated before the + * pre-linking phase and it is shared with other directives (see + * `require` attribute). This allows the directives to communicate with each other and augment + * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals: + * + * * `$scope` - Current scope associated with the element + * * `$element` - Current element + * * `$attrs` - Current attributes object for the element + * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope. + * The scope can be overridden by an optional first argument. + * `function([scope], cloneLinkingFn)`. + * + * + * #### `require` + * Require another directive and inject its controller as the fourth argument to the linking function. The + * `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the + * injected argument will be an array in corresponding order. If no such directive can be + * found, or if the directive does not have a controller, then an error is raised. The name can be prefixed with: + * + * * (no prefix) - Locate the required controller on the current element. Throw an error if not found. + * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found. + * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found. + * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass + * `null` to the `link` fn if not found. + * + * + * #### `controllerAs` + * Controller alias at the directive scope. An alias for the controller so it + * can be referenced at the directive template. The directive needs to define a scope for this + * configuration to be used. Useful in the case when directive is used as component. + * + * + * #### `restrict` + * String of subset of `EACM` which restricts the directive to a specific directive + * declaration style. If omitted, the default (attributes only) is used. + * + * * `E` - Element name: `` + * * `A` - Attribute (default): `
` + * * `C` - Class: `
` + * * `M` - Comment: `` + * + * + * #### `template` + * HTML markup that may: + * * Replace the contents of the directive's element (default). + * * Replace the directive's element itself (if `replace` is true - DEPRECATED). + * * Wrap the contents of the directive's element (if `transclude` is true). + * + * Value may be: + * + * * A string. For example `
{{delete_str}}
`. + * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile` + * function api below) and returns a string value. + * + * + * #### `templateUrl` + * Same as `template` but the template is loaded from the specified URL. Because + * the template loading is asynchronous the compilation/linking is suspended until the template + * is loaded. + * + * You can specify `templateUrl` as a string representing the URL or as a function which takes two + * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns + * a string value representing the url. In either case, the template URL is passed through {@link + * api/ng.$sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}. + * + * + * #### `replace` ([*DEPRECATED*!], will be removed in next major release) + * specify what the template should replace. Defaults to `false`. + * + * * `true` - the template will replace the directive's element. + * * `false` - the template will replace the contents of the directive's element. + * + * The replacement process migrates all of the attributes / classes from the old element to the new + * one. See the {@link guide/directive#creating-custom-directives_creating-directives_template-expanding-directive + * Directives Guide} for an example. + * + * #### `transclude` + * compile the content of the element and make it available to the directive. + * Typically used with {@link ng.directive:ngTransclude + * ngTransclude}. The advantage of transclusion is that the linking function receives a + * transclusion function which is pre-bound to the correct scope. In a typical setup the widget + * creates an `isolate` scope, but the transclusion is not a child, but a sibling of the `isolate` + * scope. This makes it possible for the widget to have private state, and the transclusion to + * be bound to the parent (pre-`isolate`) scope. + * + * * `true` - transclude the content of the directive. + * * `'element'` - transclude the whole element including any directives defined at lower priority. + * + *
+ * **Note:** When testing an element transclude directive you must not place the directive at the root of the + * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives + * Testing Transclusion Directives}. + *
+ * + * #### `compile` + * + * ```js + * function compile(tElement, tAttrs, transclude) { ... } + * ``` + * + * The compile function deals with transforming the template DOM. Since most directives do not do + * template transformation, it is not used often. The compile function takes the following arguments: + * + * * `tElement` - template element - The element where the directive has been declared. It is + * safe to do template transformation on the element and child elements only. + * + * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared + * between all directive compile functions. + * + * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)` + * + *
+ * **Note:** The template instance and the link instance may be different objects if the template has + * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that + * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration + * should be done in a linking function rather than in a compile function. + *
+ + *
+ * **Note:** The compile function cannot handle directives that recursively use themselves in their + * own templates or compile functions. Compiling these directives results in an infinite loop and a + * stack overflow errors. + * + * This can be avoided by manually using $compile in the postLink function to imperatively compile + * a directive's template instead of relying on automatic template compilation via `template` or + * `templateUrl` declaration or manual compilation inside the compile function. + *
+ * + *
+ * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it + * e.g. does not know about the right outer scope. Please use the transclude function that is passed + * to the link function instead. + *
+ + * A compile function can have a return value which can be either a function or an object. + * + * * returning a (post-link) function - is equivalent to registering the linking function via the + * `link` property of the config object when the compile function is empty. + * + * * returning an object with function(s) registered via `pre` and `post` properties - allows you to + * control when a linking function should be called during the linking phase. See info about + * pre-linking and post-linking functions below. + * + * + * #### `link` + * This property is used only if the `compile` property is not defined. + * + * ```js + * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... } + * ``` + * + * The link function is responsible for registering DOM listeners as well as updating the DOM. It is + * executed after the template has been cloned. This is where most of the directive logic will be + * put. + * + * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the + * directive for registering {@link ng.$rootScope.Scope#$watch watches}. + * + * * `iElement` - instance element - The element where the directive is to be used. It is safe to + * manipulate the children of the element only in `postLink` function since the children have + * already been linked. + * + * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared + * between all directive linking functions. + * + * * `controller` - a controller instance - A controller instance if at least one directive on the + * element defines a controller. The controller is shared among all the directives, which allows + * the directives to use the controllers as a communication channel. + * + * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope. + * The scope can be overridden by an optional first argument. This is the same as the `$transclude` + * parameter of directive controllers. + * `function([scope], cloneLinkingFn)`. + * + * + * #### Pre-linking function + * + * Executed before the child elements are linked. Not safe to do DOM transformation since the + * compiler linking function will fail to locate the correct elements for linking. + * + * #### Post-linking function + * + * Executed after the child elements are linked. It is safe to do DOM transformation in the post-linking function. + * + * + * ### Attributes + * + * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the + * `link()` or `compile()` functions. It has a variety of uses. + * + * accessing *Normalized attribute names:* + * Directives like 'ngBind' can be expressed in many ways: 'ng:bind', `data-ng-bind`, or 'x-ng-bind'. + * the attributes object allows for normalized access to + * the attributes. + * + * * *Directive inter-communication:* All directives share the same instance of the attributes + * object which allows the directives to use the attributes object as inter directive + * communication. + * + * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object + * allowing other directives to read the interpolated value. + * + * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes + * that contain interpolation (e.g. `src="{{bar}}"`). Not only is this very efficient but it's also + * the only way to easily get the actual value because during the linking phase the interpolation + * hasn't been evaluated yet and so the value is at this time set to `undefined`. + * + * ```js + * function linkingFn(scope, elm, attrs, ctrl) { + * // get the attribute value + * console.log(attrs.ngModel); + * + * // change the attribute + * attrs.$set('ngModel', 'new value'); + * + * // observe changes to interpolated attribute + * attrs.$observe('ngModel', function(value) { + * console.log('ngModel has changed value to ' + value); + * }); + * } + * ``` + * + * Below is an example using `$compileProvider`. + * + *
+ * **Note**: Typically directives are registered with `module.directive`. The example below is + * to illustrate how `$compile` works. + *
+ * + + + +
+
+
+
+
+
+ + it('should auto compile', function() { + var textarea = $('textarea'); + var output = $('div[compile]'); + // The initial state reads 'Hello Angular'. + expect(output.getText()).toBe('Hello Angular'); + textarea.clear(); + textarea.sendKeys('{{name}}!'); + expect(output.getText()).toBe('Angular!'); + }); + +
+ + * + * + * @param {string|DOMElement} element Element or HTML string to compile into a template function. + * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives. + * @param {number} maxPriority only apply directives lower than given priority (Only effects the + * root element(s), not their children) + * @returns {function(scope, cloneAttachFn=)} a link function which is used to bind template + * (a DOM element/tree) to a scope. Where: + * + * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. + * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the + * `template` and call the `cloneAttachFn` function allowing the caller to attach the + * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is + * called as:
`cloneAttachFn(clonedElement, scope)` where: + * + * * `clonedElement` - is a clone of the original `element` passed into the compiler. + * * `scope` - is the current scope with which the linking function is working with. + * + * Calling the linking function returns the element of the template. It is either the original + * element passed in, or the clone of the element if the `cloneAttachFn` is provided. + * + * After linking the view is not updated until after a call to $digest which typically is done by + * Angular automatically. + * + * If you need access to the bound view, there are two ways to do it: + * + * - If you are not asking the linking function to clone the template, create the DOM element(s) + * before you send them to the compiler and keep this reference around. + * ```js + * var element = $compile('

{{total}}

')(scope); + * ``` + * + * - if on the other hand, you need the element to be cloned, the view reference from the original + * example would not point to the clone, but rather to the original template that was cloned. In + * this case, you can access the clone via the cloneAttachFn: + * ```js + * var templateElement = angular.element('

{{total}}

'), + * scope = ....; + * + * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) { + * //attach the clone to DOM document at the right place + * }); + * + * //now we have reference to the cloned DOM via `clonedElement` + * ``` + * + * + * For information on how the compiler works, see the + * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide. + */ + +var $compileMinErr = minErr('$compile'); + +/** + * @ngdoc provider + * @name $compileProvider + * @kind function + * + * @description + */ +$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider']; +function $CompileProvider($provide, $$sanitizeUriProvider) { + var hasDirectives = {}, + Suffix = 'Directive', + COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w_\-]+)\s+(.*)$/, + CLASS_DIRECTIVE_REGEXP = /(([\d\w_\-]+)(?:\:([^;]+))?;?)/; + + // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes + // The assumption is that future DOM event attribute names will begin with + // 'on' and be composed of only English letters. + var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/; + + /** + * @ngdoc method + * @name $compileProvider#directive + * @kind function + * + * @description + * Register a new directive with the compiler. + * + * @param {string|Object} name Name of the directive in camel-case (i.e. ngBind which + * will match as ng-bind), or an object map of directives where the keys are the + * names and the values are the factories. + * @param {Function|Array} directiveFactory An injectable directive factory function. See + * {@link guide/directive} for more info. + * @returns {ng.$compileProvider} Self for chaining. + */ + this.directive = function registerDirective(name, directiveFactory) { + assertNotHasOwnProperty(name, 'directive'); + if (isString(name)) { + assertArg(directiveFactory, 'directiveFactory'); + if (!hasDirectives.hasOwnProperty(name)) { + hasDirectives[name] = []; + $provide.factory(name + Suffix, ['$injector', '$exceptionHandler', + function($injector, $exceptionHandler) { + var directives = []; + forEach(hasDirectives[name], function(directiveFactory, index) { + try { + var directive = $injector.invoke(directiveFactory); + if (isFunction(directive)) { + directive = { compile: valueFn(directive) }; + } else if (!directive.compile && directive.link) { + directive.compile = valueFn(directive.link); + } + directive.priority = directive.priority || 0; + directive.index = index; + directive.name = directive.name || name; + directive.require = directive.require || (directive.controller && directive.name); + directive.restrict = directive.restrict || 'A'; + directives.push(directive); + } catch (e) { + $exceptionHandler(e); + } + }); + return directives; + }]); + } + hasDirectives[name].push(directiveFactory); + } else { + forEach(name, reverseParams(registerDirective)); + } + return this; + }; + + + /** + * @ngdoc method + * @name $compileProvider#aHrefSanitizationWhitelist + * @kind function + * + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during a[href] sanitization. + * + * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * + * Any url about to be assigned to a[href] via data-binding is first normalized and turned into + * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` + * regular expression. If a match is found, the original url is written into the dom. Otherwise, + * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.aHrefSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp); + return this; + } else { + return $$sanitizeUriProvider.aHrefSanitizationWhitelist(); + } + }; + + + /** + * @ngdoc method + * @name $compileProvider#imgSrcSanitizationWhitelist + * @kind function + * + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during img[src] sanitization. + * + * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * + * Any url about to be assigned to img[src] via data-binding is first normalized and turned into + * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` + * regular expression. If a match is found, the original url is written into the dom. Otherwise, + * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.imgSrcSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp); + return this; + } else { + return $$sanitizeUriProvider.imgSrcSanitizationWhitelist(); + } + }; + + this.$get = [ + '$injector', '$interpolate', '$exceptionHandler', '$http', '$templateCache', '$parse', + '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri', + function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse, + $controller, $rootScope, $document, $sce, $animate, $$sanitizeUri) { + + var Attributes = function(element, attr) { + this.$$element = element; + this.$attr = attr || {}; + }; + + Attributes.prototype = { + $normalize: directiveNormalize, + + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$addClass + * @kind function + * + * @description + * Adds the CSS class value specified by the classVal parameter to the element. If animations + * are enabled then an animation will be triggered for the class addition. + * + * @param {string} classVal The className value that will be added to the element + */ + $addClass : function(classVal) { + if(classVal && classVal.length > 0) { + $animate.addClass(this.$$element, classVal); + } + }, + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$removeClass + * @kind function + * + * @description + * Removes the CSS class value specified by the classVal parameter from the element. If + * animations are enabled then an animation will be triggered for the class removal. + * + * @param {string} classVal The className value that will be removed from the element + */ + $removeClass : function(classVal) { + if(classVal && classVal.length > 0) { + $animate.removeClass(this.$$element, classVal); + } + }, + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$updateClass + * @kind function + * + * @description + * Adds and removes the appropriate CSS class values to the element based on the difference + * between the new and old CSS class values (specified as newClasses and oldClasses). + * + * @param {string} newClasses The current CSS className value + * @param {string} oldClasses The former CSS className value + */ + $updateClass : function(newClasses, oldClasses) { + var toAdd = tokenDifference(newClasses, oldClasses); + var toRemove = tokenDifference(oldClasses, newClasses); + + if(toAdd.length === 0) { + $animate.removeClass(this.$$element, toRemove); + } else if(toRemove.length === 0) { + $animate.addClass(this.$$element, toAdd); + } else { + $animate.setClass(this.$$element, toAdd, toRemove); + } + }, + + /** + * Set a normalized attribute on the element in a way such that all directives + * can share the attribute. This function properly handles boolean attributes. + * @param {string} key Normalized key. (ie ngAttribute) + * @param {string|boolean} value The value to set. If `null` attribute will be deleted. + * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute. + * Defaults to true. + * @param {string=} attrName Optional none normalized name. Defaults to key. + */ + $set: function(key, value, writeAttr, attrName) { + // TODO: decide whether or not to throw an error if "class" + //is set through this function since it may cause $updateClass to + //become unstable. + + var booleanKey = getBooleanAttrName(this.$$element[0], key), + normalizedVal, + nodeName; + + if (booleanKey) { + this.$$element.prop(key, value); + attrName = booleanKey; + } + + this[key] = value; + + // translate normalized key to actual key + if (attrName) { + this.$attr[key] = attrName; + } else { + attrName = this.$attr[key]; + if (!attrName) { + this.$attr[key] = attrName = snake_case(key, '-'); + } + } + + nodeName = nodeName_(this.$$element); + + // sanitize a[href] and img[src] values + if ((nodeName === 'A' && key === 'href') || + (nodeName === 'IMG' && key === 'src')) { + this[key] = value = $$sanitizeUri(value, key === 'src'); + } + + if (writeAttr !== false) { + if (value === null || value === undefined) { + this.$$element.removeAttr(attrName); + } else { + this.$$element.attr(attrName, value); + } + } + + // fire observers + var $$observers = this.$$observers; + $$observers && forEach($$observers[key], function(fn) { + try { + fn(value); + } catch (e) { + $exceptionHandler(e); + } + }); + }, + + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$observe + * @kind function + * + * @description + * Observes an interpolated attribute. + * + * The observer function will be invoked once during the next `$digest` following + * compilation. The observer is then invoked whenever the interpolated value + * changes. + * + * @param {string} key Normalized key. (ie ngAttribute) . + * @param {function(interpolatedValue)} fn Function that will be called whenever + the interpolated value of the attribute changes. + * See the {@link guide/directive#Attributes Directives} guide for more info. + * @returns {function()} the `fn` parameter. + */ + $observe: function(key, fn) { + var attrs = this, + $$observers = (attrs.$$observers || (attrs.$$observers = {})), + listeners = ($$observers[key] || ($$observers[key] = [])); + + listeners.push(fn); + $rootScope.$evalAsync(function() { + if (!listeners.$$inter) { + // no one registered attribute interpolation function, so lets call it manually + fn(attrs[key]); + } + }); + return fn; + } + }; + + var startSymbol = $interpolate.startSymbol(), + endSymbol = $interpolate.endSymbol(), + denormalizeTemplate = (startSymbol == '{{' || endSymbol == '}}') + ? identity + : function denormalizeTemplate(template) { + return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol); + }, + NG_ATTR_BINDING = /^ngAttr[A-Z]/; + + + return compile; + + //================================ + + function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, + previousCompileContext) { + if (!($compileNodes instanceof jqLite)) { + // jquery always rewraps, whereas we need to preserve the original selector so that we can + // modify it. + $compileNodes = jqLite($compileNodes); + } + // We can not compile top level text elements since text nodes can be merged and we will + // not be able to attach scope data to them, so we will wrap them in + forEach($compileNodes, function(node, index){ + if (node.nodeType == 3 /* text node */ && node.nodeValue.match(/\S+/) /* non-empty */ ) { + $compileNodes[index] = node = jqLite(node).wrap('').parent()[0]; + } + }); + var compositeLinkFn = + compileNodes($compileNodes, transcludeFn, $compileNodes, + maxPriority, ignoreDirective, previousCompileContext); + safeAddClass($compileNodes, 'ng-scope'); + return function publicLinkFn(scope, cloneConnectFn, transcludeControllers, parentBoundTranscludeFn){ + assertArg(scope, 'scope'); + // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart + // and sometimes changes the structure of the DOM. + var $linkNode = cloneConnectFn + ? JQLitePrototype.clone.call($compileNodes) // IMPORTANT!!! + : $compileNodes; + + forEach(transcludeControllers, function(instance, name) { + $linkNode.data('$' + name + 'Controller', instance); + }); + + // Attach scope only to non-text nodes. + for(var i = 0, ii = $linkNode.length; i + addDirective(directives, + directiveNormalize(nodeName_(node).toLowerCase()), 'E', maxPriority, ignoreDirective); + + // iterate over the attributes + for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes, + j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) { + var attrStartName = false; + var attrEndName = false; + + attr = nAttrs[j]; + if (!msie || msie >= 8 || attr.specified) { + name = attr.name; + value = trim(attr.value); + + // support ngAttr attribute binding + ngAttrName = directiveNormalize(name); + if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) { + name = snake_case(ngAttrName.substr(6), '-'); + } + + var directiveNName = ngAttrName.replace(/(Start|End)$/, ''); + if (ngAttrName === directiveNName + 'Start') { + attrStartName = name; + attrEndName = name.substr(0, name.length - 5) + 'end'; + name = name.substr(0, name.length - 6); + } + + nName = directiveNormalize(name.toLowerCase()); + attrsMap[nName] = name; + if (isNgAttr || !attrs.hasOwnProperty(nName)) { + attrs[nName] = value; + if (getBooleanAttrName(node, nName)) { + attrs[nName] = true; // presence means true + } + } + addAttrInterpolateDirective(node, directives, value, nName); + addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, + attrEndName); + } + } + + // use class as directive + className = node.className; + if (isString(className) && className !== '') { + while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) { + nName = directiveNormalize(match[2]); + if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) { + attrs[nName] = trim(match[3]); + } + className = className.substr(match.index + match[0].length); + } + } + break; + case 3: /* Text Node */ + addTextInterpolateDirective(directives, node.nodeValue); + break; + case 8: /* Comment */ + try { + match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue); + if (match) { + nName = directiveNormalize(match[1]); + if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) { + attrs[nName] = trim(match[2]); + } + } + } catch (e) { + // turns out that under some circumstances IE9 throws errors when one attempts to read + // comment's node value. + // Just ignore it and continue. (Can't seem to reproduce in test case.) + } + break; + } + + directives.sort(byPriority); + return directives; + } + + /** + * Given a node with an directive-start it collects all of the siblings until it finds + * directive-end. + * @param node + * @param attrStart + * @param attrEnd + * @returns {*} + */ + function groupScan(node, attrStart, attrEnd) { + var nodes = []; + var depth = 0; + if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) { + var startNode = node; + do { + if (!node) { + throw $compileMinErr('uterdir', + "Unterminated attribute, found '{0}' but no matching '{1}' found.", + attrStart, attrEnd); + } + if (node.nodeType == 1 /** Element **/) { + if (node.hasAttribute(attrStart)) depth++; + if (node.hasAttribute(attrEnd)) depth--; + } + nodes.push(node); + node = node.nextSibling; + } while (depth > 0); + } else { + nodes.push(node); + } + + return jqLite(nodes); + } + + /** + * Wrapper for linking function which converts normal linking function into a grouped + * linking function. + * @param linkFn + * @param attrStart + * @param attrEnd + * @returns {Function} + */ + function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) { + return function(scope, element, attrs, controllers, transcludeFn) { + element = groupScan(element[0], attrStart, attrEnd); + return linkFn(scope, element, attrs, controllers, transcludeFn); + }; + } + + /** + * Once the directives have been collected, their compile functions are executed. This method + * is responsible for inlining directive templates as well as terminating the application + * of the directives if the terminal directive has been reached. + * + * @param {Array} directives Array of collected directives to execute their compile function. + * this needs to be pre-sorted by priority order. + * @param {Node} compileNode The raw DOM node to apply the compile functions to + * @param {Object} templateAttrs The shared attribute function + * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the + * scope argument is auto-generated to the new + * child of the transcluded parent scope. + * @param {JQLite} jqCollection If we are working on the root of the compile tree then this + * argument has the root jqLite array so that we can replace nodes + * on it. + * @param {Object=} originalReplaceDirective An optional directive that will be ignored when + * compiling the transclusion. + * @param {Array.} preLinkFns + * @param {Array.} postLinkFns + * @param {Object} previousCompileContext Context used for previous compilation of the current + * node + * @returns {Function} linkFn + */ + function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, + jqCollection, originalReplaceDirective, preLinkFns, postLinkFns, + previousCompileContext) { + previousCompileContext = previousCompileContext || {}; + + var terminalPriority = -Number.MAX_VALUE, + newScopeDirective, + controllerDirectives = previousCompileContext.controllerDirectives, + newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective, + templateDirective = previousCompileContext.templateDirective, + nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective, + hasTranscludeDirective = false, + hasTemplate = false, + hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective, + $compileNode = templateAttrs.$$element = jqLite(compileNode), + directive, + directiveName, + $template, + replaceDirective = originalReplaceDirective, + childTranscludeFn = transcludeFn, + linkFn, + directiveValue; + + // executes all directives on the current element + for(var i = 0, ii = directives.length; i < ii; i++) { + directive = directives[i]; + var attrStart = directive.$$start; + var attrEnd = directive.$$end; + + // collect multiblock sections + if (attrStart) { + $compileNode = groupScan(compileNode, attrStart, attrEnd); + } + $template = undefined; + + if (terminalPriority > directive.priority) { + break; // prevent further processing of directives + } + + if (directiveValue = directive.scope) { + newScopeDirective = newScopeDirective || directive; + + // skip the check for directives with async templates, we'll check the derived sync + // directive when the template arrives + if (!directive.templateUrl) { + assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive, + $compileNode); + if (isObject(directiveValue)) { + newIsolateScopeDirective = directive; + } + } + } + + directiveName = directive.name; + + if (!directive.templateUrl && directive.controller) { + directiveValue = directive.controller; + controllerDirectives = controllerDirectives || {}; + assertNoDuplicate("'" + directiveName + "' controller", + controllerDirectives[directiveName], directive, $compileNode); + controllerDirectives[directiveName] = directive; + } + + if (directiveValue = directive.transclude) { + hasTranscludeDirective = true; + + // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion. + // This option should only be used by directives that know how to safely handle element transclusion, + // where the transcluded nodes are added or replaced after linking. + if (!directive.$$tlb) { + assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode); + nonTlbTranscludeDirective = directive; + } + + if (directiveValue == 'element') { + hasElementTranscludeDirective = true; + terminalPriority = directive.priority; + $template = $compileNode; + $compileNode = templateAttrs.$$element = + jqLite(document.createComment(' ' + directiveName + ': ' + + templateAttrs[directiveName] + ' ')); + compileNode = $compileNode[0]; + replaceWith(jqCollection, sliceArgs($template), compileNode); + + childTranscludeFn = compile($template, transcludeFn, terminalPriority, + replaceDirective && replaceDirective.name, { + // Don't pass in: + // - controllerDirectives - otherwise we'll create duplicates controllers + // - newIsolateScopeDirective or templateDirective - combining templates with + // element transclusion doesn't make sense. + // + // We need only nonTlbTranscludeDirective so that we prevent putting transclusion + // on the same element more than once. + nonTlbTranscludeDirective: nonTlbTranscludeDirective + }); + } else { + $template = jqLite(jqLiteClone(compileNode)).contents(); + $compileNode.empty(); // clear contents + childTranscludeFn = compile($template, transcludeFn); + } + } + + if (directive.template) { + hasTemplate = true; + assertNoDuplicate('template', templateDirective, directive, $compileNode); + templateDirective = directive; + + directiveValue = (isFunction(directive.template)) + ? directive.template($compileNode, templateAttrs) + : directive.template; + + directiveValue = denormalizeTemplate(directiveValue); + + if (directive.replace) { + replaceDirective = directive; + if (jqLiteIsTextNode(directiveValue)) { + $template = []; + } else { + $template = jqLite(trim(directiveValue)); + } + compileNode = $template[0]; + + if ($template.length != 1 || compileNode.nodeType !== 1) { + throw $compileMinErr('tplrt', + "Template for directive '{0}' must have exactly one root element. {1}", + directiveName, ''); + } + + replaceWith(jqCollection, $compileNode, compileNode); + + var newTemplateAttrs = {$attr: {}}; + + // combine directives from the original node and from the template: + // - take the array of directives for this element + // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed) + // - collect directives from the template and sort them by priority + // - combine directives as: processed + template + unprocessed + var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs); + var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1)); + + if (newIsolateScopeDirective) { + markDirectivesAsIsolate(templateDirectives); + } + directives = directives.concat(templateDirectives).concat(unprocessedDirectives); + mergeTemplateAttributes(templateAttrs, newTemplateAttrs); + + ii = directives.length; + } else { + $compileNode.html(directiveValue); + } + } + + if (directive.templateUrl) { + hasTemplate = true; + assertNoDuplicate('template', templateDirective, directive, $compileNode); + templateDirective = directive; + + if (directive.replace) { + replaceDirective = directive; + } + + nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode, + templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, { + controllerDirectives: controllerDirectives, + newIsolateScopeDirective: newIsolateScopeDirective, + templateDirective: templateDirective, + nonTlbTranscludeDirective: nonTlbTranscludeDirective + }); + ii = directives.length; + } else if (directive.compile) { + try { + linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn); + if (isFunction(linkFn)) { + addLinkFns(null, linkFn, attrStart, attrEnd); + } else if (linkFn) { + addLinkFns(linkFn.pre, linkFn.post, attrStart, attrEnd); + } + } catch (e) { + $exceptionHandler(e, startingTag($compileNode)); + } + } + + if (directive.terminal) { + nodeLinkFn.terminal = true; + terminalPriority = Math.max(terminalPriority, directive.priority); + } + + } + + nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true; + nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective; + nodeLinkFn.templateOnThisElement = hasTemplate; + nodeLinkFn.transclude = childTranscludeFn; + + previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective; + + // might be normal or delayed nodeLinkFn depending on if templateUrl is present + return nodeLinkFn; + + //////////////////// + + function addLinkFns(pre, post, attrStart, attrEnd) { + if (pre) { + if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd); + pre.require = directive.require; + pre.directiveName = directiveName; + if (newIsolateScopeDirective === directive || directive.$$isolateScope) { + pre = cloneAndAnnotateFn(pre, {isolateScope: true}); + } + preLinkFns.push(pre); + } + if (post) { + if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd); + post.require = directive.require; + post.directiveName = directiveName; + if (newIsolateScopeDirective === directive || directive.$$isolateScope) { + post = cloneAndAnnotateFn(post, {isolateScope: true}); + } + postLinkFns.push(post); + } + } + + + function getControllers(directiveName, require, $element, elementControllers) { + var value, retrievalMethod = 'data', optional = false; + if (isString(require)) { + while((value = require.charAt(0)) == '^' || value == '?') { + require = require.substr(1); + if (value == '^') { + retrievalMethod = 'inheritedData'; + } + optional = optional || value == '?'; + } + value = null; + + if (elementControllers && retrievalMethod === 'data') { + value = elementControllers[require]; + } + value = value || $element[retrievalMethod]('$' + require + 'Controller'); + + if (!value && !optional) { + throw $compileMinErr('ctreq', + "Controller '{0}', required by directive '{1}', can't be found!", + require, directiveName); + } + return value; + } else if (isArray(require)) { + value = []; + forEach(require, function(require) { + value.push(getControllers(directiveName, require, $element, elementControllers)); + }); + } + return value; + } + + + function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { + var attrs, $element, i, ii, linkFn, controller, isolateScope, elementControllers = {}, transcludeFn; + + attrs = (compileNode === linkNode) + ? templateAttrs + : shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr)); + $element = attrs.$$element; + + if (newIsolateScopeDirective) { + var LOCAL_REGEXP = /^\s*([@=&])(\??)\s*(\w*)\s*$/; + + isolateScope = scope.$new(true); + + if (templateDirective && (templateDirective === newIsolateScopeDirective || + templateDirective === newIsolateScopeDirective.$$originalDirective)) { + $element.data('$isolateScope', isolateScope); + } else { + $element.data('$isolateScopeNoTemplate', isolateScope); + } + + + + safeAddClass($element, 'ng-isolate-scope'); + + forEach(newIsolateScopeDirective.scope, function(definition, scopeName) { + var match = definition.match(LOCAL_REGEXP) || [], + attrName = match[3] || scopeName, + optional = (match[2] == '?'), + mode = match[1], // @, =, or & + lastValue, + parentGet, parentSet, compare; + + isolateScope.$$isolateBindings[scopeName] = mode + attrName; + + switch (mode) { + + case '@': + attrs.$observe(attrName, function(value) { + isolateScope[scopeName] = value; + }); + attrs.$$observers[attrName].$$scope = scope; + if( attrs[attrName] ) { + // If the attribute has been provided then we trigger an interpolation to ensure + // the value is there for use in the link fn + isolateScope[scopeName] = $interpolate(attrs[attrName])(scope); + } + break; + + case '=': + if (optional && !attrs[attrName]) { + return; + } + parentGet = $parse(attrs[attrName]); + if (parentGet.literal) { + compare = equals; + } else { + compare = function(a,b) { return a === b || (a !== a && b !== b); }; + } + parentSet = parentGet.assign || function() { + // reset the change, or we will throw this exception on every $digest + lastValue = isolateScope[scopeName] = parentGet(scope); + throw $compileMinErr('nonassign', + "Expression '{0}' used with directive '{1}' is non-assignable!", + attrs[attrName], newIsolateScopeDirective.name); + }; + lastValue = isolateScope[scopeName] = parentGet(scope); + isolateScope.$watch(function parentValueWatch() { + var parentValue = parentGet(scope); + if (!compare(parentValue, isolateScope[scopeName])) { + // we are out of sync and need to copy + if (!compare(parentValue, lastValue)) { + // parent changed and it has precedence + isolateScope[scopeName] = parentValue; + } else { + // if the parent can be assigned then do so + parentSet(scope, parentValue = isolateScope[scopeName]); + } + } + return lastValue = parentValue; + }, null, parentGet.literal); + break; + + case '&': + parentGet = $parse(attrs[attrName]); + isolateScope[scopeName] = function(locals) { + return parentGet(scope, locals); + }; + break; + + default: + throw $compileMinErr('iscp', + "Invalid isolate scope definition for directive '{0}'." + + " Definition: {... {1}: '{2}' ...}", + newIsolateScopeDirective.name, scopeName, definition); + } + }); + } + transcludeFn = boundTranscludeFn && controllersBoundTransclude; + if (controllerDirectives) { + forEach(controllerDirectives, function(directive) { + var locals = { + $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope, + $element: $element, + $attrs: attrs, + $transclude: transcludeFn + }, controllerInstance; + + controller = directive.controller; + if (controller == '@') { + controller = attrs[directive.name]; + } + + controllerInstance = $controller(controller, locals); + // For directives with element transclusion the element is a comment, + // but jQuery .data doesn't support attaching data to comment nodes as it's hard to + // clean up (http://bugs.jquery.com/ticket/8335). + // Instead, we save the controllers for the element in a local hash and attach to .data + // later, once we have the actual element. + elementControllers[directive.name] = controllerInstance; + if (!hasElementTranscludeDirective) { + $element.data('$' + directive.name + 'Controller', controllerInstance); + } + + if (directive.controllerAs) { + locals.$scope[directive.controllerAs] = controllerInstance; + } + }); + } + + // PRELINKING + for(i = 0, ii = preLinkFns.length; i < ii; i++) { + try { + linkFn = preLinkFns[i]; + linkFn(linkFn.isolateScope ? isolateScope : scope, $element, attrs, + linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), transcludeFn); + } catch (e) { + $exceptionHandler(e, startingTag($element)); + } + } + + // RECURSION + // We only pass the isolate scope, if the isolate directive has a template, + // otherwise the child elements do not belong to the isolate directive. + var scopeToChild = scope; + if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) { + scopeToChild = isolateScope; + } + childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn); + + // POSTLINKING + for(i = postLinkFns.length - 1; i >= 0; i--) { + try { + linkFn = postLinkFns[i]; + linkFn(linkFn.isolateScope ? isolateScope : scope, $element, attrs, + linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), transcludeFn); + } catch (e) { + $exceptionHandler(e, startingTag($element)); + } + } + + // This is the function that is injected as `$transclude`. + function controllersBoundTransclude(scope, cloneAttachFn) { + var transcludeControllers; + + // no scope passed + if (arguments.length < 2) { + cloneAttachFn = scope; + scope = undefined; + } + + if (hasElementTranscludeDirective) { + transcludeControllers = elementControllers; + } + + return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers); + } + } + } + + function markDirectivesAsIsolate(directives) { + // mark all directives as needing isolate scope. + for (var j = 0, jj = directives.length; j < jj; j++) { + directives[j] = inherit(directives[j], {$$isolateScope: true}); + } + } + + /** + * looks up the directive and decorates it with exception handling and proper parameters. We + * call this the boundDirective. + * + * @param {string} name name of the directive to look up. + * @param {string} location The directive must be found in specific format. + * String containing any of theses characters: + * + * * `E`: element name + * * `A': attribute + * * `C`: class + * * `M`: comment + * @returns {boolean} true if directive was added. + */ + function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, + endAttrName) { + if (name === ignoreDirective) return null; + var match = null; + if (hasDirectives.hasOwnProperty(name)) { + for(var directive, directives = $injector.get(name + Suffix), + i = 0, ii = directives.length; i directive.priority) && + directive.restrict.indexOf(location) != -1) { + if (startAttrName) { + directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); + } + tDirectives.push(directive); + match = directive; + } + } catch(e) { $exceptionHandler(e); } + } + } + return match; + } + + + /** + * When the element is replaced with HTML template then the new attributes + * on the template need to be merged with the existing attributes in the DOM. + * The desired effect is to have both of the attributes present. + * + * @param {object} dst destination attributes (original DOM) + * @param {object} src source attributes (from the directive template) + */ + function mergeTemplateAttributes(dst, src) { + var srcAttr = src.$attr, + dstAttr = dst.$attr, + $element = dst.$$element; + + // reapply the old attributes to the new element + forEach(dst, function(value, key) { + if (key.charAt(0) != '$') { + if (src[key] && src[key] !== value) { + value += (key === 'style' ? ';' : ' ') + src[key]; + } + dst.$set(key, value, true, srcAttr[key]); + } + }); + + // copy the new attributes on the old attrs object + forEach(src, function(value, key) { + if (key == 'class') { + safeAddClass($element, value); + dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value; + } else if (key == 'style') { + $element.attr('style', $element.attr('style') + ';' + value); + dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value; + // `dst` will never contain hasOwnProperty as DOM parser won't let it. + // You will get an "InvalidCharacterError: DOM Exception 5" error if you + // have an attribute like "has-own-property" or "data-has-own-property", etc. + } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) { + dst[key] = value; + dstAttr[key] = srcAttr[key]; + } + }); + } + + + function compileTemplateUrl(directives, $compileNode, tAttrs, + $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) { + var linkQueue = [], + afterTemplateNodeLinkFn, + afterTemplateChildLinkFn, + beforeTemplateCompileNode = $compileNode[0], + origAsyncDirective = directives.shift(), + // The fact that we have to copy and patch the directive seems wrong! + derivedSyncDirective = extend({}, origAsyncDirective, { + templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective + }), + templateUrl = (isFunction(origAsyncDirective.templateUrl)) + ? origAsyncDirective.templateUrl($compileNode, tAttrs) + : origAsyncDirective.templateUrl; + + $compileNode.empty(); + + $http.get($sce.getTrustedResourceUrl(templateUrl), {cache: $templateCache}). + success(function(content) { + var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn; + + content = denormalizeTemplate(content); + + if (origAsyncDirective.replace) { + if (jqLiteIsTextNode(content)) { + $template = []; + } else { + $template = jqLite(trim(content)); + } + compileNode = $template[0]; + + if ($template.length != 1 || compileNode.nodeType !== 1) { + throw $compileMinErr('tplrt', + "Template for directive '{0}' must have exactly one root element. {1}", + origAsyncDirective.name, templateUrl); + } + + tempTemplateAttrs = {$attr: {}}; + replaceWith($rootElement, $compileNode, compileNode); + var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs); + + if (isObject(origAsyncDirective.scope)) { + markDirectivesAsIsolate(templateDirectives); + } + directives = templateDirectives.concat(directives); + mergeTemplateAttributes(tAttrs, tempTemplateAttrs); + } else { + compileNode = beforeTemplateCompileNode; + $compileNode.html(content); + } + + directives.unshift(derivedSyncDirective); + + afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, + childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns, + previousCompileContext); + forEach($rootElement, function(node, i) { + if (node == compileNode) { + $rootElement[i] = $compileNode[0]; + } + }); + afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn); + + while(linkQueue.length) { + var scope = linkQueue.shift(), + beforeTemplateLinkNode = linkQueue.shift(), + linkRootElement = linkQueue.shift(), + boundTranscludeFn = linkQueue.shift(), + linkNode = $compileNode[0]; + + if (beforeTemplateLinkNode !== beforeTemplateCompileNode) { + var oldClasses = beforeTemplateLinkNode.className; + + if (!(previousCompileContext.hasElementTranscludeDirective && + origAsyncDirective.replace)) { + // it was cloned therefore we have to clone as well. + linkNode = jqLiteClone(compileNode); + } + + replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode); + + // Copy in CSS classes from original node + safeAddClass(jqLite(linkNode), oldClasses); + } + if (afterTemplateNodeLinkFn.transcludeOnThisElement) { + childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); + } else { + childBoundTranscludeFn = boundTranscludeFn; + } + afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, + childBoundTranscludeFn); + } + linkQueue = null; + }). + error(function(response, code, headers, config) { + throw $compileMinErr('tpload', 'Failed to load template: {0}', config.url); + }); + + return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) { + var childBoundTranscludeFn = boundTranscludeFn; + if (linkQueue) { + linkQueue.push(scope); + linkQueue.push(node); + linkQueue.push(rootElement); + linkQueue.push(childBoundTranscludeFn); + } else { + if (afterTemplateNodeLinkFn.transcludeOnThisElement) { + childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); + } + afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn); + } + }; + } + + + /** + * Sorting function for bound directives. + */ + function byPriority(a, b) { + var diff = b.priority - a.priority; + if (diff !== 0) return diff; + if (a.name !== b.name) return (a.name < b.name) ? -1 : 1; + return a.index - b.index; + } + + + function assertNoDuplicate(what, previousDirective, directive, element) { + if (previousDirective) { + throw $compileMinErr('multidir', 'Multiple directives [{0}, {1}] asking for {2} on: {3}', + previousDirective.name, directive.name, what, startingTag(element)); + } + } + + + function addTextInterpolateDirective(directives, text) { + var interpolateFn = $interpolate(text, true); + if (interpolateFn) { + directives.push({ + priority: 0, + compile: function textInterpolateCompileFn(templateNode) { + // when transcluding a template that has bindings in the root + // then we don't have a parent and should do this in the linkFn + var parent = templateNode.parent(), hasCompileParent = parent.length; + if (hasCompileParent) safeAddClass(templateNode.parent(), 'ng-binding'); + + return function textInterpolateLinkFn(scope, node) { + var parent = node.parent(), + bindings = parent.data('$binding') || []; + bindings.push(interpolateFn); + parent.data('$binding', bindings); + if (!hasCompileParent) safeAddClass(parent, 'ng-binding'); + scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { + node[0].nodeValue = value; + }); + }; + } + }); + } + } + + + function getTrustedContext(node, attrNormalizedName) { + if (attrNormalizedName == "srcdoc") { + return $sce.HTML; + } + var tag = nodeName_(node); + // maction[xlink:href] can source SVG. It's not limited to . + if (attrNormalizedName == "xlinkHref" || + (tag == "FORM" && attrNormalizedName == "action") || + (tag != "IMG" && (attrNormalizedName == "src" || + attrNormalizedName == "ngSrc"))) { + return $sce.RESOURCE_URL; + } + } + + + function addAttrInterpolateDirective(node, directives, value, name) { + var interpolateFn = $interpolate(value, true); + + // no interpolation found -> ignore + if (!interpolateFn) return; + + + if (name === "multiple" && nodeName_(node) === "SELECT") { + throw $compileMinErr("selmulti", + "Binding to the 'multiple' attribute is not supported. Element: {0}", + startingTag(node)); + } + + directives.push({ + priority: 100, + compile: function() { + return { + pre: function attrInterpolatePreLinkFn(scope, element, attr) { + var $$observers = (attr.$$observers || (attr.$$observers = {})); + + if (EVENT_HANDLER_ATTR_REGEXP.test(name)) { + throw $compileMinErr('nodomevents', + "Interpolations for HTML DOM event attributes are disallowed. Please use the " + + "ng- versions (such as ng-click instead of onclick) instead."); + } + + // we need to interpolate again, in case the attribute value has been updated + // (e.g. by another directive's compile function) + interpolateFn = $interpolate(attr[name], true, getTrustedContext(node, name)); + + // if attribute was updated so that there is no interpolation going on we don't want to + // register any observers + if (!interpolateFn) return; + + // TODO(i): this should likely be attr.$set(name, iterpolateFn(scope) so that we reset the + // actual attr value + attr[name] = interpolateFn(scope); + ($$observers[name] || ($$observers[name] = [])).$$inter = true; + (attr.$$observers && attr.$$observers[name].$$scope || scope). + $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) { + //special case for class attribute addition + removal + //so that class changes can tap into the animation + //hooks provided by the $animate service. Be sure to + //skip animations when the first digest occurs (when + //both the new and the old values are the same) since + //the CSS classes are the non-interpolated values + if(name === 'class' && newValue != oldValue) { + attr.$updateClass(newValue, oldValue); + } else { + attr.$set(name, newValue); + } + }); + } + }; + } + }); + } + + + /** + * This is a special jqLite.replaceWith, which can replace items which + * have no parents, provided that the containing jqLite collection is provided. + * + * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes + * in the root of the tree. + * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep + * the shell, but replace its DOM node reference. + * @param {Node} newNode The new DOM node. + */ + function replaceWith($rootElement, elementsToRemove, newNode) { + var firstElementToRemove = elementsToRemove[0], + removeCount = elementsToRemove.length, + parent = firstElementToRemove.parentNode, + i, ii; + + if ($rootElement) { + for(i = 0, ii = $rootElement.length; i < ii; i++) { + if ($rootElement[i] == firstElementToRemove) { + $rootElement[i++] = newNode; + for (var j = i, j2 = j + removeCount - 1, + jj = $rootElement.length; + j < jj; j++, j2++) { + if (j2 < jj) { + $rootElement[j] = $rootElement[j2]; + } else { + delete $rootElement[j]; + } + } + $rootElement.length -= removeCount - 1; + break; + } + } + } + + if (parent) { + parent.replaceChild(newNode, firstElementToRemove); + } + var fragment = document.createDocumentFragment(); + fragment.appendChild(firstElementToRemove); + newNode[jqLite.expando] = firstElementToRemove[jqLite.expando]; + for (var k = 1, kk = elementsToRemove.length; k < kk; k++) { + var element = elementsToRemove[k]; + jqLite(element).remove(); // must do this way to clean up expando + fragment.appendChild(element); + delete elementsToRemove[k]; + } + + elementsToRemove[0] = newNode; + elementsToRemove.length = 1; + } + + + function cloneAndAnnotateFn(fn, annotation) { + return extend(function() { return fn.apply(null, arguments); }, fn, annotation); + } + }]; +} + +var PREFIX_REGEXP = /^(x[\:\-_]|data[\:\-_])/i; +/** + * Converts all accepted directives format into proper directive name. + * All of these will become 'myDirective': + * my:Directive + * my-directive + * x-my-directive + * data-my:directive + * + * Also there is special case for Moz prefix starting with upper case letter. + * @param name Name to normalize + */ +function directiveNormalize(name) { + return camelCase(name.replace(PREFIX_REGEXP, '')); +} + +/** + * @ngdoc type + * @name $compile.directive.Attributes + * + * @description + * A shared object between directive compile / linking functions which contains normalized DOM + * element attributes. The values reflect current binding state `{{ }}`. The normalization is + * needed since all of these are treated as equivalent in Angular: + * + * ``` + * + * ``` + */ + +/** + * @ngdoc property + * @name $compile.directive.Attributes#$attr + * + * @description + * A map of DOM element attribute names to the normalized name. This is + * needed to do reverse lookup from normalized name back to actual name. + */ + + +/** + * @ngdoc method + * @name $compile.directive.Attributes#$set + * @kind function + * + * @description + * Set DOM element attribute value. + * + * + * @param {string} name Normalized element attribute name of the property to modify. The name is + * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr} + * property to the original name. + * @param {string} value Value to set the attribute to. The value can be an interpolated string. + */ + + + +/** + * Closure compiler type information + */ + +function nodesetLinkingFn( + /* angular.Scope */ scope, + /* NodeList */ nodeList, + /* Element */ rootElement, + /* function(Function) */ boundTranscludeFn +){} + +function directiveLinkingFn( + /* nodesetLinkingFn */ nodesetLinkingFn, + /* angular.Scope */ scope, + /* Node */ node, + /* Element */ rootElement, + /* function(Function) */ boundTranscludeFn +){} + +function tokenDifference(str1, str2) { + var values = '', + tokens1 = str1.split(/\s+/), + tokens2 = str2.split(/\s+/); + + outer: + for(var i = 0; i < tokens1.length; i++) { + var token = tokens1[i]; + for(var j = 0; j < tokens2.length; j++) { + if(token == tokens2[j]) continue outer; + } + values += (values.length > 0 ? ' ' : '') + token; + } + return values; +} + +/** + * @ngdoc provider + * @name $controllerProvider + * @description + * The {@link ng.$controller $controller service} is used by Angular to create new + * controllers. + * + * This provider allows controller registration via the + * {@link ng.$controllerProvider#register register} method. + */ +function $ControllerProvider() { + var controllers = {}, + CNTRL_REG = /^(\S+)(\s+as\s+(\w+))?$/; + + + /** + * @ngdoc method + * @name $controllerProvider#register + * @param {string|Object} name Controller name, or an object map of controllers where the keys are + * the names and the values are the constructors. + * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI + * annotations in the array notation). + */ + this.register = function(name, constructor) { + assertNotHasOwnProperty(name, 'controller'); + if (isObject(name)) { + extend(controllers, name); + } else { + controllers[name] = constructor; + } + }; + + + this.$get = ['$injector', '$window', function($injector, $window) { + + /** + * @ngdoc service + * @name $controller + * @requires $injector + * + * @param {Function|string} constructor If called with a function then it's considered to be the + * controller constructor function. Otherwise it's considered to be a string which is used + * to retrieve the controller constructor using the following steps: + * + * * check if a controller with given name is registered via `$controllerProvider` + * * check if evaluating the string on the current scope returns a constructor + * * check `window[constructor]` on the global `window` object + * + * @param {Object} locals Injection locals for Controller. + * @return {Object} Instance of given controller. + * + * @description + * `$controller` service is responsible for instantiating controllers. + * + * It's just a simple call to {@link auto.$injector $injector}, but extracted into + * a service, so that one can override this service with [BC version](https://gist.github.com/1649788). + */ + return function(expression, locals) { + var instance, match, constructor, identifier; + + if(isString(expression)) { + match = expression.match(CNTRL_REG), + constructor = match[1], + identifier = match[3]; + expression = controllers.hasOwnProperty(constructor) + ? controllers[constructor] + : getter(locals.$scope, constructor, true) || getter($window, constructor, true); + + assertArgFn(expression, constructor, true); + } + + instance = $injector.instantiate(expression, locals); + + if (identifier) { + if (!(locals && typeof locals.$scope === 'object')) { + throw minErr('$controller')('noscp', + "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.", + constructor || expression.name, identifier); + } + + locals.$scope[identifier] = instance; + } + + return instance; + }; + }]; +} + +/** + * @ngdoc service + * @name $document + * @requires $window + * + * @description + * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object. + * + * @example + + +
+

$document title:

+

window.document title:

+
+
+ + angular.module('documentExample', []) + .controller('ExampleController', ['$scope', '$document', function($scope, $document) { + $scope.title = $document[0].title; + $scope.windowTitle = angular.element(window.document)[0].title; + }]); + +
+ */ +function $DocumentProvider(){ + this.$get = ['$window', function(window){ + return jqLite(window.document); + }]; +} + +/** + * @ngdoc service + * @name $exceptionHandler + * @requires ng.$log + * + * @description + * Any uncaught exception in angular expressions is delegated to this service. + * The default implementation simply delegates to `$log.error` which logs it into + * the browser console. + * + * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by + * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing. + * + * ## Example: + * + * ```js + * angular.module('exceptionOverride', []).factory('$exceptionHandler', function () { + * return function (exception, cause) { + * exception.message += ' (caused by "' + cause + '")'; + * throw exception; + * }; + * }); + * ``` + * + * This example will override the normal action of `$exceptionHandler`, to make angular + * exceptions fail hard when they happen, instead of just logging to the console. + * + * @param {Error} exception Exception associated with the error. + * @param {string=} cause optional information about the context in which + * the error was thrown. + * + */ +function $ExceptionHandlerProvider() { + this.$get = ['$log', function($log) { + return function(exception, cause) { + $log.error.apply($log, arguments); + }; + }]; +} + +/** + * Parse headers into key value object + * + * @param {string} headers Raw headers as a string + * @returns {Object} Parsed headers as key value object + */ +function parseHeaders(headers) { + var parsed = {}, key, val, i; + + if (!headers) return parsed; + + forEach(headers.split('\n'), function(line) { + i = line.indexOf(':'); + key = lowercase(trim(line.substr(0, i))); + val = trim(line.substr(i + 1)); + + if (key) { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +} + + +/** + * Returns a function that provides access to parsed headers. + * + * Headers are lazy parsed when first requested. + * @see parseHeaders + * + * @param {(string|Object)} headers Headers to provide access to. + * @returns {function(string=)} Returns a getter function which if called with: + * + * - if called with single an argument returns a single header value or null + * - if called with no arguments returns an object containing all headers. + */ +function headersGetter(headers) { + var headersObj = isObject(headers) ? headers : undefined; + + return function(name) { + if (!headersObj) headersObj = parseHeaders(headers); + + if (name) { + return headersObj[lowercase(name)] || null; + } + + return headersObj; + }; +} + + +/** + * Chain all given functions + * + * This function is used for both request and response transforming + * + * @param {*} data Data to transform. + * @param {function(string=)} headers Http headers getter fn. + * @param {(Function|Array.)} fns Function or an array of functions. + * @returns {*} Transformed data. + */ +function transformData(data, headers, fns) { + if (isFunction(fns)) + return fns(data, headers); + + forEach(fns, function(fn) { + data = fn(data, headers); + }); + + return data; +} + + +function isSuccess(status) { + return 200 <= status && status < 300; +} + + +/** + * @ngdoc provider + * @name $httpProvider + * @description + * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service. + * */ +function $HttpProvider() { + var JSON_START = /^\s*(\[|\{[^\{])/, + JSON_END = /[\}\]]\s*$/, + PROTECTION_PREFIX = /^\)\]\}',?\n/, + CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': 'application/json;charset=utf-8'}; + + /** + * @ngdoc property + * @name $httpProvider#defaults + * @description + * + * Object containing default values for all {@link ng.$http $http} requests. + * + * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token. + * Defaults value is `'XSRF-TOKEN'`. + * + * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the + * XSRF token. Defaults value is `'X-XSRF-TOKEN'`. + * + * - **`defaults.headers`** - {Object} - Default headers for all $http requests. + * Refer to {@link ng.$http#setting-http-headers $http} for documentation on + * setting default headers. + * - **`defaults.headers.common`** + * - **`defaults.headers.post`** + * - **`defaults.headers.put`** + * - **`defaults.headers.patch`** + **/ + var defaults = this.defaults = { + // transform incoming response data + transformResponse: [function(data) { + if (isString(data)) { + // strip json vulnerability protection prefix + data = data.replace(PROTECTION_PREFIX, ''); + if (JSON_START.test(data) && JSON_END.test(data)) + data = fromJson(data); + } + return data; + }], + + // transform outgoing request data + transformRequest: [function(d) { + return isObject(d) && !isFile(d) && !isBlob(d) ? toJson(d) : d; + }], + + // default headers + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + }, + post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), + put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), + patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON) + }, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN' + }; + + /** + * Are ordered by request, i.e. they are applied in the same order as the + * array, on request, but reverse order, on response. + */ + var interceptorFactories = this.interceptors = []; + + /** + * For historical reasons, response interceptors are ordered by the order in which + * they are applied to the response. (This is the opposite of interceptorFactories) + */ + var responseInterceptorFactories = this.responseInterceptors = []; + + this.$get = ['$httpBackend', '$browser', '$cacheFactory', '$rootScope', '$q', '$injector', + function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) { + + var defaultCache = $cacheFactory('$http'); + + /** + * Interceptors stored in reverse order. Inner interceptors before outer interceptors. + * The reversal is needed so that we can build up the interception chain around the + * server request. + */ + var reversedInterceptors = []; + + forEach(interceptorFactories, function(interceptorFactory) { + reversedInterceptors.unshift(isString(interceptorFactory) + ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory)); + }); + + forEach(responseInterceptorFactories, function(interceptorFactory, index) { + var responseFn = isString(interceptorFactory) + ? $injector.get(interceptorFactory) + : $injector.invoke(interceptorFactory); + + /** + * Response interceptors go before "around" interceptors (no real reason, just + * had to pick one.) But they are already reversed, so we can't use unshift, hence + * the splice. + */ + reversedInterceptors.splice(index, 0, { + response: function(response) { + return responseFn($q.when(response)); + }, + responseError: function(response) { + return responseFn($q.reject(response)); + } + }); + }); + + + /** + * @ngdoc service + * @kind function + * @name $http + * @requires ng.$httpBackend + * @requires $cacheFactory + * @requires $rootScope + * @requires $q + * @requires $injector + * + * @description + * The `$http` service is a core Angular service that facilitates communication with the remote + * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest) + * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP). + * + * For unit testing applications that use `$http` service, see + * {@link ngMock.$httpBackend $httpBackend mock}. + * + * For a higher level of abstraction, please check out the {@link ngResource.$resource + * $resource} service. + * + * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by + * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage + * it is important to familiarize yourself with these APIs and the guarantees they provide. + * + * + * # General usage + * The `$http` service is a function which takes a single argument — a configuration object — + * that is used to generate an HTTP request and returns a {@link ng.$q promise} + * with two $http specific methods: `success` and `error`. + * + * ```js + * $http({method: 'GET', url: '/someUrl'}). + * success(function(data, status, headers, config) { + * // this callback will be called asynchronously + * // when the response is available + * }). + * error(function(data, status, headers, config) { + * // called asynchronously if an error occurs + * // or server returns response with an error status. + * }); + * ``` + * + * Since the returned value of calling the $http function is a `promise`, you can also use + * the `then` method to register callbacks, and these callbacks will receive a single argument – + * an object representing the response. See the API signature and type info below for more + * details. + * + * A response status code between 200 and 299 is considered a success status and + * will result in the success callback being called. Note that if the response is a redirect, + * XMLHttpRequest will transparently follow it, meaning that the error callback will not be + * called for such responses. + * + * # Writing Unit Tests that use $http + * When unit testing (using {@link ngMock ngMock}), it is necessary to call + * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending + * request using trained responses. + * + * ``` + * $httpBackend.expectGET(...); + * $http.get(...); + * $httpBackend.flush(); + * ``` + * + * # Shortcut methods + * + * Shortcut methods are also available. All shortcut methods require passing in the URL, and + * request data must be passed in for POST/PUT requests. + * + * ```js + * $http.get('/someUrl').success(successCallback); + * $http.post('/someUrl', data).success(successCallback); + * ``` + * + * Complete list of shortcut methods: + * + * - {@link ng.$http#get $http.get} + * - {@link ng.$http#head $http.head} + * - {@link ng.$http#post $http.post} + * - {@link ng.$http#put $http.put} + * - {@link ng.$http#delete $http.delete} + * - {@link ng.$http#jsonp $http.jsonp} + * - {@link ng.$http#patch $http.patch} + * + * + * # Setting HTTP Headers + * + * The $http service will automatically add certain HTTP headers to all requests. These defaults + * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration + * object, which currently contains this default configuration: + * + * - `$httpProvider.defaults.headers.common` (headers that are common for all requests): + * - `Accept: application/json, text/plain, * / *` + * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests) + * - `Content-Type: application/json` + * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests) + * - `Content-Type: application/json` + * + * To add or overwrite these defaults, simply add or remove a property from these configuration + * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object + * with the lowercased HTTP method name as the key, e.g. + * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }. + * + * The defaults can also be set at runtime via the `$http.defaults` object in the same + * fashion. For example: + * + * ``` + * module.run(function($http) { + * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w' + * }); + * ``` + * + * In addition, you can supply a `headers` property in the config object passed when + * calling `$http(config)`, which overrides the defaults without changing them globally. + * + * + * # Transforming Requests and Responses + * + * Both requests and responses can be transformed using transform functions. By default, Angular + * applies these transformations: + * + * Request transformations: + * + * - If the `data` property of the request configuration object contains an object, serialize it + * into JSON format. + * + * Response transformations: + * + * - If XSRF prefix is detected, strip it (see Security Considerations section below). + * - If JSON response is detected, deserialize it using a JSON parser. + * + * To globally augment or override the default transforms, modify the + * `$httpProvider.defaults.transformRequest` and `$httpProvider.defaults.transformResponse` + * properties. These properties are by default an array of transform functions, which allows you + * to `push` or `unshift` a new transformation function into the transformation chain. You can + * also decide to completely override any default transformations by assigning your + * transformation functions to these properties directly without the array wrapper. These defaults + * are again available on the $http factory at run-time, which may be useful if you have run-time + * services you wish to be involved in your transformations. + * + * Similarly, to locally override the request/response transforms, augment the + * `transformRequest` and/or `transformResponse` properties of the configuration object passed + * into `$http`. + * + * + * # Caching + * + * To enable caching, set the request configuration `cache` property to `true` (to use default + * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}). + * When the cache is enabled, `$http` stores the response from the server in the specified + * cache. The next time the same request is made, the response is served from the cache without + * sending a request to the server. + * + * Note that even if the response is served from cache, delivery of the data is asynchronous in + * the same way that real requests are. + * + * If there are multiple GET requests for the same URL that should be cached using the same + * cache, but the cache is not populated yet, only one request to the server will be made and + * the remaining requests will be fulfilled using the response from the first request. + * + * You can change the default cache to a new object (built with + * {@link ng.$cacheFactory `$cacheFactory`}) by updating the + * {@link ng.$http#properties_defaults `$http.defaults.cache`} property. All requests who set + * their `cache` property to `true` will now use this cache object. + * + * If you set the default cache to `false` then only requests that specify their own custom + * cache object will be cached. + * + * # Interceptors + * + * Before you start creating interceptors, be sure to understand the + * {@link ng.$q $q and deferred/promise APIs}. + * + * For purposes of global error handling, authentication, or any kind of synchronous or + * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be + * able to intercept requests before they are handed to the server and + * responses before they are handed over to the application code that + * initiated these requests. The interceptors leverage the {@link ng.$q + * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing. + * + * The interceptors are service factories that are registered with the `$httpProvider` by + * adding them to the `$httpProvider.interceptors` array. The factory is called and + * injected with dependencies (if specified) and returns the interceptor. + * + * There are two kinds of interceptors (and two kinds of rejection interceptors): + * + * * `request`: interceptors get called with a http `config` object. The function is free to + * modify the `config` object or create a new one. The function needs to return the `config` + * object directly, or a promise containing the `config` or a new `config` object. + * * `requestError`: interceptor gets called when a previous interceptor threw an error or + * resolved with a rejection. + * * `response`: interceptors get called with http `response` object. The function is free to + * modify the `response` object or create a new one. The function needs to return the `response` + * object directly, or as a promise containing the `response` or a new `response` object. + * * `responseError`: interceptor gets called when a previous interceptor threw an error or + * resolved with a rejection. + * + * + * ```js + * // register the interceptor as a service + * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) { + * return { + * // optional method + * 'request': function(config) { + * // do something on success + * return config; + * }, + * + * // optional method + * 'requestError': function(rejection) { + * // do something on error + * if (canRecover(rejection)) { + * return responseOrNewPromise + * } + * return $q.reject(rejection); + * }, + * + * + * + * // optional method + * 'response': function(response) { + * // do something on success + * return response; + * }, + * + * // optional method + * 'responseError': function(rejection) { + * // do something on error + * if (canRecover(rejection)) { + * return responseOrNewPromise + * } + * return $q.reject(rejection); + * } + * }; + * }); + * + * $httpProvider.interceptors.push('myHttpInterceptor'); + * + * + * // alternatively, register the interceptor via an anonymous factory + * $httpProvider.interceptors.push(function($q, dependency1, dependency2) { + * return { + * 'request': function(config) { + * // same as above + * }, + * + * 'response': function(response) { + * // same as above + * } + * }; + * }); + * ``` + * + * # Response interceptors (DEPRECATED) + * + * Before you start creating interceptors, be sure to understand the + * {@link ng.$q $q and deferred/promise APIs}. + * + * For purposes of global error handling, authentication or any kind of synchronous or + * asynchronous preprocessing of received responses, it is desirable to be able to intercept + * responses for http requests before they are handed over to the application code that + * initiated these requests. The response interceptors leverage the {@link ng.$q + * promise apis} to fulfil this need for both synchronous and asynchronous preprocessing. + * + * The interceptors are service factories that are registered with the $httpProvider by + * adding them to the `$httpProvider.responseInterceptors` array. The factory is called and + * injected with dependencies (if specified) and returns the interceptor — a function that + * takes a {@link ng.$q promise} and returns the original or a new promise. + * + * ```js + * // register the interceptor as a service + * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) { + * return function(promise) { + * return promise.then(function(response) { + * // do something on success + * return response; + * }, function(response) { + * // do something on error + * if (canRecover(response)) { + * return responseOrNewPromise + * } + * return $q.reject(response); + * }); + * } + * }); + * + * $httpProvider.responseInterceptors.push('myHttpInterceptor'); + * + * + * // register the interceptor via an anonymous factory + * $httpProvider.responseInterceptors.push(function($q, dependency1, dependency2) { + * return function(promise) { + * // same as above + * } + * }); + * ``` + * + * + * # Security Considerations + * + * When designing web applications, consider security threats from: + * + * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) + * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) + * + * Both server and the client must cooperate in order to eliminate these threats. Angular comes + * pre-configured with strategies that address these issues, but for this to work backend server + * cooperation is required. + * + * ## JSON Vulnerability Protection + * + * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) + * allows third party website to turn your JSON resource URL into + * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To + * counter this your server can prefix all JSON requests with following string `")]}',\n"`. + * Angular will automatically strip the prefix before processing it as JSON. + * + * For example if your server needs to return: + * ```js + * ['one','two'] + * ``` + * + * which is vulnerable to attack, your server can return: + * ```js + * )]}', + * ['one','two'] + * ``` + * + * Angular will strip the prefix, before processing the JSON. + * + * + * ## Cross Site Request Forgery (XSRF) Protection + * + * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is a technique by which + * an unauthorized site can gain your user's private data. Angular provides a mechanism + * to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie + * (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only + * JavaScript that runs on your domain could read the cookie, your server can be assured that + * the XHR came from JavaScript running on your domain. The header will not be set for + * cross-domain requests. + * + * To take advantage of this, your server needs to set a token in a JavaScript readable session + * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the + * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure + * that only JavaScript running on your domain could have sent the request. The token must be + * unique for each user and must be verifiable by the server (to prevent the JavaScript from + * making up its own tokens). We recommend that the token is a digest of your site's + * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography)) + * for added security. + * + * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName + * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time, + * or the per-request config object. + * + * + * @param {object} config Object describing the request to be made and how it should be + * processed. The object has following properties: + * + * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc) + * - **url** – `{string}` – Absolute or relative URL of the resource that is being requested. + * - **params** – `{Object.}` – Map of strings or objects which will be turned + * to `?key1=value1&key2=value2` after the url. If the value is not a string, it will be + * JSONified. + * - **data** – `{string|Object}` – Data to be sent as the request message data. + * - **headers** – `{Object}` – Map of strings or functions which return strings representing + * HTTP headers to send to the server. If the return value of a function is null, the + * header will not be sent. + * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token. + * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token. + * - **transformRequest** – + * `{function(data, headersGetter)|Array.}` – + * transform function or an array of such functions. The transform function takes the http + * request body and headers and returns its transformed (typically serialized) version. + * - **transformResponse** – + * `{function(data, headersGetter)|Array.}` – + * transform function or an array of such functions. The transform function takes the http + * response body and headers and returns its transformed (typically deserialized) version. + * - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the + * GET request, otherwise if a cache instance built with + * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for + * caching. + * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} + * that should abort the request when resolved. + * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the + * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials) + * for more information. + * - **responseType** - `{string}` - see + * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType). + * + * @returns {HttpPromise} Returns a {@link ng.$q promise} object with the + * standard `then` method and two http specific methods: `success` and `error`. The `then` + * method takes two arguments a success and an error callback which will be called with a + * response object. The `success` and `error` methods take a single argument - a function that + * will be called when the request succeeds or fails respectively. The arguments passed into + * these functions are destructured representation of the response object passed into the + * `then` method. The response object has these properties: + * + * - **data** – `{string|Object}` – The response body transformed with the transform + * functions. + * - **status** – `{number}` – HTTP status code of the response. + * - **headers** – `{function([headerName])}` – Header getter function. + * - **config** – `{Object}` – The configuration object that was used to generate the request. + * - **statusText** – `{string}` – HTTP status text of the response. + * + * @property {Array.} pendingRequests Array of config objects for currently pending + * requests. This is primarily meant to be used for debugging purposes. + * + * + * @example + + +
+ + +
+ + + +
http status code: {{status}}
+
http response data: {{data}}
+
+
+ + angular.module('httpExample', []) + .controller('FetchController', ['$scope', '$http', '$templateCache', + function($scope, $http, $templateCache) { + $scope.method = 'GET'; + $scope.url = 'http-hello.html'; + + $scope.fetch = function() { + $scope.code = null; + $scope.response = null; + + $http({method: $scope.method, url: $scope.url, cache: $templateCache}). + success(function(data, status) { + $scope.status = status; + $scope.data = data; + }). + error(function(data, status) { + $scope.data = data || "Request failed"; + $scope.status = status; + }); + }; + + $scope.updateModel = function(method, url) { + $scope.method = method; + $scope.url = url; + }; + }]); + + + Hello, $http! + + + var status = element(by.binding('status')); + var data = element(by.binding('data')); + var fetchBtn = element(by.id('fetchbtn')); + var sampleGetBtn = element(by.id('samplegetbtn')); + var sampleJsonpBtn = element(by.id('samplejsonpbtn')); + var invalidJsonpBtn = element(by.id('invalidjsonpbtn')); + + it('should make an xhr GET request', function() { + sampleGetBtn.click(); + fetchBtn.click(); + expect(status.getText()).toMatch('200'); + expect(data.getText()).toMatch(/Hello, \$http!/); + }); + + it('should make a JSONP request to angularjs.org', function() { + sampleJsonpBtn.click(); + fetchBtn.click(); + expect(status.getText()).toMatch('200'); + expect(data.getText()).toMatch(/Super Hero!/); + }); + + it('should make JSONP request to invalid URL and invoke the error handler', + function() { + invalidJsonpBtn.click(); + fetchBtn.click(); + expect(status.getText()).toMatch('0'); + expect(data.getText()).toMatch('Request failed'); + }); + +
+ */ + function $http(requestConfig) { + var config = { + method: 'get', + transformRequest: defaults.transformRequest, + transformResponse: defaults.transformResponse + }; + var headers = mergeHeaders(requestConfig); + + extend(config, requestConfig); + config.headers = headers; + config.method = uppercase(config.method); + + var serverRequest = function(config) { + headers = config.headers; + var reqData = transformData(config.data, headersGetter(headers), config.transformRequest); + + // strip content-type if data is undefined + if (isUndefined(reqData)) { + forEach(headers, function(value, header) { + if (lowercase(header) === 'content-type') { + delete headers[header]; + } + }); + } + + if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) { + config.withCredentials = defaults.withCredentials; + } + + // send request + return sendReq(config, reqData, headers).then(transformResponse, transformResponse); + }; + + var chain = [serverRequest, undefined]; + var promise = $q.when(config); + + // apply interceptors + forEach(reversedInterceptors, function(interceptor) { + if (interceptor.request || interceptor.requestError) { + chain.unshift(interceptor.request, interceptor.requestError); + } + if (interceptor.response || interceptor.responseError) { + chain.push(interceptor.response, interceptor.responseError); + } + }); + + while(chain.length) { + var thenFn = chain.shift(); + var rejectFn = chain.shift(); + + promise = promise.then(thenFn, rejectFn); + } + + promise.success = function(fn) { + promise.then(function(response) { + fn(response.data, response.status, response.headers, config); + }); + return promise; + }; + + promise.error = function(fn) { + promise.then(null, function(response) { + fn(response.data, response.status, response.headers, config); + }); + return promise; + }; + + return promise; + + function transformResponse(response) { + // make a copy since the response must be cacheable + var resp = extend({}, response, { + data: transformData(response.data, response.headers, config.transformResponse) + }); + return (isSuccess(response.status)) + ? resp + : $q.reject(resp); + } + + function mergeHeaders(config) { + var defHeaders = defaults.headers, + reqHeaders = extend({}, config.headers), + defHeaderName, lowercaseDefHeaderName, reqHeaderName; + + defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]); + + // using for-in instead of forEach to avoid unecessary iteration after header has been found + defaultHeadersIteration: + for (defHeaderName in defHeaders) { + lowercaseDefHeaderName = lowercase(defHeaderName); + + for (reqHeaderName in reqHeaders) { + if (lowercase(reqHeaderName) === lowercaseDefHeaderName) { + continue defaultHeadersIteration; + } + } + + reqHeaders[defHeaderName] = defHeaders[defHeaderName]; + } + + // execute if header value is a function for merged headers + execHeaders(reqHeaders); + return reqHeaders; + + function execHeaders(headers) { + var headerContent; + + forEach(headers, function(headerFn, header) { + if (isFunction(headerFn)) { + headerContent = headerFn(); + if (headerContent != null) { + headers[header] = headerContent; + } else { + delete headers[header]; + } + } + }); + } + } + } + + $http.pendingRequests = []; + + /** + * @ngdoc method + * @name $http#get + * + * @description + * Shortcut method to perform `GET` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#delete + * + * @description + * Shortcut method to perform `DELETE` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#head + * + * @description + * Shortcut method to perform `HEAD` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#jsonp + * + * @description + * Shortcut method to perform `JSONP` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request. + * The name of the callback should be the string `JSON_CALLBACK`. + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + createShortMethods('get', 'delete', 'head', 'jsonp'); + + /** + * @ngdoc method + * @name $http#post + * + * @description + * Shortcut method to perform `POST` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {*} data Request content + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#put + * + * @description + * Shortcut method to perform `PUT` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {*} data Request content + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + createShortMethodsWithData('post', 'put'); + + /** + * @ngdoc property + * @name $http#defaults + * + * @description + * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of + * default headers, withCredentials as well as request and response transformations. + * + * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above. + */ + $http.defaults = defaults; + + + return $http; + + + function createShortMethods(names) { + forEach(arguments, function(name) { + $http[name] = function(url, config) { + return $http(extend(config || {}, { + method: name, + url: url + })); + }; + }); + } + + + function createShortMethodsWithData(name) { + forEach(arguments, function(name) { + $http[name] = function(url, data, config) { + return $http(extend(config || {}, { + method: name, + url: url, + data: data + })); + }; + }); + } + + + /** + * Makes the request. + * + * !!! ACCESSES CLOSURE VARS: + * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests + */ + function sendReq(config, reqData, reqHeaders) { + var deferred = $q.defer(), + promise = deferred.promise, + cache, + cachedResp, + url = buildUrl(config.url, config.params); + + $http.pendingRequests.push(config); + promise.then(removePendingReq, removePendingReq); + + + if ((config.cache || defaults.cache) && config.cache !== false && + (config.method === 'GET' || config.method === 'JSONP')) { + cache = isObject(config.cache) ? config.cache + : isObject(defaults.cache) ? defaults.cache + : defaultCache; + } + + if (cache) { + cachedResp = cache.get(url); + if (isDefined(cachedResp)) { + if (isPromiseLike(cachedResp)) { + // cached request has already been sent, but there is no response yet + cachedResp.then(removePendingReq, removePendingReq); + return cachedResp; + } else { + // serving from cache + if (isArray(cachedResp)) { + resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]); + } else { + resolvePromise(cachedResp, 200, {}, 'OK'); + } + } + } else { + // put the promise for the non-transformed response into cache as a placeholder + cache.put(url, promise); + } + } + + + // if we won't have the response in cache, set the xsrf headers and + // send the request to the backend + if (isUndefined(cachedResp)) { + var xsrfValue = urlIsSameOrigin(config.url) + ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName] + : undefined; + if (xsrfValue) { + reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; + } + + $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, + config.withCredentials, config.responseType); + } + + return promise; + + + /** + * Callback registered to $httpBackend(): + * - caches the response if desired + * - resolves the raw $http promise + * - calls $apply + */ + function done(status, response, headersString, statusText) { + if (cache) { + if (isSuccess(status)) { + cache.put(url, [status, response, parseHeaders(headersString), statusText]); + } else { + // remove promise from the cache + cache.remove(url); + } + } + + resolvePromise(response, status, headersString, statusText); + if (!$rootScope.$$phase) $rootScope.$apply(); + } + + + /** + * Resolves the raw $http promise. + */ + function resolvePromise(response, status, headers, statusText) { + // normalize internal statuses to 0 + status = Math.max(status, 0); + + (isSuccess(status) ? deferred.resolve : deferred.reject)({ + data: response, + status: status, + headers: headersGetter(headers), + config: config, + statusText : statusText + }); + } + + + function removePendingReq() { + var idx = indexOf($http.pendingRequests, config); + if (idx !== -1) $http.pendingRequests.splice(idx, 1); + } + } + + + function buildUrl(url, params) { + if (!params) return url; + var parts = []; + forEachSorted(params, function(value, key) { + if (value === null || isUndefined(value)) return; + if (!isArray(value)) value = [value]; + + forEach(value, function(v) { + if (isObject(v)) { + if (isDate(v)){ + v = v.toISOString(); + } else { + v = toJson(v); + } + } + parts.push(encodeUriQuery(key) + '=' + + encodeUriQuery(v)); + }); + }); + if(parts.length > 0) { + url += ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&'); + } + return url; + } + }]; +} + +function createXhr(method) { + //if IE and the method is not RFC2616 compliant, or if XMLHttpRequest + //is not available, try getting an ActiveXObject. Otherwise, use XMLHttpRequest + //if it is available + if (msie <= 8 && (!method.match(/^(get|post|head|put|delete|options)$/i) || + !window.XMLHttpRequest)) { + return new window.ActiveXObject("Microsoft.XMLHTTP"); + } else if (window.XMLHttpRequest) { + return new window.XMLHttpRequest(); + } + + throw minErr('$httpBackend')('noxhr', "This browser does not support XMLHttpRequest."); +} + +/** + * @ngdoc service + * @name $httpBackend + * @requires $window + * @requires $document + * + * @description + * HTTP backend used by the {@link ng.$http service} that delegates to + * XMLHttpRequest object or JSONP and deals with browser incompatibilities. + * + * You should never need to use this service directly, instead use the higher-level abstractions: + * {@link ng.$http $http} or {@link ngResource.$resource $resource}. + * + * During testing this implementation is swapped with {@link ngMock.$httpBackend mock + * $httpBackend} which can be trained with responses. + */ +function $HttpBackendProvider() { + this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) { + return createHttpBackend($browser, createXhr, $browser.defer, $window.angular.callbacks, $document[0]); + }]; +} + +function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) { + var ABORTED = -1; + + // TODO(vojta): fix the signature + return function(method, url, post, callback, headers, timeout, withCredentials, responseType) { + var status; + $browser.$$incOutstandingRequestCount(); + url = url || $browser.url(); + + if (lowercase(method) == 'jsonp') { + var callbackId = '_' + (callbacks.counter++).toString(36); + callbacks[callbackId] = function(data) { + callbacks[callbackId].data = data; + callbacks[callbackId].called = true; + }; + + var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId), + callbackId, function(status, text) { + completeRequest(callback, status, callbacks[callbackId].data, "", text); + callbacks[callbackId] = noop; + }); + } else { + + var xhr = createXhr(method); + + xhr.open(method, url, true); + forEach(headers, function(value, key) { + if (isDefined(value)) { + xhr.setRequestHeader(key, value); + } + }); + + // In IE6 and 7, this might be called synchronously when xhr.send below is called and the + // response is in the cache. the promise api will ensure that to the app code the api is + // always async + xhr.onreadystatechange = function() { + // onreadystatechange might get called multiple times with readyState === 4 on mobile webkit caused by + // xhrs that are resolved while the app is in the background (see #5426). + // since calling completeRequest sets the `xhr` variable to null, we just check if it's not null before + // continuing + // + // we can't set xhr.onreadystatechange to undefined or delete it because that breaks IE8 (method=PATCH) and + // Safari respectively. + if (xhr && xhr.readyState == 4) { + var responseHeaders = null, + response = null, + statusText = ''; + + if(status !== ABORTED) { + responseHeaders = xhr.getAllResponseHeaders(); + + // responseText is the old-school way of retrieving response (supported by IE8 & 9) + // response/responseType properties were introduced in XHR Level2 spec (supported by IE10) + response = ('response' in xhr) ? xhr.response : xhr.responseText; + } + + // Accessing statusText on an aborted xhr object will + // throw an 'c00c023f error' in IE9 and lower, don't touch it. + if (!(status === ABORTED && msie < 10)) { + statusText = xhr.statusText; + } + + completeRequest(callback, + status || xhr.status, + response, + responseHeaders, + statusText); + } + }; + + if (withCredentials) { + xhr.withCredentials = true; + } + + if (responseType) { + try { + xhr.responseType = responseType; + } catch (e) { + // WebKit added support for the json responseType value on 09/03/2013 + // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are + // known to throw when setting the value "json" as the response type. Other older + // browsers implementing the responseType + // + // The json response type can be ignored if not supported, because JSON payloads are + // parsed on the client-side regardless. + if (responseType !== 'json') { + throw e; + } + } + } + + xhr.send(post || null); + } + + if (timeout > 0) { + var timeoutId = $browserDefer(timeoutRequest, timeout); + } else if (isPromiseLike(timeout)) { + timeout.then(timeoutRequest); + } + + + function timeoutRequest() { + status = ABORTED; + jsonpDone && jsonpDone(); + xhr && xhr.abort(); + } + + function completeRequest(callback, status, response, headersString, statusText) { + // cancel timeout and subsequent timeout promise resolution + timeoutId && $browserDefer.cancel(timeoutId); + jsonpDone = xhr = null; + + // fix status code when it is 0 (0 status is undocumented). + // Occurs when accessing file resources or on Android 4.1 stock browser + // while retrieving files from application cache. + if (status === 0) { + status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0; + } + + // normalize IE bug (http://bugs.jquery.com/ticket/1450) + status = status === 1223 ? 204 : status; + statusText = statusText || ''; + + callback(status, response, headersString, statusText); + $browser.$$completeOutstandingRequest(noop); + } + }; + + function jsonpReq(url, callbackId, done) { + // we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.: + // - fetches local scripts via XHR and evals them + // - adds and immediately removes script elements from the document + var script = rawDocument.createElement('script'), callback = null; + script.type = "text/javascript"; + script.src = url; + script.async = true; + + callback = function(event) { + removeEventListenerFn(script, "load", callback); + removeEventListenerFn(script, "error", callback); + rawDocument.body.removeChild(script); + script = null; + var status = -1; + var text = "unknown"; + + if (event) { + if (event.type === "load" && !callbacks[callbackId].called) { + event = { type: "error" }; + } + text = event.type; + status = event.type === "error" ? 404 : 200; + } + + if (done) { + done(status, text); + } + }; + + addEventListenerFn(script, "load", callback); + addEventListenerFn(script, "error", callback); + + if (msie <= 8) { + script.onreadystatechange = function() { + if (isString(script.readyState) && /loaded|complete/.test(script.readyState)) { + script.onreadystatechange = null; + callback({ + type: 'load' + }); + } + }; + } + + rawDocument.body.appendChild(script); + return callback; + } +} + +var $interpolateMinErr = minErr('$interpolate'); + +/** + * @ngdoc provider + * @name $interpolateProvider + * @kind function + * + * @description + * + * Used for configuring the interpolation markup. Defaults to `{{` and `}}`. + * + * @example + + + +
+ //demo.label// +
+
+ + it('should interpolate binding with custom symbols', function() { + expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.'); + }); + +
+ */ +function $InterpolateProvider() { + var startSymbol = '{{'; + var endSymbol = '}}'; + + /** + * @ngdoc method + * @name $interpolateProvider#startSymbol + * @description + * Symbol to denote start of expression in the interpolated string. Defaults to `{{`. + * + * @param {string=} value new value to set the starting symbol to. + * @returns {string|self} Returns the symbol when used as getter and self if used as setter. + */ + this.startSymbol = function(value){ + if (value) { + startSymbol = value; + return this; + } else { + return startSymbol; + } + }; + + /** + * @ngdoc method + * @name $interpolateProvider#endSymbol + * @description + * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. + * + * @param {string=} value new value to set the ending symbol to. + * @returns {string|self} Returns the symbol when used as getter and self if used as setter. + */ + this.endSymbol = function(value){ + if (value) { + endSymbol = value; + return this; + } else { + return endSymbol; + } + }; + + + this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) { + var startSymbolLength = startSymbol.length, + endSymbolLength = endSymbol.length; + + /** + * @ngdoc service + * @name $interpolate + * @kind function + * + * @requires $parse + * @requires $sce + * + * @description + * + * Compiles a string with markup into an interpolation function. This service is used by the + * HTML {@link ng.$compile $compile} service for data binding. See + * {@link ng.$interpolateProvider $interpolateProvider} for configuring the + * interpolation markup. + * + * + * ```js + * var $interpolate = ...; // injected + * var exp = $interpolate('Hello {{name | uppercase}}!'); + * expect(exp({name:'Angular'}).toEqual('Hello ANGULAR!'); + * ``` + * + * + * @param {string} text The text with markup to interpolate. + * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have + * embedded expression in order to return an interpolation function. Strings with no + * embedded expression will return null for the interpolation function. + * @param {string=} trustedContext when provided, the returned function passes the interpolated + * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult, + * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that + * provides Strict Contextual Escaping for details. + * @returns {function(context)} an interpolation function which is used to compute the + * interpolated string. The function has these parameters: + * + * * `context`: an object against which any expressions embedded in the strings are evaluated + * against. + * + */ + function $interpolate(text, mustHaveExpression, trustedContext) { + var startIndex, + endIndex, + index = 0, + parts = [], + length = text.length, + hasInterpolation = false, + fn, + exp, + concat = []; + + while(index < length) { + if ( ((startIndex = text.indexOf(startSymbol, index)) != -1) && + ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1) ) { + (index != startIndex) && parts.push(text.substring(index, startIndex)); + parts.push(fn = $parse(exp = text.substring(startIndex + startSymbolLength, endIndex))); + fn.exp = exp; + index = endIndex + endSymbolLength; + hasInterpolation = true; + } else { + // we did not find anything, so we have to add the remainder to the parts array + (index != length) && parts.push(text.substring(index)); + index = length; + } + } + + if (!(length = parts.length)) { + // we added, nothing, must have been an empty string. + parts.push(''); + length = 1; + } + + // Concatenating expressions makes it hard to reason about whether some combination of + // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a + // single expression be used for iframe[src], object[src], etc., we ensure that the value + // that's used is assigned or constructed by some JS code somewhere that is more testable or + // make it obvious that you bound the value to some user controlled value. This helps reduce + // the load when auditing for XSS issues. + if (trustedContext && parts.length > 1) { + throw $interpolateMinErr('noconcat', + "Error while interpolating: {0}\nStrict Contextual Escaping disallows " + + "interpolations that concatenate multiple expressions when a trusted value is " + + "required. See http://docs.angularjs.org/api/ng.$sce", text); + } + + if (!mustHaveExpression || hasInterpolation) { + concat.length = length; + fn = function(context) { + try { + for(var i = 0, ii = length, part; i + * **Note**: Intervals created by this service must be explicitly destroyed when you are finished + * with them. In particular they are not automatically destroyed when a controller's scope or a + * directive's element are destroyed. + * You should take this into consideration and make sure to always cancel the interval at the + * appropriate moment. See the example below for more details on how and when to do this. + * + * + * @param {function()} fn A function that should be called repeatedly. + * @param {number} delay Number of milliseconds between each function call. + * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat + * indefinitely. + * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise + * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. + * @returns {promise} A promise which will be notified on each iteration. + * + * @example + * + * + * + * + *
+ *
+ * Date format:
+ * Current time is: + *
+ * Blood 1 : {{blood_1}} + * Blood 2 : {{blood_2}} + * + * + * + *
+ *
+ * + *
+ *
+ */ + function interval(fn, delay, count, invokeApply) { + var setInterval = $window.setInterval, + clearInterval = $window.clearInterval, + deferred = $q.defer(), + promise = deferred.promise, + iteration = 0, + skipApply = (isDefined(invokeApply) && !invokeApply); + + count = isDefined(count) ? count : 0; + + promise.then(null, null, fn); + + promise.$$intervalId = setInterval(function tick() { + deferred.notify(iteration++); + + if (count > 0 && iteration >= count) { + deferred.resolve(iteration); + clearInterval(promise.$$intervalId); + delete intervals[promise.$$intervalId]; + } + + if (!skipApply) $rootScope.$apply(); + + }, delay); + + intervals[promise.$$intervalId] = deferred; + + return promise; + } + + + /** + * @ngdoc method + * @name $interval#cancel + * + * @description + * Cancels a task associated with the `promise`. + * + * @param {promise} promise returned by the `$interval` function. + * @returns {boolean} Returns `true` if the task was successfully canceled. + */ + interval.cancel = function(promise) { + if (promise && promise.$$intervalId in intervals) { + intervals[promise.$$intervalId].reject('canceled'); + $window.clearInterval(promise.$$intervalId); + delete intervals[promise.$$intervalId]; + return true; + } + return false; + }; + + return interval; + }]; +} + +/** + * @ngdoc service + * @name $locale + * + * @description + * $locale service provides localization rules for various Angular components. As of right now the + * only public api is: + * + * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`) + */ +function $LocaleProvider(){ + this.$get = function() { + return { + id: 'en-us', + + NUMBER_FORMATS: { + DECIMAL_SEP: '.', + GROUP_SEP: ',', + PATTERNS: [ + { // Decimal Pattern + minInt: 1, + minFrac: 0, + maxFrac: 3, + posPre: '', + posSuf: '', + negPre: '-', + negSuf: '', + gSize: 3, + lgSize: 3 + },{ //Currency Pattern + minInt: 1, + minFrac: 2, + maxFrac: 2, + posPre: '\u00A4', + posSuf: '', + negPre: '(\u00A4', + negSuf: ')', + gSize: 3, + lgSize: 3 + } + ], + CURRENCY_SYM: '$' + }, + + DATETIME_FORMATS: { + MONTH: + 'January,February,March,April,May,June,July,August,September,October,November,December' + .split(','), + SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','), + DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','), + SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','), + AMPMS: ['AM','PM'], + medium: 'MMM d, y h:mm:ss a', + short: 'M/d/yy h:mm a', + fullDate: 'EEEE, MMMM d, y', + longDate: 'MMMM d, y', + mediumDate: 'MMM d, y', + shortDate: 'M/d/yy', + mediumTime: 'h:mm:ss a', + shortTime: 'h:mm a' + }, + + pluralCat: function(num) { + if (num === 1) { + return 'one'; + } + return 'other'; + } + }; + }; +} + +var PATH_MATCH = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/, + DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21}; +var $locationMinErr = minErr('$location'); + + +/** + * Encode path using encodeUriSegment, ignoring forward slashes + * + * @param {string} path Path to encode + * @returns {string} + */ +function encodePath(path) { + var segments = path.split('/'), + i = segments.length; + + while (i--) { + segments[i] = encodeUriSegment(segments[i]); + } + + return segments.join('/'); +} + +function parseAbsoluteUrl(absoluteUrl, locationObj, appBase) { + var parsedUrl = urlResolve(absoluteUrl, appBase); + + locationObj.$$protocol = parsedUrl.protocol; + locationObj.$$host = parsedUrl.hostname; + locationObj.$$port = int(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; +} + + +function parseAppUrl(relativeUrl, locationObj, appBase) { + var prefixed = (relativeUrl.charAt(0) !== '/'); + if (prefixed) { + relativeUrl = '/' + relativeUrl; + } + var match = urlResolve(relativeUrl, appBase); + locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ? + match.pathname.substring(1) : match.pathname); + locationObj.$$search = parseKeyValue(match.search); + locationObj.$$hash = decodeURIComponent(match.hash); + + // make sure path starts with '/'; + if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') { + locationObj.$$path = '/' + locationObj.$$path; + } +} + + +/** + * + * @param {string} begin + * @param {string} whole + * @returns {string} returns text from whole after begin or undefined if it does not begin with + * expected string. + */ +function beginsWith(begin, whole) { + if (whole.indexOf(begin) === 0) { + return whole.substr(begin.length); + } +} + + +function stripHash(url) { + var index = url.indexOf('#'); + return index == -1 ? url : url.substr(0, index); +} + + +function stripFile(url) { + return url.substr(0, stripHash(url).lastIndexOf('/') + 1); +} + +/* return the server only (scheme://host:port) */ +function serverBase(url) { + return url.substring(0, url.indexOf('/', url.indexOf('//') + 2)); +} + + +/** + * LocationHtml5Url represents an url + * This object is exposed as $location service when HTML5 mode is enabled and supported + * + * @constructor + * @param {string} appBase application base URL + * @param {string} basePrefix url path prefix + */ +function LocationHtml5Url(appBase, basePrefix) { + this.$$html5 = true; + basePrefix = basePrefix || ''; + var appBaseNoFile = stripFile(appBase); + parseAbsoluteUrl(appBase, this, appBase); + + + /** + * Parse given html5 (regular) url string into properties + * @param {string} newAbsoluteUrl HTML5 url + * @private + */ + this.$$parse = function(url) { + var pathUrl = beginsWith(appBaseNoFile, url); + if (!isString(pathUrl)) { + throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url, + appBaseNoFile); + } + + parseAppUrl(pathUrl, this, appBase); + + if (!this.$$path) { + this.$$path = '/'; + } + + this.$$compose(); + }; + + /** + * Compose url and update `absUrl` property + * @private + */ + this.$$compose = function() { + var search = toKeyValue(this.$$search), + hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; + + this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; + this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/' + }; + + this.$$rewrite = function(url) { + var appUrl, prevAppUrl; + + if ( (appUrl = beginsWith(appBase, url)) !== undefined ) { + prevAppUrl = appUrl; + if ( (appUrl = beginsWith(basePrefix, appUrl)) !== undefined ) { + return appBaseNoFile + (beginsWith('/', appUrl) || appUrl); + } else { + return appBase + prevAppUrl; + } + } else if ( (appUrl = beginsWith(appBaseNoFile, url)) !== undefined ) { + return appBaseNoFile + appUrl; + } else if (appBaseNoFile == url + '/') { + return appBaseNoFile; + } + }; +} + + +/** + * LocationHashbangUrl represents url + * This object is exposed as $location service when developer doesn't opt into html5 mode. + * It also serves as the base class for html5 mode fallback on legacy browsers. + * + * @constructor + * @param {string} appBase application base URL + * @param {string} hashPrefix hashbang prefix + */ +function LocationHashbangUrl(appBase, hashPrefix) { + var appBaseNoFile = stripFile(appBase); + + parseAbsoluteUrl(appBase, this, appBase); + + + /** + * Parse given hashbang url into properties + * @param {string} url Hashbang url + * @private + */ + this.$$parse = function(url) { + var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url); + var withoutHashUrl = withoutBaseUrl.charAt(0) == '#' + ? beginsWith(hashPrefix, withoutBaseUrl) + : (this.$$html5) + ? withoutBaseUrl + : ''; + + if (!isString(withoutHashUrl)) { + throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url, + hashPrefix); + } + parseAppUrl(withoutHashUrl, this, appBase); + + this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase); + + this.$$compose(); + + /* + * In Windows, on an anchor node on documents loaded from + * the filesystem, the browser will return a pathname + * prefixed with the drive name ('/C:/path') when a + * pathname without a drive is set: + * * a.setAttribute('href', '/foo') + * * a.pathname === '/C:/foo' //true + * + * Inside of Angular, we're always using pathnames that + * do not include drive names for routing. + */ + function removeWindowsDriveName (path, url, base) { + /* + Matches paths for file protocol on windows, + such as /C:/foo/bar, and captures only /foo/bar. + */ + var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; + + var firstPathSegmentMatch; + + //Get the relative path from the input URL. + if (url.indexOf(base) === 0) { + url = url.replace(base, ''); + } + + // The input URL intentionally contains a first path segment that ends with a colon. + if (windowsFilePathExp.exec(url)) { + return path; + } + + firstPathSegmentMatch = windowsFilePathExp.exec(path); + return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; + } + }; + + /** + * Compose hashbang url and update `absUrl` property + * @private + */ + this.$$compose = function() { + var search = toKeyValue(this.$$search), + hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; + + this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; + this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : ''); + }; + + this.$$rewrite = function(url) { + if(stripHash(appBase) == stripHash(url)) { + return url; + } + }; +} + + +/** + * LocationHashbangUrl represents url + * This object is exposed as $location service when html5 history api is enabled but the browser + * does not support it. + * + * @constructor + * @param {string} appBase application base URL + * @param {string} hashPrefix hashbang prefix + */ +function LocationHashbangInHtml5Url(appBase, hashPrefix) { + this.$$html5 = true; + LocationHashbangUrl.apply(this, arguments); + + var appBaseNoFile = stripFile(appBase); + + this.$$rewrite = function(url) { + var appUrl; + + if ( appBase == stripHash(url) ) { + return url; + } else if ( (appUrl = beginsWith(appBaseNoFile, url)) ) { + return appBase + hashPrefix + appUrl; + } else if ( appBaseNoFile === url + '/') { + return appBaseNoFile; + } + }; + + this.$$compose = function() { + var search = toKeyValue(this.$$search), + hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; + + this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; + // include hashPrefix in $$absUrl when $$url is empty so IE8 & 9 do not reload page because of removal of '#' + this.$$absUrl = appBase + hashPrefix + this.$$url; + }; + +} + + +LocationHashbangInHtml5Url.prototype = + LocationHashbangUrl.prototype = + LocationHtml5Url.prototype = { + + /** + * Are we in html5 mode? + * @private + */ + $$html5: false, + + /** + * Has any change been replacing ? + * @private + */ + $$replace: false, + + /** + * @ngdoc method + * @name $location#absUrl + * + * @description + * This method is getter only. + * + * Return full url representation with all segments encoded according to rules specified in + * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt). + * + * @return {string} full url + */ + absUrl: locationGetter('$$absUrl'), + + /** + * @ngdoc method + * @name $location#url + * + * @description + * This method is getter / setter. + * + * Return url (e.g. `/path?a=b#hash`) when called without any parameter. + * + * Change path, search and hash, when called with parameter and return `$location`. + * + * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`) + * @return {string} url + */ + url: function(url) { + if (isUndefined(url)) + return this.$$url; + + var match = PATH_MATCH.exec(url); + if (match[1]) this.path(decodeURIComponent(match[1])); + if (match[2] || match[1]) this.search(match[3] || ''); + this.hash(match[5] || ''); + + return this; + }, + + /** + * @ngdoc method + * @name $location#protocol + * + * @description + * This method is getter only. + * + * Return protocol of current url. + * + * @return {string} protocol of current url + */ + protocol: locationGetter('$$protocol'), + + /** + * @ngdoc method + * @name $location#host + * + * @description + * This method is getter only. + * + * Return host of current url. + * + * @return {string} host of current url. + */ + host: locationGetter('$$host'), + + /** + * @ngdoc method + * @name $location#port + * + * @description + * This method is getter only. + * + * Return port of current url. + * + * @return {Number} port + */ + port: locationGetter('$$port'), + + /** + * @ngdoc method + * @name $location#path + * + * @description + * This method is getter / setter. + * + * Return path of current url when called without any parameter. + * + * Change path when called with parameter and return `$location`. + * + * Note: Path should always begin with forward slash (/), this method will add the forward slash + * if it is missing. + * + * @param {(string|number)=} path New path + * @return {string} path + */ + path: locationGetterSetter('$$path', function(path) { + path = path ? path.toString() : ''; + return path.charAt(0) == '/' ? path : '/' + path; + }), + + /** + * @ngdoc method + * @name $location#search + * + * @description + * This method is getter / setter. + * + * Return search part (as object) of current url when called without any parameter. + * + * Change search part when called with parameter and return `$location`. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var searchObject = $location.search(); + * // => {foo: 'bar', baz: 'xoxo'} + * + * + * // set foo to 'yipee' + * $location.search('foo', 'yipee'); + * // => $location + * ``` + * + * @param {string|Object.|Object.>} search New search params - string or + * hash object. + * + * When called with a single argument the method acts as a setter, setting the `search` component + * of `$location` to the specified value. + * + * If the argument is a hash object containing an array of values, these values will be encoded + * as duplicate search parameters in the url. + * + * @param {(string|Number|Array|boolean)=} paramValue If `search` is a string or number, then `paramValue` + * will override only a single search property. + * + * If `paramValue` is an array, it will override the property of the `search` component of + * `$location` specified via the first argument. + * + * If `paramValue` is `null`, the property specified via the first argument will be deleted. + * + * If `paramValue` is `true`, the property specified via the first argument will be added with no + * value nor trailing equal sign. + * + * @return {Object} If called with no arguments returns the parsed `search` object. If called with + * one or more arguments returns `$location` object itself. + */ + search: function(search, paramValue) { + switch (arguments.length) { + case 0: + return this.$$search; + case 1: + if (isString(search) || isNumber(search)) { + search = search.toString(); + this.$$search = parseKeyValue(search); + } else if (isObject(search)) { + // remove object undefined or null properties + forEach(search, function(value, key) { + if (value == null) delete search[key]; + }); + + this.$$search = search; + } else { + throw $locationMinErr('isrcharg', + 'The first argument of the `$location#search()` call must be a string or an object.'); + } + break; + default: + if (isUndefined(paramValue) || paramValue === null) { + delete this.$$search[search]; + } else { + this.$$search[search] = paramValue; + } + } + + this.$$compose(); + return this; + }, + + /** + * @ngdoc method + * @name $location#hash + * + * @description + * This method is getter / setter. + * + * Return hash fragment when called without any parameter. + * + * Change hash fragment when called with parameter and return `$location`. + * + * @param {(string|number)=} hash New hash fragment + * @return {string} hash + */ + hash: locationGetterSetter('$$hash', function(hash) { + return hash ? hash.toString() : ''; + }), + + /** + * @ngdoc method + * @name $location#replace + * + * @description + * If called, all changes to $location during current `$digest` will be replacing current history + * record, instead of adding new one. + */ + replace: function() { + this.$$replace = true; + return this; + } +}; + +function locationGetter(property) { + return function() { + return this[property]; + }; +} + + +function locationGetterSetter(property, preprocess) { + return function(value) { + if (isUndefined(value)) + return this[property]; + + this[property] = preprocess(value); + this.$$compose(); + + return this; + }; +} + + +/** + * @ngdoc service + * @name $location + * + * @requires $rootElement + * + * @description + * The $location service parses the URL in the browser address bar (based on the + * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL + * available to your application. Changes to the URL in the address bar are reflected into + * $location service and changes to $location are reflected into the browser address bar. + * + * **The $location service:** + * + * - Exposes the current URL in the browser address bar, so you can + * - Watch and observe the URL. + * - Change the URL. + * - Synchronizes the URL with the browser when the user + * - Changes the address bar. + * - Clicks the back or forward button (or clicks a History link). + * - Clicks on a link. + * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash). + * + * For more information see {@link guide/$location Developer Guide: Using $location} + */ + +/** + * @ngdoc provider + * @name $locationProvider + * @description + * Use the `$locationProvider` to configure how the application deep linking paths are stored. + */ +function $LocationProvider(){ + var hashPrefix = '', + html5Mode = false; + + /** + * @ngdoc method + * @name $locationProvider#hashPrefix + * @description + * @param {string=} prefix Prefix for hash part (containing path and search) + * @returns {*} current value if used as getter or itself (chaining) if used as setter + */ + this.hashPrefix = function(prefix) { + if (isDefined(prefix)) { + hashPrefix = prefix; + return this; + } else { + return hashPrefix; + } + }; + + /** + * @ngdoc method + * @name $locationProvider#html5Mode + * @description + * @param {boolean=} mode Use HTML5 strategy if available. + * @returns {*} current value if used as getter or itself (chaining) if used as setter + */ + this.html5Mode = function(mode) { + if (isDefined(mode)) { + html5Mode = mode; + return this; + } else { + return html5Mode; + } + }; + + /** + * @ngdoc event + * @name $location#$locationChangeStart + * @eventType broadcast on root scope + * @description + * Broadcasted before a URL will change. This change can be prevented by calling + * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more + * details about event object. Upon successful change + * {@link ng.$location#events_$locationChangeSuccess $locationChangeSuccess} is fired. + * + * @param {Object} angularEvent Synthetic event object. + * @param {string} newUrl New URL + * @param {string=} oldUrl URL that was before it was changed. + */ + + /** + * @ngdoc event + * @name $location#$locationChangeSuccess + * @eventType broadcast on root scope + * @description + * Broadcasted after a URL was changed. + * + * @param {Object} angularEvent Synthetic event object. + * @param {string} newUrl New URL + * @param {string=} oldUrl URL that was before it was changed. + */ + + this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', + function( $rootScope, $browser, $sniffer, $rootElement) { + var $location, + LocationMode, + baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to '' + initialUrl = $browser.url(), + appBase; + + if (html5Mode) { + appBase = serverBase(initialUrl) + (baseHref || '/'); + LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url; + } else { + appBase = stripHash(initialUrl); + LocationMode = LocationHashbangUrl; + } + $location = new LocationMode(appBase, '#' + hashPrefix); + $location.$$parse($location.$$rewrite(initialUrl)); + + var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i; + + $rootElement.on('click', function(event) { + // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) + // currently we open nice url link and redirect then + + if (event.ctrlKey || event.metaKey || event.which == 2) return; + + var elm = jqLite(event.target); + + // traverse the DOM up to find first A tag + while (lowercase(elm[0].nodeName) !== 'a') { + // ignore rewriting if no A tag (reached root element, or no parent - removed from document) + if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return; + } + + var absHref = elm.prop('href'); + + if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') { + // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during + // an animation. + absHref = urlResolve(absHref.animVal).href; + } + + // Ignore when url is started with javascript: or mailto: + if (IGNORE_URI_REGEXP.test(absHref)) return; + + // Make relative links work in HTML5 mode for legacy browsers (or at least IE8 & 9) + // The href should be a regular url e.g. /link/somewhere or link/somewhere or ../somewhere or + // somewhere#anchor or http://example.com/somewhere + if (LocationMode === LocationHashbangInHtml5Url) { + // get the actual href attribute - see + // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx + var href = elm.attr('href') || elm.attr('xlink:href'); + + if (href && href.indexOf('://') < 0) { // Ignore absolute URLs + var prefix = '#' + hashPrefix; + if (href[0] == '/') { + // absolute path - replace old path + absHref = appBase + prefix + href; + } else if (href[0] == '#') { + // local anchor + absHref = appBase + prefix + ($location.path() || '/') + href; + } else { + // relative path - join with current path + var stack = $location.path().split("/"), + parts = href.split("/"); + if (stack.length === 2 && !stack[1]) stack.length = 1; + for (var i=0; i html5 url + if ($location.absUrl() != initialUrl) { + $browser.url($location.absUrl(), true); + } + + // update $location when $browser url changes + $browser.onUrlChange(function(newUrl) { + if ($location.absUrl() != newUrl) { + $rootScope.$evalAsync(function() { + var oldUrl = $location.absUrl(); + + $location.$$parse(newUrl); + if ($rootScope.$broadcast('$locationChangeStart', newUrl, + oldUrl).defaultPrevented) { + $location.$$parse(oldUrl); + $browser.url(oldUrl); + } else { + afterLocationChange(oldUrl); + } + }); + if (!$rootScope.$$phase) $rootScope.$digest(); + } + }); + + // update browser + var changeCounter = 0; + $rootScope.$watch(function $locationWatch() { + var oldUrl = $browser.url(); + var currentReplace = $location.$$replace; + + if (!changeCounter || oldUrl != $location.absUrl()) { + changeCounter++; + $rootScope.$evalAsync(function() { + if ($rootScope.$broadcast('$locationChangeStart', $location.absUrl(), oldUrl). + defaultPrevented) { + $location.$$parse(oldUrl); + } else { + $browser.url($location.absUrl(), currentReplace); + afterLocationChange(oldUrl); + } + }); + } + $location.$$replace = false; + + return changeCounter; + }); + + return $location; + + function afterLocationChange(oldUrl) { + $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl); + } +}]; +} + +/** + * @ngdoc service + * @name $log + * @requires $window + * + * @description + * Simple service for logging. Default implementation safely writes the message + * into the browser's console (if present). + * + * The main purpose of this service is to simplify debugging and troubleshooting. + * + * The default is to log `debug` messages. You can use + * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this. + * + * @example + + + angular.module('logExample', []) + .controller('LogController', ['$scope', '$log', function($scope, $log) { + $scope.$log = $log; + $scope.message = 'Hello World!'; + }]); + + +
+

Reload this page with open console, enter text and hit the log button...

+ Message: + + + + + +
+
+
+ */ + +/** + * @ngdoc provider + * @name $logProvider + * @description + * Use the `$logProvider` to configure how the application logs messages + */ +function $LogProvider(){ + var debug = true, + self = this; + + /** + * @ngdoc method + * @name $logProvider#debugEnabled + * @description + * @param {boolean=} flag enable or disable debug level messages + * @returns {*} current value if used as getter or itself (chaining) if used as setter + */ + this.debugEnabled = function(flag) { + if (isDefined(flag)) { + debug = flag; + return this; + } else { + return debug; + } + }; + + this.$get = ['$window', function($window){ + return { + /** + * @ngdoc method + * @name $log#log + * + * @description + * Write a log message + */ + log: consoleLog('log'), + + /** + * @ngdoc method + * @name $log#info + * + * @description + * Write an information message + */ + info: consoleLog('info'), + + /** + * @ngdoc method + * @name $log#warn + * + * @description + * Write a warning message + */ + warn: consoleLog('warn'), + + /** + * @ngdoc method + * @name $log#error + * + * @description + * Write an error message + */ + error: consoleLog('error'), + + /** + * @ngdoc method + * @name $log#debug + * + * @description + * Write a debug message + */ + debug: (function () { + var fn = consoleLog('debug'); + + return function() { + if (debug) { + fn.apply(self, arguments); + } + }; + }()) + }; + + function formatError(arg) { + if (arg instanceof Error) { + if (arg.stack) { + arg = (arg.message && arg.stack.indexOf(arg.message) === -1) + ? 'Error: ' + arg.message + '\n' + arg.stack + : arg.stack; + } else if (arg.sourceURL) { + arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line; + } + } + return arg; + } + + function consoleLog(type) { + var console = $window.console || {}, + logFn = console[type] || console.log || noop, + hasApply = false; + + // Note: reading logFn.apply throws an error in IE11 in IE8 document mode. + // The reason behind this is that console.log has type "object" in IE8... + try { + hasApply = !!logFn.apply; + } catch (e) {} + + if (hasApply) { + return function() { + var args = []; + forEach(arguments, function(arg) { + args.push(formatError(arg)); + }); + return logFn.apply(console, args); + }; + } + + // we are IE which either doesn't have window.console => this is noop and we do nothing, + // or we are IE where console.log doesn't have apply so we log at least first 2 args + return function(arg1, arg2) { + logFn(arg1, arg2 == null ? '' : arg2); + }; + } + }]; +} + +var $parseMinErr = minErr('$parse'); +var promiseWarningCache = {}; +var promiseWarning; + +// Sandboxing Angular Expressions +// ------------------------------ +// Angular expressions are generally considered safe because these expressions only have direct +// access to $scope and locals. However, one can obtain the ability to execute arbitrary JS code by +// obtaining a reference to native JS functions such as the Function constructor. +// +// As an example, consider the following Angular expression: +// +// {}.toString.constructor('alert("evil JS code")') +// +// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits +// against the expression language, but not to prevent exploits that were enabled by exposing +// sensitive JavaScript or browser apis on Scope. Exposing such objects on a Scope is never a good +// practice and therefore we are not even trying to protect against interaction with an object +// explicitly exposed in this way. +// +// In general, it is not possible to access a Window object from an angular expression unless a +// window or some DOM object that has a reference to window is published onto a Scope. +// Similarly we prevent invocations of function known to be dangerous, as well as assignments to +// native objects. + + +function ensureSafeMemberName(name, fullExpression) { + if (name === "__defineGetter__" || name === "__defineSetter__" + || name === "__lookupGetter__" || name === "__lookupSetter__" + || name === "__proto__") { + throw $parseMinErr('isecfld', + 'Attempting to access a disallowed field in Angular expressions! ' + +'Expression: {0}', fullExpression); + } + return name; +} + +function ensureSafeObject(obj, fullExpression) { + // nifty check if obj is Function that is fast and works across iframes and other contexts + if (obj) { + if (obj.constructor === obj) { + throw $parseMinErr('isecfn', + 'Referencing Function in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (// isWindow(obj) + obj.document && obj.location && obj.alert && obj.setInterval) { + throw $parseMinErr('isecwindow', + 'Referencing the Window in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (// isElement(obj) + obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) { + throw $parseMinErr('isecdom', + 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (// block Object so that we can't get hold of dangerous Object.* methods + obj === Object) { + throw $parseMinErr('isecobj', + 'Referencing Object in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } + } + return obj; +} + +var CALL = Function.prototype.call; +var APPLY = Function.prototype.apply; +var BIND = Function.prototype.bind; + +function ensureSafeFunction(obj, fullExpression) { + if (obj) { + if (obj.constructor === obj) { + throw $parseMinErr('isecfn', + 'Referencing Function in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (obj === CALL || obj === APPLY || (BIND && obj === BIND)) { + throw $parseMinErr('isecff', + 'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } + } +} + +var OPERATORS = { + /* jshint bitwise : false */ + 'null':function(){return null;}, + 'true':function(){return true;}, + 'false':function(){return false;}, + undefined:noop, + '+':function(self, locals, a,b){ + a=a(self, locals); b=b(self, locals); + if (isDefined(a)) { + if (isDefined(b)) { + return a + b; + } + return a; + } + return isDefined(b)?b:undefined;}, + '-':function(self, locals, a,b){ + a=a(self, locals); b=b(self, locals); + return (isDefined(a)?a:0)-(isDefined(b)?b:0); + }, + '*':function(self, locals, a,b){return a(self, locals)*b(self, locals);}, + '/':function(self, locals, a,b){return a(self, locals)/b(self, locals);}, + '%':function(self, locals, a,b){return a(self, locals)%b(self, locals);}, + '^':function(self, locals, a,b){return a(self, locals)^b(self, locals);}, + '=':noop, + '===':function(self, locals, a, b){return a(self, locals)===b(self, locals);}, + '!==':function(self, locals, a, b){return a(self, locals)!==b(self, locals);}, + '==':function(self, locals, a,b){return a(self, locals)==b(self, locals);}, + '!=':function(self, locals, a,b){return a(self, locals)!=b(self, locals);}, + '<':function(self, locals, a,b){return a(self, locals)':function(self, locals, a,b){return a(self, locals)>b(self, locals);}, + '<=':function(self, locals, a,b){return a(self, locals)<=b(self, locals);}, + '>=':function(self, locals, a,b){return a(self, locals)>=b(self, locals);}, + '&&':function(self, locals, a,b){return a(self, locals)&&b(self, locals);}, + '||':function(self, locals, a,b){return a(self, locals)||b(self, locals);}, + '&':function(self, locals, a,b){return a(self, locals)&b(self, locals);}, +// '|':function(self, locals, a,b){return a|b;}, + '|':function(self, locals, a,b){return b(self, locals)(self, locals, a(self, locals));}, + '!':function(self, locals, a){return !a(self, locals);} +}; +/* jshint bitwise: true */ +var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'}; + + +///////////////////////////////////////// + + +/** + * @constructor + */ +var Lexer = function (options) { + this.options = options; +}; + +Lexer.prototype = { + constructor: Lexer, + + lex: function (text) { + this.text = text; + + this.index = 0; + this.ch = undefined; + this.lastCh = ':'; // can start regexp + + this.tokens = []; + + while (this.index < this.text.length) { + this.ch = this.text.charAt(this.index); + if (this.is('"\'')) { + this.readString(this.ch); + } else if (this.isNumber(this.ch) || this.is('.') && this.isNumber(this.peek())) { + this.readNumber(); + } else if (this.isIdent(this.ch)) { + this.readIdent(); + } else if (this.is('(){}[].,;:?')) { + this.tokens.push({ + index: this.index, + text: this.ch + }); + this.index++; + } else if (this.isWhitespace(this.ch)) { + this.index++; + continue; + } else { + var ch2 = this.ch + this.peek(); + var ch3 = ch2 + this.peek(2); + var fn = OPERATORS[this.ch]; + var fn2 = OPERATORS[ch2]; + var fn3 = OPERATORS[ch3]; + if (fn3) { + this.tokens.push({index: this.index, text: ch3, fn: fn3}); + this.index += 3; + } else if (fn2) { + this.tokens.push({index: this.index, text: ch2, fn: fn2}); + this.index += 2; + } else if (fn) { + this.tokens.push({ + index: this.index, + text: this.ch, + fn: fn + }); + this.index += 1; + } else { + this.throwError('Unexpected next character ', this.index, this.index + 1); + } + } + this.lastCh = this.ch; + } + return this.tokens; + }, + + is: function(chars) { + return chars.indexOf(this.ch) !== -1; + }, + + was: function(chars) { + return chars.indexOf(this.lastCh) !== -1; + }, + + peek: function(i) { + var num = i || 1; + return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false; + }, + + isNumber: function(ch) { + return ('0' <= ch && ch <= '9'); + }, + + isWhitespace: function(ch) { + // IE treats non-breaking space as \u00A0 + return (ch === ' ' || ch === '\r' || ch === '\t' || + ch === '\n' || ch === '\v' || ch === '\u00A0'); + }, + + isIdent: function(ch) { + return ('a' <= ch && ch <= 'z' || + 'A' <= ch && ch <= 'Z' || + '_' === ch || ch === '$'); + }, + + isExpOperator: function(ch) { + return (ch === '-' || ch === '+' || this.isNumber(ch)); + }, + + throwError: function(error, start, end) { + end = end || this.index; + var colStr = (isDefined(start) + ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']' + : ' ' + end); + throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].', + error, colStr, this.text); + }, + + readNumber: function() { + var number = ''; + var start = this.index; + while (this.index < this.text.length) { + var ch = lowercase(this.text.charAt(this.index)); + if (ch == '.' || this.isNumber(ch)) { + number += ch; + } else { + var peekCh = this.peek(); + if (ch == 'e' && this.isExpOperator(peekCh)) { + number += ch; + } else if (this.isExpOperator(ch) && + peekCh && this.isNumber(peekCh) && + number.charAt(number.length - 1) == 'e') { + number += ch; + } else if (this.isExpOperator(ch) && + (!peekCh || !this.isNumber(peekCh)) && + number.charAt(number.length - 1) == 'e') { + this.throwError('Invalid exponent'); + } else { + break; + } + } + this.index++; + } + number = 1 * number; + this.tokens.push({ + index: start, + text: number, + literal: true, + constant: true, + fn: function() { return number; } + }); + }, + + readIdent: function() { + var parser = this; + + var ident = ''; + var start = this.index; + + var lastDot, peekIndex, methodName, ch; + + while (this.index < this.text.length) { + ch = this.text.charAt(this.index); + if (ch === '.' || this.isIdent(ch) || this.isNumber(ch)) { + if (ch === '.') lastDot = this.index; + ident += ch; + } else { + break; + } + this.index++; + } + + //check if this is not a method invocation and if it is back out to last dot + if (lastDot) { + peekIndex = this.index; + while (peekIndex < this.text.length) { + ch = this.text.charAt(peekIndex); + if (ch === '(') { + methodName = ident.substr(lastDot - start + 1); + ident = ident.substr(0, lastDot - start); + this.index = peekIndex; + break; + } + if (this.isWhitespace(ch)) { + peekIndex++; + } else { + break; + } + } + } + + + var token = { + index: start, + text: ident + }; + + // OPERATORS is our own object so we don't need to use special hasOwnPropertyFn + if (OPERATORS.hasOwnProperty(ident)) { + token.fn = OPERATORS[ident]; + token.literal = true; + token.constant = true; + } else { + var getter = getterFn(ident, this.options, this.text); + token.fn = extend(function(self, locals) { + return (getter(self, locals)); + }, { + assign: function(self, value) { + return setter(self, ident, value, parser.text, parser.options); + } + }); + } + + this.tokens.push(token); + + if (methodName) { + this.tokens.push({ + index:lastDot, + text: '.' + }); + this.tokens.push({ + index: lastDot + 1, + text: methodName + }); + } + }, + + readString: function(quote) { + var start = this.index; + this.index++; + var string = ''; + var rawString = quote; + var escape = false; + while (this.index < this.text.length) { + var ch = this.text.charAt(this.index); + rawString += ch; + if (escape) { + if (ch === 'u') { + var hex = this.text.substring(this.index + 1, this.index + 5); + if (!hex.match(/[\da-f]{4}/i)) + this.throwError('Invalid unicode escape [\\u' + hex + ']'); + this.index += 4; + string += String.fromCharCode(parseInt(hex, 16)); + } else { + var rep = ESCAPE[ch]; + string = string + (rep || ch); + } + escape = false; + } else if (ch === '\\') { + escape = true; + } else if (ch === quote) { + this.index++; + this.tokens.push({ + index: start, + text: rawString, + string: string, + literal: true, + constant: true, + fn: function() { return string; } + }); + return; + } else { + string += ch; + } + this.index++; + } + this.throwError('Unterminated quote', start); + } +}; + + +/** + * @constructor + */ +var Parser = function (lexer, $filter, options) { + this.lexer = lexer; + this.$filter = $filter; + this.options = options; +}; + +Parser.ZERO = extend(function () { + return 0; +}, { + constant: true +}); + +Parser.prototype = { + constructor: Parser, + + parse: function (text) { + this.text = text; + + this.tokens = this.lexer.lex(text); + + var value = this.statements(); + + if (this.tokens.length !== 0) { + this.throwError('is an unexpected token', this.tokens[0]); + } + + value.literal = !!value.literal; + value.constant = !!value.constant; + + return value; + }, + + primary: function () { + var primary; + if (this.expect('(')) { + primary = this.filterChain(); + this.consume(')'); + } else if (this.expect('[')) { + primary = this.arrayDeclaration(); + } else if (this.expect('{')) { + primary = this.object(); + } else { + var token = this.expect(); + primary = token.fn; + if (!primary) { + this.throwError('not a primary expression', token); + } + primary.literal = !!token.literal; + primary.constant = !!token.constant; + } + + var next, context; + while ((next = this.expect('(', '[', '.'))) { + if (next.text === '(') { + primary = this.functionCall(primary, context); + context = null; + } else if (next.text === '[') { + context = primary; + primary = this.objectIndex(primary); + } else if (next.text === '.') { + context = primary; + primary = this.fieldAccess(primary); + } else { + this.throwError('IMPOSSIBLE'); + } + } + return primary; + }, + + throwError: function(msg, token) { + throw $parseMinErr('syntax', + 'Syntax Error: Token \'{0}\' {1} at column {2} of the expression [{3}] starting at [{4}].', + token.text, msg, (token.index + 1), this.text, this.text.substring(token.index)); + }, + + peekToken: function() { + if (this.tokens.length === 0) + throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); + return this.tokens[0]; + }, + + peek: function(e1, e2, e3, e4) { + if (this.tokens.length > 0) { + var token = this.tokens[0]; + var t = token.text; + if (t === e1 || t === e2 || t === e3 || t === e4 || + (!e1 && !e2 && !e3 && !e4)) { + return token; + } + } + return false; + }, + + expect: function(e1, e2, e3, e4){ + var token = this.peek(e1, e2, e3, e4); + if (token) { + this.tokens.shift(); + return token; + } + return false; + }, + + consume: function(e1){ + if (!this.expect(e1)) { + this.throwError('is unexpected, expecting [' + e1 + ']', this.peek()); + } + }, + + unaryFn: function(fn, right) { + return extend(function(self, locals) { + return fn(self, locals, right); + }, { + constant:right.constant + }); + }, + + ternaryFn: function(left, middle, right){ + return extend(function(self, locals){ + return left(self, locals) ? middle(self, locals) : right(self, locals); + }, { + constant: left.constant && middle.constant && right.constant + }); + }, + + binaryFn: function(left, fn, right) { + return extend(function(self, locals) { + return fn(self, locals, left, right); + }, { + constant:left.constant && right.constant + }); + }, + + statements: function() { + var statements = []; + while (true) { + if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']')) + statements.push(this.filterChain()); + if (!this.expect(';')) { + // optimize for the common case where there is only one statement. + // TODO(size): maybe we should not support multiple statements? + return (statements.length === 1) + ? statements[0] + : function(self, locals) { + var value; + for (var i = 0; i < statements.length; i++) { + var statement = statements[i]; + if (statement) { + value = statement(self, locals); + } + } + return value; + }; + } + } + }, + + filterChain: function() { + var left = this.expression(); + var token; + while (true) { + if ((token = this.expect('|'))) { + left = this.binaryFn(left, token.fn, this.filter()); + } else { + return left; + } + } + }, + + filter: function() { + var token = this.expect(); + var fn = this.$filter(token.text); + var argsFn = []; + while (true) { + if ((token = this.expect(':'))) { + argsFn.push(this.expression()); + } else { + var fnInvoke = function(self, locals, input) { + var args = [input]; + for (var i = 0; i < argsFn.length; i++) { + args.push(argsFn[i](self, locals)); + } + return fn.apply(self, args); + }; + return function() { + return fnInvoke; + }; + } + } + }, + + expression: function() { + return this.assignment(); + }, + + assignment: function() { + var left = this.ternary(); + var right; + var token; + if ((token = this.expect('='))) { + if (!left.assign) { + this.throwError('implies assignment but [' + + this.text.substring(0, token.index) + '] can not be assigned to', token); + } + right = this.ternary(); + return function(scope, locals) { + return left.assign(scope, right(scope, locals), locals); + }; + } + return left; + }, + + ternary: function() { + var left = this.logicalOR(); + var middle; + var token; + if ((token = this.expect('?'))) { + middle = this.assignment(); + if ((token = this.expect(':'))) { + return this.ternaryFn(left, middle, this.assignment()); + } else { + this.throwError('expected :', token); + } + } else { + return left; + } + }, + + logicalOR: function() { + var left = this.logicalAND(); + var token; + while (true) { + if ((token = this.expect('||'))) { + left = this.binaryFn(left, token.fn, this.logicalAND()); + } else { + return left; + } + } + }, + + logicalAND: function() { + var left = this.equality(); + var token; + if ((token = this.expect('&&'))) { + left = this.binaryFn(left, token.fn, this.logicalAND()); + } + return left; + }, + + equality: function() { + var left = this.relational(); + var token; + if ((token = this.expect('==','!=','===','!=='))) { + left = this.binaryFn(left, token.fn, this.equality()); + } + return left; + }, + + relational: function() { + var left = this.additive(); + var token; + if ((token = this.expect('<', '>', '<=', '>='))) { + left = this.binaryFn(left, token.fn, this.relational()); + } + return left; + }, + + additive: function() { + var left = this.multiplicative(); + var token; + while ((token = this.expect('+','-'))) { + left = this.binaryFn(left, token.fn, this.multiplicative()); + } + return left; + }, + + multiplicative: function() { + var left = this.unary(); + var token; + while ((token = this.expect('*','/','%'))) { + left = this.binaryFn(left, token.fn, this.unary()); + } + return left; + }, + + unary: function() { + var token; + if (this.expect('+')) { + return this.primary(); + } else if ((token = this.expect('-'))) { + return this.binaryFn(Parser.ZERO, token.fn, this.unary()); + } else if ((token = this.expect('!'))) { + return this.unaryFn(token.fn, this.unary()); + } else { + return this.primary(); + } + }, + + fieldAccess: function(object) { + var parser = this; + var field = this.expect().text; + var getter = getterFn(field, this.options, this.text); + + return extend(function(scope, locals, self) { + return getter(self || object(scope, locals)); + }, { + assign: function(scope, value, locals) { + var o = object(scope, locals); + if (!o) object.assign(scope, o = {}); + return setter(o, field, value, parser.text, parser.options); + } + }); + }, + + objectIndex: function(obj) { + var parser = this; + + var indexFn = this.expression(); + this.consume(']'); + + return extend(function(self, locals) { + var o = obj(self, locals), + i = indexFn(self, locals), + v, p; + + ensureSafeMemberName(i, parser.text); + if (!o) return undefined; + v = ensureSafeObject(o[i], parser.text); + if (v && v.then && parser.options.unwrapPromises) { + p = v; + if (!('$$v' in v)) { + p.$$v = undefined; + p.then(function(val) { p.$$v = val; }); + } + v = v.$$v; + } + return v; + }, { + assign: function(self, value, locals) { + var key = ensureSafeMemberName(indexFn(self, locals), parser.text); + // prevent overwriting of Function.constructor which would break ensureSafeObject check + var o = ensureSafeObject(obj(self, locals), parser.text); + if (!o) obj.assign(self, o = {}); + return o[key] = value; + } + }); + }, + + functionCall: function(fn, contextGetter) { + var argsFn = []; + if (this.peekToken().text !== ')') { + do { + argsFn.push(this.expression()); + } while (this.expect(',')); + } + this.consume(')'); + + var parser = this; + + return function(scope, locals) { + var args = []; + var context = contextGetter ? contextGetter(scope, locals) : scope; + + for (var i = 0; i < argsFn.length; i++) { + args.push(ensureSafeObject(argsFn[i](scope, locals), parser.text)); + } + var fnPtr = fn(scope, locals, context) || noop; + + ensureSafeObject(context, parser.text); + ensureSafeFunction(fnPtr, parser.text); + + // IE stupidity! (IE doesn't have apply for some native functions) + var v = fnPtr.apply + ? fnPtr.apply(context, args) + : fnPtr(args[0], args[1], args[2], args[3], args[4]); + + return ensureSafeObject(v, parser.text); + }; + }, + + // This is used with json array declaration + arrayDeclaration: function () { + var elementFns = []; + var allConstant = true; + if (this.peekToken().text !== ']') { + do { + if (this.peek(']')) { + // Support trailing commas per ES5.1. + break; + } + var elementFn = this.expression(); + elementFns.push(elementFn); + if (!elementFn.constant) { + allConstant = false; + } + } while (this.expect(',')); + } + this.consume(']'); + + return extend(function(self, locals) { + var array = []; + for (var i = 0; i < elementFns.length; i++) { + array.push(elementFns[i](self, locals)); + } + return array; + }, { + literal: true, + constant: allConstant + }); + }, + + object: function () { + var keyValues = []; + var allConstant = true; + if (this.peekToken().text !== '}') { + do { + if (this.peek('}')) { + // Support trailing commas per ES5.1. + break; + } + var token = this.expect(), + key = token.string || token.text; + this.consume(':'); + var value = this.expression(); + keyValues.push({key: key, value: value}); + if (!value.constant) { + allConstant = false; + } + } while (this.expect(',')); + } + this.consume('}'); + + return extend(function(self, locals) { + var object = {}; + for (var i = 0; i < keyValues.length; i++) { + var keyValue = keyValues[i]; + object[keyValue.key] = keyValue.value(self, locals); + } + return object; + }, { + literal: true, + constant: allConstant + }); + } +}; + + +////////////////////////////////////////////////// +// Parser helper functions +////////////////////////////////////////////////// + +function setter(obj, path, setValue, fullExp, options) { + ensureSafeObject(obj, fullExp); + + //needed? + options = options || {}; + + var element = path.split('.'), key; + for (var i = 0; element.length > 1; i++) { + key = ensureSafeMemberName(element.shift(), fullExp); + var propertyObj = ensureSafeObject(obj[key], fullExp); + if (!propertyObj) { + propertyObj = {}; + obj[key] = propertyObj; + } + obj = propertyObj; + if (obj.then && options.unwrapPromises) { + promiseWarning(fullExp); + if (!("$$v" in obj)) { + (function(promise) { + promise.then(function(val) { promise.$$v = val; }); } + )(obj); + } + if (obj.$$v === undefined) { + obj.$$v = {}; + } + obj = obj.$$v; + } + } + key = ensureSafeMemberName(element.shift(), fullExp); + ensureSafeObject(obj[key], fullExp); + obj[key] = setValue; + return setValue; +} + +var getterFnCache = {}; + +/** + * Implementation of the "Black Hole" variant from: + * - http://jsperf.com/angularjs-parse-getter/4 + * - http://jsperf.com/path-evaluation-simplified/7 + */ +function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) { + ensureSafeMemberName(key0, fullExp); + ensureSafeMemberName(key1, fullExp); + ensureSafeMemberName(key2, fullExp); + ensureSafeMemberName(key3, fullExp); + ensureSafeMemberName(key4, fullExp); + + return !options.unwrapPromises + ? function cspSafeGetter(scope, locals) { + var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope; + + if (pathVal == null) return pathVal; + pathVal = pathVal[key0]; + + if (!key1) return pathVal; + if (pathVal == null) return undefined; + pathVal = pathVal[key1]; + + if (!key2) return pathVal; + if (pathVal == null) return undefined; + pathVal = pathVal[key2]; + + if (!key3) return pathVal; + if (pathVal == null) return undefined; + pathVal = pathVal[key3]; + + if (!key4) return pathVal; + if (pathVal == null) return undefined; + pathVal = pathVal[key4]; + + return pathVal; + } + : function cspSafePromiseEnabledGetter(scope, locals) { + var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope, + promise; + + if (pathVal == null) return pathVal; + + pathVal = pathVal[key0]; + if (pathVal && pathVal.then) { + promiseWarning(fullExp); + if (!("$$v" in pathVal)) { + promise = pathVal; + promise.$$v = undefined; + promise.then(function(val) { promise.$$v = val; }); + } + pathVal = pathVal.$$v; + } + + if (!key1) return pathVal; + if (pathVal == null) return undefined; + pathVal = pathVal[key1]; + if (pathVal && pathVal.then) { + promiseWarning(fullExp); + if (!("$$v" in pathVal)) { + promise = pathVal; + promise.$$v = undefined; + promise.then(function(val) { promise.$$v = val; }); + } + pathVal = pathVal.$$v; + } + + if (!key2) return pathVal; + if (pathVal == null) return undefined; + pathVal = pathVal[key2]; + if (pathVal && pathVal.then) { + promiseWarning(fullExp); + if (!("$$v" in pathVal)) { + promise = pathVal; + promise.$$v = undefined; + promise.then(function(val) { promise.$$v = val; }); + } + pathVal = pathVal.$$v; + } + + if (!key3) return pathVal; + if (pathVal == null) return undefined; + pathVal = pathVal[key3]; + if (pathVal && pathVal.then) { + promiseWarning(fullExp); + if (!("$$v" in pathVal)) { + promise = pathVal; + promise.$$v = undefined; + promise.then(function(val) { promise.$$v = val; }); + } + pathVal = pathVal.$$v; + } + + if (!key4) return pathVal; + if (pathVal == null) return undefined; + pathVal = pathVal[key4]; + if (pathVal && pathVal.then) { + promiseWarning(fullExp); + if (!("$$v" in pathVal)) { + promise = pathVal; + promise.$$v = undefined; + promise.then(function(val) { promise.$$v = val; }); + } + pathVal = pathVal.$$v; + } + return pathVal; + }; +} + +function getterFn(path, options, fullExp) { + // Check whether the cache has this getter already. + // We can use hasOwnProperty directly on the cache because we ensure, + // see below, that the cache never stores a path called 'hasOwnProperty' + if (getterFnCache.hasOwnProperty(path)) { + return getterFnCache[path]; + } + + var pathKeys = path.split('.'), + pathKeysLength = pathKeys.length, + fn; + + // http://jsperf.com/angularjs-parse-getter/6 + if (options.csp) { + if (pathKeysLength < 6) { + fn = cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4], fullExp, + options); + } else { + fn = function(scope, locals) { + var i = 0, val; + do { + val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++], + pathKeys[i++], fullExp, options)(scope, locals); + + locals = undefined; // clear after first iteration + scope = val; + } while (i < pathKeysLength); + return val; + }; + } + } else { + var code = 'var p;\n'; + forEach(pathKeys, function(key, index) { + ensureSafeMemberName(key, fullExp); + code += 'if(s == null) return undefined;\n' + + 's='+ (index + // we simply dereference 's' on any .dot notation + ? 's' + // but if we are first then we check locals first, and if so read it first + : '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '["' + key + '"]' + ';\n' + + (options.unwrapPromises + ? 'if (s && s.then) {\n' + + ' pw("' + fullExp.replace(/(["\r\n])/g, '\\$1') + '");\n' + + ' if (!("$$v" in s)) {\n' + + ' p=s;\n' + + ' p.$$v = undefined;\n' + + ' p.then(function(v) {p.$$v=v;});\n' + + '}\n' + + ' s=s.$$v\n' + + '}\n' + : ''); + }); + code += 'return s;'; + + /* jshint -W054 */ + var evaledFnGetter = new Function('s', 'k', 'pw', code); // s=scope, k=locals, pw=promiseWarning + /* jshint +W054 */ + evaledFnGetter.toString = valueFn(code); + fn = options.unwrapPromises ? function(scope, locals) { + return evaledFnGetter(scope, locals, promiseWarning); + } : evaledFnGetter; + } + + // Only cache the value if it's not going to mess up the cache object + // This is more performant that using Object.prototype.hasOwnProperty.call + if (path !== 'hasOwnProperty') { + getterFnCache[path] = fn; + } + return fn; +} + +/////////////////////////////////// + +/** + * @ngdoc service + * @name $parse + * @kind function + * + * @description + * + * Converts Angular {@link guide/expression expression} into a function. + * + * ```js + * var getter = $parse('user.name'); + * var setter = getter.assign; + * var context = {user:{name:'angular'}}; + * var locals = {user:{name:'local'}}; + * + * expect(getter(context)).toEqual('angular'); + * setter(context, 'newValue'); + * expect(context.user.name).toEqual('newValue'); + * expect(getter(context, locals)).toEqual('local'); + * ``` + * + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + * + * The returned function also has the following properties: + * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript + * literal. + * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript + * constant literals. + * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be + * set to a function to change its value on the given context. + * + */ + + +/** + * @ngdoc provider + * @name $parseProvider + * @kind function + * + * @description + * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse} + * service. + */ +function $ParseProvider() { + var cache = {}; + + var $parseOptions = { + csp: false, + unwrapPromises: false, + logPromiseWarnings: true + }; + + + /** + * @deprecated Promise unwrapping via $parse is deprecated and will be removed in the future. + * + * @ngdoc method + * @name $parseProvider#unwrapPromises + * @description + * + * **This feature is deprecated, see deprecation notes below for more info** + * + * If set to true (default is false), $parse will unwrap promises automatically when a promise is + * found at any part of the expression. In other words, if set to true, the expression will always + * result in a non-promise value. + * + * While the promise is unresolved, it's treated as undefined, but once resolved and fulfilled, + * the fulfillment value is used in place of the promise while evaluating the expression. + * + * **Deprecation notice** + * + * This is a feature that didn't prove to be wildly useful or popular, primarily because of the + * dichotomy between data access in templates (accessed as raw values) and controller code + * (accessed as promises). + * + * In most code we ended up resolving promises manually in controllers anyway and thus unifying + * the model access there. + * + * Other downsides of automatic promise unwrapping: + * + * - when building components it's often desirable to receive the raw promises + * - adds complexity and slows down expression evaluation + * - makes expression code pre-generation unattractive due to the amount of code that needs to be + * generated + * - makes IDE auto-completion and tool support hard + * + * **Warning Logs** + * + * If the unwrapping is enabled, Angular will log a warning about each expression that unwraps a + * promise (to reduce the noise, each expression is logged only once). To disable this logging use + * `$parseProvider.logPromiseWarnings(false)` api. + * + * + * @param {boolean=} value New value. + * @returns {boolean|self} Returns the current setting when used as getter and self if used as + * setter. + */ + this.unwrapPromises = function(value) { + if (isDefined(value)) { + $parseOptions.unwrapPromises = !!value; + return this; + } else { + return $parseOptions.unwrapPromises; + } + }; + + + /** + * @deprecated Promise unwrapping via $parse is deprecated and will be removed in the future. + * + * @ngdoc method + * @name $parseProvider#logPromiseWarnings + * @description + * + * Controls whether Angular should log a warning on any encounter of a promise in an expression. + * + * The default is set to `true`. + * + * This setting applies only if `$parseProvider.unwrapPromises` setting is set to true as well. + * + * @param {boolean=} value New value. + * @returns {boolean|self} Returns the current setting when used as getter and self if used as + * setter. + */ + this.logPromiseWarnings = function(value) { + if (isDefined(value)) { + $parseOptions.logPromiseWarnings = value; + return this; + } else { + return $parseOptions.logPromiseWarnings; + } + }; + + + this.$get = ['$filter', '$sniffer', '$log', function($filter, $sniffer, $log) { + $parseOptions.csp = $sniffer.csp; + + promiseWarning = function promiseWarningFn(fullExp) { + if (!$parseOptions.logPromiseWarnings || promiseWarningCache.hasOwnProperty(fullExp)) return; + promiseWarningCache[fullExp] = true; + $log.warn('[$parse] Promise found in the expression `' + fullExp + '`. ' + + 'Automatic unwrapping of promises in Angular expressions is deprecated.'); + }; + + return function(exp) { + var parsedExpression; + + switch (typeof exp) { + case 'string': + + if (cache.hasOwnProperty(exp)) { + return cache[exp]; + } + + var lexer = new Lexer($parseOptions); + var parser = new Parser(lexer, $filter, $parseOptions); + parsedExpression = parser.parse(exp); + + if (exp !== 'hasOwnProperty') { + // Only cache the value if it's not going to mess up the cache object + // This is more performant that using Object.prototype.hasOwnProperty.call + cache[exp] = parsedExpression; + } + + return parsedExpression; + + case 'function': + return exp; + + default: + return noop; + } + }; + }]; +} + +/** + * @ngdoc service + * @name $q + * @requires $rootScope + * + * @description + * A promise/deferred implementation inspired by [Kris Kowal's Q](https://github.com/kriskowal/q). + * + * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an + * interface for interacting with an object that represents the result of an action that is + * performed asynchronously, and may or may not be finished at any given point in time. + * + * From the perspective of dealing with error handling, deferred and promise APIs are to + * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming. + * + * ```js + * // for the purpose of this example let's assume that variables `$q`, `scope` and `okToGreet` + * // are available in the current lexical scope (they could have been injected or passed in). + * + * function asyncGreet(name) { + * var deferred = $q.defer(); + * + * setTimeout(function() { + * deferred.notify('About to greet ' + name + '.'); + * + * if (okToGreet(name)) { + * deferred.resolve('Hello, ' + name + '!'); + * } else { + * deferred.reject('Greeting ' + name + ' is not allowed.'); + * } + * }, 1000); + * + * return deferred.promise; + * } + * + * var promise = asyncGreet('Robin Hood'); + * promise.then(function(greeting) { + * alert('Success: ' + greeting); + * }, function(reason) { + * alert('Failed: ' + reason); + * }, function(update) { + * alert('Got notification: ' + update); + * }); + * ``` + * + * At first it might not be obvious why this extra complexity is worth the trouble. The payoff + * comes in the way of guarantees that promise and deferred APIs make, see + * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md. + * + * Additionally the promise api allows for composition that is very hard to do with the + * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach. + * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the + * section on serial or parallel joining of promises. + * + * + * # The Deferred API + * + * A new instance of deferred is constructed by calling `$q.defer()`. + * + * The purpose of the deferred object is to expose the associated Promise instance as well as APIs + * that can be used for signaling the successful or unsuccessful completion, as well as the status + * of the task. + * + * **Methods** + * + * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection + * constructed via `$q.reject`, the promise will be rejected instead. + * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to + * resolving it with a rejection constructed via `$q.reject`. + * - `notify(value)` - provides updates on the status of the promise's execution. This may be called + * multiple times before the promise is either resolved or rejected. + * + * **Properties** + * + * - promise – `{Promise}` – promise object associated with this deferred. + * + * + * # The Promise API + * + * A new promise instance is created when a deferred instance is created and can be retrieved by + * calling `deferred.promise`. + * + * The purpose of the promise object is to allow for interested parties to get access to the result + * of the deferred task when it completes. + * + * **Methods** + * + * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or + * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously + * as soon as the result is available. The callbacks are called with a single argument: the result + * or rejection reason. Additionally, the notify callback may be called zero or more times to + * provide a progress indication, before the promise is resolved or rejected. + * + * This method *returns a new promise* which is resolved or rejected via the return value of the + * `successCallback`, `errorCallback`. It also notifies via the return value of the + * `notifyCallback` method. The promise can not be resolved or rejected from the notifyCallback + * method. + * + * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)` + * + * - `finally(callback)` – allows you to observe either the fulfillment or rejection of a promise, + * but to do so without modifying the final value. This is useful to release resources or do some + * clean-up that needs to be done whether the promise was rejected or resolved. See the [full + * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for + * more information. + * + * Because `finally` is a reserved word in JavaScript and reserved keywords are not supported as + * property names by ES3, you'll need to invoke the method like `promise['finally'](callback)` to + * make your code IE8 and Android 2.x compatible. + * + * # Chaining promises + * + * Because calling the `then` method of a promise returns a new derived promise, it is easily + * possible to create a chain of promises: + * + * ```js + * promiseB = promiseA.then(function(result) { + * return result + 1; + * }); + * + * // promiseB will be resolved immediately after promiseA is resolved and its value + * // will be the result of promiseA incremented by 1 + * ``` + * + * It is possible to create chains of any length and since a promise can be resolved with another + * promise (which will defer its resolution further), it is possible to pause/defer resolution of + * the promises at any point in the chain. This makes it possible to implement powerful APIs like + * $http's response interceptors. + * + * + * # Differences between Kris Kowal's Q and $q + * + * There are two main differences: + * + * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation + * mechanism in angular, which means faster propagation of resolution or rejection into your + * models and avoiding unnecessary browser repaints, which would result in flickering UI. + * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains + * all the important functionality needed for common async tasks. + * + * # Testing + * + * ```js + * it('should simulate promise', inject(function($q, $rootScope) { + * var deferred = $q.defer(); + * var promise = deferred.promise; + * var resolvedValue; + * + * promise.then(function(value) { resolvedValue = value; }); + * expect(resolvedValue).toBeUndefined(); + * + * // Simulate resolving of promise + * deferred.resolve(123); + * // Note that the 'then' function does not get called synchronously. + * // This is because we want the promise API to always be async, whether or not + * // it got called synchronously or asynchronously. + * expect(resolvedValue).toBeUndefined(); + * + * // Propagate promise resolution to 'then' functions using $apply(). + * $rootScope.$apply(); + * expect(resolvedValue).toEqual(123); + * })); + * ``` + */ +function $QProvider() { + + this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) { + return qFactory(function(callback) { + $rootScope.$evalAsync(callback); + }, $exceptionHandler); + }]; +} + + +/** + * Constructs a promise manager. + * + * @param {function(Function)} nextTick Function for executing functions in the next turn. + * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for + * debugging purposes. + * @returns {object} Promise manager. + */ +function qFactory(nextTick, exceptionHandler) { + + /** + * @ngdoc method + * @name $q#defer + * @kind function + * + * @description + * Creates a `Deferred` object which represents a task which will finish in the future. + * + * @returns {Deferred} Returns a new instance of deferred. + */ + var defer = function() { + var pending = [], + value, deferred; + + deferred = { + + resolve: function(val) { + if (pending) { + var callbacks = pending; + pending = undefined; + value = ref(val); + + if (callbacks.length) { + nextTick(function() { + var callback; + for (var i = 0, ii = callbacks.length; i < ii; i++) { + callback = callbacks[i]; + value.then(callback[0], callback[1], callback[2]); + } + }); + } + } + }, + + + reject: function(reason) { + deferred.resolve(createInternalRejectedPromise(reason)); + }, + + + notify: function(progress) { + if (pending) { + var callbacks = pending; + + if (pending.length) { + nextTick(function() { + var callback; + for (var i = 0, ii = callbacks.length; i < ii; i++) { + callback = callbacks[i]; + callback[2](progress); + } + }); + } + } + }, + + + promise: { + then: function(callback, errback, progressback) { + var result = defer(); + + var wrappedCallback = function(value) { + try { + result.resolve((isFunction(callback) ? callback : defaultCallback)(value)); + } catch(e) { + result.reject(e); + exceptionHandler(e); + } + }; + + var wrappedErrback = function(reason) { + try { + result.resolve((isFunction(errback) ? errback : defaultErrback)(reason)); + } catch(e) { + result.reject(e); + exceptionHandler(e); + } + }; + + var wrappedProgressback = function(progress) { + try { + result.notify((isFunction(progressback) ? progressback : defaultCallback)(progress)); + } catch(e) { + exceptionHandler(e); + } + }; + + if (pending) { + pending.push([wrappedCallback, wrappedErrback, wrappedProgressback]); + } else { + value.then(wrappedCallback, wrappedErrback, wrappedProgressback); + } + + return result.promise; + }, + + "catch": function(callback) { + return this.then(null, callback); + }, + + "finally": function(callback) { + + function makePromise(value, resolved) { + var result = defer(); + if (resolved) { + result.resolve(value); + } else { + result.reject(value); + } + return result.promise; + } + + function handleCallback(value, isResolved) { + var callbackOutput = null; + try { + callbackOutput = (callback ||defaultCallback)(); + } catch(e) { + return makePromise(e, false); + } + if (isPromiseLike(callbackOutput)) { + return callbackOutput.then(function() { + return makePromise(value, isResolved); + }, function(error) { + return makePromise(error, false); + }); + } else { + return makePromise(value, isResolved); + } + } + + return this.then(function(value) { + return handleCallback(value, true); + }, function(error) { + return handleCallback(error, false); + }); + } + } + }; + + return deferred; + }; + + + var ref = function(value) { + if (isPromiseLike(value)) return value; + return { + then: function(callback) { + var result = defer(); + nextTick(function() { + result.resolve(callback(value)); + }); + return result.promise; + } + }; + }; + + + /** + * @ngdoc method + * @name $q#reject + * @kind function + * + * @description + * Creates a promise that is resolved as rejected with the specified `reason`. This api should be + * used to forward rejection in a chain of promises. If you are dealing with the last promise in + * a promise chain, you don't need to worry about it. + * + * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of + * `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via + * a promise error callback and you want to forward the error to the promise derived from the + * current promise, you have to "rethrow" the error by returning a rejection constructed via + * `reject`. + * + * ```js + * promiseB = promiseA.then(function(result) { + * // success: do something and resolve promiseB + * // with the old or a new result + * return result; + * }, function(reason) { + * // error: handle the error if possible and + * // resolve promiseB with newPromiseOrValue, + * // otherwise forward the rejection to promiseB + * if (canHandle(reason)) { + * // handle the error and recover + * return newPromiseOrValue; + * } + * return $q.reject(reason); + * }); + * ``` + * + * @param {*} reason Constant, message, exception or an object representing the rejection reason. + * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`. + */ + var reject = function(reason) { + var result = defer(); + result.reject(reason); + return result.promise; + }; + + var createInternalRejectedPromise = function(reason) { + return { + then: function(callback, errback) { + var result = defer(); + nextTick(function() { + try { + result.resolve((isFunction(errback) ? errback : defaultErrback)(reason)); + } catch(e) { + result.reject(e); + exceptionHandler(e); + } + }); + return result.promise; + } + }; + }; + + + /** + * @ngdoc method + * @name $q#when + * @kind function + * + * @description + * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. + * This is useful when you are dealing with an object that might or might not be a promise, or if + * the promise comes from a source that can't be trusted. + * + * @param {*} value Value or a promise + * @returns {Promise} Returns a promise of the passed value or promise + */ + var when = function(value, callback, errback, progressback) { + var result = defer(), + done; + + var wrappedCallback = function(value) { + try { + return (isFunction(callback) ? callback : defaultCallback)(value); + } catch (e) { + exceptionHandler(e); + return reject(e); + } + }; + + var wrappedErrback = function(reason) { + try { + return (isFunction(errback) ? errback : defaultErrback)(reason); + } catch (e) { + exceptionHandler(e); + return reject(e); + } + }; + + var wrappedProgressback = function(progress) { + try { + return (isFunction(progressback) ? progressback : defaultCallback)(progress); + } catch (e) { + exceptionHandler(e); + } + }; + + nextTick(function() { + ref(value).then(function(value) { + if (done) return; + done = true; + result.resolve(ref(value).then(wrappedCallback, wrappedErrback, wrappedProgressback)); + }, function(reason) { + if (done) return; + done = true; + result.resolve(wrappedErrback(reason)); + }, function(progress) { + if (done) return; + result.notify(wrappedProgressback(progress)); + }); + }); + + return result.promise; + }; + + + function defaultCallback(value) { + return value; + } + + + function defaultErrback(reason) { + return reject(reason); + } + + + /** + * @ngdoc method + * @name $q#all + * @kind function + * + * @description + * Combines multiple promises into a single promise that is resolved when all of the input + * promises are resolved. + * + * @param {Array.|Object.} promises An array or hash of promises. + * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values, + * each value corresponding to the promise at the same index/key in the `promises` array/hash. + * If any of the promises is resolved with a rejection, this resulting promise will be rejected + * with the same rejection value. + */ + function all(promises) { + var deferred = defer(), + counter = 0, + results = isArray(promises) ? [] : {}; + + forEach(promises, function(promise, key) { + counter++; + ref(promise).then(function(value) { + if (results.hasOwnProperty(key)) return; + results[key] = value; + if (!(--counter)) deferred.resolve(results); + }, function(reason) { + if (results.hasOwnProperty(key)) return; + deferred.reject(reason); + }); + }); + + if (counter === 0) { + deferred.resolve(results); + } + + return deferred.promise; + } + + return { + defer: defer, + reject: reject, + when: when, + all: all + }; +} + +function $$RAFProvider(){ //rAF + this.$get = ['$window', '$timeout', function($window, $timeout) { + var requestAnimationFrame = $window.requestAnimationFrame || + $window.webkitRequestAnimationFrame || + $window.mozRequestAnimationFrame; + + var cancelAnimationFrame = $window.cancelAnimationFrame || + $window.webkitCancelAnimationFrame || + $window.mozCancelAnimationFrame || + $window.webkitCancelRequestAnimationFrame; + + var rafSupported = !!requestAnimationFrame; + var raf = rafSupported + ? function(fn) { + var id = requestAnimationFrame(fn); + return function() { + cancelAnimationFrame(id); + }; + } + : function(fn) { + var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666 + return function() { + $timeout.cancel(timer); + }; + }; + + raf.supported = rafSupported; + + return raf; + }]; +} + +/** + * DESIGN NOTES + * + * The design decisions behind the scope are heavily favored for speed and memory consumption. + * + * The typical use of scope is to watch the expressions, which most of the time return the same + * value as last time so we optimize the operation. + * + * Closures construction is expensive in terms of speed as well as memory: + * - No closures, instead use prototypical inheritance for API + * - Internal state needs to be stored on scope directly, which means that private state is + * exposed as $$____ properties + * + * Loop operations are optimized by using while(count--) { ... } + * - this means that in order to keep the same order of execution as addition we have to add + * items to the array at the beginning (unshift) instead of at the end (push) + * + * Child scopes are created and removed often + * - Using an array would be slow since inserts in middle are expensive so we use linked list + * + * There are few watches then a lot of observers. This is why you don't want the observer to be + * implemented in the same way as watch. Watch requires return of initialization function which + * are expensive to construct. + */ + + +/** + * @ngdoc provider + * @name $rootScopeProvider + * @description + * + * Provider for the $rootScope service. + */ + +/** + * @ngdoc method + * @name $rootScopeProvider#digestTtl + * @description + * + * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and + * assuming that the model is unstable. + * + * The current default is 10 iterations. + * + * In complex applications it's possible that the dependencies between `$watch`s will result in + * several digest iterations. However if an application needs more than the default 10 digest + * iterations for its model to stabilize then you should investigate what is causing the model to + * continuously change during the digest. + * + * Increasing the TTL could have performance implications, so you should not change it without + * proper justification. + * + * @param {number} limit The number of digest iterations. + */ + + +/** + * @ngdoc service + * @name $rootScope + * @description + * + * Every application has a single root {@link ng.$rootScope.Scope scope}. + * All other scopes are descendant scopes of the root scope. Scopes provide separation + * between the model and the view, via a mechanism for watching the model for changes. + * They also provide an event emission/broadcast and subscription facility. See the + * {@link guide/scope developer guide on scopes}. + */ +function $RootScopeProvider(){ + var TTL = 10; + var $rootScopeMinErr = minErr('$rootScope'); + var lastDirtyWatch = null; + + this.digestTtl = function(value) { + if (arguments.length) { + TTL = value; + } + return TTL; + }; + + this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser', + function( $injector, $exceptionHandler, $parse, $browser) { + + /** + * @ngdoc type + * @name $rootScope.Scope + * + * @description + * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the + * {@link auto.$injector $injector}. Child scopes are created using the + * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when + * compiled HTML template is executed.) + * + * Here is a simple scope snippet to show how you can interact with the scope. + * ```html + * + * ``` + * + * # Inheritance + * A scope can inherit from a parent scope, as in this example: + * ```js + var parent = $rootScope; + var child = parent.$new(); + + parent.salutation = "Hello"; + child.name = "World"; + expect(child.salutation).toEqual('Hello'); + + child.salutation = "Welcome"; + expect(child.salutation).toEqual('Welcome'); + expect(parent.salutation).toEqual('Hello'); + * ``` + * + * + * @param {Object.=} providers Map of service factory which need to be + * provided for the current scope. Defaults to {@link ng}. + * @param {Object.=} instanceCache Provides pre-instantiated services which should + * append/override services provided by `providers`. This is handy + * when unit-testing and having the need to override a default + * service. + * @returns {Object} Newly created scope. + * + */ + function Scope() { + this.$id = nextUid(); + this.$$phase = this.$parent = this.$$watchers = + this.$$nextSibling = this.$$prevSibling = + this.$$childHead = this.$$childTail = null; + this['this'] = this.$root = this; + this.$$destroyed = false; + this.$$asyncQueue = []; + this.$$postDigestQueue = []; + this.$$listeners = {}; + this.$$listenerCount = {}; + this.$$isolateBindings = {}; + } + + /** + * @ngdoc property + * @name $rootScope.Scope#$id + * + * @description + * Unique scope ID (monotonically increasing) useful for debugging. + */ + + /** + * @ngdoc property + * @name $rootScope.Scope#$parent + * + * @description + * Reference to the parent scope. + */ + + /** + * @ngdoc property + * @name $rootScope.Scope#$root + * + * @description + * Reference to the root scope. + */ + + Scope.prototype = { + constructor: Scope, + /** + * @ngdoc method + * @name $rootScope.Scope#$new + * @kind function + * + * @description + * Creates a new child {@link ng.$rootScope.Scope scope}. + * + * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event. + * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}. + * + * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is + * desired for the scope and its child scopes to be permanently detached from the parent and + * thus stop participating in model change detection and listener notification by invoking. + * + * @param {boolean} isolate If true, then the scope does not prototypically inherit from the + * parent scope. The scope is isolated, as it can not see parent scope properties. + * When creating widgets, it is useful for the widget to not accidentally read parent + * state. + * + * @returns {Object} The newly created child scope. + * + */ + $new: function(isolate) { + var ChildScope, + child; + + if (isolate) { + child = new Scope(); + child.$root = this.$root; + // ensure that there is just one async queue per $rootScope and its children + child.$$asyncQueue = this.$$asyncQueue; + child.$$postDigestQueue = this.$$postDigestQueue; + } else { + // Only create a child scope class if somebody asks for one, + // but cache it to allow the VM to optimize lookups. + if (!this.$$childScopeClass) { + this.$$childScopeClass = function() { + this.$$watchers = this.$$nextSibling = + this.$$childHead = this.$$childTail = null; + this.$$listeners = {}; + this.$$listenerCount = {}; + this.$id = nextUid(); + this.$$childScopeClass = null; + }; + this.$$childScopeClass.prototype = this; + } + child = new this.$$childScopeClass(); + } + child['this'] = child; + child.$parent = this; + child.$$prevSibling = this.$$childTail; + if (this.$$childHead) { + this.$$childTail.$$nextSibling = child; + this.$$childTail = child; + } else { + this.$$childHead = this.$$childTail = child; + } + return child; + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$watch + * @kind function + * + * @description + * Registers a `listener` callback to be executed whenever the `watchExpression` changes. + * + * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest + * $digest()} and should return the value that will be watched. (Since + * {@link ng.$rootScope.Scope#$digest $digest()} reruns when it detects changes the + * `watchExpression` can execute multiple times per + * {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.) + * - The `listener` is called only when the value from the current `watchExpression` and the + * previous call to `watchExpression` are not equal (with the exception of the initial run, + * see below). Inequality is determined according to reference inequality, + * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators) + * via the `!==` Javascript operator, unless `objectEquality == true` + * (see next point) + * - When `objectEquality == true`, inequality of the `watchExpression` is determined + * according to the {@link angular.equals} function. To save the value of the object for + * later comparison, the {@link angular.copy} function is used. This therefore means that + * watching complex objects will have adverse memory and performance implications. + * - The watch `listener` may change the model, which may trigger other `listener`s to fire. + * This is achieved by rerunning the watchers until no changes are detected. The rerun + * iteration limit is 10 to prevent an infinite loop deadlock. + * + * + * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called, + * you can register a `watchExpression` function with no `listener`. (Since `watchExpression` + * can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a + * change is detected, be prepared for multiple calls to your listener.) + * + * After a watcher is registered with the scope, the `listener` fn is called asynchronously + * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the + * watcher. In rare cases, this is undesirable because the listener is called when the result + * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you + * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the + * listener was called due to initialization. + * + * The example below contains an illustration of using a function as your $watch listener + * + * + * # Example + * ```js + // let's assume that scope was dependency injected as the $rootScope + var scope = $rootScope; + scope.name = 'misko'; + scope.counter = 0; + + expect(scope.counter).toEqual(0); + scope.$watch('name', function(newValue, oldValue) { + scope.counter = scope.counter + 1; + }); + expect(scope.counter).toEqual(0); + + scope.$digest(); + // the listener is always called during the first $digest loop after it was registered + expect(scope.counter).toEqual(1); + + scope.$digest(); + // but now it will not be called unless the value changes + expect(scope.counter).toEqual(1); + + scope.name = 'adam'; + scope.$digest(); + expect(scope.counter).toEqual(2); + + + + // Using a listener function + var food; + scope.foodCounter = 0; + expect(scope.foodCounter).toEqual(0); + scope.$watch( + // This is the listener function + function() { return food; }, + // This is the change handler + function(newValue, oldValue) { + if ( newValue !== oldValue ) { + // Only increment the counter if the value changed + scope.foodCounter = scope.foodCounter + 1; + } + } + ); + // No digest has been run so the counter will be zero + expect(scope.foodCounter).toEqual(0); + + // Run the digest but since food has not changed count will still be zero + scope.$digest(); + expect(scope.foodCounter).toEqual(0); + + // Update food and run digest. Now the counter will increment + food = 'cheeseburger'; + scope.$digest(); + expect(scope.foodCounter).toEqual(1); + + * ``` + * + * + * + * @param {(function()|string)} watchExpression Expression that is evaluated on each + * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers + * a call to the `listener`. + * + * - `string`: Evaluated as {@link guide/expression expression} + * - `function(scope)`: called with current `scope` as a parameter. + * @param {(function()|string)=} listener Callback called whenever the return value of + * the `watchExpression` changes. + * + * - `string`: Evaluated as {@link guide/expression expression} + * - `function(newValue, oldValue, scope)`: called with current and previous values as + * parameters. + * + * @param {boolean=} objectEquality Compare for object equality using {@link angular.equals} instead of + * comparing for reference equality. + * @returns {function()} Returns a deregistration function for this listener. + */ + $watch: function(watchExp, listener, objectEquality) { + var scope = this, + get = compileToFn(watchExp, 'watch'), + array = scope.$$watchers, + watcher = { + fn: listener, + last: initWatchVal, + get: get, + exp: watchExp, + eq: !!objectEquality + }; + + lastDirtyWatch = null; + + // in the case user pass string, we need to compile it, do we really need this ? + if (!isFunction(listener)) { + var listenFn = compileToFn(listener || noop, 'listener'); + watcher.fn = function(newVal, oldVal, scope) {listenFn(scope);}; + } + + if (typeof watchExp == 'string' && get.constant) { + var originalFn = watcher.fn; + watcher.fn = function(newVal, oldVal, scope) { + originalFn.call(this, newVal, oldVal, scope); + arrayRemove(array, watcher); + }; + } + + if (!array) { + array = scope.$$watchers = []; + } + // we use unshift since we use a while loop in $digest for speed. + // the while loop reads in reverse order. + array.unshift(watcher); + + return function deregisterWatch() { + arrayRemove(array, watcher); + lastDirtyWatch = null; + }; + }, + + + /** + * @ngdoc method + * @name $rootScope.Scope#$watchCollection + * @kind function + * + * @description + * Shallow watches the properties of an object and fires whenever any of the properties change + * (for arrays, this implies watching the array items; for object maps, this implies watching + * the properties). If a change is detected, the `listener` callback is fired. + * + * - The `obj` collection is observed via standard $watch operation and is examined on every + * call to $digest() to see if any items have been added, removed, or moved. + * - The `listener` is called whenever anything within the `obj` has changed. Examples include + * adding, removing, and moving items belonging to an object or array. + * + * + * # Example + * ```js + $scope.names = ['igor', 'matias', 'misko', 'james']; + $scope.dataCount = 4; + + $scope.$watchCollection('names', function(newNames, oldNames) { + $scope.dataCount = newNames.length; + }); + + expect($scope.dataCount).toEqual(4); + $scope.$digest(); + + //still at 4 ... no changes + expect($scope.dataCount).toEqual(4); + + $scope.names.pop(); + $scope.$digest(); + + //now there's been a change + expect($scope.dataCount).toEqual(3); + * ``` + * + * + * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The + * expression value should evaluate to an object or an array which is observed on each + * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the + * collection will trigger a call to the `listener`. + * + * @param {function(newCollection, oldCollection, scope)} listener a callback function called + * when a change is detected. + * - The `newCollection` object is the newly modified data obtained from the `obj` expression + * - The `oldCollection` object is a copy of the former collection data. + * Due to performance considerations, the`oldCollection` value is computed only if the + * `listener` function declares two or more arguments. + * - The `scope` argument refers to the current scope. + * + * @returns {function()} Returns a de-registration function for this listener. When the + * de-registration function is executed, the internal watch operation is terminated. + */ + $watchCollection: function(obj, listener) { + var self = this; + // the current value, updated on each dirty-check run + var newValue; + // a shallow copy of the newValue from the last dirty-check run, + // updated to match newValue during dirty-check run + var oldValue; + // a shallow copy of the newValue from when the last change happened + var veryOldValue; + // only track veryOldValue if the listener is asking for it + var trackVeryOldValue = (listener.length > 1); + var changeDetected = 0; + var objGetter = $parse(obj); + var internalArray = []; + var internalObject = {}; + var initRun = true; + var oldLength = 0; + + function $watchCollectionWatch() { + newValue = objGetter(self); + var newLength, key, bothNaN; + + if (!isObject(newValue)) { // if primitive + if (oldValue !== newValue) { + oldValue = newValue; + changeDetected++; + } + } else if (isArrayLike(newValue)) { + if (oldValue !== internalArray) { + // we are transitioning from something which was not an array into array. + oldValue = internalArray; + oldLength = oldValue.length = 0; + changeDetected++; + } + + newLength = newValue.length; + + if (oldLength !== newLength) { + // if lengths do not match we need to trigger change notification + changeDetected++; + oldValue.length = oldLength = newLength; + } + // copy the items to oldValue and look for changes. + for (var i = 0; i < newLength; i++) { + bothNaN = (oldValue[i] !== oldValue[i]) && + (newValue[i] !== newValue[i]); + if (!bothNaN && (oldValue[i] !== newValue[i])) { + changeDetected++; + oldValue[i] = newValue[i]; + } + } + } else { + if (oldValue !== internalObject) { + // we are transitioning from something which was not an object into object. + oldValue = internalObject = {}; + oldLength = 0; + changeDetected++; + } + // copy the items to oldValue and look for changes. + newLength = 0; + for (key in newValue) { + if (newValue.hasOwnProperty(key)) { + newLength++; + if (oldValue.hasOwnProperty(key)) { + bothNaN = (oldValue[key] !== oldValue[key]) && + (newValue[key] !== newValue[key]); + if (!bothNaN && (oldValue[key] !== newValue[key])) { + changeDetected++; + oldValue[key] = newValue[key]; + } + } else { + oldLength++; + oldValue[key] = newValue[key]; + changeDetected++; + } + } + } + if (oldLength > newLength) { + // we used to have more keys, need to find them and destroy them. + changeDetected++; + for(key in oldValue) { + if (oldValue.hasOwnProperty(key) && !newValue.hasOwnProperty(key)) { + oldLength--; + delete oldValue[key]; + } + } + } + } + return changeDetected; + } + + function $watchCollectionAction() { + if (initRun) { + initRun = false; + listener(newValue, newValue, self); + } else { + listener(newValue, veryOldValue, self); + } + + // make a copy for the next time a collection is changed + if (trackVeryOldValue) { + if (!isObject(newValue)) { + //primitive + veryOldValue = newValue; + } else if (isArrayLike(newValue)) { + veryOldValue = new Array(newValue.length); + for (var i = 0; i < newValue.length; i++) { + veryOldValue[i] = newValue[i]; + } + } else { // if object + veryOldValue = {}; + for (var key in newValue) { + if (hasOwnProperty.call(newValue, key)) { + veryOldValue[key] = newValue[key]; + } + } + } + } + } + + return this.$watch($watchCollectionWatch, $watchCollectionAction); + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$digest + * @kind function + * + * @description + * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and + * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change + * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} + * until no more listeners are firing. This means that it is possible to get into an infinite + * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of + * iterations exceeds 10. + * + * Usually, you don't call `$digest()` directly in + * {@link ng.directive:ngController controllers} or in + * {@link ng.$compileProvider#directive directives}. + * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within + * a {@link ng.$compileProvider#directive directives}), which will force a `$digest()`. + * + * If you want to be notified whenever `$digest()` is called, + * you can register a `watchExpression` function with + * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`. + * + * In unit tests, you may need to call `$digest()` to simulate the scope life cycle. + * + * # Example + * ```js + var scope = ...; + scope.name = 'misko'; + scope.counter = 0; + + expect(scope.counter).toEqual(0); + scope.$watch('name', function(newValue, oldValue) { + scope.counter = scope.counter + 1; + }); + expect(scope.counter).toEqual(0); + + scope.$digest(); + // the listener is always called during the first $digest loop after it was registered + expect(scope.counter).toEqual(1); + + scope.$digest(); + // but now it will not be called unless the value changes + expect(scope.counter).toEqual(1); + + scope.name = 'adam'; + scope.$digest(); + expect(scope.counter).toEqual(2); + * ``` + * + */ + $digest: function() { + var watch, value, last, + watchers, + asyncQueue = this.$$asyncQueue, + postDigestQueue = this.$$postDigestQueue, + length, + dirty, ttl = TTL, + next, current, target = this, + watchLog = [], + logIdx, logMsg, asyncTask; + + beginPhase('$digest'); + // Check for changes to browser url that happened in sync before the call to $digest + $browser.$$checkUrlChange(); + + lastDirtyWatch = null; + + do { // "while dirty" loop + dirty = false; + current = target; + + while(asyncQueue.length) { + try { + asyncTask = asyncQueue.shift(); + asyncTask.scope.$eval(asyncTask.expression); + } catch (e) { + clearPhase(); + $exceptionHandler(e); + } + lastDirtyWatch = null; + } + + traverseScopesLoop: + do { // "traverse the scopes" loop + if ((watchers = current.$$watchers)) { + // process our watches + length = watchers.length; + while (length--) { + try { + watch = watchers[length]; + // Most common watches are on primitives, in which case we can short + // circuit it with === operator, only when === fails do we use .equals + if (watch) { + if ((value = watch.get(current)) !== (last = watch.last) && + !(watch.eq + ? equals(value, last) + : (typeof value === 'number' && typeof last === 'number' + && isNaN(value) && isNaN(last)))) { + dirty = true; + lastDirtyWatch = watch; + watch.last = watch.eq ? copy(value, null) : value; + watch.fn(value, ((last === initWatchVal) ? value : last), current); + if (ttl < 5) { + logIdx = 4 - ttl; + if (!watchLog[logIdx]) watchLog[logIdx] = []; + logMsg = (isFunction(watch.exp)) + ? 'fn: ' + (watch.exp.name || watch.exp.toString()) + : watch.exp; + logMsg += '; newVal: ' + toJson(value) + '; oldVal: ' + toJson(last); + watchLog[logIdx].push(logMsg); + } + } else if (watch === lastDirtyWatch) { + // If the most recently dirty watcher is now clean, short circuit since the remaining watchers + // have already been tested. + dirty = false; + break traverseScopesLoop; + } + } + } catch (e) { + clearPhase(); + $exceptionHandler(e); + } + } + } + + // Insanity Warning: scope depth-first traversal + // yes, this code is a bit crazy, but it works and we have tests to prove it! + // this piece should be kept in sync with the traversal in $broadcast + if (!(next = (current.$$childHead || + (current !== target && current.$$nextSibling)))) { + while(current !== target && !(next = current.$$nextSibling)) { + current = current.$parent; + } + } + } while ((current = next)); + + // `break traverseScopesLoop;` takes us to here + + if((dirty || asyncQueue.length) && !(ttl--)) { + clearPhase(); + throw $rootScopeMinErr('infdig', + '{0} $digest() iterations reached. Aborting!\n' + + 'Watchers fired in the last 5 iterations: {1}', + TTL, toJson(watchLog)); + } + + } while (dirty || asyncQueue.length); + + clearPhase(); + + while(postDigestQueue.length) { + try { + postDigestQueue.shift()(); + } catch (e) { + $exceptionHandler(e); + } + } + }, + + + /** + * @ngdoc event + * @name $rootScope.Scope#$destroy + * @eventType broadcast on scope being destroyed + * + * @description + * Broadcasted when a scope and its children are being destroyed. + * + * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to + * clean up DOM bindings before an element is removed from the DOM. + */ + + /** + * @ngdoc method + * @name $rootScope.Scope#$destroy + * @kind function + * + * @description + * Removes the current scope (and all of its children) from the parent scope. Removal implies + * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer + * propagate to the current scope and its children. Removal also implies that the current + * scope is eligible for garbage collection. + * + * The `$destroy()` is usually used by directives such as + * {@link ng.directive:ngRepeat ngRepeat} for managing the + * unrolling of the loop. + * + * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope. + * Application code can register a `$destroy` event handler that will give it a chance to + * perform any necessary cleanup. + * + * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to + * clean up DOM bindings before an element is removed from the DOM. + */ + $destroy: function() { + // we can't destroy the root scope or a scope that has been already destroyed + if (this.$$destroyed) return; + var parent = this.$parent; + + this.$broadcast('$destroy'); + this.$$destroyed = true; + if (this === $rootScope) return; + + forEach(this.$$listenerCount, bind(null, decrementListenerCount, this)); + + // sever all the references to parent scopes (after this cleanup, the current scope should + // not be retained by any of our references and should be eligible for garbage collection) + if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling; + if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling; + if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling; + if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling; + + + // All of the code below is bogus code that works around V8's memory leak via optimized code + // and inline caches. + // + // see: + // - https://code.google.com/p/v8/issues/detail?id=2073#c26 + // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909 + // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451 + + this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = + this.$$childTail = this.$root = null; + + // don't reset these to null in case some async task tries to register a listener/watch/task + this.$$listeners = {}; + this.$$watchers = this.$$asyncQueue = this.$$postDigestQueue = []; + + // prevent NPEs since these methods have references to properties we nulled out + this.$destroy = this.$digest = this.$apply = noop; + this.$on = this.$watch = function() { return noop; }; + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$eval + * @kind function + * + * @description + * Executes the `expression` on the current scope and returns the result. Any exceptions in + * the expression are propagated (uncaught). This is useful when evaluating Angular + * expressions. + * + * # Example + * ```js + var scope = ng.$rootScope.Scope(); + scope.a = 1; + scope.b = 2; + + expect(scope.$eval('a+b')).toEqual(3); + expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3); + * ``` + * + * @param {(string|function())=} expression An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with the current `scope` parameter. + * + * @param {(object)=} locals Local variables object, useful for overriding values in scope. + * @returns {*} The result of evaluating the expression. + */ + $eval: function(expr, locals) { + return $parse(expr)(this, locals); + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$evalAsync + * @kind function + * + * @description + * Executes the expression on the current scope at a later point in time. + * + * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only + * that: + * + * - it will execute after the function that scheduled the evaluation (preferably before DOM + * rendering). + * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after + * `expression` execution. + * + * Any exceptions from the execution of the expression are forwarded to the + * {@link ng.$exceptionHandler $exceptionHandler} service. + * + * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle + * will be scheduled. However, it is encouraged to always call code that changes the model + * from within an `$apply` call. That includes code evaluated via `$evalAsync`. + * + * @param {(string|function())=} expression An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with the current `scope` parameter. + * + */ + $evalAsync: function(expr) { + // if we are outside of an $digest loop and this is the first time we are scheduling async + // task also schedule async auto-flush + if (!$rootScope.$$phase && !$rootScope.$$asyncQueue.length) { + $browser.defer(function() { + if ($rootScope.$$asyncQueue.length) { + $rootScope.$digest(); + } + }); + } + + this.$$asyncQueue.push({scope: this, expression: expr}); + }, + + $$postDigest : function(fn) { + this.$$postDigestQueue.push(fn); + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$apply + * @kind function + * + * @description + * `$apply()` is used to execute an expression in angular from outside of the angular + * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries). + * Because we are calling into the angular framework we need to perform proper scope life + * cycle of {@link ng.$exceptionHandler exception handling}, + * {@link ng.$rootScope.Scope#$digest executing watches}. + * + * ## Life cycle + * + * # Pseudo-Code of `$apply()` + * ```js + function $apply(expr) { + try { + return $eval(expr); + } catch (e) { + $exceptionHandler(e); + } finally { + $root.$digest(); + } + } + * ``` + * + * + * Scope's `$apply()` method transitions through the following stages: + * + * 1. The {@link guide/expression expression} is executed using the + * {@link ng.$rootScope.Scope#$eval $eval()} method. + * 2. Any exceptions from the execution of the expression are forwarded to the + * {@link ng.$exceptionHandler $exceptionHandler} service. + * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the + * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method. + * + * + * @param {(string|function())=} exp An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with current `scope` parameter. + * + * @returns {*} The result of evaluating the expression. + */ + $apply: function(expr) { + try { + beginPhase('$apply'); + return this.$eval(expr); + } catch (e) { + $exceptionHandler(e); + } finally { + clearPhase(); + try { + $rootScope.$digest(); + } catch (e) { + $exceptionHandler(e); + throw e; + } + } + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$on + * @kind function + * + * @description + * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for + * discussion of event life cycle. + * + * The event listener function format is: `function(event, args...)`. The `event` object + * passed into the listener has the following attributes: + * + * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or + * `$broadcast`-ed. + * - `currentScope` - `{Scope}`: the current scope which is handling the event. + * - `name` - `{string}`: name of the event. + * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel + * further event propagation (available only for events that were `$emit`-ed). + * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag + * to true. + * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called. + * + * @param {string} name Event name to listen on. + * @param {function(event, ...args)} listener Function to call when the event is emitted. + * @returns {function()} Returns a deregistration function for this listener. + */ + $on: function(name, listener) { + var namedListeners = this.$$listeners[name]; + if (!namedListeners) { + this.$$listeners[name] = namedListeners = []; + } + namedListeners.push(listener); + + var current = this; + do { + if (!current.$$listenerCount[name]) { + current.$$listenerCount[name] = 0; + } + current.$$listenerCount[name]++; + } while ((current = current.$parent)); + + var self = this; + return function() { + namedListeners[indexOf(namedListeners, listener)] = null; + decrementListenerCount(self, 1, name); + }; + }, + + + /** + * @ngdoc method + * @name $rootScope.Scope#$emit + * @kind function + * + * @description + * Dispatches an event `name` upwards through the scope hierarchy notifying the + * registered {@link ng.$rootScope.Scope#$on} listeners. + * + * The event life cycle starts at the scope on which `$emit` was called. All + * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get + * notified. Afterwards, the event traverses upwards toward the root scope and calls all + * registered listeners along the way. The event will stop propagating if one of the listeners + * cancels it. + * + * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed + * onto the {@link ng.$exceptionHandler $exceptionHandler} service. + * + * @param {string} name Event name to emit. + * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. + * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}). + */ + $emit: function(name, args) { + var empty = [], + namedListeners, + scope = this, + stopPropagation = false, + event = { + name: name, + targetScope: scope, + stopPropagation: function() {stopPropagation = true;}, + preventDefault: function() { + event.defaultPrevented = true; + }, + defaultPrevented: false + }, + listenerArgs = concat([event], arguments, 1), + i, length; + + do { + namedListeners = scope.$$listeners[name] || empty; + event.currentScope = scope; + for (i=0, length=namedListeners.length; i= 8 ) { + normalizedVal = urlResolve(uri).href; + if (normalizedVal !== '' && !normalizedVal.match(regex)) { + return 'unsafe:'+normalizedVal; + } + } + return uri; + }; + }; +} + +var $sceMinErr = minErr('$sce'); + +var SCE_CONTEXTS = { + HTML: 'html', + CSS: 'css', + URL: 'url', + // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a + // url. (e.g. ng-include, script src, templateUrl) + RESOURCE_URL: 'resourceUrl', + JS: 'js' +}; + +// Helper functions follow. + +// Copied from: +// http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962 +// Prereq: s is a string. +function escapeForRegexp(s) { + return s.replace(/([-()\[\]{}+?*.$\^|,:# -1) { + throw $sceMinErr('iwcard', + 'Illegal sequence *** in string matcher. String: {0}', matcher); + } + matcher = escapeForRegexp(matcher). + replace('\\*\\*', '.*'). + replace('\\*', '[^:/.?&;]*'); + return new RegExp('^' + matcher + '$'); + } else if (isRegExp(matcher)) { + // The only other type of matcher allowed is a Regexp. + // Match entire URL / disallow partial matches. + // Flags are reset (i.e. no global, ignoreCase or multiline) + return new RegExp('^' + matcher.source + '$'); + } else { + throw $sceMinErr('imatcher', + 'Matchers may only be "self", string patterns or RegExp objects'); + } +} + + +function adjustMatchers(matchers) { + var adjustedMatchers = []; + if (isDefined(matchers)) { + forEach(matchers, function(matcher) { + adjustedMatchers.push(adjustMatcher(matcher)); + }); + } + return adjustedMatchers; +} + + +/** + * @ngdoc service + * @name $sceDelegate + * @kind function + * + * @description + * + * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict + * Contextual Escaping (SCE)} services to AngularJS. + * + * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of + * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is + * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to + * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things + * work because `$sce` delegates to `$sceDelegate` for these operations. + * + * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service. + * + * The default instance of `$sceDelegate` should work out of the box with little pain. While you + * can override it completely to change the behavior of `$sce`, the common case would + * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting + * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as + * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist + * $sceDelegateProvider.resourceUrlWhitelist} and {@link + * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} + */ + +/** + * @ngdoc provider + * @name $sceDelegateProvider + * @description + * + * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate + * $sceDelegate} service. This allows one to get/set the whitelists and blacklists used to ensure + * that the URLs used for sourcing Angular templates are safe. Refer {@link + * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and + * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} + * + * For the general details about this service in Angular, read the main page for {@link ng.$sce + * Strict Contextual Escaping (SCE)}. + * + * **Example**: Consider the following case. + * + * - your app is hosted at url `http://myapp.example.com/` + * - but some of your templates are hosted on other domains you control such as + * `http://srv01.assets.example.com/`,  `http://srv02.assets.example.com/`, etc. + * - and you have an open redirect at `http://myapp.example.com/clickThru?...`. + * + * Here is what a secure configuration for this scenario might look like: + * + * ``` + * angular.module('myApp', []).config(function($sceDelegateProvider) { + * $sceDelegateProvider.resourceUrlWhitelist([ + * // Allow same origin resource loads. + * 'self', + * // Allow loading from our assets domain. Notice the difference between * and **. + * 'http://srv*.assets.example.com/**' + * ]); + * + * // The blacklist overrides the whitelist so the open redirect here is blocked. + * $sceDelegateProvider.resourceUrlBlacklist([ + * 'http://myapp.example.com/clickThru**' + * ]); + * }); + * ``` + */ + +function $SceDelegateProvider() { + this.SCE_CONTEXTS = SCE_CONTEXTS; + + // Resource URLs can also be trusted by policy. + var resourceUrlWhitelist = ['self'], + resourceUrlBlacklist = []; + + /** + * @ngdoc method + * @name $sceDelegateProvider#resourceUrlWhitelist + * @kind function + * + * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value + * provided. This must be an array or null. A snapshot of this array is used so further + * changes to the array are ignored. + * + * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items + * allowed in this array. + * + * Note: **an empty whitelist array will block all URLs**! + * + * @return {Array} the currently set whitelist array. + * + * The **default value** when no whitelist has been explicitly set is `['self']` allowing only + * same origin resource requests. + * + * @description + * Sets/Gets the whitelist of trusted resource URLs. + */ + this.resourceUrlWhitelist = function (value) { + if (arguments.length) { + resourceUrlWhitelist = adjustMatchers(value); + } + return resourceUrlWhitelist; + }; + + /** + * @ngdoc method + * @name $sceDelegateProvider#resourceUrlBlacklist + * @kind function + * + * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value + * provided. This must be an array or null. A snapshot of this array is used so further + * changes to the array are ignored. + * + * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items + * allowed in this array. + * + * The typical usage for the blacklist is to **block + * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as + * these would otherwise be trusted but actually return content from the redirected domain. + * + * Finally, **the blacklist overrides the whitelist** and has the final say. + * + * @return {Array} the currently set blacklist array. + * + * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there + * is no blacklist.) + * + * @description + * Sets/Gets the blacklist of trusted resource URLs. + */ + + this.resourceUrlBlacklist = function (value) { + if (arguments.length) { + resourceUrlBlacklist = adjustMatchers(value); + } + return resourceUrlBlacklist; + }; + + this.$get = ['$injector', function($injector) { + + var htmlSanitizer = function htmlSanitizer(html) { + throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); + }; + + if ($injector.has('$sanitize')) { + htmlSanitizer = $injector.get('$sanitize'); + } + + + function matchUrl(matcher, parsedUrl) { + if (matcher === 'self') { + return urlIsSameOrigin(parsedUrl); + } else { + // definitely a regex. See adjustMatchers() + return !!matcher.exec(parsedUrl.href); + } + } + + function isResourceUrlAllowedByPolicy(url) { + var parsedUrl = urlResolve(url.toString()); + var i, n, allowed = false; + // Ensure that at least one item from the whitelist allows this url. + for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) { + if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) { + allowed = true; + break; + } + } + if (allowed) { + // Ensure that no item from the blacklist blocked this url. + for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) { + if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) { + allowed = false; + break; + } + } + } + return allowed; + } + + function generateHolderType(Base) { + var holderType = function TrustedValueHolderType(trustedValue) { + this.$$unwrapTrustedValue = function() { + return trustedValue; + }; + }; + if (Base) { + holderType.prototype = new Base(); + } + holderType.prototype.valueOf = function sceValueOf() { + return this.$$unwrapTrustedValue(); + }; + holderType.prototype.toString = function sceToString() { + return this.$$unwrapTrustedValue().toString(); + }; + return holderType; + } + + var trustedValueHolderBase = generateHolderType(), + byType = {}; + + byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]); + + /** + * @ngdoc method + * @name $sceDelegate#trustAs + * + * @description + * Returns an object that is trusted by angular for use in specified strict + * contextual escaping contexts (such as ng-bind-html, ng-include, any src + * attribute interpolation, any dom event binding attribute interpolation + * such as for onclick, etc.) that uses the provided value. + * See {@link ng.$sce $sce} for enabling strict contextual escaping. + * + * @param {string} type The kind of context in which this value is safe for use. e.g. url, + * resourceUrl, html, js and css. + * @param {*} value The value that that should be considered trusted/safe. + * @returns {*} A value that can be used to stand in for the provided `value` in places + * where Angular expects a $sce.trustAs() return value. + */ + function trustAs(type, trustedValue) { + var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null); + if (!Constructor) { + throw $sceMinErr('icontext', + 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}', + type, trustedValue); + } + if (trustedValue === null || trustedValue === undefined || trustedValue === '') { + return trustedValue; + } + // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting + // mutable objects, we ensure here that the value passed in is actually a string. + if (typeof trustedValue !== 'string') { + throw $sceMinErr('itype', + 'Attempted to trust a non-string value in a content requiring a string: Context: {0}', + type); + } + return new Constructor(trustedValue); + } + + /** + * @ngdoc method + * @name $sceDelegate#valueOf + * + * @description + * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link + * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. + * + * If the passed parameter is not a value that had been returned by {@link + * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is. + * + * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} + * call or anything else. + * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns + * `value` unchanged. + */ + function valueOf(maybeTrusted) { + if (maybeTrusted instanceof trustedValueHolderBase) { + return maybeTrusted.$$unwrapTrustedValue(); + } else { + return maybeTrusted; + } + } + + /** + * @ngdoc method + * @name $sceDelegate#getTrusted + * + * @description + * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and + * returns the originally supplied value if the queried context type is a supertype of the + * created type. If this condition isn't satisfied, throws an exception. + * + * @param {string} type The kind of context in which this value is to be used. + * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`} call. + * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`} if valid in this context. Otherwise, throws an exception. + */ + function getTrusted(type, maybeTrusted) { + if (maybeTrusted === null || maybeTrusted === undefined || maybeTrusted === '') { + return maybeTrusted; + } + var constructor = (byType.hasOwnProperty(type) ? byType[type] : null); + if (constructor && maybeTrusted instanceof constructor) { + return maybeTrusted.$$unwrapTrustedValue(); + } + // If we get here, then we may only take one of two actions. + // 1. sanitize the value for the requested type, or + // 2. throw an exception. + if (type === SCE_CONTEXTS.RESOURCE_URL) { + if (isResourceUrlAllowedByPolicy(maybeTrusted)) { + return maybeTrusted; + } else { + throw $sceMinErr('insecurl', + 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}', + maybeTrusted.toString()); + } + } else if (type === SCE_CONTEXTS.HTML) { + return htmlSanitizer(maybeTrusted); + } + throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); + } + + return { trustAs: trustAs, + getTrusted: getTrusted, + valueOf: valueOf }; + }]; +} + + +/** + * @ngdoc provider + * @name $sceProvider + * @description + * + * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service. + * - enable/disable Strict Contextual Escaping (SCE) in a module + * - override the default implementation with a custom delegate + * + * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}. + */ + +/* jshint maxlen: false*/ + +/** + * @ngdoc service + * @name $sce + * @kind function + * + * @description + * + * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS. + * + * # Strict Contextual Escaping + * + * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain + * contexts to result in a value that is marked as safe to use for that context. One example of + * such a context is binding arbitrary html controlled by the user via `ng-bind-html`. We refer + * to these contexts as privileged or SCE contexts. + * + * As of version 1.2, Angular ships with SCE enabled by default. + * + * Note: When enabled (the default), IE8 in quirks mode is not supported. In this mode, IE8 allows + * one to execute arbitrary javascript by the use of the expression() syntax. Refer + * to learn more about them. + * You can ensure your document is in standards mode and not quirks mode by adding `` + * to the top of your HTML document. + * + * SCE assists in writing code in way that (a) is secure by default and (b) makes auditing for + * security vulnerabilities such as XSS, clickjacking, etc. a lot easier. + * + * Here's an example of a binding in a privileged context: + * + * ``` + * + *
+ * ``` + * + * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE + * disabled, this application allows the user to render arbitrary HTML into the DIV. + * In a more realistic example, one may be rendering user comments, blog articles, etc. via + * bindings. (HTML is just one example of a context where rendering user controlled input creates + * security vulnerabilities.) + * + * For the case of HTML, you might use a library, either on the client side, or on the server side, + * to sanitize unsafe HTML before binding to the value and rendering it in the document. + * + * How would you ensure that every place that used these types of bindings was bound to a value that + * was sanitized by your library (or returned as safe for rendering by your server?) How can you + * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some + * properties/fields and forgot to update the binding to the sanitized value? + * + * To be secure by default, you want to ensure that any such bindings are disallowed unless you can + * determine that something explicitly says it's safe to use a value for binding in that + * context. You can then audit your code (a simple grep would do) to ensure that this is only done + * for those values that you can easily tell are safe - because they were received from your server, + * sanitized by your library, etc. You can organize your codebase to help with this - perhaps + * allowing only the files in a specific directory to do this. Ensuring that the internal API + * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task. + * + * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs} + * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to + * obtain values that will be accepted by SCE / privileged contexts. + * + * + * ## How does it work? + * + * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted + * $sce.getTrusted(context, value)} rather than to the value directly. Directives use {@link + * ng.$sce#parse $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the + * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals. + * + * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link + * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly + * simplified): + * + * ``` + * var ngBindHtmlDirective = ['$sce', function($sce) { + * return function(scope, element, attr) { + * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) { + * element.html(value || ''); + * }); + * }; + * }]; + * ``` + * + * ## Impact on loading templates + * + * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as + * `templateUrl`'s specified by {@link guide/directive directives}. + * + * By default, Angular only loads templates from the same domain and protocol as the application + * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl + * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or + * protocols, you may either either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist + * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value. + * + * *Please note*: + * The browser's + * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest) + * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/) + * policy apply in addition to this and may further restrict whether the template is successfully + * loaded. This means that without the right CORS policy, loading templates from a different domain + * won't work on all browsers. Also, loading templates from `file://` URL does not work on some + * browsers. + * + * ## This feels like too much overhead for the developer? + * + * It's important to remember that SCE only applies to interpolation expressions. + * + * If your expressions are constant literals, they're automatically trusted and you don't need to + * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g. + * `
`) just works. + * + * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them + * through {@link ng.$sce#getTrusted $sce.getTrusted}. SCE doesn't play a role here. + * + * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load + * templates in `ng-include` from your application's domain without having to even know about SCE. + * It blocks loading templates from other domains or loading templates over http from an https + * served document. You can change these by setting your own custom {@link + * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link + * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs. + * + * This significantly reduces the overhead. It is far easier to pay the small overhead and have an + * application that's secure and can be audited to verify that with much more ease than bolting + * security onto an application later. + * + * + * ## What trusted context types are supported? + * + * | Context | Notes | + * |---------------------|----------------| + * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. | + * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. | + * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`
Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. | + * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. | + * + * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist}
+ * + * Each element in these arrays must be one of the following: + * + * - **'self'** + * - The special **string**, `'self'`, can be used to match against all URLs of the **same + * domain** as the application document using the **same protocol**. + * - **String** (except the special value `'self'`) + * - The string is matched against the full *normalized / absolute URL* of the resource + * being tested (substring matches are not good enough.) + * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters + * match themselves. + * - `*`: matches zero or more occurrences of any character other than one of the following 6 + * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and ';'. It's a useful wildcard for use + * in a whitelist. + * - `**`: matches zero or more occurrences of *any* character. As such, it's not + * not appropriate to use in for a scheme, domain, etc. as it would match too much. (e.g. + * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might + * not have been the intention.) Its usage at the very end of the path is ok. (e.g. + * http://foo.example.com/templates/**). + * - **RegExp** (*see caveat below*) + * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax + * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to + * accidentally introduce a bug when one updates a complex expression (imho, all regexes should + * have good test coverage.). For instance, the use of `.` in the regex is correct only in a + * small number of cases. A `.` character in the regex used when matching the scheme or a + * subdomain could be matched against a `:` or literal `.` that was likely not intended. It + * is highly recommended to use the string patterns and only fall back to regular expressions + * if they as a last resort. + * - The regular expression must be an instance of RegExp (i.e. not a string.) It is + * matched against the **entire** *normalized / absolute URL* of the resource being tested + * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags + * present on the RegExp (such as multiline, global, ignoreCase) are ignored. + * - If you are generating your JavaScript from some other templating engine (not + * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)), + * remember to escape your regular expression (and be aware that you might need more than + * one level of escaping depending on your templating engine and the way you interpolated + * the value.) Do make use of your platform's escaping mechanism as it might be good + * enough before coding your own. e.g. Ruby has + * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape) + * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape). + * Javascript lacks a similar built in function for escaping. Take a look at Google + * Closure library's [goog.string.regExpEscape(s)]( + * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962). + * + * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example. + * + * ## Show me an example using SCE. + * + * + * + *
+ *

+ * User comments
+ * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when + * $sanitize is available. If $sanitize isn't available, this results in an error instead of an + * exploit. + *
+ *
+ * {{userComment.name}}: + * + *
+ *
+ *
+ *
+ *
+ * + * + * var mySceApp = angular.module('mySceApp', ['ngSanitize']); + * + * mySceApp.controller("myAppController", function myAppController($http, $templateCache, $sce) { + * var self = this; + * $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) { + * self.userComments = userComments; + * }); + * self.explicitlyTrustedHtml = $sce.trustAsHtml( + * 'Hover over this text.'); + * }); + * + * + * + * [ + * { "name": "Alice", + * "htmlComment": + * "Is anyone reading this?" + * }, + * { "name": "Bob", + * "htmlComment": "Yes! Am I the only other one?" + * } + * ] + * + * + * + * describe('SCE doc demo', function() { + * it('should sanitize untrusted values', function() { + * expect(element.all(by.css('.htmlComment')).first().getInnerHtml()) + * .toBe('Is anyone reading this?'); + * }); + * + * it('should NOT sanitize explicitly trusted values', function() { + * expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe( + * 'Hover over this text.'); + * }); + * }); + * + *
+ * + * + * + * ## Can I disable SCE completely? + * + * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits + * for little coding overhead. It will be much harder to take an SCE disabled application and + * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE + * for cases where you have a lot of existing code that was written before SCE was introduced and + * you're migrating them a module at a time. + * + * That said, here's how you can completely disable SCE: + * + * ``` + * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) { + * // Completely disable SCE. For demonstration purposes only! + * // Do not use in new projects. + * $sceProvider.enabled(false); + * }); + * ``` + * + */ +/* jshint maxlen: 100 */ + +function $SceProvider() { + var enabled = true; + + /** + * @ngdoc method + * @name $sceProvider#enabled + * @kind function + * + * @param {boolean=} value If provided, then enables/disables SCE. + * @return {boolean} true if SCE is enabled, false otherwise. + * + * @description + * Enables/disables SCE and returns the current value. + */ + this.enabled = function (value) { + if (arguments.length) { + enabled = !!value; + } + return enabled; + }; + + + /* Design notes on the default implementation for SCE. + * + * The API contract for the SCE delegate + * ------------------------------------- + * The SCE delegate object must provide the following 3 methods: + * + * - trustAs(contextEnum, value) + * This method is used to tell the SCE service that the provided value is OK to use in the + * contexts specified by contextEnum. It must return an object that will be accepted by + * getTrusted() for a compatible contextEnum and return this value. + * + * - valueOf(value) + * For values that were not produced by trustAs(), return them as is. For values that were + * produced by trustAs(), return the corresponding input value to trustAs. Basically, if + * trustAs is wrapping the given values into some type, this operation unwraps it when given + * such a value. + * + * - getTrusted(contextEnum, value) + * This function should return the a value that is safe to use in the context specified by + * contextEnum or throw and exception otherwise. + * + * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be + * opaque or wrapped in some holder object. That happens to be an implementation detail. For + * instance, an implementation could maintain a registry of all trusted objects by context. In + * such a case, trustAs() would return the same object that was passed in. getTrusted() would + * return the same object passed in if it was found in the registry under a compatible context or + * throw an exception otherwise. An implementation might only wrap values some of the time based + * on some criteria. getTrusted() might return a value and not throw an exception for special + * constants or objects even if not wrapped. All such implementations fulfill this contract. + * + * + * A note on the inheritance model for SCE contexts + * ------------------------------------------------ + * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This + * is purely an implementation details. + * + * The contract is simply this: + * + * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value) + * will also succeed. + * + * Inheritance happens to capture this in a natural way. In some future, we + * may not use inheritance anymore. That is OK because no code outside of + * sce.js and sceSpecs.js would need to be aware of this detail. + */ + + this.$get = ['$parse', '$sniffer', '$sceDelegate', function( + $parse, $sniffer, $sceDelegate) { + // Prereq: Ensure that we're not running in IE8 quirks mode. In that mode, IE allows + // the "expression(javascript expression)" syntax which is insecure. + if (enabled && $sniffer.msie && $sniffer.msieDocumentMode < 8) { + throw $sceMinErr('iequirks', + 'Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks ' + + 'mode. You can fix this by adding the text to the top of your HTML ' + + 'document. See http://docs.angularjs.org/api/ng.$sce for more information.'); + } + + var sce = shallowCopy(SCE_CONTEXTS); + + /** + * @ngdoc method + * @name $sce#isEnabled + * @kind function + * + * @return {Boolean} true if SCE is enabled, false otherwise. If you want to set the value, you + * have to do it at module config time on {@link ng.$sceProvider $sceProvider}. + * + * @description + * Returns a boolean indicating if SCE is enabled. + */ + sce.isEnabled = function () { + return enabled; + }; + sce.trustAs = $sceDelegate.trustAs; + sce.getTrusted = $sceDelegate.getTrusted; + sce.valueOf = $sceDelegate.valueOf; + + if (!enabled) { + sce.trustAs = sce.getTrusted = function(type, value) { return value; }; + sce.valueOf = identity; + } + + /** + * @ngdoc method + * @name $sce#parseAs + * + * @description + * Converts Angular {@link guide/expression expression} into a function. This is like {@link + * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it + * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*, + * *result*)} + * + * @param {string} type The kind of SCE context in which this result will be used. + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + sce.parseAs = function sceParseAs(type, expr) { + var parsed = $parse(expr); + if (parsed.literal && parsed.constant) { + return parsed; + } else { + return function sceParseAsTrusted(self, locals) { + return sce.getTrusted(type, parsed(self, locals)); + }; + } + }; + + /** + * @ngdoc method + * @name $sce#trustAs + * + * @description + * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such, + * returns an object that is trusted by angular for use in specified strict contextual + * escaping contexts (such as ng-bind-html, ng-include, any src attribute + * interpolation, any dom event binding attribute interpolation such as for onclick, etc.) + * that uses the provided value. See * {@link ng.$sce $sce} for enabling strict contextual + * escaping. + * + * @param {string} type The kind of context in which this value is safe for use. e.g. url, + * resource_url, html, js and css. + * @param {*} value The value that that should be considered trusted/safe. + * @returns {*} A value that can be used to stand in for the provided `value` in places + * where Angular expects a $sce.trustAs() return value. + */ + + /** + * @ngdoc method + * @name $sce#trustAsHtml + * + * @description + * Shorthand method. `$sce.trustAsHtml(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml + * $sce.getTrustedHtml(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the + * return value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#trustAsUrl + * + * @description + * Shorthand method. `$sce.trustAsUrl(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl + * $sce.getTrustedUrl(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the + * return value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#trustAsResourceUrl + * + * @description + * Shorthand method. `$sce.trustAsResourceUrl(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl + * $sce.getTrustedResourceUrl(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the return + * value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#trustAsJs + * + * @description + * Shorthand method. `$sce.trustAsJs(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs + * $sce.getTrustedJs(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the + * return value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#getTrusted + * + * @description + * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such, + * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the + * originally supplied value if the queried context type is a supertype of the created type. + * If this condition isn't satisfied, throws an exception. + * + * @param {string} type The kind of context in which this value is to be used. + * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`} + * call. + * @returns {*} The value the was originally provided to + * {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context. + * Otherwise, throws an exception. + */ + + /** + * @ngdoc method + * @name $sce#getTrustedHtml + * + * @description + * Shorthand method. `$sce.getTrustedHtml(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedCss + * + * @description + * Shorthand method. `$sce.getTrustedCss(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedUrl + * + * @description + * Shorthand method. `$sce.getTrustedUrl(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedResourceUrl + * + * @description + * Shorthand method. `$sce.getTrustedResourceUrl(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`} + * + * @param {*} value The value to pass to `$sceDelegate.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedJs + * + * @description + * Shorthand method. `$sce.getTrustedJs(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)` + */ + + /** + * @ngdoc method + * @name $sce#parseAsHtml + * + * @description + * Shorthand method. `$sce.parseAsHtml(expression string)` → + * {@link ng.$sce#parse `$sce.parseAs($sce.HTML, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsCss + * + * @description + * Shorthand method. `$sce.parseAsCss(value)` → + * {@link ng.$sce#parse `$sce.parseAs($sce.CSS, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsUrl + * + * @description + * Shorthand method. `$sce.parseAsUrl(value)` → + * {@link ng.$sce#parse `$sce.parseAs($sce.URL, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsResourceUrl + * + * @description + * Shorthand method. `$sce.parseAsResourceUrl(value)` → + * {@link ng.$sce#parse `$sce.parseAs($sce.RESOURCE_URL, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsJs + * + * @description + * Shorthand method. `$sce.parseAsJs(value)` → + * {@link ng.$sce#parse `$sce.parseAs($sce.JS, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + // Shorthand delegations. + var parse = sce.parseAs, + getTrusted = sce.getTrusted, + trustAs = sce.trustAs; + + forEach(SCE_CONTEXTS, function (enumValue, name) { + var lName = lowercase(name); + sce[camelCase("parse_as_" + lName)] = function (expr) { + return parse(enumValue, expr); + }; + sce[camelCase("get_trusted_" + lName)] = function (value) { + return getTrusted(enumValue, value); + }; + sce[camelCase("trust_as_" + lName)] = function (value) { + return trustAs(enumValue, value); + }; + }); + + return sce; + }]; +} + +/** + * !!! This is an undocumented "private" service !!! + * + * @name $sniffer + * @requires $window + * @requires $document + * + * @property {boolean} history Does the browser support html5 history api ? + * @property {boolean} hashchange Does the browser support hashchange event ? + * @property {boolean} transitions Does the browser support CSS transition events ? + * @property {boolean} animations Does the browser support CSS animation events ? + * + * @description + * This is very simple implementation of testing browser's features. + */ +function $SnifferProvider() { + this.$get = ['$window', '$document', function($window, $document) { + var eventSupport = {}, + android = + int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), + boxee = /Boxee/i.test(($window.navigator || {}).userAgent), + document = $document[0] || {}, + documentMode = document.documentMode, + vendorPrefix, + vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/, + bodyStyle = document.body && document.body.style, + transitions = false, + animations = false, + match; + + if (bodyStyle) { + for(var prop in bodyStyle) { + if(match = vendorRegex.exec(prop)) { + vendorPrefix = match[0]; + vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1); + break; + } + } + + if(!vendorPrefix) { + vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit'; + } + + transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle)); + animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle)); + + if (android && (!transitions||!animations)) { + transitions = isString(document.body.style.webkitTransition); + animations = isString(document.body.style.webkitAnimation); + } + } + + + return { + // Android has history.pushState, but it does not update location correctly + // so let's not use the history API at all. + // http://code.google.com/p/android/issues/detail?id=17471 + // https://github.com/angular/angular.js/issues/904 + + // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has + // so let's not use the history API also + // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined + // jshint -W018 + history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee), + // jshint +W018 + hashchange: 'onhashchange' in $window && + // IE8 compatible mode lies + (!documentMode || documentMode > 7), + hasEvent: function(event) { + // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have + // it. In particular the event is not fired when backspace or delete key are pressed or + // when cut operation is performed. + if (event == 'input' && msie == 9) return false; + + if (isUndefined(eventSupport[event])) { + var divElm = document.createElement('div'); + eventSupport[event] = 'on' + event in divElm; + } + + return eventSupport[event]; + }, + csp: csp(), + vendorPrefix: vendorPrefix, + transitions : transitions, + animations : animations, + android: android, + msie : msie, + msieDocumentMode: documentMode + }; + }]; +} + +function $TimeoutProvider() { + this.$get = ['$rootScope', '$browser', '$q', '$exceptionHandler', + function($rootScope, $browser, $q, $exceptionHandler) { + var deferreds = {}; + + + /** + * @ngdoc service + * @name $timeout + * + * @description + * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch + * block and delegates any exceptions to + * {@link ng.$exceptionHandler $exceptionHandler} service. + * + * The return value of registering a timeout function is a promise, which will be resolved when + * the timeout is reached and the timeout function is executed. + * + * To cancel a timeout request, call `$timeout.cancel(promise)`. + * + * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to + * synchronously flush the queue of deferred functions. + * + * @param {function()} fn A function, whose execution should be delayed. + * @param {number=} [delay=0] Delay in milliseconds. + * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise + * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. + * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this + * promise will be resolved with is the return value of the `fn` function. + * + */ + function timeout(fn, delay, invokeApply) { + var deferred = $q.defer(), + promise = deferred.promise, + skipApply = (isDefined(invokeApply) && !invokeApply), + timeoutId; + + timeoutId = $browser.defer(function() { + try { + deferred.resolve(fn()); + } catch(e) { + deferred.reject(e); + $exceptionHandler(e); + } + finally { + delete deferreds[promise.$$timeoutId]; + } + + if (!skipApply) $rootScope.$apply(); + }, delay); + + promise.$$timeoutId = timeoutId; + deferreds[timeoutId] = deferred; + + return promise; + } + + + /** + * @ngdoc method + * @name $timeout#cancel + * + * @description + * Cancels a task associated with the `promise`. As a result of this, the promise will be + * resolved with a rejection. + * + * @param {Promise=} promise Promise returned by the `$timeout` function. + * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully + * canceled. + */ + timeout.cancel = function(promise) { + if (promise && promise.$$timeoutId in deferreds) { + deferreds[promise.$$timeoutId].reject('canceled'); + delete deferreds[promise.$$timeoutId]; + return $browser.defer.cancel(promise.$$timeoutId); + } + return false; + }; + + return timeout; + }]; +} + +// NOTE: The usage of window and document instead of $window and $document here is +// deliberate. This service depends on the specific behavior of anchor nodes created by the +// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and +// cause us to break tests. In addition, when the browser resolves a URL for XHR, it +// doesn't know about mocked locations and resolves URLs to the real document - which is +// exactly the behavior needed here. There is little value is mocking these out for this +// service. +var urlParsingNode = document.createElement("a"); +var originUrl = urlResolve(window.location.href, true); + + +/** + * + * Implementation Notes for non-IE browsers + * ---------------------------------------- + * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, + * results both in the normalizing and parsing of the URL. Normalizing means that a relative + * URL will be resolved into an absolute URL in the context of the application document. + * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related + * properties are all populated to reflect the normalized URL. This approach has wide + * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See + * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html + * + * Implementation Notes for IE + * --------------------------- + * IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other + * browsers. However, the parsed components will not be set if the URL assigned did not specify + * them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We + * work around that by performing the parsing in a 2nd step by taking a previously normalized + * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the + * properties such as protocol, hostname, port, etc. + * + * IE7 does not normalize the URL when assigned to an anchor node. (Apparently, it does, if one + * uses the inner HTML approach to assign the URL as part of an HTML snippet - + * http://stackoverflow.com/a/472729) However, setting img[src] does normalize the URL. + * Unfortunately, setting img[src] to something like "javascript:foo" on IE throws an exception. + * Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that + * method and IE < 8 is unsupported. + * + * References: + * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement + * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html + * http://url.spec.whatwg.org/#urlutils + * https://github.com/angular/angular.js/pull/2902 + * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ + * + * @kind function + * @param {string} url The URL to be parsed. + * @description Normalizes and parses a URL. + * @returns {object} Returns the normalized URL as a dictionary. + * + * | member name | Description | + * |---------------|----------------| + * | href | A normalized version of the provided URL if it was not an absolute URL | + * | protocol | The protocol including the trailing colon | + * | host | The host and port (if the port is non-default) of the normalizedUrl | + * | search | The search params, minus the question mark | + * | hash | The hash string, minus the hash symbol + * | hostname | The hostname + * | port | The port, without ":" + * | pathname | The pathname, beginning with "/" + * + */ +function urlResolve(url, base) { + var href = url; + + if (msie) { + // Normalize before parse. Refer Implementation Notes on why this is + // done in two steps on IE. + urlParsingNode.setAttribute("href", href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') + ? urlParsingNode.pathname + : '/' + urlParsingNode.pathname + }; +} + +/** + * Parse a request URL and determine whether this is a same-origin request as the application document. + * + * @param {string|object} requestUrl The url of the request as a string that will be resolved + * or a parsed URL object. + * @returns {boolean} Whether the request is for the same origin as the application document. + */ +function urlIsSameOrigin(requestUrl) { + var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl; + return (parsed.protocol === originUrl.protocol && + parsed.host === originUrl.host); +} + +/** + * @ngdoc service + * @name $window + * + * @description + * A reference to the browser's `window` object. While `window` + * is globally available in JavaScript, it causes testability problems, because + * it is a global variable. In angular we always refer to it through the + * `$window` service, so it may be overridden, removed or mocked for testing. + * + * Expressions, like the one defined for the `ngClick` directive in the example + * below, are evaluated with respect to the current scope. Therefore, there is + * no risk of inadvertently coding in a dependency on a global value in such an + * expression. + * + * @example + + + +
+ + +
+
+ + it('should display the greeting in the input box', function() { + element(by.model('greeting')).sendKeys('Hello, E2E Tests'); + // If we click the button it will block the test runner + // element(':button').click(); + }); + +
+ */ +function $WindowProvider(){ + this.$get = valueFn(window); +} + +/* global currencyFilter: true, + dateFilter: true, + filterFilter: true, + jsonFilter: true, + limitToFilter: true, + lowercaseFilter: true, + numberFilter: true, + orderByFilter: true, + uppercaseFilter: true, + */ + +/** + * @ngdoc provider + * @name $filterProvider + * @description + * + * Filters are just functions which transform input to an output. However filters need to be + * Dependency Injected. To achieve this a filter definition consists of a factory function which is + * annotated with dependencies and is responsible for creating a filter function. + * + * ```js + * // Filter registration + * function MyModule($provide, $filterProvider) { + * // create a service to demonstrate injection (not always needed) + * $provide.value('greet', function(name){ + * return 'Hello ' + name + '!'; + * }); + * + * // register a filter factory which uses the + * // greet service to demonstrate DI. + * $filterProvider.register('greet', function(greet){ + * // return the filter function which uses the greet service + * // to generate salutation + * return function(text) { + * // filters need to be forgiving so check input validity + * return text && greet(text) || text; + * }; + * }); + * } + * ``` + * + * The filter function is registered with the `$injector` under the filter name suffix with + * `Filter`. + * + * ```js + * it('should be the same instance', inject( + * function($filterProvider) { + * $filterProvider.register('reverse', function(){ + * return ...; + * }); + * }, + * function($filter, reverseFilter) { + * expect($filter('reverse')).toBe(reverseFilter); + * }); + * ``` + * + * + * For more information about how angular filters work, and how to create your own filters, see + * {@link guide/filter Filters} in the Angular Developer Guide. + */ + +/** + * @ngdoc service + * @name $filter + * @kind function + * @description + * Filters are used for formatting data displayed to the user. + * + * The general syntax in templates is as follows: + * + * {{ expression [| filter_name[:parameter_value] ... ] }} + * + * @param {String} name Name of the filter function to retrieve + * @return {Function} the filter function + * @example + + +
+

{{ originalText }}

+

{{ filteredText }}

+
+
+ + + angular.module('filterExample', []) + .controller('MainCtrl', function($scope, $filter) { + $scope.originalText = 'hello'; + $scope.filteredText = $filter('uppercase')($scope.originalText); + }); + +
+ */ +$FilterProvider.$inject = ['$provide']; +function $FilterProvider($provide) { + var suffix = 'Filter'; + + /** + * @ngdoc method + * @name $filterProvider#register + * @param {string|Object} name Name of the filter function, or an object map of filters where + * the keys are the filter names and the values are the filter factories. + * @returns {Object} Registered filter instance, or if a map of filters was provided then a map + * of the registered filter instances. + */ + function register(name, factory) { + if(isObject(name)) { + var filters = {}; + forEach(name, function(filter, key) { + filters[key] = register(key, filter); + }); + return filters; + } else { + return $provide.factory(name + suffix, factory); + } + } + this.register = register; + + this.$get = ['$injector', function($injector) { + return function(name) { + return $injector.get(name + suffix); + }; + }]; + + //////////////////////////////////////// + + /* global + currencyFilter: false, + dateFilter: false, + filterFilter: false, + jsonFilter: false, + limitToFilter: false, + lowercaseFilter: false, + numberFilter: false, + orderByFilter: false, + uppercaseFilter: false, + */ + + register('currency', currencyFilter); + register('date', dateFilter); + register('filter', filterFilter); + register('json', jsonFilter); + register('limitTo', limitToFilter); + register('lowercase', lowercaseFilter); + register('number', numberFilter); + register('orderBy', orderByFilter); + register('uppercase', uppercaseFilter); +} + +/** + * @ngdoc filter + * @name filter + * @kind function + * + * @description + * Selects a subset of items from `array` and returns it as a new array. + * + * @param {Array} array The source array. + * @param {string|Object|function()} expression The predicate to be used for selecting items from + * `array`. + * + * Can be one of: + * + * - `string`: The string is evaluated as an expression and the resulting value is used for substring match against + * the contents of the `array`. All strings or objects with string properties in `array` that contain this string + * will be returned. The predicate can be negated by prefixing the string with `!`. + * + * - `Object`: A pattern object can be used to filter specific properties on objects contained + * by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items + * which have property `name` containing "M" and property `phone` containing "1". A special + * property name `$` can be used (as in `{$:"text"}`) to accept a match against any + * property of the object. That's equivalent to the simple substring match with a `string` + * as described above. The predicate can be negated by prefixing the string with `!`. + * For Example `{name: "!M"}` predicate will return an array of items which have property `name` + * not containing "M". + * + * - `function(value)`: A predicate function can be used to write arbitrary filters. The function is + * called for each element of `array`. The final result is an array of those elements that + * the predicate returned true for. + * + * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in + * determining if the expected value (from the filter expression) and actual value (from + * the object in the array) should be considered a match. + * + * Can be one of: + * + * - `function(actual, expected)`: + * The function will be given the object value and the predicate value to compare and + * should return true if the item should be included in filtered result. + * + * - `true`: A shorthand for `function(actual, expected) { return angular.equals(expected, actual)}`. + * this is essentially strict comparison of expected and actual. + * + * - `false|undefined`: A short hand for a function which will look for a substring match in case + * insensitive way. + * + * @example + + +
+ + Search: + + + + + + +
NamePhone
{{friend.name}}{{friend.phone}}
+
+ Any:
+ Name only
+ Phone only
+ Equality
+ + + + + + +
NamePhone
{{friendObj.name}}{{friendObj.phone}}
+
+ + var expectFriendNames = function(expectedNames, key) { + element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) { + arr.forEach(function(wd, i) { + expect(wd.getText()).toMatch(expectedNames[i]); + }); + }); + }; + + it('should search across all fields when filtering with a string', function() { + var searchText = element(by.model('searchText')); + searchText.clear(); + searchText.sendKeys('m'); + expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend'); + + searchText.clear(); + searchText.sendKeys('76'); + expectFriendNames(['John', 'Julie'], 'friend'); + }); + + it('should search in specific fields when filtering with a predicate object', function() { + var searchAny = element(by.model('search.$')); + searchAny.clear(); + searchAny.sendKeys('i'); + expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj'); + }); + it('should use a equal comparison when comparator is true', function() { + var searchName = element(by.model('search.name')); + var strict = element(by.model('strict')); + searchName.clear(); + searchName.sendKeys('Julie'); + strict.click(); + expectFriendNames(['Julie'], 'friendObj'); + }); + +
+ */ +function filterFilter() { + return function(array, expression, comparator) { + if (!isArray(array)) return array; + + var comparatorType = typeof(comparator), + predicates = []; + + predicates.check = function(value) { + for (var j = 0; j < predicates.length; j++) { + if(!predicates[j](value)) { + return false; + } + } + return true; + }; + + if (comparatorType !== 'function') { + if (comparatorType === 'boolean' && comparator) { + comparator = function(obj, text) { + return angular.equals(obj, text); + }; + } else { + comparator = function(obj, text) { + if (obj && text && typeof obj === 'object' && typeof text === 'object') { + for (var objKey in obj) { + if (objKey.charAt(0) !== '$' && hasOwnProperty.call(obj, objKey) && + comparator(obj[objKey], text[objKey])) { + return true; + } + } + return false; + } + text = (''+text).toLowerCase(); + return (''+obj).toLowerCase().indexOf(text) > -1; + }; + } + } + + var search = function(obj, text){ + if (typeof text == 'string' && text.charAt(0) === '!') { + return !search(obj, text.substr(1)); + } + switch (typeof obj) { + case "boolean": + case "number": + case "string": + return comparator(obj, text); + case "object": + switch (typeof text) { + case "object": + return comparator(obj, text); + default: + for ( var objKey in obj) { + if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) { + return true; + } + } + break; + } + return false; + case "array": + for ( var i = 0; i < obj.length; i++) { + if (search(obj[i], text)) { + return true; + } + } + return false; + default: + return false; + } + }; + switch (typeof expression) { + case "boolean": + case "number": + case "string": + // Set up expression object and fall through + expression = {$:expression}; + // jshint -W086 + case "object": + // jshint +W086 + for (var key in expression) { + (function(path) { + if (typeof expression[path] === 'undefined') return; + predicates.push(function(value) { + return search(path == '$' ? value : (value && value[path]), expression[path]); + }); + })(key); + } + break; + case 'function': + predicates.push(expression); + break; + default: + return array; + } + var filtered = []; + for ( var j = 0; j < array.length; j++) { + var value = array[j]; + if (predicates.check(value)) { + filtered.push(value); + } + } + return filtered; + }; +} + +/** + * @ngdoc filter + * @name currency + * @kind function + * + * @description + * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default + * symbol for current locale is used. + * + * @param {number} amount Input to filter. + * @param {string=} symbol Currency symbol or identifier to be displayed. + * @returns {string} Formatted number. + * + * + * @example + + + +
+
+ default currency symbol ($): {{amount | currency}}
+ custom currency identifier (USD$): {{amount | currency:"USD$"}} +
+
+ + it('should init with 1234.56', function() { + expect(element(by.id('currency-default')).getText()).toBe('$1,234.56'); + expect(element(by.binding('amount | currency:"USD$"')).getText()).toBe('USD$1,234.56'); + }); + it('should update', function() { + if (browser.params.browser == 'safari') { + // Safari does not understand the minus key. See + // https://github.com/angular/protractor/issues/481 + return; + } + element(by.model('amount')).clear(); + element(by.model('amount')).sendKeys('-1234'); + expect(element(by.id('currency-default')).getText()).toBe('($1,234.00)'); + expect(element(by.binding('amount | currency:"USD$"')).getText()).toBe('(USD$1,234.00)'); + }); + +
+ */ +currencyFilter.$inject = ['$locale']; +function currencyFilter($locale) { + var formats = $locale.NUMBER_FORMATS; + return function(amount, currencySymbol){ + if (isUndefined(currencySymbol)) currencySymbol = formats.CURRENCY_SYM; + return formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, 2). + replace(/\u00A4/g, currencySymbol); + }; +} + +/** + * @ngdoc filter + * @name number + * @kind function + * + * @description + * Formats a number as text. + * + * If the input is not a number an empty string is returned. + * + * @param {number|string} number Number to format. + * @param {(number|string)=} fractionSize Number of decimal places to round the number to. + * If this is not provided then the fraction size is computed from the current locale's number + * formatting pattern. In the case of the default locale, it will be 3. + * @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit. + * + * @example + + + +
+ Enter number:
+ Default formatting: {{val | number}}
+ No fractions: {{val | number:0}}
+ Negative number: {{-val | number:4}} +
+
+ + it('should format numbers', function() { + expect(element(by.id('number-default')).getText()).toBe('1,234.568'); + expect(element(by.binding('val | number:0')).getText()).toBe('1,235'); + expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679'); + }); + + it('should update', function() { + element(by.model('val')).clear(); + element(by.model('val')).sendKeys('3374.333'); + expect(element(by.id('number-default')).getText()).toBe('3,374.333'); + expect(element(by.binding('val | number:0')).getText()).toBe('3,374'); + expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330'); + }); + +
+ */ + + +numberFilter.$inject = ['$locale']; +function numberFilter($locale) { + var formats = $locale.NUMBER_FORMATS; + return function(number, fractionSize) { + return formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP, + fractionSize); + }; +} + +var DECIMAL_SEP = '.'; +function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { + if (number == null || !isFinite(number) || isObject(number)) return ''; + + var isNegative = number < 0; + number = Math.abs(number); + var numStr = number + '', + formatedText = '', + parts = []; + + var hasExponent = false; + if (numStr.indexOf('e') !== -1) { + var match = numStr.match(/([\d\.]+)e(-?)(\d+)/); + if (match && match[2] == '-' && match[3] > fractionSize + 1) { + numStr = '0'; + number = 0; + } else { + formatedText = numStr; + hasExponent = true; + } + } + + if (!hasExponent) { + var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length; + + // determine fractionSize if it is not specified + if (isUndefined(fractionSize)) { + fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac); + } + + // safely round numbers in JS without hitting imprecisions of floating-point arithmetics + // inspired by: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round + number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize); + + if (number === 0) { + isNegative = false; + } + + var fraction = ('' + number).split(DECIMAL_SEP); + var whole = fraction[0]; + fraction = fraction[1] || ''; + + var i, pos = 0, + lgroup = pattern.lgSize, + group = pattern.gSize; + + if (whole.length >= (lgroup + group)) { + pos = whole.length - lgroup; + for (i = 0; i < pos; i++) { + if ((pos - i)%group === 0 && i !== 0) { + formatedText += groupSep; + } + formatedText += whole.charAt(i); + } + } + + for (i = pos; i < whole.length; i++) { + if ((whole.length - i)%lgroup === 0 && i !== 0) { + formatedText += groupSep; + } + formatedText += whole.charAt(i); + } + + // format fraction part. + while(fraction.length < fractionSize) { + fraction += '0'; + } + + if (fractionSize && fractionSize !== "0") formatedText += decimalSep + fraction.substr(0, fractionSize); + } else { + + if (fractionSize > 0 && number > -1 && number < 1) { + formatedText = number.toFixed(fractionSize); + } + } + + parts.push(isNegative ? pattern.negPre : pattern.posPre); + parts.push(formatedText); + parts.push(isNegative ? pattern.negSuf : pattern.posSuf); + return parts.join(''); +} + +function padNumber(num, digits, trim) { + var neg = ''; + if (num < 0) { + neg = '-'; + num = -num; + } + num = '' + num; + while(num.length < digits) num = '0' + num; + if (trim) + num = num.substr(num.length - digits); + return neg + num; +} + + +function dateGetter(name, size, offset, trim) { + offset = offset || 0; + return function(date) { + var value = date['get' + name](); + if (offset > 0 || value > -offset) + value += offset; + if (value === 0 && offset == -12 ) value = 12; + return padNumber(value, size, trim); + }; +} + +function dateStrGetter(name, shortForm) { + return function(date, formats) { + var value = date['get' + name](); + var get = uppercase(shortForm ? ('SHORT' + name) : name); + + return formats[get][value]; + }; +} + +function timeZoneGetter(date) { + var zone = -1 * date.getTimezoneOffset(); + var paddedZone = (zone >= 0) ? "+" : ""; + + paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) + + padNumber(Math.abs(zone % 60), 2); + + return paddedZone; +} + +function ampmGetter(date, formats) { + return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]; +} + +var DATE_FORMATS = { + yyyy: dateGetter('FullYear', 4), + yy: dateGetter('FullYear', 2, 0, true), + y: dateGetter('FullYear', 1), + MMMM: dateStrGetter('Month'), + MMM: dateStrGetter('Month', true), + MM: dateGetter('Month', 2, 1), + M: dateGetter('Month', 1, 1), + dd: dateGetter('Date', 2), + d: dateGetter('Date', 1), + HH: dateGetter('Hours', 2), + H: dateGetter('Hours', 1), + hh: dateGetter('Hours', 2, -12), + h: dateGetter('Hours', 1, -12), + mm: dateGetter('Minutes', 2), + m: dateGetter('Minutes', 1), + ss: dateGetter('Seconds', 2), + s: dateGetter('Seconds', 1), + // while ISO 8601 requires fractions to be prefixed with `.` or `,` + // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions + sss: dateGetter('Milliseconds', 3), + EEEE: dateStrGetter('Day'), + EEE: dateStrGetter('Day', true), + a: ampmGetter, + Z: timeZoneGetter +}; + +var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/, + NUMBER_STRING = /^\-?\d+$/; + +/** + * @ngdoc filter + * @name date + * @kind function + * + * @description + * Formats `date` to a string based on the requested `format`. + * + * `format` string can be composed of the following elements: + * + * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010) + * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) + * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199) + * * `'MMMM'`: Month in year (January-December) + * * `'MMM'`: Month in year (Jan-Dec) + * * `'MM'`: Month in year, padded (01-12) + * * `'M'`: Month in year (1-12) + * * `'dd'`: Day in month, padded (01-31) + * * `'d'`: Day in month (1-31) + * * `'EEEE'`: Day in Week,(Sunday-Saturday) + * * `'EEE'`: Day in Week, (Sun-Sat) + * * `'HH'`: Hour in day, padded (00-23) + * * `'H'`: Hour in day (0-23) + * * `'hh'`: Hour in am/pm, padded (01-12) + * * `'h'`: Hour in am/pm, (1-12) + * * `'mm'`: Minute in hour, padded (00-59) + * * `'m'`: Minute in hour (0-59) + * * `'ss'`: Second in minute, padded (00-59) + * * `'s'`: Second in minute (0-59) + * * `'.sss' or ',sss'`: Millisecond in second, padded (000-999) + * * `'a'`: am/pm marker + * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200) + * + * `format` string can also be one of the following predefined + * {@link guide/i18n localizable formats}: + * + * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale + * (e.g. Sep 3, 2010 12:05:08 pm) + * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 pm) + * * `'fullDate'`: equivalent to `'EEEE, MMMM d,y'` for en_US locale + * (e.g. Friday, September 3, 2010) + * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010) + * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010) + * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10) + * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 pm) + * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 pm) + * + * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g. + * `"h 'in the morning'"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence + * (e.g. `"h 'o''clock'"`). + * + * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or + * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its + * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is + * specified in the string input, the time is considered to be in the local timezone. + * @param {string=} format Formatting rules (see Description). If not specified, + * `mediumDate` is used. + * @returns {string} Formatted string or the input if input is not recognized as date/millis. + * + * @example + + + {{1288323623006 | date:'medium'}}: + {{1288323623006 | date:'medium'}}
+ {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}: + {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
+ {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}: + {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}
+ {{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}}: + {{'1288323623006' | date:"MM/dd/yyyy 'at' h:mma"}}
+
+ + it('should format date', function() { + expect(element(by.binding("1288323623006 | date:'medium'")).getText()). + toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/); + expect(element(by.binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).getText()). + toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} (\-|\+)?\d{4}/); + expect(element(by.binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).getText()). + toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/); + expect(element(by.binding("'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"")).getText()). + toMatch(/10\/2\d\/2010 at \d{1,2}:\d{2}(AM|PM)/); + }); + +
+ */ +dateFilter.$inject = ['$locale']; +function dateFilter($locale) { + + + var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; + // 1 2 3 4 5 6 7 8 9 10 11 + function jsonStringToDate(string) { + var match; + if (match = string.match(R_ISO8601_STR)) { + var date = new Date(0), + tzHour = 0, + tzMin = 0, + dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear, + timeSetter = match[8] ? date.setUTCHours : date.setHours; + + if (match[9]) { + tzHour = int(match[9] + match[10]); + tzMin = int(match[9] + match[11]); + } + dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3])); + var h = int(match[4]||0) - tzHour; + var m = int(match[5]||0) - tzMin; + var s = int(match[6]||0); + var ms = Math.round(parseFloat('0.' + (match[7]||0)) * 1000); + timeSetter.call(date, h, m, s, ms); + return date; + } + return string; + } + + + return function(date, format) { + var text = '', + parts = [], + fn, match; + + format = format || 'mediumDate'; + format = $locale.DATETIME_FORMATS[format] || format; + if (isString(date)) { + date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date); + } + + if (isNumber(date)) { + date = new Date(date); + } + + if (!isDate(date)) { + return date; + } + + while(format) { + match = DATE_FORMATS_SPLIT.exec(format); + if (match) { + parts = concat(parts, match, 1); + format = parts.pop(); + } else { + parts.push(format); + format = null; + } + } + + forEach(parts, function(value){ + fn = DATE_FORMATS[value]; + text += fn ? fn(date, $locale.DATETIME_FORMATS) + : value.replace(/(^'|'$)/g, '').replace(/''/g, "'"); + }); + + return text; + }; +} + + +/** + * @ngdoc filter + * @name json + * @kind function + * + * @description + * Allows you to convert a JavaScript object into JSON string. + * + * This filter is mostly useful for debugging. When using the double curly {{value}} notation + * the binding is automatically converted to JSON. + * + * @param {*} object Any JavaScript object (including arrays and primitive types) to filter. + * @returns {string} JSON string. + * + * + * @example + + +
{{ {'name':'value'} | json }}
+
+ + it('should jsonify filtered objects', function() { + expect(element(by.binding("{'name':'value'}")).getText()).toMatch(/\{\n "name": ?"value"\n}/); + }); + +
+ * + */ +function jsonFilter() { + return function(object) { + return toJson(object, true); + }; +} + + +/** + * @ngdoc filter + * @name lowercase + * @kind function + * @description + * Converts string to lowercase. + * @see angular.lowercase + */ +var lowercaseFilter = valueFn(lowercase); + + +/** + * @ngdoc filter + * @name uppercase + * @kind function + * @description + * Converts string to uppercase. + * @see angular.uppercase + */ +var uppercaseFilter = valueFn(uppercase); + +/** + * @ngdoc filter + * @name limitTo + * @kind function + * + * @description + * Creates a new array or string containing only a specified number of elements. The elements + * are taken from either the beginning or the end of the source array or string, as specified by + * the value and sign (positive or negative) of `limit`. + * + * @param {Array|string} input Source array or string to be limited. + * @param {string|number} limit The length of the returned array or string. If the `limit` number + * is positive, `limit` number of items from the beginning of the source array/string are copied. + * If the number is negative, `limit` number of items from the end of the source array/string + * are copied. The `limit` will be trimmed if it exceeds `array.length` + * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array + * had less than `limit` elements. + * + * @example + + + +
+ Limit {{numbers}} to: +

Output numbers: {{ numbers | limitTo:numLimit }}

+ Limit {{letters}} to: +

Output letters: {{ letters | limitTo:letterLimit }}

+
+
+ + var numLimitInput = element(by.model('numLimit')); + var letterLimitInput = element(by.model('letterLimit')); + var limitedNumbers = element(by.binding('numbers | limitTo:numLimit')); + var limitedLetters = element(by.binding('letters | limitTo:letterLimit')); + + it('should limit the number array to first three items', function() { + expect(numLimitInput.getAttribute('value')).toBe('3'); + expect(letterLimitInput.getAttribute('value')).toBe('3'); + expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]'); + expect(limitedLetters.getText()).toEqual('Output letters: abc'); + }); + + it('should update the output when -3 is entered', function() { + numLimitInput.clear(); + numLimitInput.sendKeys('-3'); + letterLimitInput.clear(); + letterLimitInput.sendKeys('-3'); + expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]'); + expect(limitedLetters.getText()).toEqual('Output letters: ghi'); + }); + + it('should not exceed the maximum size of input array', function() { + numLimitInput.clear(); + numLimitInput.sendKeys('100'); + letterLimitInput.clear(); + letterLimitInput.sendKeys('100'); + expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]'); + expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi'); + }); + +
+ */ +function limitToFilter(){ + return function(input, limit) { + if (!isArray(input) && !isString(input)) return input; + + if (Math.abs(Number(limit)) === Infinity) { + limit = Number(limit); + } else { + limit = int(limit); + } + + if (isString(input)) { + //NaN check on limit + if (limit) { + return limit >= 0 ? input.slice(0, limit) : input.slice(limit, input.length); + } else { + return ""; + } + } + + var out = [], + i, n; + + // if abs(limit) exceeds maximum length, trim it + if (limit > input.length) + limit = input.length; + else if (limit < -input.length) + limit = -input.length; + + if (limit > 0) { + i = 0; + n = limit; + } else { + i = input.length + limit; + n = input.length; + } + + for (; i} expression A predicate to be + * used by the comparator to determine the order of elements. + * + * Can be one of: + * + * - `function`: Getter function. The result of this function will be sorted using the + * `<`, `=`, `>` operator. + * - `string`: An Angular expression. The result of this expression is used to compare elements + * (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by + * 3 first characters of a property called `name`). The result of a constant expression + * is interpreted as a property name to be used in comparisons (for example `"special name"` + * to sort object by the value of their `special name` property). An expression can be + * optionally prefixed with `+` or `-` to control ascending or descending sort order + * (for example, `+name` or `-name`). + * - `Array`: An array of function or string predicates. The first predicate in the array + * is used for sorting, but when two items are equivalent, the next predicate is used. + * + * @param {boolean=} reverse Reverse the order of the array. + * @returns {Array} Sorted copy of the source array. + * + * @example + + + +
+
Sorting predicate = {{predicate}}; reverse = {{reverse}}
+
+ [ unsorted ] + + + + + + + + + + + +
Name + (^)Phone NumberAge
{{friend.name}}{{friend.phone}}{{friend.age}}
+
+
+
+ * + * It's also possible to call the orderBy filter manually, by injecting `$filter`, retrieving the + * filter routine with `$filter('orderBy')`, and calling the returned filter routine with the + * desired parameters. + * + * Example: + * + * @example + + +
+ + + + + + + + + + + +
Name + (^)Phone NumberAge
{{friend.name}}{{friend.phone}}{{friend.age}}
+
+
+ + + angular.module('orderByExample', []) + .controller('ExampleController', ['$scope', '$filter', function($scope, $filter) { + var orderBy = $filter('orderBy'); + $scope.friends = [ + { name: 'John', phone: '555-1212', age: 10 }, + { name: 'Mary', phone: '555-9876', age: 19 }, + { name: 'Mike', phone: '555-4321', age: 21 }, + { name: 'Adam', phone: '555-5678', age: 35 }, + { name: 'Julie', phone: '555-8765', age: 29 } + ]; + $scope.order = function(predicate, reverse) { + $scope.friends = orderBy($scope.friends, predicate, reverse); + }; + $scope.order('-age',false); + }]); + +
+ */ +orderByFilter.$inject = ['$parse']; +function orderByFilter($parse){ + return function(array, sortPredicate, reverseOrder) { + if (!(isArrayLike(array))) return array; + if (!sortPredicate) return array; + sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate]; + sortPredicate = map(sortPredicate, function(predicate){ + var descending = false, get = predicate || identity; + if (isString(predicate)) { + if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) { + descending = predicate.charAt(0) == '-'; + predicate = predicate.substring(1); + } + get = $parse(predicate); + if (get.constant) { + var key = get(); + return reverseComparator(function(a,b) { + return compare(a[key], b[key]); + }, descending); + } + } + return reverseComparator(function(a,b){ + return compare(get(a),get(b)); + }, descending); + }); + var arrayCopy = []; + for ( var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); } + return arrayCopy.sort(reverseComparator(comparator, reverseOrder)); + + function comparator(o1, o2){ + for ( var i = 0; i < sortPredicate.length; i++) { + var comp = sortPredicate[i](o1, o2); + if (comp !== 0) return comp; + } + return 0; + } + function reverseComparator(comp, descending) { + return toBoolean(descending) + ? function(a,b){return comp(b,a);} + : comp; + } + function compare(v1, v2){ + var t1 = typeof v1; + var t2 = typeof v2; + if (t1 == t2) { + if (isDate(v1) && isDate(v2)) { + v1 = v1.valueOf(); + v2 = v2.valueOf(); + } + if (t1 == "string") { + v1 = v1.toLowerCase(); + v2 = v2.toLowerCase(); + } + if (v1 === v2) return 0; + return v1 < v2 ? -1 : 1; + } else { + return t1 < t2 ? -1 : 1; + } + } + }; +} + +function ngDirective(directive) { + if (isFunction(directive)) { + directive = { + link: directive + }; + } + directive.restrict = directive.restrict || 'AC'; + return valueFn(directive); +} + +/** + * @ngdoc directive + * @name a + * @restrict E + * + * @description + * Modifies the default behavior of the html A tag so that the default action is prevented when + * the href attribute is empty. + * + * This change permits the easy creation of action links with the `ngClick` directive + * without changing the location or causing page reloads, e.g.: + * `Add Item` + */ +var htmlAnchorDirective = valueFn({ + restrict: 'E', + compile: function(element, attr) { + + if (msie <= 8) { + + // turn link into a stylable link in IE + // but only if it doesn't have name attribute, in which case it's an anchor + if (!attr.href && !attr.name) { + attr.$set('href', ''); + } + + // add a comment node to anchors to workaround IE bug that causes element content to be reset + // to new attribute content if attribute is updated with value containing @ and element also + // contains value with @ + // see issue #1949 + element.append(document.createComment('IE fix')); + } + + if (!attr.href && !attr.xlinkHref && !attr.name) { + return function(scope, element) { + // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. + var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? + 'xlink:href' : 'href'; + element.on('click', function(event){ + // if we have no href url, then don't navigate anywhere. + if (!element.attr(href)) { + event.preventDefault(); + } + }); + }; + } + } +}); + +/** + * @ngdoc directive + * @name ngHref + * @restrict A + * @priority 99 + * + * @description + * Using Angular markup like `{{hash}}` in an href attribute will + * make the link go to the wrong URL if the user clicks it before + * Angular has a chance to replace the `{{hash}}` markup with its + * value. Until Angular replaces the markup the link will be broken + * and will most likely return a 404 error. + * + * The `ngHref` directive solves this problem. + * + * The wrong way to write it: + * ```html + * + * ``` + * + * The correct way to write it: + * ```html + * + * ``` + * + * @element A + * @param {template} ngHref any string which can contain `{{}}` markup. + * + * @example + * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes + * in links and their different behaviors: + + +
+
link 1 (link, don't reload)
+ link 2 (link, don't reload)
+ link 3 (link, reload!)
+ anchor (link, don't reload)
+ anchor (no link)
+ link (link, change location) +
+ + it('should execute ng-click but not reload when href without value', function() { + element(by.id('link-1')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('1'); + expect(element(by.id('link-1')).getAttribute('href')).toBe(''); + }); + + it('should execute ng-click but not reload when href empty string', function() { + element(by.id('link-2')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('2'); + expect(element(by.id('link-2')).getAttribute('href')).toBe(''); + }); + + it('should execute ng-click and change url when ng-href specified', function() { + expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\/123$/); + + element(by.id('link-3')).click(); + + // At this point, we navigate away from an Angular page, so we need + // to use browser.driver to get the base webdriver. + + browser.wait(function() { + return browser.driver.getCurrentUrl().then(function(url) { + return url.match(/\/123$/); + }); + }, 5000, 'page should navigate to /123'); + }); + + xit('should execute ng-click but not reload when href empty string and name specified', function() { + element(by.id('link-4')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('4'); + expect(element(by.id('link-4')).getAttribute('href')).toBe(''); + }); + + it('should execute ng-click but not reload when no href but name specified', function() { + element(by.id('link-5')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('5'); + expect(element(by.id('link-5')).getAttribute('href')).toBe(null); + }); + + it('should only change url when only ng-href', function() { + element(by.model('value')).clear(); + element(by.model('value')).sendKeys('6'); + expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/); + + element(by.id('link-6')).click(); + + // At this point, we navigate away from an Angular page, so we need + // to use browser.driver to get the base webdriver. + browser.wait(function() { + return browser.driver.getCurrentUrl().then(function(url) { + return url.match(/\/6$/); + }); + }, 5000, 'page should navigate to /6'); + }); + + + */ + +/** + * @ngdoc directive + * @name ngSrc + * @restrict A + * @priority 99 + * + * @description + * Using Angular markup like `{{hash}}` in a `src` attribute doesn't + * work right: The browser will fetch from the URL with the literal + * text `{{hash}}` until Angular replaces the expression inside + * `{{hash}}`. The `ngSrc` directive solves this problem. + * + * The buggy way to write it: + * ```html + * + * ``` + * + * The correct way to write it: + * ```html + * + * ``` + * + * @element IMG + * @param {template} ngSrc any string which can contain `{{}}` markup. + */ + +/** + * @ngdoc directive + * @name ngSrcset + * @restrict A + * @priority 99 + * + * @description + * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't + * work right: The browser will fetch from the URL with the literal + * text `{{hash}}` until Angular replaces the expression inside + * `{{hash}}`. The `ngSrcset` directive solves this problem. + * + * The buggy way to write it: + * ```html + * + * ``` + * + * The correct way to write it: + * ```html + * + * ``` + * + * @element IMG + * @param {template} ngSrcset any string which can contain `{{}}` markup. + */ + +/** + * @ngdoc directive + * @name ngDisabled + * @restrict A + * @priority 100 + * + * @description + * + * We shouldn't do this, because it will make the button enabled on Chrome/Firefox but not on IE8 and older IEs: + * ```html + *
+ * + *
+ * ``` + * + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as disabled. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngDisabled` directive solves this problem for the `disabled` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * + * @example + + + Click me to toggle:
+ +
+ + it('should toggle button', function() { + expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy(); + element(by.model('checked')).click(); + expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy(); + }); + +
+ * + * @element INPUT + * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy, + * then special attribute "disabled" will be set on the element + */ + + +/** + * @ngdoc directive + * @name ngChecked + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as checked. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngChecked` directive solves this problem for the `checked` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * @example + + + Check me to check both:
+ +
+ + it('should check both checkBoxes', function() { + expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy(); + element(by.model('master')).click(); + expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy(); + }); + +
+ * + * @element INPUT + * @param {expression} ngChecked If the {@link guide/expression expression} is truthy, + * then special attribute "checked" will be set on the element + */ + + +/** + * @ngdoc directive + * @name ngReadonly + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as readonly. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngReadonly` directive solves this problem for the `readonly` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * @example + + + Check me to make text readonly:
+ +
+ + it('should toggle readonly attr', function() { + expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeFalsy(); + element(by.model('checked')).click(); + expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeTruthy(); + }); + +
+ * + * @element INPUT + * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy, + * then special attribute "readonly" will be set on the element + */ + + +/** + * @ngdoc directive + * @name ngSelected + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as selected. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngSelected` directive solves this problem for the `selected` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * + * @example + + + Check me to select:
+ +
+ + it('should select Greetings!', function() { + expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy(); + element(by.model('selected')).click(); + expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy(); + }); + +
+ * + * @element OPTION + * @param {expression} ngSelected If the {@link guide/expression expression} is truthy, + * then special attribute "selected" will be set on the element + */ + +/** + * @ngdoc directive + * @name ngOpen + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as open. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngOpen` directive solves this problem for the `open` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * @example + + + Check me check multiple:
+
+ Show/Hide me +
+
+ + it('should toggle open', function() { + expect(element(by.id('details')).getAttribute('open')).toBeFalsy(); + element(by.model('open')).click(); + expect(element(by.id('details')).getAttribute('open')).toBeTruthy(); + }); + +
+ * + * @element DETAILS + * @param {expression} ngOpen If the {@link guide/expression expression} is truthy, + * then special attribute "open" will be set on the element + */ + +var ngAttributeAliasDirectives = {}; + + +// boolean attrs are evaluated +forEach(BOOLEAN_ATTR, function(propName, attrName) { + // binding to multiple is not supported + if (propName == "multiple") return; + + var normalized = directiveNormalize('ng-' + attrName); + ngAttributeAliasDirectives[normalized] = function() { + return { + priority: 100, + link: function(scope, element, attr) { + scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { + attr.$set(attrName, !!value); + }); + } + }; + }; +}); + + +// ng-src, ng-srcset, ng-href are interpolated +forEach(['src', 'srcset', 'href'], function(attrName) { + var normalized = directiveNormalize('ng-' + attrName); + ngAttributeAliasDirectives[normalized] = function() { + return { + priority: 99, // it needs to run after the attributes are interpolated + link: function(scope, element, attr) { + var propName = attrName, + name = attrName; + + if (attrName === 'href' && + toString.call(element.prop('href')) === '[object SVGAnimatedString]') { + name = 'xlinkHref'; + attr.$attr[name] = 'xlink:href'; + propName = null; + } + + attr.$observe(normalized, function(value) { + if (!value) { + if (attrName === 'href') { + attr.$set(name, null); + } + return; + } + + attr.$set(name, value); + + // on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist + // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need + // to set the property as well to achieve the desired effect. + // we use attr[attrName] value since $set can sanitize the url. + if (msie && propName) element.prop(propName, attr[name]); + }); + } + }; + }; +}); + +/* global -nullFormCtrl */ +var nullFormCtrl = { + $addControl: noop, + $removeControl: noop, + $setValidity: noop, + $setDirty: noop, + $setPristine: noop +}; + +/** + * @ngdoc type + * @name form.FormController + * + * @property {boolean} $pristine True if user has not interacted with the form yet. + * @property {boolean} $dirty True if user has already interacted with the form. + * @property {boolean} $valid True if all of the containing forms and controls are valid. + * @property {boolean} $invalid True if at least one containing control or form is invalid. + * + * @property {Object} $error Is an object hash, containing references to all invalid controls or + * forms, where: + * + * - keys are validation tokens (error names), + * - values are arrays of controls or forms that are invalid for given error name. + * + * + * Built-in validation tokens: + * + * - `email` + * - `max` + * - `maxlength` + * - `min` + * - `minlength` + * - `number` + * - `pattern` + * - `required` + * - `url` + * + * @description + * `FormController` keeps track of all its controls and nested forms as well as the state of them, + * such as being valid/invalid or dirty/pristine. + * + * Each {@link ng.directive:form form} directive creates an instance + * of `FormController`. + * + */ +//asks for $scope to fool the BC controller module +FormController.$inject = ['$element', '$attrs', '$scope', '$animate']; +function FormController(element, attrs, $scope, $animate) { + var form = this, + parentForm = element.parent().controller('form') || nullFormCtrl, + invalidCount = 0, // used to easily determine if we are valid + errors = form.$error = {}, + controls = []; + + // init state + form.$name = attrs.name || attrs.ngForm; + form.$dirty = false; + form.$pristine = true; + form.$valid = true; + form.$invalid = false; + + parentForm.$addControl(form); + + // Setup initial state of the control + element.addClass(PRISTINE_CLASS); + toggleValidCss(true); + + // convenience method for easy toggling of classes + function toggleValidCss(isValid, validationErrorKey) { + validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : ''; + $animate.setClass(element, + (isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey, + (isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey); + } + + /** + * @ngdoc method + * @name form.FormController#$addControl + * + * @description + * Register a control with the form. + * + * Input elements using ngModelController do this automatically when they are linked. + */ + form.$addControl = function(control) { + // Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored + // and not added to the scope. Now we throw an error. + assertNotHasOwnProperty(control.$name, 'input'); + controls.push(control); + + if (control.$name) { + form[control.$name] = control; + } + }; + + /** + * @ngdoc method + * @name form.FormController#$removeControl + * + * @description + * Deregister a control from the form. + * + * Input elements using ngModelController do this automatically when they are destroyed. + */ + form.$removeControl = function(control) { + if (control.$name && form[control.$name] === control) { + delete form[control.$name]; + } + forEach(errors, function(queue, validationToken) { + form.$setValidity(validationToken, true, control); + }); + + arrayRemove(controls, control); + }; + + /** + * @ngdoc method + * @name form.FormController#$setValidity + * + * @description + * Sets the validity of a form control. + * + * This method will also propagate to parent forms. + */ + form.$setValidity = function(validationToken, isValid, control) { + var queue = errors[validationToken]; + + if (isValid) { + if (queue) { + arrayRemove(queue, control); + if (!queue.length) { + invalidCount--; + if (!invalidCount) { + toggleValidCss(isValid); + form.$valid = true; + form.$invalid = false; + } + errors[validationToken] = false; + toggleValidCss(true, validationToken); + parentForm.$setValidity(validationToken, true, form); + } + } + + } else { + if (!invalidCount) { + toggleValidCss(isValid); + } + if (queue) { + if (includes(queue, control)) return; + } else { + errors[validationToken] = queue = []; + invalidCount++; + toggleValidCss(false, validationToken); + parentForm.$setValidity(validationToken, false, form); + } + queue.push(control); + + form.$valid = false; + form.$invalid = true; + } + }; + + /** + * @ngdoc method + * @name form.FormController#$setDirty + * + * @description + * Sets the form to a dirty state. + * + * This method can be called to add the 'ng-dirty' class and set the form to a dirty + * state (ng-dirty class). This method will also propagate to parent forms. + */ + form.$setDirty = function() { + $animate.removeClass(element, PRISTINE_CLASS); + $animate.addClass(element, DIRTY_CLASS); + form.$dirty = true; + form.$pristine = false; + parentForm.$setDirty(); + }; + + /** + * @ngdoc method + * @name form.FormController#$setPristine + * + * @description + * Sets the form to its pristine state. + * + * This method can be called to remove the 'ng-dirty' class and set the form to its pristine + * state (ng-pristine class). This method will also propagate to all the controls contained + * in this form. + * + * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after + * saving or resetting it. + */ + form.$setPristine = function () { + $animate.removeClass(element, DIRTY_CLASS); + $animate.addClass(element, PRISTINE_CLASS); + form.$dirty = false; + form.$pristine = true; + forEach(controls, function(control) { + control.$setPristine(); + }); + }; +} + + +/** + * @ngdoc directive + * @name ngForm + * @restrict EAC + * + * @description + * Nestable alias of {@link ng.directive:form `form`} directive. HTML + * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a + * sub-group of controls needs to be determined. + * + * Note: the purpose of `ngForm` is to group controls, + * but not to be a replacement for the `
` tag with all of its capabilities + * (e.g. posting to the server, ...). + * + * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into + * related scope, under this name. + * + */ + + /** + * @ngdoc directive + * @name form + * @restrict E + * + * @description + * Directive that instantiates + * {@link form.FormController FormController}. + * + * If the `name` attribute is specified, the form controller is published onto the current scope under + * this name. + * + * # Alias: {@link ng.directive:ngForm `ngForm`} + * + * In Angular forms can be nested. This means that the outer form is valid when all of the child + * forms are valid as well. However, browsers do not allow nesting of `` elements, so + * Angular provides the {@link ng.directive:ngForm `ngForm`} directive which behaves identically to + * `` but can be nested. This allows you to have nested forms, which is very useful when + * using Angular validation directives in forms that are dynamically generated using the + * {@link ng.directive:ngRepeat `ngRepeat`} directive. Since you cannot dynamically generate the `name` + * attribute of input elements using interpolation, you have to wrap each set of repeated inputs in an + * `ngForm` directive and nest these in an outer `form` element. + * + * + * # CSS classes + * - `ng-valid` is set if the form is valid. + * - `ng-invalid` is set if the form is invalid. + * - `ng-pristine` is set if the form is pristine. + * - `ng-dirty` is set if the form is dirty. + * + * Keep in mind that ngAnimate can detect each of these classes when added and removed. + * + * + * # Submitting a form and preventing the default action + * + * Since the role of forms in client-side Angular applications is different than in classical + * roundtrip apps, it is desirable for the browser not to translate the form submission into a full + * page reload that sends the data to the server. Instead some javascript logic should be triggered + * to handle the form submission in an application-specific way. + * + * For this reason, Angular prevents the default action (form submission to the server) unless the + * `` element has an `action` attribute specified. + * + * You can use one of the following two ways to specify what javascript method should be called when + * a form is submitted: + * + * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element + * - {@link ng.directive:ngClick ngClick} directive on the first + * button or input field of type submit (input[type=submit]) + * + * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit} + * or {@link ng.directive:ngClick ngClick} directives. + * This is because of the following form submission rules in the HTML specification: + * + * - If a form has only one input field then hitting enter in this field triggers form submit + * (`ngSubmit`) + * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter + * doesn't trigger submit + * - if a form has one or more input fields and one or more buttons or input[type=submit] then + * hitting enter in any of the input fields will trigger the click handler on the *first* button or + * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`) + * + * + * ## Animation Hooks + * + * Animations in ngForm are triggered when any of the associated CSS classes are added and removed. + * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any + * other validations that are performed within the form. Animations in ngForm are similar to how + * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well + * as JS animations. + * + * The following example shows a simple way to utilize CSS transitions to style a form element + * that has been rendered as invalid after it has been validated: + * + *
+ * //be sure to include ngAnimate as a module to hook into more
+ * //advanced animations
+ * .my-form {
+ *   transition:0.5s linear all;
+ *   background: white;
+ * }
+ * .my-form.ng-invalid {
+ *   background: red;
+ *   color:white;
+ * }
+ * 
+ * + * @example + + + + + + userType: + Required!
+ userType = {{userType}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+ +
+ + it('should initialize to model', function() { + var userType = element(by.binding('userType')); + var valid = element(by.binding('myForm.input.$valid')); + + expect(userType.getText()).toContain('guest'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + var userType = element(by.binding('userType')); + var valid = element(by.binding('myForm.input.$valid')); + var userInput = element(by.model('userType')); + + userInput.clear(); + userInput.sendKeys(''); + + expect(userType.getText()).toEqual('userType ='); + expect(valid.getText()).toContain('false'); + }); + +
+ * + * @param {string=} name Name of the form. If specified, the form controller will be published into + * related scope, under this name. + */ +var formDirectiveFactory = function(isNgForm) { + return ['$timeout', function($timeout) { + var formDirective = { + name: 'form', + restrict: isNgForm ? 'EAC' : 'E', + controller: FormController, + compile: function() { + return { + pre: function(scope, formElement, attr, controller) { + if (!attr.action) { + // we can't use jq events because if a form is destroyed during submission the default + // action is not prevented. see #1238 + // + // IE 9 is not affected because it doesn't fire a submit event and try to do a full + // page reload if the form was destroyed by submission of the form via a click handler + // on a button in the form. Looks like an IE9 specific bug. + var preventDefaultListener = function(event) { + event.preventDefault + ? event.preventDefault() + : event.returnValue = false; // IE + }; + + addEventListenerFn(formElement[0], 'submit', preventDefaultListener); + + // unregister the preventDefault listener so that we don't not leak memory but in a + // way that will achieve the prevention of the default action. + formElement.on('$destroy', function() { + $timeout(function() { + removeEventListenerFn(formElement[0], 'submit', preventDefaultListener); + }, 0, false); + }); + } + + var parentFormCtrl = formElement.parent().controller('form'), + alias = attr.name || attr.ngForm; + + if (alias) { + setter(scope, alias, controller, alias); + } + if (parentFormCtrl) { + formElement.on('$destroy', function() { + parentFormCtrl.$removeControl(controller); + if (alias) { + setter(scope, alias, undefined, alias); + } + extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards + }); + } + } + }; + } + }; + + return formDirective; + }]; +}; + +var formDirective = formDirectiveFactory(); +var ngFormDirective = formDirectiveFactory(true); + +/* global VALID_CLASS: true, + INVALID_CLASS: true, + PRISTINE_CLASS: true, + DIRTY_CLASS: true +*/ + +var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/; +var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i; +var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/; + +var inputType = { + + /** + * @ngdoc input + * @name input[text] + * + * @description + * Standard HTML text input with angular data binding, inherited by most of the `input` elements. + * + * *NOTE* Not every feature offered is available for all input types. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Adds `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. + * This parameter is ignored for input[type=password] controls, which will never trim the + * input. + * + * @example + + + +
+ Single word: + + Required! + + Single word only! + + text = {{text}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+
+
+ + var text = element(by.binding('text')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('text')); + + it('should initialize to model', function() { + expect(text.getText()).toContain('guest'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + + expect(text.getText()).toEqual('text ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if multi word', function() { + input.clear(); + input.sendKeys('hello world'); + + expect(valid.getText()).toContain('false'); + }); + +
+ */ + 'text': textInputType, + + + /** + * @ngdoc input + * @name input[number] + * + * @description + * Text input with number validation and transformation. Sets the `number` validation + * error if not a valid number. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Number: + + Required! + + Not valid number! + value = {{value}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+
+
+ + var value = element(by.binding('value')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('value')); + + it('should initialize to model', function() { + expect(value.getText()).toContain('12'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if over max', function() { + input.clear(); + input.sendKeys('123'); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('false'); + }); + +
+ */ + 'number': numberInputType, + + + /** + * @ngdoc input + * @name input[url] + * + * @description + * Text input with URL validation. Sets the `url` validation error key if the content is not a + * valid URL. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ URL: + + Required! + + Not valid url! + text = {{text}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+ myForm.$error.url = {{!!myForm.$error.url}}
+
+
+ + var text = element(by.binding('text')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('text')); + + it('should initialize to model', function() { + expect(text.getText()).toContain('http://google.com'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + + expect(text.getText()).toEqual('text ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if not url', function() { + input.clear(); + input.sendKeys('box'); + + expect(valid.getText()).toContain('false'); + }); + +
+ */ + 'url': urlInputType, + + + /** + * @ngdoc input + * @name input[email] + * + * @description + * Text input with email validation. Sets the `email` validation error key if not a valid email + * address. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Email: + + Required! + + Not valid email! + text = {{text}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+ myForm.$error.email = {{!!myForm.$error.email}}
+
+
+ + var text = element(by.binding('text')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('text')); + + it('should initialize to model', function() { + expect(text.getText()).toContain('me@example.com'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + expect(text.getText()).toEqual('text ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if not email', function() { + input.clear(); + input.sendKeys('xxx'); + + expect(valid.getText()).toContain('false'); + }); + +
+ */ + 'email': emailInputType, + + + /** + * @ngdoc input + * @name input[radio] + * + * @description + * HTML radio button. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string} value The value to which the expression should be set when selected. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {string} ngValue Angular expression which sets the value to which the expression should + * be set when selected. + * + * @example + + + +
+ Red
+ Green
+ Blue
+ color = {{color | json}}
+
+ Note that `ng-value="specialValue"` sets radio item's value to be the value of `$scope.specialValue`. +
+ + it('should change state', function() { + var color = element(by.binding('color')); + + expect(color.getText()).toContain('blue'); + + element.all(by.model('color')).get(0).click(); + + expect(color.getText()).toContain('red'); + }); + +
+ */ + 'radio': radioInputType, + + + /** + * @ngdoc input + * @name input[checkbox] + * + * @description + * HTML checkbox. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} ngTrueValue The value to which the expression should be set when selected. + * @param {string=} ngFalseValue The value to which the expression should be set when not selected. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Value1:
+ Value2:
+ value1 = {{value1}}
+ value2 = {{value2}}
+
+
+ + it('should change state', function() { + var value1 = element(by.binding('value1')); + var value2 = element(by.binding('value2')); + + expect(value1.getText()).toContain('true'); + expect(value2.getText()).toContain('YES'); + + element(by.model('value1')).click(); + element(by.model('value2')).click(); + + expect(value1.getText()).toContain('false'); + expect(value2.getText()).toContain('NO'); + }); + +
+ */ + 'checkbox': checkboxInputType, + + 'hidden': noop, + 'button': noop, + 'submit': noop, + 'reset': noop, + 'file': noop +}; + +// A helper function to call $setValidity and return the value / undefined, +// a pattern that is repeated a lot in the input validation logic. +function validate(ctrl, validatorName, validity, value){ + ctrl.$setValidity(validatorName, validity); + return validity ? value : undefined; +} + +function testFlags(validity, flags) { + var i, flag; + if (flags) { + for (i=0; i= minlength, value); + }; + + ctrl.$parsers.push(minLengthValidator); + ctrl.$formatters.push(minLengthValidator); + } + + // max length validator + if (attr.ngMaxlength) { + var maxlength = int(attr.ngMaxlength); + var maxLengthValidator = function(value) { + return validate(ctrl, 'maxlength', ctrl.$isEmpty(value) || value.length <= maxlength, value); + }; + + ctrl.$parsers.push(maxLengthValidator); + ctrl.$formatters.push(maxLengthValidator); + } +} + +var numberBadFlags = ['badInput']; + +function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { + textInputType(scope, element, attr, ctrl, $sniffer, $browser); + + ctrl.$parsers.push(function(value) { + var empty = ctrl.$isEmpty(value); + if (empty || NUMBER_REGEXP.test(value)) { + ctrl.$setValidity('number', true); + return value === '' ? null : (empty ? value : parseFloat(value)); + } else { + ctrl.$setValidity('number', false); + return undefined; + } + }); + + addNativeHtml5Validators(ctrl, 'number', numberBadFlags, null, ctrl.$$validityState); + + ctrl.$formatters.push(function(value) { + return ctrl.$isEmpty(value) ? '' : '' + value; + }); + + if (attr.min) { + var minValidator = function(value) { + var min = parseFloat(attr.min); + return validate(ctrl, 'min', ctrl.$isEmpty(value) || value >= min, value); + }; + + ctrl.$parsers.push(minValidator); + ctrl.$formatters.push(minValidator); + } + + if (attr.max) { + var maxValidator = function(value) { + var max = parseFloat(attr.max); + return validate(ctrl, 'max', ctrl.$isEmpty(value) || value <= max, value); + }; + + ctrl.$parsers.push(maxValidator); + ctrl.$formatters.push(maxValidator); + } + + ctrl.$formatters.push(function(value) { + return validate(ctrl, 'number', ctrl.$isEmpty(value) || isNumber(value), value); + }); +} + +function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) { + textInputType(scope, element, attr, ctrl, $sniffer, $browser); + + var urlValidator = function(value) { + return validate(ctrl, 'url', ctrl.$isEmpty(value) || URL_REGEXP.test(value), value); + }; + + ctrl.$formatters.push(urlValidator); + ctrl.$parsers.push(urlValidator); +} + +function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) { + textInputType(scope, element, attr, ctrl, $sniffer, $browser); + + var emailValidator = function(value) { + return validate(ctrl, 'email', ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value), value); + }; + + ctrl.$formatters.push(emailValidator); + ctrl.$parsers.push(emailValidator); +} + +function radioInputType(scope, element, attr, ctrl) { + // make the name unique, if not defined + if (isUndefined(attr.name)) { + element.attr('name', nextUid()); + } + + element.on('click', function() { + if (element[0].checked) { + scope.$apply(function() { + ctrl.$setViewValue(attr.value); + }); + } + }); + + ctrl.$render = function() { + var value = attr.value; + element[0].checked = (value == ctrl.$viewValue); + }; + + attr.$observe('value', ctrl.$render); +} + +function checkboxInputType(scope, element, attr, ctrl) { + var trueValue = attr.ngTrueValue, + falseValue = attr.ngFalseValue; + + if (!isString(trueValue)) trueValue = true; + if (!isString(falseValue)) falseValue = false; + + element.on('click', function() { + scope.$apply(function() { + ctrl.$setViewValue(element[0].checked); + }); + }); + + ctrl.$render = function() { + element[0].checked = ctrl.$viewValue; + }; + + // Override the standard `$isEmpty` because a value of `false` means empty in a checkbox. + ctrl.$isEmpty = function(value) { + return value !== trueValue; + }; + + ctrl.$formatters.push(function(value) { + return value === trueValue; + }); + + ctrl.$parsers.push(function(value) { + return value ? trueValue : falseValue; + }); +} + + +/** + * @ngdoc directive + * @name textarea + * @restrict E + * + * @description + * HTML textarea element control with angular data-binding. The data-binding and validation + * properties of this element are exactly the same as those of the + * {@link ng.directive:input input element}. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. + */ + + +/** + * @ngdoc directive + * @name input + * @restrict E + * + * @description + * HTML input element control with angular data-binding. Input control follows HTML5 input types + * and polyfills the HTML5 validation behavior for older browsers. + * + * *NOTE* Not every feature offered is available for all input types. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {boolean=} ngRequired Sets `required` attribute if set to true + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. + * This parameter is ignored for input[type=password] controls, which will never trim the + * input. + * + * @example + + + +
+
+ User name: + + Required!
+ Last name: + + Too short! + + Too long!
+
+
+ user = {{user}}
+ myForm.userName.$valid = {{myForm.userName.$valid}}
+ myForm.userName.$error = {{myForm.userName.$error}}
+ myForm.lastName.$valid = {{myForm.lastName.$valid}}
+ myForm.lastName.$error = {{myForm.lastName.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+ myForm.$error.minlength = {{!!myForm.$error.minlength}}
+ myForm.$error.maxlength = {{!!myForm.$error.maxlength}}
+
+
+ + var user = element(by.binding('{{user}}')); + var userNameValid = element(by.binding('myForm.userName.$valid')); + var lastNameValid = element(by.binding('myForm.lastName.$valid')); + var lastNameError = element(by.binding('myForm.lastName.$error')); + var formValid = element(by.binding('myForm.$valid')); + var userNameInput = element(by.model('user.name')); + var userLastInput = element(by.model('user.last')); + + it('should initialize to model', function() { + expect(user.getText()).toContain('{"name":"guest","last":"visitor"}'); + expect(userNameValid.getText()).toContain('true'); + expect(formValid.getText()).toContain('true'); + }); + + it('should be invalid if empty when required', function() { + userNameInput.clear(); + userNameInput.sendKeys(''); + + expect(user.getText()).toContain('{"last":"visitor"}'); + expect(userNameValid.getText()).toContain('false'); + expect(formValid.getText()).toContain('false'); + }); + + it('should be valid if empty when min length is set', function() { + userLastInput.clear(); + userLastInput.sendKeys(''); + + expect(user.getText()).toContain('{"name":"guest","last":""}'); + expect(lastNameValid.getText()).toContain('true'); + expect(formValid.getText()).toContain('true'); + }); + + it('should be invalid if less than required min length', function() { + userLastInput.clear(); + userLastInput.sendKeys('xx'); + + expect(user.getText()).toContain('{"name":"guest"}'); + expect(lastNameValid.getText()).toContain('false'); + expect(lastNameError.getText()).toContain('minlength'); + expect(formValid.getText()).toContain('false'); + }); + + it('should be invalid if longer than max length', function() { + userLastInput.clear(); + userLastInput.sendKeys('some ridiculously long name'); + + expect(user.getText()).toContain('{"name":"guest"}'); + expect(lastNameValid.getText()).toContain('false'); + expect(lastNameError.getText()).toContain('maxlength'); + expect(formValid.getText()).toContain('false'); + }); + +
+ */ +var inputDirective = ['$browser', '$sniffer', function($browser, $sniffer) { + return { + restrict: 'E', + require: '?ngModel', + link: function(scope, element, attr, ctrl) { + if (ctrl) { + (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrl, $sniffer, + $browser); + } + } + }; +}]; + +var VALID_CLASS = 'ng-valid', + INVALID_CLASS = 'ng-invalid', + PRISTINE_CLASS = 'ng-pristine', + DIRTY_CLASS = 'ng-dirty'; + +/** + * @ngdoc type + * @name ngModel.NgModelController + * + * @property {string} $viewValue Actual string value in the view. + * @property {*} $modelValue The value in the model, that the control is bound to. + * @property {Array.} $parsers Array of functions to execute, as a pipeline, whenever + the control reads value from the DOM. Each function is called, in turn, passing the value + through to the next. The last return value is used to populate the model. + Used to sanitize / convert the value as well as validation. For validation, + the parsers should update the validity state using + {@link ngModel.NgModelController#$setValidity $setValidity()}, + and return `undefined` for invalid values. + + * + * @property {Array.} $formatters Array of functions to execute, as a pipeline, whenever + the model value changes. Each function is called, in turn, passing the value through to the + next. Used to format / convert values for display in the control and validation. + * ```js + * function formatter(value) { + * if (value) { + * return value.toUpperCase(); + * } + * } + * ngModel.$formatters.push(formatter); + * ``` + * + * @property {Array.} $viewChangeListeners Array of functions to execute whenever the + * view value has changed. It is called with no arguments, and its return value is ignored. + * This can be used in place of additional $watches against the model value. + * + * @property {Object} $error An object hash with all errors as keys. + * + * @property {boolean} $pristine True if user has not interacted with the control yet. + * @property {boolean} $dirty True if user has already interacted with the control. + * @property {boolean} $valid True if there is no error. + * @property {boolean} $invalid True if at least one error on the control. + * + * @description + * + * `NgModelController` provides API for the `ng-model` directive. The controller contains + * services for data-binding, validation, CSS updates, and value formatting and parsing. It + * purposefully does not contain any logic which deals with DOM rendering or listening to + * DOM events. Such DOM related logic should be provided by other directives which make use of + * `NgModelController` for data-binding. + * + * ## Custom Control Example + * This example shows how to use `NgModelController` with a custom control to achieve + * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`) + * collaborate together to achieve the desired result. + * + * Note that `contenteditable` is an HTML5 attribute, which tells the browser to let the element + * contents be edited in place by the user. This will not work on older browsers. + * + * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize} + * module to automatically remove "bad" content like inline event listener (e.g. ``). + * However, as we are using `$sce` the model can still decide to to provide unsafe content if it marks + * that content using the `$sce` service. + * + * + + [contenteditable] { + border: 1px solid black; + background-color: white; + min-height: 20px; + } + + .ng-invalid { + border: 1px solid red; + } + + + + angular.module('customControl', ['ngSanitize']). + directive('contenteditable', ['$sce', function($sce) { + return { + restrict: 'A', // only activate on element attribute + require: '?ngModel', // get a hold of NgModelController + link: function(scope, element, attrs, ngModel) { + if(!ngModel) return; // do nothing if no ng-model + + // Specify how UI should be updated + ngModel.$render = function() { + element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); + }; + + // Listen for change events to enable binding + element.on('blur keyup change', function() { + scope.$apply(read); + }); + read(); // initialize + + // Write data to the model + function read() { + var html = element.html(); + // When we clear the content editable the browser leaves a
behind + // If strip-br attribute is provided then we strip this out + if( attrs.stripBr && html == '
' ) { + html = ''; + } + ngModel.$setViewValue(html); + } + } + }; + }]); +
+ +
+
Change me!
+ Required! +
+ +
+
+ + it('should data-bind and become invalid', function() { + if (browser.params.browser == 'safari' || browser.params.browser == 'firefox') { + // SafariDriver can't handle contenteditable + // and Firefox driver can't clear contenteditables very well + return; + } + var contentEditable = element(by.css('[contenteditable]')); + var content = 'Change me!'; + + expect(contentEditable.getText()).toEqual(content); + + contentEditable.clear(); + contentEditable.sendKeys(protractor.Key.BACK_SPACE); + expect(contentEditable.getText()).toEqual(''); + expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/); + }); + + *
+ * + * + */ +var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', + function($scope, $exceptionHandler, $attr, $element, $parse, $animate) { + this.$viewValue = Number.NaN; + this.$modelValue = Number.NaN; + this.$parsers = []; + this.$formatters = []; + this.$viewChangeListeners = []; + this.$pristine = true; + this.$dirty = false; + this.$valid = true; + this.$invalid = false; + this.$name = $attr.name; + + var ngModelGet = $parse($attr.ngModel), + ngModelSet = ngModelGet.assign; + + if (!ngModelSet) { + throw minErr('ngModel')('nonassign', "Expression '{0}' is non-assignable. Element: {1}", + $attr.ngModel, startingTag($element)); + } + + /** + * @ngdoc method + * @name ngModel.NgModelController#$render + * + * @description + * Called when the view needs to be updated. It is expected that the user of the ng-model + * directive will implement this method. + */ + this.$render = noop; + + /** + * @ngdoc method + * @name ngModel.NgModelController#$isEmpty + * + * @description + * This is called when we need to determine if the value of the input is empty. + * + * For instance, the required directive does this to work out if the input has data or not. + * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`. + * + * You can override this for input directives whose concept of being empty is different to the + * default. The `checkboxInputType` directive does this because in its case a value of `false` + * implies empty. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is empty. + */ + this.$isEmpty = function(value) { + return isUndefined(value) || value === '' || value === null || value !== value; + }; + + var parentForm = $element.inheritedData('$formController') || nullFormCtrl, + invalidCount = 0, // used to easily determine if we are valid + $error = this.$error = {}; // keep invalid keys here + + + // Setup initial state of the control + $element.addClass(PRISTINE_CLASS); + toggleValidCss(true); + + // convenience method for easy toggling of classes + function toggleValidCss(isValid, validationErrorKey) { + validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : ''; + $animate.removeClass($element, (isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey); + $animate.addClass($element, (isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey); + } + + /** + * @ngdoc method + * @name ngModel.NgModelController#$setValidity + * + * @description + * Change the validity state, and notifies the form when the control changes validity. (i.e. it + * does not notify form if given validator is already marked as invalid). + * + * This method should be called by validators - i.e. the parser or formatter functions. + * + * @param {string} validationErrorKey Name of the validator. the `validationErrorKey` will assign + * to `$error[validationErrorKey]=!isValid` so that it is available for data-binding. + * The `validationErrorKey` should be in camelCase and will get converted into dash-case + * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error` + * class and can be bound to as `{{someForm.someControl.$error.myError}}` . + * @param {boolean} isValid Whether the current state is valid (true) or invalid (false). + */ + this.$setValidity = function(validationErrorKey, isValid) { + // Purposeful use of ! here to cast isValid to boolean in case it is undefined + // jshint -W018 + if ($error[validationErrorKey] === !isValid) return; + // jshint +W018 + + if (isValid) { + if ($error[validationErrorKey]) invalidCount--; + if (!invalidCount) { + toggleValidCss(true); + this.$valid = true; + this.$invalid = false; + } + } else { + toggleValidCss(false); + this.$invalid = true; + this.$valid = false; + invalidCount++; + } + + $error[validationErrorKey] = !isValid; + toggleValidCss(isValid, validationErrorKey); + + parentForm.$setValidity(validationErrorKey, isValid, this); + }; + + /** + * @ngdoc method + * @name ngModel.NgModelController#$setPristine + * + * @description + * Sets the control to its pristine state. + * + * This method can be called to remove the 'ng-dirty' class and set the control to its pristine + * state (ng-pristine class). + */ + this.$setPristine = function () { + this.$dirty = false; + this.$pristine = true; + $animate.removeClass($element, DIRTY_CLASS); + $animate.addClass($element, PRISTINE_CLASS); + }; + + /** + * @ngdoc method + * @name ngModel.NgModelController#$setViewValue + * + * @description + * Update the view value. + * + * This method should be called when the view value changes, typically from within a DOM event handler. + * For example {@link ng.directive:input input} and + * {@link ng.directive:select select} directives call it. + * + * It will update the $viewValue, then pass this value through each of the functions in `$parsers`, + * which includes any validators. The value that comes out of this `$parsers` pipeline, be applied to + * `$modelValue` and the **expression** specified in the `ng-model` attribute. + * + * Lastly, all the registered change listeners, in the `$viewChangeListeners` list, are called. + * + * Note that calling this function does not trigger a `$digest`. + * + * @param {string} value Value from the view. + */ + this.$setViewValue = function(value) { + this.$viewValue = value; + + // change to dirty + if (this.$pristine) { + this.$dirty = true; + this.$pristine = false; + $animate.removeClass($element, PRISTINE_CLASS); + $animate.addClass($element, DIRTY_CLASS); + parentForm.$setDirty(); + } + + forEach(this.$parsers, function(fn) { + value = fn(value); + }); + + if (this.$modelValue !== value) { + this.$modelValue = value; + ngModelSet($scope, value); + forEach(this.$viewChangeListeners, function(listener) { + try { + listener(); + } catch(e) { + $exceptionHandler(e); + } + }); + } + }; + + // model -> value + var ctrl = this; + + $scope.$watch(function ngModelWatch() { + var value = ngModelGet($scope); + + // if scope model value and ngModel value are out of sync + if (ctrl.$modelValue !== value) { + + var formatters = ctrl.$formatters, + idx = formatters.length; + + ctrl.$modelValue = value; + while(idx--) { + value = formatters[idx](value); + } + + if (ctrl.$viewValue !== value) { + ctrl.$viewValue = value; + ctrl.$render(); + } + } + + return value; + }); +}]; + + +/** + * @ngdoc directive + * @name ngModel + * + * @element input + * + * @description + * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a + * property on the scope using {@link ngModel.NgModelController NgModelController}, + * which is created and exposed by this directive. + * + * `ngModel` is responsible for: + * + * - Binding the view into the model, which other directives such as `input`, `textarea` or `select` + * require. + * - Providing validation behavior (i.e. required, number, email, url). + * - Keeping the state of the control (valid/invalid, dirty/pristine, validation errors). + * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`) including animations. + * - Registering the control with its parent {@link ng.directive:form form}. + * + * Note: `ngModel` will try to bind to the property given by evaluating the expression on the + * current scope. If the property doesn't already exist on this scope, it will be created + * implicitly and added to the scope. + * + * For best practices on using `ngModel`, see: + * + * - [https://github.com/angular/angular.js/wiki/Understanding-Scopes] + * + * For basic examples, how to use `ngModel`, see: + * + * - {@link ng.directive:input input} + * - {@link input[text] text} + * - {@link input[checkbox] checkbox} + * - {@link input[radio] radio} + * - {@link input[number] number} + * - {@link input[email] email} + * - {@link input[url] url} + * - {@link ng.directive:select select} + * - {@link ng.directive:textarea textarea} + * + * # CSS classes + * The following CSS classes are added and removed on the associated input/select/textarea element + * depending on the validity of the model. + * + * - `ng-valid` is set if the model is valid. + * - `ng-invalid` is set if the model is invalid. + * - `ng-pristine` is set if the model is pristine. + * - `ng-dirty` is set if the model is dirty. + * + * Keep in mind that ngAnimate can detect each of these classes when added and removed. + * + * ## Animation Hooks + * + * Animations within models are triggered when any of the associated CSS classes are added and removed + * on the input element which is attached to the model. These classes are: `.ng-pristine`, `.ng-dirty`, + * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself. + * The animations that are triggered within ngModel are similar to how they work in ngClass and + * animations can be hooked into using CSS transitions, keyframes as well as JS animations. + * + * The following example shows a simple way to utilize CSS transitions to style an input element + * that has been rendered as invalid after it has been validated: + * + *
+ * //be sure to include ngAnimate as a module to hook into more
+ * //advanced animations
+ * .my-input {
+ *   transition:0.5s linear all;
+ *   background: white;
+ * }
+ * .my-input.ng-invalid {
+ *   background: red;
+ *   color:white;
+ * }
+ * 
+ * + * @example + * + + + + Update input to see transitions when valid/invalid. + Integer is a valid value. +
+ +
+
+ *
+ */ +var ngModelDirective = function() { + return { + require: ['ngModel', '^?form'], + controller: NgModelController, + link: function(scope, element, attr, ctrls) { + // notify others, especially parent forms + + var modelCtrl = ctrls[0], + formCtrl = ctrls[1] || nullFormCtrl; + + formCtrl.$addControl(modelCtrl); + + scope.$on('$destroy', function() { + formCtrl.$removeControl(modelCtrl); + }); + } + }; +}; + + +/** + * @ngdoc directive + * @name ngChange + * + * @description + * Evaluate the given expression when the user changes the input. + * The expression is evaluated immediately, unlike the JavaScript onchange event + * which only triggers at the end of a change (usually, when the user leaves the + * form element or presses the return key). + * The expression is not evaluated when the value change is coming from the model. + * + * Note, this directive requires `ngModel` to be present. + * + * @element input + * @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change + * in input value. + * + * @example + * + * + * + *
+ * + * + *
+ * debug = {{confirmed}}
+ * counter = {{counter}}
+ *
+ *
+ * + * var counter = element(by.binding('counter')); + * var debug = element(by.binding('confirmed')); + * + * it('should evaluate the expression if changing from view', function() { + * expect(counter.getText()).toContain('0'); + * + * element(by.id('ng-change-example1')).click(); + * + * expect(counter.getText()).toContain('1'); + * expect(debug.getText()).toContain('true'); + * }); + * + * it('should not evaluate the expression if changing from model', function() { + * element(by.id('ng-change-example2')).click(); + + * expect(counter.getText()).toContain('0'); + * expect(debug.getText()).toContain('true'); + * }); + * + *
+ */ +var ngChangeDirective = valueFn({ + require: 'ngModel', + link: function(scope, element, attr, ctrl) { + ctrl.$viewChangeListeners.push(function() { + scope.$eval(attr.ngChange); + }); + } +}); + + +var requiredDirective = function() { + return { + require: '?ngModel', + link: function(scope, elm, attr, ctrl) { + if (!ctrl) return; + attr.required = true; // force truthy in case we are on non input element + + var validator = function(value) { + if (attr.required && ctrl.$isEmpty(value)) { + ctrl.$setValidity('required', false); + return; + } else { + ctrl.$setValidity('required', true); + return value; + } + }; + + ctrl.$formatters.push(validator); + ctrl.$parsers.unshift(validator); + + attr.$observe('required', function() { + validator(ctrl.$viewValue); + }); + } + }; +}; + + +/** + * @ngdoc directive + * @name ngList + * + * @description + * Text input that converts between a delimited string and an array of strings. The delimiter + * can be a fixed string (by default a comma) or a regular expression. + * + * @element input + * @param {string=} ngList optional delimiter that should be used to split the value. If + * specified in form `/something/` then the value will be converted into a regular expression. + * + * @example + + + +
+ List: + + Required! +
+ names = {{names}}
+ myForm.namesInput.$valid = {{myForm.namesInput.$valid}}
+ myForm.namesInput.$error = {{myForm.namesInput.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+
+
+ + var listInput = element(by.model('names')); + var names = element(by.binding('{{names}}')); + var valid = element(by.binding('myForm.namesInput.$valid')); + var error = element(by.css('span.error')); + + it('should initialize to model', function() { + expect(names.getText()).toContain('["igor","misko","vojta"]'); + expect(valid.getText()).toContain('true'); + expect(error.getCssValue('display')).toBe('none'); + }); + + it('should be invalid if empty', function() { + listInput.clear(); + listInput.sendKeys(''); + + expect(names.getText()).toContain(''); + expect(valid.getText()).toContain('false'); + expect(error.getCssValue('display')).not.toBe('none'); }); + +
+ */ +var ngListDirective = function() { + return { + require: 'ngModel', + link: function(scope, element, attr, ctrl) { + var match = /\/(.*)\//.exec(attr.ngList), + separator = match && new RegExp(match[1]) || attr.ngList || ','; + + var parse = function(viewValue) { + // If the viewValue is invalid (say required but empty) it will be `undefined` + if (isUndefined(viewValue)) return; + + var list = []; + + if (viewValue) { + forEach(viewValue.split(separator), function(value) { + if (value) list.push(trim(value)); + }); + } + + return list; + }; + + ctrl.$parsers.push(parse); + ctrl.$formatters.push(function(value) { + if (isArray(value)) { + return value.join(', '); + } + + return undefined; + }); + + // Override the standard $isEmpty because an empty array means the input is empty. + ctrl.$isEmpty = function(value) { + return !value || !value.length; + }; + } + }; +}; + + +var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/; +/** + * @ngdoc directive + * @name ngValue + * + * @description + * Binds the given expression to the value of `input[select]` or `input[radio]`, so + * that when the element is selected, the `ngModel` of that element is set to the + * bound value. + * + * `ngValue` is useful when dynamically generating lists of radio buttons using `ng-repeat`, as + * shown below. + * + * @element input + * @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute + * of the `input` element + * + * @example + + + +
+

Which is your favorite?

+ +
You chose {{my.favorite}}
+
+
+ + var favorite = element(by.binding('my.favorite')); + + it('should initialize to model', function() { + expect(favorite.getText()).toContain('unicorns'); + }); + it('should bind the values to the inputs', function() { + element.all(by.model('my.favorite')).get(0).click(); + expect(favorite.getText()).toContain('pizza'); + }); + +
+ */ +var ngValueDirective = function() { + return { + priority: 100, + compile: function(tpl, tplAttr) { + if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) { + return function ngValueConstantLink(scope, elm, attr) { + attr.$set('value', scope.$eval(attr.ngValue)); + }; + } else { + return function ngValueLink(scope, elm, attr) { + scope.$watch(attr.ngValue, function valueWatchAction(value) { + attr.$set('value', value); + }); + }; + } + } + }; +}; + +/** + * @ngdoc directive + * @name ngBind + * @restrict AC + * + * @description + * The `ngBind` attribute tells Angular to replace the text content of the specified HTML element + * with the value of a given expression, and to update the text content when the value of that + * expression changes. + * + * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like + * `{{ expression }}` which is similar but less verbose. + * + * It is preferable to use `ngBind` instead of `{{ expression }}` if a template is momentarily + * displayed by the browser in its raw state before Angular compiles it. Since `ngBind` is an + * element attribute, it makes the bindings invisible to the user while the page is loading. + * + * An alternative solution to this problem would be using the + * {@link ng.directive:ngCloak ngCloak} directive. + * + * + * @element ANY + * @param {expression} ngBind {@link guide/expression Expression} to evaluate. + * + * @example + * Enter a name in the Live Preview text box; the greeting below the text box changes instantly. + + + +
+ Enter name:
+ Hello ! +
+
+ + it('should check ng-bind', function() { + var nameInput = element(by.model('name')); + + expect(element(by.binding('name')).getText()).toBe('Whirled'); + nameInput.clear(); + nameInput.sendKeys('world'); + expect(element(by.binding('name')).getText()).toBe('world'); + }); + +
+ */ +var ngBindDirective = ngDirective({ + compile: function(templateElement) { + templateElement.addClass('ng-binding'); + return function (scope, element, attr) { + element.data('$binding', attr.ngBind); + scope.$watch(attr.ngBind, function ngBindWatchAction(value) { + // We are purposefully using == here rather than === because we want to + // catch when value is "null or undefined" + // jshint -W041 + element.text(value == undefined ? '' : value); + }); + }; + } +}); + + +/** + * @ngdoc directive + * @name ngBindTemplate + * + * @description + * The `ngBindTemplate` directive specifies that the element + * text content should be replaced with the interpolation of the template + * in the `ngBindTemplate` attribute. + * Unlike `ngBind`, the `ngBindTemplate` can contain multiple `{{` `}}` + * expressions. This directive is needed since some HTML elements + * (such as TITLE and OPTION) cannot contain SPAN elements. + * + * @element ANY + * @param {string} ngBindTemplate template of form + * {{ expression }} to eval. + * + * @example + * Try it here: enter text in text box and watch the greeting change. + + + +
+ Salutation:
+ Name:
+

+       
+
+ + it('should check ng-bind', function() { + var salutationElem = element(by.binding('salutation')); + var salutationInput = element(by.model('salutation')); + var nameInput = element(by.model('name')); + + expect(salutationElem.getText()).toBe('Hello World!'); + + salutationInput.clear(); + salutationInput.sendKeys('Greetings'); + nameInput.clear(); + nameInput.sendKeys('user'); + + expect(salutationElem.getText()).toBe('Greetings user!'); + }); + +
+ */ +var ngBindTemplateDirective = ['$interpolate', function($interpolate) { + return function(scope, element, attr) { + // TODO: move this to scenario runner + var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate)); + element.addClass('ng-binding').data('$binding', interpolateFn); + attr.$observe('ngBindTemplate', function(value) { + element.text(value); + }); + }; +}]; + + +/** + * @ngdoc directive + * @name ngBindHtml + * + * @description + * Creates a binding that will innerHTML the result of evaluating the `expression` into the current + * element in a secure way. By default, the innerHTML-ed content will be sanitized using the {@link + * ngSanitize.$sanitize $sanitize} service. To utilize this functionality, ensure that `$sanitize` + * is available, for example, by including {@link ngSanitize} in your module's dependencies (not in + * core Angular.) You may also bypass sanitization for values you know are safe. To do so, bind to + * an explicitly trusted value via {@link ng.$sce#trustAsHtml $sce.trustAsHtml}. See the example + * under {@link ng.$sce#Example Strict Contextual Escaping (SCE)}. + * + * Note: If a `$sanitize` service is unavailable and the bound value isn't explicitly trusted, you + * will have an exception (instead of an exploit.) + * + * @element ANY + * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate. + * + * @example + + + +
+

+
+
+ + + angular.module('bindHtmlExample', ['ngSanitize']) + .controller('ExampleController', ['$scope', function($scope) { + $scope.myHTML = + 'I am an HTMLstring with ' + + 'links! and other stuff'; + }]); + + + + it('should check ng-bind-html', function() { + expect(element(by.binding('myHTML')).getText()).toBe( + 'I am an HTMLstring with links! and other stuff'); + }); + +
+ */ +var ngBindHtmlDirective = ['$sce', '$parse', function($sce, $parse) { + return { + compile: function (tElement) { + tElement.addClass('ng-binding'); + + return function (scope, element, attr) { + element.data('$binding', attr.ngBindHtml); + + var parsed = $parse(attr.ngBindHtml); + + function getStringValue() { + return (parsed(scope) || '').toString(); + } + + scope.$watch(getStringValue, function ngBindHtmlWatchAction(value) { + element.html($sce.getTrustedHtml(parsed(scope)) || ''); + }); + }; + } + }; +}]; + +function classDirective(name, selector) { + name = 'ngClass' + name; + return ['$animate', function($animate) { + return { + restrict: 'AC', + link: function(scope, element, attr) { + var oldVal; + + scope.$watch(attr[name], ngClassWatchAction, true); + + attr.$observe('class', function(value) { + ngClassWatchAction(scope.$eval(attr[name])); + }); + + + if (name !== 'ngClass') { + scope.$watch('$index', function($index, old$index) { + // jshint bitwise: false + var mod = $index & 1; + if (mod !== (old$index & 1)) { + var classes = arrayClasses(scope.$eval(attr[name])); + mod === selector ? + addClasses(classes) : + removeClasses(classes); + } + }); + } + + function addClasses(classes) { + var newClasses = digestClassCounts(classes, 1); + attr.$addClass(newClasses); + } + + function removeClasses(classes) { + var newClasses = digestClassCounts(classes, -1); + attr.$removeClass(newClasses); + } + + function digestClassCounts (classes, count) { + var classCounts = element.data('$classCounts') || {}; + var classesToUpdate = []; + forEach(classes, function (className) { + if (count > 0 || classCounts[className]) { + classCounts[className] = (classCounts[className] || 0) + count; + if (classCounts[className] === +(count > 0)) { + classesToUpdate.push(className); + } + } + }); + element.data('$classCounts', classCounts); + return classesToUpdate.join(' '); + } + + function updateClasses (oldClasses, newClasses) { + var toAdd = arrayDifference(newClasses, oldClasses); + var toRemove = arrayDifference(oldClasses, newClasses); + toRemove = digestClassCounts(toRemove, -1); + toAdd = digestClassCounts(toAdd, 1); + + if (toAdd.length === 0) { + $animate.removeClass(element, toRemove); + } else if (toRemove.length === 0) { + $animate.addClass(element, toAdd); + } else { + $animate.setClass(element, toAdd, toRemove); + } + } + + function ngClassWatchAction(newVal) { + if (selector === true || scope.$index % 2 === selector) { + var newClasses = arrayClasses(newVal || []); + if (!oldVal) { + addClasses(newClasses); + } else if (!equals(newVal,oldVal)) { + var oldClasses = arrayClasses(oldVal); + updateClasses(oldClasses, newClasses); + } + } + oldVal = shallowCopy(newVal); + } + } + }; + + function arrayDifference(tokens1, tokens2) { + var values = []; + + outer: + for(var i = 0; i < tokens1.length; i++) { + var token = tokens1[i]; + for(var j = 0; j < tokens2.length; j++) { + if(token == tokens2[j]) continue outer; + } + values.push(token); + } + return values; + } + + function arrayClasses (classVal) { + if (isArray(classVal)) { + return classVal; + } else if (isString(classVal)) { + return classVal.split(' '); + } else if (isObject(classVal)) { + var classes = [], i = 0; + forEach(classVal, function(v, k) { + if (v) { + classes = classes.concat(k.split(' ')); + } + }); + return classes; + } + return classVal; + } + }]; +} + +/** + * @ngdoc directive + * @name ngClass + * @restrict AC + * + * @description + * The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding + * an expression that represents all classes to be added. + * + * The directive operates in three different ways, depending on which of three types the expression + * evaluates to: + * + * 1. If the expression evaluates to a string, the string should be one or more space-delimited class + * names. + * + * 2. If the expression evaluates to an array, each element of the array should be a string that is + * one or more space-delimited class names. + * + * 3. If the expression evaluates to an object, then for each key-value pair of the + * object with a truthy value the corresponding key is used as a class name. + * + * The directive won't add duplicate classes if a particular class was already set. + * + * When the expression changes, the previously added classes are removed and only then the + * new classes are added. + * + * @animations + * add - happens just before the class is applied to the element + * remove - happens just before the class is removed from the element + * + * @element ANY + * @param {expression} ngClass {@link guide/expression Expression} to eval. The result + * of the evaluation can be a string representing space delimited class + * names, an array, or a map of class names to boolean values. In the case of a map, the + * names of the properties whose values are truthy will be added as css classes to the + * element. + * + * @example Example that demonstrates basic bindings via ngClass directive. + + +

Map Syntax Example

+ deleted (apply "strike" class)
+ important (apply "bold" class)
+ error (apply "red" class) +
+

Using String Syntax

+ +
+

Using Array Syntax

+
+
+
+
+ + .strike { + text-decoration: line-through; + } + .bold { + font-weight: bold; + } + .red { + color: red; + } + + + var ps = element.all(by.css('p')); + + it('should let you toggle the class', function() { + + expect(ps.first().getAttribute('class')).not.toMatch(/bold/); + expect(ps.first().getAttribute('class')).not.toMatch(/red/); + + element(by.model('important')).click(); + expect(ps.first().getAttribute('class')).toMatch(/bold/); + + element(by.model('error')).click(); + expect(ps.first().getAttribute('class')).toMatch(/red/); + }); + + it('should let you toggle string example', function() { + expect(ps.get(1).getAttribute('class')).toBe(''); + element(by.model('style')).clear(); + element(by.model('style')).sendKeys('red'); + expect(ps.get(1).getAttribute('class')).toBe('red'); + }); + + it('array example should have 3 classes', function() { + expect(ps.last().getAttribute('class')).toBe(''); + element(by.model('style1')).sendKeys('bold'); + element(by.model('style2')).sendKeys('strike'); + element(by.model('style3')).sendKeys('red'); + expect(ps.last().getAttribute('class')).toBe('bold strike red'); + }); + +
+ + ## Animations + + The example below demonstrates how to perform animations using ngClass. + + + + + +
+ Sample Text +
+ + .base-class { + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + } + + .base-class.my-class { + color: red; + font-size:3em; + } + + + it('should check ng-class', function() { + expect(element(by.css('.base-class')).getAttribute('class')).not. + toMatch(/my-class/); + + element(by.id('setbtn')).click(); + + expect(element(by.css('.base-class')).getAttribute('class')). + toMatch(/my-class/); + + element(by.id('clearbtn')).click(); + + expect(element(by.css('.base-class')).getAttribute('class')).not. + toMatch(/my-class/); + }); + +
+ + + ## ngClass and pre-existing CSS3 Transitions/Animations + The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure. + Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder + any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure + to view the step by step details of {@link ngAnimate.$animate#addclass $animate.addClass} and + {@link ngAnimate.$animate#removeclass $animate.removeClass}. + */ +var ngClassDirective = classDirective('', true); + +/** + * @ngdoc directive + * @name ngClassOdd + * @restrict AC + * + * @description + * The `ngClassOdd` and `ngClassEven` directives work exactly as + * {@link ng.directive:ngClass ngClass}, except they work in + * conjunction with `ngRepeat` and take effect only on odd (even) rows. + * + * This directive can be applied only within the scope of an + * {@link ng.directive:ngRepeat ngRepeat}. + * + * @element ANY + * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result + * of the evaluation can be a string representing space delimited class names or an array. + * + * @example + + +
    +
  1. + + {{name}} + +
  2. +
+
+ + .odd { + color: red; + } + .even { + color: blue; + } + + + it('should check ng-class-odd and ng-class-even', function() { + expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')). + toMatch(/odd/); + expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')). + toMatch(/even/); + }); + +
+ */ +var ngClassOddDirective = classDirective('Odd', 0); + +/** + * @ngdoc directive + * @name ngClassEven + * @restrict AC + * + * @description + * The `ngClassOdd` and `ngClassEven` directives work exactly as + * {@link ng.directive:ngClass ngClass}, except they work in + * conjunction with `ngRepeat` and take effect only on odd (even) rows. + * + * This directive can be applied only within the scope of an + * {@link ng.directive:ngRepeat ngRepeat}. + * + * @element ANY + * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The + * result of the evaluation can be a string representing space delimited class names or an array. + * + * @example + + +
    +
  1. + + {{name}}       + +
  2. +
+
+ + .odd { + color: red; + } + .even { + color: blue; + } + + + it('should check ng-class-odd and ng-class-even', function() { + expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')). + toMatch(/odd/); + expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')). + toMatch(/even/); + }); + +
+ */ +var ngClassEvenDirective = classDirective('Even', 1); + +/** + * @ngdoc directive + * @name ngCloak + * @restrict AC + * + * @description + * The `ngCloak` directive is used to prevent the Angular html template from being briefly + * displayed by the browser in its raw (uncompiled) form while your application is loading. Use this + * directive to avoid the undesirable flicker effect caused by the html template display. + * + * The directive can be applied to the `` element, but the preferred usage is to apply + * multiple `ngCloak` directives to small portions of the page to permit progressive rendering + * of the browser view. + * + * `ngCloak` works in cooperation with the following css rule embedded within `angular.js` and + * `angular.min.js`. + * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}). + * + * ```css + * [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { + * display: none !important; + * } + * ``` + * + * When this css rule is loaded by the browser, all html elements (including their children) that + * are tagged with the `ngCloak` directive are hidden. When Angular encounters this directive + * during the compilation of the template it deletes the `ngCloak` element attribute, making + * the compiled element visible. + * + * For the best result, the `angular.js` script must be loaded in the head section of the html + * document; alternatively, the css rule above must be included in the external stylesheet of the + * application. + * + * Legacy browsers, like IE7, do not provide attribute selector support (added in CSS 2.1) so they + * cannot match the `[ng\:cloak]` selector. To work around this limitation, you must add the css + * class `ng-cloak` in addition to the `ngCloak` directive as shown in the example below. + * + * @element ANY + * + * @example + + +
{{ 'hello' }}
+
{{ 'hello IE7' }}
+
+ + it('should remove the template directive and css class', function() { + expect($('#template1').getAttribute('ng-cloak')). + toBeNull(); + expect($('#template2').getAttribute('ng-cloak')). + toBeNull(); + }); + +
+ * + */ +var ngCloakDirective = ngDirective({ + compile: function(element, attr) { + attr.$set('ngCloak', undefined); + element.removeClass('ng-cloak'); + } +}); + +/** + * @ngdoc directive + * @name ngController + * + * @description + * The `ngController` directive attaches a controller class to the view. This is a key aspect of how angular + * supports the principles behind the Model-View-Controller design pattern. + * + * MVC components in angular: + * + * * Model — Models are the properties of a scope; scopes are attached to the DOM where scope properties + * are accessed through bindings. + * * View — The template (HTML with data bindings) that is rendered into the View. + * * Controller — The `ngController` directive specifies a Controller class; the class contains business + * logic behind the application to decorate the scope with functions and values + * + * Note that you can also attach controllers to the DOM by declaring it in a route definition + * via the {@link ngRoute.$route $route} service. A common mistake is to declare the controller + * again using `ng-controller` in the template itself. This will cause the controller to be attached + * and executed twice. + * + * @element ANY + * @scope + * @param {expression} ngController Name of a globally accessible constructor function or an + * {@link guide/expression expression} that on the current scope evaluates to a + * constructor function. The controller instance can be published into a scope property + * by specifying `as propertyName`. + * + * @example + * Here is a simple form for editing user contact information. Adding, removing, clearing, and + * greeting are methods declared on the controller (see source tab). These methods can + * easily be called from the angular markup. Any changes to the data are automatically reflected + * in the View without the need for a manual update. + * + * Two different declaration styles are included below: + * + * * one binds methods and properties directly onto the controller using `this`: + * `ng-controller="SettingsController1 as settings"` + * * one injects `$scope` into the controller: + * `ng-controller="SettingsController2"` + * + * The second option is more common in the Angular community, and is generally used in boilerplates + * and in this guide. However, there are advantages to binding properties directly to the controller + * and avoiding scope. + * + * * Using `controller as` makes it obvious which controller you are accessing in the template when + * multiple controllers apply to an element. + * * If you are writing your controllers as classes you have easier access to the properties and + * methods, which will appear on the scope, from inside the controller code. + * * Since there is always a `.` in the bindings, you don't have to worry about prototypal + * inheritance masking primitives. + * + * This example demonstrates the `controller as` syntax. + * + * + * + *
+ * Name: + * [ greet ]
+ * Contact: + *
    + *
  • + * + * + * [ clear + * | X ] + *
  • + *
  • [ add ]
  • + *
+ *
+ *
+ * + * angular.module('controllerAsExample', []) + * .controller('SettingsController1', SettingsController1); + * + * function SettingsController1() { + * this.name = "John Smith"; + * this.contacts = [ + * {type: 'phone', value: '408 555 1212'}, + * {type: 'email', value: 'john.smith@example.org'} ]; + * } + * + * SettingsController1.prototype.greet = function() { + * alert(this.name); + * }; + * + * SettingsController1.prototype.addContact = function() { + * this.contacts.push({type: 'email', value: 'yourname@example.org'}); + * }; + * + * SettingsController1.prototype.removeContact = function(contactToRemove) { + * var index = this.contacts.indexOf(contactToRemove); + * this.contacts.splice(index, 1); + * }; + * + * SettingsController1.prototype.clearContact = function(contact) { + * contact.type = 'phone'; + * contact.value = ''; + * }; + * + * + * it('should check controller as', function() { + * var container = element(by.id('ctrl-as-exmpl')); + * expect(container.element(by.model('settings.name')) + * .getAttribute('value')).toBe('John Smith'); + * + * var firstRepeat = + * container.element(by.repeater('contact in settings.contacts').row(0)); + * var secondRepeat = + * container.element(by.repeater('contact in settings.contacts').row(1)); + * + * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value')) + * .toBe('408 555 1212'); + * + * expect(secondRepeat.element(by.model('contact.value')).getAttribute('value')) + * .toBe('john.smith@example.org'); + * + * firstRepeat.element(by.linkText('clear')).click(); + * + * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value')) + * .toBe(''); + * + * container.element(by.linkText('add')).click(); + * + * expect(container.element(by.repeater('contact in settings.contacts').row(2)) + * .element(by.model('contact.value')) + * .getAttribute('value')) + * .toBe('yourname@example.org'); + * }); + * + *
+ * + * This example demonstrates the "attach to `$scope`" style of controller. + * + * + * + *
+ * Name: + * [ greet ]
+ * Contact: + *
    + *
  • + * + * + * [ clear + * | X ] + *
  • + *
  • [ add ]
  • + *
+ *
+ *
+ * + * angular.module('controllerExample', []) + * .controller('SettingsController2', ['$scope', SettingsController2]); + * + * function SettingsController2($scope) { + * $scope.name = "John Smith"; + * $scope.contacts = [ + * {type:'phone', value:'408 555 1212'}, + * {type:'email', value:'john.smith@example.org'} ]; + * + * $scope.greet = function() { + * alert($scope.name); + * }; + * + * $scope.addContact = function() { + * $scope.contacts.push({type:'email', value:'yourname@example.org'}); + * }; + * + * $scope.removeContact = function(contactToRemove) { + * var index = $scope.contacts.indexOf(contactToRemove); + * $scope.contacts.splice(index, 1); + * }; + * + * $scope.clearContact = function(contact) { + * contact.type = 'phone'; + * contact.value = ''; + * }; + * } + * + * + * it('should check controller', function() { + * var container = element(by.id('ctrl-exmpl')); + * + * expect(container.element(by.model('name')) + * .getAttribute('value')).toBe('John Smith'); + * + * var firstRepeat = + * container.element(by.repeater('contact in contacts').row(0)); + * var secondRepeat = + * container.element(by.repeater('contact in contacts').row(1)); + * + * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value')) + * .toBe('408 555 1212'); + * expect(secondRepeat.element(by.model('contact.value')).getAttribute('value')) + * .toBe('john.smith@example.org'); + * + * firstRepeat.element(by.linkText('clear')).click(); + * + * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value')) + * .toBe(''); + * + * container.element(by.linkText('add')).click(); + * + * expect(container.element(by.repeater('contact in contacts').row(2)) + * .element(by.model('contact.value')) + * .getAttribute('value')) + * .toBe('yourname@example.org'); + * }); + * + *
+ + */ +var ngControllerDirective = [function() { + return { + scope: true, + controller: '@', + priority: 500 + }; +}]; + +/** + * @ngdoc directive + * @name ngCsp + * + * @element html + * @description + * Enables [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) support. + * + * This is necessary when developing things like Google Chrome Extensions. + * + * CSP forbids apps to use `eval` or `Function(string)` generated functions (among other things). + * For Angular to be CSP compatible there are only two things that we need to do differently: + * + * - don't use `Function` constructor to generate optimized value getters + * - don't inject custom stylesheet into the document + * + * AngularJS uses `Function(string)` generated functions as a speed optimization. Applying the `ngCsp` + * directive will cause Angular to use CSP compatibility mode. When this mode is on AngularJS will + * evaluate all expressions up to 30% slower than in non-CSP mode, but no security violations will + * be raised. + * + * CSP forbids JavaScript to inline stylesheet rules. In non CSP mode Angular automatically + * includes some CSS rules (e.g. {@link ng.directive:ngCloak ngCloak}). + * To make those directives work in CSP mode, include the `angular-csp.css` manually. + * + * Angular tries to autodetect if CSP is active and automatically turn on the CSP-safe mode. This + * autodetection however triggers a CSP error to be logged in the console: + * + * ``` + * Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of + * script in the following Content Security Policy directive: "default-src 'self'". Note that + * 'script-src' was not explicitly set, so 'default-src' is used as a fallback. + * ``` + * + * This error is harmless but annoying. To prevent the error from showing up, put the `ngCsp` + * directive on the root element of the application or on the `angular.js` script tag, whichever + * appears first in the html document. + * + * *Note: This directive is only available in the `ng-csp` and `data-ng-csp` attribute form.* + * + * @example + * This example shows how to apply the `ngCsp` directive to the `html` tag. + ```html + + + ... + ... + + ``` + */ + +// ngCsp is not implemented as a proper directive any more, because we need it be processed while we +// bootstrap the system (before $parse is instantiated), for this reason we just have +// the csp.isActive() fn that looks for ng-csp attribute anywhere in the current doc + +/** + * @ngdoc directive + * @name ngClick + * + * @description + * The ngClick directive allows you to specify custom behavior when + * an element is clicked. + * + * @element ANY + * @priority 0 + * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon + * click. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + + + count: {{count}} + + + + it('should check ng-click', function() { + expect(element(by.binding('count')).getText()).toMatch('0'); + element(by.css('button')).click(); + expect(element(by.binding('count')).getText()).toMatch('1'); + }); + + + */ +/* + * A directive that allows creation of custom onclick handlers that are defined as angular + * expressions and are compiled and executed within the current scope. + * + * Events that are handled via these handler are always configured not to propagate further. + */ +var ngEventDirectives = {}; + +// For events that might fire synchronously during DOM manipulation +// we need to execute their event handlers asynchronously using $evalAsync, +// so that they are not executed in an inconsistent state. +var forceAsyncEvents = { + 'blur': true, + 'focus': true +}; +forEach( + 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '), + function(eventName) { + var directiveName = directiveNormalize('ng-' + eventName); + ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) { + return { + compile: function($element, attr) { + var fn = $parse(attr[directiveName]); + return function ngEventHandler(scope, element) { + element.on(eventName, function(event) { + var callback = function() { + fn(scope, {$event:event}); + }; + if (forceAsyncEvents[eventName] && $rootScope.$$phase) { + scope.$evalAsync(callback); + } else { + scope.$apply(callback); + } + }); + }; + } + }; + }]; + } +); + +/** + * @ngdoc directive + * @name ngDblclick + * + * @description + * The `ngDblclick` directive allows you to specify custom behavior on a dblclick event. + * + * @element ANY + * @priority 0 + * @param {expression} ngDblclick {@link guide/expression Expression} to evaluate upon + * a dblclick. (The Event object is available as `$event`) + * + * @example + + + + count: {{count}} + + + */ + + +/** + * @ngdoc directive + * @name ngMousedown + * + * @description + * The ngMousedown directive allows you to specify custom behavior on mousedown event. + * + * @element ANY + * @priority 0 + * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon + * mousedown. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + + count: {{count}} + + + */ + + +/** + * @ngdoc directive + * @name ngMouseup + * + * @description + * Specify custom behavior on mouseup event. + * + * @element ANY + * @priority 0 + * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon + * mouseup. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + + count: {{count}} + + + */ + +/** + * @ngdoc directive + * @name ngMouseover + * + * @description + * Specify custom behavior on mouseover event. + * + * @element ANY + * @priority 0 + * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon + * mouseover. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + + count: {{count}} + + + */ + + +/** + * @ngdoc directive + * @name ngMouseenter + * + * @description + * Specify custom behavior on mouseenter event. + * + * @element ANY + * @priority 0 + * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon + * mouseenter. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + + count: {{count}} + + + */ + + +/** + * @ngdoc directive + * @name ngMouseleave + * + * @description + * Specify custom behavior on mouseleave event. + * + * @element ANY + * @priority 0 + * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon + * mouseleave. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + + count: {{count}} + + + */ + + +/** + * @ngdoc directive + * @name ngMousemove + * + * @description + * Specify custom behavior on mousemove event. + * + * @element ANY + * @priority 0 + * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon + * mousemove. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + + count: {{count}} + + + */ + + +/** + * @ngdoc directive + * @name ngKeydown + * + * @description + * Specify custom behavior on keydown event. + * + * @element ANY + * @priority 0 + * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon + * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.) + * + * @example + + + + key down count: {{count}} + + + */ + + +/** + * @ngdoc directive + * @name ngKeyup + * + * @description + * Specify custom behavior on keyup event. + * + * @element ANY + * @priority 0 + * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon + * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.) + * + * @example + + +

Typing in the input box below updates the key count

+ key up count: {{count}} + +

Typing in the input box below updates the keycode

+ +

event keyCode: {{ event.keyCode }}

+

event altKey: {{ event.altKey }}

+
+
+ */ + + +/** + * @ngdoc directive + * @name ngKeypress + * + * @description + * Specify custom behavior on keypress event. + * + * @element ANY + * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon + * keypress. ({@link guide/expression#-event- Event object is available as `$event`} + * and can be interrogated for keyCode, altKey, etc.) + * + * @example + + + + key press count: {{count}} + + + */ + + +/** + * @ngdoc directive + * @name ngSubmit + * + * @description + * Enables binding angular expressions to onsubmit events. + * + * Additionally it prevents the default action (which for form means sending the request to the + * server and reloading the current page), but only if the form does not contain `action`, + * `data-action`, or `x-action` attributes. + * + *
+ * **Warning:** Be careful not to cause "double-submission" by using both the `ngClick` and + * `ngSubmit` handlers together. See the + * {@link form#submitting-a-form-and-preventing-the-default-action `form` directive documentation} + * for a detailed discussion of when `ngSubmit` may be triggered. + *
+ * + * @element form + * @priority 0 + * @param {expression} ngSubmit {@link guide/expression Expression} to eval. + * ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + +
+ Enter text and hit enter: + + +
list={{list}}
+
+
+ + it('should check ng-submit', function() { + expect(element(by.binding('list')).getText()).toBe('list=[]'); + element(by.css('#submit')).click(); + expect(element(by.binding('list')).getText()).toContain('hello'); + expect(element(by.model('text')).getAttribute('value')).toBe(''); + }); + it('should ignore empty strings', function() { + expect(element(by.binding('list')).getText()).toBe('list=[]'); + element(by.css('#submit')).click(); + element(by.css('#submit')).click(); + expect(element(by.binding('list')).getText()).toContain('hello'); + }); + +
+ */ + +/** + * @ngdoc directive + * @name ngFocus + * + * @description + * Specify custom behavior on focus event. + * + * Note: As the `focus` event is executed synchronously when calling `input.focus()` + * AngularJS executes the expression using `scope.$evalAsync` if the event is fired + * during an `$apply` to ensure a consistent state. + * + * @element window, input, select, textarea, a + * @priority 0 + * @param {expression} ngFocus {@link guide/expression Expression} to evaluate upon + * focus. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + +/** + * @ngdoc directive + * @name ngBlur + * + * @description + * Specify custom behavior on blur event. + * + * A [blur event](https://developer.mozilla.org/en-US/docs/Web/Events/blur) fires when + * an element has lost focus. + * + * Note: As the `blur` event is executed synchronously also during DOM manipulations + * (e.g. removing a focussed input), + * AngularJS executes the expression using `scope.$evalAsync` if the event is fired + * during an `$apply` to ensure a consistent state. + * + * @element window, input, select, textarea, a + * @priority 0 + * @param {expression} ngBlur {@link guide/expression Expression} to evaluate upon + * blur. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + +/** + * @ngdoc directive + * @name ngCopy + * + * @description + * Specify custom behavior on copy event. + * + * @element window, input, select, textarea, a + * @priority 0 + * @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon + * copy. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + + copied: {{copied}} + + + */ + +/** + * @ngdoc directive + * @name ngCut + * + * @description + * Specify custom behavior on cut event. + * + * @element window, input, select, textarea, a + * @priority 0 + * @param {expression} ngCut {@link guide/expression Expression} to evaluate upon + * cut. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + + cut: {{cut}} + + + */ + +/** + * @ngdoc directive + * @name ngPaste + * + * @description + * Specify custom behavior on paste event. + * + * @element window, input, select, textarea, a + * @priority 0 + * @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon + * paste. ({@link guide/expression#-event- Event object is available as `$event`}) + * + * @example + + + + pasted: {{paste}} + + + */ + +/** + * @ngdoc directive + * @name ngIf + * @restrict A + * + * @description + * The `ngIf` directive removes or recreates a portion of the DOM tree based on an + * {expression}. If the expression assigned to `ngIf` evaluates to a false + * value then the element is removed from the DOM, otherwise a clone of the + * element is reinserted into the DOM. + * + * `ngIf` differs from `ngShow` and `ngHide` in that `ngIf` completely removes and recreates the + * element in the DOM rather than changing its visibility via the `display` css property. A common + * case when this difference is significant is when using css selectors that rely on an element's + * position within the DOM, such as the `:first-child` or `:last-child` pseudo-classes. + * + * Note that when an element is removed using `ngIf` its scope is destroyed and a new scope + * is created when the element is restored. The scope created within `ngIf` inherits from + * its parent scope using + * [prototypal inheritance](https://github.com/angular/angular.js/wiki/The-Nuances-of-Scope-Prototypal-Inheritance). + * An important implication of this is if `ngModel` is used within `ngIf` to bind to + * a javascript primitive defined in the parent scope. In this case any modifications made to the + * variable within the child scope will override (hide) the value in the parent scope. + * + * Also, `ngIf` recreates elements using their compiled state. An example of this behavior + * is if an element's class attribute is directly modified after it's compiled, using something like + * jQuery's `.addClass()` method, and the element is later removed. When `ngIf` recreates the element + * the added class will be lost because the original compiled state is used to regenerate the element. + * + * Additionally, you can provide animations via the `ngAnimate` module to animate the `enter` + * and `leave` effects. + * + * @animations + * enter - happens just after the ngIf contents change and a new DOM element is created and injected into the ngIf container + * leave - happens just before the ngIf contents are removed from the DOM + * + * @element ANY + * @scope + * @priority 600 + * @param {expression} ngIf If the {@link guide/expression expression} is falsy then + * the element is removed from the DOM tree. If it is truthy a copy of the compiled + * element is added to the DOM tree. + * + * @example + + + Click me:
+ Show when checked: + + I'm removed when the checkbox is unchecked. + +
+ + .animate-if { + background:white; + border:1px solid black; + padding:10px; + } + + .animate-if.ng-enter, .animate-if.ng-leave { + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + } + + .animate-if.ng-enter, + .animate-if.ng-leave.ng-leave-active { + opacity:0; + } + + .animate-if.ng-leave, + .animate-if.ng-enter.ng-enter-active { + opacity:1; + } + +
+ */ +var ngIfDirective = ['$animate', function($animate) { + return { + transclude: 'element', + priority: 600, + terminal: true, + restrict: 'A', + $$tlb: true, + link: function ($scope, $element, $attr, ctrl, $transclude) { + var block, childScope, previousElements; + $scope.$watch($attr.ngIf, function ngIfWatchAction(value) { + + if (toBoolean(value)) { + if (!childScope) { + childScope = $scope.$new(); + $transclude(childScope, function (clone) { + clone[clone.length++] = document.createComment(' end ngIf: ' + $attr.ngIf + ' '); + // Note: We only need the first/last node of the cloned nodes. + // However, we need to keep the reference to the jqlite wrapper as it might be changed later + // by a directive with templateUrl when its template arrives. + block = { + clone: clone + }; + $animate.enter(clone, $element.parent(), $element); + }); + } + } else { + if(previousElements) { + previousElements.remove(); + previousElements = null; + } + if(childScope) { + childScope.$destroy(); + childScope = null; + } + if(block) { + previousElements = getBlockElements(block.clone); + $animate.leave(previousElements, function() { + previousElements = null; + }); + block = null; + } + } + }); + } + }; +}]; + +/** + * @ngdoc directive + * @name ngInclude + * @restrict ECA + * + * @description + * Fetches, compiles and includes an external HTML fragment. + * + * By default, the template URL is restricted to the same domain and protocol as the + * application document. This is done by calling {@link ng.$sce#getTrustedResourceUrl + * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols + * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or + * [wrap them](ng.$sce#trustAsResourceUrl) as trusted values. Refer to Angular's {@link + * ng.$sce Strict Contextual Escaping}. + * + * In addition, the browser's + * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest) + * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/) + * policy may further restrict whether the template is successfully loaded. + * For example, `ngInclude` won't work for cross-domain requests on all browsers and for `file://` + * access on some browsers. + * + * @animations + * enter - animation is used to bring new content into the browser. + * leave - animation is used to animate existing content away. + * + * The enter and leave animation occur concurrently. + * + * @scope + * @priority 400 + * + * @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant, + * make sure you wrap it in **single** quotes, e.g. `src="'myPartialTemplate.html'"`. + * @param {string=} onload Expression to evaluate when a new partial is loaded. + * + * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll + * $anchorScroll} to scroll the viewport after the content is loaded. + * + * - If the attribute is not set, disable scrolling. + * - If the attribute is set without value, enable scrolling. + * - Otherwise enable scrolling only if the expression evaluates to truthy value. + * + * @example + + +
+ + url of the template: {{template.url}} +
+
+
+
+
+
+ + angular.module('includeExample', ['ngAnimate']) + .controller('ExampleController', ['$scope', function($scope) { + $scope.templates = + [ { name: 'template1.html', url: 'template1.html'}, + { name: 'template2.html', url: 'template2.html'} ]; + $scope.template = $scope.templates[0]; + }]); + + + Content of template1.html + + + Content of template2.html + + + .slide-animate-container { + position:relative; + background:white; + border:1px solid black; + height:40px; + overflow:hidden; + } + + .slide-animate { + padding:10px; + } + + .slide-animate.ng-enter, .slide-animate.ng-leave { + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + + position:absolute; + top:0; + left:0; + right:0; + bottom:0; + display:block; + padding:10px; + } + + .slide-animate.ng-enter { + top:-50px; + } + .slide-animate.ng-enter.ng-enter-active { + top:0; + } + + .slide-animate.ng-leave { + top:0; + } + .slide-animate.ng-leave.ng-leave-active { + top:50px; + } + + + var templateSelect = element(by.model('template')); + var includeElem = element(by.css('[ng-include]')); + + it('should load template1.html', function() { + expect(includeElem.getText()).toMatch(/Content of template1.html/); + }); + + it('should load template2.html', function() { + if (browser.params.browser == 'firefox') { + // Firefox can't handle using selects + // See https://github.com/angular/protractor/issues/480 + return; + } + templateSelect.click(); + templateSelect.all(by.css('option')).get(2).click(); + expect(includeElem.getText()).toMatch(/Content of template2.html/); + }); + + it('should change to blank', function() { + if (browser.params.browser == 'firefox') { + // Firefox can't handle using selects + return; + } + templateSelect.click(); + templateSelect.all(by.css('option')).get(0).click(); + expect(includeElem.isPresent()).toBe(false); + }); + +
+ */ + + +/** + * @ngdoc event + * @name ngInclude#$includeContentRequested + * @eventType emit on the scope ngInclude was declared in + * @description + * Emitted every time the ngInclude content is requested. + */ + + +/** + * @ngdoc event + * @name ngInclude#$includeContentLoaded + * @eventType emit on the current ngInclude scope + * @description + * Emitted every time the ngInclude content is reloaded. + */ +var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$animate', '$sce', + function($http, $templateCache, $anchorScroll, $animate, $sce) { + return { + restrict: 'ECA', + priority: 400, + terminal: true, + transclude: 'element', + controller: angular.noop, + compile: function(element, attr) { + var srcExp = attr.ngInclude || attr.src, + onloadExp = attr.onload || '', + autoScrollExp = attr.autoscroll; + + return function(scope, $element, $attr, ctrl, $transclude) { + var changeCounter = 0, + currentScope, + previousElement, + currentElement; + + var cleanupLastIncludeContent = function() { + if(previousElement) { + previousElement.remove(); + previousElement = null; + } + if(currentScope) { + currentScope.$destroy(); + currentScope = null; + } + if(currentElement) { + $animate.leave(currentElement, function() { + previousElement = null; + }); + previousElement = currentElement; + currentElement = null; + } + }; + + scope.$watch($sce.parseAsResourceUrl(srcExp), function ngIncludeWatchAction(src) { + var afterAnimation = function() { + if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) { + $anchorScroll(); + } + }; + var thisChangeId = ++changeCounter; + + if (src) { + $http.get(src, {cache: $templateCache}).success(function(response) { + if (thisChangeId !== changeCounter) return; + var newScope = scope.$new(); + ctrl.template = response; + + // Note: This will also link all children of ng-include that were contained in the original + // html. If that content contains controllers, ... they could pollute/change the scope. + // However, using ng-include on an element with additional content does not make sense... + // Note: We can't remove them in the cloneAttchFn of $transclude as that + // function is called before linking the content, which would apply child + // directives to non existing elements. + var clone = $transclude(newScope, function(clone) { + cleanupLastIncludeContent(); + $animate.enter(clone, null, $element, afterAnimation); + }); + + currentScope = newScope; + currentElement = clone; + + currentScope.$emit('$includeContentLoaded'); + scope.$eval(onloadExp); + }).error(function() { + if (thisChangeId === changeCounter) cleanupLastIncludeContent(); + }); + scope.$emit('$includeContentRequested'); + } else { + cleanupLastIncludeContent(); + ctrl.template = null; + } + }); + }; + } + }; +}]; + +// This directive is called during the $transclude call of the first `ngInclude` directive. +// It will replace and compile the content of the element with the loaded template. +// We need this directive so that the element content is already filled when +// the link function of another directive on the same element as ngInclude +// is called. +var ngIncludeFillContentDirective = ['$compile', + function($compile) { + return { + restrict: 'ECA', + priority: -400, + require: 'ngInclude', + link: function(scope, $element, $attr, ctrl) { + $element.html(ctrl.template); + $compile($element.contents())(scope); + } + }; + }]; + +/** + * @ngdoc directive + * @name ngInit + * @restrict AC + * + * @description + * The `ngInit` directive allows you to evaluate an expression in the + * current scope. + * + *
+ * The only appropriate use of `ngInit` is for aliasing special properties of + * {@link ng.directive:ngRepeat `ngRepeat`}, as seen in the demo below. Besides this case, you + * should use {@link guide/controller controllers} rather than `ngInit` + * to initialize values on a scope. + *
+ *
+ * **Note**: If you have assignment in `ngInit` along with {@link ng.$filter `$filter`}, make + * sure you have parenthesis for correct precedence: + *
+ *   
+ *
+ *
+ * + * @priority 450 + * + * @element ANY + * @param {expression} ngInit {@link guide/expression Expression} to eval. + * + * @example + + + +
+
+
+ list[ {{outerIndex}} ][ {{innerIndex}} ] = {{value}}; +
+
+
+
+ + it('should alias index positions', function() { + var elements = element.all(by.css('.example-init')); + expect(elements.get(0).getText()).toBe('list[ 0 ][ 0 ] = a;'); + expect(elements.get(1).getText()).toBe('list[ 0 ][ 1 ] = b;'); + expect(elements.get(2).getText()).toBe('list[ 1 ][ 0 ] = c;'); + expect(elements.get(3).getText()).toBe('list[ 1 ][ 1 ] = d;'); + }); + +
+ */ +var ngInitDirective = ngDirective({ + priority: 450, + compile: function() { + return { + pre: function(scope, element, attrs) { + scope.$eval(attrs.ngInit); + } + }; + } +}); + +/** + * @ngdoc directive + * @name ngNonBindable + * @restrict AC + * @priority 1000 + * + * @description + * The `ngNonBindable` directive tells Angular not to compile or bind the contents of the current + * DOM element. This is useful if the element contains what appears to be Angular directives and + * bindings but which should be ignored by Angular. This could be the case if you have a site that + * displays snippets of code, for instance. + * + * @element ANY + * + * @example + * In this example there are two locations where a simple interpolation binding (`{{}}`) is present, + * but the one wrapped in `ngNonBindable` is left alone. + * + * @example + + +
Normal: {{1 + 2}}
+
Ignored: {{1 + 2}}
+
+ + it('should check ng-non-bindable', function() { + expect(element(by.binding('1 + 2')).getText()).toContain('3'); + expect(element.all(by.css('div')).last().getText()).toMatch(/1 \+ 2/); + }); + +
+ */ +var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 }); + +/** + * @ngdoc directive + * @name ngPluralize + * @restrict EA + * + * @description + * `ngPluralize` is a directive that displays messages according to en-US localization rules. + * These rules are bundled with angular.js, but can be overridden + * (see {@link guide/i18n Angular i18n} dev guide). You configure ngPluralize directive + * by specifying the mappings between + * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html) + * and the strings to be displayed. + * + * # Plural categories and explicit number rules + * There are two + * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html) + * in Angular's default en-US locale: "one" and "other". + * + * While a plural category may match many numbers (for example, in en-US locale, "other" can match + * any number that is not 1), an explicit number rule can only match one number. For example, the + * explicit number rule for "3" matches the number 3. There are examples of plural categories + * and explicit number rules throughout the rest of this documentation. + * + * # Configuring ngPluralize + * You configure ngPluralize by providing 2 attributes: `count` and `when`. + * You can also provide an optional attribute, `offset`. + * + * The value of the `count` attribute can be either a string or an {@link guide/expression + * Angular expression}; these are evaluated on the current scope for its bound value. + * + * The `when` attribute specifies the mappings between plural categories and the actual + * string to be displayed. The value of the attribute should be a JSON object. + * + * The following example shows how to configure ngPluralize: + * + * ```html + * + * + *``` + * + * In the example, `"0: Nobody is viewing."` is an explicit number rule. If you did not + * specify this rule, 0 would be matched to the "other" category and "0 people are viewing" + * would be shown instead of "Nobody is viewing". You can specify an explicit number rule for + * other numbers, for example 12, so that instead of showing "12 people are viewing", you can + * show "a dozen people are viewing". + * + * You can use a set of closed braces (`{}`) as a placeholder for the number that you want substituted + * into pluralized strings. In the previous example, Angular will replace `{}` with + * `{{personCount}}`. The closed braces `{}` is a placeholder + * for {{numberExpression}}. + * + * # Configuring ngPluralize with offset + * The `offset` attribute allows further customization of pluralized text, which can result in + * a better user experience. For example, instead of the message "4 people are viewing this document", + * you might display "John, Kate and 2 others are viewing this document". + * The offset attribute allows you to offset a number by any desired value. + * Let's take a look at an example: + * + * ```html + * + * + * ``` + * + * Notice that we are still using two plural categories(one, other), but we added + * three explicit number rules 0, 1 and 2. + * When one person, perhaps John, views the document, "John is viewing" will be shown. + * When three people view the document, no explicit number rule is found, so + * an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category. + * In this case, plural category 'one' is matched and "John, Mary and one other person are viewing" + * is shown. + * + * Note that when you specify offsets, you must provide explicit number rules for + * numbers from 0 up to and including the offset. If you use an offset of 3, for example, + * you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for + * plural categories "one" and "other". + * + * @param {string|expression} count The variable to be bound to. + * @param {string} when The mapping between plural category to its corresponding strings. + * @param {number=} offset Offset to deduct from the total number. + * + * @example + + + +
+ Person 1:
+ Person 2:
+ Number of People:
+ + + Without Offset: + +
+ + + With Offset(2): + + +
+
+ + it('should show correct pluralized string', function() { + var withoutOffset = element.all(by.css('ng-pluralize')).get(0); + var withOffset = element.all(by.css('ng-pluralize')).get(1); + var countInput = element(by.model('personCount')); + + expect(withoutOffset.getText()).toEqual('1 person is viewing.'); + expect(withOffset.getText()).toEqual('Igor is viewing.'); + + countInput.clear(); + countInput.sendKeys('0'); + + expect(withoutOffset.getText()).toEqual('Nobody is viewing.'); + expect(withOffset.getText()).toEqual('Nobody is viewing.'); + + countInput.clear(); + countInput.sendKeys('2'); + + expect(withoutOffset.getText()).toEqual('2 people are viewing.'); + expect(withOffset.getText()).toEqual('Igor and Misko are viewing.'); + + countInput.clear(); + countInput.sendKeys('3'); + + expect(withoutOffset.getText()).toEqual('3 people are viewing.'); + expect(withOffset.getText()).toEqual('Igor, Misko and one other person are viewing.'); + + countInput.clear(); + countInput.sendKeys('4'); + + expect(withoutOffset.getText()).toEqual('4 people are viewing.'); + expect(withOffset.getText()).toEqual('Igor, Misko and 2 other people are viewing.'); + }); + it('should show data-bound names', function() { + var withOffset = element.all(by.css('ng-pluralize')).get(1); + var personCount = element(by.model('personCount')); + var person1 = element(by.model('person1')); + var person2 = element(by.model('person2')); + personCount.clear(); + personCount.sendKeys('4'); + person1.clear(); + person1.sendKeys('Di'); + person2.clear(); + person2.sendKeys('Vojta'); + expect(withOffset.getText()).toEqual('Di, Vojta and 2 other people are viewing.'); + }); + +
+ */ +var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interpolate) { + var BRACE = /{}/g; + return { + restrict: 'EA', + link: function(scope, element, attr) { + var numberExp = attr.count, + whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs + offset = attr.offset || 0, + whens = scope.$eval(whenExp) || {}, + whensExpFns = {}, + startSymbol = $interpolate.startSymbol(), + endSymbol = $interpolate.endSymbol(), + isWhen = /^when(Minus)?(.+)$/; + + forEach(attr, function(expression, attributeName) { + if (isWhen.test(attributeName)) { + whens[lowercase(attributeName.replace('when', '').replace('Minus', '-'))] = + element.attr(attr.$attr[attributeName]); + } + }); + forEach(whens, function(expression, key) { + whensExpFns[key] = + $interpolate(expression.replace(BRACE, startSymbol + numberExp + '-' + + offset + endSymbol)); + }); + + scope.$watch(function ngPluralizeWatch() { + var value = parseFloat(scope.$eval(numberExp)); + + if (!isNaN(value)) { + //if explicit number rule such as 1, 2, 3... is defined, just use it. Otherwise, + //check it against pluralization rules in $locale service + if (!(value in whens)) value = $locale.pluralCat(value - offset); + return whensExpFns[value](scope, element, true); + } else { + return ''; + } + }, function ngPluralizeWatchAction(newVal) { + element.text(newVal); + }); + } + }; +}]; + +/** + * @ngdoc directive + * @name ngRepeat + * + * @description + * The `ngRepeat` directive instantiates a template once per item from a collection. Each template + * instance gets its own scope, where the given loop variable is set to the current collection item, + * and `$index` is set to the item index or key. + * + * Special properties are exposed on the local scope of each template instance, including: + * + * | Variable | Type | Details | + * |-----------|-----------------|-----------------------------------------------------------------------------| + * | `$index` | {@type number} | iterator offset of the repeated element (0..length-1) | + * | `$first` | {@type boolean} | true if the repeated element is first in the iterator. | + * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. | + * | `$last` | {@type boolean} | true if the repeated element is last in the iterator. | + * | `$even` | {@type boolean} | true if the iterator position `$index` is even (otherwise false). | + * | `$odd` | {@type boolean} | true if the iterator position `$index` is odd (otherwise false). | + * + * Creating aliases for these properties is possible with {@link ng.directive:ngInit `ngInit`}. + * This may be useful when, for instance, nesting ngRepeats. + * + * # Special repeat start and end points + * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending + * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively. + * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on) + * up to and including the ending HTML tag where **ng-repeat-end** is placed. + * + * The example below makes use of this feature: + * ```html + *
+ * Header {{ item }} + *
+ *
+ * Body {{ item }} + *
+ *
+ * Footer {{ item }} + *
+ * ``` + * + * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to: + * ```html + *
+ * Header A + *
+ *
+ * Body A + *
+ *
+ * Footer A + *
+ *
+ * Header B + *
+ *
+ * Body B + *
+ *
+ * Footer B + *
+ * ``` + * + * The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such + * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**). + * + * @animations + * **.enter** - when a new item is added to the list or when an item is revealed after a filter + * + * **.leave** - when an item is removed from the list or when an item is filtered out + * + * **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered + * + * @element ANY + * @scope + * @priority 1000 + * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These + * formats are currently supported: + * + * * `variable in expression` – where variable is the user defined loop variable and `expression` + * is a scope expression giving the collection to enumerate. + * + * For example: `album in artist.albums`. + * + * * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers, + * and `expression` is the scope expression giving the collection to enumerate. + * + * For example: `(name, age) in {'adam':10, 'amalie':12}`. + * + * * `variable in expression track by tracking_expression` – You can also provide an optional tracking function + * which can be used to associate the objects in the collection with the DOM elements. If no tracking function + * is specified the ng-repeat associates elements by identity in the collection. It is an error to have + * more than one tracking function to resolve to the same key. (This would mean that two distinct objects are + * mapped to the same DOM element, which is not possible.) Filters should be applied to the expression, + * before specifying a tracking expression. + * + * For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements + * will be associated by item identity in the array. + * + * For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique + * `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements + * with the corresponding item in the array by identity. Moving the same object in array would move the DOM + * element in the same way in the DOM. + * + * For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this + * case the object identity does not matter. Two objects are considered equivalent as long as their `id` + * property is same. + * + * For example: `item in items | filter:searchText track by item.id` is a pattern that might be used to apply a filter + * to items in conjunction with a tracking expression. + * + * @example + * This example initializes the scope to a list of names and + * then uses `ngRepeat` to display every person: + + +
+ I have {{friends.length}} friends. They are: + +
    +
  • + [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old. +
  • +
+
+
+ + .example-animate-container { + background:white; + border:1px solid black; + list-style:none; + margin:0; + padding:0 10px; + } + + .animate-repeat { + line-height:40px; + list-style:none; + box-sizing:border-box; + } + + .animate-repeat.ng-move, + .animate-repeat.ng-enter, + .animate-repeat.ng-leave { + -webkit-transition:all linear 0.5s; + transition:all linear 0.5s; + } + + .animate-repeat.ng-leave.ng-leave-active, + .animate-repeat.ng-move, + .animate-repeat.ng-enter { + opacity:0; + max-height:0; + } + + .animate-repeat.ng-leave, + .animate-repeat.ng-move.ng-move-active, + .animate-repeat.ng-enter.ng-enter-active { + opacity:1; + max-height:40px; + } + + + var friends = element.all(by.repeater('friend in friends')); + + it('should render initial data set', function() { + expect(friends.count()).toBe(10); + expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.'); + expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.'); + expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.'); + expect(element(by.binding('friends.length')).getText()) + .toMatch("I have 10 friends. They are:"); + }); + + it('should update repeater when filter predicate changes', function() { + expect(friends.count()).toBe(10); + + element(by.model('q')).sendKeys('ma'); + + expect(friends.count()).toBe(2); + expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.'); + expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.'); + }); + +
+ */ +var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) { + var NG_REMOVED = '$$NG_REMOVED'; + var ngRepeatMinErr = minErr('ngRepeat'); + return { + transclude: 'element', + priority: 1000, + terminal: true, + $$tlb: true, + link: function($scope, $element, $attr, ctrl, $transclude){ + var expression = $attr.ngRepeat; + var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/), + trackByExp, trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn, + lhs, rhs, valueIdentifier, keyIdentifier, + hashFnLocals = {$id: hashKey}; + + if (!match) { + throw ngRepeatMinErr('iexp', "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.", + expression); + } + + lhs = match[1]; + rhs = match[2]; + trackByExp = match[3]; + + if (trackByExp) { + trackByExpGetter = $parse(trackByExp); + trackByIdExpFn = function(key, value, index) { + // assign key, value, and $index to the locals so that they can be used in hash functions + if (keyIdentifier) hashFnLocals[keyIdentifier] = key; + hashFnLocals[valueIdentifier] = value; + hashFnLocals.$index = index; + return trackByExpGetter($scope, hashFnLocals); + }; + } else { + trackByIdArrayFn = function(key, value) { + return hashKey(value); + }; + trackByIdObjFn = function(key) { + return key; + }; + } + + match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/); + if (!match) { + throw ngRepeatMinErr('iidexp', "'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.", + lhs); + } + valueIdentifier = match[3] || match[1]; + keyIdentifier = match[2]; + + // Store a list of elements from previous run. This is a hash where key is the item from the + // iterator, and the value is objects with following properties. + // - scope: bound scope + // - element: previous element. + // - index: position + var lastBlockMap = {}; + + //watch props + $scope.$watchCollection(rhs, function ngRepeatAction(collection){ + var index, length, + previousNode = $element[0], // current position of the node + nextNode, + // Same as lastBlockMap but it has the current state. It will become the + // lastBlockMap on the next iteration. + nextBlockMap = {}, + arrayLength, + childScope, + key, value, // key/value of iteration + trackById, + trackByIdFn, + collectionKeys, + block, // last object information {scope, element, id} + nextBlockOrder = [], + elementsToRemove; + + + if (isArrayLike(collection)) { + collectionKeys = collection; + trackByIdFn = trackByIdExpFn || trackByIdArrayFn; + } else { + trackByIdFn = trackByIdExpFn || trackByIdObjFn; + // if object, extract keys, sort them and use to determine order of iteration over obj props + collectionKeys = []; + for (key in collection) { + if (collection.hasOwnProperty(key) && key.charAt(0) != '$') { + collectionKeys.push(key); + } + } + collectionKeys.sort(); + } + + arrayLength = collectionKeys.length; + + // locate existing items + length = nextBlockOrder.length = collectionKeys.length; + for(index = 0; index < length; index++) { + key = (collection === collectionKeys) ? index : collectionKeys[index]; + value = collection[key]; + trackById = trackByIdFn(key, value, index); + assertNotHasOwnProperty(trackById, '`track by` id'); + if(lastBlockMap.hasOwnProperty(trackById)) { + block = lastBlockMap[trackById]; + delete lastBlockMap[trackById]; + nextBlockMap[trackById] = block; + nextBlockOrder[index] = block; + } else if (nextBlockMap.hasOwnProperty(trackById)) { + // restore lastBlockMap + forEach(nextBlockOrder, function(block) { + if (block && block.scope) lastBlockMap[block.id] = block; + }); + // This is a duplicate and we need to throw an error + throw ngRepeatMinErr('dupes', + "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}", + expression, trackById, toJson(value)); + } else { + // new never before seen block + nextBlockOrder[index] = { id: trackById }; + nextBlockMap[trackById] = false; + } + } + + // remove existing items + for (key in lastBlockMap) { + // lastBlockMap is our own object so we don't need to use special hasOwnPropertyFn + if (lastBlockMap.hasOwnProperty(key)) { + block = lastBlockMap[key]; + elementsToRemove = getBlockElements(block.clone); + $animate.leave(elementsToRemove); + forEach(elementsToRemove, function(element) { element[NG_REMOVED] = true; }); + block.scope.$destroy(); + } + } + + // we are not using forEach for perf reasons (trying to avoid #call) + for (index = 0, length = collectionKeys.length; index < length; index++) { + key = (collection === collectionKeys) ? index : collectionKeys[index]; + value = collection[key]; + block = nextBlockOrder[index]; + if (nextBlockOrder[index - 1]) previousNode = getBlockEnd(nextBlockOrder[index - 1]); + + if (block.scope) { + // if we have already seen this object, then we need to reuse the + // associated scope/element + childScope = block.scope; + + nextNode = previousNode; + do { + nextNode = nextNode.nextSibling; + } while(nextNode && nextNode[NG_REMOVED]); + + if (getBlockStart(block) != nextNode) { + // existing item which got moved + $animate.move(getBlockElements(block.clone), null, jqLite(previousNode)); + } + previousNode = getBlockEnd(block); + } else { + // new item which we don't know about + childScope = $scope.$new(); + } + + childScope[valueIdentifier] = value; + if (keyIdentifier) childScope[keyIdentifier] = key; + childScope.$index = index; + childScope.$first = (index === 0); + childScope.$last = (index === (arrayLength - 1)); + childScope.$middle = !(childScope.$first || childScope.$last); + // jshint bitwise: false + childScope.$odd = !(childScope.$even = (index&1) === 0); + // jshint bitwise: true + + if (!block.scope) { + $transclude(childScope, function(clone) { + clone[clone.length++] = document.createComment(' end ngRepeat: ' + expression + ' '); + $animate.enter(clone, null, jqLite(previousNode)); + previousNode = clone; + block.scope = childScope; + // Note: We only need the first/last node of the cloned nodes. + // However, we need to keep the reference to the jqlite wrapper as it might be changed later + // by a directive with templateUrl when its template arrives. + block.clone = clone; + nextBlockMap[block.id] = block; + }); + } + } + lastBlockMap = nextBlockMap; + }); + } + }; + + function getBlockStart(block) { + return block.clone[0]; + } + + function getBlockEnd(block) { + return block.clone[block.clone.length - 1]; + } +}]; + +/** + * @ngdoc directive + * @name ngShow + * + * @description + * The `ngShow` directive shows or hides the given HTML element based on the expression + * provided to the `ngShow` attribute. The element is shown or hidden by removing or adding + * the `.ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined + * in AngularJS and sets the display style to none (using an !important flag). + * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}). + * + * ```html + * + *
+ * + * + *
+ * ``` + * + * When the `ngShow` expression evaluates to false then the `.ng-hide` CSS class is added to the class attribute + * on the element causing it to become hidden. When true, the `.ng-hide` CSS class is removed + * from the element causing the element not to appear hidden. + * + *
+ * **Note:** Here is a list of values that ngShow will consider as a falsy value (case insensitive):
+ * "f" / "0" / "false" / "no" / "n" / "[]" + *
+ * + * ## Why is !important used? + * + * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector + * can be easily overridden by heavier selectors. For example, something as simple + * as changing the display style on a HTML list item would make hidden elements appear visible. + * This also becomes a bigger issue when dealing with CSS frameworks. + * + * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector + * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the + * styling to change how to hide an element then it is just a matter of using !important in their own CSS code. + * + * ### Overriding `.ng-hide` + * + * By default, the `.ng-hide` class will style the element with `display:none!important`. If you wish to change + * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide` + * class in CSS: + * + * ```css + * .ng-hide { + * //this is just another form of hiding an element + * display:block!important; + * position:absolute; + * top:-9999px; + * left:-9999px; + * } + * ``` + * + * By default you don't need to override in CSS anything and the animations will work around the display style. + * + * ## A note about animations with `ngShow` + * + * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression + * is true and false. This system works like the animation system present with ngClass except that + * you must also include the !important flag to override the display property + * so that you can perform an animation when the element is hidden during the time of the animation. + * + * ```css + * // + * //a working example can be found at the bottom of this page + * // + * .my-element.ng-hide-add, .my-element.ng-hide-remove { + * transition:0.5s linear all; + * } + * + * .my-element.ng-hide-add { ... } + * .my-element.ng-hide-add.ng-hide-add-active { ... } + * .my-element.ng-hide-remove { ... } + * .my-element.ng-hide-remove.ng-hide-remove-active { ... } + * ``` + * + * Keep in mind that, as of AngularJS version 1.2.17 (and 1.3.0-beta.11), there is no need to change the display + * property to block during animation states--ngAnimate will handle the style toggling automatically for you. + * + * @animations + * addClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a truthy value and the just before contents are set to visible + * removeClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden + * + * @element ANY + * @param {expression} ngShow If the {@link guide/expression expression} is truthy + * then the element is shown or hidden respectively. + * + * @example + + + Click me:
+
+ Show: +
+ I show up when your checkbox is checked. +
+
+
+ Hide: +
+ I hide when your checkbox is checked. +
+
+
+ + @import url(//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css); + + + .animate-show { + -webkit-transition:all linear 0.5s; + transition:all linear 0.5s; + line-height:20px; + opacity:1; + padding:10px; + border:1px solid black; + background:white; + } + + .animate-show.ng-hide { + line-height:0; + opacity:0; + padding:0 10px; + } + + .check-element { + padding:10px; + border:1px solid black; + background:white; + } + + + var thumbsUp = element(by.css('span.glyphicon-thumbs-up')); + var thumbsDown = element(by.css('span.glyphicon-thumbs-down')); + + it('should check ng-show / ng-hide', function() { + expect(thumbsUp.isDisplayed()).toBeFalsy(); + expect(thumbsDown.isDisplayed()).toBeTruthy(); + + element(by.model('checked')).click(); + + expect(thumbsUp.isDisplayed()).toBeTruthy(); + expect(thumbsDown.isDisplayed()).toBeFalsy(); + }); + +
+ */ +var ngShowDirective = ['$animate', function($animate) { + return function(scope, element, attr) { + scope.$watch(attr.ngShow, function ngShowWatchAction(value){ + $animate[toBoolean(value) ? 'removeClass' : 'addClass'](element, 'ng-hide'); + }); + }; +}]; + + +/** + * @ngdoc directive + * @name ngHide + * + * @description + * The `ngHide` directive shows or hides the given HTML element based on the expression + * provided to the `ngHide` attribute. The element is shown or hidden by removing or adding + * the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined + * in AngularJS and sets the display style to none (using an !important flag). + * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}). + * + * ```html + * + *
+ * + * + *
+ * ``` + * + * When the `.ngHide` expression evaluates to true then the `.ng-hide` CSS class is added to the class attribute + * on the element causing it to become hidden. When false, the `.ng-hide` CSS class is removed + * from the element causing the element not to appear hidden. + * + *
+ * **Note:** Here is a list of values that ngHide will consider as a falsy value (case insensitive):
+ * "f" / "0" / "false" / "no" / "n" / "[]" + *
+ * + * ## Why is !important used? + * + * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector + * can be easily overridden by heavier selectors. For example, something as simple + * as changing the display style on a HTML list item would make hidden elements appear visible. + * This also becomes a bigger issue when dealing with CSS frameworks. + * + * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector + * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the + * styling to change how to hide an element then it is just a matter of using !important in their own CSS code. + * + * ### Overriding `.ng-hide` + * + * By default, the `.ng-hide` class will style the element with `display:none!important`. If you wish to change + * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide` + * class in CSS: + * + * ```css + * .ng-hide { + * //this is just another form of hiding an element + * display:block!important; + * position:absolute; + * top:-9999px; + * left:-9999px; + * } + * ``` + * + * By default you don't need to override in CSS anything and the animations will work around the display style. + * + * ## A note about animations with `ngHide` + * + * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression + * is true and false. This system works like the animation system present with ngClass, except that the `.ng-hide` + * CSS class is added and removed for you instead of your own CSS class. + * + * ```css + * // + * //a working example can be found at the bottom of this page + * // + * .my-element.ng-hide-add, .my-element.ng-hide-remove { + * transition:0.5s linear all; + * } + * + * .my-element.ng-hide-add { ... } + * .my-element.ng-hide-add.ng-hide-add-active { ... } + * .my-element.ng-hide-remove { ... } + * .my-element.ng-hide-remove.ng-hide-remove-active { ... } + * ``` + * + * Keep in mind that, as of AngularJS version 1.2.17 (and 1.3.0-beta.11), there is no need to change the display + * property to block during animation states--ngAnimate will handle the style toggling automatically for you. + * + * @animations + * removeClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden + * addClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a non truthy value and just before the contents are set to visible + * + * @element ANY + * @param {expression} ngHide If the {@link guide/expression expression} is truthy then + * the element is shown or hidden respectively. + * + * @example + + + Click me:
+
+ Show: +
+ I show up when your checkbox is checked. +
+
+
+ Hide: +
+ I hide when your checkbox is checked. +
+
+
+ + @import url(//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css); + + + .animate-hide { + -webkit-transition:all linear 0.5s; + transition:all linear 0.5s; + line-height:20px; + opacity:1; + padding:10px; + border:1px solid black; + background:white; + } + + .animate-hide.ng-hide { + line-height:0; + opacity:0; + padding:0 10px; + } + + .check-element { + padding:10px; + border:1px solid black; + background:white; + } + + + var thumbsUp = element(by.css('span.glyphicon-thumbs-up')); + var thumbsDown = element(by.css('span.glyphicon-thumbs-down')); + + it('should check ng-show / ng-hide', function() { + expect(thumbsUp.isDisplayed()).toBeFalsy(); + expect(thumbsDown.isDisplayed()).toBeTruthy(); + + element(by.model('checked')).click(); + + expect(thumbsUp.isDisplayed()).toBeTruthy(); + expect(thumbsDown.isDisplayed()).toBeFalsy(); + }); + +
+ */ +var ngHideDirective = ['$animate', function($animate) { + return function(scope, element, attr) { + scope.$watch(attr.ngHide, function ngHideWatchAction(value){ + $animate[toBoolean(value) ? 'addClass' : 'removeClass'](element, 'ng-hide'); + }); + }; +}]; + +/** + * @ngdoc directive + * @name ngStyle + * @restrict AC + * + * @description + * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally. + * + * @element ANY + * @param {expression} ngStyle + * + * {@link guide/expression Expression} which evals to an + * object whose keys are CSS style names and values are corresponding values for those CSS + * keys. + * + * Since some CSS style names are not valid keys for an object, they must be quoted. + * See the 'background-color' style in the example below. + * + * @example + + + + + +
+ Sample Text +
myStyle={{myStyle}}
+
+ + span { + color: black; + } + + + var colorSpan = element(by.css('span')); + + it('should check ng-style', function() { + expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)'); + element(by.css('input[value=\'set color\']')).click(); + expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)'); + element(by.css('input[value=clear]')).click(); + expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)'); + }); + +
+ */ +var ngStyleDirective = ngDirective(function(scope, element, attr) { + scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) { + if (oldStyles && (newStyles !== oldStyles)) { + forEach(oldStyles, function(val, style) { element.css(style, '');}); + } + if (newStyles) element.css(newStyles); + }, true); +}); + +/** + * @ngdoc directive + * @name ngSwitch + * @restrict EA + * + * @description + * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression. + * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location + * as specified in the template. + * + * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it + * from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element + * matches the value obtained from the evaluated expression. In other words, you define a container element + * (where you place the directive), place an expression on the **`on="..."` attribute** + * (or the **`ng-switch="..."` attribute**), define any inner elements inside of the directive and place + * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on + * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default + * attribute is displayed. + * + *
+ * Be aware that the attribute values to match against cannot be expressions. They are interpreted + * as literal string values to match against. + * For example, **`ng-switch-when="someVal"`** will match against the string `"someVal"` not against the + * value of the expression `$scope.someVal`. + *
+ + * @animations + * enter - happens after the ngSwitch contents change and the matched child element is placed inside the container + * leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM + * + * @usage + * + * ``` + * + * ... + * ... + * ... + * + * ``` + * + * + * @scope + * @priority 800 + * @param {*} ngSwitch|on expression to match against ng-switch-when. + * On child elements add: + * + * * `ngSwitchWhen`: the case statement to match against. If match then this + * case will be displayed. If the same match appears multiple times, all the + * elements will be displayed. + * * `ngSwitchDefault`: the default case when no other case match. If there + * are multiple default cases, all of them will be displayed when no other + * case match. + * + * + * @example + + +
+ + selection={{selection}} +
+
+
Settings Div
+
Home Span
+
default
+
+
+
+ + angular.module('switchExample', ['ngAnimate']) + .controller('ExampleController', ['$scope', function($scope) { + $scope.items = ['settings', 'home', 'other']; + $scope.selection = $scope.items[0]; + }]); + + + .animate-switch-container { + position:relative; + background:white; + border:1px solid black; + height:40px; + overflow:hidden; + } + + .animate-switch { + padding:10px; + } + + .animate-switch.ng-animate { + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + + position:absolute; + top:0; + left:0; + right:0; + bottom:0; + } + + .animate-switch.ng-leave.ng-leave-active, + .animate-switch.ng-enter { + top:-50px; + } + .animate-switch.ng-leave, + .animate-switch.ng-enter.ng-enter-active { + top:0; + } + + + var switchElem = element(by.css('[ng-switch]')); + var select = element(by.model('selection')); + + it('should start in settings', function() { + expect(switchElem.getText()).toMatch(/Settings Div/); + }); + it('should change to home', function() { + select.all(by.css('option')).get(1).click(); + expect(switchElem.getText()).toMatch(/Home Span/); + }); + it('should select default', function() { + select.all(by.css('option')).get(2).click(); + expect(switchElem.getText()).toMatch(/default/); + }); + +
+ */ +var ngSwitchDirective = ['$animate', function($animate) { + return { + restrict: 'EA', + require: 'ngSwitch', + + // asks for $scope to fool the BC controller module + controller: ['$scope', function ngSwitchController() { + this.cases = {}; + }], + link: function(scope, element, attr, ngSwitchController) { + var watchExpr = attr.ngSwitch || attr.on, + selectedTranscludes = [], + selectedElements = [], + previousElements = [], + selectedScopes = []; + + scope.$watch(watchExpr, function ngSwitchWatchAction(value) { + var i, ii; + for (i = 0, ii = previousElements.length; i < ii; ++i) { + previousElements[i].remove(); + } + previousElements.length = 0; + + for (i = 0, ii = selectedScopes.length; i < ii; ++i) { + var selected = selectedElements[i]; + selectedScopes[i].$destroy(); + previousElements[i] = selected; + $animate.leave(selected, function() { + previousElements.splice(i, 1); + }); + } + + selectedElements.length = 0; + selectedScopes.length = 0; + + if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) { + scope.$eval(attr.change); + forEach(selectedTranscludes, function(selectedTransclude) { + var selectedScope = scope.$new(); + selectedScopes.push(selectedScope); + selectedTransclude.transclude(selectedScope, function(caseElement) { + var anchor = selectedTransclude.element; + + selectedElements.push(caseElement); + $animate.enter(caseElement, anchor.parent(), anchor); + }); + }); + } + }); + } + }; +}]; + +var ngSwitchWhenDirective = ngDirective({ + transclude: 'element', + priority: 800, + require: '^ngSwitch', + link: function(scope, element, attrs, ctrl, $transclude) { + ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []); + ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element }); + } +}); + +var ngSwitchDefaultDirective = ngDirective({ + transclude: 'element', + priority: 800, + require: '^ngSwitch', + link: function(scope, element, attr, ctrl, $transclude) { + ctrl.cases['?'] = (ctrl.cases['?'] || []); + ctrl.cases['?'].push({ transclude: $transclude, element: element }); + } +}); + +/** + * @ngdoc directive + * @name ngTransclude + * @restrict AC + * + * @description + * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion. + * + * Any existing content of the element that this directive is placed on will be removed before the transcluded content is inserted. + * + * @element ANY + * + * @example + + + +
+
+
+ {{text}} +
+
+ + it('should have transcluded', function() { + var titleElement = element(by.model('title')); + titleElement.clear(); + titleElement.sendKeys('TITLE'); + var textElement = element(by.model('text')); + textElement.clear(); + textElement.sendKeys('TEXT'); + expect(element(by.binding('title')).getText()).toEqual('TITLE'); + expect(element(by.binding('text')).getText()).toEqual('TEXT'); + }); + +
+ * + */ +var ngTranscludeDirective = ngDirective({ + link: function($scope, $element, $attrs, controller, $transclude) { + if (!$transclude) { + throw minErr('ngTransclude')('orphan', + 'Illegal use of ngTransclude directive in the template! ' + + 'No parent directive that requires a transclusion found. ' + + 'Element: {0}', + startingTag($element)); + } + + $transclude(function(clone) { + $element.empty(); + $element.append(clone); + }); + } +}); + +/** + * @ngdoc directive + * @name script + * @restrict E + * + * @description + * Load the content of a ` + + Load inlined template +
+ + + it('should load template defined inside script tag', function() { + element(by.css('#tpl-link')).click(); + expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/); + }); + + + */ +var scriptDirective = ['$templateCache', function($templateCache) { + return { + restrict: 'E', + terminal: true, + compile: function(element, attr) { + if (attr.type == 'text/ng-template') { + var templateUrl = attr.id, + // IE is not consistent, in scripts we have to read .text but in other nodes we have to read .textContent + text = element[0].text; + + $templateCache.put(templateUrl, text); + } + } + }; +}]; + +var ngOptionsMinErr = minErr('ngOptions'); +/** + * @ngdoc directive + * @name select + * @restrict E + * + * @description + * HTML `SELECT` element with angular data-binding. + * + * # `ngOptions` + * + * The `ngOptions` attribute can be used to dynamically generate a list of `` + * DOM element. + * * `trackexpr`: Used when working with an array of objects. The result of this expression will be + * used to identify the objects in the array. The `trackexpr` will most likely refer to the + * `value` variable (e.g. `value.propertyName`). + * + * @example + + + +
+
    +
  • + Name: + [X] +
  • +
  • + [add] +
  • +
+
+ Color (null not allowed): +
+ + Color (null allowed): + + +
+ + Color grouped by shade: +
+ + + Select bogus.
+
+ Currently selected: {{ {selected_color:myColor} }} +
+
+
+
+ + it('should check ng-options', function() { + expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red'); + element.all(by.model('myColor')).first().click(); + element.all(by.css('select[ng-model="myColor"] option')).first().click(); + expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black'); + element(by.css('.nullable select[ng-model="myColor"]')).click(); + element.all(by.css('.nullable select[ng-model="myColor"] option')).first().click(); + expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('null'); + }); + +
+ */ + +var ngOptionsDirective = valueFn({ terminal: true }); +// jshint maxlen: false +var selectDirective = ['$compile', '$parse', function($compile, $parse) { + //000011111111110000000000022222222220000000000000000000003333333333000000000000004444444444444440000000005555555555555550000000666666666666666000000000000000777777777700000000000000000008888888888 + var NG_OPTIONS_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/, + nullModelCtrl = {$setViewValue: noop}; +// jshint maxlen: 100 + + return { + restrict: 'E', + require: ['select', '?ngModel'], + controller: ['$element', '$scope', '$attrs', function($element, $scope, $attrs) { + var self = this, + optionsMap = {}, + ngModelCtrl = nullModelCtrl, + nullOption, + unknownOption; + + + self.databound = $attrs.ngModel; + + + self.init = function(ngModelCtrl_, nullOption_, unknownOption_) { + ngModelCtrl = ngModelCtrl_; + nullOption = nullOption_; + unknownOption = unknownOption_; + }; + + + self.addOption = function(value) { + assertNotHasOwnProperty(value, '"option value"'); + optionsMap[value] = true; + + if (ngModelCtrl.$viewValue == value) { + $element.val(value); + if (unknownOption.parent()) unknownOption.remove(); + } + }; + + + self.removeOption = function(value) { + if (this.hasOption(value)) { + delete optionsMap[value]; + if (ngModelCtrl.$viewValue == value) { + this.renderUnknownOption(value); + } + } + }; + + + self.renderUnknownOption = function(val) { + var unknownVal = '? ' + hashKey(val) + ' ?'; + unknownOption.val(unknownVal); + $element.prepend(unknownOption); + $element.val(unknownVal); + unknownOption.prop('selected', true); // needed for IE + }; + + + self.hasOption = function(value) { + return optionsMap.hasOwnProperty(value); + }; + + $scope.$on('$destroy', function() { + // disable unknown option so that we don't do work when the whole select is being destroyed + self.renderUnknownOption = noop; + }); + }], + + link: function(scope, element, attr, ctrls) { + // if ngModel is not defined, we don't need to do anything + if (!ctrls[1]) return; + + var selectCtrl = ctrls[0], + ngModelCtrl = ctrls[1], + multiple = attr.multiple, + optionsExp = attr.ngOptions, + nullOption = false, // if false, user will not be able to select it (used by ngOptions) + emptyOption, + // we can't just jqLite('