From e0addf5b588a1244f9679becd90999dfcb4c3a94 Mon Sep 17 00:00:00 2001 From: "ITSERVICES\\rb7147" Date: Tue, 25 Apr 2017 11:46:00 -0400 Subject: Policy 1707 commit to LF Change-Id: Ibe6f01d92f9a434c040abb05d5386e89d675ae65 Signed-off-by: ITSERVICES\rb7147 --- .../openecomp/policy/adapter/AddressGroupJson.java | 79 - .../org/openecomp/policy/adapter/AddressJson.java | 44 - .../openecomp/policy/adapter/AddressMembers.java | 46 - .../policy/adapter/AutoPushTabAdapter.java | 42 - .../policy/adapter/ClosedLoopFaultBody.java | 280 - .../ClosedLoopFaultTriggerUISignatures.java | 44 - .../openecomp/policy/adapter/ClosedLoopPMBody.java | 133 - .../adapter/ClosedLoopPerformanceMetrics.java | 36 - .../openecomp/policy/adapter/ClosedLoopPolicy.java | 61 - .../policy/adapter/ClosedLoopPolicyConditions.java | 39 - .../policy/adapter/ClosedLoopPolicyStatus.java | 41 - .../policy/adapter/ClosedLoopSignatures.java | 52 - .../policy/adapter/DeletePolicyCondition.java | 38 - .../openecomp/policy/adapter/DeployNowJson.java | 36 - .../org/openecomp/policy/adapter/GridData.java | 54 - .../openecomp/policy/adapter/PolicyAdapter.java | 619 - .../policy/adapter/PolicyExportAdapter.java | 36 - .../org/openecomp/policy/adapter/PrefixIPList.java | 74 - .../openecomp/policy/adapter/ServiceGroupJson.java | 79 - .../openecomp/policy/adapter/ServiceListJson.java | 107 - .../openecomp/policy/adapter/ServiceMembers.java | 48 - .../org/openecomp/policy/adapter/ServicesJson.java | 44 - .../java/org/openecomp/policy/adapter/Term.java | 201 - .../openecomp/policy/adapter/TermCollector.java | 132 - .../java/org/openecomp/policy/admin/CheckPDP.java | 187 - .../policy/admin/PAPNotificationBroadcaster.java | 120 - .../policy/admin/PolicyManagerServlet.java | 1334 - .../policy/admin/PolicyNotificationMail.java | 140 - .../openecomp/policy/admin/RESTfulPAPEngine.java | 732 - .../org/openecomp/policy/admin/XacmlAdminUI.java | 266 - .../policy/components/ElasticSearchComponent.java | 426 - .../policy/components/HumanPolicyComponent.java | 982 - .../policy/components/PolicyImportWindow.java | 226 - .../openecomp/policy/conf/HibernateSession.java | 60 - .../policy/controller/ActionPolicyController.java | 535 - .../policy/controller/AdminTabController.java | 100 - .../policy/controller/AutoPushController.java | 433 - .../controller/CreateBRMSParamController.java | 723 - .../policy/controller/CreateBRMSRawController.java | 440 - .../CreateClosedLoopFaultController.java | 889 - .../controller/CreateClosedLoopPMController.java | 422 - .../CreateDcaeMicroServiceController.java | 987 - .../controller/CreateFirewallController.java | 1292 - .../policy/controller/CreatePolicyController.java | 484 - .../policy/controller/DashboardController.java | 430 - .../controller/DecisionPolicyController.java | 507 - .../openecomp/policy/controller/PDPController.java | 302 - .../policy/controller/PolicyController.java | 418 - .../PolicyExportAndImportController.java | 563 - .../controller/PolicyNotificationController.java | 122 - .../policy/controller/PolicyRolesController.java | 137 - .../controller/PolicyValidationController.java | 300 - .../policy/dao/FunctionDefinitionDao.java | 32 - .../policy/dao/GlobalRoleSettingsDao.java | 33 - .../org/openecomp/policy/dao/GroupEntityDao.java | 39 - .../org/openecomp/policy/dao/PDPEntityDao.java | 33 - .../policy/dao/PolicyEditorScopesDao.java | 37 - .../org/openecomp/policy/dao/PolicyRolesDao.java | 37 - .../org/openecomp/policy/dao/PolicyVersionDao.java | 38 - .../policy/dao/RemoteCatalogValuesDao.java | 34 - .../java/org/openecomp/policy/dao/RolesDao.java | 38 - .../openecomp/policy/dao/RuleAlgorithmsDao.java | 31 - .../org/openecomp/policy/dao/SystemLogDbDao.java | 33 - .../policy/dao/WatchPolicyNotificationDao.java | 35 - .../policy/daoImp/ActionPolicyDictDaoImpl.java | 178 - .../policy/daoImp/AddressGroupDaoImpl.java | 152 - .../policy/daoImp/BRMSParamTemplateDaoImpl.java | 152 - .../policy/daoImp/DescriptiveScopeDaoImpl.java | 177 - .../daoImp/FirewallDictionaryListDaoImpl.java | 196 - .../policy/daoImp/FunctionDefinitionDaoImpl.java | 94 - .../policy/daoImp/GlobalRoleSettingsDaoImpl.java | 91 - .../policy/daoImp/GroupEntityDaoImpl.java | 124 - .../policy/daoImp/GroupPolicyScopeListDaoImpl.java | 177 - .../policy/daoImp/MicroServiceModelsDaoImpl.java | 156 - .../openecomp/policy/daoImp/PDPEntityDaoImpl.java | 68 - .../policy/daoImp/PolicyEditorScopesDaoImpl.java | 193 - .../policy/daoImp/PolicyRolesDaoImpl.java | 159 - .../policy/daoImp/PolicyVersionDaoImpl.java | 216 - .../openecomp/policy/daoImp/PrefixListDaoImpl.java | 153 - .../policy/daoImp/RemoteCatalogValuesDaoImpl.java | 150 - .../org/openecomp/policy/daoImp/RolesDaoImpl.java | 109 - .../policy/daoImp/RuleAlgorithmsDaoImpl.java | 68 - .../policy/daoImp/SafePolicyWarningDaoImpl.java | 181 - .../policy/daoImp/SecurityZoneDaoImpl.java | 152 - .../policy/daoImp/ServiceGroupDaoImpl.java | 153 - .../policy/daoImp/ServiceListDaoImpl.java | 154 - .../policy/daoImp/SystemLogDbDaoImpl.java | 93 - .../openecomp/policy/daoImp/TermListDaoImpl.java | 176 - .../openecomp/policy/daoImp/UserInfoDaoImpl.java | 123 - .../policy/daoImp/VarbindDictionaryDaoImpl.java | 177 - .../daoImp/WatchPolicyNotificationDaoImpl.java | 173 - .../openecomp/policy/elk/client/ElkConnector.java | 1235 - .../java/org/openecomp/policy/elk/client/Pair.java | 35 - .../elk/client/PolicyElasticSearchController.java | 756 - .../openecomp/policy/elk/client/PolicyLocator.java | 53 - .../openecomp/policy/elk/converter/ElkRecord.java | 42 - .../openecomp/policy/elk/converter/Xacml2Elk.java | 978 - .../openecomp/policy/model/PDPGroupContainer.java | 531 - .../openecomp/policy/model/PDPPolicyContainer.java | 348 - .../java/org/openecomp/policy/model/Roles.java | 95 - .../policy/utils/ConfigurableRESTUtils.java | 163 - .../openecomp/policy/utils/PolicyContainer.java | 121 - .../policy/utils/PolicyItemSetChangeNotifier.java | 95 - .../utils/XACMLPolicyWriterWithPapNotify.java | 494 - .../portalapp/conf/ExternalAppConfig.java | 188 - .../portalapp/conf/ExternalAppInitializer.java | 60 - .../portalapp/conf/HibernateMappingLocations.java | 37 - .../controller/AngularSinglePageController.java | 48 - .../portalapp/controller/CallflowController.java | 44 - .../controller/ElasticSearchController.java | 128 - .../portalapp/controller/LeafletMapContoller.java | 43 - .../portalapp/controller/PostDroolsController.java | 138 - .../controller/UserProfileController.java | 72 - .../portalapp/controller/WelcomeController.java | 43 - .../java/org/openecomp/portalapp/model/Result.java | 37 - .../org/openecomp/portalapp/scheduler/LogJob.java | 47 - .../openecomp/portalapp/scheduler/LogRegistry.java | 57 - .../openecomp/portalapp/scheduler/Register.java | 82 - .../portalapp/scheduler/RegistryAdapter.java | 108 - .../portalapp/service/AdminAuthExtension.java | 84 - .../service/OnBoardingApiServiceImplPolicy.java | 348 - .../portalapp/uebhandler/InitUebHandler.java | 73 - .../portalapp/uebhandler/MainUebHandler.java | 104 - .../uebhandler/WidgetNotificationHandler.java | 46 - .../portalapp/util/CustomLoggingFilter.java | 54 - ecomp-sdk-app/src/main/resources/att-rules.drl | 16 - ecomp-sdk-app/src/main/resources/cache.ccf | 30 - ecomp-sdk-app/src/main/resources/logback.xml | 370 - .../src/main/resources/mchange-log.properties | 23 - ecomp-sdk-app/src/main/resources/portal.properties | 69 - ecomp-sdk-app/src/main/resources/state-rules.drl | 38 - .../src/main/webapp/WEB-INF/conf/quartz.properties | 30 - .../src/main/webapp/WEB-INF/conf/raptor.properties | 187 - .../WEB-INF/conf/raptor_app_fusion.properties | 39 - .../WEB-INF/conf/raptor_db_fusion.properties | 19 - .../main/webapp/WEB-INF/conf/raptor_pdf.properties | 49 - .../src/main/webapp/WEB-INF/conf/sql.properties | 322 - .../src/main/webapp/WEB-INF/conf/system.properties | 105 - .../src/main/webapp/WEB-INF/defs/definitions.xml | 22 - .../webapp/WEB-INF/fusion/conf/fusion.properties | 61 - .../webapp/WEB-INF/fusion/defs/definitions.xml | 240 - .../src/main/webapp/WEB-INF/fusion/jsp/.gitignore | 0 .../main/webapp/WEB-INF/fusion/jsp/broadcast.jsp | 137 - .../webapp/WEB-INF/fusion/jsp/broadcast_list.jsp | 201 - .../webapp/WEB-INF/fusion/jsp/collaborateList.jsp | 146 - .../main/webapp/WEB-INF/fusion/jsp/data_out.jsp | 20 - .../webapp/WEB-INF/fusion/jsp/ebz/ebz_footer.jsp | 46 - .../webapp/WEB-INF/fusion/jsp/ebz/ebz_header.jsp | 799 - .../WEB-INF/fusion/jsp/ebz/loginSnippet.html | 120 - .../webapp/WEB-INF/fusion/jsp/ebz_template.jsp | 45 - .../fusion/jsp/ebz_template_noheader_nofooter.jsp | 35 - .../fusion/jsp/ebz_template_report_embedded.jsp | 48 - .../webapp/WEB-INF/fusion/jsp/es_search_demo.jsp | 97 - .../webapp/WEB-INF/fusion/jsp/es_suggest_demo.jsp | 97 - .../webapp/WEB-INF/fusion/jsp/frame_insert.jsp | 44 - .../src/main/webapp/WEB-INF/fusion/jsp/include.jsp | 30 - .../main/webapp/WEB-INF/fusion/jsp/jcs_admin.jsp | 144 - .../src/main/webapp/WEB-INF/fusion/jsp/meta.jsp | 36 - .../webapp/WEB-INF/fusion/jsp/popup_modal.html | 324 - .../WEB-INF/fusion/jsp/popup_modal_role.html | 274 - .../fusion/jsp/popup_modal_rolefunction.html | 87 - .../main/webapp/WEB-INF/fusion/jsp/post_search.jsp | 356 - .../src/main/webapp/WEB-INF/fusion/jsp/profile.jsp | 442 - .../webapp/WEB-INF/fusion/jsp/profile_search.jsp | 104 - .../src/main/webapp/WEB-INF/fusion/jsp/role.jsp | 286 - .../WEB-INF/fusion/jsp/role_function_list.jsp | 213 - .../main/webapp/WEB-INF/fusion/jsp/role_list.jsp | 139 - .../main/webapp/WEB-INF/fusion/jsp/usage_list.jsp | 87 - .../WEB-INF/fusion/jsp/webrtc/collaboration.jsp | 492 - .../main/webapp/WEB-INF/fusion/orm/Fusion.hbm.xml | 352 - .../fusion/orm/RNoteBookIntegration.hbm.xml | 44 - .../webapp/WEB-INF/fusion/orm/Workflow.hbm.xml | 48 - .../fusion/raptor/custom_header_include.jsp | 135 - .../WEB-INF/fusion/raptor/custom_js_include.jsp | 31 - .../fusion/raptor/date_end_field_run_sql.jsp | 38 - .../fusion/raptor/date_start_field_run_sql.jsp | 39 - .../fusion/raptor/default_field_run_sql.jsp | 39 - .../webapp/WEB-INF/fusion/raptor/disclaimer.jsp | 38 - .../webapp/WEB-INF/fusion/raptor/error_include.jsp | 58 - .../webapp/WEB-INF/fusion/raptor/error_page.jsp | 229 - .../main/webapp/WEB-INF/fusion/raptor/footer.jsp | 25 - .../fusion/raptor/popup_drill_down_report.jsp | 601 - .../fusion/raptor/popup_import_semaphore.jsp | 80 - .../WEB-INF/fusion/raptor/popup_semaphore.jsp | 419 - .../webapp/WEB-INF/fusion/raptor/popup_sql.jsp | 55 - .../WEB-INF/fusion/raptor/popup_table_cols.jsp | 171 - .../WEB-INF/fusion/raptor/popup_testrun_sql.jsp | 103 - .../WEB-INF/fusion/raptor/report_download_csv.jsp | 89 - .../WEB-INF/fusion/raptor/report_download_pdf.jsp | 40 - .../WEB-INF/fusion/raptor/report_download_xls.jsp | 64 - .../webapp/WEB-INF/fusion/raptor/report_ebz.jsp | 179 - .../webapp/WEB-INF/fusion/raptor/report_import.jsp | 69 - .../webapp/WEB-INF/fusion/raptor/report_sample.jsp | 40 - .../webapp/WEB-INF/fusion/raptor/report_search.jsp | 2432 - .../webapp/WEB-INF/fusion/raptor/report_wizard.jsp | 309 - .../WEB-INF/fusion/raptor/test_field_run_sql.jsp | 39 - .../webapp/WEB-INF/fusion/raptor/test_run_sql.jsp | 38 - .../WEB-INF/fusion/raptor/tree/folderNav.jsp | 483 - .../webapp/WEB-INF/fusion/raptor/tree/testTree.jsp | 248 - .../fusion/raptor/wizard_adhoc_schedule.jsp | 733 - .../webapp/WEB-INF/fusion/raptor/wizard_chart.jsp | 1335 - .../fusion/raptor/wizard_columns_add_multi.jsp | 96 - .../WEB-INF/fusion/raptor/wizard_columns_edit.jsp | 1127 - .../WEB-INF/fusion/raptor/wizard_columns_list.jsp | 157 - .../fusion/raptor/wizard_columns_order_all.jsp | 88 - .../fusion/raptor/wizard_data_forecasting.jsp | 184 - .../WEB-INF/fusion/raptor/wizard_definition.jsp | 1122 - .../WEB-INF/fusion/raptor/wizard_filters_edit.jsp | 320 - .../WEB-INF/fusion/raptor/wizard_filters_list.jsp | 115 - .../fusion/raptor/wizard_form_fields_edit.jsp | 771 - .../fusion/raptor/wizard_form_fields_list.jsp | 107 - .../WEB-INF/fusion/raptor/wizard_javascript.jsp | 167 - .../webapp/WEB-INF/fusion/raptor/wizard_log.jsp | 109 - .../webapp/WEB-INF/fusion/raptor/wizard_map.jsp | 424 - .../webapp/WEB-INF/fusion/raptor/wizard_run.jsp | 74 - .../WEB-INF/fusion/raptor/wizard_schedule.jsp | 376 - .../raptor/wizard_schedule_formfield_include.jsp | 754 - .../fusion/raptor/wizard_schedule_multiple.jsp | 157 - .../WEB-INF/fusion/raptor/wizard_schedule_only.jsp | 172 - .../raptor/wizard_schedule_only_from_search.jsp | 173 - .../WEB-INF/fusion/raptor/wizard_sorting_edit.jsp | 86 - .../WEB-INF/fusion/raptor/wizard_sorting_list.jsp | 116 - .../fusion/raptor/wizard_sorting_order_all.jsp | 112 - .../WEB-INF/fusion/raptor/wizard_sql_def.jsp | 226 - .../WEB-INF/fusion/raptor/wizard_tables_edit.jsp | 369 - .../WEB-INF/fusion/raptor/wizard_tables_list.jsp | 85 - .../WEB-INF/fusion/raptor/wizard_user_access.jsp | 184 - .../src/main/webapp/WEB-INF/jsp/error.jsp | 20 - .../src/main/webapp/WEB-INF/jsp/leafletMap.jsp | 288 - .../src/main/webapp/WEB-INF/jsp/login_external.jsp | 154 - .../src/main/webapp/WEB-INF/jsp/net_map.jsp | 38 - .../src/main/webapp/WEB-INF/jsp/user_profile.jsp | 84 - .../src/main/webapp/WEB-INF/jsp/welcome.jsp | 629 - ecomp-sdk-app/src/main/webapp/WEB-INF/web.xml | 24 - .../fusion/external/angular-1.5/angular-animate.js | 4121 -- .../external/angular-1.5/angular-animate.min.js | 56 - .../angular-1.5/angular-animate.min.js.map | 8 - .../fusion/external/angular-1.5/angular-aria.js | 398 - .../external/angular-1.5/angular-aria.min.js | 14 - .../external/angular-1.5/angular-aria.min.js.map | 8 - .../fusion/external/angular-1.5/angular-cookies.js | 322 - .../external/angular-1.5/angular-cookies.min.js | 9 - .../angular-1.5/angular-cookies.min.js.map | 8 - .../fusion/external/angular-1.5/angular-csp.css | 20 - .../fusion/external/angular-1.5/angular-loader.js | 484 - .../external/angular-1.5/angular-loader.min.js | 10 - .../external/angular-1.5/angular-loader.min.js.map | 8 - .../external/angular-1.5/angular-message-format.js | 980 - .../angular-1.5/angular-message-format.min.js | 26 - .../angular-1.5/angular-message-format.min.js.map | 8 - .../external/angular-1.5/angular-messages.js | 687 - .../external/angular-1.5/angular-messages.min.js | 12 - .../angular-1.5/angular-messages.min.js.map | 8 - .../fusion/external/angular-1.5/angular-mocks.js | 2842 - .../external/angular-1.5/angular-resource.js | 768 - .../external/angular-1.5/angular-resource.min.js | 15 - .../angular-1.5/angular-resource.min.js.map | 8 - .../fusion/external/angular-1.5/angular-route.js | 1016 - .../external/angular-1.5/angular-route.min.js | 15 - .../external/angular-1.5/angular-route.min.js.map | 8 - .../external/angular-1.5/angular-sanitize.js | 717 - .../external/angular-1.5/angular-sanitize.min.js | 15 - .../angular-1.5/angular-sanitize.min.js.map | 8 - .../external/angular-1.5/angular-scenario.js | 41849 ------------ .../fusion/external/angular-1.5/angular-touch.js | 729 - .../external/angular-1.5/angular-touch.min.js | 14 - .../external/angular-1.5/angular-touch.min.js.map | 8 - .../app/fusion/external/angular-1.5/angular.js | 30428 --------- .../app/fusion/external/angular-1.5/angular.min.js | 307 - .../fusion/external/angular-1.5/angular.min.js.map | 8 - .../app/fusion/external/angular-1.5/errors.json | 1 - .../app/fusion/external/angular-1.5/version.json | 1 - .../app/fusion/external/angular-1.5/version.txt | 1 - .../angular-ui/ui-bootstrap-tpls-1.1.2.min.js | 10 - .../angular-ui/ui-bootstrap-tpls-1.2.4.min.js | 10 - .../webapp/app/fusion/external/bootstrap/bs.css | 678 - .../webapp/app/fusion/external/d3/css/nv.d3.css | 656 - .../main/webapp/app/fusion/external/d3/js/cie.js | 155 - .../app/fusion/external/d3/js/colorbrewer.js | 302 - .../main/webapp/app/fusion/external/d3/js/core.js | 122 - .../app/fusion/external/d3/js/crossfilter.js | 1180 - .../app/fusion/external/d3/js/crossfilter.min.js | 1 - .../webapp/app/fusion/external/d3/js/d3.geom.js | 816 - .../main/webapp/app/fusion/external/d3/js/d3.js | 5 - .../app/fusion/external/d3/js/d3.layout.cloud.js | 433 - .../webapp/app/fusion/external/d3/js/d3.layout.js | 908 - .../main/webapp/app/fusion/external/d3/js/d3.v2.js | 7037 -- .../webapp/app/fusion/external/d3/js/d3.v2.min.js | 4 - .../webapp/app/fusion/external/d3/js/d3.v3.min.js | 1 - .../webapp/app/fusion/external/d3/js/fisheye.js | 86 - .../main/webapp/app/fusion/external/d3/js/hive.js | 80 - .../webapp/app/fusion/external/d3/js/horizon.js | 192 - .../app/fusion/external/d3/js/interactiveLayer.js | 251 - .../main/webapp/app/fusion/external/d3/js/intro.js | 1 - .../app/fusion/external/d3/js/models/axis-min.js | 1 - .../app/fusion/external/d3/js/models/axis.js | 470 - .../app/fusion/external/d3/js/models/axis.min.js | 1 - .../fusion/external/d3/js/models/backup/bullet.js | 250 - .../external/d3/js/models/backup/bulletChart.js | 349 - .../fusion/external/d3/js/models/boilerplate.js | 104 - .../app/fusion/external/d3/js/models/bullet.js | 385 - .../fusion/external/d3/js/models/bulletChart.js | 343 - .../external/d3/js/models/cumulativeLineChart.js | 782 - .../fusion/external/d3/js/models/discreteBar.js | 349 - .../external/d3/js/models/discreteBarChart.js | 333 - .../fusion/external/d3/js/models/distribution.js | 148 - .../fusion/external/d3/js/models/historicalBar.js | 331 - .../external/d3/js/models/historicalBarChart.js | 419 - .../fusion/external/d3/js/models/indentedTree.js | 337 - .../app/fusion/external/d3/js/models/legend.js | 270 - .../app/fusion/external/d3/js/models/line.js | 284 - .../app/fusion/external/d3/js/models/lineChart.js | 465 - .../external/d3/js/models/linePlusBarChart.js | 433 - .../d3/js/models/linePlusBarWithFocusChart.js | 658 - .../external/d3/js/models/lineWithFisheye.js | 200 - .../external/d3/js/models/lineWithFisheyeChart.js | 297 - .../external/d3/js/models/lineWithFocusChart.js | 574 - .../app/fusion/external/d3/js/models/multiBar.js | 461 - .../fusion/external/d3/js/models/multiBarChart.js | 524 - .../external/d3/js/models/multiBarHorizontal.js | 424 - .../d3/js/models/multiBarHorizontalChart.js | 434 - .../external/d3/js/models/multiBarTimeSeries.js | 384 - .../d3/js/models/multiBarTimeSeriesChart.js | 405 - .../app/fusion/external/d3/js/models/multiChart.js | 452 - .../app/fusion/external/d3/js/models/ohlcBar.js | 380 - .../external/d3/js/models/parallelCoordinates.js | 239 - .../webapp/app/fusion/external/d3/js/models/pie.js | 400 - .../app/fusion/external/d3/js/models/pieChart.js | 292 - .../app/fusion/external/d3/js/models/scatter.js | 674 - .../fusion/external/d3/js/models/scatterChart.js | 628 - .../external/d3/js/models/scatterPlusLineChart.js | 620 - .../app/fusion/external/d3/js/models/sparkline.js | 194 - .../fusion/external/d3/js/models/sparklinePlus.js | 295 - .../fusion/external/d3/js/models/stackedArea.js | 368 - .../external/d3/js/models/stackedAreaChart.js | 629 - .../main/webapp/app/fusion/external/d3/js/nv.d3.js | 13097 ---- .../webapp/app/fusion/external/d3/js/nv.d3.min.js | 1 - .../main/webapp/app/fusion/external/d3/js/outro.js | 1 - .../webapp/app/fusion/external/d3/js/sankey.js | 292 - .../webapp/app/fusion/external/d3/js/tooltip.js | 490 - .../main/webapp/app/fusion/external/d3/js/utils.js | 152 - .../external/ebz/angular_js/angular-animate.js | 3721 - .../external/ebz/angular_js/angular-cookies.js | 206 - .../external/ebz/angular_js/angular-route.js | 911 - .../external/ebz/angular_js/angular-route.min.js | 14 - .../external/ebz/angular_js/angular-sanitize.js | 647 - .../external/ebz/angular_js/angular-touch.js | 628 - .../app/fusion/external/ebz/angular_js/angular.js | 22024 ------ .../app/fusion/external/ebz/angular_js/app.js | 6 - .../external/ebz/angular_js/checklist-model.js | 99 - .../external/ebz/angular_js/checklist-model.min.js | 1 - .../app/fusion/external/ebz/angular_js/gestures.js | 1495 - .../app/fusion/external/ebz/angular_js/ng_base.js | 4 - .../external/ebz/angular_js/ui-charts-tpls.js | 3909 -- .../app/fusion/external/ebz/ebz_header/footer.css | 311 - .../app/fusion/external/ebz/ebz_header/header.css | 1866 - .../external/ebz/ebz_header/portal_ebz_header.css | 63 - .../main/webapp/app/fusion/external/ebz/fn-ebz.css | 1614 - .../fusion/external/ebz/images/headerChatIcon.png | Bin 465 -> 0 bytes .../external/ebz/images/no_favorites_star.png | Bin 2794 -> 0 bytes .../app/fusion/external/ebz/js/attHeaderSnippet.js | 210 - .../webapp/app/fusion/external/ebz/js/footer.js | 110 - .../fusion/external/ebz/sandbox/att-abs-tpls.js | 20451 ------ .../external/ebz/sandbox/att-abs-tpls.min.js | 22 - .../fusion/external/ebz/sandbox/styles/base.css | 6198 -- .../app/fusion/external/ebz/sandbox/styles/btn.css | 1 - .../fusion/external/ebz/sandbox/styles/demo.css | 2 - .../fusion/external/ebz/sandbox/styles/dtpk.css | 9 - .../fusion/external/ebz/sandbox/styles/frms.css | 1 - .../ebz/sandbox/styles/ie/backgroundsize.min.htc | 12 - .../ebz/sandbox/styles/images/calendar-icon.png | Bin 515635 -> 0 bytes .../ebz/sandbox/styles/images/checkbox.png | Bin 1170 -> 0 bytes .../external/ebz/sandbox/styles/images/down.png | Bin 1059 -> 0 bytes .../ebz/sandbox/styles/images/icon-close-modal.png | Bin 1634 -> 0 bytes .../styles/images/icon-informative-modal.png | Bin 5018 -> 0 bytes .../sandbox/styles/images/icon-warning-modal.png | Bin 3831 -> 0 bytes .../external/ebz/sandbox/styles/images/loader.gif | Bin 5732 -> 0 bytes .../styles/images/loading-spinner-medium.png | Bin 2021 -> 0 bytes .../styles/images/loading-spinner-orange.png | Bin 2087 -> 0 bytes .../styles/images/loading_balls_black-small.gif | Bin 3209 -> 0 bytes .../sandbox/styles/images/loading_balls_black.gif | Bin 2636 -> 0 bytes .../styles/images/loading_balls_blue-small.gif | Bin 3210 -> 0 bytes .../sandbox/styles/images/loading_balls_blue.gif | Bin 2636 -> 0 bytes .../styles/images/loading_balls_white-small.gif | Bin 2060 -> 0 bytes .../sandbox/styles/images/loading_balls_white.gif | Bin 1924 -> 0 bytes .../ebz/sandbox/styles/images/loading_dots.gif | Bin 3736 -> 0 bytes .../ebz/sandbox/styles/images/magnify_glass.png | Bin 556 -> 0 bytes .../ebz/sandbox/styles/images/oops-exclamation.png | Bin 836 -> 0 bytes .../external/ebz/sandbox/styles/images/radio.jpg | Bin 1352 -> 0 bytes .../ebz/sandbox/styles/images/select-arrows.png | Bin 1373 -> 0 bytes .../ebz/sandbox/styles/images/treearrow.png | Bin 17821 -> 0 bytes .../external/ebz/sandbox/styles/images/up.png | Bin 1064 -> 0 bytes .../ebz/sandbox/styles/images/upanddown.png | Bin 1033 -> 0 bytes .../ebz/sandbox/styles/pages/iconography.css | 2 - .../fusion/external/ebz/sandbox/styles/sldr.css | 1 - .../fusion/external/ebz/sandbox/styles/style.css | 1 - .../app/fusion/external/ebz/sandbox/styles/tbs.css | 1 - .../app/fusion/external/ionicons-2.0.1/.gitignore | 4 - .../app/fusion/external/ionicons-2.0.1/LICENSE | 21 - .../app/fusion/external/ionicons-2.0.1/bower.json | 31 - .../fusion/external/ionicons-2.0.1/component.json | 19 - .../fusion/external/ionicons-2.0.1/composer.json | 36 - .../external/ionicons-2.0.1/css/ionicons.css | 1480 - .../external/ionicons-2.0.1/css/ionicons.min.css | 11 - .../external/ionicons-2.0.1/fonts/ionicons.eot | Bin 120724 -> 0 bytes .../external/ionicons-2.0.1/fonts/ionicons.svg | 2230 - .../external/ionicons-2.0.1/fonts/ionicons.ttf | Bin 188508 -> 0 bytes .../external/ionicons-2.0.1/fonts/ionicons.woff | Bin 67904 -> 0 bytes .../ionicons-2.0.1/less/_ionicons-font.less | 27 - .../ionicons-2.0.1/less/_ionicons-icons.less | 1473 - .../ionicons-2.0.1/less/_ionicons-variables.less | 747 - .../external/ionicons-2.0.1/less/ionicons.less | 3 - .../ionicons-2.0.1/png/512/alert-circled.png | Bin 2551 -> 0 bytes .../external/ionicons-2.0.1/png/512/alert.png | Bin 766 -> 0 bytes .../ionicons-2.0.1/png/512/android-add-contact.png | Bin 3279 -> 0 bytes .../ionicons-2.0.1/png/512/android-add.png | Bin 240 -> 0 bytes .../ionicons-2.0.1/png/512/android-alarm.png | Bin 6428 -> 0 bytes .../ionicons-2.0.1/png/512/android-archive.png | Bin 1628 -> 0 bytes .../ionicons-2.0.1/png/512/android-arrow-back.png | Bin 1218 -> 0 bytes .../png/512/android-arrow-down-left.png | Bin 1451 -> 0 bytes .../png/512/android-arrow-down-right.png | Bin 1462 -> 0 bytes .../png/512/android-arrow-forward.png | Bin 1191 -> 0 bytes .../png/512/android-arrow-up-left.png | Bin 1499 -> 0 bytes .../png/512/android-arrow-up-right.png | Bin 1482 -> 0 bytes .../ionicons-2.0.1/png/512/android-battery.png | Bin 238 -> 0 bytes .../ionicons-2.0.1/png/512/android-book.png | Bin 3746 -> 0 bytes .../ionicons-2.0.1/png/512/android-calendar.png | Bin 849 -> 0 bytes .../ionicons-2.0.1/png/512/android-call.png | Bin 4766 -> 0 bytes .../ionicons-2.0.1/png/512/android-camera.png | Bin 3871 -> 0 bytes .../ionicons-2.0.1/png/512/android-chat.png | Bin 3577 -> 0 bytes .../ionicons-2.0.1/png/512/android-checkmark.png | Bin 1846 -> 0 bytes .../ionicons-2.0.1/png/512/android-clock.png | Bin 5268 -> 0 bytes .../ionicons-2.0.1/png/512/android-close.png | Bin 2156 -> 0 bytes .../ionicons-2.0.1/png/512/android-contact.png | Bin 3658 -> 0 bytes .../ionicons-2.0.1/png/512/android-contacts.png | Bin 4299 -> 0 bytes .../ionicons-2.0.1/png/512/android-data.png | Bin 4808 -> 0 bytes .../ionicons-2.0.1/png/512/android-developer.png | Bin 4115 -> 0 bytes .../ionicons-2.0.1/png/512/android-display.png | Bin 4909 -> 0 bytes .../ionicons-2.0.1/png/512/android-download.png | Bin 4890 -> 0 bytes .../ionicons-2.0.1/png/512/android-drawer.png | Bin 190 -> 0 bytes .../ionicons-2.0.1/png/512/android-dropdown.png | Bin 777 -> 0 bytes .../ionicons-2.0.1/png/512/android-earth.png | Bin 6517 -> 0 bytes .../ionicons-2.0.1/png/512/android-folder.png | Bin 1688 -> 0 bytes .../ionicons-2.0.1/png/512/android-forums.png | Bin 1739 -> 0 bytes .../ionicons-2.0.1/png/512/android-friends.png | Bin 4868 -> 0 bytes .../ionicons-2.0.1/png/512/android-hand.png | Bin 4650 -> 0 bytes .../ionicons-2.0.1/png/512/android-image.png | Bin 1433 -> 0 bytes .../ionicons-2.0.1/png/512/android-inbox.png | Bin 3018 -> 0 bytes .../ionicons-2.0.1/png/512/android-information.png | Bin 3370 -> 0 bytes .../ionicons-2.0.1/png/512/android-keypad.png | Bin 1055 -> 0 bytes .../ionicons-2.0.1/png/512/android-lightbulb.png | Bin 3515 -> 0 bytes .../ionicons-2.0.1/png/512/android-locate.png | Bin 5003 -> 0 bytes .../ionicons-2.0.1/png/512/android-location.png | Bin 3067 -> 0 bytes .../ionicons-2.0.1/png/512/android-mail.png | Bin 3455 -> 0 bytes .../ionicons-2.0.1/png/512/android-microphone.png | Bin 3267 -> 0 bytes .../ionicons-2.0.1/png/512/android-mixer.png | Bin 2727 -> 0 bytes .../ionicons-2.0.1/png/512/android-more.png | Bin 224 -> 0 bytes .../ionicons-2.0.1/png/512/android-note.png | Bin 249 -> 0 bytes .../ionicons-2.0.1/png/512/android-playstore.png | Bin 3165 -> 0 bytes .../ionicons-2.0.1/png/512/android-printer.png | Bin 1721 -> 0 bytes .../ionicons-2.0.1/png/512/android-promotion.png | Bin 2374 -> 0 bytes .../ionicons-2.0.1/png/512/android-reminder.png | Bin 2890 -> 0 bytes .../ionicons-2.0.1/png/512/android-remove.png | Bin 160 -> 0 bytes .../ionicons-2.0.1/png/512/android-search.png | Bin 4232 -> 0 bytes .../ionicons-2.0.1/png/512/android-send.png | Bin 2079 -> 0 bytes .../ionicons-2.0.1/png/512/android-settings.png | Bin 3883 -> 0 bytes .../ionicons-2.0.1/png/512/android-share.png | Bin 3212 -> 0 bytes .../ionicons-2.0.1/png/512/android-social-user.png | Bin 3644 -> 0 bytes .../ionicons-2.0.1/png/512/android-social.png | Bin 3849 -> 0 bytes .../ionicons-2.0.1/png/512/android-sort.png | Bin 197 -> 0 bytes .../png/512/android-stair-drawer.png | Bin 209 -> 0 bytes .../ionicons-2.0.1/png/512/android-star.png | Bin 2926 -> 0 bytes .../ionicons-2.0.1/png/512/android-stopwatch.png | Bin 5225 -> 0 bytes .../ionicons-2.0.1/png/512/android-storage.png | Bin 233 -> 0 bytes .../ionicons-2.0.1/png/512/android-system-back.png | Bin 1796 -> 0 bytes .../ionicons-2.0.1/png/512/android-system-home.png | Bin 1107 -> 0 bytes .../png/512/android-system-windows.png | Bin 202 -> 0 bytes .../ionicons-2.0.1/png/512/android-timer.png | Bin 3904 -> 0 bytes .../ionicons-2.0.1/png/512/android-trash.png | Bin 2865 -> 0 bytes .../ionicons-2.0.1/png/512/android-user-menu.png | Bin 3568 -> 0 bytes .../ionicons-2.0.1/png/512/android-volume.png | Bin 6022 -> 0 bytes .../ionicons-2.0.1/png/512/android-wifi.png | Bin 4868 -> 0 bytes .../external/ionicons-2.0.1/png/512/aperture.png | Bin 9500 -> 0 bytes .../external/ionicons-2.0.1/png/512/archive.png | Bin 2445 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-down-a.png | Bin 1173 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-down-b.png | Bin 1307 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-down-c.png | Bin 1966 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-expand.png | Bin 2498 -> 0 bytes .../png/512/arrow-graph-down-left.png | Bin 2478 -> 0 bytes .../png/512/arrow-graph-down-right.png | Bin 2545 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-graph-up-left.png | Bin 2440 -> 0 bytes .../png/512/arrow-graph-up-right.png | Bin 2440 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-left-a.png | Bin 1260 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-left-b.png | Bin 1608 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-left-c.png | Bin 1662 -> 0 bytes .../external/ionicons-2.0.1/png/512/arrow-move.png | Bin 1948 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-resize.png | Bin 1266 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-return-left.png | Bin 1082 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-return-right.png | Bin 1124 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-right-a.png | Bin 1317 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-right-b.png | Bin 1671 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-right-c.png | Bin 1657 -> 0 bytes .../ionicons-2.0.1/png/512/arrow-shrink.png | Bin 2594 -> 0 bytes .../external/ionicons-2.0.1/png/512/arrow-swap.png | Bin 1521 -> 0 bytes .../external/ionicons-2.0.1/png/512/arrow-up-a.png | Bin 1115 -> 0 bytes .../external/ionicons-2.0.1/png/512/arrow-up-b.png | Bin 1343 -> 0 bytes .../external/ionicons-2.0.1/png/512/arrow-up-c.png | Bin 2002 -> 0 bytes .../external/ionicons-2.0.1/png/512/asterisk.png | Bin 4023 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/at.png | Bin 5852 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/bag.png | Bin 3665 -> 0 bytes .../ionicons-2.0.1/png/512/battery-charging.png | Bin 1897 -> 0 bytes .../ionicons-2.0.1/png/512/battery-empty.png | Bin 1019 -> 0 bytes .../ionicons-2.0.1/png/512/battery-full.png | Bin 982 -> 0 bytes .../ionicons-2.0.1/png/512/battery-half.png | Bin 1320 -> 0 bytes .../ionicons-2.0.1/png/512/battery-low.png | Bin 1342 -> 0 bytes .../external/ionicons-2.0.1/png/512/beaker.png | Bin 3931 -> 0 bytes .../external/ionicons-2.0.1/png/512/beer.png | Bin 4559 -> 0 bytes .../external/ionicons-2.0.1/png/512/bluetooth.png | Bin 2909 -> 0 bytes .../external/ionicons-2.0.1/png/512/bonfire.png | Bin 4852 -> 0 bytes .../external/ionicons-2.0.1/png/512/bookmark.png | Bin 1102 -> 0 bytes .../external/ionicons-2.0.1/png/512/briefcase.png | Bin 1475 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/bug.png | Bin 4736 -> 0 bytes .../external/ionicons-2.0.1/png/512/calculator.png | Bin 1315 -> 0 bytes .../external/ionicons-2.0.1/png/512/calendar.png | Bin 2577 -> 0 bytes .../external/ionicons-2.0.1/png/512/camera.png | Bin 4190 -> 0 bytes .../external/ionicons-2.0.1/png/512/card.png | Bin 1494 -> 0 bytes .../external/ionicons-2.0.1/png/512/cash.png | Bin 3435 -> 0 bytes .../ionicons-2.0.1/png/512/chatbox-working.png | Bin 2301 -> 0 bytes .../external/ionicons-2.0.1/png/512/chatbox.png | Bin 1870 -> 0 bytes .../external/ionicons-2.0.1/png/512/chatboxes.png | Bin 2562 -> 0 bytes .../ionicons-2.0.1/png/512/chatbubble-working.png | Bin 3028 -> 0 bytes .../external/ionicons-2.0.1/png/512/chatbubble.png | Bin 2579 -> 0 bytes .../ionicons-2.0.1/png/512/chatbubbles.png | Bin 3751 -> 0 bytes .../ionicons-2.0.1/png/512/checkmark-circled.png | Bin 3687 -> 0 bytes .../ionicons-2.0.1/png/512/checkmark-round.png | Bin 2367 -> 0 bytes .../external/ionicons-2.0.1/png/512/checkmark.png | Bin 2134 -> 0 bytes .../ionicons-2.0.1/png/512/chevron-down.png | Bin 1689 -> 0 bytes .../ionicons-2.0.1/png/512/chevron-left.png | Bin 1769 -> 0 bytes .../ionicons-2.0.1/png/512/chevron-right.png | Bin 1831 -> 0 bytes .../external/ionicons-2.0.1/png/512/chevron-up.png | Bin 1677 -> 0 bytes .../external/ionicons-2.0.1/png/512/clipboard.png | Bin 2593 -> 0 bytes .../external/ionicons-2.0.1/png/512/clock.png | Bin 5866 -> 0 bytes .../ionicons-2.0.1/png/512/close-circled.png | Bin 3809 -> 0 bytes .../ionicons-2.0.1/png/512/close-round.png | Bin 2177 -> 0 bytes .../external/ionicons-2.0.1/png/512/close.png | Bin 2244 -> 0 bytes .../ionicons-2.0.1/png/512/closed-captioning.png | Bin 3665 -> 0 bytes .../external/ionicons-2.0.1/png/512/cloud.png | Bin 2067 -> 0 bytes .../ionicons-2.0.1/png/512/code-download.png | Bin 2423 -> 0 bytes .../ionicons-2.0.1/png/512/code-working.png | Bin 2433 -> 0 bytes .../external/ionicons-2.0.1/png/512/code.png | Bin 1720 -> 0 bytes .../external/ionicons-2.0.1/png/512/coffee.png | Bin 3205 -> 0 bytes .../external/ionicons-2.0.1/png/512/compass.png | Bin 7318 -> 0 bytes .../external/ionicons-2.0.1/png/512/compose.png | Bin 4296 -> 0 bytes .../ionicons-2.0.1/png/512/connection-bars.png | Bin 214 -> 0 bytes .../external/ionicons-2.0.1/png/512/contrast.png | Bin 4087 -> 0 bytes .../external/ionicons-2.0.1/png/512/cube.png | Bin 3265 -> 0 bytes .../external/ionicons-2.0.1/png/512/disc.png | Bin 4935 -> 0 bytes .../ionicons-2.0.1/png/512/document-text.png | Bin 1918 -> 0 bytes .../external/ionicons-2.0.1/png/512/document.png | Bin 1914 -> 0 bytes .../external/ionicons-2.0.1/png/512/drag.png | Bin 178 -> 0 bytes .../external/ionicons-2.0.1/png/512/earth.png | Bin 6476 -> 0 bytes .../external/ionicons-2.0.1/png/512/edit.png | Bin 2741 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/egg.png | Bin 4234 -> 0 bytes .../external/ionicons-2.0.1/png/512/eject.png | Bin 3209 -> 0 bytes .../external/ionicons-2.0.1/png/512/email.png | Bin 3125 -> 0 bytes .../ionicons-2.0.1/png/512/eye-disabled.png | Bin 3558 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/eye.png | Bin 3297 -> 0 bytes .../external/ionicons-2.0.1/png/512/female.png | Bin 2779 -> 0 bytes .../external/ionicons-2.0.1/png/512/filing.png | Bin 2349 -> 0 bytes .../ionicons-2.0.1/png/512/film-marker.png | Bin 2645 -> 0 bytes .../external/ionicons-2.0.1/png/512/fireball.png | Bin 3325 -> 0 bytes .../external/ionicons-2.0.1/png/512/flag.png | Bin 2337 -> 0 bytes .../external/ionicons-2.0.1/png/512/flame.png | Bin 3012 -> 0 bytes .../external/ionicons-2.0.1/png/512/flash-off.png | Bin 5437 -> 0 bytes .../external/ionicons-2.0.1/png/512/flash.png | Bin 1965 -> 0 bytes .../external/ionicons-2.0.1/png/512/flask.png | Bin 2939 -> 0 bytes .../external/ionicons-2.0.1/png/512/folder.png | Bin 1689 -> 0 bytes .../external/ionicons-2.0.1/png/512/fork-repo.png | Bin 3236 -> 0 bytes .../external/ionicons-2.0.1/png/512/fork.png | Bin 3007 -> 0 bytes .../external/ionicons-2.0.1/png/512/forward.png | Bin 2142 -> 0 bytes .../external/ionicons-2.0.1/png/512/funnel.png | Bin 3354 -> 0 bytes .../ionicons-2.0.1/png/512/game-controller-a.png | Bin 2548 -> 0 bytes .../ionicons-2.0.1/png/512/game-controller-b.png | Bin 3623 -> 0 bytes .../external/ionicons-2.0.1/png/512/gear-a.png | Bin 3806 -> 0 bytes .../external/ionicons-2.0.1/png/512/gear-b.png | Bin 2756 -> 0 bytes .../external/ionicons-2.0.1/png/512/grid.png | Bin 1066 -> 0 bytes .../external/ionicons-2.0.1/png/512/hammer.png | Bin 2493 -> 0 bytes .../external/ionicons-2.0.1/png/512/happy.png | Bin 5732 -> 0 bytes .../external/ionicons-2.0.1/png/512/headphone.png | Bin 4082 -> 0 bytes .../ionicons-2.0.1/png/512/heart-broken.png | Bin 4007 -> 0 bytes .../external/ionicons-2.0.1/png/512/heart.png | Bin 2322 -> 0 bytes .../external/ionicons-2.0.1/png/512/help-buoy.png | Bin 5824 -> 0 bytes .../ionicons-2.0.1/png/512/help-circled.png | Bin 3940 -> 0 bytes .../external/ionicons-2.0.1/png/512/help.png | Bin 2678 -> 0 bytes .../external/ionicons-2.0.1/png/512/home.png | Bin 1275 -> 0 bytes .../external/ionicons-2.0.1/png/512/icecream.png | Bin 2317 -> 0 bytes .../png/512/icon-social-google-plus-outline.png | Bin 4071 -> 0 bytes .../png/512/icon-social-google-plus.png | Bin 3888 -> 0 bytes .../external/ionicons-2.0.1/png/512/image.png | Bin 2952 -> 0 bytes .../external/ionicons-2.0.1/png/512/images.png | Bin 5073 -> 0 bytes .../ionicons-2.0.1/png/512/information-circled.png | Bin 3300 -> 0 bytes .../ionicons-2.0.1/png/512/information.png | Bin 2236 -> 0 bytes .../external/ionicons-2.0.1/png/512/ionic.png | Bin 5541 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-alarm-outline.png | Bin 5769 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-alarm.png | Bin 3922 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-albums-outline.png | Bin 231 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-albums.png | Bin 226 -> 0 bytes .../png/512/ios7-americanfootball-outline.png | Bin 5767 -> 0 bytes .../png/512/ios7-americanfootball.png | Bin 5675 -> 0 bytes .../png/512/ios7-analytics-outline.png | Bin 5847 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-analytics.png | Bin 4406 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-arrow-back.png | Bin 881 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-arrow-down.png | Bin 1451 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-arrow-forward.png | Bin 898 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-arrow-left.png | Bin 1550 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-arrow-right.png | Bin 1537 -> 0 bytes .../png/512/ios7-arrow-thin-down.png | Bin 1632 -> 0 bytes .../png/512/ios7-arrow-thin-left.png | Bin 1258 -> 0 bytes .../png/512/ios7-arrow-thin-right.png | Bin 1235 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-arrow-thin-up.png | Bin 1647 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-arrow-up.png | Bin 1482 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-at-outline.png | Bin 4303 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-at.png | Bin 4153 -> 0 bytes .../png/512/ios7-barcode-outline.png | Bin 233 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-barcode.png | Bin 219 -> 0 bytes .../png/512/ios7-baseball-outline.png | Bin 6676 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-baseball.png | Bin 5565 -> 0 bytes .../png/512/ios7-basketball-outline.png | Bin 6200 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-basketball.png | Bin 6525 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-bell-outline.png | Bin 3615 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-bell.png | Bin 2769 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-bolt-outline.png | Bin 2384 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-bolt.png | Bin 1892 -> 0 bytes .../png/512/ios7-bookmarks-outline.png | Bin 2454 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-bookmarks.png | Bin 2172 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-box-outline.png | Bin 1602 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-box.png | Bin 1032 -> 0 bytes .../png/512/ios7-briefcase-outline.png | Bin 1359 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-briefcase.png | Bin 1316 -> 0 bytes .../png/512/ios7-browsers-outline.png | Bin 372 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-browsers.png | Bin 357 -> 0 bytes .../png/512/ios7-calculator-outline.png | Bin 1785 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-calculator.png | Bin 1500 -> 0 bytes .../png/512/ios7-calendar-outline.png | Bin 236 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-calendar.png | Bin 230 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-camera-outline.png | Bin 3582 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-camera.png | Bin 3099 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-cart-outline.png | Bin 2861 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-cart.png | Bin 2200 -> 0 bytes .../png/512/ios7-chatboxes-outline.png | Bin 901 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-chatboxes.png | Bin 512 -> 0 bytes .../png/512/ios7-chatbubble-outline.png | Bin 3640 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-chatbubble.png | Bin 2259 -> 0 bytes .../png/512/ios7-checkmark-empty.png | Bin 920 -> 0 bytes .../png/512/ios7-checkmark-outline.png | Bin 4706 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-checkmark.png | Bin 3080 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-circle-filled.png | Bin 6478 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-circle-outline.png | Bin 4120 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-clock-outline.png | Bin 4320 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-clock.png | Bin 2762 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-close-empty.png | Bin 1204 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-close-outline.png | Bin 4999 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-close.png | Bin 3426 -> 0 bytes .../png/512/ios7-cloud-download-outline.png | Bin 3953 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-cloud-download.png | Bin 2782 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-cloud-outline.png | Bin 3339 -> 0 bytes .../png/512/ios7-cloud-upload-outline.png | Bin 3927 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-cloud-upload.png | Bin 2815 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-cloud.png | Bin 2082 -> 0 bytes .../png/512/ios7-cloudy-night-outline.png | Bin 3814 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-cloudy-night.png | Bin 2870 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-cloudy-outline.png | Bin 2280 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-cloudy.png | Bin 1572 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-cog-outline.png | Bin 8008 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-cog.png | Bin 6029 -> 0 bytes .../png/512/ios7-compose-outline.png | Bin 1584 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-compose.png | Bin 2061 -> 0 bytes .../png/512/ios7-contact-outline.png | Bin 4846 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-contact.png | Bin 4218 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-copy-outline.png | Bin 927 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-copy.png | Bin 782 -> 0 bytes .../png/512/ios7-download-outline.png | Bin 1163 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-download.png | Bin 1135 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-drag.png | Bin 165 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-email-outline.png | Bin 2592 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-email.png | Bin 4167 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-expand.png | Bin 485 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-eye-outline.png | Bin 4381 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-eye.png | Bin 2973 -> 0 bytes .../png/512/ios7-fastforward-outline.png | Bin 2726 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-fastforward.png | Bin 2158 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-filing-outline.png | Bin 2041 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-filing.png | Bin 1933 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-film-outline.png | Bin 772 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-film.png | Bin 722 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-flag-outline.png | Bin 1928 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-flag.png | Bin 1483 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-folder-outline.png | Bin 1606 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-folder.png | Bin 1640 -> 0 bytes .../png/512/ios7-football-outline.png | Bin 6266 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-football.png | Bin 5391 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-gear-outline.png | Bin 5721 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-gear.png | Bin 3445 -> 0 bytes .../png/512/ios7-glasses-outline.png | Bin 3597 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-glasses.png | Bin 2350 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-heart-outline.png | Bin 3097 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-heart.png | Bin 2078 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-help-empty.png | Bin 1669 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-help-outline.png | Bin 5608 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-help.png | Bin 3587 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-home-outline.png | Bin 1710 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-home.png | Bin 1518 -> 0 bytes .../png/512/ios7-infinite-outline.png | Bin 3028 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-infinite.png | Bin 2989 -> 0 bytes .../png/512/ios7-information-empty.png | Bin 837 -> 0 bytes .../png/512/ios7-information-outline.png | Bin 4563 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-information.png | Bin 2959 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-ionic-outline.png | Bin 5780 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-keypad-outline.png | Bin 7485 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-keypad.png | Bin 7505 -> 0 bytes .../png/512/ios7-lightbulb-outline.png | Bin 3791 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-lightbulb.png | Bin 2696 -> 0 bytes .../png/512/ios7-location-outline.png | Bin 4116 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-location.png | Bin 2767 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-locked-outline.png | Bin 2640 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-locked.png | Bin 2674 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-loop-strong.png | Bin 4101 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-loop.png | Bin 4270 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-medkit-outline.png | Bin 1386 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-medkit.png | Bin 1373 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-mic-off.png | Bin 7597 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-mic-outline.png | Bin 3550 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-mic.png | Bin 3878 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-minus-empty.png | Bin 153 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-minus-outline.png | Bin 4137 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-minus.png | Bin 2520 -> 0 bytes .../png/512/ios7-monitor-outline.png | Bin 225 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-monitor.png | Bin 230 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-moon-outline.png | Bin 2566 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-moon.png | Bin 1784 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-more-outline.png | Bin 1598 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-more.png | Bin 1700 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-musical-note.png | Bin 1521 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-musical-notes.png | Bin 2124 -> 0 bytes .../png/512/ios7-navigate-outline.png | Bin 4901 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-navigate.png | Bin 3333 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-paper-outline.png | Bin 1361 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-paper.png | Bin 1197 -> 0 bytes .../png/512/ios7-paperplane-outline.png | Bin 2952 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-paperplane.png | Bin 4805 -> 0 bytes .../png/512/ios7-partlysunny-outline.png | Bin 4823 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-partlysunny.png | Bin 4052 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-pause-outline.png | Bin 227 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-pause.png | Bin 213 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-paw-outline.png | Bin 6318 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-paw.png | Bin 4119 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-people-outline.png | Bin 5295 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-people.png | Bin 3439 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-person-outline.png | Bin 3189 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-person.png | Bin 2046 -> 0 bytes .../png/512/ios7-personadd-outline.png | Bin 3246 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-personadd.png | Bin 2110 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-photos-outline.png | Bin 234 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-photos.png | Bin 226 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-pie-outline.png | Bin 4549 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-pie.png | Bin 3646 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-play-outline.png | Bin 1474 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-play.png | Bin 1216 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-plus-empty.png | Bin 204 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-plus-outline.png | Bin 4415 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-plus.png | Bin 2970 -> 0 bytes .../png/512/ios7-pricetag-outline.png | Bin 3007 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-pricetag.png | Bin 2593 -> 0 bytes .../png/512/ios7-pricetags-outline.png | Bin 3563 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-pricetags.png | Bin 3219 -> 0 bytes .../png/512/ios7-printer-outline.png | Bin 1764 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-printer.png | Bin 1456 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-pulse-strong.png | Bin 3326 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-pulse.png | Bin 2955 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-rainy-outline.png | Bin 3346 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-rainy.png | Bin 2567 -> 0 bytes .../png/512/ios7-recording-outline.png | Bin 4926 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-recording.png | Bin 3762 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-redo-outline.png | Bin 3094 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-redo.png | Bin 2054 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-refresh-empty.png | Bin 2685 -> 0 bytes .../png/512/ios7-refresh-outline.png | Bin 6021 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-refresh.png | Bin 4579 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-reload.png | Bin 4195 -> 0 bytes .../png/512/ios7-reverse-camera-outline.png | Bin 3404 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-reverse-camera.png | Bin 3019 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-rewind-outline.png | Bin 2898 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-rewind.png | Bin 2362 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-search-strong.png | Bin 3329 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-search.png | Bin 3361 -> 0 bytes .../png/512/ios7-settings-strong.png | Bin 1714 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-settings.png | Bin 2160 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-shrink.png | Bin 490 -> 0 bytes .../png/512/ios7-skipbackward-outline.png | Bin 1890 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-skipbackward.png | Bin 1533 -> 0 bytes .../png/512/ios7-skipforward-outline.png | Bin 1827 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-skipforward.png | Bin 1556 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-snowy.png | Bin 3775 -> 0 bytes .../png/512/ios7-speedometer-outline.png | Bin 4678 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-speedometer.png | Bin 5748 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-star-half.png | Bin 3431 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-star-outline.png | Bin 3572 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-star.png | Bin 2463 -> 0 bytes .../png/512/ios7-stopwatch-outline.png | Bin 4823 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-stopwatch.png | Bin 3451 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-sunny-outline.png | Bin 2669 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-sunny.png | Bin 2506 -> 0 bytes .../png/512/ios7-telephone-outline.png | Bin 3779 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-telephone.png | Bin 2352 -> 0 bytes .../png/512/ios7-tennisball-outline.png | Bin 5535 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-tennisball.png | Bin 6356 -> 0 bytes .../png/512/ios7-thunderstorm-outline.png | Bin 3053 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-thunderstorm.png | Bin 2492 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-time-outline.png | Bin 5875 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-time.png | Bin 4136 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-timer-outline.png | Bin 4578 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-timer.png | Bin 6013 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-toggle-outline.png | Bin 5660 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-toggle.png | Bin 4825 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-trash-outline.png | Bin 4497 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-trash.png | Bin 2760 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-undo-outline.png | Bin 3114 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-undo.png | Bin 1954 -> 0 bytes .../png/512/ios7-unlocked-outline.png | Bin 2580 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-unlocked.png | Bin 2605 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-upload-outline.png | Bin 1128 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-upload.png | Bin 1085 -> 0 bytes .../png/512/ios7-videocam-outline.png | Bin 2038 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-videocam.png | Bin 2715 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-volume-high.png | Bin 2977 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-volume-low.png | Bin 956 -> 0 bytes .../png/512/ios7-wineglass-outline.png | Bin 2527 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-wineglass.png | Bin 2013 -> 0 bytes .../ionicons-2.0.1/png/512/ios7-world-outline.png | Bin 7420 -> 0 bytes .../external/ionicons-2.0.1/png/512/ios7-world.png | Bin 10031 -> 0 bytes .../external/ionicons-2.0.1/png/512/ipad.png | Bin 1356 -> 0 bytes .../external/ionicons-2.0.1/png/512/iphone.png | Bin 1651 -> 0 bytes .../external/ionicons-2.0.1/png/512/ipod.png | Bin 3207 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/jet.png | Bin 2856 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/key.png | Bin 2722 -> 0 bytes .../external/ionicons-2.0.1/png/512/knife.png | Bin 1822 -> 0 bytes .../external/ionicons-2.0.1/png/512/laptop.png | Bin 2474 -> 0 bytes .../external/ionicons-2.0.1/png/512/leaf.png | Bin 3440 -> 0 bytes .../external/ionicons-2.0.1/png/512/levels.png | Bin 2431 -> 0 bytes .../external/ionicons-2.0.1/png/512/lightbulb.png | Bin 2474 -> 0 bytes .../external/ionicons-2.0.1/png/512/link.png | Bin 2306 -> 0 bytes .../external/ionicons-2.0.1/png/512/load-a.png | Bin 3941 -> 0 bytes .../external/ionicons-2.0.1/png/512/load-b.png | Bin 5473 -> 0 bytes .../external/ionicons-2.0.1/png/512/load-c.png | Bin 4337 -> 0 bytes .../external/ionicons-2.0.1/png/512/load-d.png | Bin 6618 -> 0 bytes .../external/ionicons-2.0.1/png/512/location.png | Bin 2739 -> 0 bytes .../external/ionicons-2.0.1/png/512/locked.png | Bin 2494 -> 0 bytes .../external/ionicons-2.0.1/png/512/log-in.png | Bin 1460 -> 0 bytes .../external/ionicons-2.0.1/png/512/log-out.png | Bin 1637 -> 0 bytes .../external/ionicons-2.0.1/png/512/loop.png | Bin 3794 -> 0 bytes .../external/ionicons-2.0.1/png/512/magnet.png | Bin 4495 -> 0 bytes .../external/ionicons-2.0.1/png/512/male.png | Bin 3788 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/man.png | Bin 2126 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/map.png | Bin 4906 -> 0 bytes .../external/ionicons-2.0.1/png/512/medkit.png | Bin 1605 -> 0 bytes .../external/ionicons-2.0.1/png/512/merge.png | Bin 3879 -> 0 bytes .../external/ionicons-2.0.1/png/512/mic-a.png | Bin 4098 -> 0 bytes .../external/ionicons-2.0.1/png/512/mic-b.png | Bin 2576 -> 0 bytes .../external/ionicons-2.0.1/png/512/mic-c.png | Bin 1726 -> 0 bytes .../ionicons-2.0.1/png/512/minus-circled.png | Bin 2655 -> 0 bytes .../ionicons-2.0.1/png/512/minus-round.png | Bin 937 -> 0 bytes .../external/ionicons-2.0.1/png/512/minus.png | Bin 160 -> 0 bytes .../external/ionicons-2.0.1/png/512/model-s.png | Bin 4262 -> 0 bytes .../external/ionicons-2.0.1/png/512/monitor.png | Bin 1469 -> 0 bytes .../external/ionicons-2.0.1/png/512/more.png | Bin 3357 -> 0 bytes .../external/ionicons-2.0.1/png/512/mouse.png | Bin 2891 -> 0 bytes .../external/ionicons-2.0.1/png/512/music-note.png | Bin 2519 -> 0 bytes .../ionicons-2.0.1/png/512/navicon-round.png | Bin 1628 -> 0 bytes .../external/ionicons-2.0.1/png/512/navicon.png | Bin 175 -> 0 bytes .../external/ionicons-2.0.1/png/512/navigate.png | Bin 1693 -> 0 bytes .../external/ionicons-2.0.1/png/512/network.png | Bin 3041 -> 0 bytes .../external/ionicons-2.0.1/png/512/no-smoking.png | Bin 5816 -> 0 bytes .../external/ionicons-2.0.1/png/512/nuclear.png | Bin 3618 -> 0 bytes .../external/ionicons-2.0.1/png/512/outlet.png | Bin 2882 -> 0 bytes .../ionicons-2.0.1/png/512/paper-airplane.png | Bin 3678 -> 0 bytes .../external/ionicons-2.0.1/png/512/paperclip.png | Bin 2710 -> 0 bytes .../external/ionicons-2.0.1/png/512/pause.png | Bin 1340 -> 0 bytes .../external/ionicons-2.0.1/png/512/person-add.png | Bin 2410 -> 0 bytes .../ionicons-2.0.1/png/512/person-stalker.png | Bin 3272 -> 0 bytes .../external/ionicons-2.0.1/png/512/person.png | Bin 2258 -> 0 bytes .../external/ionicons-2.0.1/png/512/pie-graph.png | Bin 3608 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/pin.png | Bin 2270 -> 0 bytes .../external/ionicons-2.0.1/png/512/pinpoint.png | Bin 4799 -> 0 bytes .../external/ionicons-2.0.1/png/512/pizza.png | Bin 4548 -> 0 bytes .../external/ionicons-2.0.1/png/512/plane.png | Bin 3218 -> 0 bytes .../external/ionicons-2.0.1/png/512/planet.png | Bin 4319 -> 0 bytes .../external/ionicons-2.0.1/png/512/play.png | Bin 1787 -> 0 bytes .../ionicons-2.0.1/png/512/playstation.png | Bin 3275 -> 0 bytes .../ionicons-2.0.1/png/512/plus-circled.png | Bin 3114 -> 0 bytes .../external/ionicons-2.0.1/png/512/plus-round.png | Bin 1567 -> 0 bytes .../external/ionicons-2.0.1/png/512/plus.png | Bin 223 -> 0 bytes .../external/ionicons-2.0.1/png/512/podium.png | Bin 209 -> 0 bytes .../external/ionicons-2.0.1/png/512/pound.png | Bin 2383 -> 0 bytes .../external/ionicons-2.0.1/png/512/power.png | Bin 4727 -> 0 bytes .../external/ionicons-2.0.1/png/512/pricetag.png | Bin 2457 -> 0 bytes .../external/ionicons-2.0.1/png/512/pricetags.png | Bin 2906 -> 0 bytes .../external/ionicons-2.0.1/png/512/printer.png | Bin 1869 -> 0 bytes .../ionicons-2.0.1/png/512/pull-request.png | Bin 3613 -> 0 bytes .../external/ionicons-2.0.1/png/512/qr-scanner.png | Bin 1842 -> 0 bytes .../external/ionicons-2.0.1/png/512/quote.png | Bin 1743 -> 0 bytes .../ionicons-2.0.1/png/512/radio-waves.png | Bin 4978 -> 0 bytes .../external/ionicons-2.0.1/png/512/record.png | Bin 3779 -> 0 bytes .../external/ionicons-2.0.1/png/512/refresh.png | Bin 3582 -> 0 bytes .../external/ionicons-2.0.1/png/512/reply-all.png | Bin 3033 -> 0 bytes .../external/ionicons-2.0.1/png/512/reply.png | Bin 2131 -> 0 bytes .../external/ionicons-2.0.1/png/512/ribbon-a.png | Bin 6449 -> 0 bytes .../external/ionicons-2.0.1/png/512/ribbon-b.png | Bin 5913 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/sad.png | Bin 5517 -> 0 bytes .../external/ionicons-2.0.1/png/512/scissors.png | Bin 5061 -> 0 bytes .../external/ionicons-2.0.1/png/512/search.png | Bin 3229 -> 0 bytes .../external/ionicons-2.0.1/png/512/settings.png | Bin 4141 -> 0 bytes .../external/ionicons-2.0.1/png/512/share.png | Bin 2616 -> 0 bytes .../external/ionicons-2.0.1/png/512/shuffle.png | Bin 3420 -> 0 bytes .../ionicons-2.0.1/png/512/skip-backward.png | Bin 2421 -> 0 bytes .../ionicons-2.0.1/png/512/skip-forward.png | Bin 2402 -> 0 bytes .../png/512/social-android-outline.png | Bin 3772 -> 0 bytes .../ionicons-2.0.1/png/512/social-android.png | Bin 2784 -> 0 bytes .../png/512/social-apple-outline.png | Bin 4104 -> 0 bytes .../ionicons-2.0.1/png/512/social-apple.png | Bin 2647 -> 0 bytes .../png/512/social-bitcoin-outline.png | Bin 3790 -> 0 bytes .../ionicons-2.0.1/png/512/social-bitcoin.png | Bin 2424 -> 0 bytes .../png/512/social-buffer-outline.png | Bin 3913 -> 0 bytes .../ionicons-2.0.1/png/512/social-buffer.png | Bin 4687 -> 0 bytes .../png/512/social-designernews-outline.png | Bin 4754 -> 0 bytes .../ionicons-2.0.1/png/512/social-designernews.png | Bin 4242 -> 0 bytes .../png/512/social-dribbble-outline.png | Bin 5588 -> 0 bytes .../ionicons-2.0.1/png/512/social-dribbble.png | Bin 6983 -> 0 bytes .../png/512/social-dropbox-outline.png | Bin 5113 -> 0 bytes .../ionicons-2.0.1/png/512/social-dropbox.png | Bin 6161 -> 0 bytes .../png/512/social-facebook-outline.png | Bin 1788 -> 0 bytes .../ionicons-2.0.1/png/512/social-facebook.png | Bin 1402 -> 0 bytes .../png/512/social-foursquare-outline.png | Bin 3364 -> 0 bytes .../ionicons-2.0.1/png/512/social-foursquare.png | Bin 3021 -> 0 bytes .../png/512/social-freebsd-devil.png | Bin 5300 -> 0 bytes .../png/512/social-github-outline.png | Bin 7475 -> 0 bytes .../ionicons-2.0.1/png/512/social-github.png | Bin 4561 -> 0 bytes .../png/512/social-google-outline.png | Bin 3890 -> 0 bytes .../ionicons-2.0.1/png/512/social-google.png | Bin 3682 -> 0 bytes .../png/512/social-googleplus-outline.png | Bin 4071 -> 0 bytes .../ionicons-2.0.1/png/512/social-googleplus.png | Bin 3888 -> 0 bytes .../png/512/social-hackernews-outline.png | Bin 1994 -> 0 bytes .../ionicons-2.0.1/png/512/social-hackernews.png | Bin 1905 -> 0 bytes .../png/512/social-instagram-outline.png | Bin 3317 -> 0 bytes .../ionicons-2.0.1/png/512/social-instagram.png | Bin 4403 -> 0 bytes .../png/512/social-linkedin-outline.png | Bin 2370 -> 0 bytes .../ionicons-2.0.1/png/512/social-linkedin.png | Bin 2275 -> 0 bytes .../png/512/social-pinterest-outline.png | Bin 6933 -> 0 bytes .../ionicons-2.0.1/png/512/social-pinterest.png | Bin 5532 -> 0 bytes .../png/512/social-reddit-outline.png | Bin 6414 -> 0 bytes .../ionicons-2.0.1/png/512/social-reddit.png | Bin 4498 -> 0 bytes .../ionicons-2.0.1/png/512/social-rss-outline.png | Bin 5945 -> 0 bytes .../external/ionicons-2.0.1/png/512/social-rss.png | Bin 4789 -> 0 bytes .../png/512/social-skype-outline.png | Bin 5608 -> 0 bytes .../ionicons-2.0.1/png/512/social-skype.png | Bin 4269 -> 0 bytes .../png/512/social-tumblr-outline.png | Bin 2725 -> 0 bytes .../ionicons-2.0.1/png/512/social-tumblr.png | Bin 1946 -> 0 bytes .../external/ionicons-2.0.1/png/512/social-tux.png | Bin 7103 -> 0 bytes .../png/512/social-twitter-outline.png | Bin 5569 -> 0 bytes .../ionicons-2.0.1/png/512/social-twitter.png | Bin 3405 -> 0 bytes .../ionicons-2.0.1/png/512/social-usd-outline.png | Bin 5744 -> 0 bytes .../external/ionicons-2.0.1/png/512/social-usd.png | Bin 3446 -> 0 bytes .../png/512/social-vimeo-outline.png | Bin 5525 -> 0 bytes .../ionicons-2.0.1/png/512/social-vimeo.png | Bin 3456 -> 0 bytes .../png/512/social-windows-outline.png | Bin 1775 -> 0 bytes .../ionicons-2.0.1/png/512/social-windows.png | Bin 2550 -> 0 bytes .../png/512/social-wordpress-outline.png | Bin 6418 -> 0 bytes .../ionicons-2.0.1/png/512/social-wordpress.png | Bin 5465 -> 0 bytes .../png/512/social-yahoo-outline.png | Bin 2119 -> 0 bytes .../ionicons-2.0.1/png/512/social-yahoo.png | Bin 1729 -> 0 bytes .../png/512/social-youtube-outline.png | Bin 4655 -> 0 bytes .../ionicons-2.0.1/png/512/social-youtube.png | Bin 2511 -> 0 bytes .../ionicons-2.0.1/png/512/speakerphone.png | Bin 4310 -> 0 bytes .../ionicons-2.0.1/png/512/speedometer.png | Bin 4238 -> 0 bytes .../external/ionicons-2.0.1/png/512/spoon.png | Bin 2306 -> 0 bytes .../external/ionicons-2.0.1/png/512/star.png | Bin 2195 -> 0 bytes .../external/ionicons-2.0.1/png/512/stats-bars.png | Bin 218 -> 0 bytes .../external/ionicons-2.0.1/png/512/steam.png | Bin 3875 -> 0 bytes .../external/ionicons-2.0.1/png/512/stop.png | Bin 1090 -> 0 bytes .../ionicons-2.0.1/png/512/thermometer.png | Bin 1980 -> 0 bytes .../external/ionicons-2.0.1/png/512/thumbsdown.png | Bin 2288 -> 0 bytes .../external/ionicons-2.0.1/png/512/thumbsup.png | Bin 2356 -> 0 bytes .../ionicons-2.0.1/png/512/toggle-filled.png | Bin 3194 -> 0 bytes .../external/ionicons-2.0.1/png/512/toggle.png | Bin 3599 -> 0 bytes .../external/ionicons-2.0.1/png/512/trash-a.png | Bin 2752 -> 0 bytes .../external/ionicons-2.0.1/png/512/trash-b.png | Bin 1882 -> 0 bytes .../external/ionicons-2.0.1/png/512/trophy.png | Bin 3579 -> 0 bytes .../external/ionicons-2.0.1/png/512/umbrella.png | Bin 3416 -> 0 bytes .../external/ionicons-2.0.1/png/512/university.png | Bin 3167 -> 0 bytes .../external/ionicons-2.0.1/png/512/unlocked.png | Bin 2412 -> 0 bytes .../external/ionicons-2.0.1/png/512/upload.png | Bin 2480 -> 0 bytes .../fusion/external/ionicons-2.0.1/png/512/usb.png | Bin 3950 -> 0 bytes .../ionicons-2.0.1/png/512/videocamera.png | Bin 2381 -> 0 bytes .../ionicons-2.0.1/png/512/volume-high.png | Bin 4334 -> 0 bytes .../ionicons-2.0.1/png/512/volume-medium.png | Bin 3174 -> 0 bytes .../ionicons-2.0.1/png/512/volume-mute.png | Bin 4803 -> 0 bytes .../external/ionicons-2.0.1/png/512/wand.png | Bin 1933 -> 0 bytes .../external/ionicons-2.0.1/png/512/waterdrop.png | Bin 3169 -> 0 bytes .../external/ionicons-2.0.1/png/512/wifi.png | Bin 3037 -> 0 bytes .../external/ionicons-2.0.1/png/512/wineglass.png | Bin 3734 -> 0 bytes .../external/ionicons-2.0.1/png/512/woman.png | Bin 3592 -> 0 bytes .../external/ionicons-2.0.1/png/512/wrench.png | Bin 2866 -> 0 bytes .../external/ionicons-2.0.1/png/512/xbox.png | Bin 4958 -> 0 bytes .../app/fusion/external/ionicons-2.0.1/readme.md | 60 - .../ionicons-2.0.1/scss/_ionicons-font.scss | 27 - .../ionicons-2.0.1/scss/_ionicons-icons.scss | 1473 - .../ionicons-2.0.1/scss/_ionicons-variables.scss | 741 - .../external/ionicons-2.0.1/scss/ionicons.scss | 15 - .../external/ionicons-2.0.1/src/alert-circled.svg | 11 - .../fusion/external/ionicons-2.0.1/src/alert.svg | 9 - .../ionicons-2.0.1/src/android-add-circle.svg | 12 - .../external/ionicons-2.0.1/src/android-add.svg | 11 - .../ionicons-2.0.1/src/android-alarm-clock.svg | 15 - .../external/ionicons-2.0.1/src/android-alert.svg | 12 - .../external/ionicons-2.0.1/src/android-apps.svg | 12 - .../ionicons-2.0.1/src/android-archive.svg | 12 - .../ionicons-2.0.1/src/android-arrow-back.svg | 11 - .../ionicons-2.0.1/src/android-arrow-down.svg | 11 - .../src/android-arrow-dropdown-circle.svg | 10 - .../ionicons-2.0.1/src/android-arrow-dropdown.svg | 9 - .../src/android-arrow-dropleft-circle.svg | 10 - .../ionicons-2.0.1/src/android-arrow-dropleft.svg | 9 - .../src/android-arrow-dropright-circle.svg | 10 - .../ionicons-2.0.1/src/android-arrow-dropright.svg | 9 - .../src/android-arrow-dropup-circle.svg | 10 - .../ionicons-2.0.1/src/android-arrow-dropup.svg | 9 - .../ionicons-2.0.1/src/android-arrow-forward.svg | 11 - .../ionicons-2.0.1/src/android-arrow-up.svg | 11 - .../external/ionicons-2.0.1/src/android-attach.svg | 15 - .../external/ionicons-2.0.1/src/android-bar.svg | 12 - .../ionicons-2.0.1/src/android-bicycle.svg | 19 - .../external/ionicons-2.0.1/src/android-boat.svg | 16 - .../ionicons-2.0.1/src/android-bookmark.svg | 7 - .../external/ionicons-2.0.1/src/android-bulb.svg | 18 - .../external/ionicons-2.0.1/src/android-bus.svg | 18 - .../ionicons-2.0.1/src/android-calendar.svg | 11 - .../external/ionicons-2.0.1/src/android-call.svg | 10 - .../external/ionicons-2.0.1/src/android-camera.svg | 12 - .../external/ionicons-2.0.1/src/android-cancel.svg | 11 - .../external/ionicons-2.0.1/src/android-car.svg | 15 - .../external/ionicons-2.0.1/src/android-cart.svg | 14 - .../external/ionicons-2.0.1/src/android-chat.svg | 12 - .../ionicons-2.0.1/src/android-checkbox-blank.svg | 12 - .../src/android-checkbox-outline-blank.svg | 13 - .../src/android-checkbox-outline.svg | 13 - .../ionicons-2.0.1/src/android-checkbox.svg | 13 - .../src/android-checkmark-circle.svg | 9 - .../ionicons-2.0.1/src/android-clipboard.svg | 10 - .../external/ionicons-2.0.1/src/android-close.svg | 12 - .../ionicons-2.0.1/src/android-cloud-circle.svg | 16 - .../ionicons-2.0.1/src/android-cloud-done.svg | 12 - .../ionicons-2.0.1/src/android-cloud-outline.svg | 16 - .../external/ionicons-2.0.1/src/android-cloud.svg | 9 - .../ionicons-2.0.1/src/android-color-palette.svg | 17 - .../ionicons-2.0.1/src/android-compass.svg | 9 - .../ionicons-2.0.1/src/android-contact.svg | 15 - .../ionicons-2.0.1/src/android-contacts.svg | 26 - .../ionicons-2.0.1/src/android-contract.svg | 12 - .../external/ionicons-2.0.1/src/android-create.svg | 13 - .../external/ionicons-2.0.1/src/android-delete.svg | 10 - .../ionicons-2.0.1/src/android-desktop.svg | 13 - .../ionicons-2.0.1/src/android-document.svg | 10 - .../ionicons-2.0.1/src/android-done-all.svg | 13 - .../external/ionicons-2.0.1/src/android-done.svg | 13 - .../ionicons-2.0.1/src/android-download.svg | 9 - .../external/ionicons-2.0.1/src/android-drafts.svg | 15 - .../external/ionicons-2.0.1/src/android-exit.svg | 9 - .../external/ionicons-2.0.1/src/android-expand.svg | 12 - .../src/android-favorite-outline.svg | 13 - .../ionicons-2.0.1/src/android-favorite.svg | 11 - .../external/ionicons-2.0.1/src/android-film.svg | 9 - .../ionicons-2.0.1/src/android-folder-open.svg | 10 - .../external/ionicons-2.0.1/src/android-folder.svg | 14 - .../external/ionicons-2.0.1/src/android-funnel.svg | 7 - .../external/ionicons-2.0.1/src/android-globe.svg | 24 - .../external/ionicons-2.0.1/src/android-hand.svg | 15 - .../ionicons-2.0.1/src/android-hangout.svg | 9 - .../external/ionicons-2.0.1/src/android-happy.svg | 12 - .../external/ionicons-2.0.1/src/android-home.svg | 9 - .../external/ionicons-2.0.1/src/android-image.svg | 13 - .../external/ionicons-2.0.1/src/android-laptop.svg | 14 - .../external/ionicons-2.0.1/src/android-list.svg | 10 - .../external/ionicons-2.0.1/src/android-locate.svg | 16 - .../external/ionicons-2.0.1/src/android-lock.svg | 14 - .../external/ionicons-2.0.1/src/android-mail.svg | 13 - .../external/ionicons-2.0.1/src/android-map.svg | 16 - .../external/ionicons-2.0.1/src/android-menu.svg | 11 - .../ionicons-2.0.1/src/android-microphone-off.svg | 17 - .../ionicons-2.0.1/src/android-microphone.svg | 12 - .../ionicons-2.0.1/src/android-more-horizontal.svg | 9 - .../ionicons-2.0.1/src/android-more-vertical.svg | 9 - .../ionicons-2.0.1/src/android-navigate.svg | 11 - .../src/android-notifications-none.svg | 11 - .../src/android-notifications-off.svg | 13 - .../ionicons-2.0.1/src/android-notifications.svg | 9 - .../external/ionicons-2.0.1/src/android-open.svg | 9 - .../ionicons-2.0.1/src/android-options.svg | 26 - .../external/ionicons-2.0.1/src/android-people.svg | 11 - .../ionicons-2.0.1/src/android-person-add.svg | 17 - .../external/ionicons-2.0.1/src/android-person.svg | 10 - .../ionicons-2.0.1/src/android-phone-landscape.svg | 12 - .../ionicons-2.0.1/src/android-phone-portrait.svg | 12 - .../external/ionicons-2.0.1/src/android-pin.svg | 11 - .../external/ionicons-2.0.1/src/android-plane.svg | 12 - .../ionicons-2.0.1/src/android-playstore.svg | 11 - .../external/ionicons-2.0.1/src/android-print.svg | 10 - .../src/android-radio-button-off.svg | 12 - .../ionicons-2.0.1/src/android-radio-button-on.svg | 13 - .../ionicons-2.0.1/src/android-refresh.svg | 11 - .../ionicons-2.0.1/src/android-remove-circle.svg | 10 - .../external/ionicons-2.0.1/src/android-remove.svg | 7 - .../ionicons-2.0.1/src/android-restaurant.svg | 17 - .../external/ionicons-2.0.1/src/android-sad.svg | 16 - .../external/ionicons-2.0.1/src/android-search.svg | 19 - .../external/ionicons-2.0.1/src/android-send.svg | 7 - .../ionicons-2.0.1/src/android-settings.svg | 19 - .../ionicons-2.0.1/src/android-share-alt.svg | 16 - .../external/ionicons-2.0.1/src/android-share.svg | 12 - .../ionicons-2.0.1/src/android-star-half.svg | 9 - .../ionicons-2.0.1/src/android-star-outline.svg | 10 - .../external/ionicons-2.0.1/src/android-star.svg | 10 - .../ionicons-2.0.1/src/android-stopwatch.svg | 21 - .../external/ionicons-2.0.1/src/android-subway.svg | 13 - .../external/ionicons-2.0.1/src/android-sunny.svg | 18 - .../external/ionicons-2.0.1/src/android-sync.svg | 10 - .../ionicons-2.0.1/src/android-textsms.svg | 10 - .../external/ionicons-2.0.1/src/android-time.svg | 15 - .../external/ionicons-2.0.1/src/android-train.svg | 15 - .../external/ionicons-2.0.1/src/android-unlock.svg | 10 - .../external/ionicons-2.0.1/src/android-upload.svg | 9 - .../ionicons-2.0.1/src/android-volume-down.svg | 8 - .../ionicons-2.0.1/src/android-volume-mute.svg | 7 - .../ionicons-2.0.1/src/android-volume-off.svg | 15 - .../ionicons-2.0.1/src/android-volume-up.svg | 9 - .../external/ionicons-2.0.1/src/android-walk.svg | 12 - .../ionicons-2.0.1/src/android-warning.svg | 11 - .../external/ionicons-2.0.1/src/android-watch.svg | 15 - .../external/ionicons-2.0.1/src/android-wifi.svg | 14 - .../external/ionicons-2.0.1/src/aperture.svg | 20 - .../fusion/external/ionicons-2.0.1/src/archive.svg | 12 - .../external/ionicons-2.0.1/src/arrow-down-a.svg | 7 - .../external/ionicons-2.0.1/src/arrow-down-b.svg | 8 - .../external/ionicons-2.0.1/src/arrow-down-c.svg | 9 - .../external/ionicons-2.0.1/src/arrow-expand.svg | 12 - .../ionicons-2.0.1/src/arrow-graph-down-left.svg | 7 - .../ionicons-2.0.1/src/arrow-graph-down-right.svg | 7 - .../ionicons-2.0.1/src/arrow-graph-up-left.svg | 7 - .../ionicons-2.0.1/src/arrow-graph-up-right.svg | 7 - .../external/ionicons-2.0.1/src/arrow-left-a.svg | 7 - .../external/ionicons-2.0.1/src/arrow-left-b.svg | 8 - .../external/ionicons-2.0.1/src/arrow-left-c.svg | 9 - .../external/ionicons-2.0.1/src/arrow-move.svg | 8 - .../external/ionicons-2.0.1/src/arrow-resize.svg | 8 - .../ionicons-2.0.1/src/arrow-return-left.svg | 8 - .../ionicons-2.0.1/src/arrow-return-right.svg | 8 - .../external/ionicons-2.0.1/src/arrow-right-a.svg | 7 - .../external/ionicons-2.0.1/src/arrow-right-b.svg | 8 - .../external/ionicons-2.0.1/src/arrow-right-c.svg | 9 - .../external/ionicons-2.0.1/src/arrow-shrink.svg | 12 - .../external/ionicons-2.0.1/src/arrow-swap.svg | 10 - .../external/ionicons-2.0.1/src/arrow-up-a.svg | 7 - .../external/ionicons-2.0.1/src/arrow-up-b.svg | 8 - .../external/ionicons-2.0.1/src/arrow-up-c.svg | 9 - .../external/ionicons-2.0.1/src/asterisk.svg | 8 - .../app/fusion/external/ionicons-2.0.1/src/at.svg | 25 - .../ionicons-2.0.1/src/backspace-outline.svg | 21 - .../external/ionicons-2.0.1/src/backspace.svg | 17 - .../app/fusion/external/ionicons-2.0.1/src/bag.svg | 10 - .../ionicons-2.0.1/src/battery-charging.svg | 9 - .../external/ionicons-2.0.1/src/battery-empty.svg | 8 - .../external/ionicons-2.0.1/src/battery-full.svg | 8 - .../external/ionicons-2.0.1/src/battery-half.svg | 9 - .../external/ionicons-2.0.1/src/battery-low.svg | 9 - .../fusion/external/ionicons-2.0.1/src/beaker.svg | 20 - .../fusion/external/ionicons-2.0.1/src/beer.svg | 28 - .../external/ionicons-2.0.1/src/bluetooth.svg | 18 - .../fusion/external/ionicons-2.0.1/src/bonfire.svg | 32 - .../external/ionicons-2.0.1/src/bookmark.svg | 10 - .../fusion/external/ionicons-2.0.1/src/bowtie.svg | 22 - .../external/ionicons-2.0.1/src/briefcase.svg | 12 - .../app/fusion/external/ionicons-2.0.1/src/bug.svg | 30 - .../external/ionicons-2.0.1/src/calculator.svg | 10 - .../external/ionicons-2.0.1/src/calendar.svg | 12 - .../fusion/external/ionicons-2.0.1/src/camera.svg | 15 - .../fusion/external/ionicons-2.0.1/src/card.svg | 14 - .../fusion/external/ionicons-2.0.1/src/cash.svg | 31 - .../ionicons-2.0.1/src/chatbox-working.svg | 11 - .../fusion/external/ionicons-2.0.1/src/chatbox.svg | 8 - .../external/ionicons-2.0.1/src/chatboxes.svg | 12 - .../ionicons-2.0.1/src/chatbubble-working.svg | 12 - .../external/ionicons-2.0.1/src/chatbubble.svg | 9 - .../external/ionicons-2.0.1/src/chatbubbles.svg | 16 - .../ionicons-2.0.1/src/checkmark-circled.svg | 13 - .../ionicons-2.0.1/src/checkmark-round.svg | 9 - .../external/ionicons-2.0.1/src/checkmark.svg | 10 - .../external/ionicons-2.0.1/src/chevron-down.svg | 9 - .../external/ionicons-2.0.1/src/chevron-left.svg | 9 - .../external/ionicons-2.0.1/src/chevron-right.svg | 9 - .../external/ionicons-2.0.1/src/chevron-up.svg | 9 - .../external/ionicons-2.0.1/src/clipboard.svg | 22 - .../fusion/external/ionicons-2.0.1/src/clock.svg | 21 - .../external/ionicons-2.0.1/src/close-circled.svg | 13 - .../external/ionicons-2.0.1/src/close-round.svg | 9 - .../fusion/external/ionicons-2.0.1/src/close.svg | 10 - .../ionicons-2.0.1/src/closed-captioning.svg | 31 - .../fusion/external/ionicons-2.0.1/src/cloud.svg | 9 - .../external/ionicons-2.0.1/src/code-download.svg | 31 - .../external/ionicons-2.0.1/src/code-working.svg | 21 - .../fusion/external/ionicons-2.0.1/src/code.svg | 14 - .../fusion/external/ionicons-2.0.1/src/coffee.svg | 13 - .../fusion/external/ionicons-2.0.1/src/compass.svg | 16 - .../fusion/external/ionicons-2.0.1/src/compose.svg | 14 - .../ionicons-2.0.1/src/connection-bars.svg | 12 - .../external/ionicons-2.0.1/src/contrast.svg | 9 - .../fusion/external/ionicons-2.0.1/src/crop.svg | 11 - .../fusion/external/ionicons-2.0.1/src/cube.svg | 19 - .../fusion/external/ionicons-2.0.1/src/disc.svg | 13 - .../external/ionicons-2.0.1/src/document-text.svg | 15 - .../external/ionicons-2.0.1/src/document.svg | 10 - .../fusion/external/ionicons-2.0.1/src/drag.svg | 11 - .../fusion/external/ionicons-2.0.1/src/earth.svg | 44 - .../fusion/external/ionicons-2.0.1/src/easel.svg | 15 - .../fusion/external/ionicons-2.0.1/src/edit.svg | 13 - .../app/fusion/external/ionicons-2.0.1/src/egg.svg | 7 - .../fusion/external/ionicons-2.0.1/src/eject.svg | 12 - .../external/ionicons-2.0.1/src/email-unread.svg | 19 - .../fusion/external/ionicons-2.0.1/src/email.svg | 15 - .../src/erlenmeyer-flask-bubbles.svg | 15 - .../ionicons-2.0.1/src/erlenmeyer-flask.svg | 21 - .../external/ionicons-2.0.1/src/eye-disabled.svg | 18 - .../app/fusion/external/ionicons-2.0.1/src/eye.svg | 15 - .../fusion/external/ionicons-2.0.1/src/female.svg | 8 - .../fusion/external/ionicons-2.0.1/src/filing.svg | 12 - .../external/ionicons-2.0.1/src/film-marker.svg | 10 - .../external/ionicons-2.0.1/src/fireball.svg | 16 - .../fusion/external/ionicons-2.0.1/src/flag.svg | 12 - .../fusion/external/ionicons-2.0.1/src/flame.svg | 11 - .../external/ionicons-2.0.1/src/flash-off.svg | 16 - .../fusion/external/ionicons-2.0.1/src/flash.svg | 7 - .../fusion/external/ionicons-2.0.1/src/folder.svg | 14 - .../external/ionicons-2.0.1/src/fork-repo.svg | 20 - .../fusion/external/ionicons-2.0.1/src/fork.svg | 14 - .../fusion/external/ionicons-2.0.1/src/forward.svg | 9 - .../fusion/external/ionicons-2.0.1/src/funnel.svg | 13 - .../fusion/external/ionicons-2.0.1/src/gear-a.svg | 15 - .../fusion/external/ionicons-2.0.1/src/gear-b.svg | 11 - .../fusion/external/ionicons-2.0.1/src/grid.svg | 32 - .../fusion/external/ionicons-2.0.1/src/hammer.svg | 11 - .../external/ionicons-2.0.1/src/happy-outline.svg | 23 - .../fusion/external/ionicons-2.0.1/src/happy.svg | 20 - .../external/ionicons-2.0.1/src/headphone.svg | 15 - .../external/ionicons-2.0.1/src/heart-broken.svg | 17 - .../fusion/external/ionicons-2.0.1/src/heart.svg | 10 - .../external/ionicons-2.0.1/src/help-buoy.svg | 13 - .../external/ionicons-2.0.1/src/help-circled.svg | 15 - .../fusion/external/ionicons-2.0.1/src/help.svg | 14 - .../fusion/external/ionicons-2.0.1/src/home.svg | 9 - .../external/ionicons-2.0.1/src/icecream.svg | 15 - .../fusion/external/ionicons-2.0.1/src/image.svg | 13 - .../fusion/external/ionicons-2.0.1/src/images.svg | 20 - .../ionicons-2.0.1/src/information-circled.svg | 11 - .../external/ionicons-2.0.1/src/information.svg | 10 - .../fusion/external/ionicons-2.0.1/src/ionic.svg | 18 - .../ionicons-2.0.1/src/ios-alarm-outline.svg | 21 - .../external/ionicons-2.0.1/src/ios-alarm.svg | 14 - .../ionicons-2.0.1/src/ios-albums-outline.svg | 11 - .../external/ionicons-2.0.1/src/ios-albums.svg | 11 - .../src/ios-americanfootball-outline.svg | 24 - .../ionicons-2.0.1/src/ios-americanfootball.svg | 21 - .../ionicons-2.0.1/src/ios-analytics-outline.svg | 24 - .../external/ionicons-2.0.1/src/ios-analytics.svg | 17 - .../external/ionicons-2.0.1/src/ios-arrow-back.svg | 7 - .../external/ionicons-2.0.1/src/ios-arrow-down.svg | 7 - .../ionicons-2.0.1/src/ios-arrow-forward.svg | 7 - .../external/ionicons-2.0.1/src/ios-arrow-left.svg | 7 - .../ionicons-2.0.1/src/ios-arrow-right.svg | 7 - .../ionicons-2.0.1/src/ios-arrow-thin-down.svg | 9 - .../ionicons-2.0.1/src/ios-arrow-thin-left.svg | 9 - .../ionicons-2.0.1/src/ios-arrow-thin-right.svg | 9 - .../ionicons-2.0.1/src/ios-arrow-thin-up.svg | 9 - .../external/ionicons-2.0.1/src/ios-arrow-up.svg | 7 - .../external/ionicons-2.0.1/src/ios-at-outline.svg | 26 - .../fusion/external/ionicons-2.0.1/src/ios-at.svg | 24 - .../ionicons-2.0.1/src/ios-barcode-outline.svg | 15 - .../external/ionicons-2.0.1/src/ios-barcode.svg | 10 - .../ionicons-2.0.1/src/ios-baseball-outline.svg | 35 - .../external/ionicons-2.0.1/src/ios-baseball.svg | 27 - .../ionicons-2.0.1/src/ios-basketball-outline.svg | 25 - .../external/ionicons-2.0.1/src/ios-basketball.svg | 21 - .../ionicons-2.0.1/src/ios-bell-outline.svg | 13 - .../external/ionicons-2.0.1/src/ios-bell.svg | 11 - .../ionicons-2.0.1/src/ios-body-outline.svg | 27 - .../external/ionicons-2.0.1/src/ios-body.svg | 17 - .../ionicons-2.0.1/src/ios-bolt-outline.svg | 8 - .../external/ionicons-2.0.1/src/ios-bolt.svg | 7 - .../ionicons-2.0.1/src/ios-book-outline.svg | 13 - .../external/ionicons-2.0.1/src/ios-book.svg | 12 - .../ionicons-2.0.1/src/ios-bookmarks-outline.svg | 13 - .../external/ionicons-2.0.1/src/ios-bookmarks.svg | 13 - .../ionicons-2.0.1/src/ios-box-outline.svg | 13 - .../fusion/external/ionicons-2.0.1/src/ios-box.svg | 10 - .../ionicons-2.0.1/src/ios-briefcase-outline.svg | 11 - .../external/ionicons-2.0.1/src/ios-briefcase.svg | 13 - .../ionicons-2.0.1/src/ios-browsers-outline.svg | 12 - .../external/ionicons-2.0.1/src/ios-browsers.svg | 10 - .../ionicons-2.0.1/src/ios-calculator-outline.svg | 19 - .../external/ionicons-2.0.1/src/ios-calculator.svg | 9 - .../ionicons-2.0.1/src/ios-calendar-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-calendar.svg | 12 - .../ionicons-2.0.1/src/ios-camera-outline.svg | 17 - .../external/ionicons-2.0.1/src/ios-camera.svg | 13 - .../ionicons-2.0.1/src/ios-cart-outline.svg | 16 - .../external/ionicons-2.0.1/src/ios-cart.svg | 14 - .../ionicons-2.0.1/src/ios-chatboxes-outline.svg | 10 - .../external/ionicons-2.0.1/src/ios-chatboxes.svg | 10 - .../ionicons-2.0.1/src/ios-chatbubble-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-chatbubble.svg | 11 - .../ionicons-2.0.1/src/ios-checkmark-empty.svg | 10 - .../ionicons-2.0.1/src/ios-checkmark-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-checkmark.svg | 10 - .../ionicons-2.0.1/src/ios-circle-filled.svg | 18 - .../ionicons-2.0.1/src/ios-circle-outline.svg | 13 - .../ionicons-2.0.1/src/ios-clock-outline.svg | 12 - .../external/ionicons-2.0.1/src/ios-clock.svg | 10 - .../ionicons-2.0.1/src/ios-close-empty.svg | 13 - .../ionicons-2.0.1/src/ios-close-outline.svg | 20 - .../external/ionicons-2.0.1/src/ios-close.svg | 16 - .../src/ios-cloud-download-outline.svg | 19 - .../ionicons-2.0.1/src/ios-cloud-download.svg | 12 - .../ionicons-2.0.1/src/ios-cloud-outline.svg | 12 - .../src/ios-cloud-upload-outline.svg | 20 - .../ionicons-2.0.1/src/ios-cloud-upload.svg | 13 - .../external/ionicons-2.0.1/src/ios-cloud.svg | 9 - .../src/ios-cloudy-night-outline.svg | 24 - .../ionicons-2.0.1/src/ios-cloudy-night.svg | 21 - .../ionicons-2.0.1/src/ios-cloudy-outline.svg | 17 - .../external/ionicons-2.0.1/src/ios-cloudy.svg | 14 - .../ionicons-2.0.1/src/ios-cog-outline.svg | 29 - .../fusion/external/ionicons-2.0.1/src/ios-cog.svg | 23 - .../src/ios-color-filter-outline.svg | 25 - .../ionicons-2.0.1/src/ios-color-filter.svg | 29 - .../ionicons-2.0.1/src/ios-color-wand-outline.svg | 17 - .../external/ionicons-2.0.1/src/ios-color-wand.svg | 16 - .../ionicons-2.0.1/src/ios-compose-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-compose.svg | 13 - .../ionicons-2.0.1/src/ios-contact-outline.svg | 13 - .../external/ionicons-2.0.1/src/ios-contact.svg | 13 - .../ionicons-2.0.1/src/ios-copy-outline.svg | 11 - .../external/ionicons-2.0.1/src/ios-copy.svg | 12 - .../ionicons-2.0.1/src/ios-crop-strong.svg | 12 - .../external/ionicons-2.0.1/src/ios-crop.svg | 12 - .../ionicons-2.0.1/src/ios-download-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-download.svg | 11 - .../external/ionicons-2.0.1/src/ios-drag.svg | 11 - .../ionicons-2.0.1/src/ios-email-outline.svg | 8 - .../external/ionicons-2.0.1/src/ios-email.svg | 11 - .../ionicons-2.0.1/src/ios-eye-outline.svg | 18 - .../fusion/external/ionicons-2.0.1/src/ios-eye.svg | 13 - .../ionicons-2.0.1/src/ios-fastforward-outline.svg | 8 - .../ionicons-2.0.1/src/ios-fastforward.svg | 7 - .../ionicons-2.0.1/src/ios-filing-outline.svg | 9 - .../external/ionicons-2.0.1/src/ios-filing.svg | 11 - .../ionicons-2.0.1/src/ios-film-outline.svg | 9 - .../external/ionicons-2.0.1/src/ios-film.svg | 11 - .../ionicons-2.0.1/src/ios-flag-outline.svg | 13 - .../external/ionicons-2.0.1/src/ios-flag.svg | 11 - .../ionicons-2.0.1/src/ios-flame-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-flame.svg | 11 - .../ionicons-2.0.1/src/ios-flask-outline.svg | 19 - .../external/ionicons-2.0.1/src/ios-flask.svg | 17 - .../ionicons-2.0.1/src/ios-flower-outline.svg | 75 - .../external/ionicons-2.0.1/src/ios-flower.svg | 38 - .../ionicons-2.0.1/src/ios-folder-outline.svg | 11 - .../external/ionicons-2.0.1/src/ios-folder.svg | 13 - .../ionicons-2.0.1/src/ios-football-outline.svg | 20 - .../external/ionicons-2.0.1/src/ios-football.svg | 14 - .../src/ios-game-controller-a-outline.svg | 26 - .../ionicons-2.0.1/src/ios-game-controller-a.svg | 19 - .../src/ios-game-controller-b-outline.svg | 35 - .../ionicons-2.0.1/src/ios-game-controller-b.svg | 23 - .../ionicons-2.0.1/src/ios-gear-outline.svg | 40 - .../external/ionicons-2.0.1/src/ios-gear.svg | 17 - .../ionicons-2.0.1/src/ios-glasses-outline.svg | 12 - .../external/ionicons-2.0.1/src/ios-glasses.svg | 11 - .../ionicons-2.0.1/src/ios-grid-view-outline.svg | 8 - .../external/ionicons-2.0.1/src/ios-grid-view.svg | 11 - .../ionicons-2.0.1/src/ios-heart-outline.svg | 15 - .../external/ionicons-2.0.1/src/ios-heart.svg | 9 - .../external/ionicons-2.0.1/src/ios-help-empty.svg | 12 - .../ionicons-2.0.1/src/ios-help-outline.svg | 22 - .../external/ionicons-2.0.1/src/ios-help.svg | 12 - .../ionicons-2.0.1/src/ios-home-outline.svg | 11 - .../external/ionicons-2.0.1/src/ios-home.svg | 10 - .../ionicons-2.0.1/src/ios-infinite-outline.svg | 17 - .../external/ionicons-2.0.1/src/ios-infinite.svg | 16 - .../ionicons-2.0.1/src/ios-information-empty.svg | 12 - .../ionicons-2.0.1/src/ios-information-outline.svg | 17 - .../ionicons-2.0.1/src/ios-information.svg | 11 - .../ionicons-2.0.1/src/ios-ionic-outline.svg | 18 - .../ionicons-2.0.1/src/ios-keypad-outline.svg | 28 - .../external/ionicons-2.0.1/src/ios-keypad.svg | 20 - .../ionicons-2.0.1/src/ios-lightbulb-outline.svg | 17 - .../external/ionicons-2.0.1/src/ios-lightbulb.svg | 16 - .../ionicons-2.0.1/src/ios-list-outline.svg | 23 - .../external/ionicons-2.0.1/src/ios-list.svg | 11 - .../ionicons-2.0.1/src/ios-location-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-location.svg | 8 - .../ionicons-2.0.1/src/ios-locked-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-locked.svg | 12 - .../ionicons-2.0.1/src/ios-loop-strong.svg | 18 - .../external/ionicons-2.0.1/src/ios-loop.svg | 22 - .../ionicons-2.0.1/src/ios-medical-outline.svg | 10 - .../external/ionicons-2.0.1/src/ios-medical.svg | 8 - .../ionicons-2.0.1/src/ios-medkit-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-medkit.svg | 13 - .../external/ionicons-2.0.1/src/ios-mic-off.svg | 14 - .../ionicons-2.0.1/src/ios-mic-outline.svg | 12 - .../fusion/external/ionicons-2.0.1/src/ios-mic.svg | 12 - .../ionicons-2.0.1/src/ios-minus-empty.svg | 9 - .../ionicons-2.0.1/src/ios-minus-outline.svg | 16 - .../external/ionicons-2.0.1/src/ios-minus.svg | 10 - .../ionicons-2.0.1/src/ios-monitor-outline.svg | 7 - .../external/ionicons-2.0.1/src/ios-monitor.svg | 10 - .../ionicons-2.0.1/src/ios-moon-outline.svg | 15 - .../external/ionicons-2.0.1/src/ios-moon.svg | 13 - .../ionicons-2.0.1/src/ios-more-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-more.svg | 11 - .../ionicons-2.0.1/src/ios-musical-note.svg | 9 - .../ionicons-2.0.1/src/ios-musical-notes.svg | 9 - .../ionicons-2.0.1/src/ios-navigate-outline.svg | 12 - .../external/ionicons-2.0.1/src/ios-navigate.svg | 10 - .../ionicons-2.0.1/src/ios-nutrition-outline.svg | 29 - .../external/ionicons-2.0.1/src/ios-nutrition.svg | 17 - .../ionicons-2.0.1/src/ios-paper-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-paper.svg | 8 - .../ionicons-2.0.1/src/ios-paperplane-outline.svg | 8 - .../external/ionicons-2.0.1/src/ios-paperplane.svg | 10 - .../ionicons-2.0.1/src/ios-partlysunny-outline.svg | 33 - .../ionicons-2.0.1/src/ios-partlysunny.svg | 28 - .../ionicons-2.0.1/src/ios-pause-outline.svg | 10 - .../external/ionicons-2.0.1/src/ios-pause.svg | 10 - .../ionicons-2.0.1/src/ios-paw-outline.svg | 43 - .../fusion/external/ionicons-2.0.1/src/ios-paw.svg | 26 - .../ionicons-2.0.1/src/ios-people-outline.svg | 44 - .../external/ionicons-2.0.1/src/ios-people.svg | 29 - .../ionicons-2.0.1/src/ios-person-outline.svg | 22 - .../external/ionicons-2.0.1/src/ios-person.svg | 13 - .../ionicons-2.0.1/src/ios-personadd-outline.svg | 25 - .../external/ionicons-2.0.1/src/ios-personadd.svg | 16 - .../ionicons-2.0.1/src/ios-photos-outline.svg | 10 - .../external/ionicons-2.0.1/src/ios-photos.svg | 10 - .../ionicons-2.0.1/src/ios-pie-outline.svg | 16 - .../fusion/external/ionicons-2.0.1/src/ios-pie.svg | 11 - .../ionicons-2.0.1/src/ios-pint-outline.svg | 17 - .../external/ionicons-2.0.1/src/ios-pint.svg | 12 - .../ionicons-2.0.1/src/ios-play-outline.svg | 9 - .../external/ionicons-2.0.1/src/ios-play.svg | 9 - .../external/ionicons-2.0.1/src/ios-plus-empty.svg | 9 - .../ionicons-2.0.1/src/ios-plus-outline.svg | 18 - .../external/ionicons-2.0.1/src/ios-plus.svg | 10 - .../ionicons-2.0.1/src/ios-pricetag-outline.svg | 11 - .../external/ionicons-2.0.1/src/ios-pricetag.svg | 11 - .../ionicons-2.0.1/src/ios-pricetags-outline.svg | 12 - .../external/ionicons-2.0.1/src/ios-pricetags.svg | 16 - .../ionicons-2.0.1/src/ios-printer-outline.svg | 12 - .../external/ionicons-2.0.1/src/ios-printer.svg | 17 - .../ionicons-2.0.1/src/ios-pulse-strong.svg | 12 - .../external/ionicons-2.0.1/src/ios-pulse.svg | 12 - .../ionicons-2.0.1/src/ios-rainy-outline.svg | 20 - .../external/ionicons-2.0.1/src/ios-rainy.svg | 17 - .../ionicons-2.0.1/src/ios-recording-outline.svg | 15 - .../external/ionicons-2.0.1/src/ios-recording.svg | 14 - .../ionicons-2.0.1/src/ios-redo-outline.svg | 11 - .../external/ionicons-2.0.1/src/ios-redo.svg | 10 - .../ionicons-2.0.1/src/ios-refresh-empty.svg | 10 - .../ionicons-2.0.1/src/ios-refresh-outline.svg | 15 - .../external/ionicons-2.0.1/src/ios-refresh.svg | 11 - .../external/ionicons-2.0.1/src/ios-reload.svg | 11 - .../src/ios-reverse-camera-outline.svg | 20 - .../ionicons-2.0.1/src/ios-reverse-camera.svg | 15 - .../ionicons-2.0.1/src/ios-rewind-outline.svg | 8 - .../external/ionicons-2.0.1/src/ios-rewind.svg | 7 - .../ionicons-2.0.1/src/ios-rose-outline.svg | 29 - .../external/ionicons-2.0.1/src/ios-rose.svg | 18 - .../ionicons-2.0.1/src/ios-search-strong.svg | 10 - .../external/ionicons-2.0.1/src/ios-search.svg | 10 - .../ionicons-2.0.1/src/ios-settings-strong.svg | 14 - .../external/ionicons-2.0.1/src/ios-settings.svg | 24 - .../ionicons-2.0.1/src/ios-shuffle-strong.svg | 18 - .../external/ionicons-2.0.1/src/ios-shuffle.svg | 20 - .../src/ios-skipbackward-outline.svg | 8 - .../ionicons-2.0.1/src/ios-skipbackward.svg | 7 - .../ionicons-2.0.1/src/ios-skipforward-outline.svg | 8 - .../ionicons-2.0.1/src/ios-skipforward.svg | 7 - .../external/ionicons-2.0.1/src/ios-snowy.svg | 26 - .../ionicons-2.0.1/src/ios-speedometer-outline.svg | 24 - .../ionicons-2.0.1/src/ios-speedometer.svg | 28 - .../external/ionicons-2.0.1/src/ios-star-half.svg | 8 - .../ionicons-2.0.1/src/ios-star-outline.svg | 8 - .../external/ionicons-2.0.1/src/ios-star.svg | 7 - .../ionicons-2.0.1/src/ios-stopwatch-outline.svg | 15 - .../external/ionicons-2.0.1/src/ios-stopwatch.svg | 13 - .../ionicons-2.0.1/src/ios-sunny-outline.svg | 27 - .../external/ionicons-2.0.1/src/ios-sunny.svg | 26 - .../ionicons-2.0.1/src/ios-telephone-outline.svg | 17 - .../external/ionicons-2.0.1/src/ios-telephone.svg | 12 - .../ionicons-2.0.1/src/ios-tennisball-outline.svg | 19 - .../external/ionicons-2.0.1/src/ios-tennisball.svg | 25 - .../src/ios-thunderstorm-outline.svg | 22 - .../ionicons-2.0.1/src/ios-thunderstorm.svg | 17 - .../ionicons-2.0.1/src/ios-time-outline.svg | 36 - .../external/ionicons-2.0.1/src/ios-time.svg | 27 - .../ionicons-2.0.1/src/ios-timer-outline.svg | 11 - .../external/ionicons-2.0.1/src/ios-timer.svg | 12 - .../ionicons-2.0.1/src/ios-toggle-outline.svg | 22 - .../external/ionicons-2.0.1/src/ios-toggle.svg | 16 - .../ionicons-2.0.1/src/ios-trash-outline.svg | 17 - .../external/ionicons-2.0.1/src/ios-trash.svg | 12 - .../ionicons-2.0.1/src/ios-undo-outline.svg | 11 - .../external/ionicons-2.0.1/src/ios-undo.svg | 10 - .../ionicons-2.0.1/src/ios-unlocked-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-unlocked.svg | 12 - .../ionicons-2.0.1/src/ios-upload-outline.svg | 14 - .../external/ionicons-2.0.1/src/ios-upload.svg | 10 - .../ionicons-2.0.1/src/ios-videocam-outline.svg | 12 - .../external/ionicons-2.0.1/src/ios-videocam.svg | 11 - .../ionicons-2.0.1/src/ios-volume-high.svg | 19 - .../external/ionicons-2.0.1/src/ios-volume-low.svg | 7 - .../ionicons-2.0.1/src/ios-wineglass-outline.svg | 15 - .../external/ionicons-2.0.1/src/ios-wineglass.svg | 11 - .../ionicons-2.0.1/src/ios-world-outline.svg | 22 - .../external/ionicons-2.0.1/src/ios-world.svg | 29 - .../fusion/external/ionicons-2.0.1/src/ipad.svg | 10 - .../fusion/external/ionicons-2.0.1/src/iphone.svg | 13 - .../fusion/external/ionicons-2.0.1/src/ipod.svg | 13 - .../app/fusion/external/ionicons-2.0.1/src/jet.svg | 14 - .../app/fusion/external/ionicons-2.0.1/src/key.svg | 14 - .../fusion/external/ionicons-2.0.1/src/knife.svg | 9 - .../fusion/external/ionicons-2.0.1/src/laptop.svg | 10 - .../fusion/external/ionicons-2.0.1/src/leaf.svg | 12 - .../fusion/external/ionicons-2.0.1/src/levels.svg | 16 - .../external/ionicons-2.0.1/src/lightbulb.svg | 21 - .../fusion/external/ionicons-2.0.1/src/link.svg | 15 - .../fusion/external/ionicons-2.0.1/src/load-a.svg | 17 - .../fusion/external/ionicons-2.0.1/src/load-b.svg | 20 - .../fusion/external/ionicons-2.0.1/src/load-c.svg | 21 - .../fusion/external/ionicons-2.0.1/src/load-d.svg | 28 - .../external/ionicons-2.0.1/src/location.svg | 11 - .../ionicons-2.0.1/src/lock-combination.svg | 28 - .../fusion/external/ionicons-2.0.1/src/locked.svg | 11 - .../fusion/external/ionicons-2.0.1/src/log-in.svg | 14 - .../fusion/external/ionicons-2.0.1/src/log-out.svg | 17 - .../fusion/external/ionicons-2.0.1/src/loop.svg | 14 - .../fusion/external/ionicons-2.0.1/src/magnet.svg | 14 - .../fusion/external/ionicons-2.0.1/src/male.svg | 10 - .../app/fusion/external/ionicons-2.0.1/src/man.svg | 12 - .../app/fusion/external/ionicons-2.0.1/src/map.svg | 30 - .../fusion/external/ionicons-2.0.1/src/medkit.svg | 12 - .../fusion/external/ionicons-2.0.1/src/merge.svg | 13 - .../fusion/external/ionicons-2.0.1/src/mic-a.svg | 15 - .../fusion/external/ionicons-2.0.1/src/mic-b.svg | 17 - .../fusion/external/ionicons-2.0.1/src/mic-c.svg | 8 - .../external/ionicons-2.0.1/src/minus-circled.svg | 9 - .../external/ionicons-2.0.1/src/minus-round.svg | 8 - .../fusion/external/ionicons-2.0.1/src/minus.svg | 7 - .../fusion/external/ionicons-2.0.1/src/model-s.svg | 33 - .../fusion/external/ionicons-2.0.1/src/monitor.svg | 12 - .../fusion/external/ionicons-2.0.1/src/more.svg | 12 - .../fusion/external/ionicons-2.0.1/src/mouse.svg | 24 - .../external/ionicons-2.0.1/src/music-note.svg | 10 - .../external/ionicons-2.0.1/src/navicon-round.svg | 14 - .../fusion/external/ionicons-2.0.1/src/navicon.svg | 11 - .../external/ionicons-2.0.1/src/navigate.svg | 7 - .../fusion/external/ionicons-2.0.1/src/network.svg | 12 - .../external/ionicons-2.0.1/src/no-smoking.svg | 33 - .../fusion/external/ionicons-2.0.1/src/nuclear.svg | 18 - .../fusion/external/ionicons-2.0.1/src/outlet.svg | 16 - .../external/ionicons-2.0.1/src/paintbrush.svg | 18 - .../external/ionicons-2.0.1/src/paintbucket.svg | 12 - .../external/ionicons-2.0.1/src/paper-airplane.svg | 13 - .../external/ionicons-2.0.1/src/paperclip.svg | 13 - .../fusion/external/ionicons-2.0.1/src/pause.svg | 12 - .../external/ionicons-2.0.1/src/person-add.svg | 13 - .../external/ionicons-2.0.1/src/person-stalker.svg | 18 - .../fusion/external/ionicons-2.0.1/src/person.svg | 10 - .../external/ionicons-2.0.1/src/pie-graph.svg | 11 - .../app/fusion/external/ionicons-2.0.1/src/pin.svg | 11 - .../external/ionicons-2.0.1/src/pinpoint.svg | 11 - .../fusion/external/ionicons-2.0.1/src/pizza.svg | 20 - .../fusion/external/ionicons-2.0.1/src/plane.svg | 10 - .../fusion/external/ionicons-2.0.1/src/planet.svg | 21 - .../fusion/external/ionicons-2.0.1/src/play.svg | 8 - .../external/ionicons-2.0.1/src/playstation.svg | 27 - .../external/ionicons-2.0.1/src/plus-circled.svg | 10 - .../external/ionicons-2.0.1/src/plus-round.svg | 9 - .../fusion/external/ionicons-2.0.1/src/plus.svg | 7 - .../fusion/external/ionicons-2.0.1/src/podium.svg | 11 - .../fusion/external/ionicons-2.0.1/src/pound.svg | 11 - .../fusion/external/ionicons-2.0.1/src/power.svg | 15 - .../external/ionicons-2.0.1/src/pricetag.svg | 13 - .../external/ionicons-2.0.1/src/pricetags.svg | 18 - .../fusion/external/ionicons-2.0.1/src/printer.svg | 14 - .../external/ionicons-2.0.1/src/pull-request.svg | 16 - .../external/ionicons-2.0.1/src/qr-scanner.svg | 12 - .../fusion/external/ionicons-2.0.1/src/quote.svg | 16 - .../external/ionicons-2.0.1/src/radio-waves.svg | 25 - .../fusion/external/ionicons-2.0.1/src/record.svg | 7 - .../fusion/external/ionicons-2.0.1/src/refresh.svg | 15 - .../external/ionicons-2.0.1/src/reply-all.svg | 12 - .../fusion/external/ionicons-2.0.1/src/reply.svg | 9 - .../external/ionicons-2.0.1/src/ribbon-a.svg | 14 - .../external/ionicons-2.0.1/src/ribbon-b.svg | 18 - .../external/ionicons-2.0.1/src/sad-outline.svg | 28 - .../app/fusion/external/ionicons-2.0.1/src/sad.svg | 20 - .../external/ionicons-2.0.1/src/scissors.svg | 23 - .../fusion/external/ionicons-2.0.1/src/search.svg | 10 - .../external/ionicons-2.0.1/src/settings.svg | 18 - .../fusion/external/ionicons-2.0.1/src/share.svg | 11 - .../fusion/external/ionicons-2.0.1/src/shuffle.svg | 11 - .../external/ionicons-2.0.1/src/skip-backward.svg | 15 - .../external/ionicons-2.0.1/src/skip-forward.svg | 15 - .../ionicons-2.0.1/src/social-android-outline.svg | 29 - .../external/ionicons-2.0.1/src/social-android.svg | 22 - .../ionicons-2.0.1/src/social-angular-outline.svg | 11 - .../external/ionicons-2.0.1/src/social-angular.svg | 11 - .../ionicons-2.0.1/src/social-apple-outline.svg | 20 - .../external/ionicons-2.0.1/src/social-apple.svg | 14 - .../ionicons-2.0.1/src/social-bitcoin-outline.svg | 27 - .../external/ionicons-2.0.1/src/social-bitcoin.svg | 14 - .../ionicons-2.0.1/src/social-buffer-outline.svg | 24 - .../external/ionicons-2.0.1/src/social-buffer.svg | 18 - .../ionicons-2.0.1/src/social-chrome-outline.svg | 17 - .../external/ionicons-2.0.1/src/social-chrome.svg | 22 - .../ionicons-2.0.1/src/social-codepen-outline.svg | 26 - .../external/ionicons-2.0.1/src/social-codepen.svg | 26 - .../ionicons-2.0.1/src/social-css3-outline.svg | 12 - .../external/ionicons-2.0.1/src/social-css3.svg | 14 - .../src/social-designernews-outline.svg | 18 - .../ionicons-2.0.1/src/social-designernews.svg | 18 - .../ionicons-2.0.1/src/social-dribbble-outline.svg | 15 - .../ionicons-2.0.1/src/social-dribbble.svg | 26 - .../ionicons-2.0.1/src/social-dropbox-outline.svg | 13 - .../external/ionicons-2.0.1/src/social-dropbox.svg | 13 - .../ionicons-2.0.1/src/social-euro-outline.svg | 19 - .../external/ionicons-2.0.1/src/social-euro.svg | 12 - .../ionicons-2.0.1/src/social-facebook-outline.svg | 9 - .../ionicons-2.0.1/src/social-facebook.svg | 8 - .../src/social-foursquare-outline.svg | 22 - .../ionicons-2.0.1/src/social-foursquare.svg | 20 - .../ionicons-2.0.1/src/social-freebsd-devil.svg | 22 - .../ionicons-2.0.1/src/social-github-outline.svg | 24 - .../external/ionicons-2.0.1/src/social-github.svg | 14 - .../ionicons-2.0.1/src/social-google-outline.svg | 19 - .../external/ionicons-2.0.1/src/social-google.svg | 20 - .../src/social-googleplus-outline.svg | 18 - .../ionicons-2.0.1/src/social-googleplus.svg | 17 - .../src/social-hackernews-outline.svg | 12 - .../ionicons-2.0.1/src/social-hackernews.svg | 9 - .../ionicons-2.0.1/src/social-html5-outline.svg | 13 - .../external/ionicons-2.0.1/src/social-html5.svg | 9 - .../src/social-instagram-outline.svg | 12 - .../ionicons-2.0.1/src/social-instagram.svg | 18 - .../src/social-javascript-outline.svg | 27 - .../ionicons-2.0.1/src/social-javascript.svg | 17 - .../ionicons-2.0.1/src/social-linkedin-outline.svg | 22 - .../ionicons-2.0.1/src/social-linkedin.svg | 13 - .../ionicons-2.0.1/src/social-markdown.svg | 14 - .../external/ionicons-2.0.1/src/social-nodejs.svg | 26 - .../external/ionicons-2.0.1/src/social-octocat.svg | 28 - .../src/social-pinterest-outline.svg | 14 - .../ionicons-2.0.1/src/social-pinterest.svg | 15 - .../external/ionicons-2.0.1/src/social-python.svg | 21 - .../ionicons-2.0.1/src/social-reddit-outline.svg | 26 - .../external/ionicons-2.0.1/src/social-reddit.svg | 18 - .../ionicons-2.0.1/src/social-rss-outline.svg | 16 - .../external/ionicons-2.0.1/src/social-rss.svg | 12 - .../external/ionicons-2.0.1/src/social-sass.svg | 35 - .../ionicons-2.0.1/src/social-skype-outline.svg | 26 - .../external/ionicons-2.0.1/src/social-skype.svg | 20 - .../ionicons-2.0.1/src/social-snapchat-outline.svg | 42 - .../ionicons-2.0.1/src/social-snapchat.svg | 31 - .../ionicons-2.0.1/src/social-tumblr-outline.svg | 13 - .../external/ionicons-2.0.1/src/social-tumblr.svg | 10 - .../external/ionicons-2.0.1/src/social-tux.svg | 53 - .../ionicons-2.0.1/src/social-twitch-outline.svg | 13 - .../external/ionicons-2.0.1/src/social-twitch.svg | 9 - .../ionicons-2.0.1/src/social-twitter-outline.svg | 19 - .../external/ionicons-2.0.1/src/social-twitter.svg | 12 - .../ionicons-2.0.1/src/social-usd-outline.svg | 44 - .../external/ionicons-2.0.1/src/social-usd.svg | 24 - .../ionicons-2.0.1/src/social-vimeo-outline.svg | 23 - .../external/ionicons-2.0.1/src/social-vimeo.svg | 18 - .../ionicons-2.0.1/src/social-whatsapp-outline.svg | 25 - .../ionicons-2.0.1/src/social-whatsapp.svg | 18 - .../ionicons-2.0.1/src/social-windows-outline.svg | 17 - .../external/ionicons-2.0.1/src/social-windows.svg | 17 - .../src/social-wordpress-outline.svg | 16 - .../ionicons-2.0.1/src/social-wordpress.svg | 20 - .../ionicons-2.0.1/src/social-yahoo-outline.svg | 10 - .../external/ionicons-2.0.1/src/social-yahoo.svg | 8 - .../ionicons-2.0.1/src/social-yen-outline.svg | 9 - .../external/ionicons-2.0.1/src/social-yen.svg | 8 - .../ionicons-2.0.1/src/social-youtube-outline.svg | 22 - .../external/ionicons-2.0.1/src/social-youtube.svg | 12 - .../ionicons-2.0.1/src/soup-can-outline.svg | 28 - .../external/ionicons-2.0.1/src/soup-can.svg | 16 - .../external/ionicons-2.0.1/src/speakerphone.svg | 19 - .../external/ionicons-2.0.1/src/speedometer.svg | 15 - .../fusion/external/ionicons-2.0.1/src/spoon.svg | 10 - .../fusion/external/ionicons-2.0.1/src/star.svg | 7 - .../external/ionicons-2.0.1/src/stats-bars.svg | 12 - .../fusion/external/ionicons-2.0.1/src/steam.svg | 20 - .../fusion/external/ionicons-2.0.1/src/stop.svg | 8 - .../external/ionicons-2.0.1/src/thermometer.svg | 11 - .../external/ionicons-2.0.1/src/thumbsdown.svg | 13 - .../external/ionicons-2.0.1/src/thumbsup.svg | 13 - .../external/ionicons-2.0.1/src/toggle-filled.svg | 11 - .../fusion/external/ionicons-2.0.1/src/toggle.svg | 12 - .../external/ionicons-2.0.1/src/transgender.svg | 12 - .../fusion/external/ionicons-2.0.1/src/trash-a.svg | 10 - .../fusion/external/ionicons-2.0.1/src/trash-b.svg | 13 - .../fusion/external/ionicons-2.0.1/src/trophy.svg | 16 - .../external/ionicons-2.0.1/src/tshirt-outline.svg | 11 - .../fusion/external/ionicons-2.0.1/src/tshirt.svg | 8 - .../external/ionicons-2.0.1/src/umbrella.svg | 18 - .../external/ionicons-2.0.1/src/university.svg | 11 - .../external/ionicons-2.0.1/src/unlocked.svg | 10 - .../fusion/external/ionicons-2.0.1/src/upload.svg | 9 - .../app/fusion/external/ionicons-2.0.1/src/usb.svg | 22 - .../external/ionicons-2.0.1/src/videocamera.svg | 11 - .../external/ionicons-2.0.1/src/volume-high.svg | 15 - .../external/ionicons-2.0.1/src/volume-low.svg | 11 - .../external/ionicons-2.0.1/src/volume-medium.svg | 13 - .../external/ionicons-2.0.1/src/volume-mute.svg | 14 - .../fusion/external/ionicons-2.0.1/src/wand.svg | 17 - .../external/ionicons-2.0.1/src/waterdrop.svg | 11 - .../fusion/external/ionicons-2.0.1/src/wifi.svg | 16 - .../external/ionicons-2.0.1/src/wineglass.svg | 21 - .../fusion/external/ionicons-2.0.1/src/woman.svg | 13 - .../fusion/external/ionicons-2.0.1/src/wrench.svg | 11 - .../fusion/external/ionicons-2.0.1/src/xbox.svg | 21 - .../fusion/external/samples/css/images/blank.gif | Bin 49 -> 0 bytes .../app/fusion/external/samples/css/scribble.css | 40 - .../app/fusion/external/samples/css/slider.css | 142 - .../fusion/external/samples/css/spacegallery.css | 18 - .../fusion/external/samples/html/area_chart.html | 49 - .../fusion/external/samples/html/bar_chart.html | 95 - .../external/samples/html/d3_gauges_demo.html | 39 - .../external/samples/html/data/speedometer2.csv | 16 - .../external/samples/html/data/speedometer3.csv | 2 - .../fusion/external/samples/html/data/worddata.csv | 22 - .../app/fusion/external/samples/html/donut_d3.html | 43 - .../external/samples/html/js/area_chart.min.js | 1 - .../fusion/external/samples/html/js/donut.min.js | 1 - .../fusion/external/samples/html/js/gauges.min.js | 1 - .../external/samples/html/js/line_chart.min.js | 1 - .../external/samples/html/js/pie_chart.min.js | 1 - .../external/samples/html/js/worddata.min.js | 1 - .../fusion/external/samples/html/line_chart.html | 49 - .../fusion/external/samples/html/pie_chart.html | 38 - .../fusion/external/samples/html/wordcloud.html | 37 - .../external/samples/images/Calendar-16x16.png | Bin 552 -> 0 bytes .../fusion/external/samples/images/arrow-next.png | Bin 1561 -> 0 bytes .../fusion/external/samples/images/arrow-prev.png | Bin 1557 -> 0 bytes .../images/carousel/slide_b_drive_test_map.png | Bin 202465 -> 0 bytes .../images/carousel/slide_b_eppt_county.png | Bin 21222 -> 0 bytes .../images/carousel/slide_b_eppt_regression.png | Bin 11536 -> 0 bytes .../images/carousel/slide_b_ios_throughput.png | Bin 26131 -> 0 bytes .../samples/images/carousel/slide_b_lata_map.png | Bin 192031 -> 0 bytes .../images/carousel/slide_b_lata_map_legend.png | Bin 3021 -> 0 bytes .../images/carousel/slide_b_nova_sdn_map.png | Bin 179361 -> 0 bytes .../fusion/external/samples/images/copyicon.png | Bin 235 -> 0 bytes .../fusion/external/samples/images/deleteicon.gif | Bin 579 -> 0 bytes .../external/samples/images/example-frame.png | Bin 33699 -> 0 bytes .../app/fusion/external/samples/images/loading.gif | Bin 6820 -> 0 bytes .../external/samples/images/tunnels/1_mon.png | Bin 22762 -> 0 bytes .../external/samples/images/tunnels/2_tue.png | Bin 22772 -> 0 bytes .../external/samples/images/tunnels/3_wed.png | Bin 24012 -> 0 bytes .../external/samples/images/tunnels/4_thu.png | Bin 23902 -> 0 bytes .../external/samples/images/tunnels/5_fri.png | Bin 22349 -> 0 bytes .../external/samples/images/tunnels/6_sat.png | Bin 23674 -> 0 bytes .../external/samples/images/tunnels/7_sun.png | Bin 22845 -> 0 bytes .../samples/images/tunnels/BH_DLSTX_IN.png | Bin 10575 -> 0 bytes .../samples/images/tunnels/BH_DLSTX_OUT.png | Bin 10460 -> 0 bytes .../external/samples/images/tunnels/BH_Nat.png | Bin 10420 -> 0 bytes .../external/samples/images/tunnels/BH_Nat_Def.png | Bin 8941 -> 0 bytes .../samples/images/tunnels/BH_Nat_Priority.png | Bin 10590 -> 0 bytes .../app/fusion/external/samples/js/FusionCharts.js | 361 - .../app/fusion/external/samples/js/charts.js | 132 - .../app/fusion/external/samples/js/scribble.js | 19 - .../external/samples/js/slides.min.jquery.js | 20 - .../app/fusion/external/samples/js/spacegallery.js | 235 - .../samples/org_chart/css/bootstrap.min.css | 351 - .../external/samples/org_chart/css/custom.css | 97 - .../samples/org_chart/css/jquery.jOrgChart.css | 51 - .../external/samples/org_chart/css/prettify.css | 1 - .../fusion/external/samples/org_chart/example.html | 85 - .../external/samples/org_chart/example_vsp.html | 88 - .../external/samples/org_chart/images/bkgd.png | Bin 133 -> 0 bytes .../samples/org_chart/images/raspberry.jpg | Bin 5755 -> 0 bytes .../external/samples/org_chart/jquery.jOrgChart.js | 267 - .../fusion/external/samples/org_chart/prettify.js | 28 - .../app/fusion/external/utils/js/browserCheck.js | 24 - .../src/main/webapp/app/fusion/images/Rlogo.jpg | Bin 3173 -> 0 bytes .../src/main/webapp/app/fusion/images/Thumbs.db | Bin 102912 -> 0 bytes .../main/webapp/app/fusion/images/action_icon.png | Bin 2388 -> 0 bytes .../app/fusion/images/action_list_spacer.gif | Bin 73 -> 0 bytes .../src/main/webapp/app/fusion/images/active.png | Bin 682 -> 0 bytes .../src/main/webapp/app/fusion/images/add.png | Bin 352 -> 0 bytes .../webapp/app/fusion/images/add_tool_button.png | Bin 31105 -> 0 bytes .../src/main/webapp/app/fusion/images/addicon.png | Bin 463 -> 0 bytes .../app/fusion/images/application_window_bg.jpg | Bin 914 -> 0 bytes .../main/webapp/app/fusion/images/arrow-next.png | Bin 1561 -> 0 bytes .../main/webapp/app/fusion/images/arrow-prev.png | Bin 1557 -> 0 bytes .../fusion/images/att_angular_gridster/grips.png | Bin 951 -> 0 bytes .../main/webapp/app/fusion/images/backButton.png | Bin 816 -> 0 bytes .../src/main/webapp/app/fusion/images/blank.gif | Bin 49 -> 0 bytes .../main/webapp/app/fusion/images/blueButton.png | Bin 1468 -> 0 bytes .../main/webapp/app/fusion/images/body_graphic.jpg | Bin 20667 -> 0 bytes .../src/main/webapp/app/fusion/images/bubble.png | Bin 662 -> 0 bytes .../src/main/webapp/app/fusion/images/cache.png | Bin 1081 -> 0 bytes .../src/main/webapp/app/fusion/images/calendar.gif | Bin 929 -> 0 bytes .../src/main/webapp/app/fusion/images/chevron.png | Bin 252 -> 0 bytes .../webapp/app/fusion/images/close_container.gif | Bin 85 -> 0 bytes .../webapp/app/fusion/images/collapsed-icon.png | Bin 1379 -> 0 bytes .../main/webapp/app/fusion/images/column-bg.png | Bin 165 -> 0 bytes .../app/fusion/images/copyicon-highlighted.png | Bin 264 -> 0 bytes .../src/main/webapp/app/fusion/images/copyicon.png | Bin 235 -> 0 bytes .../src/main/webapp/app/fusion/images/csv_icon.jpg | Bin 632 -> 0 bytes .../src/main/webapp/app/fusion/images/csv_icon.png | Bin 938 -> 0 bytes .../webapp/app/fusion/images/customers-add.png | Bin 755 -> 0 bytes .../webapp/app/fusion/images/customers-search.png | Bin 976 -> 0 bytes .../main/webapp/app/fusion/images/customers.png | Bin 749 -> 0 bytes .../main/webapp/app/fusion/images/decrypted.png | Bin 628 -> 0 bytes .../app/fusion/images/deleteicon-highlighted.gif | Bin 592 -> 0 bytes .../app/fusion/images/deleteicon-highlighted.png | Bin 566 -> 0 bytes .../main/webapp/app/fusion/images/deleteicon.gif | Bin 579 -> 0 bytes .../src/main/webapp/app/fusion/images/editicon.gif | Bin 360 -> 0 bytes .../main/webapp/app/fusion/images/error_type.gif | Bin 398 -> 0 bytes .../webapp/app/fusion/images/example-frame.png | Bin 33699 -> 0 bytes .../webapp/app/fusion/images/excelicon_multi.gif | Bin 1028 -> 0 bytes .../main/webapp/app/fusion/images/executeicon.png | Bin 1076 -> 0 bytes .../webapp/app/fusion/images/expanded-icon.png | Bin 1372 -> 0 bytes .../src/main/webapp/app/fusion/images/file-add.png | Bin 675 -> 0 bytes .../main/webapp/app/fusion/images/file_import.png | Bin 653 -> 0 bytes .../webapp/app/fusion/images/file_save-all.png | Bin 610 -> 0 bytes .../main/webapp/app/fusion/images/filter_icon.png | Bin 29069 -> 0 bytes .../main/webapp/app/fusion/images/folder_add.png | Bin 772 -> 0 bytes .../webapp/app/fusion/images/folder_closed.png | Bin 559 -> 0 bytes .../webapp/app/fusion/images/folder_delete.png | Bin 767 -> 0 bytes .../main/webapp/app/fusion/images/folder_edit.png | Bin 829 -> 0 bytes .../main/webapp/app/fusion/images/folder_open.png | Bin 632 -> 0 bytes .../main/webapp/app/fusion/images/folder_user.png | Bin 887 -> 0 bytes .../src/main/webapp/app/fusion/images/funnel.png | Bin 543 -> 0 bytes .../src/main/webapp/app/fusion/images/fusion.gif | Bin 8821 -> 0 bytes .../main/webapp/app/fusion/images/grayButton.png | Bin 1361 -> 0 bytes .../app/fusion/images/gray_add_tool_button.png | Bin 30883 -> 0 bytes .../webapp/app/fusion/images/headerChatIcon.png | Bin 465 -> 0 bytes .../webapp/app/fusion/images/icon_remove_all.gif | Bin 982 -> 0 bytes .../src/main/webapp/app/fusion/images/inactive.png | Bin 842 -> 0 bytes .../main/webapp/app/fusion/images/info_type.gif | Bin 291 -> 0 bytes .../app/fusion/images/layout/panel-e-w-toggle.png | Bin 459 -> 0 bytes .../app/fusion/images/layout/panel-n-s-toggle.png | Bin 335 -> 0 bytes .../main/webapp/app/fusion/images/leftButton.png | Bin 681 -> 0 bytes .../src/main/webapp/app/fusion/images/loading.gif | Bin 6820 -> 0 bytes .../main/webapp/app/fusion/images/loading_bar.gif | Bin 28954 -> 0 bytes .../main/webapp/app/fusion/images/login_button.gif | Bin 1222 -> 0 bytes .../src/main/webapp/app/fusion/images/m1.gif | Bin 636 -> 0 bytes .../src/main/webapp/app/fusion/images/mail.png | Bin 449 -> 0 bytes .../src/main/webapp/app/fusion/images/map.png | Bin 611 -> 0 bytes .../main/webapp/app/fusion/images/menu/bubble.png | Bin 662 -> 0 bytes .../webapp/app/fusion/images/menu/file_import.png | Bin 653 -> 0 bytes .../app/fusion/images/menu/file_save-all.png | Bin 610 -> 0 bytes .../main/webapp/app/fusion/images/menu/mail.png | Bin 449 -> 0 bytes .../main/webapp/app/fusion/images/menu/profile.png | Bin 462 -> 0 bytes .../webapp/app/fusion/images/menu/speechbubble.png | Bin 458 -> 0 bytes .../main/webapp/app/fusion/images/menu/users.png | Bin 938 -> 0 bytes .../src/main/webapp/app/fusion/images/minus.gif | Bin 75 -> 0 bytes .../fusion/images/mobile_logo_att_header_black.png | Bin 34762 -> 0 bytes .../fusion/images/mobile_logo_att_header_grey.png | Bin 34636 -> 0 bytes .../images/mobile_logo_att_header_horizontal.png | Bin 5202 -> 0 bytes .../fusion/images/mobile_logo_att_header_white.png | Bin 34475 -> 0 bytes .../main/webapp/app/fusion/images/modify_icon.gif | Bin 246 -> 0 bytes .../src/main/webapp/app/fusion/images/note-add.png | Bin 589 -> 0 bytes .../main/webapp/app/fusion/images/note-search.png | Bin 876 -> 0 bytes .../src/main/webapp/app/fusion/images/note.png | Bin 583 -> 0 bytes .../src/main/webapp/app/fusion/images/notes.png | Bin 673 -> 0 bytes .../src/main/webapp/app/fusion/images/offline.png | Bin 3483 -> 0 bytes .../main/webapp/app/fusion/images/offlineMsg.gif | Bin 1004 -> 0 bytes .../src/main/webapp/app/fusion/images/online.png | Bin 888 -> 0 bytes .../src/main/webapp/app/fusion/images/page.gif | Bin 131 -> 0 bytes .../main/webapp/app/fusion/images/pagination.png | Bin 724 -> 0 bytes .../webapp/app/fusion/images/panel-e-w-toggle.png | Bin 459 -> 0 bytes .../webapp/app/fusion/images/panel-n-s-toggle.png | Bin 335 -> 0 bytes .../src/main/webapp/app/fusion/images/pix.gif | Bin 49 -> 0 bytes .../src/main/webapp/app/fusion/images/plus.gif | Bin 78 -> 0 bytes .../src/main/webapp/app/fusion/images/printer.gif | Bin 1036 -> 0 bytes .../src/main/webapp/app/fusion/images/profile.png | Bin 462 -> 0 bytes .../main/webapp/app/fusion/images/report-add.png | Bin 724 -> 0 bytes .../webapp/app/fusion/images/report-favorite.png | Bin 693 -> 0 bytes .../main/webapp/app/fusion/images/report-my.png | Bin 739 -> 0 bytes .../webapp/app/fusion/images/report-public.png | Bin 776 -> 0 bytes .../src/main/webapp/app/fusion/images/report.png | Bin 563 -> 0 bytes .../src/main/webapp/app/fusion/images/reports.png | Bin 769 -> 0 bytes .../app/fusion/images/results-first-active.png | Bin 545 -> 0 bytes .../app/fusion/images/results-first-disabled.png | Bin 421 -> 0 bytes .../app/fusion/images/results-last-active.png | Bin 541 -> 0 bytes .../app/fusion/images/results-last-disabled.png | Bin 421 -> 0 bytes .../app/fusion/images/results-next-active.png | Bin 416 -> 0 bytes .../app/fusion/images/results-next-disabled.png | Bin 326 -> 0 bytes .../app/fusion/images/results-prev-active.png | Bin 421 -> 0 bytes .../app/fusion/images/results-prev-disabled.png | Bin 322 -> 0 bytes .../webapp/app/fusion/images/resultset_last.png | Bin 506 -> 0 bytes .../app/fusion/images/resultset_previous.png | Bin 381 -> 0 bytes .../webapp/app/fusion/images/return_to_top.gif | Bin 846 -> 0 bytes .../main/webapp/app/fusion/images/rightButton.png | Bin 731 -> 0 bytes .../src/main/webapp/app/fusion/images/search.png | Bin 3501 -> 0 bytes .../webapp/app/fusion/images/search_profile.png | Bin 880 -> 0 bytes .../src/main/webapp/app/fusion/images/sort_asc.gif | Bin 57 -> 0 bytes .../main/webapp/app/fusion/images/sort_desc.gif | Bin 58 -> 0 bytes .../src/main/webapp/app/fusion/images/spacer.gif | Bin 43 -> 0 bytes .../main/webapp/app/fusion/images/success_type.gif | Bin 260 -> 0 bytes .../src/main/webapp/app/fusion/images/swoosh.gif | Bin 14250 -> 0 bytes .../src/main/webapp/app/fusion/images/tab-hm.png | Bin 249 -> 0 bytes .../src/main/webapp/app/fusion/images/tab-v-hm.png | Bin 317 -> 0 bytes .../src/main/webapp/app/fusion/images/tab.png | Bin 343 -> 0 bytes .../main/webapp/app/fusion/images/table-add.png | Bin 3314 -> 0 bytes .../main/webapp/app/fusion/images/table-delete.png | Bin 3342 -> 0 bytes .../main/webapp/app/fusion/images/table-edit.png | Bin 3348 -> 0 bytes .../src/main/webapp/app/fusion/images/table.png | Bin 496 -> 0 bytes .../src/main/webapp/app/fusion/images/tabs-bg.png | Bin 147 -> 0 bytes .../main/webapp/app/fusion/images/toolButton.gif | Bin 414 -> 0 bytes .../main/webapp/app/fusion/images/toolButton.png | Bin 531 -> 0 bytes .../src/main/webapp/app/fusion/images/toolbar.png | Bin 171 -> 0 bytes .../src/main/webapp/app/fusion/images/users.png | Bin 938 -> 0 bytes .../main/webapp/app/fusion/images/warning_type.gif | Bin 1055 -> 0 bytes .../src/main/webapp/app/fusion/images/webphone.ico | Bin 241 -> 0 bytes .../main/webapp/app/fusion/images/whiteButton.png | Bin 1430 -> 0 bytes .../scripts/controllers/nbook-framecontroller.js | 34 - .../scripts/controllers/nbookController.js | 179 - .../scripts/controllers/notebookFrameController.js | 65 - .../scripts/dependency/angular.js | 29400 -------- .../scripts/view-models/notebook-frame.html | 85 - .../scripts/view-models/notebook-viz.html | 26 - .../scripts/view-models/notebook.htm | 54 - .../scripts/view-models/notebookInputs.html | 90 - .../att_angular_gridster/angular-gridster.js | 2244 - .../att_angular_gridster/ui-gridster-tpls.js | 168 - .../fusion/scripts/controllers/adminController.js | 65 - .../fusion/scripts/controllers/admin_menu_edit.js | 230 - .../fusion/scripts/controllers/ase-controller.js | 22 - .../scripts/controllers/broadcast-controller.js | 79 - .../controllers/broadcast-list-controller.js | 120 - .../controllers/collaborate-list-controller.js | 63 - .../app/fusion/scripts/controllers/dummy.txt | 0 .../controllers/fn_menu_add_popup_controller.js | 281 - .../scripts/controllers/jcs-admin-controller.js | 83 - .../scripts/controllers/modelpopupController.js | 40 - .../scripts/controllers/post-search-controller.js | 202 - .../scripts/controllers/profile-controller.js | 286 - .../controllers/profile-search-controller.js | 80 - .../scripts/controllers/profileController.js | 38 - .../fusion/scripts/controllers/role-controller.js | 226 - .../controllers/role-function-list-controller.js | 157 - .../scripts/controllers/role-list-controller.js | 102 - .../controllers/rolefunctionpopupController.js | 84 - .../controllers/rolepopupmodelController.js | 205 - .../scripts/controllers/self-profile-controller.js | 284 - .../scripts/controllers/usage-list-controller.js | 41 - .../scripts/controllers/workflows/workflowApp.js | 24 - .../controllers/workflows/workflowController.js | 509 - .../controllers/workflows/workflowRouting.js | 26 - .../webapp/app/fusion/scripts/directives/dummy.txt | 0 .../webapp/app/fusion/scripts/directives/footer.js | 30 - .../webapp/app/fusion/scripts/directives/header.js | 504 - .../app/fusion/scripts/directives/leftMenu.js | 203 - .../webapp/app/fusion/scripts/jquery.resize.js | 139 - .../main/webapp/app/fusion/scripts/layout/debug.js | 329 - .../app/fusion/scripts/layout/jquery-latest.js | 9555 --- .../app/fusion/scripts/layout/jquery-ui-latest.js | 14879 ---- .../fusion/scripts/layout/jquery.layout-latest.js | 6086 -- .../main/webapp/app/fusion/scripts/modalService.js | 185 - .../main/webapp/app/fusion/scripts/moment.min.js | 6 - .../app/fusion/scripts/services/adminService.js | 160 - .../app/fusion/scripts/services/headerService.js | 89 - .../app/fusion/scripts/services/leftMenuService.js | 54 - .../app/fusion/scripts/services/profileService.js | 98 - .../app/fusion/scripts/services/userInfoService.js | 51 - .../app/fusion/scripts/socket/peerBroadcast.js | 122 - .../main/webapp/app/fusion/scripts/utils/dummy.txt | 0 .../app/fusion/scripts/utils/page-resource.js | 95 - .../fusion/scripts/utils/sandbox-resources.html | 9 - .../scripts/view-models/admin-page/admin.html | 115 - .../scripts/view-models/admin-page/profile.html | 47 - .../app/fusion/scripts/view-models/dummy.txt | 0 .../app/fusion/scripts/view-models/footer.html | 42 - .../app/fusion/scripts/view-models/header.html | 186 - .../app/fusion/scripts/view-models/left_menu.html | 41 - .../view-models/profile-page/admin_menu_edit.html | 175 - .../view-models/profile-page/broadcast.html | 61 - .../view-models/profile-page/broadcast_list.html | 71 - .../view-models/profile-page/collaborate_list.html | 57 - .../view-models/profile-page/jcs_admin.html | 87 - .../view-models/profile-page/popup_modal.html | 282 - .../profile-page/popup_modal_fn_menu_add.html | 155 - .../profile-page/popup_modal_fn_menu_edit.html | 148 - .../view-models/profile-page/popup_modal_role.html | 82 - .../profile-page/popup_modal_rolefunction.html | 46 - .../view-models/profile-page/post_search.html | 139 - .../view-models/profile-page/profile_detail.html | 188 - .../view-models/profile-page/profile_search.html | 72 - .../scripts/view-models/profile-page/role.html | 118 - .../profile-page/role_function_list.html | 88 - .../view-models/profile-page/role_list.html | 61 - .../view-models/profile-page/self_profile.html | 183 - .../view-models/profile-page/usage_list.html | 64 - .../view-models/workflows/workflow-landing.html | 130 - .../view-models/workflows/workflow-listing.html | 85 - .../view-models/workflows/workflow-new.html | 108 - .../view-models/workflows/workflow-preview.html | 36 - .../view-models/workflows/workflow-remove.html | 38 - .../view-models/workflows/workflow-schedule.html | 116 - .../fusion/scripts/webrtc/RTCMultiConnection.js | 6788 -- .../app/fusion/scripts/webrtc/getSourceId.html | 78 - .../att_angular_gridster/sandbox-gridster.css | 173 - .../styles/att_angular_gridster/ui-gridster.css | 116 - .../main/webapp/app/fusion/styles/fusion-sunny.css | 362 - .../main/webapp/app/fusion/styles/jquery-ui.css | 1225 - .../fusion/styles/layout/layout-default-latest.css | 224 - .../app/fusion/styles/workflows/workflows.css | 50 - .../drools/controller/drools-list-controller.js | 62 - .../drools/controller/drools-view-controller.js | 64 - .../drools/controller/droolsController.js | 30 - .../app/fusionapp/drools/controller/dummy.txt | 0 .../app/fusionapp/drools/directives/dummy.txt | 0 .../app/fusionapp/drools/services/droolsService.js | 76 - .../webapp/app/fusionapp/drools/utils/dummy.txt | 0 .../fusionapp/drools/view-models/droolsList.html | 47 - .../drools/view-models/droolsSinglePage.html | 92 - .../fusionapp/drools/view-models/droolsView.html | 61 - .../app/fusionapp/drools/view-models/dummy.txt | 0 .../main/webapp/app/fusionapp/external/dummy.txt | 0 .../src/main/webapp/app/fusionapp/fonts/dummy.txt | 0 .../main/webapp/app/fusionapp/icons/7450-icon.png | Bin 465 -> 0 bytes .../main/webapp/app/fusionapp/icons/7450-text.png | Bin 295 -> 0 bytes .../main/webapp/app/fusionapp/icons/7750-icon.png | Bin 565 -> 0 bytes .../main/webapp/app/fusionapp/icons/7750-text.png | Bin 632 -> 0 bytes .../webapp/app/fusionapp/icons/apn-dns-icon.png | Bin 1065 -> 0 bytes .../webapp/app/fusionapp/icons/apn-dns-text.png | Bin 901 -> 0 bytes .../main/webapp/app/fusionapp/icons/atcf-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/atcf-text.png | Bin 650 -> 0 bytes .../main/webapp/app/fusionapp/icons/atgw-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/atgw-text.png | Bin 780 -> 0 bytes .../main/webapp/app/fusionapp/icons/bgcf-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/bgcf-text.png | Bin 645 -> 0 bytes .../main/webapp/app/fusionapp/icons/com-icon.png | Bin 437 -> 0 bytes .../main/webapp/app/fusionapp/icons/cpm-icon.png | Bin 201 -> 0 bytes .../main/webapp/app/fusionapp/icons/cpm-text.png | Bin 572 -> 0 bytes .../webapp/app/fusionapp/icons/default-icon.png | Bin 329 -> 0 bytes .../webapp/app/fusionapp/icons/dra-epc-icon.png | Bin 700 -> 0 bytes .../webapp/app/fusionapp/icons/dra-epc-text.png | Bin 820 -> 0 bytes .../webapp/app/fusionapp/icons/dra-ims-icon.png | Bin 700 -> 0 bytes .../webapp/app/fusionapp/icons/dra-ims-text.png | Bin 851 -> 0 bytes .../main/webapp/app/fusionapp/icons/dslam-icon.png | Bin 774 -> 0 bytes .../main/webapp/app/fusionapp/icons/dslam-text.png | Bin 739 -> 0 bytes .../main/webapp/app/fusionapp/icons/eatf-icon.png | Bin 437 -> 0 bytes .../main/webapp/app/fusionapp/icons/eatf-text.png | Bin 439 -> 0 bytes .../main/webapp/app/fusionapp/icons/ecscf-icon.png | Bin 855 -> 0 bytes .../main/webapp/app/fusionapp/icons/ecscf-text.png | Bin 604 -> 0 bytes .../main/webapp/app/fusionapp/icons/emsc-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/enb-icon.png | Bin 1127 -> 0 bytes .../main/webapp/app/fusionapp/icons/enb-text.png | Bin 627 -> 0 bytes .../main/webapp/app/fusionapp/icons/enum-icon.png | Bin 646 -> 0 bytes .../main/webapp/app/fusionapp/icons/enum-text.png | Bin 551 -> 0 bytes .../main/webapp/app/fusionapp/icons/esmlc-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/esmlc-text.png | Bin 701 -> 0 bytes .../main/webapp/app/fusionapp/icons/ettcs-icon.png | Bin 95 -> 0 bytes .../main/webapp/app/fusionapp/icons/ettcs-text.png | Bin 95 -> 0 bytes .../main/webapp/app/fusionapp/icons/gmlc-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/gmlc-text.png | Bin 755 -> 0 bytes .../main/webapp/app/fusionapp/icons/hlr-icon.png | Bin 646 -> 0 bytes .../main/webapp/app/fusionapp/icons/hlr-text.png | Bin 376 -> 0 bytes .../webapp/app/fusionapp/icons/hss-epc-icon.png | Bin 646 -> 0 bytes .../webapp/app/fusionapp/icons/hss-epc-text.png | Bin 726 -> 0 bytes .../webapp/app/fusionapp/icons/hss-ims-icon.png | Bin 646 -> 0 bytes .../webapp/app/fusionapp/icons/hss-ims-text.png | Bin 757 -> 0 bytes .../main/webapp/app/fusionapp/icons/icscf-icon.png | Bin 855 -> 0 bytes .../main/webapp/app/fusionapp/icons/icscf-text.png | Bin 657 -> 0 bytes .../main/webapp/app/fusionapp/icons/ipag-icon.png | Bin 95 -> 0 bytes .../main/webapp/app/fusionapp/icons/ipag-text.png | Bin 95 -> 0 bytes .../main/webapp/app/fusionapp/icons/isbc-icon.png | Bin 855 -> 0 bytes .../main/webapp/app/fusionapp/icons/isbc-text.png | Bin 649 -> 0 bytes .../main/webapp/app/fusionapp/icons/iwf-icon.png | Bin 696 -> 0 bytes .../main/webapp/app/fusionapp/icons/iwf-text.png | Bin 595 -> 0 bytes .../webapp/app/fusionapp/icons/lrf-rdf-icon.png | Bin 953 -> 0 bytes .../webapp/app/fusionapp/icons/lrf-rdf-text.png | Bin 638 -> 0 bytes .../webapp/app/fusionapp/icons/lrg-rdf-text.png | Bin 769 -> 0 bytes .../main/webapp/app/fusionapp/icons/mgc8-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/mgc8-text.png | Bin 771 -> 0 bytes .../webapp/app/fusionapp/icons/mgcf-emsc-icon.png | Bin 388 -> 0 bytes .../webapp/app/fusionapp/icons/mgcf-emsc-text.png | Bin 1140 -> 0 bytes .../main/webapp/app/fusionapp/icons/mgw-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/mgw-text.png | Bin 823 -> 0 bytes .../main/webapp/app/fusionapp/icons/mind-icon.png | Bin 646 -> 0 bytes .../main/webapp/app/fusionapp/icons/mind-text.png | Bin 550 -> 0 bytes .../main/webapp/app/fusionapp/icons/mme-icon.png | Bin 232 -> 0 bytes .../main/webapp/app/fusionapp/icons/mme-text.png | Bin 252 -> 0 bytes .../main/webapp/app/fusionapp/icons/mrf-icon.png | Bin 437 -> 0 bytes .../main/webapp/app/fusionapp/icons/mrf-text.png | Bin 504 -> 0 bytes .../main/webapp/app/fusionapp/icons/msc-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/msn-icon.png | Bin 465 -> 0 bytes .../main/webapp/app/fusionapp/icons/msn-text.png | Bin 318 -> 0 bytes .../main/webapp/app/fusionapp/icons/multi-icon.png | Bin 329 -> 0 bytes .../main/webapp/app/fusionapp/icons/n7450-icon.png | Bin 464 -> 0 bytes .../main/webapp/app/fusionapp/icons/n7450-text.png | Bin 295 -> 0 bytes .../webapp/app/fusionapp/icons/n7750a-icon.png | Bin 393 -> 0 bytes .../webapp/app/fusionapp/icons/n7750a-text.png | Bin 258 -> 0 bytes .../webapp/app/fusionapp/icons/n7750b-icon.png | Bin 393 -> 0 bytes .../webapp/app/fusionapp/icons/n7750b-text.png | Bin 258 -> 0 bytes .../webapp/app/fusionapp/icons/n7750c-icon.png | Bin 391 -> 0 bytes .../webapp/app/fusionapp/icons/n7750c-text.png | Bin 258 -> 0 bytes .../webapp/app/fusionapp/icons/n7750d-icon.png | Bin 391 -> 0 bytes .../webapp/app/fusionapp/icons/n7750d-text.png | Bin 258 -> 0 bytes .../main/webapp/app/fusionapp/icons/nb-icon.png | Bin 1127 -> 0 bytes .../main/webapp/app/fusionapp/icons/nb-text.png | Bin 499 -> 0 bytes .../main/webapp/app/fusionapp/icons/pas-icon.png | Bin 700 -> 0 bytes .../main/webapp/app/fusionapp/icons/pas-text.png | Bin 596 -> 0 bytes .../main/webapp/app/fusionapp/icons/pcef-icon.png | Bin 785 -> 0 bytes .../main/webapp/app/fusionapp/icons/pcef-text.png | Bin 539 -> 0 bytes .../main/webapp/app/fusionapp/icons/pcrf-icon.png | Bin 785 -> 0 bytes .../main/webapp/app/fusionapp/icons/pcrf-text.png | Bin 594 -> 0 bytes .../main/webapp/app/fusionapp/icons/pcscf-icon.png | Bin 855 -> 0 bytes .../main/webapp/app/fusionapp/icons/pcscf-text.png | Bin 744 -> 0 bytes .../main/webapp/app/fusionapp/icons/pgw-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/pgw-text.png | Bin 807 -> 0 bytes .../main/webapp/app/fusionapp/icons/plrf-icon.png | Bin 953 -> 0 bytes .../main/webapp/app/fusionapp/icons/plrf-text.png | Bin 735 -> 0 bytes .../main/webapp/app/fusionapp/icons/psap-icon.png | Bin 322 -> 0 bytes .../webapp/app/fusionapp/icons/pstn-tdm-icon.png | Bin 95 -> 0 bytes .../webapp/app/fusionapp/icons/pstn-tdm-text.png | Bin 95 -> 0 bytes .../main/webapp/app/fusionapp/icons/rg-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/rg-text.png | Bin 540 -> 0 bytes .../main/webapp/app/fusionapp/icons/rnc-icon.png | Bin 591 -> 0 bytes .../main/webapp/app/fusionapp/icons/rnc-text.png | Bin 646 -> 0 bytes .../main/webapp/app/fusionapp/icons/sbc-icon.png | Bin 855 -> 0 bytes .../main/webapp/app/fusionapp/icons/sbc-text.png | Bin 632 -> 0 bytes .../main/webapp/app/fusionapp/icons/sccas-icon.png | Bin 437 -> 0 bytes .../main/webapp/app/fusionapp/icons/sccas-text.png | Bin 861 -> 0 bytes .../main/webapp/app/fusionapp/icons/scscf-icon.png | Bin 855 -> 0 bytes .../main/webapp/app/fusionapp/icons/scscf-text.png | Bin 704 -> 0 bytes .../main/webapp/app/fusionapp/icons/sdg-icon.png | Bin 491 -> 0 bytes .../main/webapp/app/fusionapp/icons/sdg-text.png | Bin 696 -> 0 bytes .../webapp/app/fusionapp/icons/sgsns4-icon.png | Bin 230 -> 0 bytes .../webapp/app/fusionapp/icons/sgsns4-text.png | Bin 469 -> 0 bytes .../main/webapp/app/fusionapp/icons/sgw-icon.png | Bin 388 -> 0 bytes .../main/webapp/app/fusionapp/icons/sgw-text.png | Bin 884 -> 0 bytes .../main/webapp/app/fusionapp/icons/siad-icon.png | Bin 774 -> 0 bytes .../main/webapp/app/fusionapp/icons/siad-text.png | Bin 753 -> 0 bytes .../webapp/app/fusionapp/icons/ss7-gport-icon.png | Bin 286 -> 0 bytes .../webapp/app/fusionapp/icons/ss7-gport-text.png | Bin 418 -> 0 bytes .../webapp/app/fusionapp/icons/ss7gport-icon.png | Bin 646 -> 0 bytes .../webapp/app/fusionapp/icons/ss7gport-text.png | Bin 1011 -> 0 bytes .../webapp/app/fusionapp/icons/switch-icon.png | Bin 877 -> 0 bytes .../main/webapp/app/fusionapp/icons/tas-icon.png | Bin 437 -> 0 bytes .../main/webapp/app/fusionapp/icons/tas-text.png | Bin 858 -> 0 bytes .../webapp/app/fusionapp/icons/transcoder-icon.png | Bin 774 -> 0 bytes .../webapp/app/fusionapp/icons/transcoder-text.png | Bin 1242 -> 0 bytes .../main/webapp/app/fusionapp/icons/ue-icon.png | Bin 577 -> 0 bytes .../webapp/app/fusionapp/icons/uephone-icon.png | Bin 1190 -> 0 bytes .../webapp/app/fusionapp/icons/usp-dns-icon.png | Bin 1065 -> 0 bytes .../webapp/app/fusionapp/icons/usp-dns-text.png | Bin 826 -> 0 bytes .../src/main/webapp/app/fusionapp/images/dummy.txt | 0 .../app/fusionapp/scripts/controller/dummy.txt | 0 .../scripts/controller/sample-page-controller.js | 80 - .../controller/sample-page-iframe-controller.js | 23 - .../scripts/controller/sampleController.js | 30 - .../app/fusionapp/scripts/directives/dummy.txt | 0 .../webapp/app/fusionapp/scripts/utils/dummy.txt | 0 .../app/fusionapp/scripts/view-models/dummy.txt | 0 .../app/fusionapp/scripts/view-models/sample.html | 60 - .../scripts/view-models/sampleWithIframe.html | 22 - .../scripts/view-models/singlePageSample.html | 87 - .../src/main/webapp/app/fusionapp/styles/dummy.txt | 0 .../app/policyApp/CSS/Notification/angular-csp.css | 22 - .../Notification/angular-ui-notification.min.css | 1 - .../Notification/angular-ui-notification.min.js | 1 - .../webapp/app/policyApp/CSS/bootstrap.min.css | 5 - .../main/webapp/app/policyApp/CSS/bootstrap.min.js | 7 - .../src/main/webapp/app/policyApp/CSS/select.css | 287 - .../src/main/webapp/app/policyApp/CSS/select.js | 1748 - .../src/main/webapp/app/policyApp/CSS/w3.css | 360 - .../app/policyApp/JSONDataFiles/JSONConfig.json | 132 - .../webapp/app/policyApp/Properties/config.json | 3 - .../Windows/Dictionary/ActionPolicyDictionary.html | 89 - .../Windows/Dictionary/AttributeDictionary.html | 80 - .../Windows/Dictionary/BRMSParamDictionary.html | 47 - .../Windows/Dictionary/CLPepOptionsDictionary.html | 65 - .../Dictionary/CLServiceTypeDictionary.html | 43 - .../Windows/Dictionary/CLSiteDictionary.html | 43 - .../Windows/Dictionary/CLVarbindDictionary.html | 48 - .../Windows/Dictionary/CLVnfTypeDictionary.html | 43 - .../Windows/Dictionary/CLVsclActionDictionary.html | 43 - .../Dictionary/DecisionSettingsDictionary.html | 60 - .../Dictionary/DescriptiveScopeDictionary.html | 65 - .../Windows/Dictionary/EcompNameDictionary.html | 43 - .../Windows/Dictionary/EnforcerTypeDictionary.html | 51 - .../Windows/Dictionary/FWActionListDictionary.html | 43 - .../Dictionary/FWAddressGroupDictionary.html | 62 - .../Windows/Dictionary/FWParentListDictionary.html | 81 - .../Windows/Dictionary/FWPortListDictionary.html | 43 - .../Windows/Dictionary/FWPrefixListDictionary.html | 49 - .../Dictionary/FWProtocolListDictionary.html | 43 - .../Dictionary/FWSecurityZoneDictionary.html | 43 - .../Dictionary/FWServiceGroupDictionary.html | 57 - .../Dictionary/FWServiceListDictionary.html | 87 - .../Windows/Dictionary/FWTermListDictionary.html | 176 - .../Windows/Dictionary/FWZoneDictionary.html | 43 - .../Windows/Dictionary/MSConfigNameDictionary.html | 43 - .../Windows/Dictionary/MSDCAEUUIDDictionary.html | 43 - .../Windows/Dictionary/MSLocationDictionary.html | 43 - .../Windows/Dictionary/MSModelsDictionary.html | 41 - .../Windows/Dictionary/PSClosedLoopDictionary.html | 43 - .../Dictionary/PSGroupPolicyScopeDictionary.html | 65 - .../Windows/Dictionary/PSResourceDictionary.html | 43 - .../Windows/Dictionary/PSServiceDictionary.html | 43 - .../Windows/Dictionary/PSTypeDictionary.html | 43 - .../Windows/Dictionary/RiskTypeDictionary.html | 43 - .../Dictionary/SafePolicyWarningDictionary.html | 49 - .../app/policyApp/Windows/Edit_Roles_Window.html | 48 - .../Windows/PDPTabWindows/AddorEditPDPtoGroup.html | 56 - .../Windows/PDPTabWindows/PdpStatusWindow.html | 73 - .../PushtabWindow/removeGroupPoliciesWindow.html | 35 - .../app/policyApp/Windows/new_PDPGroup_Window.html | 94 - .../app/policyApp/controller/AutoPushController.js | 201 - .../RemovePDPGroupPoliciesController.js | 85 - .../policyApp/controller/DictionaryController.js | 82 - .../webapp/app/policyApp/controller/FileSaver.js | 170 - .../controller/ImportDictionaryController.js | 53 - .../PDPTabController/AddorEditPdpInGroup.js | 62 - .../PDPTabController/PDPGroupStatusController.js | 44 - .../controller/PolicyAddScopeRoleController.js | 65 - .../policyApp/controller/PolicyRolesController.js | 95 - .../policyApp/controller/dashboardController.js | 125 - .../controller/dashboard_Logging_Controller.js | 81 - .../BRMSParamDictController.js | 88 - .../CLPepOptionsDictController.js | 120 - .../CLServiceDictController.js | 75 - .../dictionaryController/CLSiteDictController.js | 75 - .../CLVarbindDictController.js | 75 - .../CLVnfTypeDictController.js | 75 - .../CLVsclActionDictController.js | 75 - .../DecisionSettingsDictController.js | 75 - .../DescriptiveSearchDictController.js | 121 - .../dictionaryController/EnforcerDictController.js | 70 - .../FWActionListDictController.js | 75 - .../FWAddressGroupDictController.js | 120 - .../FWParentListDictController.js | 156 - .../FWPortListDictController.js | 75 - .../FWPrefixListDictController.js | 103 - .../FWProtocolListDictController.js | 75 - .../FWSecurityZoneDictController.js | 75 - .../FWServiceGroupDictController.js | 121 - .../FWServiceListDictController.js | 147 - .../FWTermListDictController.js | 331 - .../dictionaryController/FWZoneDictController.js | 75 - .../MSConfigNameDictController.js | 76 - .../MSDcaeUUIDDictController.js | 76 - .../MSLocationDictController.js | 76 - .../dictionaryController/MSModelsDictController.js | 87 - .../PSClosedLoopDictController.js | 75 - .../PSGroupPolicyScopeDictController.js | 137 - .../PSResourceDictController.js | 75 - .../PSServiceDictController.js | 75 - .../dictionaryController/PSTypeDictController.js | 76 - .../dictionaryController/RiskTypeDictController.js | 75 - .../SafePolicyWarningDictController.js | 107 - .../actionPolicyDictController.js | 119 - .../attributeDictController.js | 109 - .../ecompNameEditorController.js | 74 - .../BRMSParamDictGridController.js | 127 - .../CLPepOptionsDictGridController.js | 183 - .../CLServiceDictGridController.js | 161 - .../CLSiteDictGridController.js | 161 - .../CLVarbindDictGridController.js | 184 - .../CLVnfTypeDictGridController.js | 181 - .../CLVsclActionDictGridController.js | 183 - .../DecisionSettingsDictGridController.js | 151 - .../DescriptiveScopeDictGridController.js | 150 - .../EnforcerTypeDictGridController.js | 126 - .../FWActionListDictGridController.js | 145 - .../FWAddressGroupDictGridController.js | 146 - .../FWParentListDictGridController.js | 149 - .../FWPortListDictGridController.js | 132 - .../FWPrefixListDictGridController.js | 148 - .../FWProtocolListDictGridController.js | 157 - .../FWSecurityZoneDictGridController.js | 147 - .../FWServiceGroupDictGridController.js | 147 - .../FWServiceListDictGridController.js | 162 - .../FWTermListDictGridController.js | 159 - .../FWZoneDictGridController.js | 148 - .../MSConfigNameDictGridController.js | 124 - .../MSDcaeUUIDDictGridController.js | 124 - .../MSLocationDictGridController.js | 124 - .../MSModelDictGridController.js | 124 - .../PSClosedLoopDictGridController.js | 123 - .../PSGroupPolicyScopeDictGridController.js | 127 - .../PSResourceDictGridController.js | 123 - .../PSServiceDictGridController.js | 122 - .../PSTypeDictGridController.js | 122 - .../RiskTypeDictGridController.js | 152 - .../SafePolicyWarningDictGridController.js | 127 - .../actionPolicyDictGridController.js | 161 - .../attributeDictGridController.js | 159 - .../ecompNameDictGridController.js | 152 - .../policyApp/controller/editorTabController.js | 211 - .../app/policyApp/controller/pdpController.js | 178 - .../controller/pdpGroupPopUpController.js | 179 - .../controller/policyAdminTabController.js | 70 - .../app/policyApp/controller/policyController.js | 65 - .../main/webapp/app/policyApp/images/loading.gif | Bin 6820 -> 0 bytes .../webapp/app/policyApp/images/loading_bar.gif | Bin 28954 -> 0 bytes .../src/main/webapp/app/policyApp/libs/README.md | 48 - .../bower_components/angular-cookies/.bower.json | 19 - .../bower_components/angular-cookies/README.md | 68 - .../angular-cookies/angular-cookies.js | 207 - .../angular-cookies/angular-cookies.min.js | 8 - .../angular-cookies/angular-cookies.min.js.map | 8 - .../bower_components/angular-cookies/bower.json | 9 - .../libs/bower_components/angular-cookies/index.js | 2 - .../bower_components/angular-cookies/package.json | 26 - .../angular-translate/angular-translate.min.js | 6 - .../libs/bower_components/angular/.bower.json | 17 - .../libs/bower_components/angular/README.md | 64 - .../libs/bower_components/angular/angular-csp.css | 13 - .../libs/bower_components/angular/angular.js | 26451 ------- .../libs/bower_components/angular/angular.min.js | 253 - .../bower_components/angular/angular.min.js.gzip | Bin 46451 -> 0 bytes .../bower_components/angular/angular.min.js.map | 8 - .../libs/bower_components/angular/bower.json | 8 - .../libs/bower_components/angular/index.js | 2 - .../libs/bower_components/angular/package.json | 25 - .../bootstrap/dist/css/bootstrap.min.css | 6 - .../bootstrap/dist/js/bootstrap.min.js | 7 - .../fonts/glyphicons-halflings-regular.eot | Bin 20127 -> 0 bytes .../fonts/glyphicons-halflings-regular.svg | 288 - .../fonts/glyphicons-halflings-regular.ttf | Bin 45404 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 23424 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff2 | Bin 18028 -> 0 bytes .../bootswatch/paper/bootstrap.min.css | 11 - .../libs/bower_components/jquery/.bower.json | 38 - .../libs/bower_components/jquery/MIT-LICENSE.txt | 21 - .../libs/bower_components/jquery/bower.json | 28 - .../libs/bower_components/jquery/dist/jquery.js | 9210 --- .../bower_components/jquery/dist/jquery.min.js | 5 - .../bower_components/jquery/dist/jquery.min.map | 1 - .../libs/bower_components/jquery/src/ajax.js | 786 - .../libs/bower_components/jquery/src/ajax/jsonp.js | 89 - .../libs/bower_components/jquery/src/ajax/load.js | 75 - .../bower_components/jquery/src/ajax/parseJSON.js | 13 - .../bower_components/jquery/src/ajax/parseXML.js | 28 - .../bower_components/jquery/src/ajax/script.js | 64 - .../bower_components/jquery/src/ajax/var/nonce.js | 5 - .../bower_components/jquery/src/ajax/var/rquery.js | 3 - .../libs/bower_components/jquery/src/ajax/xhr.js | 136 - .../libs/bower_components/jquery/src/attributes.js | 11 - .../bower_components/jquery/src/attributes/attr.js | 141 - .../jquery/src/attributes/classes.js | 158 - .../bower_components/jquery/src/attributes/prop.js | 94 - .../jquery/src/attributes/support.js | 35 - .../bower_components/jquery/src/attributes/val.js | 161 - .../libs/bower_components/jquery/src/callbacks.js | 205 - .../libs/bower_components/jquery/src/core.js | 502 - .../bower_components/jquery/src/core/access.js | 60 - .../libs/bower_components/jquery/src/core/init.js | 123 - .../bower_components/jquery/src/core/parseHTML.js | 39 - .../libs/bower_components/jquery/src/core/ready.js | 97 - .../jquery/src/core/var/rsingleTag.js | 4 - .../libs/bower_components/jquery/src/css.js | 450 - .../jquery/src/css/addGetHookIf.js | 22 - .../libs/bower_components/jquery/src/css/curCSS.js | 57 - .../jquery/src/css/defaultDisplay.js | 70 - .../jquery/src/css/hiddenVisibleSelectors.js | 15 - .../bower_components/jquery/src/css/support.js | 96 - .../libs/bower_components/jquery/src/css/swap.js | 28 - .../jquery/src/css/var/cssExpand.js | 3 - .../jquery/src/css/var/getStyles.js | 12 - .../jquery/src/css/var/isHidden.js | 13 - .../bower_components/jquery/src/css/var/rmargin.js | 3 - .../jquery/src/css/var/rnumnonpx.js | 5 - .../libs/bower_components/jquery/src/data.js | 178 - .../libs/bower_components/jquery/src/data/Data.js | 181 - .../bower_components/jquery/src/data/accepts.js | 20 - .../jquery/src/data/var/data_priv.js | 5 - .../jquery/src/data/var/data_user.js | 5 - .../libs/bower_components/jquery/src/deferred.js | 149 - .../libs/bower_components/jquery/src/deprecated.js | 13 - .../libs/bower_components/jquery/src/dimensions.js | 50 - .../libs/bower_components/jquery/src/effects.js | 648 - .../bower_components/jquery/src/effects/Tween.js | 114 - .../jquery/src/effects/animatedSelector.js | 13 - .../libs/bower_components/jquery/src/event.js | 868 - .../libs/bower_components/jquery/src/event/ajax.js | 13 - .../bower_components/jquery/src/event/alias.js | 39 - .../bower_components/jquery/src/event/support.js | 9 - .../bower_components/jquery/src/exports/amd.js | 24 - .../bower_components/jquery/src/exports/global.js | 32 - .../libs/bower_components/jquery/src/intro.js | 44 - .../libs/bower_components/jquery/src/jquery.js | 37 - .../bower_components/jquery/src/manipulation.js | 580 - .../jquery/src/manipulation/_evalUrl.js | 18 - .../jquery/src/manipulation/support.js | 32 - .../jquery/src/manipulation/var/rcheckableType.js | 3 - .../libs/bower_components/jquery/src/offset.js | 207 - .../libs/bower_components/jquery/src/outro.js | 1 - .../libs/bower_components/jquery/src/queue.js | 142 - .../bower_components/jquery/src/queue/delay.js | 22 - .../bower_components/jquery/src/selector-native.js | 172 - .../bower_components/jquery/src/selector-sizzle.js | 14 - .../libs/bower_components/jquery/src/selector.js | 1 - .../libs/bower_components/jquery/src/serialize.js | 111 - .../jquery/src/sizzle/dist/sizzle.js | 2067 - .../jquery/src/sizzle/dist/sizzle.min.js | 3 - .../jquery/src/sizzle/dist/sizzle.min.map | 1 - .../libs/bower_components/jquery/src/traversing.js | 199 - .../jquery/src/traversing/findFilter.js | 100 - .../jquery/src/traversing/var/rneedsContext.js | 6 - .../libs/bower_components/jquery/src/var/arr.js | 3 - .../bower_components/jquery/src/var/class2type.js | 4 - .../libs/bower_components/jquery/src/var/concat.js | 5 - .../libs/bower_components/jquery/src/var/hasOwn.js | 5 - .../bower_components/jquery/src/var/indexOf.js | 5 - .../libs/bower_components/jquery/src/var/pnum.js | 3 - .../libs/bower_components/jquery/src/var/push.js | 5 - .../bower_components/jquery/src/var/rnotwhite.js | 3 - .../libs/bower_components/jquery/src/var/slice.js | 5 - .../jquery/src/var/strundefined.js | 3 - .../bower_components/jquery/src/var/support.js | 4 - .../bower_components/jquery/src/var/toString.js | 5 - .../libs/bower_components/jquery/src/wrap.js | 79 - .../ng-file-upload/ng-file-upload.min.js | 3 - .../main/webapp/app/policyApp/libs/html2canvas.js | 3010 - .../webapp/app/policyApp/libs/jquery.base64.js | 190 - .../main/webapp/app/policyApp/libs/jspdf/jspdf.js | 303 - .../webapp/app/policyApp/libs/jspdf/libs/base64.js | 143 - .../app/policyApp/libs/jspdf/libs/sprintf.js | 152 - .../webapp/app/policyApp/libs/jspdf/pdfmake.js | 68149 ------------------- .../app/policyApp/libs/tableExport.jquery.json | 1 - .../main/webapp/app/policyApp/libs/tableExport.js | 359 - .../webapp/app/policyApp/main/policy_Editor.html | 323 - .../Dictionary/ActionPolicyDictionary.html | 23 - .../Dictionary/AttributeDictionary.html | 26 - .../Dictionary/BRMSParamDictionary.html | 23 - .../Dictionary/CLPepOptionsDictionary.html | 23 - .../Dictionary/CLServiceDictionary.html | 23 - .../policy-models/Dictionary/CLSiteDictionary.html | 23 - .../Dictionary/CLVNFTypeDictionary.html | 23 - .../Dictionary/CLVSCLActionDictionary.html | 23 - .../Dictionary/CLVarbindDictionary.html | 23 - .../Dictionary/DecisionSettingsDictionary.html | 23 - .../Dictionary/DescriptiveScopeDictionary.html | 23 - .../Dictionary/EcompNameDictionary.html | 23 - .../Dictionary/EnforcerTypeDictionary.html | 23 - .../Dictionary/FWActionLisdtDictionary.html | 23 - .../Dictionary/FWActionListDictionary.html | 23 - .../Dictionary/FWAddressGroupDictionary.html | 23 - .../Dictionary/FWParentListDictionary.html | 23 - .../Dictionary/FWPortListDictionary.html | 23 - .../Dictionary/FWPrefixListDictionary.html | 23 - .../Dictionary/FWProtocolListDictionary.html | 23 - .../Dictionary/FWSecurityZoneDictionary.html | 23 - .../Dictionary/FWServiceGroupDictionary.html | 23 - .../Dictionary/FWServiceListDictionary.html | 23 - .../Dictionary/FWTermListDictionary.html | 23 - .../policy-models/Dictionary/FWZoneDictionary.html | 23 - .../Dictionary/MSConfigNameDictionary.html | 23 - .../Dictionary/MSDcaeUUIDDictionary.html | 23 - .../Dictionary/MSLocationDictionary.html | 23 - .../Dictionary/MSModelDictionary.html | 23 - .../Dictionary/PSClosedLoopDictionary.html | 23 - .../Dictionary/PSGroupPolicyScopeDictionary.html | 23 - .../Dictionary/PSResourceDictionary.html | 23 - .../Dictionary/PSServiceDictionary.html | 23 - .../policy-models/Dictionary/PSTypeDictionary.html | 23 - .../Dictionary/RiskTypeDictionary.html | 23 - .../Dictionary/SafePolicyWarningDictionary.html | 23 - .../ActionPolicyController.js | 175 - .../BRMSParamPolicyController.js | 210 - .../BRMSRawPolicyController.js | 147 - .../BaseConfigPolicyController.js | 185 - .../ClosedLoopFaultController.js | 790 - .../ClosedLoopPMController.js | 178 - .../DCAEMicroServicePolicyController.js | 694 - .../DecisionPolicyController.js | 212 - .../ExportPolicyController.js | 108 - .../FirewallPolicyController.js | 234 - .../PolicyDictionaryService.js | 522 - .../PolicyTemplates/ActionPolicyTemplate.html | 103 - .../PolicyTemplates/BRMSParamPolicyTemplate.html | 112 - .../PolicyTemplates/BRMSRawPolicyTemplate.html | 99 - .../Editor/PolicyTemplates/BasePolicyTemplate.html | 126 - .../ClosedLoopFaultPolicyTemplate.html | 350 - .../ClosedLoopPMPolicyTemplate.html | 141 - .../DCAEMicroServicePolicyTemplate.html | 108 - .../PolicyTemplates/DecisionPolicyTemplate.html | 130 - .../PolicyTemplates/DescribePolicyTemplate.html | 50 - .../PolicyTemplates/ExportPolicyTemplate.html | 35 - .../PolicyTemplates/FirewallPolicyTemplate.html | 116 - .../Editor/PolicyTemplates/PolicyTypeTemplate.html | 79 - .../policy-models/Editor/css/normalize-legacy.css | 545 - .../policy-models/Editor/css/normalize.css | 439 - .../policyApp/policy-models/Editor/css/styles.css | 86 - .../policy-models/Editor/src/css/animations.css | 183 - .../policy-models/Editor/src/css/dialogs.css | 85 - .../policy-models/Editor/src/css/main.css | 336 - .../policyApp/policy-models/Editor/src/js/app.js | 47 - .../Editor/src/js/controllers/main.js | 426 - .../src/js/controllers/selector-controller.js | 47 - .../Editor/src/js/directives/directives.js | 60 - .../policy-models/Editor/src/js/entities/item.js | 351 - .../policy-models/Editor/src/js/filters/filters.js | 41 - .../Editor/src/js/providers/config.js | 90 - .../Editor/src/js/providers/translations.js | 353 - .../Editor/src/js/services/RolesService.js | 41 - .../Editor/src/js/services/filenavigator.js | 199 - .../Editor/src/js/services/fileuploader.js | 73 - .../src/templates/current-folder-breadcrumb.html | 34 - .../Editor/src/templates/item-context-menu.html | 102 - .../Editor/src/templates/item-toolbar.html | 25 - .../Editor/src/templates/main-icons.html | 43 - .../Editor/src/templates/main-table-modal.html | 66 - .../Editor/src/templates/main-table.html | 100 - .../policy-models/Editor/src/templates/main.html | 34 - .../policy-models/Editor/src/templates/modals.html | 385 - .../policy-models/Editor/src/templates/navbar.html | 127 - .../Editor/src/templates/sidebar.html | 34 - .../Editor/src/templates/spinner.html | 25 - .../policyApp/policy-models/policy_AdminTab.html | 35 - .../policyApp/policy-models/policy_AutoPush.html | 68 - .../policy-models/policy_DashboardHealth.html | 39 - .../policy-models/policy_DashboardLogging.html | 44 - .../policyApp/policy-models/policy_Dictionary.html | 104 - .../policy-models/policy_PDPManagement.html | 98 - .../app/policyApp/policy-models/policy_Roles.html | 29 - .../app/policyApp/service/AdminTabService.js | 56 - .../app/policyApp/service/AutoPushService.js | 41 - .../app/policyApp/service/ClosedLoopPMService.js | 42 - .../app/policyApp/service/DashboardService.js | 99 - .../service/Dictionary/CLDictionaryService.js | 132 - .../service/Dictionary/DictionaryService.js | 148 - .../service/Dictionary/FWDictionaryService.js | 339 - .../service/Dictionary/MSDictionaryService.js | 96 - .../service/Dictionary/PolicyScopeService.js | 182 - .../service/Dictionary/SafePolicyService.js | 92 - .../app/policyApp/service/ExportPolicyService.js | 41 - .../webapp/app/policyApp/service/PDPService.js | 53 - .../webapp/app/policyApp/service/PapUrlService.js | 39 - .../app/policyApp/service/RolesTabService.js | 56 - ecomp-sdk-app/src/main/webapp/index.jsp | 24 - ecomp-sdk-app/src/main/webapp/manifest.jsp | 47 - .../css/att_angular_gridster/sandbox-gridster.css | 173 - .../css/att_angular_gridster/ui-gridster.css | 116 - .../main/webapp/static/fusion/css/fusion-sunny.css | 362 - .../main/webapp/static/fusion/css/jquery-ui.css | 1225 - .../fusion/css/layout/layout-default-latest.css | 224 - .../src/main/webapp/static/fusion/d3/css/nv.d3.css | 656 - .../src/main/webapp/static/fusion/d3/js/cie.js | 155 - .../main/webapp/static/fusion/d3/js/colorbrewer.js | 302 - .../src/main/webapp/static/fusion/d3/js/core.js | 122 - .../main/webapp/static/fusion/d3/js/crossfilter.js | 1180 - .../webapp/static/fusion/d3/js/crossfilter.min.js | 1 - .../src/main/webapp/static/fusion/d3/js/d3.geom.js | 816 - .../src/main/webapp/static/fusion/d3/js/d3.js | 5 - .../webapp/static/fusion/d3/js/d3.layout.cloud.js | 433 - .../main/webapp/static/fusion/d3/js/d3.layout.js | 908 - .../src/main/webapp/static/fusion/d3/js/d3.v2.js | 7037 -- .../main/webapp/static/fusion/d3/js/d3.v2.min.js | 4 - .../main/webapp/static/fusion/d3/js/d3.v3.min.js | 1 - .../src/main/webapp/static/fusion/d3/js/fisheye.js | 86 - .../src/main/webapp/static/fusion/d3/js/hive.js | 80 - .../src/main/webapp/static/fusion/d3/js/horizon.js | 192 - .../webapp/static/fusion/d3/js/interactiveLayer.js | 251 - .../src/main/webapp/static/fusion/d3/js/intro.js | 1 - .../webapp/static/fusion/d3/js/models/axis-min.js | 1 - .../main/webapp/static/fusion/d3/js/models/axis.js | 470 - .../webapp/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 - .../static/fusion/d3/js/models/boilerplate.js | 104 - .../webapp/static/fusion/d3/js/models/bullet.js | 385 - .../static/fusion/d3/js/models/bulletChart.js | 343 - .../fusion/d3/js/models/cumulativeLineChart.js | 782 - .../static/fusion/d3/js/models/discreteBar.js | 349 - .../static/fusion/d3/js/models/discreteBarChart.js | 333 - .../static/fusion/d3/js/models/distribution.js | 148 - .../static/fusion/d3/js/models/historicalBar.js | 331 - .../fusion/d3/js/models/historicalBarChart.js | 419 - .../static/fusion/d3/js/models/indentedTree.js | 337 - .../webapp/static/fusion/d3/js/models/legend.js | 270 - .../main/webapp/static/fusion/d3/js/models/line.js | 284 - .../webapp/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 - .../webapp/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 - .../static/fusion/d3/js/models/multiChart.js | 452 - .../webapp/static/fusion/d3/js/models/ohlcBar.js | 380 - .../fusion/d3/js/models/parallelCoordinates.js | 239 - .../main/webapp/static/fusion/d3/js/models/pie.js | 400 - .../webapp/static/fusion/d3/js/models/pieChart.js | 292 - .../webapp/static/fusion/d3/js/models/scatter.js | 674 - .../static/fusion/d3/js/models/scatterChart.js | 628 - .../fusion/d3/js/models/scatterPlusLineChart.js | 620 - .../webapp/static/fusion/d3/js/models/sparkline.js | 194 - .../static/fusion/d3/js/models/sparklinePlus.js | 295 - .../static/fusion/d3/js/models/stackedArea.js | 368 - .../static/fusion/d3/js/models/stackedAreaChart.js | 629 - .../src/main/webapp/static/fusion/d3/js/nv.d3.js | 13097 ---- .../main/webapp/static/fusion/d3/js/nv.d3.min.js | 1 - .../src/main/webapp/static/fusion/d3/js/outro.js | 1 - .../src/main/webapp/static/fusion/d3/js/sankey.js | 292 - .../src/main/webapp/static/fusion/d3/js/tooltip.js | 490 - .../src/main/webapp/static/fusion/d3/js/utils.js | 152 - .../webapp/static/fusion/images/Logo_att_labs.png | Bin 2011 -> 0 bytes .../src/main/webapp/static/fusion/images/Rlogo.jpg | Bin 3173 -> 0 bytes .../src/main/webapp/static/fusion/images/Thumbs.db | Bin 102912 -> 0 bytes .../webapp/static/fusion/images/action_icon.png | Bin 2388 -> 0 bytes .../static/fusion/images/action_list_spacer.gif | Bin 73 -> 0 bytes .../main/webapp/static/fusion/images/active.png | Bin 682 -> 0 bytes .../src/main/webapp/static/fusion/images/add.png | Bin 352 -> 0 bytes .../static/fusion/images/add_tool_button.png | Bin 31105 -> 0 bytes .../main/webapp/static/fusion/images/addicon.png | Bin 463 -> 0 bytes .../static/fusion/images/application_window_bg.jpg | Bin 914 -> 0 bytes .../webapp/static/fusion/images/arrow-next.png | Bin 1561 -> 0 bytes .../webapp/static/fusion/images/arrow-prev.png | Bin 1557 -> 0 bytes .../fusion/images/att_angular_gridster/grips.png | Bin 951 -> 0 bytes .../webapp/static/fusion/images/backButton.png | Bin 816 -> 0 bytes .../src/main/webapp/static/fusion/images/blank.gif | Bin 49 -> 0 bytes .../webapp/static/fusion/images/blueButton.png | Bin 1468 -> 0 bytes .../main/webapp/static/fusion/images/bubble.png | Bin 662 -> 0 bytes .../src/main/webapp/static/fusion/images/cache.png | Bin 1081 -> 0 bytes .../main/webapp/static/fusion/images/calendar.gif | Bin 929 -> 0 bytes .../main/webapp/static/fusion/images/chevron.png | Bin 252 -> 0 bytes .../static/fusion/images/close_container.gif | Bin 85 -> 0 bytes .../webapp/static/fusion/images/collapsed-icon.png | Bin 1379 -> 0 bytes .../main/webapp/static/fusion/images/column-bg.png | Bin 165 -> 0 bytes .../static/fusion/images/copyicon-highlighted.png | Bin 264 -> 0 bytes .../main/webapp/static/fusion/images/copyicon.png | Bin 235 -> 0 bytes .../main/webapp/static/fusion/images/csv_icon.jpg | Bin 632 -> 0 bytes .../main/webapp/static/fusion/images/csv_icon.png | Bin 938 -> 0 bytes .../webapp/static/fusion/images/customers-add.png | Bin 755 -> 0 bytes .../static/fusion/images/customers-search.png | Bin 976 -> 0 bytes .../main/webapp/static/fusion/images/customers.png | Bin 749 -> 0 bytes .../main/webapp/static/fusion/images/decrypted.png | Bin 628 -> 0 bytes .../fusion/images/deleteicon-highlighted.gif | Bin 592 -> 0 bytes .../fusion/images/deleteicon-highlighted.png | Bin 566 -> 0 bytes .../webapp/static/fusion/images/deleteicon.gif | Bin 579 -> 0 bytes .../src/main/webapp/static/fusion/images/ecomp.png | Bin 107597 -> 0 bytes .../webapp/static/fusion/images/ecomp_trans.png | Bin 109926 -> 0 bytes .../main/webapp/static/fusion/images/editicon.gif | Bin 360 -> 0 bytes .../webapp/static/fusion/images/error_type.gif | Bin 398 -> 0 bytes .../webapp/static/fusion/images/example-frame.png | Bin 33699 -> 0 bytes .../static/fusion/images/excelicon_multi.gif | Bin 1028 -> 0 bytes .../webapp/static/fusion/images/executeicon.png | Bin 1076 -> 0 bytes .../webapp/static/fusion/images/expanded-icon.png | Bin 1372 -> 0 bytes .../main/webapp/static/fusion/images/file-add.png | Bin 675 -> 0 bytes .../webapp/static/fusion/images/file_import.png | Bin 653 -> 0 bytes .../webapp/static/fusion/images/file_save-all.png | Bin 610 -> 0 bytes .../webapp/static/fusion/images/filter_icon.png | Bin 29069 -> 0 bytes .../webapp/static/fusion/images/folder_add.png | Bin 772 -> 0 bytes .../webapp/static/fusion/images/folder_closed.png | Bin 559 -> 0 bytes .../webapp/static/fusion/images/folder_delete.png | Bin 767 -> 0 bytes .../webapp/static/fusion/images/folder_edit.png | Bin 829 -> 0 bytes .../webapp/static/fusion/images/folder_open.png | Bin 632 -> 0 bytes .../webapp/static/fusion/images/folder_user.png | Bin 887 -> 0 bytes .../main/webapp/static/fusion/images/funnel.png | Bin 543 -> 0 bytes .../main/webapp/static/fusion/images/fusion.gif | Bin 8821 -> 0 bytes .../webapp/static/fusion/images/grayButton.png | Bin 1361 -> 0 bytes .../static/fusion/images/gray_add_tool_button.png | Bin 30883 -> 0 bytes .../webapp/static/fusion/images/headerChatIcon.png | Bin 465 -> 0 bytes .../static/fusion/images/icon_remove_all.gif | Bin 982 -> 0 bytes .../main/webapp/static/fusion/images/inactive.png | Bin 842 -> 0 bytes .../main/webapp/static/fusion/images/info_type.gif | Bin 291 -> 0 bytes .../fusion/images/layout/panel-e-w-toggle.png | Bin 459 -> 0 bytes .../fusion/images/layout/panel-n-s-toggle.png | Bin 335 -> 0 bytes .../webapp/static/fusion/images/leftButton.png | Bin 681 -> 0 bytes .../main/webapp/static/fusion/images/loading.gif | Bin 6820 -> 0 bytes .../webapp/static/fusion/images/loading_bar.gif | Bin 28954 -> 0 bytes .../webapp/static/fusion/images/login_button.gif | Bin 1222 -> 0 bytes .../main/webapp/static/fusion/images/logo_att.jpg | Bin 3145 -> 0 bytes .../static/fusion/images/logo_att_header.jpg | Bin 3145 -> 0 bytes .../static/fusion/images/logo_att_header.png | Bin 43961 -> 0 bytes .../webapp/static/fusion/images/logo_header.png | Bin 37087 -> 0 bytes .../src/main/webapp/static/fusion/images/m1.gif | Bin 636 -> 0 bytes .../src/main/webapp/static/fusion/images/mail.png | Bin 449 -> 0 bytes .../src/main/webapp/static/fusion/images/map.png | Bin 611 -> 0 bytes .../webapp/static/fusion/images/menu/bubble.png | Bin 662 -> 0 bytes .../static/fusion/images/menu/file_import.png | Bin 653 -> 0 bytes .../static/fusion/images/menu/file_save-all.png | Bin 610 -> 0 bytes .../main/webapp/static/fusion/images/menu/mail.png | Bin 449 -> 0 bytes .../webapp/static/fusion/images/menu/profile.png | Bin 462 -> 0 bytes .../static/fusion/images/menu/speechbubble.png | Bin 458 -> 0 bytes .../webapp/static/fusion/images/menu/users.png | Bin 938 -> 0 bytes .../src/main/webapp/static/fusion/images/minus.gif | Bin 75 -> 0 bytes .../fusion/images/mobile_logo_att_header_black.png | Bin 34762 -> 0 bytes .../fusion/images/mobile_logo_att_header_grey.png | Bin 34636 -> 0 bytes .../images/mobile_logo_att_header_horizontal.png | Bin 5202 -> 0 bytes .../fusion/images/mobile_logo_att_header_white.png | Bin 34475 -> 0 bytes .../webapp/static/fusion/images/modify_icon.gif | Bin 246 -> 0 bytes .../static/fusion/images/no_favorites_star.png | Bin 2794 -> 0 bytes .../main/webapp/static/fusion/images/note-add.png | Bin 589 -> 0 bytes .../webapp/static/fusion/images/note-search.png | Bin 876 -> 0 bytes .../src/main/webapp/static/fusion/images/note.png | Bin 583 -> 0 bytes .../src/main/webapp/static/fusion/images/notes.png | Bin 673 -> 0 bytes .../main/webapp/static/fusion/images/offline.png | Bin 3483 -> 0 bytes .../webapp/static/fusion/images/offlineMsg.gif | Bin 1004 -> 0 bytes .../main/webapp/static/fusion/images/online.png | Bin 888 -> 0 bytes .../src/main/webapp/static/fusion/images/page.gif | Bin 131 -> 0 bytes .../webapp/static/fusion/images/pagination.png | Bin 724 -> 0 bytes .../static/fusion/images/panel-e-w-toggle.png | Bin 459 -> 0 bytes .../static/fusion/images/panel-n-s-toggle.png | Bin 335 -> 0 bytes .../src/main/webapp/static/fusion/images/pix.gif | Bin 49 -> 0 bytes .../src/main/webapp/static/fusion/images/plus.gif | Bin 78 -> 0 bytes .../main/webapp/static/fusion/images/printer.gif | Bin 1036 -> 0 bytes .../main/webapp/static/fusion/images/profile.png | Bin 462 -> 0 bytes .../webapp/static/fusion/images/report-add.png | Bin 724 -> 0 bytes .../static/fusion/images/report-favorite.png | Bin 693 -> 0 bytes .../main/webapp/static/fusion/images/report-my.png | Bin 739 -> 0 bytes .../webapp/static/fusion/images/report-public.png | Bin 776 -> 0 bytes .../main/webapp/static/fusion/images/report.png | Bin 563 -> 0 bytes .../main/webapp/static/fusion/images/reports.png | Bin 769 -> 0 bytes .../static/fusion/images/results-first-active.png | Bin 545 -> 0 bytes .../fusion/images/results-first-disabled.png | Bin 421 -> 0 bytes .../static/fusion/images/results-last-active.png | Bin 541 -> 0 bytes .../static/fusion/images/results-last-disabled.png | Bin 421 -> 0 bytes .../static/fusion/images/results-next-active.png | Bin 416 -> 0 bytes .../static/fusion/images/results-next-disabled.png | Bin 326 -> 0 bytes .../static/fusion/images/results-prev-active.png | Bin 421 -> 0 bytes .../static/fusion/images/results-prev-disabled.png | Bin 322 -> 0 bytes .../webapp/static/fusion/images/resultset_last.png | Bin 506 -> 0 bytes .../static/fusion/images/resultset_previous.png | Bin 381 -> 0 bytes .../webapp/static/fusion/images/return_to_top.gif | Bin 846 -> 0 bytes .../webapp/static/fusion/images/rightButton.png | Bin 731 -> 0 bytes .../main/webapp/static/fusion/images/search.png | Bin 3501 -> 0 bytes .../webapp/static/fusion/images/search_profile.png | Bin 880 -> 0 bytes .../main/webapp/static/fusion/images/sort_asc.gif | Bin 57 -> 0 bytes .../main/webapp/static/fusion/images/sort_desc.gif | Bin 58 -> 0 bytes .../main/webapp/static/fusion/images/spacer.gif | Bin 43 -> 0 bytes .../webapp/static/fusion/images/success_type.gif | Bin 260 -> 0 bytes .../main/webapp/static/fusion/images/swoosh.gif | Bin 14250 -> 0 bytes .../main/webapp/static/fusion/images/tab-hm.png | Bin 249 -> 0 bytes .../main/webapp/static/fusion/images/tab-v-hm.png | Bin 317 -> 0 bytes .../src/main/webapp/static/fusion/images/tab.png | Bin 343 -> 0 bytes .../main/webapp/static/fusion/images/table-add.png | Bin 3314 -> 0 bytes .../webapp/static/fusion/images/table-delete.png | Bin 3342 -> 0 bytes .../webapp/static/fusion/images/table-edit.png | Bin 3348 -> 0 bytes .../src/main/webapp/static/fusion/images/table.png | Bin 496 -> 0 bytes .../main/webapp/static/fusion/images/tabs-bg.png | Bin 147 -> 0 bytes .../webapp/static/fusion/images/toolButton.gif | Bin 414 -> 0 bytes .../webapp/static/fusion/images/toolButton.png | Bin 531 -> 0 bytes .../main/webapp/static/fusion/images/toolbar.png | Bin 171 -> 0 bytes .../src/main/webapp/static/fusion/images/users.png | Bin 938 -> 0 bytes .../webapp/static/fusion/images/warning_type.gif | Bin 1055 -> 0 bytes .../main/webapp/static/fusion/images/webphone.ico | Bin 241 -> 0 bytes .../webapp/static/fusion/images/whiteButton.png | Bin 1430 -> 0 bytes .../js/att_angular_gridster/angular-gridster.js | 2244 - .../js/att_angular_gridster/ui-gridster-tpls.js | 168 - .../main/webapp/static/fusion/js/jquery.resize.js | 139 - .../main/webapp/static/fusion/js/layout/debug.js | 329 - .../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 -- .../src/main/webapp/static/fusion/js/moment.min.js | 6 - .../main/webapp/static/fusion/raptor/css/Style.css | 77 - .../static/fusion/raptor/css/bd_quantum_raptor.css | 305 - .../webapp/static/fusion/raptor/css/calendar.css | 97 - .../webapp/static/fusion/raptor/css/dashboard.css | 36 - .../webapp/static/fusion/raptor/css/drupal.css | 83 - .../fusion/raptor/css/form-field-tooltip.css | 12 - .../static/fusion/raptor/css/mobile_raptor.css | 73 - .../webapp/static/fusion/raptor/css/novamap.css | 25 - .../webapp/static/fusion/raptor/css/picker.css | 40 - .../main/webapp/static/fusion/raptor/css/ral.css | 1437 - .../webapp/static/fusion/raptor/css/raptor.css | 62 - .../static/fusion/raptor/css/tree/context-menu.css | 57 - .../webapp/static/fusion/raptor/d3/css/nv.d3.css | 656 - .../main/webapp/static/fusion/raptor/d3/js/cie.js | 155 - .../static/fusion/raptor/d3/js/colorbrewer.js | 302 - .../main/webapp/static/fusion/raptor/d3/js/core.js | 122 - .../static/fusion/raptor/d3/js/crossfilter.js | 1180 - .../static/fusion/raptor/d3/js/crossfilter.min.js | 1 - .../webapp/static/fusion/raptor/d3/js/d3.geom.js | 816 - .../main/webapp/static/fusion/raptor/d3/js/d3.js | 3015 - .../webapp/static/fusion/raptor/d3/js/d3.layout.js | 908 - .../webapp/static/fusion/raptor/d3/js/d3.v2.js | 7033 -- .../webapp/static/fusion/raptor/d3/js/d3.v2.min.js | 4 - .../webapp/static/fusion/raptor/d3/js/d3.v3.js | 8444 --- .../webapp/static/fusion/raptor/d3/js/d3.v3.min.js | 1 - .../webapp/static/fusion/raptor/d3/js/fisheye.js | 86 - .../main/webapp/static/fusion/raptor/d3/js/hive.js | 80 - .../webapp/static/fusion/raptor/d3/js/horizon.js | 192 - .../static/fusion/raptor/d3/js/interactiveLayer.js | 251 - .../webapp/static/fusion/raptor/d3/js/intro.js | 1 - .../static/fusion/raptor/d3/js/models/axis-min.js | 1 - .../static/fusion/raptor/d3/js/models/axis.js | 470 - .../static/fusion/raptor/d3/js/models/axis.min.js | 1 - .../fusion/raptor/d3/js/models/boilerplate.js | 104 - .../static/fusion/raptor/d3/js/models/bullet.js | 385 - .../fusion/raptor/d3/js/models/bulletChart.js | 343 - .../raptor/d3/js/models/cumulativeLineChart.js | 782 - .../fusion/raptor/d3/js/models/discreteBar.js | 349 - .../fusion/raptor/d3/js/models/discreteBarChart.js | 333 - .../fusion/raptor/d3/js/models/distribution.js | 148 - .../fusion/raptor/d3/js/models/historicalBar.js | 331 - .../raptor/d3/js/models/historicalBarChart.js | 419 - .../fusion/raptor/d3/js/models/indentedTree.js | 337 - .../static/fusion/raptor/d3/js/models/legend.js | 270 - .../static/fusion/raptor/d3/js/models/line.js | 284 - .../static/fusion/raptor/d3/js/models/lineChart.js | 465 - .../fusion/raptor/d3/js/models/linePlusBarChart.js | 433 - .../d3/js/models/linePlusBarWithFocusChart.js | 658 - .../fusion/raptor/d3/js/models/lineWithFisheye.js | 200 - .../raptor/d3/js/models/lineWithFisheyeChart.js | 297 - .../raptor/d3/js/models/lineWithFocusChart.js | 574 - .../static/fusion/raptor/d3/js/models/multiBar.js | 461 - .../fusion/raptor/d3/js/models/multiBarChart.js | 524 - .../raptor/d3/js/models/multiBarHorizontal.js | 424 - .../raptor/d3/js/models/multiBarHorizontalChart.js | 434 - .../raptor/d3/js/models/multiBarTimeSeries.js | 384 - .../raptor/d3/js/models/multiBarTimeSeriesChart.js | 405 - .../fusion/raptor/d3/js/models/multiChart.js | 452 - .../static/fusion/raptor/d3/js/models/ohlcBar.js | 380 - .../raptor/d3/js/models/parallelCoordinates.js | 239 - .../static/fusion/raptor/d3/js/models/pie.js | 400 - .../static/fusion/raptor/d3/js/models/pie.js.bak | 400 - .../static/fusion/raptor/d3/js/models/pieChart.js | 292 - .../static/fusion/raptor/d3/js/models/scatter.js | 674 - .../fusion/raptor/d3/js/models/scatterChart.js | 628 - .../raptor/d3/js/models/scatterPlusLineChart.js | 620 - .../static/fusion/raptor/d3/js/models/sparkline.js | 194 - .../fusion/raptor/d3/js/models/sparklinePlus.js | 295 - .../fusion/raptor/d3/js/models/stackedArea.js | 368 - .../fusion/raptor/d3/js/models/stackedAreaChart.js | 629 - .../webapp/static/fusion/raptor/d3/js/nv.d3.min.js | 1 - .../webapp/static/fusion/raptor/d3/js/outro.js | 1 - .../webapp/static/fusion/raptor/d3/js/sankey.js | 292 - .../webapp/static/fusion/raptor/d3/js/tooltip.js | 490 - .../webapp/static/fusion/raptor/d3/js/utils.js | 152 - .../static/fusion/raptor/dy3/js/dashed-canvas.js | 176 - .../webapp/static/fusion/raptor/dy3/js/data.js | 63 - .../static/fusion/raptor/dy3/js/dygraph-canvas.js | 816 - .../fusion/raptor/dy3/js/dygraph-combined.js | 2 - .../raptor/dy3/js/dygraph-combined_bak_color.js | 2 - .../static/fusion/raptor/dy3/js/dygraph-dev.js | 45 - .../static/fusion/raptor/dy3/js/dygraph-externs.js | 93 - .../static/fusion/raptor/dy3/js/dygraph-gviz.js | 82 - .../raptor/dy3/js/dygraph-interaction-model.js | 676 - .../static/fusion/raptor/dy3/js/dygraph-layout.js | 349 - .../raptor/dy3/js/dygraph-options-reference.js | 867 - .../static/fusion/raptor/dy3/js/dygraph-options.js | 384 - .../fusion/raptor/dy3/js/dygraph-plugin-base.js | 4 - .../fusion/raptor/dy3/js/dygraph-plugin-install.js | 19 - .../static/fusion/raptor/dy3/js/dygraph-tickers.js | 487 - .../static/fusion/raptor/dy3/js/dygraph-utils.js | 1305 - .../webapp/static/fusion/raptor/dy3/js/dygraph.js | 3857 -- .../webapp/static/fusion/raptor/dy3/js/excanvas.js | 924 - .../static/fusion/raptor/dy3/js/interaction.js | 333 - .../static/fusion/raptor/dy3/js/interaction.min.js | 1 - .../static/fusion/raptor/dy3/js/interaction_sun.js | 303 - .../static/fusion/raptor/dy3/js/moment.min.js | 6 - .../static/fusion/raptor/dy3/js/phantom-driver.js | 206 - .../static/fusion/raptor/dy3/js/phantom-perf.js | 94 - .../static/fusion/raptor/dy3/js/plugins/README | 113 - .../fusion/raptor/dy3/js/plugins/annotations.js | 182 - .../static/fusion/raptor/dy3/js/plugins/axes.js | 315 - .../fusion/raptor/dy3/js/plugins/chart-labels.js | 202 - .../static/fusion/raptor/dy3/js/plugins/grid.js | 124 - .../static/fusion/raptor/dy3/js/plugins/legend.js | 332 - .../fusion/raptor/dy3/js/plugins/range-selector.js | 852 - .../fusion/raptor/dy3/js/rgbcolor/rgbcolor.js | 257 - .../static/fusion/raptor/dy3/js/stacktrace.js | 411 - .../static/fusion/raptor/dy3/js/strftime/Doxyfile | 243 - .../fusion/raptor/dy3/js/strftime/strftime-min.js | 1 - .../fusion/raptor/dy3/js/strftime/strftime.js | 731 - .../static/fusion/raptor/ebz/date_time_picker.css | 557 - .../static/fusion/raptor/ebz/date_time_picker.js | 277 - .../webapp/static/fusion/raptor/ebz/dynamicform.js | 112 - .../main/webapp/static/fusion/raptor/ebz/moment.js | 3688 - .../webapp/static/fusion/raptor/ebz/multiselect.js | 62 - .../webapp/static/fusion/raptor/ebz/quick_links.js | 33 - .../fusion/raptor/ebz/report_chart_wizard.html | 313 - .../fusion/raptor/ebz/report_chart_wizard.js | 671 - .../static/fusion/raptor/ebz/report_run.html | 67 - .../webapp/static/fusion/raptor/ebz/report_run.js | 293 - .../static/fusion/raptor/ebz/report_search.html | 34 - .../static/fusion/raptor/ebz/report_search.js | 136 - .../static/fusion/raptor/images/RAPTOR_BANNER.jpg | Bin 6249 -> 0 bytes .../static/fusion/raptor/images/accessicon.gif | Bin 329 -> 0 bytes .../webapp/static/fusion/raptor/images/active.gif | Bin 338 -> 0 bytes .../webapp/static/fusion/raptor/images/addbtn.png | Bin 662 -> 0 bytes .../static/fusion/raptor/images/ajax-loader.gif | Bin 673 -> 0 bytes .../static/fusion/raptor/images/arrow_add.gif | Bin 469 -> 0 bytes .../static/fusion/raptor/images/arrow_add_edge.gif | Bin 564 -> 0 bytes .../fusion/raptor/images/arrow_add_multiple.gif | Bin 748 -> 0 bytes .../static/fusion/raptor/images/arrow_add_one.gif | Bin 631 -> 0 bytes .../static/fusion/raptor/images/arrow_back.gif | Bin 621 -> 0 bytes .../static/fusion/raptor/images/arrow_cancel.gif | Bin 652 -> 0 bytes .../static/fusion/raptor/images/arrow_left.gif | Bin 382 -> 0 bytes .../static/fusion/raptor/images/arrow_left2.gif | Bin 399 -> 0 bytes .../static/fusion/raptor/images/arrow_next.gif | Bin 609 -> 0 bytes .../static/fusion/raptor/images/arrow_plus.gif | Bin 67 -> 0 bytes .../fusion/raptor/images/arrow_reorder_all.gif | Bin 686 -> 0 bytes .../fusion/raptor/images/arrow_reorder_all.png | Bin 29837 -> 0 bytes .../static/fusion/raptor/images/arrow_right.gif | Bin 381 -> 0 bytes .../static/fusion/raptor/images/arrow_right2.gif | Bin 399 -> 0 bytes .../static/fusion/raptor/images/arrow_save.gif | Bin 606 -> 0 bytes .../static/fusion/raptor/images/button_import.png | Bin 546 -> 0 bytes .../static/fusion/raptor/images/calendar_icon.gif | Bin 552 -> 0 bytes .../fusion/raptor/images/calendar_icon_nav.gif | Bin 538 -> 0 bytes .../fusion/raptor/images/calendar_icon_nav1.gif | Bin 1065 -> 0 bytes .../static/fusion/raptor/images/calender_icon.gif | Bin 552 -> 0 bytes .../fusion/raptor/images/columnblankdown.gif | Bin 192 -> 0 bytes .../static/fusion/raptor/images/columnblankup.gif | Bin 193 -> 0 bytes .../static/fusion/raptor/images/columndown.gif | Bin 124 -> 0 bytes .../static/fusion/raptor/images/columnup.gif | Bin 126 -> 0 bytes .../static/fusion/raptor/images/crosshairs.png | Bin 218 -> 0 bytes .../static/fusion/raptor/images/csv_icon.gif | Bin 447 -> 0 bytes .../static/fusion/raptor/images/deleteicon.gif | Bin 80 -> 0 bytes .../static/fusion/raptor/images/downloadicon.gif | Bin 74 -> 0 bytes .../static/fusion/raptor/images/excel2007.jpg | Bin 761 -> 0 bytes .../static/fusion/raptor/images/excel2007.png | Bin 3186 -> 0 bytes .../static/fusion/raptor/images/excelicon.gif | Bin 1055 -> 0 bytes .../fusion/raptor/images/excelicon_multi.gif | Bin 1026 -> 0 bytes .../fusion/raptor/images/green-arrow-right.gif | Bin 201 -> 0 bytes .../static/fusion/raptor/images/green-arrow.gif | Bin 195 -> 0 bytes .../static/fusion/raptor/images/grnarrowdn.gif | Bin 74 -> 0 bytes .../static/fusion/raptor/images/grnarrowup.gif | Bin 106 -> 0 bytes .../main/webapp/static/fusion/raptor/images/h.png | Bin 380 -> 0 bytes .../static/fusion/raptor/images/inactive.gif | Bin 352 -> 0 bytes .../webapp/static/fusion/raptor/images/loader.gif | Bin 958 -> 0 bytes .../webapp/static/fusion/raptor/images/loading.gif | Bin 4176 -> 0 bytes .../static/fusion/raptor/images/lookup_arrow.gif | Bin 645 -> 0 bytes .../static/fusion/raptor/images/maps/blue.png | Bin 1309 -> 0 bytes .../static/fusion/raptor/images/maps/green.png | Bin 1190 -> 0 bytes .../static/fusion/raptor/images/maps/lightblue.png | Bin 1269 -> 0 bytes .../fusion/raptor/images/maps/map_iphone.jpg | Bin 712 -> 0 bytes .../static/fusion/raptor/images/maps/orange.png | Bin 3413 -> 0 bytes .../static/fusion/raptor/images/maps/pink.png | Bin 1321 -> 0 bytes .../static/fusion/raptor/images/maps/purple.png | Bin 1324 -> 0 bytes .../static/fusion/raptor/images/maps/red.png | Bin 1305 -> 0 bytes .../static/fusion/raptor/images/maps/yellow.png | Bin 1309 -> 0 bytes .../webapp/static/fusion/raptor/images/minus.gif | Bin 75 -> 0 bytes .../static/fusion/raptor/images/modify_icon.gif | Bin 246 -> 0 bytes .../webapp/static/fusion/raptor/images/page.gif | Bin 554 -> 0 bytes .../static/fusion/raptor/images/pdficon_large.gif | Bin 434 -> 0 bytes .../static/fusion/raptor/images/pdficon_small.gif | Bin 361 -> 0 bytes .../static/fusion/raptor/images/pen_paper.gif | Bin 618 -> 0 bytes .../webapp/static/fusion/raptor/images/plus.gif | Bin 78 -> 0 bytes .../static/fusion/raptor/images/popupicon.gif | Bin 79 -> 0 bytes .../static/fusion/raptor/images/position.png | Bin 267 -> 0 bytes .../webapp/static/fusion/raptor/images/printer.gif | Bin 1019 -> 0 bytes .../static/fusion/raptor/images/progress.gif | Bin 734 -> 0 bytes .../static/fusion/raptor/images/question_mark.jpg | Bin 426 -> 0 bytes .../static/fusion/raptor/images/quickhelp_dk.gif | Bin 155 -> 0 bytes .../static/fusion/raptor/images/quickhelp_lt.gif | Bin 897 -> 0 bytes .../webapp/static/fusion/raptor/images/r_back.gif | Bin 918 -> 0 bytes .../webapp/static/fusion/raptor/images/raptor.jpg | Bin 889 -> 0 bytes .../static/fusion/raptor/images/raptor_logo.gif | Bin 3150 -> 0 bytes .../static/fusion/raptor/images/raptor_logo.jpg | Bin 1827 -> 0 bytes .../static/fusion/raptor/images/required.gif | Bin 854 -> 0 bytes .../static/fusion/raptor/images/shareicon.gif | Bin 542 -> 0 bytes .../main/webapp/static/fusion/raptor/images/sv.png | Bin 11373 -> 0 bytes .../static/fusion/raptor/images/tab_left.gif | Bin 137 -> 0 bytes .../static/fusion/raptor/images/tab_left_sel.gif | Bin 106 -> 0 bytes .../static/fusion/raptor/images/tab_right.gif | Bin 138 -> 0 bytes .../static/fusion/raptor/images/tab_right_sel.gif | Bin 104 -> 0 bytes .../static/fusion/raptor/images/test_run.gif | Bin 330 -> 0 bytes .../webapp/static/fusion/raptor/images/text.gif | Bin 141 -> 0 bytes .../raptor/images/tree/context-menu-gradient.gif | Bin 807 -> 0 bytes .../raptor/images/tree/dhtmlgoodies_folder.gif | Bin 1120 -> 0 bytes .../raptor/images/tree/dhtmlgoodies_minus.gif | Bin 197 -> 0 bytes .../raptor/images/tree/dhtmlgoodies_plus.gif | Bin 200 -> 0 bytes .../raptor/images/tree/dhtmlgoodies_sheet.gif | Bin 906 -> 0 bytes .../images/tree/dhtmlgoodies_sheet_crosstab.gif | Bin 1144 -> 0 bytes .../images/tree/dhtmlgoodies_sheet_dashboard.gif | Bin 1164 -> 0 bytes .../images/tree/dhtmlgoodies_sheet_graph.gif | Bin 983 -> 0 bytes .../fusion/raptor/images/tree/dragDrop_ind1.gif | Bin 53 -> 0 bytes .../fusion/raptor/images/tree/dragDrop_ind2.gif | Bin 56 -> 0 bytes .../fusion/raptor/images/tree/folder_close.gif | Bin 283 -> 0 bytes .../fusion/raptor/images/tree/folder_dots.gif | Bin 68 -> 0 bytes .../fusion/raptor/images/tree/folder_folder.gif | Bin 980 -> 0 bytes .../fusion/raptor/images/tree/folder_lastsub.gif | Bin 78 -> 0 bytes .../fusion/raptor/images/tree/folder_open.gif | Bin 286 -> 0 bytes .../fusion/raptor/images/tree/folder_sub.gif | Bin 265 -> 0 bytes .../fusion/raptor/images/tree/grnarrowleft.gif | Bin 854 -> 0 bytes .../fusion/raptor/images/tree/grnarrowright.gif | Bin 845 -> 0 bytes .../static/fusion/raptor/images/txt_icon.gif | Bin 154 -> 0 bytes .../webapp/static/fusion/raptor/images/uF033.png | Bin 520 -> 0 bytes .../webapp/static/fusion/raptor/images/uF034.png | Bin 536 -> 0 bytes .../webapp/static/fusion/raptor/images/uF035.png | Bin 487 -> 0 bytes .../webapp/static/fusion/raptor/images/uF036.png | Bin 482 -> 0 bytes .../fusion/raptor/img/BorderLayout-24x24.png | Bin 1369 -> 0 bytes .../static/fusion/raptor/img/Calendar-16x16.png | Bin 552 -> 0 bytes .../static/fusion/raptor/img/DeleteCross-16x16.png | Bin 750 -> 0 bytes .../webapp/static/fusion/raptor/img/addbtn.png | Bin 662 -> 0 bytes .../static/fusion/raptor/img/button_import.png | Bin 546 -> 0 bytes .../fusion/raptor/img/copyicon-highlighted.png | Bin 264 -> 0 bytes .../webapp/static/fusion/raptor/img/copyicon.png | Bin 235 -> 0 bytes .../static/fusion/raptor/img/cross-small.png | Bin 291 -> 0 bytes .../webapp/static/fusion/raptor/img/csv_icon.gif | Bin 447 -> 0 bytes .../webapp/static/fusion/raptor/img/csv_icon.jpg | Bin 632 -> 0 bytes .../webapp/static/fusion/raptor/img/csv_icon.png | Bin 938 -> 0 bytes .../fusion/raptor/img/deleteicon-highlighted.gif | Bin 592 -> 0 bytes .../fusion/raptor/img/deleteicon-highlighted.png | Bin 566 -> 0 bytes .../webapp/static/fusion/raptor/img/deleteicon.gif | Bin 579 -> 0 bytes .../static/fusion/raptor/img/downloadicon.gif | Bin 74 -> 0 bytes .../webapp/static/fusion/raptor/img/editicon.gif | Bin 360 -> 0 bytes .../webapp/static/fusion/raptor/img/excel2007.jpg | Bin 761 -> 0 bytes .../webapp/static/fusion/raptor/img/excelicon.gif | Bin 1055 -> 0 bytes .../static/fusion/raptor/img/excelicon_multi.gif | Bin 1026 -> 0 bytes .../static/fusion/raptor/img/executeicon.png | Bin 1076 -> 0 bytes .../static/fusion/raptor/img/file_import.png | Bin 653 -> 0 bytes .../static/fusion/raptor/img/pdficon_small.gif | Bin 361 -> 0 bytes .../webapp/static/fusion/raptor/img/pen_paper.gif | Bin 618 -> 0 bytes .../static/fusion/raptor/img/pencil-small.png | Bin 309 -> 0 bytes .../webapp/static/fusion/raptor/img/report-add.png | Bin 724 -> 0 bytes .../static/fusion/raptor/img/report-favorite.png | Bin 693 -> 0 bytes .../webapp/static/fusion/raptor/img/report-my.png | Bin 739 -> 0 bytes .../static/fusion/raptor/img/report-public.png | Bin 776 -> 0 bytes .../webapp/static/fusion/raptor/img/report.png | Bin 563 -> 0 bytes .../webapp/static/fusion/raptor/img/reports.png | Bin 769 -> 0 bytes .../webapp/static/fusion/raptor/img/search.gif | Bin 223 -> 0 bytes .../webapp/static/fusion/raptor/img/search.png | Bin 3501 -> 0 bytes .../webapp/static/fusion/raptor/img/tick-small.png | Bin 283 -> 0 bytes .../static/fusion/raptor/js/CalendarPopup.js | 1486 - .../main/webapp/static/fusion/raptor/js/ajax.js | 214 - .../fusion/raptor/js/ajax_dynamic_content.js | 97 - .../static/fusion/raptor/js/cingular_button.js | 217 - .../main/webapp/static/fusion/raptor/js/drupal.js | 1018 - .../static/fusion/raptor/js/editabledropdown.js | 363 - .../static/fusion/raptor/js/form-field-tooltip.js | 715 - .../main/webapp/static/fusion/raptor/js/gmap.js | 634 - .../main/webapp/static/fusion/raptor/js/jquery.js | 4376 -- .../webapp/static/fusion/raptor/js/jquery.min.js | 154 - .../static/fusion/raptor/js/label_quantum.js | 5 - .../webapp/static/fusion/raptor/js/nova_button.js | 1184 - .../static/fusion/raptor/js/other_scripts.js | 331 - .../fusion/raptor/js/persist_table_header.js | 47 - .../static/fusion/raptor/js/prototype-1.6.0.3.js | 4320 -- .../main/webapp/static/fusion/raptor/js/raptor.js | 314 - .../static/fusion/raptor/js/rounded-corners.js | 353 - .../main/webapp/static/fusion/raptor/js/script.js | 482 - .../webapp/static/fusion/raptor/js/tree/ajax.js | 194 - .../webapp/static/fusion/raptor/uigrid/ui-grid.css | 1971 - .../webapp/static/fusion/raptor/uigrid/ui-grid.eot | Bin 8728 -> 0 bytes .../webapp/static/fusion/raptor/uigrid/ui-grid.js | 26735 -------- .../webapp/static/fusion/raptor/uigrid/ui-grid.svg | 34 - .../webapp/static/fusion/raptor/uigrid/ui-grid.ttf | Bin 8564 -> 0 bytes .../static/fusion/raptor/uigrid/ui-grid.woff | Bin 4792 -> 0 bytes .../static/fusion/sample/css/images/blank.gif | Bin 49 -> 0 bytes .../webapp/static/fusion/sample/css/scribble.css | 40 - .../webapp/static/fusion/sample/css/slider.css | 142 - .../static/fusion/sample/css/spacegallery.css | 18 - .../webapp/static/fusion/sample/css/welcome.css | 169 - .../static/fusion/sample/html/area_chart.html | 49 - .../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 - .../webapp/static/fusion/sample/html/donut_d3.html | 43 - .../static/fusion/sample/html/js/area_chart.min.js | 1 - .../static/fusion/sample/html/js/donut.min.js | 1 - .../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 - .../static/fusion/sample/html/line_chart.html | 49 - .../static/fusion/sample/html/pie_chart.html | 38 - .../static/fusion/sample/html/wordcloud.html | 37 - .../static/fusion/sample/images/Calendar-16x16.png | Bin 552 -> 0 bytes .../static/fusion/sample/images/arrow-next.png | Bin 1561 -> 0 bytes .../static/fusion/sample/images/arrow-prev.png | Bin 1557 -> 0 bytes .../images/carousel/slide_b_drive_test_map.png | Bin 202465 -> 0 bytes .../sample/images/carousel/slide_b_eppt_county.png | Bin 21222 -> 0 bytes .../images/carousel/slide_b_eppt_regression.png | Bin 11536 -> 0 bytes .../images/carousel/slide_b_ios_throughput.png | Bin 26131 -> 0 bytes .../sample/images/carousel/slide_b_lata_map.png | Bin 192031 -> 0 bytes .../images/carousel/slide_b_lata_map_legend.png | Bin 3021 -> 0 bytes .../images/carousel/slide_b_nova_sdn_map.png | Bin 179361 -> 0 bytes .../static/fusion/sample/images/copyicon.png | Bin 235 -> 0 bytes .../static/fusion/sample/images/deleteicon.gif | Bin 579 -> 0 bytes .../static/fusion/sample/images/example-frame.png | Bin 33699 -> 0 bytes .../webapp/static/fusion/sample/images/loading.gif | Bin 6820 -> 0 bytes .../static/fusion/sample/images/tunnels/1_mon.png | Bin 22762 -> 0 bytes .../static/fusion/sample/images/tunnels/2_tue.png | Bin 22772 -> 0 bytes .../static/fusion/sample/images/tunnels/3_wed.png | Bin 24012 -> 0 bytes .../static/fusion/sample/images/tunnels/4_thu.png | Bin 23902 -> 0 bytes .../static/fusion/sample/images/tunnels/5_fri.png | Bin 22349 -> 0 bytes .../static/fusion/sample/images/tunnels/6_sat.png | Bin 23674 -> 0 bytes .../static/fusion/sample/images/tunnels/7_sun.png | Bin 22845 -> 0 bytes .../fusion/sample/images/tunnels/BH_DLSTX_IN.png | Bin 10575 -> 0 bytes .../fusion/sample/images/tunnels/BH_DLSTX_OUT.png | Bin 10460 -> 0 bytes .../static/fusion/sample/images/tunnels/BH_Nat.png | Bin 10420 -> 0 bytes .../fusion/sample/images/tunnels/BH_Nat_Def.png | Bin 8941 -> 0 bytes .../sample/images/tunnels/BH_Nat_Priority.png | Bin 10590 -> 0 bytes .../webapp/static/fusion/sample/js/FusionCharts.js | 361 - .../main/webapp/static/fusion/sample/js/charts.js | 132 - .../fusion/sample/js/jquery.flexslider-min.js | 5 - .../webapp/static/fusion/sample/js/scribble.js | 19 - .../static/fusion/sample/js/slides.min.jquery.js | 20 - .../webapp/static/fusion/sample/js/spacegallery.js | 235 - .../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 - .../static/fusion/sample/org_chart/images/bkgd.png | Bin 133 -> 0 bytes .../fusion/sample/org_chart/images/raspberry.jpg | Bin 5755 -> 0 bytes .../fusion/sample/org_chart/jquery.jOrgChart.js | 267 - .../static/fusion/sample/org_chart/prettify.js | 28 - .../src/main/webapp/static/js/jquery-1.10.2.js | 9789 --- .../src/main/webapp/static/js/jquery-ui.js | 16617 ----- .../src/main/webapp/static/js/jquery.mask.min.js | 12 - .../src/main/webapp/static/js/modalService.js | 169 - ecomp-sdk-app/src/main/webapp/static/js/search.js | 829 - .../java/org/openecomp/portalapp/SanityTest.java | 20 - .../controller/CollaborationControllerTest.java | 27 - .../openecomp/portalapp/controller/NetMapTest.java | 19 - .../portalapp/service/ProfileServiceTest.java | 37 - .../core/MockApplicationContextTestSuite.java | 126 - .../services/WorkflowScheduleServiceTest.java | 41 - 3148 files changed, 708927 deletions(-) delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressGroupJson.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressJson.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressMembers.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AutoPushTabAdapter.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopFaultBody.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopFaultTriggerUISignatures.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPMBody.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPerformanceMetrics.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicy.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicyConditions.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicyStatus.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopSignatures.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/DeletePolicyCondition.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/DeployNowJson.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/GridData.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PolicyAdapter.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PolicyExportAdapter.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PrefixIPList.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceGroupJson.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceListJson.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceMembers.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServicesJson.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/Term.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/TermCollector.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/CheckPDP.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PAPNotificationBroadcaster.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PolicyManagerServlet.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PolicyNotificationMail.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/RESTfulPAPEngine.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/XacmlAdminUI.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/components/ElasticSearchComponent.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/components/HumanPolicyComponent.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/components/PolicyImportWindow.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/conf/HibernateSession.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/ActionPolicyController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/AdminTabController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/AutoPushController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateBRMSRawController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateClosedLoopFaultController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateClosedLoopPMController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateDcaeMicroServiceController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateFirewallController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreatePolicyController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/DashboardController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/DecisionPolicyController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PDPController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyExportAndImportController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyNotificationController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyRolesController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyValidationController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/FunctionDefinitionDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/GlobalRoleSettingsDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/GroupEntityDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PDPEntityDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyEditorScopesDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyRolesDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyVersionDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RemoteCatalogValuesDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RolesDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RuleAlgorithmsDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/SystemLogDbDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/WatchPolicyNotificationDao.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ActionPolicyDictDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/AddressGroupDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/BRMSParamTemplateDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/DescriptiveScopeDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/FirewallDictionaryListDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/FunctionDefinitionDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GlobalRoleSettingsDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GroupEntityDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GroupPolicyScopeListDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/MicroServiceModelsDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PDPEntityDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyEditorScopesDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyRolesDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyVersionDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PrefixListDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RemoteCatalogValuesDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RolesDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RuleAlgorithmsDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SafePolicyWarningDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SecurityZoneDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ServiceGroupDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ServiceListDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SystemLogDbDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/TermListDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/UserInfoDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/VarbindDictionaryDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/WatchPolicyNotificationDaoImpl.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/ElkConnector.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/Pair.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/PolicyElasticSearchController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/PolicyLocator.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/converter/ElkRecord.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/converter/Xacml2Elk.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/model/PDPGroupContainer.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/model/PDPPolicyContainer.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/model/Roles.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/ConfigurableRESTUtils.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/PolicyContainer.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/PolicyItemSetChangeNotifier.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/XACMLPolicyWriterWithPapNotify.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/AngularSinglePageController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/CallflowController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/ElasticSearchController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/LeafletMapContoller.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/PostDroolsController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/UserProfileController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/WelcomeController.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/model/Result.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/Register.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/service/OnBoardingApiServiceImplPolicy.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java delete mode 100644 ecomp-sdk-app/src/main/java/org/openecomp/portalapp/util/CustomLoggingFilter.java delete mode 100644 ecomp-sdk-app/src/main/resources/att-rules.drl delete mode 100644 ecomp-sdk-app/src/main/resources/cache.ccf delete mode 100644 ecomp-sdk-app/src/main/resources/logback.xml delete mode 100644 ecomp-sdk-app/src/main/resources/mchange-log.properties delete mode 100644 ecomp-sdk-app/src/main/resources/portal.properties delete mode 100644 ecomp-sdk-app/src/main/resources/state-rules.drl delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/conf/quartz.properties delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor.properties delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_app_fusion.properties delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_db_fusion.properties delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_pdf.properties delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/conf/sql.properties delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/conf/system.properties delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/defs/definitions.xml delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/conf/fusion.properties delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/defs/definitions.xml delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/.gitignore delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/broadcast.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/broadcast_list.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/collaborateList.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/data_out.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/ebz_footer.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/ebz_header.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/loginSnippet.html delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template_noheader_nofooter.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template_report_embedded.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/es_search_demo.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/es_suggest_demo.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/frame_insert.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/include.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/jcs_admin.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/meta.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal.html delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal_role.html delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal_rolefunction.html delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/post_search.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/profile.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/profile_search.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role_function_list.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role_list.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/usage_list.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/webrtc/collaboration.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/Fusion.hbm.xml delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/RNoteBookIntegration.hbm.xml delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/Workflow.hbm.xml delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/custom_header_include.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/custom_js_include.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/date_end_field_run_sql.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/date_start_field_run_sql.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/default_field_run_sql.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/disclaimer.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/error_include.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/error_page.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/footer.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_drill_down_report.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_import_semaphore.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_semaphore.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_sql.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_table_cols.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_testrun_sql.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_csv.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_pdf.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_xls.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_ebz.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_import.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_sample.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_search.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_wizard.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/test_field_run_sql.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/test_run_sql.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/tree/folderNav.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/tree/testTree.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_adhoc_schedule.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_chart.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_columns_add_multi.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_columns_edit.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_columns_list.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_columns_order_all.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_data_forecasting.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_definition.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_filters_edit.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_filters_list.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_form_fields_edit.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_form_fields_list.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_javascript.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_log.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_map.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_run.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_formfield_include.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_multiple.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_only.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_only_from_search.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_edit.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_list.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_order_all.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sql_def.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_tables_edit.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_tables_list.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_user_access.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/error.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/leafletMap.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/login_external.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/net_map.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/user_profile.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/welcome.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/WEB-INF/web.xml delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-animate.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-animate.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-animate.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-aria.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-aria.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-aria.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-csp.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-loader.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-loader.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-loader.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-message-format.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-message-format.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-message-format.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-messages.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-messages.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-messages.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-mocks.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-resource.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-resource.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-resource.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-route.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-route.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-route.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-sanitize.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-sanitize.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-sanitize.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-scenario.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-touch.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-touch.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-touch.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/errors.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/version.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/version.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-ui/ui-bootstrap-tpls-1.1.2.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-ui/ui-bootstrap-tpls-1.2.4.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/bootstrap/bs.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/css/nv.d3.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/cie.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/colorbrewer.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/core.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/crossfilter.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/crossfilter.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/d3.geom.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/d3.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/d3.layout.cloud.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/d3.layout.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/d3.v2.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/d3.v2.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/d3.v3.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/fisheye.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/hive.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/horizon.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/interactiveLayer.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/intro.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/axis-min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/axis.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/axis.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/backup/bullet.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/backup/bulletChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/boilerplate.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/bullet.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/bulletChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/cumulativeLineChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/discreteBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/discreteBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/distribution.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/historicalBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/historicalBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/indentedTree.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/legend.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/line.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/lineChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/linePlusBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/linePlusBarWithFocusChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/lineWithFisheye.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/lineWithFisheyeChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/lineWithFocusChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/multiBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/multiBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/multiBarHorizontal.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/multiBarHorizontalChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/multiBarTimeSeries.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/multiBarTimeSeriesChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/multiChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/ohlcBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/parallelCoordinates.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/pie.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/pieChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/scatter.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/scatterChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/scatterPlusLineChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/sparkline.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/sparklinePlus.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/stackedArea.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/stackedAreaChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/nv.d3.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/nv.d3.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/outro.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/sankey.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/tooltip.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/utils.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/angular-animate.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/angular-cookies.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/angular-route.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/angular-route.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/angular-sanitize.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/angular-touch.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/angular.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/app.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/checklist-model.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/checklist-model.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/gestures.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/ng_base.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/angular_js/ui-charts-tpls.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/ebz_header/footer.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/ebz_header/header.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/ebz_header/portal_ebz_header.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/fn-ebz.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/images/headerChatIcon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/images/no_favorites_star.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/js/attHeaderSnippet.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/js/footer.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/att-abs-tpls.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/att-abs-tpls.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/base.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/btn.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/demo.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/dtpk.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/frms.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/ie/backgroundsize.min.htc delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/calendar-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/checkbox.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/down.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/icon-close-modal.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/icon-informative-modal.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/icon-warning-modal.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/loader.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/loading-spinner-medium.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/loading-spinner-orange.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/loading_balls_black-small.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/loading_balls_black.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/loading_balls_blue-small.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/loading_balls_blue.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/loading_balls_white-small.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/loading_balls_white.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/loading_dots.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/magnify_glass.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/oops-exclamation.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/radio.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/select-arrows.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/treearrow.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/up.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/images/upanddown.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/pages/iconography.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/sldr.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/style.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ebz/sandbox/styles/tbs.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/.gitignore delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/LICENSE delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/bower.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/component.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/composer.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/css/ionicons.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/css/ionicons.min.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/fonts/ionicons.eot delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/fonts/ionicons.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/fonts/ionicons.ttf delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/fonts/ionicons.woff delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/less/_ionicons-font.less delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/less/_ionicons-icons.less delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/less/_ionicons-variables.less delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/less/ionicons.less delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/alert-circled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/alert.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-add-contact.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-alarm.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-archive.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-arrow-back.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-arrow-down-left.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-arrow-down-right.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-arrow-forward.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-arrow-up-left.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-arrow-up-right.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-battery.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-book.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-calendar.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-call.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-camera.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-chat.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-checkmark.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-clock.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-close.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-contact.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-contacts.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-data.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-developer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-display.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-download.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-drawer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-dropdown.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-earth.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-folder.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-forums.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-friends.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-hand.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-image.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-inbox.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-information.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-keypad.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-lightbulb.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-locate.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-location.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-mail.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-microphone.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-mixer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-more.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-note.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-playstore.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-printer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-promotion.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-reminder.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-remove.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-search.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-send.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-settings.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-share.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-social-user.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-social.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-sort.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-stair-drawer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-star.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-stopwatch.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-storage.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-system-back.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-system-home.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-system-windows.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-timer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-trash.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-user-menu.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-volume.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/android-wifi.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/aperture.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/archive.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-down-a.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-down-b.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-down-c.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-expand.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-graph-down-left.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-graph-down-right.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-graph-up-left.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-graph-up-right.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-left-a.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-left-b.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-left-c.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-move.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-resize.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-return-left.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-return-right.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-right-a.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-right-b.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-right-c.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-shrink.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-swap.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-up-a.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-up-b.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/arrow-up-c.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/asterisk.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/at.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/bag.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/battery-charging.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/battery-empty.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/battery-full.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/battery-half.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/battery-low.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/beaker.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/beer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/bluetooth.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/bonfire.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/bookmark.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/briefcase.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/bug.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/calculator.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/calendar.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/camera.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/card.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/cash.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/chatbox-working.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/chatbox.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/chatboxes.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/chatbubble-working.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/chatbubble.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/chatbubbles.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/checkmark-circled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/checkmark-round.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/checkmark.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/chevron-down.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/chevron-left.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/chevron-right.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/chevron-up.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/clipboard.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/clock.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/close-circled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/close-round.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/close.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/closed-captioning.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/cloud.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/code-download.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/code-working.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/code.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/coffee.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/compass.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/compose.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/connection-bars.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/contrast.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/cube.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/disc.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/document-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/document.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/drag.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/earth.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/edit.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/egg.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/eject.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/email.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/eye-disabled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/eye.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/female.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/filing.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/film-marker.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/fireball.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/flag.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/flame.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/flash-off.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/flash.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/flask.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/folder.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/fork-repo.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/fork.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/forward.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/funnel.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/game-controller-a.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/game-controller-b.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/gear-a.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/gear-b.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/grid.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/hammer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/happy.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/headphone.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/heart-broken.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/heart.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/help-buoy.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/help-circled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/help.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/home.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/icecream.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/icon-social-google-plus-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/icon-social-google-plus.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/image.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/images.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/information-circled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/information.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ionic.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-alarm-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-alarm.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-albums-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-albums.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-americanfootball-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-americanfootball.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-analytics-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-analytics.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-arrow-back.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-arrow-down.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-arrow-forward.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-arrow-left.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-arrow-right.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-arrow-thin-down.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-arrow-thin-left.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-arrow-thin-right.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-arrow-thin-up.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-arrow-up.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-at-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-at.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-barcode-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-barcode.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-baseball-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-baseball.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-basketball-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-basketball.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-bell-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-bell.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-bolt-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-bolt.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-bookmarks-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-bookmarks.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-box-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-box.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-briefcase-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-briefcase.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-browsers-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-browsers.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-calculator-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-calculator.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-calendar-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-calendar.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-camera-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-camera.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cart-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cart.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-chatboxes-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-chatboxes.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-chatbubble-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-chatbubble.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-checkmark-empty.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-checkmark-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-checkmark.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-circle-filled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-circle-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-clock-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-clock.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-close-empty.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-close-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-close.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cloud-download-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cloud-download.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cloud-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cloud-upload-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cloud-upload.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cloud.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cloudy-night-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cloudy-night.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cloudy-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cloudy.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cog-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-cog.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-compose-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-compose.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-contact-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-contact.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-copy-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-copy.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-download-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-download.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-drag.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-email-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-email.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-expand.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-eye-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-eye.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-fastforward-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-fastforward.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-filing-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-filing.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-film-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-film.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-flag-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-flag.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-folder-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-folder.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-football-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-football.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-gear-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-gear.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-glasses-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-glasses.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-heart-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-heart.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-help-empty.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-help-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-help.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-home-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-home.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-infinite-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-infinite.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-information-empty.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-information-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-information.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-ionic-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-keypad-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-keypad.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-lightbulb-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-lightbulb.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-location-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-location.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-locked-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-locked.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-loop-strong.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-loop.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-medkit-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-medkit.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-mic-off.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-mic-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-mic.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-minus-empty.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-minus-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-minus.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-monitor-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-monitor.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-moon-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-moon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-more-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-more.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-musical-note.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-musical-notes.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-navigate-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-navigate.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-paper-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-paper.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-paperplane-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-paperplane.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-partlysunny-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-partlysunny.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-pause-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-pause.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-paw-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-paw.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-people-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-people.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-person-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-person.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-personadd-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-personadd.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-photos-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-photos.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-pie-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-pie.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-play-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-play.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-plus-empty.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-plus-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-plus.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-pricetag-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-pricetag.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-pricetags-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-pricetags.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-printer-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-printer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-pulse-strong.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-pulse.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-rainy-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-rainy.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-recording-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-recording.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-redo-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-redo.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-refresh-empty.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-refresh-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-refresh.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-reload.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-reverse-camera-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-reverse-camera.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-rewind-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-rewind.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-search-strong.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-search.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-settings-strong.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-settings.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-shrink.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-skipbackward-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-skipbackward.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-skipforward-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-skipforward.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-snowy.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-speedometer-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-speedometer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-star-half.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-star-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-star.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-stopwatch-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-stopwatch.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-sunny-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-sunny.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-telephone-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-telephone.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-tennisball-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-tennisball.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-thunderstorm-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-thunderstorm.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-time-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-time.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-timer-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-timer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-toggle-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-toggle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-trash-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-trash.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-undo-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-undo.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-unlocked-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-unlocked.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-upload-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-upload.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-videocam-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-videocam.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-volume-high.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-volume-low.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-wineglass-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-wineglass.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-world-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ios7-world.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ipad.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/iphone.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ipod.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/jet.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/key.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/knife.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/laptop.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/leaf.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/levels.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/lightbulb.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/link.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/load-a.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/load-b.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/load-c.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/load-d.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/location.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/locked.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/log-in.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/log-out.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/loop.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/magnet.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/male.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/man.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/map.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/medkit.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/merge.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/mic-a.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/mic-b.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/mic-c.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/minus-circled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/minus-round.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/minus.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/model-s.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/monitor.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/more.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/mouse.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/music-note.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/navicon-round.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/navicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/navigate.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/network.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/no-smoking.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/nuclear.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/outlet.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/paper-airplane.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/paperclip.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/pause.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/person-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/person-stalker.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/person.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/pie-graph.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/pin.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/pinpoint.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/pizza.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/plane.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/planet.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/play.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/playstation.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/plus-circled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/plus-round.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/plus.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/podium.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/pound.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/power.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/pricetag.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/pricetags.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/printer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/pull-request.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/qr-scanner.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/quote.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/radio-waves.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/record.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/refresh.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/reply-all.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/reply.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ribbon-a.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/ribbon-b.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/sad.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/scissors.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/search.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/settings.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/share.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/shuffle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/skip-backward.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/skip-forward.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-android-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-android.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-apple-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-apple.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-bitcoin-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-bitcoin.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-buffer-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-buffer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-designernews-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-designernews.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-dribbble-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-dribbble.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-dropbox-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-dropbox.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-facebook-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-facebook.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-foursquare-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-foursquare.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-freebsd-devil.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-github-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-github.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-google-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-google.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-googleplus-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-googleplus.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-hackernews-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-hackernews.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-instagram-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-instagram.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-linkedin-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-linkedin.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-pinterest-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-pinterest.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-reddit-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-reddit.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-rss-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-rss.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-skype-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-skype.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-tumblr-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-tumblr.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-tux.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-twitter-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-twitter.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-usd-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-usd.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-vimeo-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-vimeo.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-windows-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-windows.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-wordpress-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-wordpress.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-yahoo-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-yahoo.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-youtube-outline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/social-youtube.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/speakerphone.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/speedometer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/spoon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/star.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/stats-bars.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/steam.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/stop.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/thermometer.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/thumbsdown.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/thumbsup.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/toggle-filled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/toggle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/trash-a.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/trash-b.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/trophy.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/umbrella.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/university.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/unlocked.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/upload.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/usb.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/videocamera.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/volume-high.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/volume-medium.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/volume-mute.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/wand.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/waterdrop.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/wifi.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/wineglass.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/woman.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/wrench.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/png/512/xbox.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/readme.md delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/scss/_ionicons-font.scss delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/scss/_ionicons-icons.scss delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/scss/_ionicons-variables.scss delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/scss/ionicons.scss delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/alert-circled.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/alert.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-add-circle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-add.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-alarm-clock.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-alert.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-apps.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-archive.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-back.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-down.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-dropdown-circle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-dropdown.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-dropleft-circle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-dropleft.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-dropright-circle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-dropright.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-dropup-circle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-dropup.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-forward.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-arrow-up.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-attach.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-bar.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-bicycle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-boat.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-bookmark.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-bulb.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-bus.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-calendar.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-call.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-camera.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-cancel.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-car.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-cart.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-chat.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-checkbox-blank.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-checkbox-outline-blank.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-checkbox-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-checkbox.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-checkmark-circle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-clipboard.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-close.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-cloud-circle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-cloud-done.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-cloud-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-cloud.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-color-palette.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-compass.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-contact.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-contacts.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-contract.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-create.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-delete.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-desktop.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-document.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-done-all.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-done.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-download.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-drafts.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-exit.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-expand.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-favorite-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-favorite.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-film.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-folder-open.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-folder.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-funnel.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-globe.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-hand.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-hangout.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-happy.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-home.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-image.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-laptop.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-list.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-locate.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-lock.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-mail.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-map.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-menu.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-microphone-off.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-microphone.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-more-horizontal.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-more-vertical.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-navigate.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-notifications-none.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-notifications-off.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-notifications.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-open.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-options.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-people.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-person-add.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-person.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-phone-landscape.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-phone-portrait.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-pin.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-plane.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-playstore.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-print.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-radio-button-off.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-radio-button-on.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-refresh.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-remove-circle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-remove.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-restaurant.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-sad.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-search.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-send.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-settings.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-share-alt.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-share.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-star-half.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-star-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-star.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-stopwatch.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-subway.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-sunny.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-sync.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-textsms.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-time.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-train.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-unlock.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-upload.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-volume-down.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-volume-mute.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-volume-off.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-volume-up.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-walk.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-warning.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-watch.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/android-wifi.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/aperture.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/archive.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-down-a.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-down-b.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-down-c.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-expand.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-graph-down-left.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-graph-down-right.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-graph-up-left.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-graph-up-right.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-left-a.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-left-b.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-left-c.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-move.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-resize.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-return-left.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-return-right.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-right-a.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-right-b.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-right-c.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-shrink.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-swap.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-up-a.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-up-b.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/arrow-up-c.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/asterisk.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/at.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/backspace-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/backspace.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/bag.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/battery-charging.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/battery-empty.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/battery-full.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/battery-half.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/battery-low.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/beaker.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/beer.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/bluetooth.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/bonfire.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/bookmark.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/bowtie.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/briefcase.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/bug.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/calculator.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/calendar.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/camera.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/card.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/cash.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/chatbox-working.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/chatbox.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/chatboxes.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/chatbubble-working.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/chatbubble.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/chatbubbles.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/checkmark-circled.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/checkmark-round.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/checkmark.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/chevron-down.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/chevron-left.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/chevron-right.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/chevron-up.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/clipboard.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/clock.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/close-circled.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/close-round.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/close.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/closed-captioning.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/cloud.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/code-download.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/code-working.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/code.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/coffee.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/compass.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/compose.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/connection-bars.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/contrast.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/crop.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/cube.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/disc.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/document-text.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/document.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/drag.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/earth.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/easel.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/edit.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/egg.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/eject.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/email-unread.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/email.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/erlenmeyer-flask-bubbles.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/erlenmeyer-flask.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/eye-disabled.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/eye.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/female.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/filing.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/film-marker.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/fireball.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/flag.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/flame.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/flash-off.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/flash.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/folder.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/fork-repo.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/fork.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/forward.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/funnel.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/gear-a.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/gear-b.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/grid.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/hammer.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/happy-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/happy.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/headphone.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/heart-broken.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/heart.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/help-buoy.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/help-circled.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/help.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/home.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/icecream.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/image.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/images.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/information-circled.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/information.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ionic.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-alarm-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-alarm.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-albums-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-albums.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-americanfootball-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-americanfootball.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-analytics-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-analytics.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-arrow-back.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-arrow-down.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-arrow-forward.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-arrow-left.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-arrow-right.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-arrow-thin-down.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-arrow-thin-left.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-arrow-thin-right.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-arrow-thin-up.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-arrow-up.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-at-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-at.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-barcode-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-barcode.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-baseball-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-baseball.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-basketball-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-basketball.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-bell-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-bell.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-body-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-body.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-bolt-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-bolt.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-book-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-book.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-bookmarks-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-bookmarks.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-box-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-box.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-briefcase-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-briefcase.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-browsers-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-browsers.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-calculator-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-calculator.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-calendar-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-calendar.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-camera-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-camera.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cart-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cart.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-chatboxes-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-chatboxes.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-chatbubble-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-chatbubble.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-checkmark-empty.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-checkmark-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-checkmark.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-circle-filled.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-circle-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-clock-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-clock.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-close-empty.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-close-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-close.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cloud-download-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cloud-download.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cloud-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cloud-upload-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cloud-upload.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cloud.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cloudy-night-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cloudy-night.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cloudy-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cloudy.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cog-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-cog.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-color-filter-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-color-filter.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-color-wand-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-color-wand.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-compose-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-compose.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-contact-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-contact.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-copy-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-copy.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-crop-strong.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-crop.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-download-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-download.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-drag.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-email-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-email.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-eye-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-eye.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-fastforward-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-fastforward.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-filing-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-filing.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-film-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-film.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-flag-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-flag.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-flame-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-flame.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-flask-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-flask.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-flower-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-flower.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-folder-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-folder.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-football-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-football.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-game-controller-a-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-game-controller-a.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-game-controller-b-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-game-controller-b.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-gear-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-gear.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-glasses-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-glasses.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-grid-view-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-grid-view.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-heart-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-heart.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-help-empty.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-help-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-help.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-home-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-home.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-infinite-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-infinite.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-information-empty.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-information-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-information.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-ionic-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-keypad-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-keypad.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-lightbulb-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-lightbulb.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-list-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-list.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-location-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-location.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-locked-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-locked.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-loop-strong.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-loop.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-medical-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-medical.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-medkit-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-medkit.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-mic-off.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-mic-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-mic.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-minus-empty.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-minus-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-minus.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-monitor-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-monitor.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-moon-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-moon.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-more-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-more.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-musical-note.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-musical-notes.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-navigate-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-navigate.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-nutrition-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-nutrition.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-paper-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-paper.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-paperplane-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-paperplane.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-partlysunny-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-partlysunny.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pause-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pause.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-paw-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-paw.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-people-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-people.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-person-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-person.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-personadd-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-personadd.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-photos-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-photos.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pie-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pie.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pint-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pint.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-play-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-play.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-plus-empty.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-plus-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-plus.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pricetag-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pricetag.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pricetags-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pricetags.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-printer-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-printer.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pulse-strong.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-pulse.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-rainy-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-rainy.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-recording-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-recording.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-redo-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-redo.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-refresh-empty.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-refresh-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-refresh.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-reload.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-reverse-camera-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-reverse-camera.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-rewind-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-rewind.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-rose-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-rose.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-search-strong.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-search.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-settings-strong.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-settings.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-shuffle-strong.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-shuffle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-skipbackward-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-skipbackward.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-skipforward-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-skipforward.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-snowy.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-speedometer-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-speedometer.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-star-half.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-star-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-star.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-stopwatch-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-stopwatch.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-sunny-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-sunny.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-telephone-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-telephone.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-tennisball-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-tennisball.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-thunderstorm-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-thunderstorm.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-time-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-time.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-timer-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-timer.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-toggle-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-toggle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-trash-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-trash.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-undo-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-undo.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-unlocked-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-unlocked.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-upload-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-upload.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-videocam-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-videocam.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-volume-high.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-volume-low.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-wineglass-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-wineglass.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-world-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ios-world.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ipad.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/iphone.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ipod.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/jet.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/key.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/knife.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/laptop.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/leaf.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/levels.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/lightbulb.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/link.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/load-a.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/load-b.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/load-c.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/load-d.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/location.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/lock-combination.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/locked.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/log-in.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/log-out.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/loop.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/magnet.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/male.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/man.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/map.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/medkit.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/merge.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/mic-a.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/mic-b.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/mic-c.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/minus-circled.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/minus-round.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/minus.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/model-s.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/monitor.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/more.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/mouse.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/music-note.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/navicon-round.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/navicon.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/navigate.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/network.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/no-smoking.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/nuclear.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/outlet.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/paintbrush.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/paintbucket.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/paper-airplane.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/paperclip.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/pause.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/person-add.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/person-stalker.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/person.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/pie-graph.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/pin.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/pinpoint.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/pizza.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/plane.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/planet.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/play.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/playstation.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/plus-circled.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/plus-round.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/plus.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/podium.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/pound.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/power.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/pricetag.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/pricetags.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/printer.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/pull-request.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/qr-scanner.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/quote.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/radio-waves.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/record.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/refresh.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/reply-all.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/reply.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ribbon-a.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/ribbon-b.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/sad-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/sad.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/scissors.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/search.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/settings.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/share.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/shuffle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/skip-backward.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/skip-forward.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-android-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-android.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-angular-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-angular.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-apple-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-apple.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-bitcoin-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-bitcoin.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-buffer-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-buffer.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-chrome-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-chrome.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-codepen-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-codepen.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-css3-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-css3.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-designernews-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-designernews.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-dribbble-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-dribbble.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-dropbox-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-dropbox.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-euro-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-euro.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-facebook-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-facebook.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-foursquare-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-foursquare.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-freebsd-devil.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-github-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-github.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-google-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-google.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-googleplus-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-googleplus.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-hackernews-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-hackernews.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-html5-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-html5.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-instagram-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-instagram.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-javascript-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-javascript.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-linkedin-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-linkedin.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-markdown.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-nodejs.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-octocat.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-pinterest-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-pinterest.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-python.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-reddit-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-reddit.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-rss-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-rss.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-sass.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-skype-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-skype.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-snapchat-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-snapchat.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-tumblr-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-tumblr.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-tux.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-twitch-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-twitch.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-twitter-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-twitter.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-usd-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-usd.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-vimeo-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-vimeo.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-whatsapp-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-whatsapp.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-windows-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-windows.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-wordpress-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-wordpress.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-yahoo-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-yahoo.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-yen-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-yen.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-youtube-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/social-youtube.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/soup-can-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/soup-can.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/speakerphone.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/speedometer.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/spoon.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/star.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/stats-bars.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/steam.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/stop.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/thermometer.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/thumbsdown.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/thumbsup.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/toggle-filled.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/toggle.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/transgender.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/trash-a.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/trash-b.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/trophy.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/tshirt-outline.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/tshirt.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/umbrella.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/university.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/unlocked.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/upload.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/usb.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/videocamera.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/volume-high.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/volume-low.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/volume-medium.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/volume-mute.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/wand.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/waterdrop.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/wifi.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/wineglass.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/woman.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/wrench.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/ionicons-2.0.1/src/xbox.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/css/images/blank.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/css/scribble.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/css/slider.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/css/spacegallery.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/area_chart.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/bar_chart.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/d3_gauges_demo.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/data/speedometer2.csv delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/data/speedometer3.csv delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/data/worddata.csv delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/donut_d3.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/js/area_chart.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/js/donut.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/js/gauges.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/js/line_chart.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/js/pie_chart.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/js/worddata.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/line_chart.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/pie_chart.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/html/wordcloud.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/Calendar-16x16.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/arrow-next.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/arrow-prev.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/carousel/slide_b_drive_test_map.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/carousel/slide_b_eppt_county.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/carousel/slide_b_eppt_regression.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/carousel/slide_b_ios_throughput.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/carousel/slide_b_lata_map.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/carousel/slide_b_lata_map_legend.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/carousel/slide_b_nova_sdn_map.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/copyicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/deleteicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/example-frame.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/loading.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/1_mon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/2_tue.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/3_wed.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/4_thu.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/5_fri.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/6_sat.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/7_sun.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/BH_DLSTX_IN.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/BH_DLSTX_OUT.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/BH_Nat.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/BH_Nat_Def.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/images/tunnels/BH_Nat_Priority.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/js/FusionCharts.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/js/charts.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/js/scribble.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/js/slides.min.jquery.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/js/spacegallery.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/org_chart/css/bootstrap.min.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/org_chart/css/custom.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/org_chart/css/jquery.jOrgChart.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/org_chart/css/prettify.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/org_chart/example.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/org_chart/example_vsp.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/org_chart/images/bkgd.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/org_chart/images/raspberry.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/org_chart/jquery.jOrgChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/samples/org_chart/prettify.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/external/utils/js/browserCheck.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/Rlogo.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/Thumbs.db delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/action_icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/action_list_spacer.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/active.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/add_tool_button.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/addicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/application_window_bg.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/arrow-next.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/arrow-prev.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/att_angular_gridster/grips.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/backButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/blank.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/blueButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/body_graphic.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/bubble.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/cache.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/calendar.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/chevron.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/close_container.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/collapsed-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/column-bg.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/copyicon-highlighted.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/copyicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/csv_icon.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/csv_icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/customers-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/customers-search.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/customers.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/decrypted.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/deleteicon-highlighted.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/deleteicon-highlighted.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/deleteicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/editicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/error_type.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/example-frame.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/excelicon_multi.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/executeicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/expanded-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/file-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/file_import.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/file_save-all.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/filter_icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/folder_add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/folder_closed.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/folder_delete.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/folder_edit.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/folder_open.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/folder_user.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/funnel.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/fusion.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/grayButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/gray_add_tool_button.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/headerChatIcon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/icon_remove_all.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/inactive.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/info_type.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/layout/panel-e-w-toggle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/layout/panel-n-s-toggle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/leftButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/loading.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/loading_bar.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/login_button.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/m1.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/mail.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/map.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/menu/bubble.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/menu/file_import.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/menu/file_save-all.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/menu/mail.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/menu/profile.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/menu/speechbubble.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/menu/users.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/minus.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/mobile_logo_att_header_black.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/mobile_logo_att_header_grey.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/mobile_logo_att_header_horizontal.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/mobile_logo_att_header_white.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/modify_icon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/note-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/note-search.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/note.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/notes.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/offline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/offlineMsg.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/online.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/page.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/pagination.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/panel-e-w-toggle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/panel-n-s-toggle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/pix.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/plus.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/printer.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/profile.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/report-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/report-favorite.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/report-my.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/report-public.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/report.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/reports.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/results-first-active.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/results-first-disabled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/results-last-active.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/results-last-disabled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/results-next-active.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/results-next-disabled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/results-prev-active.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/results-prev-disabled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/resultset_last.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/resultset_previous.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/return_to_top.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/rightButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/search.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/search_profile.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/sort_asc.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/sort_desc.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/spacer.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/success_type.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/swoosh.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/tab-hm.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/tab-v-hm.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/tab.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/table-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/table-delete.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/table-edit.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/table.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/tabs-bg.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/toolButton.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/toolButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/toolbar.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/users.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/warning_type.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/webphone.ico delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/images/whiteButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/controllers/nbook-framecontroller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/controllers/nbookController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/controllers/notebookFrameController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/dependency/angular.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebook-frame.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebook-viz.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebook.htm delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebookInputs.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/att_angular_gridster/angular-gridster.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/att_angular_gridster/ui-gridster-tpls.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/adminController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/admin_menu_edit.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/ase-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/broadcast-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/broadcast-list-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/collaborate-list-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/fn_menu_add_popup_controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/jcs-admin-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/modelpopupController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/post-search-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profile-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profile-search-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profileController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-function-list-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-list-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/rolefunctionpopupController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/rolepopupmodelController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/self-profile-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/usage-list-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowApp.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowRouting.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/footer.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/header.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/leftMenu.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/jquery.resize.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/debug.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/jquery-latest.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/jquery-ui-latest.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/jquery.layout-latest.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/modalService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/moment.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/services/adminService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/services/headerService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/services/leftMenuService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/services/profileService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/services/userInfoService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/socket/peerBroadcast.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/page-resource.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/sandbox-resources.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/admin-page/admin.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/admin-page/profile.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/footer.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/header.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/left_menu.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/admin_menu_edit.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/broadcast.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/broadcast_list.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/collaborate_list.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/jcs_admin.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_fn_menu_add.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_fn_menu_edit.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_role.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_rolefunction.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/post_search.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/profile_detail.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/profile_search.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role_function_list.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role_list.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/self_profile.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/usage_list.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-landing.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-listing.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-new.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-preview.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-remove.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-schedule.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/webrtc/RTCMultiConnection.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/scripts/webrtc/getSourceId.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/styles/att_angular_gridster/sandbox-gridster.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/styles/att_angular_gridster/ui-gridster.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/styles/fusion-sunny.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/styles/jquery-ui.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/styles/layout/layout-default-latest.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusion/styles/workflows/workflows.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/drools-list-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/drools-view-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/droolsController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/directives/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/services/droolsService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/utils/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsList.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsSinglePage.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsView.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/external/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/fonts/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7450-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7450-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7750-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7750-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/apn-dns-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/apn-dns-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atcf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atcf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atgw-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atgw-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/bgcf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/bgcf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/com-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/cpm-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/cpm-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/default-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-epc-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-epc-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-ims-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-ims-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dslam-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dslam-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/eatf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/eatf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ecscf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ecscf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/emsc-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enb-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enb-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enum-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enum-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/esmlc-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/esmlc-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ettcs-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ettcs-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/gmlc-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/gmlc-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hlr-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hlr-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-epc-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-epc-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-ims-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-ims-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/icscf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/icscf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ipag-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ipag-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/isbc-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/isbc-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/iwf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/iwf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrf-rdf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrf-rdf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrg-rdf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgc8-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgc8-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgcf-emsc-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgcf-emsc-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgw-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgw-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mind-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mind-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mme-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mme-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mrf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mrf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msc-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msn-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msn-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/multi-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7450-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7450-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750a-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750a-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750b-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750b-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750c-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750c-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750d-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750d-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/nb-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/nb-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pas-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pas-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcef-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcef-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcrf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcrf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcscf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcscf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pgw-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pgw-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/plrf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/plrf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/psap-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pstn-tdm-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pstn-tdm-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rg-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rg-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rnc-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rnc-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sbc-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sbc-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sccas-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sccas-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/scscf-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/scscf-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sdg-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sdg-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgsns4-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgsns4-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgw-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgw-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/siad-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/siad-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7-gport-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7-gport-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7gport-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7gport-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/switch-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/tas-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/tas-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/transcoder-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/transcoder-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ue-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/uephone-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/usp-dns-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/usp-dns-text.png delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/images/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sample-page-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sample-page-iframe-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sampleController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/directives/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/utils/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/sample.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/sampleWithIframe.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/singlePageSample.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/fusionapp/styles/dummy.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-csp.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-ui-notification.min.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-ui-notification.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/bootstrap.min.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/bootstrap.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/select.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/select.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/w3.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/JSONDataFiles/JSONConfig.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Properties/config.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/ActionPolicyDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/AttributeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/BRMSParamDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLPepOptionsDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLServiceTypeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLSiteDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVarbindDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVnfTypeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVsclActionDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/DecisionSettingsDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/DescriptiveScopeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/EcompNameDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/EnforcerTypeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWActionListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWAddressGroupDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWParentListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWPortListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWPrefixListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWProtocolListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWSecurityZoneDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWServiceGroupDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWServiceListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWTermListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWZoneDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSConfigNameDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSDCAEUUIDDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSLocationDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSModelsDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSClosedLoopDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSGroupPolicyScopeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSResourceDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSServiceDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSTypeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/RiskTypeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/SafePolicyWarningDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Edit_Roles_Window.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PDPTabWindows/AddorEditPDPtoGroup.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PDPTabWindows/PdpStatusWindow.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PushtabWindow/removeGroupPoliciesWindow.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/new_PDPGroup_Window.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/AutoPushController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/AutoPushTabController/RemovePDPGroupPoliciesController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/DictionaryController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/FileSaver.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/ImportDictionaryController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PDPTabController/AddorEditPdpInGroup.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PDPTabController/PDPGroupStatusController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PolicyAddScopeRoleController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PolicyRolesController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dashboardController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dashboard_Logging_Controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLPepOptionsDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLServiceDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLSiteDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVarbindDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVnfTypeDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVsclActionDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/DecisionSettingsDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/DescriptiveSearchDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/EnforcerDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWActionListDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWAddressGroupDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWParentListDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWPortListDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWPrefixListDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWProtocolListDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceGroupDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceListDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWTermListDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWZoneDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSConfigNameDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSDcaeUUIDDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSLocationDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSClosedLoopDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSGroupPolicyScopeDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSResourceDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSServiceDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSTypeDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/RiskTypeDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/SafePolicyWarningDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/actionPolicyDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/attributeDictController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/ecompNameEditorController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSParamDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLPepOptionsDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLServiceDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLSiteDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVarbindDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVnfTypeDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVsclActionDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/DecisionSettingsDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/DescriptiveScopeDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/EnforcerTypeDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWActionListDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWAddressGroupDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWParentListDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWPortListDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWPrefixListDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWProtocolListDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWSecurityZoneDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWServiceGroupDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWServiceListDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTermListDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWZoneDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSConfigNameDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSDcaeUUIDDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSLocationDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSModelDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSClosedLoopDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSGroupPolicyScopeDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSResourceDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSServiceDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSTypeDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/RiskTypeDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/SafePolicyWarningDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/actionPolicyDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/attributeDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/ecompNameDictGridController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/editorTabController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/pdpController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/pdpGroupPopUpController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/policyAdminTabController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/controller/policyController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/images/loading.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/images/loading_bar.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/README.md delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/.bower.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/README.md delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/bower.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/index.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/package.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-translate/angular-translate.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/.bower.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/README.md delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular-csp.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular.min.js.gzip delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular.min.js.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/bower.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/index.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/package.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/bootstrap/dist/css/bootstrap.min.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/bootstrap/dist/js/bootstrap.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/bootswatch/fonts/glyphicons-halflings-regular.eot delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/bootswatch/fonts/glyphicons-halflings-regular.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/bootswatch/fonts/glyphicons-halflings-regular.ttf delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/bootswatch/fonts/glyphicons-halflings-regular.woff delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/bootswatch/fonts/glyphicons-halflings-regular.woff2 delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/bootswatch/paper/bootstrap.min.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/.bower.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/MIT-LICENSE.txt delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/bower.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/dist/jquery.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/dist/jquery.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/dist/jquery.min.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/ajax.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/ajax/jsonp.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/ajax/load.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/ajax/parseJSON.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/ajax/parseXML.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/ajax/script.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/ajax/var/nonce.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/ajax/var/rquery.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/ajax/xhr.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/attributes.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/attributes/attr.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/attributes/classes.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/attributes/prop.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/attributes/support.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/attributes/val.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/callbacks.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/core.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/core/access.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/core/init.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/core/parseHTML.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/core/ready.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/core/var/rsingleTag.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/addGetHookIf.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/curCSS.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/defaultDisplay.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/hiddenVisibleSelectors.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/support.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/swap.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/var/cssExpand.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/var/getStyles.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/var/isHidden.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/var/rmargin.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/css/var/rnumnonpx.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/data.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/data/Data.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/data/accepts.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/data/var/data_priv.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/data/var/data_user.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/deferred.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/deprecated.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/dimensions.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/effects.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/effects/Tween.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/effects/animatedSelector.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/event.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/event/ajax.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/event/alias.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/event/support.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/exports/amd.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/exports/global.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/intro.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/jquery.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/manipulation.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/manipulation/_evalUrl.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/manipulation/support.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/manipulation/var/rcheckableType.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/offset.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/outro.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/queue.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/queue/delay.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/selector-native.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/selector-sizzle.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/selector.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/serialize.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/sizzle/dist/sizzle.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/sizzle/dist/sizzle.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/sizzle/dist/sizzle.min.map delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/traversing.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/traversing/findFilter.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/traversing/var/rneedsContext.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/arr.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/class2type.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/concat.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/hasOwn.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/indexOf.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/pnum.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/push.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/rnotwhite.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/slice.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/strundefined.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/support.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/var/toString.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/jquery/src/wrap.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/ng-file-upload/ng-file-upload.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/html2canvas.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/jquery.base64.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/jspdf/jspdf.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/jspdf/libs/base64.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/jspdf/libs/sprintf.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/jspdf/pdfmake.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/tableExport.jquery.json delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/libs/tableExport.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/main/policy_Editor.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/ActionPolicyDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/AttributeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/BRMSParamDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/CLPepOptionsDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/CLServiceDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/CLSiteDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/CLVNFTypeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/CLVSCLActionDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/CLVarbindDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/DecisionSettingsDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/DescriptiveScopeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/EcompNameDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/EnforcerTypeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWActionLisdtDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWActionListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWAddressGroupDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWParentListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWPortListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWPrefixListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWProtocolListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWSecurityZoneDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWServiceGroupDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWServiceListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWTermListDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/FWZoneDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/MSConfigNameDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/MSDcaeUUIDDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/MSLocationDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/MSModelDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/PSClosedLoopDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/PSGroupPolicyScopeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/PSResourceDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/PSServiceDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/PSTypeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/RiskTypeDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Dictionary/SafePolicyWarningDictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ActionPolicyController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSParamPolicyController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSRawPolicyController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BaseConfigPolicyController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopPMController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ExportPolicyController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/FirewallPolicyController.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/PolicyDictionaryService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ActionPolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BRMSParamPolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BRMSRawPolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/BasePolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ClosedLoopFaultPolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ClosedLoopPMPolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DCAEMicroServicePolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DecisionPolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DescribePolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ExportPolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/FirewallPolicyTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/PolicyTypeTemplate.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/css/normalize-legacy.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/css/normalize.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/css/styles.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/css/animations.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/css/dialogs.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/css/main.css delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/app.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/controllers/main.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/controllers/selector-controller.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/directives/directives.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/entities/item.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/filters/filters.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/providers/config.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/providers/translations.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/services/RolesService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/services/filenavigator.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/js/services/fileuploader.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/current-folder-breadcrumb.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/item-context-menu.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/item-toolbar.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/main-icons.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/main-table-modal.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/main-table.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/main.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/modals.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/navbar.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/sidebar.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/Editor/src/templates/spinner.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/policy_AdminTab.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/policy_AutoPush.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/policy_DashboardHealth.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/policy_DashboardLogging.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/policy_Dictionary.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/policy_PDPManagement.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/policy-models/policy_Roles.html delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/AdminTabService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/AutoPushService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/ClosedLoopPMService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/DashboardService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/Dictionary/CLDictionaryService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/Dictionary/DictionaryService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/Dictionary/FWDictionaryService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/Dictionary/MSDictionaryService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/Dictionary/PolicyScopeService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/Dictionary/SafePolicyService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/ExportPolicyService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/PDPService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/PapUrlService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/app/policyApp/service/RolesTabService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/index.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/manifest.jsp delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/css/att_angular_gridster/sandbox-gridster.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/css/att_angular_gridster/ui-gridster.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/css/fusion-sunny.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/css/jquery-ui.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/css/layout/layout-default-latest.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/css/nv.d3.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/cie.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/colorbrewer.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/core.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/crossfilter.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/crossfilter.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/d3.geom.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/d3.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/d3.layout.cloud.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/d3.layout.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/d3.v2.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/d3.v2.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/d3.v3.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/fisheye.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/hive.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/horizon.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/interactiveLayer.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/intro.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/axis-min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/axis.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/axis.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/backup/bullet.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/backup/bulletChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/boilerplate.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/bullet.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/bulletChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/cumulativeLineChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/discreteBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/discreteBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/distribution.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/historicalBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/historicalBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/indentedTree.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/legend.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/line.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/lineChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/linePlusBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/linePlusBarWithFocusChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/lineWithFisheye.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/lineWithFisheyeChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/lineWithFocusChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/multiBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/multiBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/multiBarHorizontal.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/multiBarHorizontalChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/multiBarTimeSeries.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/multiBarTimeSeriesChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/multiChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/ohlcBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/parallelCoordinates.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/pie.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/pieChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/scatter.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/scatterChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/scatterPlusLineChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/sparkline.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/sparklinePlus.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/stackedArea.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/models/stackedAreaChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/nv.d3.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/nv.d3.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/outro.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/sankey.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/tooltip.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/d3/js/utils.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/Logo_att_labs.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/Rlogo.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/Thumbs.db delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/action_icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/action_list_spacer.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/active.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/add_tool_button.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/addicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/application_window_bg.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/arrow-next.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/arrow-prev.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/att_angular_gridster/grips.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/backButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/blank.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/blueButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/bubble.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/cache.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/calendar.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/chevron.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/close_container.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/collapsed-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/column-bg.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/copyicon-highlighted.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/copyicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/csv_icon.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/csv_icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/customers-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/customers-search.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/customers.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/decrypted.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/deleteicon-highlighted.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/deleteicon-highlighted.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/deleteicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/ecomp.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/ecomp_trans.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/editicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/error_type.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/example-frame.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/excelicon_multi.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/executeicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/expanded-icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/file-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/file_import.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/file_save-all.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/filter_icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/folder_add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/folder_closed.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/folder_delete.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/folder_edit.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/folder_open.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/folder_user.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/funnel.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/fusion.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/grayButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/gray_add_tool_button.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/headerChatIcon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/icon_remove_all.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/inactive.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/info_type.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/layout/panel-e-w-toggle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/layout/panel-n-s-toggle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/leftButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/loading.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/loading_bar.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/login_button.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/logo_att.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/logo_att_header.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/logo_att_header.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/logo_header.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/m1.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/mail.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/map.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/menu/bubble.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/menu/file_import.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/menu/file_save-all.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/menu/mail.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/menu/profile.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/menu/speechbubble.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/menu/users.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/minus.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/mobile_logo_att_header_black.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/mobile_logo_att_header_grey.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/mobile_logo_att_header_horizontal.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/mobile_logo_att_header_white.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/modify_icon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/no_favorites_star.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/note-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/note-search.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/note.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/notes.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/offline.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/offlineMsg.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/online.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/page.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/pagination.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/panel-e-w-toggle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/panel-n-s-toggle.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/pix.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/plus.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/printer.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/profile.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/report-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/report-favorite.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/report-my.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/report-public.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/report.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/reports.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/results-first-active.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/results-first-disabled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/results-last-active.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/results-last-disabled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/results-next-active.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/results-next-disabled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/results-prev-active.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/results-prev-disabled.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/resultset_last.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/resultset_previous.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/return_to_top.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/rightButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/search.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/search_profile.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/sort_asc.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/sort_desc.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/spacer.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/success_type.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/swoosh.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/tab-hm.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/tab-v-hm.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/tab.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/table-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/table-delete.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/table-edit.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/table.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/tabs-bg.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/toolButton.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/toolButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/toolbar.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/users.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/warning_type.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/webphone.ico delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/images/whiteButton.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/js/att_angular_gridster/angular-gridster.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/js/att_angular_gridster/ui-gridster-tpls.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/js/jquery.resize.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/js/layout/debug.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/js/layout/jquery-latest.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/js/layout/jquery-ui-latest.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/js/layout/jquery.layout-latest.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/js/moment.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/Style.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/bd_quantum_raptor.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/calendar.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/dashboard.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/drupal.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/form-field-tooltip.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/mobile_raptor.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/novamap.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/picker.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/ral.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/raptor.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/css/tree/context-menu.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/css/nv.d3.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/cie.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/colorbrewer.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/core.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/crossfilter.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/crossfilter.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/d3.geom.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/d3.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/d3.layout.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/d3.v2.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/d3.v2.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/d3.v3.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/d3.v3.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/fisheye.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/hive.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/horizon.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/interactiveLayer.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/intro.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/axis-min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/axis.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/axis.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/boilerplate.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/bullet.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/bulletChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/cumulativeLineChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/discreteBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/discreteBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/distribution.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/historicalBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/historicalBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/indentedTree.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/legend.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/line.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/lineChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/linePlusBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/linePlusBarWithFocusChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/lineWithFisheye.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/lineWithFisheyeChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/lineWithFocusChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/multiBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/multiBarChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/multiBarHorizontal.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/multiBarHorizontalChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/multiBarTimeSeries.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/multiBarTimeSeriesChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/multiChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/ohlcBar.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/parallelCoordinates.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/pie.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/pie.js.bak delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/pieChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/scatter.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/scatterChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/scatterPlusLineChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/sparkline.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/sparklinePlus.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/stackedArea.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/models/stackedAreaChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/nv.d3.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/outro.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/sankey.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/tooltip.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/d3/js/utils.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dashed-canvas.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/data.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-canvas.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-combined.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-combined_bak_color.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-dev.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-externs.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-gviz.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-interaction-model.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-layout.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-options-reference.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-options.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-plugin-base.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-plugin-install.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-tickers.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph-utils.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/dygraph.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/excanvas.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/interaction.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/interaction.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/interaction_sun.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/moment.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/phantom-driver.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/phantom-perf.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/plugins/README delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/plugins/annotations.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/plugins/axes.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/plugins/chart-labels.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/plugins/grid.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/plugins/legend.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/plugins/range-selector.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/rgbcolor/rgbcolor.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/stacktrace.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/strftime/Doxyfile delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/strftime/strftime-min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/dy3/js/strftime/strftime.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/date_time_picker.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/date_time_picker.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/dynamicform.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/moment.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/multiselect.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/quick_links.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/report_chart_wizard.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/report_chart_wizard.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/report_run.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/report_run.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/report_search.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/ebz/report_search.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/RAPTOR_BANNER.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/accessicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/active.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/addbtn.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/ajax-loader.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_add.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_add_edge.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_add_multiple.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_add_one.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_back.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_cancel.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_left.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_left2.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_next.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_plus.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_reorder_all.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_reorder_all.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_right.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_right2.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/arrow_save.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/button_import.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/calendar_icon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/calendar_icon_nav.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/calendar_icon_nav1.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/calender_icon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/columnblankdown.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/columnblankup.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/columndown.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/columnup.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/crosshairs.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/csv_icon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/deleteicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/downloadicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/excel2007.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/excel2007.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/excelicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/excelicon_multi.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/green-arrow-right.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/green-arrow.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/grnarrowdn.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/grnarrowup.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/h.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/inactive.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/loader.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/loading.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/lookup_arrow.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/maps/blue.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/maps/green.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/maps/lightblue.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/maps/map_iphone.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/maps/orange.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/maps/pink.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/maps/purple.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/maps/red.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/maps/yellow.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/minus.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/modify_icon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/page.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/pdficon_large.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/pdficon_small.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/pen_paper.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/plus.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/popupicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/position.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/printer.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/progress.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/question_mark.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/quickhelp_dk.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/quickhelp_lt.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/r_back.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/raptor.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/raptor_logo.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/raptor_logo.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/required.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/shareicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/sv.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tab_left.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tab_left_sel.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tab_right.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tab_right_sel.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/test_run.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/text.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/context-menu-gradient.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/dhtmlgoodies_folder.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/dhtmlgoodies_minus.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/dhtmlgoodies_plus.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/dhtmlgoodies_sheet.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/dhtmlgoodies_sheet_crosstab.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/dhtmlgoodies_sheet_dashboard.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/dhtmlgoodies_sheet_graph.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/dragDrop_ind1.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/dragDrop_ind2.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/folder_close.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/folder_dots.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/folder_folder.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/folder_lastsub.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/folder_open.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/folder_sub.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/grnarrowleft.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/tree/grnarrowright.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/txt_icon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/uF033.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/uF034.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/uF035.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/images/uF036.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/BorderLayout-24x24.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/Calendar-16x16.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/DeleteCross-16x16.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/addbtn.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/button_import.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/copyicon-highlighted.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/copyicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/cross-small.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/csv_icon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/csv_icon.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/csv_icon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/deleteicon-highlighted.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/deleteicon-highlighted.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/deleteicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/downloadicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/editicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/excel2007.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/excelicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/excelicon_multi.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/executeicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/file_import.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/pdficon_small.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/pen_paper.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/pencil-small.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/report-add.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/report-favorite.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/report-my.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/report-public.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/report.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/reports.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/search.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/search.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/img/tick-small.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/CalendarPopup.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/ajax.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/ajax_dynamic_content.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/cingular_button.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/drupal.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/editabledropdown.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/form-field-tooltip.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/gmap.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/jquery.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/jquery.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/label_quantum.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/nova_button.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/other_scripts.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/persist_table_header.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/prototype-1.6.0.3.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/raptor.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/rounded-corners.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/script.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/tree/ajax.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/uigrid/ui-grid.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/uigrid/ui-grid.eot delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/uigrid/ui-grid.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/uigrid/ui-grid.svg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/uigrid/ui-grid.ttf delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/raptor/uigrid/ui-grid.woff delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/css/images/blank.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/css/scribble.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/css/slider.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/css/spacegallery.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/css/welcome.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/area_chart.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/bar_chart.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/d3_gauges_demo.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/data/speedometer2.csv delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/data/speedometer3.csv delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/data/worddata.csv delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/donut_d3.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/js/area_chart.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/js/donut.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/js/gauges.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/js/line_chart.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/js/pie_chart.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/js/worddata.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/line_chart.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/pie_chart.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/html/wordcloud.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/Calendar-16x16.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/arrow-next.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/arrow-prev.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/carousel/slide_b_drive_test_map.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/carousel/slide_b_eppt_county.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/carousel/slide_b_eppt_regression.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/carousel/slide_b_ios_throughput.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/carousel/slide_b_lata_map.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/carousel/slide_b_lata_map_legend.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/carousel/slide_b_nova_sdn_map.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/copyicon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/deleteicon.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/example-frame.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/loading.gif delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/1_mon.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/2_tue.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/3_wed.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/4_thu.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/5_fri.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/6_sat.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/7_sun.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/BH_DLSTX_IN.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/BH_DLSTX_OUT.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/BH_Nat.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/BH_Nat_Def.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/images/tunnels/BH_Nat_Priority.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/FusionCharts.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/charts.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/jquery.flexslider-min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/scribble.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/slides.min.jquery.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/js/spacegallery.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/org_chart/css/bootstrap.min.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/org_chart/css/custom.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/org_chart/css/jquery.jOrgChart.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/org_chart/css/prettify.css delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/org_chart/example.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/org_chart/example_vsp.html delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/org_chart/images/bkgd.png delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/org_chart/images/raspberry.jpg delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/org_chart/jquery.jOrgChart.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/fusion/sample/org_chart/prettify.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/js/jquery-1.10.2.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/js/jquery-ui.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/js/jquery.mask.min.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/js/modalService.js delete mode 100644 ecomp-sdk-app/src/main/webapp/static/js/search.js delete mode 100644 ecomp-sdk-app/src/test/java/org/openecomp/portalapp/SanityTest.java delete mode 100644 ecomp-sdk-app/src/test/java/org/openecomp/portalapp/controller/CollaborationControllerTest.java delete mode 100644 ecomp-sdk-app/src/test/java/org/openecomp/portalapp/controller/NetMapTest.java delete mode 100644 ecomp-sdk-app/src/test/java/org/openecomp/portalapp/service/ProfileServiceTest.java delete mode 100644 ecomp-sdk-app/src/test/java/org/openecomp/portalsdk/core/MockApplicationContextTestSuite.java delete mode 100644 ecomp-sdk-app/src/test/java/org/openecomp/portalsdk/workflow/services/WorkflowScheduleServiceTest.java (limited to 'ecomp-sdk-app/src') diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressGroupJson.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressGroupJson.java deleted file mode 100644 index e60e4061e..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressGroupJson.java +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -import java.util.ArrayList; -import java.util.List; - -public class AddressGroupJson { - - protected String name; - protected String description; - protected List members; - - // name - public String getName() { - return name; - } - - public void setName(String value) { - this.name = value; - } - - public boolean equals(Object obj) - { - AddressGroupJson servGroupobj=(AddressGroupJson) obj; - if(this.getName().equals(servGroupobj.getName())) - { - return true; - } - return false; - } - - public int hashCode() { - return Integer.valueOf(name.charAt(0)+(name.charAt(1))); - } - - // description - public String getDescription() { - return description; - } - - public void setDescription(String value) { - this.description = value; - } - - public List getMembers() - { - if(members==null) - { - members= new ArrayList(); - } - return this.members; - } - - public void setMembers(List members) - { - this.members = members; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressJson.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressJson.java deleted file mode 100644 index 372eddf1b..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressJson.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -public class AddressJson { - - protected String type; - protected String value; - // type - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressMembers.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressMembers.java deleted file mode 100644 index 3fd22eec6..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AddressMembers.java +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - - -public class AddressMembers { - - protected String type; - protected String value; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AutoPushTabAdapter.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AutoPushTabAdapter.java deleted file mode 100644 index 85f767f26..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/AutoPushTabAdapter.java +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -import java.util.ArrayList; - -public class AutoPushTabAdapter { - - private ArrayList pdpDatas; - private ArrayList policyDatas; - public ArrayList getPdpDatas() { - return pdpDatas; - } - public void setPdpDatas(ArrayList pdpDatas) { - this.pdpDatas = pdpDatas; - } - public ArrayList getPolicyDatas() { - return policyDatas; - } - public void setPolicyDatas(ArrayList policyDatas) { - this.policyDatas = policyDatas; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopFaultBody.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopFaultBody.java deleted file mode 100644 index cb1ce55a6..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopFaultBody.java +++ /dev/null @@ -1,280 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - - -public class ClosedLoopFaultBody { - - private boolean trinity; - private boolean vUSP; - private boolean mcr; - private boolean gama; - private boolean vDNS; - - private String vnfType; - private String vServices; - private String ECOMPname; - - private String closedLoopPolicyStatus; - private ClosedLoopSignatures triggerSignatures; - private String actions; - private int timeInterval; - private int timeOutvPRO; - private int timeOutRuby; - private int retrys; - private int agingWindow; - private String geoLink; - private String emailAddress; - private ClosedLoopSignatures verificationSignatures; - private ClosedLoopPolicyConditions conditions; - private ClosedLoopFaultTriggerUISignatures triggerSignaturesUsedForUI; - private ClosedLoopFaultTriggerUISignatures verificationSignaturesUsedForUI; - private int triggerTimeWindowUsedForUI; - private int verfificationTimeWindowUsedForUI; - private String pepName; - private String pepAction; - private String templateVersion; - private int trapMaxAgeUsedForUI; - - - public Integer getTrapMaxAgeUsedForUI() { - return trapMaxAgeUsedForUI; - } - - public void setTrapMaxAgeUsedForUI(int trapMaxAgeUsedForUI) { - this.trapMaxAgeUsedForUI = trapMaxAgeUsedForUI; - } - - public String getTemplateVersion() { - return templateVersion; - } - - public void setTemplateVersion(String templateVersion) { - this.templateVersion = templateVersion; - } - - public Integer getTimeOutvPRO() { - return timeOutvPRO; - } - - public void setTimeOutvPRO(int timeOutvPRO) { - this.timeOutvPRO = timeOutvPRO; - } - - - public Integer getTriggerTimeWindowUsedForUI() { - return triggerTimeWindowUsedForUI; - } - - public String getPepName() { - return pepName; - } - - public void setPepName(String pepName) { - this.pepName = pepName; - } - - public String getPepAction() { - return pepAction; - } - - public void setPepAction(String pepAction) { - this.pepAction = pepAction; - } - - public void setTriggerTimeWindowUsedForUI(int triggerTimeWindowUsedForUI) { - this.triggerTimeWindowUsedForUI = triggerTimeWindowUsedForUI; - } - - public Integer getVerfificationTimeWindowUsedForUI() { - return verfificationTimeWindowUsedForUI; - } - - public void setVerfificationTimeWindowUsedForUI( - int verfificationTimeWindowUsedForUI) { - this.verfificationTimeWindowUsedForUI = verfificationTimeWindowUsedForUI; - } - - public String getECOMPname(){ - return ECOMPname; - } - - public void setECOMPname(String ECOMPname){ - this.ECOMPname = ECOMPname; - } - - public String getvServices() { - return vServices; - } - public void setvServices(String vServices) { - this.vServices = vServices; - } - - public ClosedLoopFaultTriggerUISignatures getVerificationSignaturesUsedForUI() { - return verificationSignaturesUsedForUI; - } - public void setVerificationSignaturesUsedForUI( - ClosedLoopFaultTriggerUISignatures verificationSignaturesUsedForUI) { - this.verificationSignaturesUsedForUI = verificationSignaturesUsedForUI; - } - public ClosedLoopFaultTriggerUISignatures getTriggerSignaturesUsedForUI() { - return triggerSignaturesUsedForUI; - } - public void setTriggerSignaturesUsedForUI( - ClosedLoopFaultTriggerUISignatures triggerSignaturesUsedForUI) { - this.triggerSignaturesUsedForUI = triggerSignaturesUsedForUI; - } - public ClosedLoopPolicyConditions getConditions() { - return conditions; - } - public void setConditions(ClosedLoopPolicyConditions conditions) { - this.conditions = conditions; - } - - public String getVnfType() { - return vnfType; - } - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public Integer getAgingWindow() { - return agingWindow; - } - public void setAgingWindow(int agingWindow) { - this.agingWindow = agingWindow; - } - - public String getClosedLoopPolicyStatus() { - return closedLoopPolicyStatus; - } - public void setClosedLoopPolicyStatus( - String closedLoopPolicyStatus) { - this.closedLoopPolicyStatus = closedLoopPolicyStatus; - } - public ClosedLoopSignatures getTriggerSignatures() { - return triggerSignatures; - } - public void setTriggerSignatures(ClosedLoopSignatures triggerSignatures) { - this.triggerSignatures = triggerSignatures; - } - public String getActions() { - return actions; - } - public void setActions(String actions) { - this.actions = actions; - } - public Integer getTimeInterval() { - return timeInterval; - } - public void setTimeInterval(int timeInterval) { - this.timeInterval = timeInterval; - } - public Integer getTimeOutRuby() { - return timeOutRuby; - } - public void setTimeOutRuby(int timeOutRuby) { - this.timeOutRuby = timeOutRuby; - } - public Integer getRetrys() { - return retrys; - } - public void setRetrys(int retrys) { - this.retrys = retrys; - } - public String getGeoLink() { - return geoLink; - } - public void setGeoLink(String geoLink) { - this.geoLink = geoLink; - } - public String getEmailAddress() { - return emailAddress; - } - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - public ClosedLoopSignatures getVerificationSignatures() { - return verificationSignatures; - } - public void setVerificationSignatures( - ClosedLoopSignatures verificationSignatures) { - this.verificationSignatures = verificationSignatures; - } - - /*public ArrayList getD2Services() { - return d2Services; - } - - public void setD2Services(ArrayList d2Services) { - this.d2Services = d2Services; - } - - public ArrayList getSiteNames() { - return siteNames; - } - - public void setSiteNames(ArrayList siteNames) { - this.siteNames = siteNames; - }*/ - - public boolean isvDNS() { - return vDNS; - } - - public void setvDNS(boolean vDNS) { - this.vDNS = vDNS; - } - - public boolean isTrinity() { - return trinity; - } - - public void setTrinity(boolean trinity) { - this.trinity = trinity; - } - - public boolean isvUSP() { - return vUSP; - } - - public void setvUSP(boolean vUSP) { - this.vUSP = vUSP; - } - - public boolean isMcr() { - return mcr; - } - - public void setMcr(boolean mcr) { - this.mcr = mcr; - } - - public boolean isGama() { - return gama; - } - - public void setGama(boolean gama) { - this.gama = gama; - } -} - diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopFaultTriggerUISignatures.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopFaultTriggerUISignatures.java deleted file mode 100644 index 2330496fe..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopFaultTriggerUISignatures.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - - -public class ClosedLoopFaultTriggerUISignatures { - - private String signatures; - - private String connectSignatures; - - public String getConnectSignatures() { - return connectSignatures; - } - public void setConnectSignatures(String connectSignatures) { - this.connectSignatures = connectSignatures; - } - public String getSignatures() { - return signatures; - } - public void setSignatures(String signatures) { - this.signatures = signatures; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPMBody.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPMBody.java deleted file mode 100644 index bbbf5508b..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPMBody.java +++ /dev/null @@ -1,133 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -import java.util.Map; - -public class ClosedLoopPMBody { - - private boolean trinity; - private boolean vUSP; - private boolean mcr; - private boolean gama; - private boolean vDNS; - private String geoLink; - private String vServices; - private String ECOMPname; - - private String emailAddress; - - private String serviceTypePolicyName; - - private Map attributes; - private String templateVersion; - - public String getTemplateVersion() { - return templateVersion; - } - - public void setTemplateVersion(String templateVersion) { - this.templateVersion = templateVersion; - } - - public String getECOMPname(){ - return ECOMPname; - } - - public void setECOMPname(String ECOMPname){ - this.ECOMPname = ECOMPname; - } - - public String getvServices() { - return vServices; - } - - public void setvServices(String vServices) { - this.vServices = vServices; - } - - public Map getAttributes() { - return attributes; - } - - public void setAttributes(Map map) { - this.attributes = map; - } - - public String getGeoLink() { - return geoLink; - } - - public void setGeoLink(String geoLink) { - this.geoLink = geoLink; - } - - public String getEmailAddress() { - return emailAddress; - } - - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - public String getServiceTypePolicyName() { - return serviceTypePolicyName; - } - - public void setServiceTypePolicyName(String serviceTypePolicyName) { - this.serviceTypePolicyName = serviceTypePolicyName; - } - - public boolean isGama() { - return gama; - } - public void setGama(boolean gama) { - this.gama = gama; - } - public boolean isvDNS() { - return vDNS; - } - public void setvDNS(boolean vDNS) { - this.vDNS = vDNS; - } - - public boolean isTrinity() { - return trinity; - } - public void setTrinity(boolean trinity) { - this.trinity = trinity; - } - public boolean isvUSP() { - return vUSP; - } - public void setvUSP(boolean vUSP) { - this.vUSP = vUSP; - } - public boolean isMcr() { - return mcr; - } - public void setMcr(boolean mcr) { - this.mcr = mcr; - } - -} - diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPerformanceMetrics.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPerformanceMetrics.java deleted file mode 100644 index 25d83169f..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPerformanceMetrics.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -public class ClosedLoopPerformanceMetrics { - public static final String CLPM_UIFIELD_ONSET_MESSAGE = "Onset Message"; - public static final String CLPM_UIJSON_ONSET_MESSAGE = "attributes.OnsetMessage"; - - public static final String CLPM_UIFIELD_POLICY_NAME = "PolicyName"; - public static final String CLPM_UIJSON_POLICY_NAME = "attributes.PolicyName"; - - public static final String CLPM_UIFIELD_ABATEMENT_MESSAGE = "Abatement Message"; - public static final String CLPM_UIJSON_ABATEMENT_MESSAGE = "attributes.AbatementMessage"; - - public static final String CLPM_UIFIELD_GEOLINK = "Geo Link"; - public static final String CLPM_UIJSON_GEOLINK = "geoLink"; -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicy.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicy.java deleted file mode 100644 index 727c9cba8..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicy.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -public class ClosedLoopPolicy { - public static final String CLFAULT_UIFIELD_D2_SERVICES_TRINITY = "Hosted Voice (Trinity)"; - public static final String CLFAULT_UIJSON_D2_SERVICES_TRINITY = "trinity"; - - public static final String CLFAULT_UIFIELD_D2_SERVICES_VUSP = "vUSP"; - public static final String CLFAULT_UIJSON_D2_SERVICES_VUSP = "vUSP"; - - public static final String CLFAULT_UIFIELD_D2_SERVICES_MCR = "MCR"; - public static final String CLFAULT_UIJSON_D2_SERVICES_MCR = "mcr"; - - public static final String CLFAULT_UIFIELD_D2_SERVICES_GAMMA = "Gamma"; - public static final String CLFAULT_UIJSON_D2_SERVICES_GAMMA = "gama"; - - public static final String CLFAULT_UIFIELD_D2_SERVICES_VDNS = "vDNS"; - public static final String CLFAULT_UIJSON_D2_SERVICES_VDNS = "vDNS"; - - public static final String CLFAULT_UIFIELD_EMAIL_ADDRESS = "Email Address"; - public static final String CLFAULT_UIJSON_EMAIL_ADDRESS = "emailAddress"; - - public static final String CLFAULT_UIFIELD_TRIGGER_SIGNATURE = "Trigger Signature"; - public static final String CLFAULT_UIJSON_TRIGGER_SIGNATURE = "triggerSignaturesUsedForUI.signatures"; - - public static final String CLFAULT_UIFIELD_VERIFICATION_SIGNATURE = "Verification Signature"; - public static final String CLFAULT_UIJSON_VERIFICATION_SIGNATURE = "verificationSignaturesUsedForUI.signatures"; - - public static final String CLFAULT_UIFIELD_CONNECT_ALL_TRAPS = "Connect All Traps"; - public static final String CLFAULT_UIJSON_CONNECT_ALL_TRAPS = "triggerSignaturesUsedForUI.connectSignatures"; - - public static final String CLFAULT_UIFIELD_CONNECT_ALL_FAULTS = "Connect All Faults"; - public static final String CLFAULT_UIJSON_CONNECT_ALL_FAULTS = "verificationSignaturesUsedForUI.connectSignatures"; - - public static final String CLFAULT_UIFIELD_POLICY_STATUS_ACTIVE = "Active"; - public static final String CLFAULT_UIJSON_POLICY_STATUS_ACTIVE = "ACTIVE"; - - public static final String CLFAULT_UIFIELD_POLICY_STATUS_INACTIVE = "InActive"; - public static final String CLFAULT_UIJSON_POLICY_STATUS_INACTIVE = "INACTIVE"; - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicyConditions.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicyConditions.java deleted file mode 100644 index cdae20e17..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicyConditions.java +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -public enum ClosedLoopPolicyConditions { - SEND("DCAE should send event notification"), - - NOTSEND("DCAE should not send event notification"); - private String name; - - private ClosedLoopPolicyConditions(String name){ - this.name = name; - } - - @Override - public String toString(){ - return this.name; - } -} - diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicyStatus.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicyStatus.java deleted file mode 100644 index 7ecd3b053..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopPolicyStatus.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -public enum ClosedLoopPolicyStatus { - ACTIVE("active"), - - INACTIVE("inactive") - ; - - private String name; - - private ClosedLoopPolicyStatus(String name){ - this.name = name; - } - - @Override - public String toString(){ - return this.name; - } -} - diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopSignatures.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopSignatures.java deleted file mode 100644 index 2eab27eea..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ClosedLoopSignatures.java +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -public class ClosedLoopSignatures { - - private String signatures; - - private int timeWindow; - - private Integer trapMaxAge; - - public String getSignatures() { - return signatures; - } - public void setSignatures(String signatures) { - this.signatures = signatures; - } - - public Integer getTimeWindow() { - return timeWindow; - } - public void setTimeWindow(Integer timeWindow) { - this.timeWindow = timeWindow; - } - - public Integer getTrapMaxAge() { - return trapMaxAge; - } - public void setTrapMaxAge(Integer trapMaxAge) { - this.trapMaxAge = trapMaxAge; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/DeletePolicyCondition.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/DeletePolicyCondition.java deleted file mode 100644 index 4698aa672..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/DeletePolicyCondition.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -public enum DeletePolicyCondition { - ONE("Are you sure you want to delete Current Version of policy"), - - ALL("Are you sure you want to delete All Versions of policy"); - private String name; - - private DeletePolicyCondition(String name){ - this.name = name; - } - - @Override - public String toString(){ - return this.name; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/DeployNowJson.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/DeployNowJson.java deleted file mode 100644 index 635431559..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/DeployNowJson.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -public class DeployNowJson { - - protected boolean deployNow; - - // deployNow - public boolean getDeployNow() { - return deployNow; - } - - public void setDeployNow(boolean value) { - this.deployNow = value; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/GridData.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/GridData.java deleted file mode 100644 index dfb3e0024..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/GridData.java +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -import java.util.ArrayList; - -public class GridData { - private ArrayList attributes; - private ArrayList transportProtocols; - private ArrayList appProtocols; - - public ArrayList getAttributes() { - return attributes; - } - - public void setAttributes(ArrayList attributes) { - this.attributes = attributes; - } - - public ArrayList getAppProtocols() { - return appProtocols; - } - - public void setAppProtocols(ArrayList appProtocols) { - this.appProtocols = appProtocols; - } - - public ArrayList getTransportProtocols() { - return transportProtocols; - } - - public void setTransportProtocols(ArrayList transportProtocols) { - this.transportProtocols = transportProtocols; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PolicyAdapter.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PolicyAdapter.java deleted file mode 100644 index f9a0bd48e..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PolicyAdapter.java +++ /dev/null @@ -1,619 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.openecomp.policy.rest.jpa.EcompName; - -public class PolicyAdapter { - - private Object data; - private String policyName = null; - private Path parentPath; - public boolean isEditPolicy = false; - private boolean isViewPolicy = false; - private Object policyData = null; - private String comboPolicyType; - private boolean readOnly; - - //adding new properties for REST interface call when creating Policies - private String oldPolicyFileName = null; - private String configType = null; - private String policyID = null; - private String policyType = null; - private String configPolicyType = null; - private String policyDescription = null; - private String ecompName = null; - private String configName = null; - private String ruleID = null; - private String ruleCombiningAlgId = null; - private Map dynamicFieldConfigAttributes; - private Map dropDownMap; - private Map dynamicSettingsMap; - private Path gitPath; - private String configBodyData = null; - private boolean isValidData = false; - private boolean draft = false; - private String version = null; - private String domain = null; - private String filterName = null; - private String comboConfigPolicyType; - private String jsonBody = null; - private Map brmsParamBody=null; - private Integer highestVersion; - private String actionPerformer = null; - private String actionAttribute = null; - private List dynamicRuleAlgorithmLabels; - private List dynamicRuleAlgorithmCombo; - private List dynamicRuleAlgorithmField1; - private List dynamicRuleAlgorithmField2; - private List dynamicVariableList; - private List dataTypeList; - private String actionBody = null; - private String actionDictHeader = null; - private String actionDictType = null; - private String actionDictUrl = null; - private String actionDictMethod = null; - private String serviceType = null; - private String uuid = null; - private String location = null; - private String priority = null; - private String actionAttributeValue; - private String ruleProvider; - - private EcompName ecompNameField; - private Object jsonBodyData; - private String dirPath; - private String configBodyPath; - private ArrayList attributes; - private ArrayList settings; - private ArrayList ruleAlgorithmschoices; - - private LinkedHashMap serviceTypePolicyName; - private String ruleName; - private LinkedHashMap ruleData; - private LinkedHashMap ruleListData; - private String clearTimeOut; - private String trapMaxAge; - private String verificationclearTimeOut; - private String fwPolicyType; - private ArrayList fwattributes; - private String parentForChild; - public String getFwPolicyType() { - return fwPolicyType; - } - public ArrayList getFwattributes() { - return fwattributes; - } - public String getParentForChild() { - return parentForChild; - } - public void setFwPolicyType(String fwPolicyType) { - this.fwPolicyType = fwPolicyType; - } - public void setFwattributes(ArrayList fwattributes) { - this.fwattributes = fwattributes; - } - public void setParentForChild(String parentForChild) { - this.parentForChild = parentForChild; - } - - private String riskLevel; - private String riskType = null; - private String guard = null; - private String ttlDate = null; - - public String getClearTimeOut() { - return clearTimeOut; - } - public void setClearTimeOut(String clearTimeOut) { - this.clearTimeOut = clearTimeOut; - } - public String getTrapMaxAge() { - return trapMaxAge; - } - public void setTrapMaxAge(String trapMaxAge) { - this.trapMaxAge = trapMaxAge; - } - public String getVerificationclearTimeOut() { - return verificationclearTimeOut; - } - public void setVerificationclearTimeOut(String verificationclearTimeOut) { - this.verificationclearTimeOut = verificationclearTimeOut; - } - public LinkedHashMap getRuleListData() { - return ruleListData; - } - public void setRuleListData(LinkedHashMap ruleListData) { - this.ruleListData = ruleListData; - } - private ArrayList triggerSignatures; - private ArrayList symptomSignatures; - private String logicalConnector; - private String policyStatus; - public String gocServerScope; - public Map dynamicLayoutMap; - private String securityZone; - - private String policyScope; - private String supressionType; - - - - public String getSupressionType() { - return supressionType; - } - public void setSupressionType(String supressionType) { - this.supressionType = supressionType; - } - public Map getDynamicLayoutMap() { - return dynamicLayoutMap; - } - public void setDynamicLayoutMap(Map dynamicLayoutMap) { - this.dynamicLayoutMap = dynamicLayoutMap; - } - public String getGocServerScope() { - return gocServerScope; - } - public void setGocServerScope(String gocServerScope) { - this.gocServerScope = gocServerScope; - } - public Object getJsonBodyData() { - return jsonBodyData; - } - public void setJsonBodyData(Object jsonBodyData) { - this.jsonBodyData = jsonBodyData; - } - public EcompName getEcompNameField() { - return ecompNameField; - } - public void setEcompNameField(EcompName ecompNameField) { - this.ecompNameField = ecompNameField; - } - public Integer getHighestVersion() { - return highestVersion; - } - public void setHighestVersion(Integer highestVersion) { - this.highestVersion = highestVersion; - } - public String getConfigType() { - return configType; - } - public void setConfigType(String configType) { - this.configType = configType; - } - public String getPolicyID() { - return policyID; - } - public void setPolicyID(String policyID) { - this.policyID = policyID; - } - public String getPolicyType() { - return policyType; - } - public void setPolicyType(String policyType) { - this.policyType = policyType; - } - public String getPolicyDescription() { - return policyDescription; - } - public void setPolicyDescription(String policyDescription) { - this.policyDescription = policyDescription; - } - public String getEcompName() { - return ecompName; - } - public void setEcompName(String ecompName) { - this.ecompName = ecompName; - } - public String getConfigName() { - return configName; - } - public void setConfigName(String configName) { - this.configName = configName; - } - public String getRuleID() { - return ruleID; - } - public void setRuleID(String ruleID) { - this.ruleID = ruleID; - } - public String getRuleCombiningAlgId() { - return ruleCombiningAlgId; - } - public void setRuleCombiningAlgId(String ruleCombiningAlgId) { - this.ruleCombiningAlgId = ruleCombiningAlgId; - } - public Map getDynamicFieldConfigAttributes() { - return dynamicFieldConfigAttributes; - } - public void setDynamicFieldConfigAttributes( - Map dynamicFieldConfigAttributes) { - this.dynamicFieldConfigAttributes = dynamicFieldConfigAttributes; - } - public Path getGitPath() { - return gitPath; - } - public void setGitPath(Path gitPath) { - this.gitPath = gitPath; - } - public Object getData() { - return data; - } - public void setData(Object data) { - this.data = data; - } - public String getPolicyName() { - return policyName; - } - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - public Path getParentPath() { - return parentPath; - } - public void setParentPath(Path parentPath) { - this.parentPath = parentPath; - } - public boolean isEditPolicy() { - return isEditPolicy; - } - public void setEditPolicy(boolean isEditPolicy) { - this.isEditPolicy = isEditPolicy; - } - public boolean isViewPolicy() { - return isViewPolicy; - } - public void setViewPolicy(boolean isViewPolicy) { - this.isViewPolicy = isViewPolicy; - } - public Object getPolicyData() { - return policyData; - } - public void setPolicyData(Object policyData) { - this.policyData = policyData; - } - public String getComboPolicyType() { - return comboPolicyType; - } - public void setComboPolicyType(String comboPolicyType) { - this.comboPolicyType = comboPolicyType; - } - public boolean isReadOnly() { - return readOnly; - } - public void setReadOnly(boolean readOnly) { - this.readOnly = readOnly; - } - public String getConfigBodyData() { - return configBodyData; - } - public void setConfigBodyData(String configBodyData) { - this.configBodyData = configBodyData; - } - public boolean isValidData() { - return isValidData; - } - public void setValidData(boolean isValidData) { - this.isValidData = isValidData; - } - public String getVersion() { - return version; - } - public void setVersion(String version) { - this.version = version; - } - public String getDomainDir() { - return domain; - } - public void setDomainDir(java.lang.String domain) { - this.domain = domain; - - } - public String getFilterName() { - return filterName; - } - public void setFilterName(String filterName) { - this.filterName = filterName; - } - public String getComboConfigPolicyType() { - return comboConfigPolicyType; - } - public void setComboConfigPolicyType(String comboConfigPolicyType) { - this.comboConfigPolicyType = comboConfigPolicyType; - } - public Map getBRMSParamBody() { - return brmsParamBody; - } - public void setBRMSParamBody(Map brmsParamBody) { - this.brmsParamBody = brmsParamBody; - } - public String getJsonBody() { - return jsonBody; - } - public void setJsonBody(String jsonBody) { - this.jsonBody = jsonBody; - } - public String getConfigPolicyType() { - return configPolicyType; - } - public void setConfigPolicyType(String configPolicyType) { - this.configPolicyType = configPolicyType; - } - public String getActionPerformer() { - return actionPerformer; - } - public void setActionPerformer(String actionPerformer) { - this.actionPerformer = actionPerformer; - } - public String getActionAttribute() { - return actionAttribute; - } - public void setActionAttribute(String actionAttribute) { - this.actionAttribute = actionAttribute; - } - public List getDynamicRuleAlgorithmLabels() { - return dynamicRuleAlgorithmLabels; - } - public void setDynamicRuleAlgorithmLabels( - List dynamicRuleAlgorithmLabels) { - this.dynamicRuleAlgorithmLabels = dynamicRuleAlgorithmLabels; - } - public List getDynamicRuleAlgorithmCombo() { - return dynamicRuleAlgorithmCombo; - } - public void setDynamicRuleAlgorithmCombo( - List dynamicRuleAlgorithmCombo) { - this.dynamicRuleAlgorithmCombo = dynamicRuleAlgorithmCombo; - } - public List getDynamicRuleAlgorithmField1() { - return dynamicRuleAlgorithmField1; - } - public void setDynamicRuleAlgorithmField1( - List dynamicRuleAlgorithmField1) { - this.dynamicRuleAlgorithmField1 = dynamicRuleAlgorithmField1; - } - public List getDynamicRuleAlgorithmField2() { - return dynamicRuleAlgorithmField2; - } - public void setDynamicRuleAlgorithmField2( - List dynamicRuleAlgorithmField2) { - this.dynamicRuleAlgorithmField2 = dynamicRuleAlgorithmField2; - } - public String getActionBody() { - return actionBody; - } - public void setActionBody(String actionBody) { - this.actionBody = actionBody; - } - public Map getDropDownMap() { - return dropDownMap; - } - public void setDropDownMap(Map dropDownMap) { - this.dropDownMap = dropDownMap; - } - public String getActionDictHeader() { - return actionDictHeader; - } - public void setActionDictHeader(String actionDictHeader) { - this.actionDictHeader = actionDictHeader; - } - public String getActionDictType() { - return actionDictType; - } - public void setActionDictType(String actionDictType) { - this.actionDictType = actionDictType; - } - public String getActionDictUrl() { - return actionDictUrl; - } - public void setActionDictUrl(String actionDictUrl) { - this.actionDictUrl = actionDictUrl; - } - public String getActionDictMethod() { - return actionDictMethod; - } - public void setActionDictMethod(String actionDictMethod) { - this.actionDictMethod = actionDictMethod; - } - public boolean isDraft() { - return draft; - } - public void setDraft(boolean draft) { - this.draft = draft; - } - public Map getDynamicSettingsMap() { - return dynamicSettingsMap; - } - public void setDynamicSettingsMap(Map dynamicSettingsMap) { - this.dynamicSettingsMap = dynamicSettingsMap; - } - public List getDynamicVariableList() { - return dynamicVariableList; - } - public void setDynamicVariableList(List dynamicVariableList) { - this.dynamicVariableList = dynamicVariableList; - } - public List getDataTypeList() { - return dataTypeList; - } - public void setDataTypeList(List dataTypeList) { - this.dataTypeList = dataTypeList; - } - public String getOldPolicyFileName() { - return oldPolicyFileName; - } - public void setOldPolicyFileName(String oldPolicyFileName) { - this.oldPolicyFileName = oldPolicyFileName; - } - public String getServiceType() { - return serviceType; - } - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - public String getUuid() { - return uuid; - } - public void setUuid(String uuid) { - this.uuid = uuid; - } - public String getLocation() { - return location; - } - public void setLocation(String location) { - this.location = location; - } - public String getPriority() { - return priority; - } - public void setPriority(String priority) { - this.priority = priority; - } - public String getDirPath() { - return dirPath; - } - public void setDirPath(String dirPath) { - this.dirPath = dirPath; - } - public String getConfigBodyPath() { - return configBodyPath; - } - public void setConfigBodyPath(String configBodyPath) { - this.configBodyPath = configBodyPath; - } - public ArrayList getAttributes() { - return attributes; - } - - @SuppressWarnings("unchecked") - public void setAttributes(Object attributes) { - this.attributes = (ArrayList) attributes; - } - public LinkedHashMap getServiceTypePolicyName() { - return serviceTypePolicyName; - } - public void setServiceTypePolicyName(LinkedHashMap serviceTypePolicyName) { - this.serviceTypePolicyName = (LinkedHashMap) serviceTypePolicyName; - } - public ArrayList getSettings() { - return settings; - } - public void setSettings(ArrayList settings) { - this.settings = settings; - } - public String getRuleName() { - return ruleName; - } - public void setRuleName(String ruleName) { - this.ruleName = ruleName; - } - public LinkedHashMap getRuleData() { - return ruleData; - } - public void setRuleData(LinkedHashMap ruleData) { - this.ruleData = ruleData; - } - public ArrayList getTriggerSignatures() { - return triggerSignatures; - } - public void setTriggerSignatures(ArrayList triggerSignatures) { - this.triggerSignatures = triggerSignatures; - } - public String getLogicalConnector() { - return logicalConnector; - } - public void setLogicalConnector(String logicalConnector) { - this.logicalConnector = logicalConnector; - } - public String getPolicyStatus() { - return policyStatus; - } - public void setPolicyStatus(String policyStatus) { - this.policyStatus = policyStatus; - } - public String getActionAttributeValue() { - return actionAttributeValue; - } - public void setActionAttributeValue(String actionAttributeValue) { - this.actionAttributeValue = actionAttributeValue; - } - public ArrayList getRuleAlgorithmschoices() { - return ruleAlgorithmschoices; - } - public void setRuleAlgorithmschoices(ArrayList ruleAlgorithmschoices) { - this.ruleAlgorithmschoices = ruleAlgorithmschoices; - } - public String getSecurityZone() { - return securityZone; - } - public void setSecurityZone(String securityZone) { - this.securityZone = securityZone; - } - public ArrayList getSymptomSignatures() { - return symptomSignatures; - } - public void setSymptomSignatures(ArrayList symptomSignatures) { - this.symptomSignatures = symptomSignatures; - } - public String getPolicyScope() { - return policyScope; - } - public void setPolicyScope(String policyScope) { - this.policyScope = policyScope; - } - public String getRuleProvider() { - return ruleProvider; - } - public void setRuleProvider(String ruleProvider) { - this.ruleProvider = ruleProvider; - } - public String getRiskLevel() { - return riskLevel; - } - public void setRiskLevel(String riskLevel) { - this.riskLevel = riskLevel; - } - public String getRiskType() { - return riskType; - } - public void setRiskType(String riskType) { - this.riskType = riskType; - } - public String getGuard() { - return guard; - } - public void setGuard(String guard) { - this.guard = guard; - } - public String getTtlDate() { - return ttlDate; - } - public void setTtlDate(String ttlDate) { - this.ttlDate = ttlDate; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PolicyExportAdapter.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PolicyExportAdapter.java deleted file mode 100644 index 37ed83d16..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PolicyExportAdapter.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -import java.util.ArrayList; - -public class PolicyExportAdapter { - - private ArrayList policyDatas; - - public ArrayList getPolicyDatas() { - return policyDatas; - } - public void setPolicyDatas(ArrayList policyDatas) { - this.policyDatas = policyDatas; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PrefixIPList.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PrefixIPList.java deleted file mode 100644 index e2c70e69f..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/PrefixIPList.java +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - - -import java.util.ArrayList; -import java.util.List; - - -public class PrefixIPList { - protected String name; - protected String description; - protected List members; - /* protected String type; - protected String value;*/ - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public List getMembers() - { - if(members==null) - { - members= new ArrayList(); - } - return this.members; - } - - public void setMembers(List members) - { - this.members = members; - } - /*public String getValue() { - return value; - } - - - public void setValue(String value) { - this.value = value; - }*/ - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceGroupJson.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceGroupJson.java deleted file mode 100644 index 1cc34fbb4..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceGroupJson.java +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -import java.util.ArrayList; -import java.util.List; - -public class ServiceGroupJson { - - protected String name; - protected String description; - protected List members; - - // name - public String getName() { - return name; - } - - public void setName(String value) { - this.name = value; - } - - public boolean equals(Object obj) - { - ServiceGroupJson servGroupobj=(ServiceGroupJson) obj; - if(this.getName().equals(servGroupobj.getName())) - { - return true; - } - return false; - } - - public int hashCode() { - return Integer.valueOf(name.charAt(0)+(name.charAt(1))); - } - - // description - public String getDescription() { - return description; - } - - public void setDescription(String value) { - this.description = value; - } - - public List getMembers() - { - if(members==null) - { - members= new ArrayList(); - } - return this.members; - } - - public void setMembers(List members) - { - this.members = members; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceListJson.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceListJson.java deleted file mode 100644 index 05df303b9..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceListJson.java +++ /dev/null @@ -1,107 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - - -public class ServiceListJson { - - protected String name; - protected String description; - protected String type; - protected String transportProtocol; - protected String appProtocol; - protected String ports; - // name - public String getName() { - return name; - } - - public void setName(String value) { - this.name = value; - } - - public boolean equals(Object obj) - { - ServiceListJson servobj=(ServiceListJson) obj; - if(this.getName().equals(servobj.getName())) - { - return true; - } - return false; - } - - public int hashCode() { - if(name!=null){ - return Integer.valueOf(name.charAt(0)+(name.charAt(1))); - }else{ - return 0; - } - } - - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - // type - public String getType() { - return type; - } - - public void setType(String value) { - this.type = value; - } - - // transportProtocol - public String getTransportProtocol() { - return transportProtocol; - } - - public void setTransportProtocol(String value) { - this.transportProtocol = value; - } - - // appProtocol - public String getAppProtocol() { - return appProtocol; - } - - public void setAppProtocol(String value) { - this.appProtocol = value; - } - - // ports - public String getPorts() { - return ports; - } - - public void setPorts(String value) { - this.ports = value; - } - - - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceMembers.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceMembers.java deleted file mode 100644 index a8b1abea5..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServiceMembers.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - - -public class ServiceMembers { - - protected String type; - protected String name; - - // type - public String getType() { - return type; - } - - public void setType(String value) { - this.type = value; - } - - // transportProtocol - public String getName() { - return name; - } - - public void setName(String value) { - this.name = value; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServicesJson.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServicesJson.java deleted file mode 100644 index bdc9232b5..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/ServicesJson.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - -public class ServicesJson { - - protected String type; - protected String name; - // type - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getName() { - return name; - } - - public void setName(String value) { - this.name = value; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/Term.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/Term.java deleted file mode 100644 index 3080f2707..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/Term.java +++ /dev/null @@ -1,201 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - - -public class Term { - - String position; - protected String ruleName; - protected List fromZones; - protected List toZones; - protected boolean negateSource; //hardcoded - protected boolean negateDestination; //hardcoded - protected List sourceList; - protected List destinationList; - protected List sourceServices; - protected Set destServices; - protected String action; - protected String description; - boolean enabled; //hardcoded - boolean log; //hardcoded - - //position - public String getPosition() { - return position; - } - - public void setPosition(String value) { - this.position = value; - } - - //RuleName - public String getRuleName() { - return ruleName; - } - - public void setRuleName(String value) { - this.ruleName = value; - } - - //From Zone - public List getFromZones() { - if (fromZones==null) - { - fromZones= new ArrayList(); - } - return fromZones; - } - - public void setFromZones(List fromZones) { - this.fromZones = fromZones; - } - - //To Zone - public List getToZones() { - if (toZones==null) - { - toZones= new ArrayList(); - } - return toZones; - } - - public void setToZones(List toZones) { - this.toZones = toZones; - } - - - //Negate Source - public boolean getNegateSource() { - return negateSource; - } - - public void setNegateSource(boolean negateSource) { - this.negateSource = negateSource; - } - - //Negate Destination - public boolean getNegateDestination() { - return negateDestination; - } - - public void setNegateDestination(boolean negateDestination) { - this.negateDestination = negateDestination; - } - - //SourceList - public List getSourceList() - { - if(sourceList==null) - { - sourceList= new ArrayList(); - } - return this.sourceList; - } - - public void setSourceList(List srcList) { - this.sourceList = srcList; - } - - //Destination List - public List getDestinationList() - { - if(destinationList==null) - { - destinationList= new ArrayList(); - } - return this.destinationList; - } - - public void setDestinationList(List destList) { - this.destinationList = destList; - } - - //Source Services - public List getSourceServices() { - if(sourceServices==null) - { - sourceServices= new ArrayList(); - } - return this.sourceServices; - } - - public void setSourceServices(List sourceServices) { - this.sourceServices = sourceServices; - } - - //Destination services. - public Set getDestServices() { - if(destServices==null) - { - destServices= new HashSet(); - } - return this.destServices; - } - - public void setDestServices(Set destServices) { - this.destServices = destServices; - } - - //Action - public String getAction() { - return action; - } - - public void setAction(String value) { - this.action = value; - } - - //description - public String getDescription() { - return description; - } - - public void setDescription(String desc) { - this.description = desc; - } - - //enabled - public boolean getEnabled() { - return enabled; - } - - public void setEnabled(boolean value) { - this.enabled = value; - } - - //Log - public boolean getLog() { - return log; - } - - public void setLog(boolean value) { - this.log = value; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/TermCollector.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/TermCollector.java deleted file mode 100644 index 169ab3637..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/adapter/TermCollector.java +++ /dev/null @@ -1,132 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.adapter; - - - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - - -public class TermCollector { - String serviceTypeId; - String configName; - DeployNowJson deploymentOption; - String securityZoneId; - - protected Set serviceGroups; - protected Set addressGroups; - protected List firewallRuleList; - - private String primaryParentZoneId; - - - //SecurityTypeId - public String getServiceTypeId() { - return serviceTypeId; - } - - public void setServiceTypeId(String serviceTypeId) { - this.serviceTypeId = serviceTypeId; - } - - //ConfigName - public String getConfigName() { - return configName; - } - - public void setConfigName(String configName) { - this.configName = configName; - } - - //DeploymentControl - public DeployNowJson getDeploymentOption() { - return deploymentOption; - } - - public void setDeploymentOption(DeployNowJson deploymentOption) { - this.deploymentOption = deploymentOption; - } - - //SecurityZoneId - public String getSecurityZoneId() { - return securityZoneId; - } - public void setSecurityZoneId(String securityZoneId) { - this.securityZoneId = securityZoneId; - } - - - //ServiceGroup - public Set getServiceGroups() { - if(serviceGroups==null) - { - serviceGroups= new HashSet(); - } - return this.serviceGroups; - } - - public void setServiceGroups(Set servListArray) { - this.serviceGroups = servListArray; - } - - //AddressGroup - public Set getAddressGroups() { - if(addressGroups==null) - { - addressGroups= new HashSet(); - } - return this.addressGroups; - } - - public void setAddressGroups(Set addressGroups) { - this.addressGroups = addressGroups; - } - - //FirewallRuleList - public List getFirewallRuleList() { - - if(firewallRuleList==null) - { - firewallRuleList= new ArrayList(); - } - return this.firewallRuleList; - } - - public void setFirewallRuleList(List firewallRuleList) { - this.firewallRuleList = firewallRuleList; - } - - - //primaryParentZoneId - public String getPrimaryParentZoneId() { - return primaryParentZoneId; - } - - public void setPrimaryParentZoneId(String primaryParentZoneId) { - this.primaryParentZoneId = primaryParentZoneId; - } - - - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/CheckPDP.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/CheckPDP.java deleted file mode 100644 index f1447f135..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/CheckPDP.java +++ /dev/null @@ -1,187 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.admin; - - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Base64; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Properties; - -import org.openecomp.policy.rest.XACMLRestProperties; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import com.att.research.xacml.util.XACMLProperties; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -public class CheckPDP { - private static Path pdpPath = null; - private static Properties pdpProp = null; - private static Long oldModified = null; - private static Long newModified = null; - private static HashMap pdpMap = null; - private static final Logger logger = FlexLogger.getLogger(CheckPDP.class); - - public static boolean validateID(String id) { - // ReadFile - try { - readFile(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + e); - return false; - } - // Check ID - if (pdpMap.containsKey(id)) { - return true; - } - return false; - } - - private static void readFile() throws Exception { - String pdpFile = null; - try{ - pdpFile = XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_IDFILE); - }catch (Exception e){ - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Cannot read the PDP ID File"); - return; - } - if (pdpFile == null) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "PDP File name not Valid : " + pdpFile); - throw new Exception(XACMLErrorConstants.ERROR_SYSTEM_ERROR +"PDP File name not Valid : " + pdpFile); - } - if (pdpPath == null) { - pdpPath = Paths.get(pdpFile); - if (Files.notExists(pdpPath)) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "File doesn't exist in the specified Path : " + pdpPath.toString()); - throw new Exception(XACMLErrorConstants.ERROR_SYSTEM_ERROR +"File doesn't exist in the specified Path : "+ pdpPath.toString()); - } - if (pdpPath.toString().endsWith(".properties")) { - readProps(); - } else { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "Not a .properties file " + pdpFile); - throw new Exception(XACMLErrorConstants.ERROR_SYSTEM_ERROR +"Not a .properties file"); - } - } - // Check if File is updated recently - else { - newModified = pdpPath.toFile().lastModified(); - if (newModified != oldModified) { - // File has been updated. - readProps(); - } - } - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - private static void readProps() throws Exception { - InputStream in; - pdpProp = new Properties(); - try { - in = new FileInputStream(pdpPath.toFile()); - oldModified = pdpPath.toFile().lastModified(); - pdpProp.load(in); - } catch (IOException e) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + e); - throw new Exception("Cannot Load the Properties file", e); - } - // Read the Properties and Load the PDPs and encoding. - pdpMap = new HashMap(); - // Check the Keys for PDP_URLs - Collection unsorted = pdpProp.keySet(); - List sorted = new ArrayList(unsorted); - Collections.sort(sorted); - for (String propKey : sorted) { - if (propKey.startsWith("PDP_URL")) { - String check_val = pdpProp.getProperty(propKey); - if (check_val == null) { - throw new Exception("Properties file doesn't have the PDP_URL parameter"); - } - if (check_val.contains(";")) { - List pdp_default = new ArrayList(Arrays.asList(check_val.split("\\s*;\\s*"))); - int pdpCount = 0; - while (pdpCount < pdp_default.size()) { - String pdpVal = pdp_default.get(pdpCount); - readPDPParam(pdpVal); - pdpCount++; - } - } else { - readPDPParam(check_val); - } - } - } - if (pdpMap == null || pdpMap.isEmpty()) { - logger.debug(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "Cannot Proceed without PDP_URLs"); - throw new Exception(XACMLErrorConstants.ERROR_SYSTEM_ERROR +"Cannot Proceed without PDP_URLs"); - } - } - - private static void readPDPParam(String pdpVal) throws Exception{ - if(pdpVal.contains(",")){ - List pdpValues = new ArrayList(Arrays.asList(pdpVal.split("\\s*,\\s*"))); - if(pdpValues.size()==3){ - // 1:2 will be UserID:Password - String userID = pdpValues.get(1); - String pass = pdpValues.get(2); - Base64.Encoder encoder = Base64.getEncoder(); - // 0 - PDPURL - pdpMap.put(pdpValues.get(0), encoder.encodeToString((userID+":"+pass).getBytes(StandardCharsets.UTF_8))); - }else{ - logger.error(XACMLErrorConstants.ERROR_PERMISSIONS + "No Credentials to send Request: " + pdpValues); - throw new Exception(XACMLErrorConstants.ERROR_PERMISSIONS + "No enough Credentials to send Request. " + pdpValues); - } - }else{ - logger.error(XACMLErrorConstants.ERROR_PERMISSIONS + "No Credentials to send Request: " + pdpVal); - throw new Exception(XACMLErrorConstants.ERROR_PERMISSIONS +"No enough Credentials to send Request."); - } - } - - public static String getEncoding(String pdpID){ - try { - readFile(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + e); - } - String encoding = null; - if(pdpMap!=null && (!pdpMap.isEmpty())){ - try{ - encoding = pdpMap.get(pdpID); - } catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + e); - } - return encoding; - }else{ - return null; - } - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PAPNotificationBroadcaster.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PAPNotificationBroadcaster.java deleted file mode 100644 index cff0828e2..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PAPNotificationBroadcaster.java +++ /dev/null @@ -1,120 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.admin; - - -import java.io.Serializable; -import java.util.LinkedList; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -/** - * Handle Notifications from the PAP that the PDP Groups have been changed. - * We need a Server Push Broadcaster because there may be multiple Vaadin instances (i.e. Users) that need to be told when a change occurs. - * - * Initially we only update the entire set of PDPGroups in one shot. - * - * (Code copied from Book of Vaadin chapter on Server Push - * - */ -public class PAPNotificationBroadcaster implements Serializable { - /** - * - */ - private static final long serialVersionUID = -2539940306348821754L; - - - private static Logger logger = FlexLogger.getLogger(PAPNotificationBroadcaster.class); - - - static ExecutorService executorService = Executors.newSingleThreadExecutor(); - - /** - * Interface used by all classes that need to be notified when PAP sends an update message. - * - * - */ - public interface PAPNotificationBroadcastListener { - void updateAllGroups(); - } - - - - /* - * list of registered listeners - */ - private static LinkedList listeners = - new LinkedList(); - - /** - * Listener registers to hear about updates. - * @param listener - */ - public static synchronized void register( - PAPNotificationBroadcastListener listener) { - listeners.add(listener); - } - - - /** - * Listener is going away. - * - * @param listener - */ - public static synchronized void unregister( - PAPNotificationBroadcastListener listener) { - listeners.remove(listener); - } - - - - /** - * Tell all listeners about an update. - * - * @param message - */ - public static synchronized void updateAllGroups() { - for (final PAPNotificationBroadcastListener listener: listeners) { - // Original code copied from example: - // executorService.execute(new Runnable() { - // @Override - // public void run() { - // The problem with this is that the execute starts a new Thread, but the thing we are calling (the listener.updateAllGroups) - // happens in this case to ALSO create a new thread, and it locks up because the shared threadpool queue is already locked by this method. - // On application shutdown that left us with a blocked thread, so the process never goes away. - // Since the listener.updateAllGroups does ALL of its work inside a new Runnable thread, there should be no need for this method to also create a thread. - - /* - * IMPORTANT: - * All listeners MUST either execute with no possibility of blocking - * OR must start their own threads to handle blocking and concurrent operations. - */ - if (logger.isDebugEnabled()) { - logger.debug("updateAllGroups"); - } - listener.updateAllGroups(); - } - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PolicyManagerServlet.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PolicyManagerServlet.java deleted file mode 100644 index e355b8295..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PolicyManagerServlet.java +++ /dev/null @@ -1,1334 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/* - * - * - * - * */ -package org.openecomp.policy.admin; - - -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileFilter; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.nio.file.DirectoryStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.BasicFileAttributes; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.compress.utils.IOUtils; -import org.apache.commons.fileupload.FileItem; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.io.filefilter.WildcardFileFilter; -import org.apache.http.HttpStatus; -import org.json.JSONException; -import org.json.JSONObject; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.components.HumanPolicyComponent; -import org.openecomp.policy.controller.ActionPolicyController; -import org.openecomp.policy.controller.CreateBRMSParamController; -import org.openecomp.policy.controller.CreateBRMSRawController; -import org.openecomp.policy.controller.CreateClosedLoopFaultController; -import org.openecomp.policy.controller.CreateClosedLoopPMController; -import org.openecomp.policy.controller.CreateDcaeMicroServiceController; -import org.openecomp.policy.controller.CreateFirewallController; -import org.openecomp.policy.controller.CreatePolicyController; -import org.openecomp.policy.controller.DecisionPolicyController; -import org.openecomp.policy.controller.PolicyController; -import org.openecomp.policy.controller.PolicyExportAndImportController; -import org.openecomp.policy.elk.client.ElkConnector; -import org.openecomp.policy.model.Roles; -import org.openecomp.policy.rest.jpa.PolicyEditorScopes; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.UserInfo; -import org.openecomp.policy.utils.XACMLPolicyWriterWithPapNotify; -import org.openecomp.portalsdk.core.web.support.UserUtils; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class PolicyManagerServlet extends HttpServlet { - private static final Logger LOG = FlexLogger.getLogger(PolicyManagerServlet.class); - private static final long serialVersionUID = -8453502699403909016L; - - private enum Mode { - LIST, RENAME, COPY, DELETE, EDITFILE, ADDFOLDER, DESCRIBEPOLICYFILE, VIEWPOLICY, ADDSUBSCOPE, SWITCHVERSION, EXPORT - } - - public static final String REPOSITORY_BASE_PATH = PolicyController.getGitPath().toString(); - private static String DATE_FORMAT = "yyyy-MM-dd hh:mm:ss"; - public static final String CONFIG_HOME = PolicyController.getConfigHome(); - public static final String ACTION_HOME = PolicyController.getActionHome(); - private static String CONTENTTYPE = "application/json"; - private File repofilePath; - private static String SUPERADMIN = "super-admin"; - private static String SUPEREDITOR = "super-editor"; - private static String SUPERGUEST = "super-guest"; - private static String ADMIN = "admin"; - private static String EDITOR = "editor"; - private static String GUEST = "guest"; - private static String RESULT = "result"; - private static String REPOSITORY = "repository"; - - private static String CONFIG = "Config_"; - private static String ACTION = "Action_"; - private static String DECISION = "Decision_"; - - @Override - public void init() throws ServletException { - super.init(); - } - - @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String path = request.getParameter("path"); - File file = new File(REPOSITORY_BASE_PATH, path); - - if (!file.isFile()) { - // if not a file, it is a folder, show this error. - response.sendError(HttpServletResponse.SC_NOT_FOUND, "Resource Not Found"); - return; - } - - response.setHeader("Content-Type", getServletContext().getMimeType(file.getName())); - response.setHeader("Content-Length", String.valueOf(file.length())); - response.setHeader("Content-Disposition", "inline; filename=\"" + file.getName() + "\""); - - FileInputStream input = null; - BufferedOutputStream output = null; - try { - input = new FileInputStream(file); - output = new BufferedOutputStream(response.getOutputStream()); - byte[] buffer = new byte[8192]; - for (int length = 0; (length = input.read(buffer)) > 0;) { - output.write(buffer, 0, length); - } - } catch (Exception e) { - LOG.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Exception Occured While Reading Imput Stream" + e); - } finally { - if (output != null) { - try { - output.close(); - } catch (Exception e) { - LOG.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Exception Occured While Closing Output Stream" + e); - } - } - if (input != null) { - try { - input.close(); - } catch (Exception e) { - LOG.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Exception Occured While Closing Input Stream" + e); - } - } - } - - } - - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - LOG.debug("doPost"); - try { - // if request contains multipart-form-data - if (ServletFileUpload.isMultipartContent(request)) { - uploadFile(request, response); - } - // all other post request has json params in body - else { - fileOperation(request, response); - } - } catch (Exception e) { - setError(e, response); - } - } - - //Set Error Message for Exception - private void setError(Exception t, HttpServletResponse response) throws IOException { - try { - JSONObject responseJsonObject = error(t.getMessage()); - response.setContentType(CONTENTTYPE); - PrintWriter out = response.getWriter(); - out.print(responseJsonObject); - out.flush(); - } catch (Exception x) { - response.sendError(HttpStatus.SC_INTERNAL_SERVER_ERROR, x.getMessage()); - } - } - - //Policy Import Functionality - private void uploadFile(HttpServletRequest request, HttpServletResponse response) throws ServletException { - try { - String newFile; - Map files = new HashMap(); - - List items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request); - for (FileItem item : items) { - if (!item.isFormField()) { - // Process form file field (input type="file"). - files.put(item.getName(), item.getInputStream()); - if(item.getName().endsWith(".tar")){ - try{ - File file = new File(item.getName()); - OutputStream outputStream = new FileOutputStream(file); - IOUtils.copy(item.getInputStream(), outputStream); - outputStream.close(); - newFile = file.toString(); - PolicyExportAndImportController importController = new PolicyExportAndImportController(); - importController.ImportRepositoryFile(newFile, request); - }catch(Exception e){ - LOG.error("Upload error : " + e); - } - } - } - } - - JSONObject responseJsonObject = null; - responseJsonObject = this.success(); - response.setContentType("application/json"); - PrintWriter out = response.getWriter(); - out.print(responseJsonObject); - out.flush(); - } catch (Exception e) { - LOG.debug("Cannot write file"); - throw new ServletException("Cannot write file", e); - } - } - - //File Operation Functionality - private void fileOperation(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - JSONObject responseJsonObject = null; - try { - StringBuilder sb = new StringBuilder(); - BufferedReader br = request.getReader(); - String str; - while ((str = br.readLine()) != null) { - sb.append(str); - } - br.close(); - JSONObject jObj = new JSONObject(sb.toString()); - JSONObject params = jObj.getJSONObject("params"); - Mode mode = Mode.valueOf(params.getString("mode")); - switch (mode) { - case ADDFOLDER: - responseJsonObject = addFolder(params, request); - break; - case COPY: - responseJsonObject = copy(params, request); - break; - case DELETE: - responseJsonObject = delete(params, request); - break; - case EDITFILE: - responseJsonObject = editFile(params); - break; - case VIEWPOLICY: - responseJsonObject = editFile(params); - break; - case LIST: - responseJsonObject = list(params, request); - break; - case RENAME: - responseJsonObject = rename(params, request); - break; - case DESCRIBEPOLICYFILE: - responseJsonObject = describePolicy(params); - break; - case ADDSUBSCOPE: - responseJsonObject = addFolder(params, request); - break; - case SWITCHVERSION: - responseJsonObject = switchVersion(params, request); - break; - default: - throw new ServletException("not implemented"); - } - if (responseJsonObject == null) { - responseJsonObject = error("generic error : responseJsonObject is null"); - } - } catch (Exception e) { - LOG.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Exception Occured While doing File Operation" + e); - responseJsonObject = error(e.getMessage()); - } - response.setContentType("application/json"); - PrintWriter out = response.getWriter(); - out.print(responseJsonObject); - out.flush(); - } - - //Switch Version Functionality - private JSONObject switchVersion(JSONObject params, HttpServletRequest request) throws ServletException{ - String path = params.getString("path"); - String userId = null; - try { - userId = UserUtils.getUserIdFromCookie(request); - } catch (Exception e) { - LOG.error("Exception Occured while reading userid from cookie" +e); - } - if(params.toString().contains("activeVersion")){ - String activeVersion = params.getString("activeVersion"); - String highestVersion = params.getString("highestVersion"); - if(Integer.parseInt(activeVersion) > Integer.parseInt(highestVersion)){ - return error("The Version shouldn't be greater than Highest Value"); - }else{ - String removeExtension = path.replace(".xml", ""); - String policyName = removeExtension.substring(0, removeExtension.lastIndexOf(".")); - String activePolicy = policyName + "." + activeVersion + ".xml"; - File file = new File(Paths.get(REPOSITORY_BASE_PATH, activePolicy).toString()); - if(!file.exists()){ - return error("The Policy is Not Existing in Workspace"); - }else{ - if(policyName.contains("/")){ - policyName = policyName.replace("/", File.separator); - } - policyName = policyName.substring(policyName.indexOf(File.separator)+1); - if(policyName.contains("\\")){ - policyName = policyName.replace(File.separator, "\\"); - } - String query = "update PolicyVersion set active_version='"+activeVersion+"' where policy_name ='" +policyName+"' and id >0"; - //query the database - PolicyController.updatePolicyVersion(query); - //Policy Notification - PolicyController controller = new PolicyController(); - PolicyVersion entity = new PolicyVersion(); - entity.setPolicyName(policyName); - entity.setActiveVersion(Integer.parseInt(activeVersion)); - entity.setModifiedBy(userId); - controller.WatchPolicyFunction(entity, policyName, "SwitchVersion"); - } - } - } - File policyFile = new File(REPOSITORY_BASE_PATH, path); - PolicyController policyController = new PolicyController(); - return policyController.SwitchVersionPolicyContent(policyFile); - } - - //Describe Policy - private JSONObject describePolicy(JSONObject params){ - String path = params.getString("path"); - File policyFile = new File(REPOSITORY_BASE_PATH, path); - - return HumanPolicyComponent.DescribePolicy(policyFile); - } - - //Get the List of Policies and Scopes for Showing in Editor tab - private JSONObject list(JSONObject params, HttpServletRequest request) throws ServletException { - Set scopes = null; - List roles = null; - try { - //Get the Login Id of the User from Request - String userId = UserUtils.getUserIdFromCookie(request); - //Check if the Role and Scope Size are Null get the values from db. - List userRoles = PolicyController.getRoles(userId); - roles = new ArrayList(); - scopes = new HashSet(); - for(Roles userRole: userRoles){ - roles.add(userRole.getRole()); - if(userRole.getScope() != null){ - if(userRole.getScope().contains(",")){ - String[] multipleScopes = userRole.getScope().split(","); - for(int i =0; i < multipleScopes.length; i++){ - scopes.add(multipleScopes[i]); - } - }else{ - scopes.add(userRole.getScope()); - } - } - } - if (roles.contains(ADMIN) || roles.contains(EDITOR) || roles.contains(GUEST) ) { - if(scopes.isEmpty()){ - return error("No Scopes has been Assigned to the User. Please, Contact Super-Admin"); - } - } - - List resultList = new ArrayList(); - SimpleDateFormat dt = new SimpleDateFormat(DATE_FORMAT); - boolean onlyFolders = params.getBoolean("onlyFolders"); - String path = params.getString("path"); - if(path.contains("..xml")){ - path = path.replaceAll("..xml", "").trim(); - } - - - if("/".equals(path)){ - if(roles.contains(SUPERADMIN) || roles.contains(SUPEREDITOR) || roles.contains(SUPERGUEST)){ - try (DirectoryStream directoryStream = Files.newDirectoryStream(Paths.get(REPOSITORY_BASE_PATH, path))) { - for (Path pathObj : directoryStream) { - BasicFileAttributes attrs = Files.readAttributes(pathObj, BasicFileAttributes.class); - if (onlyFolders && !attrs.isDirectory()) { - continue; - } - JSONObject el = new JSONObject(); - String fileName = pathObj.getFileName().toString(); - if (!(fileName.equals(".DS_Store") || fileName.contains(".git"))) { - if(!fileName.endsWith(".xml")){ - el.put("name", fileName); - el.put("date", dt.format(new Date(attrs.lastModifiedTime().toMillis()))); - el.put("size", attrs.size()); - el.put("type", attrs.isDirectory() ? "dir" : "file"); - resultList.add(el); - } - } - } - } catch (IOException ex) { - LOG.error("Error Occured While reading Policy Files List"+ex ); - } - }else if(roles.contains(ADMIN) || roles.contains(EDITOR) || roles.contains(GUEST)){ - for(Object scope : scopes){ - JSONObject el = new JSONObject(); - Path filePath = Paths.get(REPOSITORY_BASE_PATH + File.separator + scope); - if(Files.exists(filePath)){ - el.put("name", scope); - el.put("date", dt.format(filePath.toFile().lastModified())); - el.put("size", ""); - el.put("type", "dir"); - resultList.add(el); - } - } - } - }else{ - try{ - String scopeName = path.substring(path.indexOf("/") +1); - activePolicyList(scopeName, resultList, roles, scopes, onlyFolders); - } catch (Exception ex) { - LOG.error("Error Occured While reading Policy Files List"+ex ); - } - } - - return new JSONObject().put(RESULT, resultList); - } catch (Exception e) { - LOG.error("list", e); - return error(e.getMessage()); - } - } - - //Get Active Policy List based on Scope Selection form Policy Version table - private void activePolicyList(String scopeName, List resultList, List roles, Set scopes, boolean onlyFolders){ - if(scopeName.contains("/")){ - scopeName = scopeName.replace("/", File.separator); - } - if(scopeName.contains("\\")){ - scopeName = scopeName.replace("\\", "\\\\\\\\"); - } - String query = "from PolicyVersion where POLICY_NAME like'" +scopeName+"%'"; - String scopeNamequery = "from PolicyEditorScopes where SCOPENAME like'" +scopeName+"%'"; - List activePolicies = PolicyController.getListOfActivePolicies(query); - List scopesList = PolicyController.getListOfPolicyEditorScopes(scopeNamequery); - for(PolicyEditorScopes scopeById : scopesList){ - String scope = scopeById.getScopeName(); - if(scope.contains(File.separator)){ - String checkScope = scope.substring(0, scope.lastIndexOf(File.separator)); - if(scopeName.contains("\\\\")){ - scopeName = scopeName.replace("\\\\", File.separator); - } - if(scopeName.equalsIgnoreCase(checkScope)){ - JSONObject el = new JSONObject(); - Path filePath = Paths.get(REPOSITORY_BASE_PATH + File.separator + scope); - if(Files.exists(filePath)){ - el.put("name", filePath.getFileName()); - el.put("date", scopeById.getModifiedDate()); - el.put("size", ""); - el.put("type", "dir"); - el.put("createdBy", scopeById.getUserCreatedBy().getUserName()); - el.put("modifiedBy", scopeById.getUserModifiedBy().getUserName()); - resultList.add(el); - } - } - } - } - for (PolicyVersion policy : activePolicies) { - String scopeNameValue = policy.getPolicyName().substring(0, policy.getPolicyName().lastIndexOf(File.separator)); - String activepath = REPOSITORY_BASE_PATH + File.separator + policy.getPolicyName() + "." + policy.getActiveVersion() + ".xml"; - Path pathObj = Paths.get(activepath); - if(Files.exists(pathObj)){ - BasicFileAttributes attrs; - try { - attrs = Files.readAttributes(pathObj, BasicFileAttributes.class); - if (onlyFolders && !attrs.isDirectory()) { - continue; - } - if(roles.contains(SUPERADMIN) || roles.contains(SUPEREDITOR) || roles.contains(SUPERGUEST)){ - readPolicies(pathObj, attrs, scopeName, resultList); - }else if(!scopes.isEmpty()){ - for(String value : scopes){ - if(scopeNameValue.startsWith(value)){ - readPolicies(pathObj, attrs, scopeName, resultList); - } - } - } - } catch (Exception e) { - LOG.error(XACMLErrorConstants.ERROR_PROCESS_FLOW+"Exception occured while reading File Attributes"+e); - } - } - } - } - - //Read the Policy File to get Created by and Modified by User Name of Policy - public void readPolicies(Path pathObj, BasicFileAttributes attrs, String scopeName, List resultList){ - JSONObject el = new JSONObject(); - String policyName = ""; - String version = ""; - String scope = ""; - if(scopeName.contains("\\\\")){ - scopeName = scopeName.replace("\\\\", File.separator); - } - SimpleDateFormat dt = new SimpleDateFormat(DATE_FORMAT); - String fileName = pathObj.getFileName().toString(); - if (!(fileName.equals(".DS_Store") || fileName.startsWith(".git"))) { - if(fileName.endsWith(".xml")){ - fileName = fileName.substring(0, fileName.lastIndexOf('.')); - fileName = fileName.substring(0, fileName.lastIndexOf('.')); - //Query the database - String parent = pathObj.toString().substring(pathObj.toString().indexOf(REPOSITORY)+ 11); - parent = FilenameUtils.removeExtension(parent); - version = parent.substring(parent.indexOf(".")+1); - policyName = parent.substring(0, parent.lastIndexOf(".")); - scope = policyName.substring(0, policyName.lastIndexOf(File.separator)); - if(policyName.contains("\\")){ - policyName = scope + "\\" + policyName.substring(policyName.lastIndexOf("\\")); - } - } - if(scopeName.equalsIgnoreCase(scope)){ - el.put("name", fileName); - if(pathObj.toFile().toString().endsWith(".xml")){ - el.put("version", version); - List createdByModifiedBy; - try { - createdByModifiedBy = XACMLPolicyScanner.getCreatedByModifiedBy(pathObj); - } catch (IOException e) { - LOG.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error while Reading the Policy File" + pathObj.toString() + e.getMessage()); - createdByModifiedBy = Arrays.asList("", ""); - } - el.put("createdBy", getUserName(createdByModifiedBy.get(0))); - el.put("modifiedBy", getUserName(createdByModifiedBy.get(1))); - } - el.put("date", dt.format(new Date(attrs.lastModifiedTime().toMillis()))); - el.put("size", attrs.size()); - el.put("type", attrs.isDirectory() ? "dir" : "file"); - } - } - - if(!el.keySet().isEmpty()){ - resultList.add(el); - } - - } - - //Get the User Name based on ID from User Info table - public String getUserName(String userId) { - String userName = "super-admin"; - if("".equals(userId)){ - return userName; - } - try{ - return PolicyController.getUserName(userId); - }catch(Exception e){ - LOG.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Error Occured while Retriving User Name from User Info table"+e); - return userName; - } - } - - //Rename Policy - private JSONObject rename(JSONObject params, HttpServletRequest request) throws ServletException { - try { - String userId = null; - try { - userId = UserUtils.getUserIdFromCookie(request); - } catch (Exception e) { - LOG.error("Exception Occured while reading userid from cookie" +e); - } - String path = params.getString("path"); - String newpath = params.getString("newPath"); - LOG.debug("rename from: {} to: {}" +path + newpath); - - File srcFile = new File(REPOSITORY_BASE_PATH, path); - File destFile = new File(REPOSITORY_BASE_PATH, newpath); - if (srcFile.isFile()) { - renameXMLandConfig(destFile.getPath().toString(), srcFile.getPath().toString(), userId); - } else { - FileUtils.moveDirectory(srcFile, destFile); - String oldScopeName = path.substring(1).replace("/", File.separator); - String newScopeName = newpath.substring(1).replace("/", File.separator); - String scopeNamequery = "from PolicyEditorScopes where SCOPENAME like'" +oldScopeName.replace("\\", "\\\\\\\\")+"%'"; - UserInfo userInfo = new UserInfo(); - userInfo.setUserLoginId(userId); - List scopesList = PolicyController.getListOfPolicyEditorScopes(scopeNamequery); - for(PolicyEditorScopes scopes : scopesList){ - String scope = scopes.getScopeName(); - String newScope = scope.replace(oldScopeName, newScopeName); - scopes.setScopeName(newScope); - scopes.setUserModifiedBy(userInfo); - PolicyController.updatePolicyScopeEditor(scopes); - } - File[] list = destFile.listFiles(); - if(list.length > 0){ - renameXMLandConfig(destFile.getPath().toString(), srcFile.getPath().toString(), userId); - } - } - return success(); - } catch (Exception e) { - LOG.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Exception Occured While Renaming Policy"+e); - return error(e.getMessage()); - } - } - - //rename the xml and config files when renaming scope - public void renameXMLandConfig(String newPath, String oldPath, String loginId){ - if(!newPath.endsWith(".xml")){ - File dir = new File(newPath); - File[] listOfFiles = dir.listFiles(); - for(File file : listOfFiles){ - if(file.toString().endsWith(".xml")){ - renameFile(file, oldPath, newPath ); - }else if(file.isDirectory()){ - String oldFilePath = oldPath + File.separator +file.getName(); - renameXMLandConfig(file.toString(), oldFilePath, loginId); - } - } - }else{ - Path parent = Paths.get(oldPath.toString().substring(0, oldPath.toString().lastIndexOf(File.separator))); - String policyName = oldPath.toString().substring(oldPath.toString().indexOf(REPOSITORY) +11); - String removeExtension = policyName.replace(".xml", ""); - String dbPolicyName = removeExtension.substring(0, removeExtension.lastIndexOf(".")); - //Policy Notifcation - PolicyController controller = new PolicyController(); - PolicyVersion entity = new PolicyVersion(); - entity.setPolicyName(dbPolicyName); - entity.setModifiedBy(loginId); - controller.WatchPolicyFunction(entity, dbPolicyName, "Rename"); - String filterPolicyName = dbPolicyName.substring(dbPolicyName.lastIndexOf(File.separator)+1); - FileFilter fileFilter = new WildcardFileFilter(filterPolicyName + "." + "*" + ".xml"); - File[] files = parent.toFile().listFiles(fileFilter); - for(File file : files){ - String removeNewPathExtension = newPath.replace(".xml", ""); - String removeNewFileVersion = removeNewPathExtension.substring(0, removeNewPathExtension.lastIndexOf(".")); - String oldFile = file.getPath(); - oldFile = oldFile.replace(".xml", ""); - String version = oldFile.substring(oldFile.lastIndexOf(".")+1); - String finalPath = removeNewFileVersion + "." + version + ".xml"; - File destFile = new File(finalPath); - try { - FileUtils.moveFile(file, destFile); - renameFile(file, oldFile, finalPath); - } catch (IOException e) { - LOG.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Exception Occured While Renaming or Moving Policy"+e); - } - - } - } - } - - //Rename File - private void renameFile(File file, String oldPath, String newPath){ - if(file.toString().contains(CONFIG) || file.toString().contains(ACTION) || file.toString().contains(DECISION)){ - File xmlFileName = new File(newPath); - String oldfileWithExtension = null; - String filelocation = null; - String oldfile = null; - String newfile = null; - String extension = null; - if(newPath.endsWith(".xml")){ - extension = XACMLPolicyWriterWithPapNotify.changeFileNameInXmlWhenRenamePolicy(xmlFileName.toPath()); - }else{ - extension = XACMLPolicyWriterWithPapNotify.changeFileNameInXmlWhenRenamePolicy(file.toPath()); - String fileName = file.getName(); - oldPath = oldPath + File.separator + fileName; - newPath = newPath + File.separator + fileName; - } - - try{ - if(file.toString().contains(CONFIG)){ - filelocation = PolicyController.getConfigHome(); - } - if(file.toString().contains(ACTION)){ - filelocation = PolicyController.getActionHome(); - } - File oldFilePath = new File(oldPath); - String oldFileName = oldFilePath.getName().replace(".xml", ""); - File newFilePath = new File(newPath); - String newFileName = newFilePath.getName().replace(".xml", ""); - File target = new File(oldPath); - File newParentScope = new File(newPath); - if(newParentScope.toString().endsWith(".xml")){ - String newScope = newParentScope.toString().substring(0, newParentScope.toString().lastIndexOf(File.separator)); - newParentScope = new File(newScope); - } - String oldParentScope = target.toString().substring(0, target.toString().lastIndexOf(File.separator)); - String oldDomain = oldParentScope.toString().substring(oldParentScope.toString().indexOf(REPOSITORY) + 11); - if(oldDomain.endsWith(".xml")){ - oldDomain = oldDomain.substring(0, oldDomain.lastIndexOf(File.separator)); - } - oldfile = oldDomain + File.separator + oldFileName.substring(0, oldFileName.indexOf(".")); - if(oldDomain.contains(File.separator)){ - oldDomain = oldDomain.replace(File.separator, "."); - } - String newDomain = newParentScope.toString().substring(newParentScope.toString().indexOf(REPOSITORY) + 11); - newfile = newDomain + File.separator +newFileName.substring(0, newFileName.indexOf(".")); - if(newDomain.contains(File.separator)){ - newDomain = newDomain.replace(File.separator, "."); - } - if(file.toString().contains(CONFIG) || file.toString().contains(ACTION)){ - oldfileWithExtension = oldDomain + "." + oldFileName + "."+ extension; - String newfilewithExtension = newDomain + "." + newFileName + "." + extension; - File file1 = new File(filelocation, oldfileWithExtension); - file1.renameTo(new File(filelocation , newfilewithExtension)); - } - String query = "update PolicyVersion set policy_name='"+newfile.replace("\\", "\\\\")+"' where policy_name ='" +oldfile.replace("\\", "\\\\")+"' and id >0"; - //query the database - PolicyController.updatePolicyVersion(query); - }catch(Exception e){ - LOG.error(XACMLErrorConstants.ERROR_DATA_ISSUE +"Config file cannot found:" + oldfileWithExtension + e); - } - } - } - - //Clone the Policy - private JSONObject copy(JSONObject params, HttpServletRequest request) throws ServletException { - try { - String path = params.getString("path"); - String newpath = params.getString("newPath"); - LOG.debug("copy from: {} to: {}" + path +newpath); - File srcFile = new File(REPOSITORY_BASE_PATH, path); - File destFile = new File(REPOSITORY_BASE_PATH, newpath); - if (srcFile.isFile()) { - FileUtils.copyFile(srcFile, destFile); - cloneXMLandConfig(destFile, srcFile, request); - } else { - FileUtils.copyDirectory(srcFile, destFile); - } - return success(); - } catch (Exception e) { - LOG.error("copy", e); - return error(e.getMessage()); - } - } - - public void cloneXMLandConfig(File newPath, File oldPath, HttpServletRequest request){ - String userId = null; - try { - userId = UserUtils.getUserIdFromCookie(request); - } catch (Exception e) { - LOG.error("Exception Occured while reading userid from cookie" +e); - } - String newPolicyName = newPath.getPath().toString().substring(newPath.getPath().toString().indexOf(REPOSITORY) + 11); - newPolicyName = newPolicyName.replace(".xml", ""); - String version = newPolicyName.substring(newPolicyName.lastIndexOf(".") +1); - String policyName = newPolicyName.substring(0, newPolicyName.indexOf(".")); - newPolicyName = newPolicyName.replace(File.separator, "."); - //if the user leaves the name of the policy blank - if (newPolicyName == null) { - return; - }else{ - Path newPolicyPath = newPath.toPath(); - File dir = null; - File[] listOfFiles = null; - if(newPolicyName.contains(CONFIG)){ - LOG.debug("CONFIG_HOME: "+CONFIG_HOME); - dir=new File(CONFIG_HOME); - listOfFiles = dir.listFiles(); - }else if(newPolicyName.contains(ACTION)){ - LOG.debug("ACTION_HOME: "+ACTION_HOME); - dir=new File(ACTION_HOME); - listOfFiles = dir.listFiles(); - } - String indexValue = ""; - String orignalPolicyName = oldPath.getPath().toString().substring(oldPath.getPath().toString().indexOf(REPOSITORY) + 11); - orignalPolicyName = orignalPolicyName.replace(".xml", ""); - orignalPolicyName = orignalPolicyName.replace(File.separator, "."); - if(orignalPolicyName.contains("Config_Fault_")){ - indexValue = "Config_Fault_"; - } else if(orignalPolicyName.contains("Config_PM_")){ - indexValue = "Config_PM_"; - }else if(orignalPolicyName.contains("Config_FW")){ - indexValue = "Config_FW_"; - }else if(orignalPolicyName.contains("Config_BRMS_Param")){ - indexValue = "Config_BRMS_Param_"; - }else if(orignalPolicyName.contains("Config_BRMS_Raw")){ - indexValue = "Config_BRMS_Raw_"; - } else if(orignalPolicyName.contains("Config_MS")){ - indexValue = "Config_MS_"; - }else if(orignalPolicyName.contains(ACTION)){ - indexValue = ACTION; - }else if(orignalPolicyName.contains(DECISION)){ - indexValue = DECISION; - }else{ - indexValue = CONFIG; - } - File newConfigFile = null; - - //making changes to the xml file - if(indexValue.contains(CONFIG) || indexValue.contains(ACTION)){ - for (File file : listOfFiles) { - if (file.isFile()){ - String fileName=file.getName(); - if(fileName.contains(orignalPolicyName)){ - String newConfigFileName=fileName.replaceAll(orignalPolicyName,newPolicyName); - if(dir.toString().contains(File.separator)){ - newConfigFile=new File(dir.toString()+ File.separator +newConfigFileName); - } - try { - Files.copy(file.toPath(), newConfigFile.toPath()); - } catch (Exception e) { - LOG.error(XACMLErrorConstants.ERROR_DATA_ISSUE +"Error while Cloning the config file" + e); - return; - } - } - } - } - XACMLPolicyWriterWithPapNotify.changeFileNameInXmlWhenRenamePolicy(newPolicyPath); - } - //set the clone policy name into policy version database table - PolicyVersion entityItem = new PolicyVersion(); - entityItem.setActiveVersion(Integer.parseInt(version)); - entityItem.setHigherVersion(Integer.parseInt(version)); - entityItem.setPolicyName(policyName); - entityItem.setCreatedBy(userId); - entityItem.setModifiedBy(userId); - PolicyController.SaveToPolicyVersion(entityItem); - - - new Thread(new Runnable() { - @Override - public void run() { - try { - ElkConnector.singleton.update(newPolicyPath.toFile()); - if (LOG.isInfoEnabled()) { - LOG.info("ELK cloning to " + newPolicyPath); - } - } catch (Exception e) { - LOG.warn(XACMLErrorConstants.ERROR_DATA_ISSUE + ": Internal Error: Unsucessful clone: " + e.getMessage(), e); - } - } - }).start(); - - //send to pap - XACMLPolicyWriterWithPapNotify.notifyPapOfCreateUpdate(newPolicyPath.toAbsolutePath().toString()); - LOG.info("Cloned policy "+newPolicyName+" created successfully."); - return; - } - } - - //Delete Policy or Scope Functionality - private JSONObject delete(JSONObject params, HttpServletRequest request) throws ServletException { - try { - String userId = UserUtils.getUserIdFromCookie(request); - String deleteVersion = ""; - String path1 = params.getString("path"); - LOG.debug("delete {}" +path1); - if(params.has("deleteVersion")){ - deleteVersion = params.getString("deleteVersion"); - } - - this.repofilePath = new File(REPOSITORY_BASE_PATH, path1); - File policyFile = new File(REPOSITORY_BASE_PATH, path1); - if("ALL".equals(deleteVersion)){ - String removexmlExtension = policyFile.toString().substring(0, policyFile.toString().lastIndexOf(".")); - String removeVersion = removexmlExtension.substring(0, removexmlExtension.lastIndexOf(".")); - String notificationName = removeVersion.substring(removeVersion.lastIndexOf(REPOSITORY)+11); - //Policy Notifcation - PolicyController controller = new PolicyController(); - PolicyVersion entity = new PolicyVersion(); - entity.setPolicyName(notificationName); - entity.setModifiedBy(userId); - controller.WatchPolicyFunction(entity, notificationName, "DeleteAll"); - File dirXML = new File(policyFile.getParent()); - File[] listOfXMLFiles = dirXML.listFiles(); - for (File file : listOfXMLFiles) { - //delete the xml files from Repository - if (file.isFile() && file.toString().contains(removeVersion)) { - if(XACMLPolicyWriterWithPapNotify.notifyPapOfDelete(file.toString())){ - LOG.info("Policy deleted from database. Continuing with file delete"); - } else { - LOG.error("Failed to delete Policy from database. Aborting file delete"); - } - //Elk Update - updateElkOnPolicyDelete(file); - - if (file.delete()) { - if (LOG.isDebugEnabled()) { - LOG.debug("Deleted file: " + file.toString()); - } - } else { - LOG.warn(XACMLErrorConstants.ERROR_DATA_ISSUE + "Cannot delete the policy file in specified location: " + file.getAbsolutePath()); - } - - // Get tomcat home directory for deleting config data - String path = getParentPathSubScopeDir(); - path = path.replace('\\', '.'); - if(path.contains("/")){ - path = path.replace('/', '.'); - } - String fileName = FilenameUtils.removeExtension(file.getName()); - String removeVersionInFileName = fileName.substring(0, fileName.lastIndexOf(".")); - String fileLocation = null; - if (fileName != null && fileName.contains(CONFIG)) { - fileLocation = CONFIG_HOME; - } else if (fileName != null && fileName.contains(ACTION)) { - fileLocation = ACTION_HOME; - } - if (LOG.isDebugEnabled()) { - LOG.debug("Attempting to rename file from the location: "+ fileLocation); - } - if(!file.toString().contains(DECISION)){ - // Get the file from the saved location - File dir = new File(fileLocation); - File[] listOfFiles = dir.listFiles(); - - for (File file1 : listOfFiles) { - if (file1.isFile() && file1.getName().contains( path + removeVersionInFileName)) { - try { - if (file1.delete() == false) { - throw new Exception("No known error, Delete failed"); - } - } catch (Exception e) { - LOG.error("Failed to Delete file: "+ e.getLocalizedMessage()); - } - } - } - } - - //Delete the Policy from Database Policy Version table - String removeExtension = removeVersion.substring(removeVersion.indexOf(REPOSITORY)+11); - String policyVersionQuery = "delete from PolicyVersion where policy_name ='" +removeExtension.replace("\\", "\\\\")+"' and id >0"; - if(policyVersionQuery != null){ - PolicyController.updatePolicyVersion(policyVersionQuery); - } - } - } - //If Only Particular version to be deleted - }else if("CURRENT".equals(deleteVersion)){ - String removexmlExtension = policyFile.toString().substring(0, policyFile.toString().lastIndexOf(".")); - String getVersion = removexmlExtension.substring(removexmlExtension.indexOf(".")+1); - String removeVersion = removexmlExtension.substring(0, removexmlExtension.lastIndexOf(".")); - String notificationName = removeVersion.substring(removeVersion.lastIndexOf(REPOSITORY)+11); - //Policy Notifcation - PolicyController controller = new PolicyController(); - PolicyVersion entity = new PolicyVersion(); - entity.setPolicyName(notificationName); - entity.setActiveVersion(Integer.parseInt(getVersion)); - entity.setModifiedBy(userId); - controller.WatchPolicyFunction(entity, notificationName, "DeleteOne"); - if(XACMLPolicyWriterWithPapNotify.notifyPapOfDelete(policyFile.toString())){ - LOG.info("Policy deleted from database. Continuing with file delete"); - } else { - LOG.error("Failed to delete Policy from database. Aborting file delete"); - } - //Elk Update - updateElkOnPolicyDelete(policyFile); - - if (policyFile.delete()) { - LOG.debug("Deleted file: " + policyFile.toString()); - } else { - LOG.warn(XACMLErrorConstants.ERROR_DATA_ISSUE + "Cannot delete the policy file in specified location: " +policyFile.getAbsolutePath()); - } - - // Get tomcat home directory for storing action body config data - String path = getParentPathSubScopeDir(); - path = path.replace('\\', '.'); - if(path.contains("/")){ - path = path.replace('/', '.'); - LOG.info("print the path:" +path); - } - final String tempPath = path; - String fileName = FilenameUtils.removeExtension(policyFile.getName()); - String fileLocation = null; - if (fileName != null && fileName.contains(CONFIG)) { - fileLocation = CONFIG_HOME; - } else if (fileName != null && fileName.contains(ACTION)) { - fileLocation = ACTION_HOME; - } - if (LOG.isDebugEnabled()) { - LOG.debug("Attempting to delete file from the location: "+ fileLocation); - } - if(!policyFile.toString().contains(DECISION)){ - // Get the file from the saved location - File dir = new File(fileLocation); - File[] listOfFiles = dir.listFiles(); - - for (File file : listOfFiles) { - if (file.isFile() && file.toString().contains( tempPath + fileName)) { - try { - if (file.delete() == false) { - throw new Exception("No known error, Delete failed"); - } - } catch (Exception e) { - LOG.error("Failed to Delete file: "+ e.getLocalizedMessage()); - } - } - } - } - //Delete the Policy from Database and set Active Version based on the deleted file. - int highestVersion = 0; - String removeExtension = removeVersion.substring(removeVersion.indexOf(REPOSITORY)+11); - PolicyVersion policyVersionEntity = PolicyController.getPolicyEntityFromPolicyVersion(removeExtension); - if(policyVersionEntity != null){ - highestVersion = policyVersionEntity.getHigherVersion(); - } - int i =0; - int version = Integer.parseInt(getVersion); - if(version == highestVersion){ - for(i = highestVersion; i >= 1 ; i--){ - highestVersion = highestVersion-1; - path = removeVersion + "."+ highestVersion +".xml"; - File file = new File(path); - if(file.exists()){ - break; - } - } - } - String updatequery = "update PolicyVersion set active_version='"+highestVersion+"' , highest_version='"+highestVersion+"' where policy_name ='" +removeExtension.replace("\\", "\\\\")+"'"; - PolicyController.updatePolicyVersion(updatequery); - }else{ - String scopeName = policyFile.getAbsolutePath().substring(policyFile.getAbsolutePath().indexOf(REPOSITORY)+11); - String policyVersionQuery = "delete PolicyVersion where POLICY_NAME like '"+scopeName.replace("\\", "\\\\")+"%' and id >0"; - String policyScopeQuery = "delete PolicyEditorScopes where SCOPENAME like '"+scopeName.replace("\\", "\\\\")+"%' and id >0"; - PolicyController.updatePolicyVersion(policyVersionQuery); - PolicyController.updatePolicyScopeEditorWithQuery(policyScopeQuery); - delete(policyFile); - //Policy Notifcation - PolicyController controller = new PolicyController(); - PolicyVersion entity = new PolicyVersion(); - entity.setPolicyName(scopeName); - entity.setModifiedBy(userId); - controller.WatchPolicyFunction(entity, scopeName, "DeleteScope"); - } - return success(); - } catch (Exception e) { - LOG.error("delete", e); - return error(e.getMessage()); - } - } - - //Notify ELK on File Delete - private void updateElkOnPolicyDelete(File file){ - try { - ElkConnector.singleton.delete(file); - } catch (Exception e) { - LOG.warn(XACMLErrorConstants.ERROR_DATA_ISSUE + ": Cannot delete: " + file.getName() + - " at " + file.getAbsolutePath() + ": " + e.getMessage(), e); - } - } - //Deletes Files when Scope is Selected to delete - public void delete(File file) throws IOException{ - if(file.isDirectory()){ - //directory is empty, then delete it - if(file.list().length==0){ - file.delete(); - }else{ - //list all the directory contents - String[] files = file.list(); - for (String temp : files) { - //construct the file structure - File fileDelete = new File(file, temp); - //delete from Elk first - if(fileDelete.getAbsolutePath().toString().endsWith(".xml")){ - try { - String deleteFile= fileDelete.getAbsoluteFile().toString().substring(fileDelete.getAbsoluteFile().toString().indexOf("workspace")); - File deletePath= new File(deleteFile); - LOG.debug("Search:"+deletePath); - ElkConnector.singleton.delete(deletePath); - } catch (Exception e) { - LOG.warn(XACMLErrorConstants.ERROR_DATA_ISSUE + ": Cannot delete: " + fileDelete.getAbsoluteFile().getName() + - " at " + fileDelete.getAbsoluteFile().getAbsolutePath() + ": " +e.getMessage(), e); - } - } - - //recursive delete - delete(fileDelete); - - //Delete the Configuration files from Config and Action Home Location - String fileLocation = null; - String policyName = fileDelete.toString().substring(fileDelete.toString().indexOf(REPOSITORY)+11, fileDelete.toString().lastIndexOf(".")); - if(policyName.contains(CONFIG)){ - fileLocation = PolicyController.getConfigHome(); - } - if(policyName.contains(ACTION)){ - fileLocation = PolicyController.getActionHome(); - } - if(policyName.contains(File.separator)){ - policyName = policyName.replace(File.separator, "."); - } - if(!fileDelete.toString().contains(DECISION) && fileLocation != null){ - // Get the file from the saved location and delete - File dir = new File(fileLocation); - FileFilter fileFilter = new WildcardFileFilter(policyName + ".*"); - File[] configFiles = (dir).listFiles(fileFilter); - if(configFiles.length > 0){ - configFiles[0].delete(); - } - } - //Notify the PAP and Elk database for deleting the Policies Under Scopes - if(fileDelete.getAbsolutePath().toString().endsWith(".xml")){ - if(!XACMLPolicyWriterWithPapNotify.notifyPapOfDelete(fileDelete.getAbsolutePath().toString())){ - LOG.error(XACMLErrorConstants.ERROR_PROCESS_FLOW+"Could not delete the policy from the database: "+ - fileDelete.getAbsolutePath().toString()); - throw new IOException("Could not delete the policy from the database: "+ - fileDelete.getAbsolutePath().toString()); - } - } - } - //check the directory again, if empty then delete it - if(file.list().length==0){ - file.delete(); - } - } - }else{ - //if file, then delete it - file.delete(); - } - } - - //Get the Parent Scope of File - protected String getParentPathSubScopeDir() { - String domain1 = null; - final Path gitPath = PolicyController.getGitPath(); - String policyDir = this.repofilePath.getAbsolutePath(); - int startIndex = policyDir.indexOf(gitPath.toString()) + gitPath.toString().length() + 1; - policyDir = policyDir.substring(startIndex, policyDir.length()); - if(policyDir.contains(CONFIG)){ - domain1 = policyDir.substring(0,policyDir.indexOf(CONFIG)); - }else if(policyDir.contains(ACTION)){ - domain1 = policyDir.substring(0,policyDir.indexOf(ACTION)); - }else{ - domain1 = policyDir.substring(0,policyDir.indexOf(DECISION)); - } - LOG.info("print the main domain value"+policyDir); - return domain1; - } - - //Edit the Policy - private JSONObject editFile(JSONObject params) throws ServletException { - // get content - try { - String mode = params.getString("mode"); - String path = params.getString("path"); - LOG.debug("editFile path: {}"+ path); - - File policyFile = new File(REPOSITORY_BASE_PATH, path); - - Object policy = XACMLPolicyScanner.readPolicy(new FileInputStream(policyFile)); - Path fullPath = Paths.get(policyFile.getAbsolutePath(), new String[0]); - PolicyAdapter policyAdapter = new PolicyAdapter(); - policyAdapter.setData(policy); - String dirPath = fullPath.getParent().toString().substring(fullPath.getParent().toString().lastIndexOf(REPOSITORY)+11); - policyAdapter.setDirPath(dirPath); - policyAdapter.setParentPath(fullPath.getParent()); - - if("viewPolicy".equalsIgnoreCase(mode)){ - policyAdapter.setReadOnly(true); - policyAdapter.setEditPolicy(false); - }else{ - policyAdapter.setReadOnly(false); - policyAdapter.setEditPolicy(true); - } - - policyAdapter.setPolicyData(policy); - policyAdapter.setPolicyName(FilenameUtils.removeExtension(policyFile.getName())); - - String policyNameValue = null ; - String configPolicyName = null ; - if(policyAdapter.getPolicyName().startsWith("Config_PM")){ - policyNameValue = policyAdapter.getPolicyName().substring(0, policyAdapter.getPolicyName().indexOf("_")); - configPolicyName = "ClosedLoop_PM"; - }else if(policyAdapter.getPolicyName().startsWith("Config_Fault")){ - policyNameValue = policyAdapter.getPolicyName().substring(0, policyAdapter.getPolicyName().indexOf("_")); - configPolicyName = "ClosedLoop_Fault"; - }else if(policyAdapter.getPolicyName().startsWith("Config_FW")){ - policyNameValue = policyAdapter.getPolicyName().substring(0, policyAdapter.getPolicyName().indexOf("_")); - configPolicyName = "Firewall Config"; - }else if(policyAdapter.getPolicyName().startsWith("Config_BRMS_Raw")){ - policyNameValue = policyAdapter.getPolicyName().substring(0, policyAdapter.getPolicyName().indexOf("_")); - configPolicyName = "BRMS_Raw"; - }else if(policyAdapter.getPolicyName().startsWith("Config_BRMS_Param")){ - policyNameValue = policyAdapter.getPolicyName().substring(0, policyAdapter.getPolicyName().indexOf("_")); - configPolicyName = "BRMS_Param"; - }else if(policyAdapter.getPolicyName().startsWith("Config_MS")){ - policyNameValue = policyAdapter.getPolicyName().substring(0, policyAdapter.getPolicyName().indexOf("_")); - configPolicyName = "DCAE Micro Service"; - }else if(policyAdapter.getPolicyName().startsWith("Action") || policyAdapter.getPolicyName().startsWith("Decision") ){ - policyNameValue = policyAdapter.getPolicyName().substring(0, policyAdapter.getPolicyName().indexOf("_")); - } - else{ - policyNameValue = policyAdapter.getPolicyName().substring(0, policyAdapter.getPolicyName().indexOf("_")); - configPolicyName = "Base"; - } - if (policyNameValue != null) { - policyAdapter.setPolicyType(policyNameValue); - } - if (configPolicyName != null) { - policyAdapter.setConfigPolicyType(configPolicyName); - } - - if("Action".equalsIgnoreCase(policyAdapter.getPolicyType())){ - ActionPolicyController actionController = new ActionPolicyController(); - actionController.PrePopulateActionPolicyData(policyAdapter); - } - if("Decision".equalsIgnoreCase(policyAdapter.getPolicyType())){ - DecisionPolicyController decisionController = new DecisionPolicyController(); - decisionController.PrePopulateDecisionPolicyData(policyAdapter); - } - if("Config".equalsIgnoreCase(policyAdapter.getPolicyType())){ - if("Base".equalsIgnoreCase(policyAdapter.getConfigPolicyType())){ - CreatePolicyController baseController = new CreatePolicyController(); - baseController.PrePopulateBaseConfigPolicyData(policyAdapter); - } - else if("BRMS_Raw".equalsIgnoreCase(policyAdapter.getConfigPolicyType())){ - CreateBRMSRawController brmsController = new CreateBRMSRawController(); - brmsController.PrePopulateBRMSRawPolicyData(policyAdapter); - } - else if("BRMS_Param".equalsIgnoreCase(policyAdapter.getConfigPolicyType())){ - CreateBRMSParamController paramController = new CreateBRMSParamController(); - paramController.PrePopulateBRMSParamPolicyData(policyAdapter); - } - else if("ClosedLoop_Fault".equalsIgnoreCase(policyAdapter.getConfigPolicyType())){ - CreateClosedLoopFaultController newFaultTemplate = new CreateClosedLoopFaultController(); - newFaultTemplate.PrePopulateClosedLoopFaultPolicyData(policyAdapter); - } - else if("ClosedLoop_PM".equalsIgnoreCase(policyAdapter.getConfigPolicyType())){ - CreateClosedLoopPMController pmController = new CreateClosedLoopPMController(); - pmController.PrePopulateClosedLoopPMPolicyData(policyAdapter); - } - else if("DCAE Micro Service".equalsIgnoreCase(policyAdapter.getConfigPolicyType())){ - CreateDcaeMicroServiceController msController = new CreateDcaeMicroServiceController(); - msController.PrePopulateDCAEMSPolicyData(policyAdapter); - } - else if("Firewall Config".equalsIgnoreCase(policyAdapter.getConfigPolicyType())){ - CreateFirewallController firewallController = new CreateFirewallController(); - firewallController.PrePopulateFWPolicyData(policyAdapter); - } - } - - - policyAdapter.setParentPath(null); - ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(policyAdapter); - JsonNode jsonNode = mapper.readTree(json); - - return new JSONObject().put(RESULT, jsonNode); - } catch (Exception e) { - LOG.error("editFile", e); - return error(e.getMessage()); - } - } - - //Add Scopes - private JSONObject addFolder(JSONObject params, HttpServletRequest request) throws ServletException { - String name = ""; - - try { - String userId = UserUtils.getUserIdFromCookie(request); - String path = params.getString("path"); - try{ - if(params.has("subScopename")){ - if(!params.getString("subScopename").equals("")){ - name = params.getString("path").replace("/", File.separator) + File.separator +params.getString("subScopename"); - } - }else{ - name = params.getString("name"); - } - }catch(Exception e){ - name = params.getString("name"); - LOG.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Exception Occured While Adding Scope"+e); - } - - - LOG.debug("addFolder path: {} name: {}" + path +name); - File newDir = new File(REPOSITORY_BASE_PATH, name); - if(!newDir.exists()){ - if (!newDir.mkdir()) { - throw new Exception("Can't create directory: " + newDir.getAbsolutePath()); - } - UserInfo userInfo = new UserInfo(); - userInfo.setUserLoginId(userId); - PolicyEditorScopes newScope = new PolicyEditorScopes(); - String scopeName = null; - if(name.startsWith(File.separator)){ - scopeName = name.substring(1); - }else{ - scopeName = name; - } - newScope.setScopeName(scopeName); - newScope.setUserCreatedBy(userInfo); - newScope.setUserModifiedBy(userInfo); - PolicyController.SavePolicyScope(newScope); - }else{ - return error("Scope Already Exists"); - } - - return success(); - } catch (Exception e) { - LOG.error("addFolder", e); - return error(e.getMessage()); - } - } - - //Return Error Object - private JSONObject error(String msg) throws ServletException { - try { - JSONObject result = new JSONObject(); - result.put("success", false); - result.put("error", msg); - return new JSONObject().put(RESULT, result); - } catch (JSONException e) { - throw new ServletException(e); - } - } - - //Return Success Object - private JSONObject success() throws ServletException { - try { - JSONObject result = new JSONObject(); - result.put("success", true); - result.put("error", (Object) null); - return new JSONObject().put(RESULT, result); - } catch (JSONException e) { - throw new ServletException(e); - } - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PolicyNotificationMail.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PolicyNotificationMail.java deleted file mode 100644 index 186adfa29..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/PolicyNotificationMail.java +++ /dev/null @@ -1,140 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.admin; - -/* - * - * - * - * */ -import java.io.UnsupportedEncodingException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Properties; - -import javax.mail.MessagingException; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeMessage; - -import org.openecomp.policy.controller.PolicyController; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.WatchPolicyNotificationTable; -import org.springframework.beans.factory.annotation.Configurable; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.mail.javamail.JavaMailSenderImpl; -import org.springframework.mail.javamail.MimeMessageHelper; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Configurable -public class PolicyNotificationMail{ - private static Logger logger = FlexLogger.getLogger(PolicyNotificationMail.class); - - @Bean - public JavaMailSenderImpl javaMailSenderImpl(){ - JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); - mailSender.setHost(PolicyController.smtpHost); - mailSender.setPort(Integer.parseInt(PolicyController.smtpPort)); - mailSender.setUsername(PolicyController.smtpUsername); - mailSender.setPassword(PolicyController.smtpPassword); - Properties prop = mailSender.getJavaMailProperties(); - prop.put("mail.transport.protocol", "smtp"); - prop.put("mail.smtp.auth", "true"); - prop.put("mail.smtp.starttls.enable", "true"); - prop.put("mail.debug", "true"); - return mailSender; - } - - @SuppressWarnings("resource") - public void sendMail(PolicyVersion entityItem, String policyName, String mode, WatchPolicyNotificationDao policyNotificationDao) throws MessagingException { - String from = PolicyController.smtpUsername; - String to = ""; - String subject = ""; - String message = ""; - DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); - Date date = new Date(); - if(mode.equalsIgnoreCase("EditPolicy")){ - subject = "Policy has been Updated : "+entityItem.getPolicyName(); - message = "The Policy Which you are watching in " + PolicyController.smtpApplicationName + " has been Updated" + '\n' + '\n' + '\n'+ "Scope + Policy Name : " + policyName + '\n' + "Active Version : " +entityItem.getActiveVersion() - + '\n' + '\n' + "Modified By : " +entityItem.getModifiedBy() + '\n' + "Modified Time : " +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + "Policy Notification System (please don't respond to this email)"; - } - if(mode.equalsIgnoreCase("Rename")){ - subject = "Policy has been Renamed : "+entityItem.getPolicyName(); - message = "The Policy Which you are watching in " + PolicyController.smtpApplicationName + " has been Renamed" + '\n' + '\n' + '\n'+ "Scope + Policy Name : " + policyName + '\n' + "Active Version : " +entityItem.getActiveVersion() - + '\n' + '\n' + "Renamed By : " +entityItem.getModifiedBy() + '\n' + "Renamed Time : " +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + "Policy Notification System (please don't respond to this email)"; - } - if(mode.equalsIgnoreCase("DeleteAll")){ - subject = "Policy has been Deleted : "+entityItem.getPolicyName(); - message = "The Policy Which you are watching in " + PolicyController.smtpApplicationName + " has been Deleted with All Versions" + '\n' + '\n' + '\n'+ "Scope + Policy Name : " + policyName + '\n' - + '\n' + '\n' + "Deleted By : " +entityItem.getModifiedBy() + '\n' + "Deleted Time : " +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + "Policy Notification System (please don't respond to this email)"; - } - if(mode.equalsIgnoreCase("DeleteOne")){ - subject = "Policy has been Deleted : "+entityItem.getPolicyName(); - message = "The Policy Which you are watching in " + PolicyController.smtpApplicationName + " has been Deleted" + '\n' + '\n' + '\n'+ "Scope + Policy Name : " + policyName + '\n' +"Policy Version : " +entityItem.getActiveVersion() - + '\n' + '\n' + "Deleted By : " +entityItem.getModifiedBy() + '\n' + "Deleted Time : " +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + "Policy Notification System (please don't respond to this email)"; - } - if(mode.equalsIgnoreCase("DeleteScope")){ - subject = "Scope has been Deleted : "+entityItem.getPolicyName(); - message = "The Scope Which you are watching in " + PolicyController.smtpApplicationName + " has been Deleted" + '\n' + '\n' + '\n'+ "Scope + Scope Name : " + policyName + '\n' - + '\n' + '\n' + "Deleted By : " +entityItem.getModifiedBy() + '\n' + "Deleted Time : " +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + "Policy Notification System (please don't respond to this email)"; - } - if(mode.equalsIgnoreCase("SwitchVersion")){ - subject = "Policy has been SwitchedVersion : "+entityItem.getPolicyName(); - message = "The Policy Which you are watching in " + PolicyController.smtpApplicationName + " has been SwitchedVersion" + '\n' + '\n' + '\n'+ "Scope + Policy Name : " + policyName + '\n' + "Active Version : " +entityItem.getActiveVersion() - + '\n' + '\n' + "Switched By : " +entityItem.getModifiedBy() + '\n' + "Switched Time : " +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + "Policy Notification System (please don't respond to this email)"; - } - if(mode.equalsIgnoreCase("Move")){ - subject = "Policy has been Moved to Other Scope : "+entityItem.getPolicyName(); - message = "The Policy Which you are watching in " + PolicyController.smtpApplicationName + " has been Moved to Other Scope" + '\n' + '\n' + '\n'+ "Scope + Policy Name : " + policyName + '\n' + "Active Version : " +entityItem.getActiveVersion() - + '\n' + '\n' + "Moved By : " +entityItem.getModifiedBy() + '\n' + "Moved Time : " +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + "Policy Notification System (please don't respond to this email)"; - } - String policyFileName = entityItem.getPolicyName(); - List watchList = policyNotificationDao.getListDataByPolicyName(policyFileName); - if(watchList.size() > 0){ - for(WatchPolicyNotificationTable list : watchList){ - to = list.getLoginIds()+"@"+PolicyController.smtpEmailExtension; - to = to.trim(); - AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); - ctx.register(PolicyNotificationMail.class); - ctx.refresh(); - JavaMailSenderImpl mailSender = ctx.getBean(JavaMailSenderImpl.class); - MimeMessage mimeMessage = mailSender.createMimeMessage(); - MimeMessageHelper mailMsg = new MimeMessageHelper(mimeMessage); - try { - mailMsg.setFrom(new InternetAddress(from, "Policy Notification System")); - } catch (UnsupportedEncodingException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW+"Exception Occured in Policy Notification" +e); - } - mailMsg.setTo(to); - mailMsg.setSubject(subject); - mailMsg.setText(message); - mailSender.send(mimeMessage); - } - } - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/RESTfulPAPEngine.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/RESTfulPAPEngine.java deleted file mode 100644 index ecb610264..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/RESTfulPAPEngine.java +++ /dev/null @@ -1,732 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.admin; - - - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.Base64; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.io.IOUtils; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.rest.XACMLRestProperties; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.api.pap.EcompPDP; -import org.openecomp.policy.xacml.api.pap.EcompPDPGroup; -import org.openecomp.policy.xacml.api.pap.PAPPolicyEngine; -import org.openecomp.policy.xacml.std.pap.StdPAPPolicy; -import org.openecomp.policy.xacml.std.pap.StdPDP; -import org.openecomp.policy.xacml.std.pap.StdPDPGroup; -import org.openecomp.policy.xacml.std.pap.StdPDPItemSetChangeNotifier; -import org.openecomp.policy.xacml.std.pap.StdPDPPolicy; -import org.openecomp.policy.xacml.std.pap.StdPDPStatus; -import com.att.research.xacml.api.pap.PAPEngine; -import com.att.research.xacml.api.pap.PAPException; -import com.att.research.xacml.api.pap.PDP; -import com.att.research.xacml.api.pap.PDPGroup; -//import com.att.research.xacml.api.pap.PDP; -//import com.att.research.xacml.api.pap.PDPGroup; -import com.att.research.xacml.api.pap.PDPPolicy; -import com.att.research.xacml.api.pap.PDPStatus; -import com.att.research.xacml.util.XACMLProperties; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.introspect.VisibilityChecker; -import com.fasterxml.jackson.databind.type.CollectionType; -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -/** - * Implementation of the PAPEngine interface that communicates with a PAP engine in a remote servlet - * through a RESTful interface - * - * - */ -public class RESTfulPAPEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyEngine { - private static final Logger logger = FlexLogger.getLogger(RESTfulPAPEngine.class); - - // - // URL of the PAP Servlet that this Admin Console talks to - // - private String papServletURLString; - - /** - * Set up link with PAP Servlet and get our initial set of Groups - * @throws Exception - */ - public RESTfulPAPEngine (String myURLString) throws PAPException, IOException { - // - // Get our URL to the PAP servlet - // - this.papServletURLString = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL); - if (this.papServletURLString == null || this.papServletURLString.length() == 0) { - String message = "The property 'POLICYENGINE_ADMIN_ACTIVE' was not set during installation. Admin Console cannot call PAP."; - logger.error(message); - throw new PAPException(message); - } - - // - // register this Admin Console with the PAP Servlet to get updates - // - Object newURL = sendToPAP("PUT", null, null, null, "adminConsoleURL=" + myURLString); - if (newURL != null) { - // assume this was a re-direct and try again - logger.warn("Redirecting to '" + newURL + "'"); - this.papServletURLString = (String)newURL; - newURL = sendToPAP("PUT", null, null, null, "adminConsoleURL=" + myURLString); - if (newURL != null) { - logger.error("Failed to redirect to " + this.papServletURLString); - throw new PAPException("Failed to register with PAP"); - } - } - } - - - // - // High-level commands used by the Admin Console code through the PAPEngine Interface - // - - @Override - public EcompPDPGroup getDefaultGroup() throws PAPException { - EcompPDPGroup newGroup = (EcompPDPGroup)sendToPAP("GET", null, null, StdPDPGroup.class, "groupId=", "default="); - return newGroup; - } - - @Override - public void SetDefaultGroup(EcompPDPGroup group) throws PAPException { - sendToPAP("POST", null, null, null, "groupId=" + group.getId(), "default=true"); - } - - @SuppressWarnings("unchecked") - @Override - public Set getEcompPDPGroups() throws PAPException { - Set newGroupSet; - newGroupSet = (Set) this.sendToPAP("GET", null, Set.class, StdPDPGroup.class, "groupId="); - return Collections.unmodifiableSet(newGroupSet); - } - - - @Override - public EcompPDPGroup getGroup(String id) throws PAPException { - EcompPDPGroup newGroup = (EcompPDPGroup)sendToPAP("GET", null, null, StdPDPGroup.class, "groupId=" + id); - return newGroup; - } - - @Override - public void newGroup(String name, String description) - throws PAPException, NullPointerException { - String escapedName = null; - String escapedDescription = null; - try { - escapedName = URLEncoder.encode(name, "UTF-8"); - escapedDescription = URLEncoder.encode(description, "UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new PAPException("Unable to send name or description to PAP: " + e.getMessage()); - } - - this.sendToPAP("POST", null, null, null, "groupId=", "groupName="+escapedName, "groupDescription=" + escapedDescription); - } - - - /** - * Update the configuration on the PAP for a single Group. - * - * @param group - * @return - * @throws PAPException - */ - public void updateGroup(EcompPDPGroup group) throws PAPException { - - try { - - // - // ASSUME that all of the policies mentioned in this group are already located in the correct directory on the PAP! - // - // Whenever a Policy is added to the group, that file must be automatically copied to the PAP from the Workspace. - // - - -// // Copy all policies from the local machine's workspace to the PAP's PDPGroup directory. -// // This is not efficient since most of the policies will already exist there. -// // However, the policy files are (probably!) not too huge, and this is a good way to ensure that any corrupted files on the PAP get refreshed. -// - - // now update the group object on the PAP - - sendToPAP("PUT", group, null, null, "groupId=" + group.getId()); - } catch (Exception e) { - String message = "Unable to PUT policy '" + group.getId() + "', e:" + e; - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + message, e); - throw new PAPException(message); - } - } - - - @Override - public void removeGroup(EcompPDPGroup group, EcompPDPGroup newGroup) - throws PAPException, NullPointerException { - String moveToGroupString = null; - if (newGroup != null) { - moveToGroupString = "movePDPsToGroupId=" + newGroup.getId(); - } - sendToPAP("DELETE", null, null, null, "groupId=" + group.getId(), moveToGroupString); - } - - @Override - public EcompPDPGroup getPDPGroup(EcompPDP pdp) throws PAPException { - return getPDPGroup(pdp.getId()); - } - - - public EcompPDPGroup getPDPGroup(String pdpId) throws PAPException { - EcompPDPGroup newGroup = (EcompPDPGroup)sendToPAP("GET", null, null, StdPDPGroup.class, "groupId=", "pdpId=" + pdpId, "getPDPGroup="); - return newGroup; - } - - @Override - public EcompPDP getPDP(String pdpId) throws PAPException { - EcompPDP newPDP = (EcompPDP)sendToPAP("GET", null, null, StdPDP.class, "groupId=", "pdpId=" + pdpId); - return newPDP; - } - - @Override - public void newPDP(String id, EcompPDPGroup group, String name, String description, int jmxport) throws PAPException, - NullPointerException { - StdPDP newPDP = new StdPDP(id, name, description, jmxport); - sendToPAP("PUT", newPDP, null, null, "groupId=" + group.getId(), "pdpId=" + id); - return; - } - - @Override - public void movePDP(EcompPDP pdp, EcompPDPGroup newGroup) throws PAPException { - sendToPAP("POST", null, null, null, "groupId=" + newGroup.getId(), "pdpId=" + pdp.getId()); - return; - } - - @Override - public void updatePDP(EcompPDP pdp) throws PAPException { - EcompPDPGroup group = getPDPGroup(pdp); - sendToPAP("PUT", pdp, null, null, "groupId=" + group.getId(), "pdpId=" + pdp.getId()); - return; - } - - @Override - public void removePDP(EcompPDP pdp) throws PAPException { - EcompPDPGroup group = getPDPGroup(pdp); - sendToPAP("DELETE", null, null, null, "groupId=" + group.getId(), "pdpId=" + pdp.getId()); - return; - } - - //Validate the Policy Data - public boolean validatePolicyRequest(PolicyAdapter policyAdapter, String policyType) throws PAPException { - Boolean isValidData = false; -/* StdPAPPolicy newPAPPolicy = new StdPAPPolicy(policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), policyAdapter.getEcompName(), policyAdapter.getConfigName(), - policyAdapter.getDynamicFieldConfigAttributes(), policyAdapter.getConfigBodyData(), policyAdapter.getPolicyID(), policyAdapter.getRuleID(), - policyAdapter.getRuleCombiningAlgId(), policyAdapter.getParentPath().toString(), policyAdapter.getGitPath().toString(), policyAdapter.getConfigType(), policyAdapter.isEditPolicy()); - */ - - StdPAPPolicy newPAPPolicy = new StdPAPPolicy(policyAdapter.getPolicyName(), policyAdapter.getConfigBodyData(), policyAdapter.getConfigType(), "Base"); - - //send JSON object to PAP - isValidData = (Boolean) sendToPAP("PUT", newPAPPolicy, null, null, "operation=validate", "apiflag=admin", "policyType=" + policyType); - return isValidData; - } - - //create a new policy - @SuppressWarnings("unchecked") - public Map createPolicyRequest(PolicyAdapter policyAdapter) throws PAPException { - Map successMap = new HashMap(); - StdPAPPolicy newPAPPolicy = null; - - if (policyAdapter.getPolicyType().equalsIgnoreCase("Config")) { - - if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("Firewall Config")) { - - //create StdPAPPolicy object for Config Firewall Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getConfigName(), policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getJsonBody(), - policyAdapter.getHighestVersion() ,policyAdapter.getRiskLevel(), policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - } - else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("BRMS_Raw")) { - - //create StdPAPPolicy object for BRMS_Raw Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getConfigName(), policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getDynamicFieldConfigAttributes(), - policyAdapter.getHighestVersion(),policyAdapter.getEcompName(),policyAdapter.getConfigBodyData(),policyAdapter.getRiskLevel(), - policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - } - else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("BRMS_Param")) { - - //create StdPAPPolicy object for BRMS_Param Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getConfigName(), policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getDynamicFieldConfigAttributes(), - policyAdapter.getHighestVersion(),policyAdapter.getEcompName(),policyAdapter.getConfigBodyData(),policyAdapter.getBRMSParamBody(), - policyAdapter.getRiskLevel(), policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - } - - else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("Base")) { - - //create StdPAPPolicy object for Config Base Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getEcompName(), policyAdapter.getConfigName(), policyAdapter.getDynamicFieldConfigAttributes(), policyAdapter.getConfigType(), - policyAdapter.getConfigBodyData(), policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getHighestVersion(), - policyAdapter.getRiskLevel(), policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - }else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("ClosedLoop_Fault")) { - - //create StdPAPPolicy object for CloseLoop Fault Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getEcompName(), policyAdapter.getJsonBody(), policyAdapter.isDraft(), policyAdapter.getOldPolicyFileName(), null, policyAdapter.isEditPolicy(), - policyAdapter.getDomainDir(), policyAdapter.getHighestVersion(), - policyAdapter.getRiskLevel(), policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - }else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("ClosedLoop_PM")) { - - //create StdPAPPolicy object for CloseLoop PM Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getEcompName(), policyAdapter.getJsonBody(), policyAdapter.isDraft(), policyAdapter.getOldPolicyFileName(), policyAdapter.getServiceType(), - policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getHighestVersion(),policyAdapter.getRiskLevel(), policyAdapter.getRiskType(), - policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - }else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("DCAE Micro Service")) { - - //create StdPAPPolicy object for DCAE Micro Service Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getEcompName(), policyAdapter.getConfigName(), policyAdapter.getServiceType(), policyAdapter.getUuid(), policyAdapter.getLocation(), - policyAdapter.getJsonBody(), policyAdapter.getPriority(), null, policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), - policyAdapter.getHighestVersion(),policyAdapter.getRiskLevel(), policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - } - } else if (policyAdapter.getPolicyType().equalsIgnoreCase("Action")) { - - //create StdPAPPolicy object for Action Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), policyAdapter.getDynamicFieldConfigAttributes(), - policyAdapter.getDynamicRuleAlgorithmLabels(), policyAdapter.getDynamicRuleAlgorithmCombo(), policyAdapter.getDynamicRuleAlgorithmField1(), - policyAdapter.getDynamicRuleAlgorithmField2(), policyAdapter.getActionPerformer(), policyAdapter.getActionAttribute(), - policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getHighestVersion()); - - } else if (policyAdapter.getPolicyType().equalsIgnoreCase("Decision")) { - - //create StdPAPPolicy object for Decision Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), policyAdapter.getEcompName(), policyAdapter.getRuleProvider(), - policyAdapter.getDynamicFieldConfigAttributes(), policyAdapter.getDynamicSettingsMap(), policyAdapter.getDynamicRuleAlgorithmLabels(), - policyAdapter.getDynamicRuleAlgorithmCombo(), policyAdapter.getDynamicRuleAlgorithmField1(), policyAdapter.getDynamicRuleAlgorithmField2(), - policyAdapter.getDropDownMap(), policyAdapter.getDynamicVariableList(), policyAdapter.getDataTypeList(), policyAdapter.isEditPolicy(), - policyAdapter.getDomainDir(), policyAdapter.getHighestVersion()); - - } - - //send JSON object to PAP - successMap = (Map) sendToPAP("PUT", newPAPPolicy, null, null, "operation=create", "apiflag=admin", "policyType=" + policyAdapter.getPolicyType()); - return successMap; - - - } - - //update an existing policy - @SuppressWarnings("unchecked") - public Map updatePolicyRequest(PolicyAdapter policyAdapter) throws PAPException { - Map successMap = new HashMap(); - StdPAPPolicy newPAPPolicy = null; - - if (policyAdapter.getPolicyType().equalsIgnoreCase("Config")) { - - if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("Firewall Config")) { - - //create StdPAPPolicy object for Firewall Config Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), policyAdapter.getConfigName(), - policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getPolicyID(), - policyAdapter.getRuleID(), policyAdapter.getVersion(), policyAdapter.getJsonBody(), policyAdapter.getHighestVersion(),policyAdapter.getRiskLevel(), - policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - } - else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("BRMS_Raw")) { - //create StdPAPPolicy object for BRMS_Raw Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getConfigName(), policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getDynamicFieldConfigAttributes(), - policyAdapter.getHighestVersion(),policyAdapter.getEcompName(),policyAdapter.getConfigBodyData(),policyAdapter.getRiskLevel(), - policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - }else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("BRMS_Param")) { - //create StdPAPPolicy object for BRMS_Raw Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getConfigName(), policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getDynamicFieldConfigAttributes(), - policyAdapter.getHighestVersion(),policyAdapter.getEcompName(),policyAdapter.getConfigBodyData(),policyAdapter.getBRMSParamBody(), - policyAdapter.getRiskLevel(), policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - }else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("Base")) { - - //create StdPAPPolicy object for Config Base Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), policyAdapter.getEcompName(), policyAdapter.getConfigName(), - policyAdapter.getDynamicFieldConfigAttributes(), policyAdapter.getConfigBodyData(), policyAdapter.getPolicyID(), policyAdapter.getRuleID(), - policyAdapter.getConfigType(), policyAdapter.isEditPolicy(), policyAdapter.getVersion(), policyAdapter.getDomainDir(), policyAdapter.getHighestVersion(),policyAdapter.getRiskLevel(), - policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - }else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("ClosedLoop_Fault")) { - - //create StdPAPPolicy object for CloseLoop Fault Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getEcompName(), policyAdapter.getJsonBody(), policyAdapter.isDraft(), policyAdapter.getOldPolicyFileName(), null, policyAdapter.isEditPolicy(), - policyAdapter.getDomainDir(), policyAdapter.getHighestVersion(),policyAdapter.getRiskLevel(), policyAdapter.getRiskType(), policyAdapter.getGuard(), - policyAdapter.getTtlDate()); - - }else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("ClosedLoop_PM")) { - - //create StdPAPPolicy object for CloseLoop PM Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getEcompName(), policyAdapter.getJsonBody(), policyAdapter.isDraft(), policyAdapter.getOldPolicyFileName(), policyAdapter.getServiceType(), - policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getHighestVersion(),policyAdapter.getRiskLevel(), policyAdapter.getRiskType(), - policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - }else if (policyAdapter.getConfigPolicyType().equalsIgnoreCase("DCAE Micro Service")) { - - //create StdPAPPolicy object for DCAE Micro Service Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getConfigPolicyType(), policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), - policyAdapter.getEcompName(), policyAdapter.getConfigName(), policyAdapter.getServiceType(), policyAdapter.getUuid(), policyAdapter.getLocation(), - policyAdapter.getJsonBody(), policyAdapter.getPriority(), null, policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getHighestVersion(), - policyAdapter.getRiskLevel(), policyAdapter.getRiskType(), policyAdapter.getGuard(),policyAdapter.getTtlDate()); - - } - } else if (policyAdapter.getPolicyType().equalsIgnoreCase("Action")) { - - //create StdPAPPolicy object for Action Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), policyAdapter.getDynamicFieldConfigAttributes(), - policyAdapter.getDynamicRuleAlgorithmLabels(), policyAdapter.getDynamicRuleAlgorithmCombo(), policyAdapter.getDynamicRuleAlgorithmField1(), - policyAdapter.getDynamicRuleAlgorithmField2(), policyAdapter.getActionPerformer(), policyAdapter.getActionAttribute(), - policyAdapter.isEditPolicy(), policyAdapter.getDomainDir(), policyAdapter.getHighestVersion()); - - } else if (policyAdapter.getPolicyType().equalsIgnoreCase("Decision")) { - - //create StdPAPPolicy object for Decision Policy - newPAPPolicy = new StdPAPPolicy(policyAdapter.getPolicyName(), policyAdapter.getPolicyDescription(), policyAdapter.getEcompName(), policyAdapter.getRuleProvider(), - policyAdapter.getDynamicFieldConfigAttributes(), policyAdapter.getDynamicSettingsMap(), policyAdapter.getDynamicRuleAlgorithmLabels(), - policyAdapter.getDynamicRuleAlgorithmCombo(), policyAdapter.getDynamicRuleAlgorithmField1(), policyAdapter.getDynamicRuleAlgorithmField2(), - policyAdapter.getDropDownMap(), policyAdapter.getDynamicVariableList(), policyAdapter.getDataTypeList(), policyAdapter.isEditPolicy(), - policyAdapter.getDomainDir(), policyAdapter.getHighestVersion()); - - } - - //send JSON object to PAP - successMap = (Map) sendToPAP("PUT", newPAPPolicy, null, null, "operation=update", "apiflag=admin", "policyType=" + policyAdapter.getPolicyType()); - return successMap; - } - - @Override - public void publishPolicy(String id, String name, boolean isRoot, - InputStream policy, EcompPDPGroup group) throws PAPException { - - - // copy the (one) file into the target directory on the PAP servlet - copyFile(id, group, policy); - - // adjust the local copy of the group to include the new policy - PDPPolicy pdpPolicy = new StdPDPPolicy(id, isRoot, name); - group.getPolicies().add(pdpPolicy); - - // tell the PAP servlet to include the policy in the configuration - updateGroup(group); - - return; - } - - - - /** - * Copy a single Policy file from the input stream to the PAP Servlet. - * Either this works (silently) or it throws an exception. - * - * @param policyId - * @param group - * @param policy - * @return - * @throws PAPException - */ - public void copyFile(String policyId, EcompPDPGroup group, InputStream policy) throws PAPException { - // send the policy file to the PAP Servlet - try { - sendToPAP("POST", policy, null, null, "groupId=" + group.getId(), "policyId="+policyId); - } catch (Exception e) { - String message = "Unable to PUT policy '" + policyId + "', e:" + e; - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + message, e); - throw new PAPException(message); - } - } - - - @Override - public void copyPolicy(PDPPolicy policy, EcompPDPGroup group) throws PAPException { - if (policy == null || group == null) { - throw new PAPException("Null input policy="+policy+" group="+group); - } - try (InputStream is = new FileInputStream(new File(policy.getLocation())) ) { - copyFile(policy.getId(), group, is ); - } catch (Exception e) { - String message = "Unable to PUT policy '" + policy.getId() + "', e:" + e; - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + message, e); - throw new PAPException(message); - } - } - - - - - @Override - public void removePolicy(PDPPolicy policy, EcompPDPGroup group) throws PAPException { - throw new PAPException("NOT IMPLEMENTED"); - - } - - - - /** - * Special operation - Similar to the normal PAP operations but this one contacts the PDP directly - * to get detailed status info. - * - * @param pdp - * @return - * @throws PAPException - */ - - public PDPStatus getStatus(EcompPDP pdp) throws PAPException { - StdPDPStatus status = (StdPDPStatus)sendToPAP("GET", pdp, null, StdPDPStatus.class); - return status; - } - - - - - // - // Internal Operations called by the PAPEngine Interface methods - // - - /** - * Send a request to the PAP Servlet and get the response. - * - * The content is either an InputStream to be copied to the Request OutputStream - * OR it is an object that is to be encoded into JSON and pushed into the Request OutputStream. - * - * The Request parameters may be encoded in multiple "name=value" sets, or parameters may be combined by the caller. - * - * @param method - * @param content - EITHER an InputStream OR an Object to be encoded in JSON - * @param collectionTypeClass - * @param responseContentClass - * @param parameters - * @return - * @throws Exception - */ - private Object sendToPAP(String method, Object content, Class collectionTypeClass, Class responseContentClass, String... parameters ) throws PAPException { - HttpURLConnection connection = null; - String papID = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_USERID); - logger.info("User Id is " + papID); - String papPass = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_PASS); - logger.info("Pass is: " + papPass); - Base64.Encoder encoder = Base64.getEncoder(); - String encoding = encoder.encodeToString((papID+":"+papPass).getBytes(StandardCharsets.UTF_8)); - logger.info("Encoding for the PAP is: " + encoding); - try { - String fullURL = papServletURLString; - if (parameters != null && parameters.length > 0) { - String queryString = ""; - for (String p : parameters) { - queryString += "&" + p; - } - fullURL += "?" + queryString.substring(1); - } - - // special case - Status (actually the detailed status) comes from the PDP directly, not the PAP - if (method.equals("GET") && (content instanceof EcompPDP) && responseContentClass == StdPDPStatus.class) { - // Adjust the url and properties appropriately - String pdpID =((EcompPDP)content).getId(); - fullURL = pdpID + "?type=Status"; - content = null; - if(CheckPDP.validateID(pdpID)){ - encoding = CheckPDP.getEncoding(pdpID); - } - } - - - URL url = new URL(fullURL); - - // - // Open up the connection - // - connection = (HttpURLConnection)url.openConnection(); - // - // Setup our method and headers - // - connection.setRequestMethod(method); -// connection.setRequestProperty("Accept", "text/x-java-properties"); -// connection.setRequestProperty("Content-Type", "text/x-java-properties"); - connection.setUseCaches(false); - // - // Adding this in. It seems the HttpUrlConnection class does NOT - // properly forward our headers for POST re-direction. It does so - // for a GET re-direction. - // - // So we need to handle this ourselves. - // - connection.setInstanceFollowRedirects(false); - connection.setRequestProperty("Authorization", "Basic " + encoding); - connection.setDoOutput(true); - connection.setDoInput(true); - - if (content != null) { - if (content instanceof InputStream) { - try { - // - // Send our current policy configuration - // - try (OutputStream os = connection.getOutputStream()) { - int count = IOUtils.copy((InputStream)content, os); - if (logger.isDebugEnabled()) { - logger.debug("copied to output, bytes="+count); - } - } - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to write content in '" + method + "'", e); - throw e; - } - } else { - // The content is an object to be encoded in JSON - ObjectMapper mapper = new ObjectMapper(); - mapper.writeValue(connection.getOutputStream(), content); - } - } - // - // Do the connect - // - connection.connect(); - if (connection.getResponseCode() == 204) { - logger.info("Success - no content."); - return null; - } else if (connection.getResponseCode() == 200) { - logger.info("Success. We have a return object."); - String isValidData = connection.getHeaderField("isValidData"); - String isSuccess = connection.getHeaderField("successMapKey"); - Map successMap = new HashMap(); - if (isValidData != null && isValidData.equalsIgnoreCase("true")){ - logger.info("Policy Data is valid."); - return true; - } else if (isValidData != null && isValidData.equalsIgnoreCase("false")) { - logger.info("Policy Data is invalid."); - return false; - } else if (isSuccess != null && isSuccess.equalsIgnoreCase("success")) { - logger.info("Policy Created Successfully!" ); - String finalPolicyPath = connection.getHeaderField("finalPolicyPath"); - successMap.put("success", finalPolicyPath); - return successMap; - } else if (isSuccess != null && isSuccess.equalsIgnoreCase("error")) { - logger.info("There was an error while creating the policy!"); - successMap.put("error", "error"); - return successMap; - } else { - // get the response content into a String - String json = null; - // read the inputStream into a buffer (trick found online scans entire input looking for end-of-file) - java.util.Scanner scanner = new java.util.Scanner(connection.getInputStream()); - scanner.useDelimiter("\\A"); - json = scanner.hasNext() ? scanner.next() : ""; - scanner.close(); - logger.info("JSON response from PAP: " + json); - - // convert Object sent as JSON into local object - ObjectMapper mapper = new ObjectMapper(); - mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - if (collectionTypeClass != null) { - // collection of objects expected - final CollectionType javaType = - mapper.getTypeFactory().constructCollectionType(collectionTypeClass, responseContentClass); - - Object objectFromJSON = mapper.readValue(json, javaType); - return objectFromJSON; - } else { - // single value object expected - Object objectFromJSON = mapper.readValue(json, responseContentClass); - return objectFromJSON; - } - } - - } else if (connection.getResponseCode() >= 300 && connection.getResponseCode() <= 399) { - // redirection - String newURL = connection.getHeaderField("Location"); - if (newURL == null) { - logger.error("No Location header to redirect to when response code="+connection.getResponseCode()); - throw new IOException("No redirect Location header when response code="+connection.getResponseCode()); - } - int qIndex = newURL.indexOf("?"); - if (qIndex > 0) { - newURL = newURL.substring(0, qIndex); - } - logger.info("Redirect seen. Redirecting " + fullURL + " to " + newURL); - return newURL; - } else { - logger.warn("Unexpected response code: " + connection.getResponseCode() + " message: " + connection.getResponseMessage()); - throw new IOException("Server Response: " + connection.getResponseCode() + ": " + connection.getResponseMessage()); - } - - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "HTTP Request/Response to PAP: " + e,e); - throw new PAPException("Request/Response threw :" + e); - } finally { - // cleanup the connection - if (connection != null) { - try { - // For some reason trying to get the inputStream from the connection - // throws an exception rather than returning null when the InputStream does not exist. - InputStream is = null; - try { - is = connection.getInputStream(); - } catch (Exception e1) { - // ignore this - } - if (is != null) { - is.close(); - } - - } catch (IOException ex) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to close connection: " + ex, ex); - } - connection.disconnect(); - } - } - } - -} - - diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/XacmlAdminUI.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/XacmlAdminUI.java deleted file mode 100644 index aec8a0ac1..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/admin/XacmlAdminUI.java +++ /dev/null @@ -1,266 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.admin; - - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebInitParam; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; - - -import org.eclipse.jgit.api.Git; -import org.eclipse.jgit.api.errors.GitAPIException; -import org.eclipse.jgit.lib.Repository; -import org.eclipse.jgit.lib.StoredConfig; -import org.eclipse.jgit.storage.file.FileRepositoryBuilder; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.openecomp.policy.rest.XACMLRest; -import org.openecomp.policy.rest.XACMLRestProperties; -import org.openecomp.policy.rest.dao.UserInfoDao; -import org.openecomp.policy.rest.jpa.UserInfo; -import org.openecomp.policy.rest.util.Webapps; -import org.openecomp.policy.xacml.api.pap.PAPPolicyEngine; -import org.springframework.beans.factory.annotation.Autowired; - -import com.att.research.xacml.util.XACMLProperties; -import com.google.common.base.Splitter; - - - -public class XacmlAdminUI extends HttpServlet implements PAPNotificationBroadcaster.PAPNotificationBroadcastListener{ - - private static final long serialVersionUID = 1L; - // - // The PAP Engine - // - private PAPPolicyEngine papEngine; - private static Path repositoryPath; - private static Repository repository; - - @Autowired - UserInfoDao userInfoDao; - - @Autowired - SessionFactory sessionfactory; - - @WebServlet(value = "/policy#/*", description = "XACML Admin Console", asyncSupported = true, loadOnStartup = 1, initParams = { @WebInitParam(name = "XACML_PROPERTIES_NAME", value = "xacml.admin.properties", description = "The location of the properties file holding configuration information.") }) - public static class Servlet extends HttpServlet { - private static final long serialVersionUID = -5274600248961852835L; - - @Override - public void init(ServletConfig servletConfig) throws ServletException { - super.init(servletConfig); - // - // Common initialization - // - XACMLRest.xacmlInit(servletConfig); - // - // Initialize GIT repository. - // - XacmlAdminUI.initializeGitRepository(); - // - // Read the Props - // The webapps Action and Config are read when getActionHome or getConfigHome are called - try { - getConfigHome(); - } catch (Exception e) { - throw new ServletException(e); - } - - } - - - @Override - public void destroy() { - if (XacmlAdminUI.repository != null) { - XacmlAdminUI.repository.close(); - } - super.destroy(); - } - } - - private static void initializeGitRepository() throws ServletException { - - try { - XacmlAdminUI.repositoryPath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_ADMIN_REPOSITORY)); - } catch (Exception e) { - XACMLProperties.reloadProperties(); - XacmlAdminUI.repositoryPath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_ADMIN_REPOSITORY)); - } - FileRepositoryBuilder builder = new FileRepositoryBuilder(); - try { - XacmlAdminUI.repository = builder.setGitDir(XacmlAdminUI.repositoryPath.toFile()).readEnvironment().findGitDir().setBare().build(); - if (Files.notExists(XacmlAdminUI.repositoryPath)|| Files.notExists(Paths.get(XacmlAdminUI.repositoryPath.toString(), "HEAD"))) { - // - // Create it if it doesn't exist. As a bare repository - XacmlAdminUI.repository.create(); - // - // Add the magic file so remote works. - // - Path daemon = Paths.get(XacmlAdminUI.repositoryPath.toString(), "git-daemon-export-ok"); - Files.createFile(daemon); - } - } catch (IOException e) { - throw new ServletException(e.getMessage(), e.getCause()); - } - // - // Make sure the workspace directory is created - // - Path workspace = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_ADMIN_WORKSPACE)); - workspace = workspace.toAbsolutePath(); - if (Files.notExists(workspace)) { - try { - Files.createDirectory(workspace); - } catch (IOException e) { - throw new ServletException(e.getMessage(), e.getCause()); - } - } - // - // Create the user workspace directory - // - workspace = Paths.get(workspace.toString(), "admin"); - - if (Files.notExists(workspace)) { - try { - Files.createDirectory(workspace); - } catch (IOException e) { - throw new ServletException(e.getMessage(), e.getCause()); - } - } - // - // Get the path to where the repository is going to be - // - Path gitPath = Paths.get(workspace.toString(), XacmlAdminUI.repositoryPath.getFileName().toString()); - if (Files.notExists(gitPath)) { - try { - Files.createDirectory(gitPath); - } catch (IOException e) { - throw new ServletException(e.getMessage(), e.getCause()); - } - } - // - // Initialize the domain structure - // - String base = null; - String domain = XacmlAdminUI.getDomain(); - if (domain != null) { - for (String part : Splitter.on(':').trimResults().split(domain)) { - if (base == null) { - base = part; - } - Path subdir = Paths.get(gitPath.toString(), part); - if (Files.notExists(subdir)) { - try { - Files.createDirectory(subdir); - Files.createFile(Paths.get(subdir.toString(), ".svnignore")); - } catch (IOException e) { - throw new ServletException(e.getMessage(), e.getCause()); - } - } - } - } else { - try { - Files.createFile(Paths.get(workspace.toString(), ".svnignore")); - base = ".svnignore"; - } catch (IOException e) { - throw new ServletException(e.getMessage(), e.getCause()); - } - } - try { - // - // These are the sequence of commands that must be done initially to - // finish setting up the remote bare repository. - // - Git git = Git.init().setDirectory(gitPath.toFile()).setBare(false).call(); - git.add().addFilepattern(base).call(); - git.commit().setMessage("Initialize Bare Repository").call(); - StoredConfig config = git.getRepository().getConfig(); - config.setString("remote", "origin", "url", XacmlAdminUI.repositoryPath.toAbsolutePath().toString()); - config.setString("remote", "origin", "fetch", "+refs/heads/*:refs/remotes/origin/*"); - config.save(); - git.push().setRemote("origin").add("master").call(); - /* - * This will not work unless - * git.push().setRemote("origin").add("master").call(); is called - * first. Otherwise it throws an exception. However, if the push() - * is called then calling this function seems to add nothing. - * - * git.branchCreate().setName("master") - * .setUpstreamMode(SetupUpstreamMode.SET_UPSTREAM) - * .setStartPoint("origin/master").setForce(true).call(); - */ - } catch (GitAPIException | IOException e) { - throw new ServletException(e.getMessage(), e.getCause()); - } - } - - public UserInfo getUserNameFromUserInfoTable(String createdBy){ - String loginId = createdBy; - Object user = null; - Session session = sessionfactory.openSession(); - user = session.load(UserInfo.class, loginId); - return (UserInfo) user; - } - - @Override - public void updateAllGroups() { - - } - - public PAPPolicyEngine getPapEngine() { - return papEngine; - } - - public void setPapEngine(PAPPolicyEngine papEngine) { - this.papEngine = papEngine; - } - - public static String getConfigHome() { - return Webapps.getConfigHome(); - } - - public static String getDomain() { - return XACMLProperties.getProperty(XACMLRestProperties.PROP_ADMIN_DOMAIN, "urn"); - } - - // get the repository path from property file - public static Path getRepositoryPath() { - if(repositoryPath == null){ - try { - initializeGitRepository(); - } catch (ServletException e) { - - } - } - return repositoryPath; - } - - -} - diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/components/ElasticSearchComponent.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/components/ElasticSearchComponent.java deleted file mode 100644 index 35a4d14b8..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/components/ElasticSearchComponent.java +++ /dev/null @@ -1,426 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.components; - - -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.regex.Pattern; - -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.elk.client.ElkConnector; -import org.openecomp.policy.elk.client.ElkConnector.PolicyIndexType; -import org.openecomp.policy.rest.dao.DescriptiveScopeDao; -import org.openecomp.policy.rest.jpa.DescriptiveScope; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.elk.client.Pair; -import org.openecomp.policy.elk.client.PolicyLocator; -import org.springframework.beans.factory.annotation.Autowired; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - -public class ElasticSearchComponent { - private static final Logger logger = FlexLogger.getLogger(ElasticSearchComponent.class); - - - private static PolicyVersionDao policyVersionDao; - private static DescriptiveScopeDao descriptiveScopeDao; - - @Autowired - public ElasticSearchComponent(PolicyVersionDao policyVersionDao){ - ElasticSearchComponent.policyVersionDao = policyVersionDao; - } - - @Autowired - public ElasticSearchComponent(DescriptiveScopeDao descriptiveScopeDao){ - ElasticSearchComponent.descriptiveScopeDao = descriptiveScopeDao; - } - - - private volatile static HashMap filteredPolicies = new HashMap(); - - public static final HashMap name2jsonPath = new HashMap() { - private static final long serialVersionUID = 1L; - { - put(CLFAULT_UIFIELD_D2_SERVICES_TRINITY, CLFAULT_UIJSON_D2_SERVICES_TRINITY); - put(CLFAULT_UIFIELD_D2_SERVICES_VUSP, CLFAULT_UIJSON_D2_SERVICES_VUSP); - put(CLFAULT_UIFIELD_D2_SERVICES_MCR, CLFAULT_UIJSON_D2_SERVICES_MCR); - put(CLFAULT_UIFIELD_D2_SERVICES_GAMMA, CLFAULT_UIJSON_D2_SERVICES_GAMMA); - put(CLFAULT_UIFIELD_D2_SERVICES_VDNS, CLFAULT_UIJSON_D2_SERVICES_VDNS); - - put(CLFAULT_UIFIELD_EMAIL_ADDRESS, CLFAULT_UIJSON_EMAIL_ADDRESS); - put(CLFAULT_UIFIELD_TRIGGER_SIGNATURE, CLFAULT_UIJSON_TRIGGER_SIGNATURE); - put(CLFAULT_UIFIELD_VERIFICATION_SIGNATURE, CLFAULT_UIJSON_VERIFICATION_SIGNATURE); - put(CLFAULT_UIFIELD_CONNECT_ALL_TRAPS, CLFAULT_UIJSON_CONNECT_ALL_TRAPS); - put(CLFAULT_UIFIELD_CONNECT_ALL_FAULTS, CLFAULT_UIJSON_CONNECT_ALL_FAULTS); - - put(CLFAULT_UIFIELD_POLICY_STATUS_INACTIVE, CLFAULT_UIJSON_POLICY_STATUS_ACTIVE); - put(CLFAULT_UIFIELD_POLICY_STATUS_ACTIVE, CLFAULT_UIJSON_POLICY_STATUS_INACTIVE); - - put(CLPM_UIFIELD_ONSET_MESSAGE, CLPM_UIJSON_ONSET_MESSAGE); - put(CLPM_UIFIELD_POLICY_NAME, CLPM_UIJSON_POLICY_NAME); - put(CLPM_UIFIELD_ABATEMENT_MESSAGE, CLPM_UIJSON_ABATEMENT_MESSAGE); - put(CLPM_UIFIELD_GEOLINK, CLPM_UIJSON_GEOLINK); - }}; - - //For AND and OR logical connector AND=0 and OR=1 - private static int connectorSelected; - - public static final String CLFAULT_UIFIELD_D2_SERVICES_TRINITY = "Hosted Voice (Trinity)"; - public static final String CLFAULT_UIJSON_D2_SERVICES_TRINITY = "trinity"; - - public static final String CLFAULT_UIFIELD_D2_SERVICES_VUSP = "vUSP"; - public static final String CLFAULT_UIJSON_D2_SERVICES_VUSP = "vUSP"; - - public static final String CLFAULT_UIFIELD_D2_SERVICES_MCR = "MCR"; - public static final String CLFAULT_UIJSON_D2_SERVICES_MCR = "mcr"; - - public static final String CLFAULT_UIFIELD_D2_SERVICES_GAMMA = "Gamma"; - public static final String CLFAULT_UIJSON_D2_SERVICES_GAMMA = "gama"; - - public static final String CLFAULT_UIFIELD_D2_SERVICES_VDNS = "vDNS"; - public static final String CLFAULT_UIJSON_D2_SERVICES_VDNS = "vDNS"; - - public static final String CLFAULT_UIFIELD_EMAIL_ADDRESS = "Email Address"; - public static final String CLFAULT_UIJSON_EMAIL_ADDRESS = "emailAddress"; - - public static final String CLFAULT_UIFIELD_TRIGGER_SIGNATURE = "Trigger Signature"; - public static final String CLFAULT_UIJSON_TRIGGER_SIGNATURE = "triggerSignaturesUsedForUI.signatures"; - - public static final String CLFAULT_UIFIELD_VERIFICATION_SIGNATURE = "Verification Signature"; - public static final String CLFAULT_UIJSON_VERIFICATION_SIGNATURE = "verificationSignaturesUsedForUI.signatures"; - - public static final String CLFAULT_UIFIELD_CONNECT_ALL_TRAPS = "Connect All Traps"; - public static final String CLFAULT_UIJSON_CONNECT_ALL_TRAPS = "triggerSignaturesUsedForUI.connectSignatures"; - - public static final String CLFAULT_UIFIELD_CONNECT_ALL_FAULTS = "Connect All Faults"; - public static final String CLFAULT_UIJSON_CONNECT_ALL_FAULTS = "verificationSignaturesUsedForUI.connectSignatures"; - - public static final String CLFAULT_UIFIELD_POLICY_STATUS_ACTIVE = "Active"; - public static final String CLFAULT_UIJSON_POLICY_STATUS_ACTIVE = "ACTIVE"; - - public static final String CLFAULT_UIFIELD_POLICY_STATUS_INACTIVE = "InActive"; - public static final String CLFAULT_UIJSON_POLICY_STATUS_INACTIVE = "INACTIVE"; - - - public static final String CLPM_UIFIELD_ONSET_MESSAGE = "Onset Message"; - public static final String CLPM_UIJSON_ONSET_MESSAGE = "attributes.OnsetMessage"; - - public static final String CLPM_UIFIELD_POLICY_NAME = "PolicyName"; - public static final String CLPM_UIJSON_POLICY_NAME = "attributes.PolicyName"; - - public static final String CLPM_UIFIELD_ABATEMENT_MESSAGE = "Abatement Message"; - public static final String CLPM_UIJSON_ABATEMENT_MESSAGE = "attributes.AbatementMessage"; - - public static final String CLPM_UIFIELD_GEOLINK = "Geo Link"; - public static final String CLPM_UIJSON_GEOLINK = "geoLink"; - - public static void search(String value){ - String policyType = "all";//(String) self.searchPolicyType.getValue() - - ArrayList,ArrayList>> filter_s = new ArrayList,ArrayList>>(); - - String searchText = "";//self.searchTextBox.getValue() - if (searchText == null || searchText.isEmpty()) { - if (policyType == null || policyType.isEmpty() && - !policyType.equals(ElkConnector.PolicyIndexType.closedloop.toString())) { - if (logger.isDebugEnabled()) { - logger.debug("Clearing search filters, nothing to search and not closed loop."); - } - return; - } - } else { - searchText = searchText.trim(); - //Descriptive Scope. - /* - When a item is selected in the "descriptiveScope" comboBox, the name of the item - is added to the Search-Text Box with the prefix "Descriptive-Scope" - User needs to press the "Search" button to perform the search. - */ - if(searchText.contains("Descriptive-Scope=")) - { - if (logger.isDebugEnabled()) { - logger.debug("Inside the Descriptive Scope"); - } - /* - First item is always String "Descriptive-Scope" before the "=", - So taking the second item of "split using =" - */ - String[] dsName= searchText.split("=",2); - /* - Trying to find the search String by traversing different items from the dictionary by Scope-Name - Once when the the "scope-name" is found, we get the search string from dictionary. - */ - for (int i = 0; i < descriptiveScopeDao.getDescriptiveScope().size(); i++) { - DescriptiveScope dsSearch=descriptiveScopeDao.getDescriptiveScope().get(i); - if(dsSearch.getScopeName().equals(dsName[1])){ - searchText=dsSearch.getSearch(); - if (logger.isDebugEnabled()) { - logger.debug("DescriptiveScope Search String is " +searchText ); - } - } - } - } - - if(searchText.contains(":")) - { - String connector="&"; - - if(searchText.contains("&")) - { - connector="&"; - connectorSelected=0; - } - else if(searchText.contains("|")) - { - connector=Pattern.quote("|"); - connectorSelected=1; - } - for (String retval: searchText.split(connector)){ - - int index= retval.indexOf(':'); - String filterKey=null; - String filterValue=null; - - filterKey=retval.substring(0,index); - filterValue= retval.substring(index+1); - - String clSearchBoxFilter=filterKey; - - ArrayList clSearchBoxFilterField_s = new ArrayList(); - - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_Fault.name() + "_Body." + clSearchBoxFilter); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_PM.name() + "_Body." + clSearchBoxFilter); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_FW.name() + "_Body." + clSearchBoxFilter); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_MS.name() + "_Body." + clSearchBoxFilter); - - - ArrayList clSearchBoxFilterValue_s = new ArrayList(); - clSearchBoxFilterValue_s.add(filterValue); - - filter_s.add(new Pair,ArrayList>(clSearchBoxFilterField_s, clSearchBoxFilterValue_s)); - } - } - } - - if (policyType != null && !policyType.isEmpty() && - policyType.equals(ElkConnector.PolicyIndexType.closedloop.toString())) { - - /* closed loop policy type */ - - String clPolicyType = "";//(String) self.cbSearchCLPolicyType.getValue() - if (clPolicyType != null && !clPolicyType.isEmpty()) { - ArrayList clPolicyTypeField_s = new ArrayList(); - clPolicyTypeField_s.add("Policy.PolicyType"); - - ArrayList clPolicyTypeValue_s = new ArrayList(); - clPolicyTypeValue_s.add(clPolicyType); - - filter_s.add(new Pair,ArrayList>(clPolicyTypeField_s, clPolicyTypeValue_s)); - } - - String clEcompName = "";//(String) self.cbSearchCLEcompName.getValue() - if (clEcompName != null && !clEcompName.isEmpty()) { - clSearchBody(clPolicyType, "ecompname", clEcompName, filter_s); - } - - String clD2Services = "";//(String) self.cbSearchCLD2Services.getValue() - if (clD2Services != null && !clD2Services.isEmpty()) { - switch (clD2Services) { - case CLFAULT_UIFIELD_D2_SERVICES_TRINITY: - case CLFAULT_UIFIELD_D2_SERVICES_VUSP: - case CLFAULT_UIFIELD_D2_SERVICES_MCR: - case CLFAULT_UIFIELD_D2_SERVICES_GAMMA: - case CLFAULT_UIFIELD_D2_SERVICES_VDNS: - clSearchBody(clPolicyType, name2jsonPath.get(clD2Services), "true", filter_s); - break; - default: - if (logger.isWarnEnabled()) - logger.warn("Unexpected D2 Service: " + clD2Services); - break; - } - } - - String clFaultAction = "";//(String) self.cbSearchCLFaultAction.getValue() - if (clFaultAction != null && !clFaultAction.isEmpty()) { - if (clPolicyType == null || clPolicyType.equals(ElkConnector.PolicyType.Config_Fault.name())) { - clSearchFilter(ElkConnector.PolicyType.Config_Fault.name(), "actions", clFaultAction, filter_s); - } - } - - String clFaultStatus = "";//(String) self.cbSearchCLFaultStatus.getValue() - if (clFaultStatus != null && !clFaultStatus.isEmpty()) { - if (clPolicyType == null || clPolicyType.equals(ElkConnector.PolicyType.Config_Fault.name())) { - clSearchFilter(ElkConnector.PolicyType.Config_Fault.name(), "closedLoopPolicyStatus", clFaultStatus, filter_s); - } - } - - String clFaultVnfTypes = "";//(String) self.cbSearchCLFaultVnfTypes.getValue() - if (clFaultVnfTypes != null && !clFaultVnfTypes.isEmpty()) { - if (clPolicyType == null || clPolicyType.equals(ElkConnector.PolicyType.Config_Fault.name())) { - clSearchFilter(ElkConnector.PolicyType.Config_Fault.name(), "vnfType", clFaultVnfTypes, filter_s); - } - } - - String clPMServiceType = "";//(String) self.cbSearchCLPMServiceType.getValue() - if (clPMServiceType != null && !clPMServiceType.isEmpty()) { - if (clPolicyType == null || clPolicyType.equals(ElkConnector.PolicyType.Config_PM.name())) { - clSearchFilter(ElkConnector.PolicyType.Config_PM.name(), "serviceTypePolicyName", clPMServiceType, filter_s); - } - } - - String clSearchBoxFilter = "";//(String) self.cbSearchCLTextFilter.getValue() - if (clSearchBoxFilter != null && !clSearchBoxFilter.isEmpty() && - searchText != null && !searchText.isEmpty()) { - - if (name2jsonPath.containsKey(clSearchBoxFilter)) { - clSearchBoxFilter = name2jsonPath.get(clSearchBoxFilter); - } - - ArrayList clSearchBoxFilterField_s = new ArrayList(); - if (clPolicyType == null || clPolicyType.isEmpty()) { - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_Fault.name() + "_Body." + clSearchBoxFilter); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_PM.name() + "_Body." + clSearchBoxFilter); - } else { - clSearchBoxFilterField_s.add("Policy.Body." + clPolicyType + "_Body." + clSearchBoxFilter); - } - - ArrayList clSearchBoxFilterValue_s = new ArrayList(); - clSearchBoxFilterValue_s.add(searchText); - - filter_s.add(new Pair,ArrayList>(clSearchBoxFilterField_s, clSearchBoxFilterValue_s)); - - // deactivate search all fields in case a searchbox filter is provided - searchText = ""; - } - } - - if ((searchText == null || searchText.isEmpty()) && - (filter_s == null || filter_s.size() <=0) ) { - if (logger.isWarnEnabled()) { - logger.warn("Clearing search filters, closed loop but nothing to search nor filters"); - } - - return; - } - - ArrayList locators; - try { - locators = ElkConnector.singleton.policyLocators(toPolicyIndexType(policyType), - searchText, filter_s,connectorSelected); - } catch (Exception ise) { - /*AdminNotification.warn("Search is unavailable: " + ise.getMessage());*/ - return; - } - - synchronized(filteredPolicies) { - if (locators.isEmpty()) { - if (logger.isInfoEnabled()) { - logger.info("No match has been found"); - } - //AdminNotification.warn("No match has been found"); - return; - } - - // Retrieve active versions - - HashMap policyVersion_s = new HashMap(); - for(int i = 0; i < policyVersionDao.getPolicyVersionData().size(); i++) { - PolicyVersion entityVersion = policyVersionDao.getPolicyVersionData().get(i); - String dbPolicy = entityVersion.getPolicyName() + "." + entityVersion.getActiveVersion(); - policyVersion_s.put(dbPolicy, true); - if (logger.isDebugEnabled()) - logger.debug("Map addition: DB Policy Name: " + dbPolicy); - } - - filteredPolicies.clear(); - for (PolicyLocator p: locators) { - String dbPolicyName = p.scope + "/" + p.policyType + "_" + p.policyName; - if (policyVersion_s.containsKey(dbPolicyName)) { - String filterPolicyName = dbPolicyName + ".xml"; - filteredPolicies.put(Paths.get(filterPolicyName), filterPolicyName); - if (logger.isInfoEnabled()) - logger.info("Active Version Policy found in search: " + - dbPolicyName + " -> " + filterPolicyName); - } else { - if (logger.isInfoEnabled()) - logger.info("Inactive Version Policy found in search: " + dbPolicyName); - } - } - - if (filteredPolicies.isEmpty()) { - if (logger.isInfoEnabled()) { - logger.info("No match has been found for active versions"); - } - //AdminNotification.warn("No match has been found for active versions"); - return; - } - - //self.policyContainer.setFilter(self.filteredPolicies); - } - /* self.policyContainer.refresh();*/ - } - - - protected static void clSearchBody(String clPolicyType, String bodyField, String bodyValue, - ArrayList, ArrayList>> filter_s) { - if (logger.isDebugEnabled()) - logger.debug("ENTER: " + clPolicyType + ":" + bodyField + ":" + bodyValue); - - final ArrayList clBodyField_s = new ArrayList(); - final ArrayList clBodyValue_s = new ArrayList(); - - if (clPolicyType == null || clPolicyType.isEmpty()) { - clBodyField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_Fault.name() + "_Body." + bodyField); - clBodyField_s.add("Policy.Body."+ ElkConnector.PolicyType.Config_PM.name() + "_Body." + bodyField); - clBodyValue_s.add(bodyValue); - } else { - clBodyField_s.add("Policy.Body." + clPolicyType + "_Body." + bodyField); - clBodyValue_s.add(bodyValue); - } - filter_s.add(new Pair, ArrayList>(clBodyField_s, clBodyValue_s)); - } - - protected static void clSearchFilter(String clType, String clField, String clValue, - ArrayList,ArrayList>> filter_s) { - if (logger.isDebugEnabled()) - logger.debug("ENTER: " + clType + ":" + clField + ":" + clValue); - - ArrayList clSearchField_s = new ArrayList(); - clSearchField_s.add("Policy.Body." + clType + "_Body." + clField); - - ArrayList clSearchValue_s = new ArrayList(); - clSearchValue_s.add(clValue); - - filter_s.add(new Pair,ArrayList>(clSearchField_s, clSearchValue_s)); - } - - public static ElkConnector.PolicyIndexType toPolicyIndexType(String type) throws IllegalArgumentException { - if (type == null || type.isEmpty()) - return PolicyIndexType.all; - - return PolicyIndexType.valueOf(type); - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/components/HumanPolicyComponent.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/components/HumanPolicyComponent.java deleted file mode 100644 index 037888b7c..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/components/HumanPolicyComponent.java +++ /dev/null @@ -1,982 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.components; - - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.nio.file.FileSystems; -import java.nio.file.Path; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.JAXBElement; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionsType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeAssignmentExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeDesignatorType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeSelectorType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ConditionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionsType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicySetType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.VariableReferenceType; - -import org.apache.commons.io.FilenameUtils; -import org.json.JSONObject; -import org.openecomp.policy.controller.PolicyController; -import org.openecomp.policy.rest.jpa.FunctionDefinition; -import org.openecomp.policy.utils.XACMLPolicyWriterWithPapNotify; - -import com.att.research.xacml.api.AttributeValue; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import com.att.research.xacml.std.IdentifierImpl; -import com.att.research.xacml.std.StdAttribute; -import com.att.research.xacml.std.StdAttributeValue; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.att.research.xacml.util.XACMLPolicyScanner.CallbackResult; -import com.att.research.xacml.util.XACMLPolicyScanner.SimpleCallback; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - - -public class HumanPolicyComponent{ - - private static final Logger logger = FlexLogger.getLogger(HumanPolicyComponent.class); - - // Constants Used in XML Creation - public static final String CATEGORY_RECIPIENT_SUBJECT = "urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject"; - public static final String CATEGORY_RESOURCE = "urn:oasis:names:tc:xacml:3.0:attribute-category:resource"; - public static final String CATEGORY_ACTION = "urn:oasis:names:tc:xacml:3.0:attribute-category:action"; - public static final String CATEGORY_ACCESS_SUBJECT = "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"; - public static final String ACTION_ID = "urn:oasis:names:tc:xacml:1.0:action:action-id"; - public static final String SUBJECT_ID = "urn:oasis:names:tc:xacml:1.0:subject:subject-id"; - public static final String RESOURCE_ID = "urn:oasis:names:tc:xacml:1.0:resource:resource-id"; - public static final String FUNTION_INTEGER_ONE_AND_ONLY = "urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only"; - public static final String FUNCTION_STRING_ONE_AND_ONLY = "urn:oasis:names:tc:xacml:1.0:function:string-one-and-only"; - public static final String FUNCTION_STRING_EQUAL = "urn:oasis:names:tc:xacml:1.0:function:string-equal"; - public static final String FUNCTION_STRING_REGEX_MATCH = "org.openecomp.function.regex-match"; - public static final String FUNCTION_STRING_EQUAL_IGNORE = "urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case"; - public static final String INTEGER_DATATYPE = "http://www.w3.org/2001/XMLSchema#integer"; - public static final String BOOLEAN_DATATYPE = "http://www.w3.org/2001/XMLSchema#boolean"; - public static final String STRING_DATATYPE = "http://www.w3.org/2001/XMLSchema#string"; - public static final String URI_DATATYPE = "http://www.w3.org/2001/XMLSchema#anyURI"; - public static final String RULE_VARIABLE = "var:"; - public static final String EMPTY_STRING = ""; - - private static HtmlProcessor htmlProcessor; - - private static File policyFile; - - public static JSONObject DescribePolicy(final File policyFile) { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - HumanPolicyComponent.policyFile = policyFile; - return humanPolicyLayout(); - - } - - private static JSONObject humanPolicyLayout() { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - try { - String html = processPolicy(); - JSONObject result = new JSONObject(); - result.put("html", html); - return result; - //ByteArrayInputStream is = new ByteArrayInputStream(html.getBytes(StandardCharsets.UTF_8)); - - } catch (IllegalArgumentException e) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "cannot build html area por policy", e); - /*AdminNotification.warn("An error has occurred. Cannot describe this policy: " + - e.getMessage());*/ - } - return null; - } - - private static String processPolicy() throws IllegalArgumentException { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - FileInputStream pIS = null; - try { - pIS = new FileInputStream(policyFile); - Object policy = XACMLPolicyScanner.readPolicy(pIS); - if (policy == null) - throw new IllegalArgumentException("Policy File " + policyFile.getName() + - " cannot be unmarshalled"); - - HumanPolicyComponent.htmlProcessor = - new HtmlProcessor(HumanPolicyComponent.policyFile, policy); - - Path policyPath = FileSystems.getDefault().getPath(policyFile.getAbsolutePath()); - XACMLPolicyScanner xacmlScanner = new XACMLPolicyScanner(policyPath, htmlProcessor); - xacmlScanner.scan(); - String html = htmlProcessor.html(); - if (logger.isDebugEnabled()) - logger.debug(policyPath + System.lineSeparator() + html); - - return html; - - } catch (Exception e) { - String msg = "Exception reading policy: " + policyFile.getAbsolutePath() + - ": " + e.getMessage(); - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + msg, e); - throw new IllegalArgumentException(msg); - } finally { - if (pIS != null) { - try { - pIS.close(); - } catch (IOException e) { - logger.warn(e.getMessage(), e); - } - } - } - } - -} - -class HtmlProcessor extends SimpleCallback { - - private static final Logger logger = FlexLogger.getLogger(HtmlProcessor.class); - - private static Map function2human; - static { - function2human = new HashMap(); - function2human.put(HumanPolicyComponent.FUNCTION_STRING_EQUAL, "equal"); - function2human.put(HumanPolicyComponent.FUNCTION_STRING_EQUAL_IGNORE, "equal"); - function2human.put(HumanPolicyComponent.FUNCTION_STRING_ONE_AND_ONLY, "one-and-only"); - function2human.put(HumanPolicyComponent.FUNCTION_STRING_REGEX_MATCH, "matching regular expression"); - function2human.put(HumanPolicyComponent.FUNTION_INTEGER_ONE_AND_ONLY, "one-and-only"); - } - - private static Map combiningAlgo2human; - static { - combiningAlgo2human = new HashMap(); - combiningAlgo2human.put("deny-overrides", "to deny if any $placeholder$ below evaluates to deny"); - combiningAlgo2human.put("permit-overrides", "to permit if any $placeholder$ below evaluates to permit"); - - combiningAlgo2human.put("ordered-deny-overrides", "to deny if any $placeholder$ below evaluates to deny"); - combiningAlgo2human.put("ordered-permit-overrides", "to permit if any $placeholder$ below evaluates to permit"); - combiningAlgo2human.put("deny-unless-permit", "to permit if any $placeholder$ below evaluates to deny and not indeterminate"); - - combiningAlgo2human.put("permit-unless-deny", "to deny if any $placeholder$ below evaluates to is permit and not indeterminate"); - combiningAlgo2human.put("first-applicable", "to honour the result of the first successfully evaluated $placeholder$ in order"); - combiningAlgo2human.put("only-one-applicable", "to honour the result of the first successfully evaluated $placeholder$ in order"); - } - - private Map attributeIdentifiersMap = new HashMap(); - - private final StringWriter stringWriter = new StringWriter(); - private final PrintWriter htmlOut = new PrintWriter(stringWriter); - private final String policyName; - private final Object rootPolicyObject; - - public HtmlProcessor(File policyFile, Object policyObject) - throws IllegalArgumentException { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - if (policyFile == null) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Null Policy File"); - throw new IllegalArgumentException("Null Policy File"); - } - - if (!policyFile.exists() || !policyFile.canRead()) { - String msg = "Can't access " + policyFile.getAbsolutePath(); - logger.error(XACMLErrorConstants.ERROR_PERMISSIONS + msg); - throw new IllegalArgumentException(msg); - } - - if (policyObject == null || - (!(policyObject instanceof PolicySetType) && !(policyObject instanceof PolicyType))) { - String msg = "Invalid unmarshalled object: " + policyObject; - logger.error(XACMLErrorConstants.ERROR_SCHEMA_INVALID + msg); - throw new IllegalArgumentException(msg); - } - - this.policyName = FilenameUtils.removeExtension(policyFile.getName()); - this.rootPolicyObject = policyObject; - - String version = "-"; - if (policyObject instanceof PolicyType) { - PolicyType policy = (PolicyType) policyObject; - version = policy.getVersion(); - htmlOut.println("

Policy: " + policyName + - " (version " + version + ")

"); - - } else { - PolicySetType policySet = (PolicySetType) policyObject; - version = policySet.getVersion(); - htmlOut.println("

Policy Set: " + policyName + - " (v" + version + ")

"); - } - - htmlOut.println("

Location: " + policyFile.getPath() + "

"); - htmlOut.println("
"); - - if (rootPolicyObject instanceof PolicySetType) { - if (policyName.startsWith("Config_")) { - htmlOut.println("

This is a config policy set.

"); - } else if (policyName.startsWith("Action_")) { - htmlOut.println("

This is an action policy set.

"); - } - htmlOut.println("
"); - } else { - if (policyName.startsWith("Config_")) { - htmlOut.println("

This is a config policy.

"); - } else if (policyName.startsWith("Action_")) { - htmlOut.println("

This is an action policy.

"); - } - htmlOut.println("
    "); - } - } - - /** - * @return the attributeIdentifiersMap - */ - public Map getAttributeIdentifiersMap() { - return attributeIdentifiersMap; - } - - @Override - public void onFinishScan(Object root) { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - if (rootPolicyObject instanceof PolicySetType) { - htmlOut.println("
"); - } else { - htmlOut.println(""); - } - - htmlOut.println("
"); - - htmlOut.println("

Attribute Table:

"); - - htmlOut.println(""); - htmlOut.println(""); - htmlOut.print(""); - htmlOut.print(""); - htmlOut.print(""); - htmlOut.println(""); - for(Map.Entry entry : this.attributeIdentifiersMap.entrySet()){ - AttributeIdentifiers value = entry.getValue(); - htmlOut.println(""); - htmlOut.print(""); - htmlOut.print(""); - htmlOut.print(""); - htmlOut.println(""); - } - htmlOut.println("
CategoryTypeIdentifier
" + value.category + "" + value.type + "" + value.id + "
"); - - htmlOut.println("

"); - - // Not necessary for the user, uncomment if desired at some point - // writeRawXACML() - - super.onFinishScan(root); - } - - @SuppressWarnings("unused") - private void writeRawXACML() { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - htmlOut.println("
"); - htmlOut.println("

Raw XACML:

"); - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - if (rootPolicyObject instanceof PolicySetType) { - XACMLPolicyWriterWithPapNotify.writePolicyFile(bos, (PolicySetType) rootPolicyObject); - } else if (rootPolicyObject instanceof PolicyType) { - XACMLPolicyWriterWithPapNotify.writePolicyFile(bos, (PolicyType) rootPolicyObject); - } - - String xacml = bos.toString(); - xacml = xacml.replaceAll("<", "<"); - xacml = xacml.replaceAll(">", ">"); - htmlOut.println("
");
-		htmlOut.println(xacml);
-		htmlOut.println("
"); - } - - @Override - public CallbackResult onPreVisitPolicySet(PolicySetType parent, PolicySetType policySet) { - if (logger.isTraceEnabled()) - logger.trace("PolicySet: " + policySet.getPolicySetId() + " Version: " + policySet.getVersion()); - - if (parent != null && logger.isTraceEnabled()) - logger.trace("PolicySet: " + policySet.getPolicySetId() + - "Parent PolicySet: " + parent.getPolicySetId() + " Version: " + parent.getVersion()); - - String description = policySet.getDescription(); - if (description != null && logger.isTraceEnabled()) - logger.trace("PolicySet: " + policySet.getPolicySetId() + - " Description: " + policySet.getDescription()); - - if (parent == null) // root - policySet(policySet, "dl"); - else - policySet(policySet, "li"); - - if (policySet.getPolicySetOrPolicyOrPolicySetIdReference().size() > 0) - htmlOut.println("
    "); - - return super.onPreVisitPolicySet(parent, policySet); - } - - @Override - public CallbackResult onPostVisitPolicySet(PolicySetType parent, PolicySetType policySet) { - if (logger.isTraceEnabled()) - logger.trace("PolicySet: " + policySet.getPolicySetId() + " Version: " + policySet.getVersion()); - - if (parent != null && logger.isTraceEnabled()) - logger.trace("PolicySet: " + policySet.getPolicySetId() + - "Parent PolicySet: " + parent.getPolicySetId() + " Version: " + parent.getVersion()); - - String description = policySet.getDescription(); - if (description != null && logger.isTraceEnabled()) - logger.trace("PolicySet: " + policySet.getPolicySetId() + - " Description: " + policySet.getDescription()); - - if (policySet.getPolicySetOrPolicyOrPolicySetIdReference().size() > 0) - htmlOut.println("
"); - - htmlOut.println("

"); - - return super.onPostVisitPolicySet(parent, policySet); - } - - public void policySet(PolicySetType policySet, String htmlListElement) { - if (logger.isTraceEnabled()) - logger.trace("PolicySet: " + policySet.getPolicySetId()); - - String combiningAlgorithm = "-"; - String id = "-"; - String version = "-"; - - - if (policySet.getPolicyCombiningAlgId() != null) - combiningAlgorithm = extractLastIdentifier(policySet.getPolicyCombiningAlgId(), ":"); - - if (policySet.getPolicySetId() != null) - id = extractLastIdentifier(policySet.getPolicySetId(), ":"); - - if (policySet.getVersion() != null) - version = policySet.getVersion(); - - - htmlOut.println("<" + htmlListElement + ">Policy Set ID: " + id + - " (v" + version + ") " + ""); - - if (policySet.getTarget() == null || - policySet.getTarget().getAnyOf() == null || - policySet.getTarget().getAnyOf().size() <= 0) { - htmlOut.println("

This policy set applies to all requests.

"); - } else { - htmlOut.print("

"); - htmlOut.print("This policy set applies to requests with attributes "); - - List anyOf_s = policySet.getTarget().getAnyOf(); - target(anyOf_s); - htmlOut.println(".

"); - } - - if (policySet.getPolicySetOrPolicyOrPolicySetIdReference() != null && - policySet.getPolicySetOrPolicyOrPolicySetIdReference().size() > 0) { - String algoDesc = combiningAlgo2human.get(combiningAlgorithm); - if (algoDesc != null) { - algoDesc = algoDesc.replace("$placeholder$", "policy") + " (" + "" + combiningAlgorithm + ")"; - } else { - algoDesc = combiningAlgorithm; - } - - htmlOut.println("

The result is " + algoDesc + ":

"); - } - } - - @Override - public CallbackResult onPreVisitPolicy(PolicySetType parent, PolicyType policy) { - if (logger.isTraceEnabled()) - logger.trace("PolicySet: " + policy.getPolicyId() + " Version: " + policy.getVersion()); - - if (parent != null && logger.isTraceEnabled()) - logger.trace("PolicySet: " + policy.getPolicyId() + - "Parent PolicySet: " + parent.getPolicySetId() + " Version: " + parent.getVersion()); - - String description = policy.getDescription(); - if (description != null && logger.isTraceEnabled()) - logger.trace("PolicySet: " + policy.getPolicyId() + - " Description: " + policy.getDescription()); - - policy(policy); - - if (policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().size() > 0) - htmlOut.println("
    "); - - return super.onPreVisitPolicy(parent, policy); - } - - @Override - public CallbackResult onPostVisitPolicy(PolicySetType parent, PolicyType policy) { - if (logger.isTraceEnabled()) - logger.trace("PolicySet: " + policy.getPolicyId() + " Version: " + policy.getVersion()); - - if (parent != null && logger.isTraceEnabled()) - logger.trace("PolicySet: " + policy.getPolicyId() + - "Parent PolicySet: " + parent.getPolicySetId() + " Version: " + parent.getVersion()); - - if (policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().size() > 0) - htmlOut.println("
"); - - htmlOut.println("

"); - return super.onPostVisitPolicy(parent, policy); - } - - public void policy(PolicyType policy) { - if (logger.isTraceEnabled()) - logger.trace("Policy: " + policy.getPolicyId()); - - String combiningAlgorithm = "-"; - String id = "-"; - String version = "-"; - - - if (policy.getRuleCombiningAlgId() != null) - combiningAlgorithm = extractLastIdentifier(policy.getRuleCombiningAlgId(), ":"); - - if (policy.getPolicyId() != null) - id = extractLastIdentifier(policy.getPolicyId(), ":"); - - if (policy.getVersion() != null) - version = policy.getVersion(); - - htmlOut.println("
  • Policy ID: " + id + - " (v" + version + ") " + "
  • "); - - if (policy.getTarget() == null || - policy.getTarget().getAnyOf() == null || - policy.getTarget().getAnyOf().size() <= 0) { - htmlOut.println("

    This policy applies to all requests.

    "); - } else { - htmlOut.print("

    "); - htmlOut.print("This policy applies to requests with attributes "); - - List anyOf_s = policy.getTarget().getAnyOf(); - target(anyOf_s); - htmlOut.println(".

    "); - } - - if (policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition() != null && - policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().size() > 0) { - String algoDesc = combiningAlgo2human.get(combiningAlgorithm); - if (algoDesc != null) { - algoDesc = algoDesc.replace("$placeholder$", "rule") + " (" + combiningAlgorithm + ")"; - } else { - algoDesc = combiningAlgorithm; - } - htmlOut.println("

    The result is " + algoDesc + ":

    "); - } - } - - - @Override - public CallbackResult onPreVisitRule(PolicyType parent, RuleType rule) { - if (logger.isTraceEnabled()) - logger.trace("Rule: " + rule.getRuleId()); - - if (parent != null && logger.isTraceEnabled()) - logger.trace("Parent Policy: " + parent.getPolicyId() + " Version: " + parent.getVersion()); - - String description = rule.getDescription(); - if (description != null && logger.isTraceEnabled()) { - logger.trace("Rule: " + rule.getRuleId() + - " Description: " + rule.getDescription()); - } - - rule(rule); - - return super.onPreVisitRule(parent, rule); - } - - @Override - public CallbackResult onPostVisitRule(PolicyType parent, RuleType rule) { - if (logger.isTraceEnabled()) - logger.trace("Rule: " + rule.getRuleId()); - - if (parent != null && logger.isTraceEnabled()) - logger.trace("Parent Policy: " + parent.getPolicyId() + " Version: " + parent.getVersion()); - - return super.onPostVisitRule(parent, rule); - } - - public void rule(RuleType rule) { - if (logger.isTraceEnabled()) - logger.trace("Rule: " + rule.getRuleId()); - - String id = "-"; - - if (rule.getRuleId() != null) - id = extractLastIdentifier(rule.getRuleId(), ":"); - - htmlOut.println("
  • Rule ID: " + id + "
  • "); - - htmlOut.println("
    "); - - htmlOut.print("

    "); - htmlOut.print(rule.getEffect().value()); - - if (rule.getTarget() == null || - rule.getTarget().getAnyOf() == null || - rule.getTarget().getAnyOf().size() <= 0) { - htmlOut.print(" for all requests"); - } else { - List anyOf_s = rule.getTarget().getAnyOf(); - htmlOut.print(" for requests with attributes "); - target(anyOf_s); - } - - if (rule.getCondition() != null) { - htmlOut.print(" when "); - htmlOut.println(this.stringifyCondition(rule.getCondition()) + " "); - } else { - htmlOut.print(" with no conditions "); - } - - if (rule.getAdviceExpressions() != null) { - advice(rule.getAdviceExpressions()); - if (rule.getObligationExpressions() != null) - htmlOut.println(" and "); - } - - if (rule.getObligationExpressions() != null) { - obligation(rule.getObligationExpressions()); - } - - htmlOut.println("

    "); - } - - private void advice(AdviceExpressionsType adviceExpressions) { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - List ae = adviceExpressions.getAdviceExpression(); - for (AdviceExpressionType expression : ae) { - htmlOut.println(" with advice (" + expression.getAdviceId() + ") on " + - expression.getAppliesTo().value() + ":" ); - htmlOut.println("
      "); - List assignments = expression.getAttributeAssignmentExpression(); - if (assignments != null) { - processAttributeAssignments(assignments); - } - htmlOut.println("
    "); - } - } - - private void obligation(ObligationExpressionsType obligationExpressions) { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - List oe = obligationExpressions.getObligationExpression(); - for (ObligationExpressionType expression : oe) { - htmlOut.println(" with obligations (" + expression.getObligationId() + ") to be fullfilled on " + - expression.getFulfillOn().value() + ":" ); - htmlOut.println("
      "); - List assignments = expression.getAttributeAssignmentExpression(); - if (assignments != null) { - processAttributeAssignments(assignments); - } - htmlOut.println("
    "); - } - } - - /** - * @param assignments - */ - private void processAttributeAssignments(List assignments) { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - for (AttributeAssignmentExpressionType assignment : assignments) { - String succintIdentifier = extractLastIdentifier(assignment.getCategory(), ":") + - ":" + extractLastIdentifier(assignment.getAttributeId(), ":"); - AttributeIdentifiers attributeIdentifiers = null; - if (!this.attributeIdentifiersMap.containsKey(succintIdentifier)) { - // Note Attribute Assignments do not have an Attribute Type, assume string - // but note this case is unlikely since attributeMap should have been populated - // during parsing of target and conditions, and not in this case for Advice and - // Obligations. - attributeIdentifiers = new AttributeIdentifiers(assignment.getCategory(), - "NA", - assignment.getAttributeId()); - this.attributeIdentifiersMap.put(succintIdentifier, attributeIdentifiers); - } - - htmlOut.print("
  • " + succintIdentifier + " is "); - // AttributeValueType - JAXBElement jaxbExp = assignment.getExpression(); - Object assignmentObject = jaxbExp.getValue(); - if (assignmentObject instanceof AttributeValueType) { - AttributeValueType avt = (AttributeValueType) assignmentObject; - if (attributeIdentifiers != null) { - attributeIdentifiers.type = avt.getDataType(); - } - int numContent = avt.getContent().size(); - int countContent = 0; - for (Object c: avt.getContent()) { - countContent++; - htmlOut.print("" + c + ""); - if (countContent < numContent) - htmlOut.print(" or "); - } - htmlOut.println("
  • "); - } else if (assignmentObject instanceof AttributeDesignatorType) { - htmlOut.println("NA"); - } else if (assignmentObject instanceof AttributeSelectorType) { - htmlOut.println("NA"); - } else if (assignmentObject instanceof ApplyType) { - htmlOut.println("NA"); - } else { - htmlOut.println("Unexpected"); - } - } - } - - /** - * - * @param anyOfList - */ - public void target(List anyOfList) { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - if (anyOfList != null) { - Iterator iterAnyOf = anyOfList.iterator(); - String targetInHuman = ""; - while (iterAnyOf.hasNext()) { - AnyOfType anyOf = iterAnyOf.next(); - List allOfList = anyOf.getAllOf(); - if (allOfList != null) { - Iterator iterAllOf = allOfList.iterator(); - while (iterAllOf.hasNext()) { - AllOfType allOf = iterAllOf.next(); - List matchList = allOf.getMatch(); - if (matchList != null) { - Iterator iterMatch = matchList.iterator(); - if (matchList.size() > 1) - targetInHuman += "("; - while (iterMatch.hasNext()) { - MatchType match = iterMatch.next(); - // - // Finally down to the actual attribute - // - StdAttribute attribute = null; - AttributeValueType value = match.getAttributeValue(); - String attributeDataType = null; - if (match.getAttributeDesignator() != null && value != null) { - AttributeDesignatorType designator = match.getAttributeDesignator(); - attribute = new StdAttribute(new IdentifierImpl(designator.getCategory()), - new IdentifierImpl(designator.getAttributeId()), - new StdAttributeValue>(new IdentifierImpl(value.getDataType()), value.getContent()), - designator.getIssuer(), - false); - attributeDataType = designator.getDataType(); - } else if (match.getAttributeSelector() != null && value != null) { - AttributeSelectorType selector = match.getAttributeSelector(); - attribute = new StdAttribute(new IdentifierImpl(selector.getCategory()), - new IdentifierImpl(selector.getContextSelectorId()), - new StdAttributeValue>(new IdentifierImpl(value.getDataType()), value.getContent()), - null, - false); - attributeDataType = selector.getDataType(); - } else { - logger.warn("NULL designator/selector or value for match."); - attributeDataType = "NA"; - } - - String functionName = getHumanFunction(match.getMatchId()); - - String succintIdentifier = extractLastIdentifier(attribute.getCategory().stringValue(), ":") + - ":" + extractLastIdentifier(attribute.getAttributeId().stringValue(), ":"); - AttributeIdentifiers ai = new AttributeIdentifiers(attribute.getCategory().stringValue(), - attributeDataType, - attribute.getAttributeId().stringValue()); - this.attributeIdentifiersMap.put(succintIdentifier,ai); - - targetInHuman += "" + succintIdentifier + " " + functionName + " "; - - int numAttributes = attribute.getValues().size(); - int count = 0; - for (AttributeValue v: attribute.getValues()) { - count++; - if (v.getValue() instanceof Collection) { - Collection value_s = (Collection) v.getValue(); - int numValues = value_s.size(); - int countValues = 0; - for (Object o : value_s) { - countValues++; - targetInHuman += " " + o + ""; - if (countValues < numValues) { - targetInHuman += ", or"; - } - } - } else { - targetInHuman += " " + v.getValue() + ""; - if (count < numAttributes) { - targetInHuman += ", or "; - } - } - } - - if (iterMatch.hasNext()) { - targetInHuman += " and "; - } - } // end iterMatch - if (matchList.size() > 1) { - targetInHuman += ")"; - } - } - if (iterAllOf.hasNext()) { - targetInHuman += " or "; - } - } // end iterAllOf - } - if (iterAnyOf.hasNext()) { - targetInHuman = "(" + targetInHuman + ")" + " or "; - } else { - if (anyOfList.size() > 1) { - targetInHuman += ")"; - } - } - } // end iterAnyOf - htmlOut.println(targetInHuman); - } - } - - private String getHumanFunction(String matchId) { - if (HtmlProcessor.function2human.containsKey(matchId)) { - return HtmlProcessor.function2human.get(matchId); - } - - FunctionDefinition function = PolicyController.getFunctionIDMap().get(matchId); - String functionName = function.getShortname(); - - if (logger.isDebugEnabled()) { - logger.debug(functionName + - ": #args[" + function.getArgLb() + "," + function.getArgUb() +"]"); - } - - return extractLastIdentifier(removePrimitives(functionName), ":"); - } - - public String html() { - this.htmlOut.flush(); - return this.stringWriter.toString(); - } - - private String extractLastIdentifier(String in, String separator) { - int lastIndex = in.lastIndexOf(separator); - if (lastIndex < 0) - return in; - else - return in.substring(lastIndex+1); - } - - private String removePrimitives(String in) { - in = in.replace("string-", ""); - in = in.replace("integer-", ""); - in = in.replace("double-", ""); - in = in.replace("boolean-", ""); - return in; - } - - private String stringifyCondition(ConditionType condition) { - if (condition.getExpression() == null) { - return ""; - } - - return stringifyExpression(condition.getExpression().getValue()); - } - - private String stringifyExpression(Object expression) { - if (expression instanceof ApplyType) { - ApplyType apply = (ApplyType) expression; - FunctionDefinition function = PolicyController.getFunctionIDMap().get(apply.getFunctionId()); - String functionName = function.getShortname(); - - if (logger.isDebugEnabled()) { - logger.debug(functionName + - ": #args[" + function.getArgLb() + "," + function.getArgUb() +"]"); - } - - if (functionName.contains("one-and-only")) { - if (logger.isDebugEnabled()) { - logger.debug("one-and-only found: " + functionName); - } - - List> exps = apply.getExpression(); - if (exps == null || exps.size() == 0) - return ""; - else { - String forResult = ""; - for (JAXBElement e : exps) { - Object v = e.getValue(); - if (logger.isDebugEnabled()) { - logger.debug("one-and-only children: " + v); - } - if (v != null) { - // C: return stringifyExpression(v, result); - forResult += stringifyExpression(v); - } - } - return forResult; - } - } - - final int numExpr = (apply.getExpression() == null) ? -1 : apply.getExpression().size(); - if (numExpr <= 0) { - if (logger.isDebugEnabled()) { - logger.debug(functionName + " 0 expressions: " + numExpr); - } - return ""; - } else if (numExpr == 1) { - // eg: not - if (logger.isDebugEnabled()) { - logger.debug(functionName + " 1 expression: " + numExpr); - } - String applySubresult = ""; - for (JAXBElement e : apply.getExpression()) { - Object v = e.getValue(); - if (v != null) { - applySubresult += this.stringifyExpression(e.getValue()); - } - } - return " " + removePrimitives(functionName) + " (" + applySubresult + ")"; - } else { - // > 1 arguments - if (logger.isDebugEnabled()) { - logger.debug(functionName + " > 1 expressions: " + numExpr); - } - String applySubresult = ""; - int exprCount = 0; - for (JAXBElement e : apply.getExpression()) { - exprCount++; - Object ev = e.getValue(); - if (ev != null) { - if (ev instanceof ApplyType) { - if (((ApplyType) ev).getFunctionId().contains("one-and-only")) { - applySubresult += this.stringifyExpression(e.getValue()); - } else { - applySubresult += "(" + this.stringifyExpression(e.getValue()) + ")"; - } - } else { - applySubresult += this.stringifyExpression(e.getValue()); - } - - if (exprCount < numExpr) { - applySubresult += " " + removePrimitives(functionName) + " "; - } - } - } - return applySubresult; - } - } - if (expression instanceof AttributeDesignatorType) { - AttributeDesignatorType adt = (AttributeDesignatorType) expression; - - String succintIdentifier = extractLastIdentifier(adt.getCategory(), ":") + - ":" + extractLastIdentifier(adt.getAttributeId(), ":"); - AttributeIdentifiers ai = new AttributeIdentifiers(adt.getCategory(), - adt.getDataType(), - adt.getAttributeId()); - this.attributeIdentifiersMap.put(succintIdentifier,ai); - - return "" + succintIdentifier + ""; - } - if (expression instanceof AttributeSelectorType) { - AttributeSelectorType ast = (AttributeSelectorType) expression; - - String attrName = ast.getPath(); - if (attrName == null || (attrName.length() == 0)) { - return ""; - } - - String textSelector = "/text()"; - if (attrName.endsWith(textSelector)) { - attrName = attrName.substring(0, attrName.length() - textSelector.length()); - } - - attrName = extractLastIdentifier(attrName, "/"); - attrName = extractLastIdentifier(attrName, ":"); - return " " + attrName; - } - if (expression instanceof AttributeValueType) { - AttributeValueType avt = (AttributeValueType) expression; - List content = avt.getContent(); - String value_s = ""; - for (Object o: content) { - value_s += " " + o.toString(); - } - return " " + value_s; - } - if (expression instanceof VariableReferenceType) { - // - // Really unknown - the variable may or may not have been defined - // - return " VARIABLEREF-NOT-HANDLED"; - } else { - throw new IllegalArgumentException("Unexpected input expression"); - } - } -} - - -class AttributeIdentifiers { - public final String category; - public String type; - public final String id; - - public AttributeIdentifiers(String category, String type, String id) { - this.category = category; - this.type = type; - this.id = id; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/components/PolicyImportWindow.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/components/PolicyImportWindow.java deleted file mode 100644 index c70e331d0..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/components/PolicyImportWindow.java +++ /dev/null @@ -1,226 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.components; - - -/* - * - */ -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Set; - -import org.apache.commons.compress.archivers.tar.TarArchiveEntry; -import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; -import org.apache.commons.io.IOUtils; -import org.openecomp.policy.controller.PolicyController; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - - -public class PolicyImportWindow{ - - private static final Logger logger = FlexLogger.getLogger(PolicyImportWindow.class); - private static final int BUFFER_SIZE = 4096; - private static Path directory = PolicyController.getGitPath(); - private Path newfile = null; - private boolean succeeded = false; - public static String CONFIG_HOME = PolicyController.getConfigHome(); - public static String ACTION_HOME = PolicyController.getActionHome(); - private Boolean superadmin = false; - private ArrayList xacmlFiles = new ArrayList(); - /** - * The constructor should first build the main layout, set the - * composition root and then do any custom initialization. - * - * The constructor will not be automatically regenerated by the - * visual editor. - */ - - public OutputStream receiveUpload(String filename, String mimeType) { - - // - // Create its new full path - // - this.newfile = Paths.get(PolicyImportWindow.directory.toString(), filename); - // - // Does it already exist? - // - if (Files.exists(this.newfile)) { - return null; - } - // - // Try to create the output stream - // - try { - return new FileOutputStream(this.newfile.toFile()); - } catch (FileNotFoundException e) { - logger.error("Failed to create uploaded file", e); - } - return null; - } - - public void Upload(){ - TarArchiveEntry entry = null; - TarArchiveInputStream extractFile = null; - try { - extractFile = new TarArchiveInputStream (new FileInputStream(this.newfile.toFile())); - } catch (FileNotFoundException e1) { - e1.printStackTrace(); - } - //Create a loop to read every single entry in TAR file - try { - while ((entry = extractFile.getNextTarEntry()) != null) { - this.superadmin = true; - try{ - copyFileToLocation(extractFile, entry, xacmlFiles, null, superadmin); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR+"Exception while Importing Polcies"+e); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - - } - - - - - - //Copy files to Directorys - public static void copyFileToLocation(TarArchiveInputStream extractFile, TarArchiveEntry entry, ArrayList xacmlFiles, Set finalScopes, Boolean superadminValue ) throws IOException{ - String individualFiles = ""; - int offset = 0; - FileOutputStream outputFile=null; - // Get the name of the file - if(superadminValue){ - individualFiles = entry.getName(); - }else{ - for(int i =0; i< finalScopes.size(); i++){ - if(entry.getName().startsWith(finalScopes.toArray()[i].toString())){ - individualFiles = entry.getName(); - } - } - } - - if(individualFiles.endsWith(".xls")){ - if(individualFiles.contains("\\")){ - individualFiles = individualFiles.replace("\\", File.separator); - }else if(individualFiles.contains("/")){ - individualFiles = individualFiles.replace("/", File.separator); - } - return; - } - - individualFiles = individualFiles.replace("/", File.separator); - individualFiles = individualFiles.replace("\\", File.separator); - - //Create the path with the entry name - String filePath = directory.toAbsolutePath() + File.separator + individualFiles; - String configPath = CONFIG_HOME + File.separator + individualFiles; - String actionPath = ACTION_HOME + File.separator + individualFiles; - logger.info("File Name in TAR File is: " + individualFiles); - logger.info("Xml directory file path: " + filePath); - logger.info("Config Home directory file path: " + configPath); - logger.info("Action Home directory file path: " + actionPath); - - - // Get Size of the file and create a byte array for the size - byte[] content = new byte[(int) entry.getSize()]; - - offset=0; - logger.info("File Name in TAR File is: " + individualFiles); - logger.info("Size of the File is: " + entry.getSize()); - // Read file from the archive into byte array - extractFile.read(content, offset, content.length - offset); - if (!entry.isDirectory()) { - if(!individualFiles.contains(".Config_") || !individualFiles.contains(".Action_")){ - // if the entry is a file, extracts it - String filePath1 = filePath.substring(0, filePath.lastIndexOf(File.separator)); - File newFile = new File(filePath1); - if(!(newFile.exists())) { - File dir = new File(filePath1); - dir.mkdir(); - extractFile(extractFile, filePath); - } - } - } else { - // if the entry is a directory, make the director - File dir = new File(filePath); - dir.mkdir(); - } - // Define OutputStream for writing the file - if(individualFiles.contains(".Config_")){ - outputFile=new FileOutputStream(new File(configPath)); - }else if(individualFiles.contains(".Action_")){ - outputFile=new FileOutputStream(new File(actionPath)); - }else{ - if(filePath != null){ - outputFile=new FileOutputStream(new File(filePath)); - xacmlFiles.add(filePath); - } - } - - // Use IOUtiles to write content of byte array to physical file - IOUtils.write(content,outputFile); - - // Close Output Stream - try { - outputFile.close(); - } catch (IOException e) { - logger.info("IOException:" +e); - e.printStackTrace(); - } - } - - private static void extractFile(TarArchiveInputStream extractFile, String filePath) throws IOException { - BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath)); - byte[] bytesIn = new byte[BUFFER_SIZE]; - int read = 0; - while ((read = extractFile.read(bytesIn)) != -1) { - bos.write(bytesIn, 0, read); - } - bos.close(); - - } - - public Path getUploadedFile() { - if (this.succeeded) { - return this.newfile; - } - return null; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/conf/HibernateSession.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/conf/HibernateSession.java deleted file mode 100644 index b3db51df4..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/conf/HibernateSession.java +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.conf; - -/* - * - * - * */ -import java.util.Properties; - -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.cfg.Configuration; -import org.openecomp.policy.controller.PolicyController; -import org.openecomp.policy.rest.jpa.SystemLogDB; - -@SuppressWarnings("deprecation") -public class HibernateSession{ - - private static SessionFactory logSessionFactory; - - static { - try { - Properties prop= new Properties(); - prop.setProperty("hibernate.connection.url", PolicyController.logdbUrl); - prop.setProperty("hibernate.connection.username", PolicyController.logdbUserName); - prop.setProperty("hibernate.connection.password", PolicyController.logdbPassword); - prop.setProperty("dialect", PolicyController.logdbDialect); - prop.setProperty("hibernate.connection.driver_class", PolicyController.logdbDriver); - prop.setProperty("show_sql", "false"); - logSessionFactory = new Configuration().addPackage("org.openecomp.policy.*").addProperties(prop) - .addAnnotatedClass(SystemLogDB.class).buildSessionFactory(); - } catch (Throwable ex) { - throw new ExceptionInInitializerError(ex); - } - } - public static Session getSession() throws HibernateException { - return logSessionFactory.openSession(); - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/ActionPolicyController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/ActionPolicyController.java deleted file mode 100644 index 0688846b4..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/ActionPolicyController.java +++ /dev/null @@ -1,535 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.JAXBElement; - -import org.json.JSONObject; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.admin.PolicyNotificationMail; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.dao.FunctionDefinitionDao; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.dao.RuleAlgorithmsDao; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.elk.client.PolicyElasticSearchController; -import org.openecomp.policy.rest.dao.ActionPolicyDictDao; -import org.openecomp.policy.rest.jpa.ActionPolicyDict; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.RuleAlgorithms; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.att.research.xacml.api.XACML3; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Joiner; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeAssignmentExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeDesignatorType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ConditionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionsType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Controller -@RequestMapping({"/"}) -public class ActionPolicyController extends RestrictedBaseController{ - private static final Logger logger = FlexLogger.getLogger(ActionPolicyController.class); - - private static FunctionDefinitionDao functionDefinitionDao; - private static RuleAlgorithmsDao ruleAlgorithmsDao; - private static ActionPolicyDictDao actionPolciyDictDao; - private static PolicyVersionDao policyVersionDao; - private static WatchPolicyNotificationDao policyNotificationDao; - - @Autowired - private ActionPolicyController(RuleAlgorithmsDao ruleAlgorithmsDao, ActionPolicyDictDao actionPolciyDictDao, - PolicyVersionDao policyVersionDao, FunctionDefinitionDao functionDefinitionDao, WatchPolicyNotificationDao policyNotificationDao){ - ActionPolicyController.ruleAlgorithmsDao =ruleAlgorithmsDao; - ActionPolicyController.actionPolciyDictDao =actionPolciyDictDao; - ActionPolicyController.policyVersionDao =policyVersionDao; - ActionPolicyController.functionDefinitionDao = functionDefinitionDao; - ActionPolicyController.policyNotificationDao = policyNotificationDao; - } - - public ActionPolicyController(){} - - private String ruleID = ""; - private ArrayList attributeList; - protected LinkedList ruleAlgoirthmTracker; - public static final String PERFORMER_ATTRIBUTEID = "performer"; - protected Map performer = new HashMap(); - private ArrayList ruleAlgorithmList; - - public String newPolicyID() { - return Joiner.on(':').skipNulls().join((PolicyController.getDomain().startsWith("urn") ? null: "urn"), - PolicyController.getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID()); - } - - - @RequestMapping(value={"/get_FunctionDefinitionDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getFunctionDefinitionData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - model.put("functionDefinitionDatas", mapper.writeValueAsString(functionDefinitionDao.getFunctionDefinitionByName())); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - logger.equals(XACMLErrorConstants.ERROR_DATA_ISSUE +"Error while retriving the Function Definition data"+e); - } - } - - @RequestMapping(value={"/policyController/save_Actionpolicy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveActionPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - String userId = UserUtils.getUserIdFromCookie(request); - RESTfulPAPEngine engine = (RESTfulPAPEngine) PolicyController.getPapEngine(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").get("policy").toString(), PolicyAdapter.class); - if(root.get("policyData").get("model").get("type").toString().replace("\"", "").equals("file")){ - policyData.isEditPolicy = true; - } - if(root.get("policyData").get("model").get("path").size() != 0){ - String dirName = ""; - for(int i = 0; i < root.get("policyData").get("model").get("path").size(); i++){ - dirName = dirName.replace("\"", "") + root.get("policyData").get("model").get("path").get(i).toString().replace("\"", "") + File.separator; - } - policyData.setDomainDir(dirName.substring(0, dirName.lastIndexOf(File.separator))); - }else{ - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - } - int version = 0; - int highestVersion = 0; - int descriptionVersion = 0; - //get the highest version of policy from policy version table. - //getting the sub scope domain where the policy is created or updated - String dbCheckPolicyName = policyData.getDomainDir() + File.separator + "Action_" + policyData.getPolicyName(); - List versionList = policyVersionDao.getPolicyVersionEntityByName(dbCheckPolicyName); - if (versionList.size() > 0) { - for(int i = 0; i < versionList.size(); i++) { - PolicyVersion entityItem = versionList.get(i); - if(entityItem.getPolicyName().equals(dbCheckPolicyName)){ - highestVersion = entityItem.getHigherVersion(); - } - } - } - if(highestVersion != 0){ - version = highestVersion; - descriptionVersion = highestVersion +1; - }else{ - version = 1; - descriptionVersion = 1; - } - - //set policy adapter values for Building JSON object containing policy data - String createdBy = ""; - String modifiedBy = userId; - if(descriptionVersion == 1){ - createdBy = userId; - }else{ - String policyName = PolicyController.getGitPath().toAbsolutePath().toString() + File.separator + policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - File policyPath = new File(policyName); - try { - createdBy = XACMLPolicyScanner.getCreatedBy(policyPath.toPath()); - } catch (IOException e) { - createdBy = "guest"; - } - } - - policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"); - Map successMap = new HashMap(); - Map attributeMap = new HashMap(); - - List dynamicRuleAlgorithmLabels = new LinkedList(); - List dynamicRuleAlgorithmCombo = new LinkedList(); - List dynamicRuleAlgorithmField1 = new LinkedList(); - List dynamicRuleAlgorithmField2 = new LinkedList(); - - //set the Rule Combining Algorithm Id to be sent to PAP-REST via JSON - List ruleAlgorithmsList = ruleAlgorithmsDao.getRuleAlgorithms(); - for (int i = 0; i < ruleAlgorithmsList.size(); i++) { - RuleAlgorithms a = ruleAlgorithmsList.get(i); - if (a.getXacmlId().equals(XACML3.ID_RULE_PERMIT_OVERRIDES.stringValue())) { - policyData.setRuleCombiningAlgId(a.getXacmlId()); - break; - } - } - - if(policyData.getAttributes().size() > 0){ - for(Object attribute : policyData.getAttributes()){ - if(attribute instanceof LinkedHashMap){ - String key = ((LinkedHashMap) attribute).get("option").toString(); - String value = ((LinkedHashMap) attribute).get("number").toString(); - attributeMap.put(key, value); - } - } - } - - if(policyData.getRuleAlgorithmschoices().size() > 0){ - for(Object attribute : policyData.getRuleAlgorithmschoices()){ - if(attribute instanceof LinkedHashMap){ - String label = ((LinkedHashMap) attribute).get("id").toString(); - String key = ((LinkedHashMap) attribute).get("dynamicRuleAlgorithmField1").toString(); - String rule = ((LinkedHashMap) attribute).get("dynamicRuleAlgorithmCombo").toString(); - String value = ((LinkedHashMap) attribute).get("dynamicRuleAlgorithmField2").toString(); - dynamicRuleAlgorithmLabels.add(label); - dynamicRuleAlgorithmField1.add(key); - dynamicRuleAlgorithmCombo.add(rule); - dynamicRuleAlgorithmField2.add(value); - } - } - } - - String actionDictValue = policyData.getActionAttributeValue(); - ActionPolicyDict jsonData = ((ActionPolicyDict) actionPolciyDictDao.getActionEntityDatabyId(actionDictValue)); - String actionBodyString = jsonData.getBody(); - String actionDictHeader = jsonData.getHeader(); - String actionDictType = jsonData.getType(); - String actionDictUrl = jsonData.getUrl(); - String actionDictMethod = jsonData.getMethod(); - policyData.setActionDictHeader(actionDictHeader); - policyData.setActionDictType(actionDictType); - policyData.setActionDictUrl(actionDictUrl); - policyData.setActionDictMethod(actionDictMethod); - policyData.setActionAttribute(actionDictValue); - policyData.setDynamicRuleAlgorithmLabels(dynamicRuleAlgorithmLabels); - policyData.setDynamicRuleAlgorithmCombo(dynamicRuleAlgorithmCombo); - policyData.setDynamicRuleAlgorithmField1(dynamicRuleAlgorithmField1); - policyData.setDynamicRuleAlgorithmField2(dynamicRuleAlgorithmField2); - if (actionBodyString != null) { - policyData.setActionBody(actionBodyString); - } - policyData.setDynamicFieldConfigAttributes(attributeMap); - - if (policyData.isEditPolicy()){ - //increment the version and set in policyAdapter - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - policyData.setPolicyID(this.newPolicyID()); - policyData.setRuleID(ruleID); - successMap = engine.updatePolicyRequest(policyData); - } else { - //send it for policy creation - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - successMap = engine.createPolicyRequest(policyData); - - } - if (successMap.containsKey("success")) { - // Add it into our tree - Path finalPolicyPath = null; - finalPolicyPath = Paths.get(successMap.get("success")); - PolicyElasticSearchController controller = new PolicyElasticSearchController(); - controller.updateElk(finalPolicyPath.toString()); - File file = finalPolicyPath.toFile(); - if(file != null){ - String policyName = file.toString(); - String removePath = policyName.substring(policyName.indexOf("repository")+11); - String removeXml = removePath.replace(".xml", ""); - String removeExtension = removeXml.substring(0, removeXml.indexOf(".")); - List policyVersionList = policyVersionDao.getPolicyVersionEntityByName(removeExtension); - if (policyVersionList.size() > 0) { - for(int i = 0; i < policyVersionList.size(); i++) { - PolicyVersion entityItem = policyVersionList.get(i); - if(entityItem.getPolicyName().equals(removeExtension)){ - version = entityItem.getHigherVersion() +1; - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setModifiedBy(userId); - policyVersionDao.update(entityItem); - if(policyData.isEditPolicy){ - PolicyNotificationMail email = new PolicyNotificationMail(); - String mode = "EditPolicy"; - String policyNameForEmail = policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - email.sendMail(entityItem, policyNameForEmail, mode, policyNotificationDao); - } - } - } - }else{ - PolicyVersion entityItem = new PolicyVersion(); - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setPolicyName(removeExtension); - entityItem.setCreatedBy(userId); - entityItem.setModifiedBy(userId); - policyVersionDao.Save(entityItem); - } - } - } - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(successMap); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - public void PrePopulateActionPolicyData(PolicyAdapter policyAdapter) { - attributeList = new ArrayList(); - ruleAlgorithmList = new ArrayList(); - performer.put("PDP", "PDPAction"); - performer.put("PEP", "PEPAction"); - - if (policyAdapter.getPolicyData() instanceof PolicyType) { - Object policyData = policyAdapter.getPolicyData(); - PolicyType policy = (PolicyType) policyData; - policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName()); - String policyNameValue = policyAdapter.getPolicyName().substring(policyAdapter.getPolicyName().indexOf("_") + 1, policyAdapter.getPolicyName().lastIndexOf(".")); - policyAdapter.setPolicyName(policyNameValue); - String description = ""; - try{ - description = policy.getDescription().substring(0, policy.getDescription().indexOf("@CreatedBy:")); - }catch(Exception e){ - description = policy.getDescription(); - } - policyAdapter.setPolicyDescription(description); - // Get the target data under policy for Action. - TargetType target = policy.getTarget(); - if (target != null) { - // under target we have AnyOFType - List anyOfList = target.getAnyOf(); - if (anyOfList != null) { - Iterator iterAnyOf = anyOfList.iterator(); - while (iterAnyOf.hasNext()) { - AnyOfType anyOf = iterAnyOf.next(); - // Under AntOfType we have AllOfType - List allOfList = anyOf.getAllOf(); - if (allOfList != null) { - Iterator iterAllOf = allOfList.iterator(); - while (iterAllOf.hasNext()) { - AllOfType allOf = iterAllOf.next(); - // Under AllOfType we have Mathch. - List matchList = allOf.getMatch(); - if (matchList != null) { - Iterator iterMatch = matchList.iterator(); - while (iterMatch.hasNext()) { - MatchType match = iterMatch.next(); - // - // Under the match we have attributevalue and - // attributeDesignator. So,finally down to the actual attribute. - // - AttributeValueType attributeValue = match.getAttributeValue(); - String value = (String) attributeValue.getContent().get(0); - AttributeDesignatorType designator = match.getAttributeDesignator(); - String attributeId = designator.getAttributeId(); - // Component attributes are saved under Target here we are fetching them back. - // One row is default so we are not adding dynamic componet at index 0. - Map attribute = new HashMap(); - attribute.put("option", attributeId); - attribute.put("number", value); - attributeList.add(attribute); - } - } - policyAdapter.setAttributes(attributeList); - } - } - } - } - - List ruleList = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition(); - // Under rule we have Condition and obligation. - for (Object o : ruleList) { - if (o instanceof RuleType) { - // get the condition data under the rule for rule Algorithms. - ruleID = ((RuleType) o).getRuleId(); - ConditionType condition = ((RuleType) o).getCondition(); - ObligationExpressionsType obligations = ((RuleType) o).getObligationExpressions(); - if (condition != null) { - int index = 0; - ApplyType actionApply = (ApplyType) condition.getExpression().getValue(); - ruleAlgoirthmTracker = new LinkedList(); - // Populating Rule Algorithms starting from compound. - prePopulateCompoundRuleAlgorithm(index, actionApply); - } - policyAdapter.setRuleAlgorithmschoices(ruleAlgorithmList); - // get the Obligation data under the rule for Form elements. - if (obligations != null) { - // Under the obligationExpressions we have obligationExpression. - List obligationList = obligations.getObligationExpression(); - if (obligationList != null) { - Iterator iterObligation = obligationList.iterator(); - while (iterObligation.hasNext()) { - ObligationExpressionType obligation = iterObligation.next(); - policyAdapter.setActionAttributeValue(obligation.getObligationId()); - // Under the obligationExpression we have attributeAssignmentExpression. - List attributeAssignmentExpressionList = obligation.getAttributeAssignmentExpression(); - if (attributeAssignmentExpressionList != null) { - Iterator iterAttributeAssignmentExpression = attributeAssignmentExpressionList.iterator(); - while (iterAttributeAssignmentExpression.hasNext()) { - AttributeAssignmentExpressionType attributeAssignmentExpression = iterAttributeAssignmentExpression.next(); - String attributeID = attributeAssignmentExpression.getAttributeId(); - AttributeValueType attributeValue = (AttributeValueType) attributeAssignmentExpression.getExpression().getValue(); - if (attributeID.equals(PERFORMER_ATTRIBUTEID)) { - for (String key : performer.keySet()) { - String keyValue = performer.get(key); - if (keyValue.equals(attributeValue.getContent().get(0))) { - policyAdapter.setActionPerformer(key); - } - } - } - } - } - } - } - } - } - } - } - } - } - - private int prePopulateCompoundRuleAlgorithm(int index, ApplyType actionApply) { - boolean isCompoundRule = true; - List> jaxbActionTypes = actionApply.getExpression(); - for (JAXBElement jaxbElement : jaxbActionTypes) { - // If There is Attribute Value under Action Type that means we came to the final child - if (logger.isDebugEnabled()) { - logger.debug("Prepopulating rule algoirthm: " + index); - } - // Check to see if Attribute Value exists, if yes then it is not a compound rule - if (jaxbElement.getValue() instanceof AttributeValueType) { - prePopulateRuleAlgorithms(index, actionApply, jaxbActionTypes); - ruleAlgoirthmTracker.addLast(index); - isCompoundRule = false; - index++; - } - } - if (isCompoundRule) { - // As it's compound rule, Get the Apply types - for (JAXBElement jaxbElement : jaxbActionTypes) { - ApplyType innerActionApply = (ApplyType) jaxbElement.getValue(); - index = prePopulateCompoundRuleAlgorithm(index, innerActionApply); - } - // Populate combo box - if (logger.isDebugEnabled()) { - logger.debug("Prepopulating Compound rule algorithm: " + index); - } - Map rule = new HashMap(); - for (String key : PolicyController.getDropDownMap().keySet()) { - String keyValue = PolicyController.getDropDownMap().get(key); - if (keyValue.equals(actionApply.getFunctionId())) { - rule.put("dynamicRuleAlgorithmCombo", key); - } - } - rule.put("id", "A" + (index +1)); - // Populate Key and values for Compound Rule - rule.put("dynamicRuleAlgorithmField1", "A" + (ruleAlgoirthmTracker.getLast() + 1 )); - ruleAlgoirthmTracker.removeLast(); - rule.put("dynamicRuleAlgorithmField2", "A" + (ruleAlgoirthmTracker.getLast() + 1)); - ruleAlgoirthmTracker.removeLast(); - ruleAlgoirthmTracker.addLast(index); - ruleAlgorithmList.add(rule); - index++; - } - return index; - } - - private void prePopulateRuleAlgorithms(int index, ApplyType actionApply, List> jaxbActionTypes) { - Map ruleMap = new HashMap(); - ruleMap.put("id", "A" + (index +1)); - // Populate combo box - Map dropDownMap = PolicyController.getDropDownMap(); - for (String key : dropDownMap.keySet()) { - String keyValue = dropDownMap.get(key); - if (keyValue.equals(actionApply.getFunctionId())) { - ruleMap.put("dynamicRuleAlgorithmCombo", key); - } - } - // Populate the key and value fields - // Rule Attribute added as key - if ((jaxbActionTypes.get(0).getValue()) instanceof ApplyType) { - // Get from Attribute Designator - ApplyType innerActionApply = (ApplyType) jaxbActionTypes.get(0).getValue(); - List> jaxbInnerActionTypes = innerActionApply.getExpression(); - AttributeDesignatorType attributeDesignator = (AttributeDesignatorType) jaxbInnerActionTypes.get(0).getValue(); - ruleMap.put("dynamicRuleAlgorithmField1", attributeDesignator.getAttributeId()); - - // Get from Attribute Value - AttributeValueType actionConditionAttributeValue = (AttributeValueType) jaxbActionTypes.get(1).getValue(); - String attributeValue = (String) actionConditionAttributeValue.getContent().get(0); - ruleMap.put("dynamicRuleAlgorithmField2", attributeValue); - } - // Rule Attribute added as value - else if (((jaxbActionTypes.get(0).getValue()) instanceof AttributeValueType)) { - AttributeValueType actionConditionAttributeValue = (AttributeValueType) jaxbActionTypes.get(0).getValue(); - String attributeValue = (String) actionConditionAttributeValue.getContent().get(0); - ruleMap.put("dynamicRuleAlgorithmField2", attributeValue); - - ApplyType innerActionApply = (ApplyType) jaxbActionTypes.get(1).getValue(); - List> jaxbInnerActionTypes = innerActionApply.getExpression(); - AttributeDesignatorType attributeDesignator = (AttributeDesignatorType) jaxbInnerActionTypes.get(0).getValue(); - ruleMap.put("dynamicRuleAlgorithmField1", attributeDesignator.getAttributeId()); - } - ruleAlgorithmList.add(ruleMap); - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/AdminTabController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/AdminTabController.java deleted file mode 100644 index 67c2d3080..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/AdminTabController.java +++ /dev/null @@ -1,100 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.PrintWriter; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.json.JSONObject; -import org.openecomp.policy.dao.GlobalRoleSettingsDao; -import org.openecomp.policy.rest.jpa.GlobalRoleSettings; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Controller -@RequestMapping({"/"}) -public class AdminTabController extends RestrictedBaseController{ - - @Autowired - GlobalRoleSettingsDao globalRoleSettingsDao; - - - - @RequestMapping(value={"/get_LockDownData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getAdminTabEntityData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - model.put("lockdowndata", mapper.writeValueAsString(globalRoleSettingsDao.getGlobalRoleSettings())); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - @RequestMapping(value={"/adminTabController/save_LockDownValue.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveAdminTabLockdownValue(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - GlobalRoleSettings globalRole = mapper.readValue(root.get("lockdowndata").toString(), GlobalRoleSettings.class); - globalRole.setRole("super-admin"); - globalRoleSettingsDao.update(globalRole); - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(this.globalRoleSettingsDao.getGlobalRoleSettings()); - JSONObject j = new JSONObject("{descriptiveScopeDictionaryDatas: " + responseString + "}"); - - out.write(j.toString()); - - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/AutoPushController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/AutoPushController.java deleted file mode 100644 index 699d8ed00..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/AutoPushController.java +++ /dev/null @@ -1,433 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.net.URI; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.io.FilenameUtils; -import org.json.JSONArray; -import org.json.JSONObject; -import org.openecomp.policy.adapter.AutoPushTabAdapter; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.model.PDPGroupContainer; -import org.openecomp.policy.model.PDPPolicyContainer; -import org.openecomp.policy.model.Roles; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.api.pap.EcompPDPGroup; - -import com.att.research.xacml.api.pap.PAPException; -//import com.att.research.xacml.api.pap.PDPGroup; -import com.att.research.xacml.api.pap.PDPPolicy; -import org.openecomp.policy.xacml.std.pap.StdPDPGroup; -import org.openecomp.policy.xacml.std.pap.StdPDPPolicy; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - -@Controller -@RequestMapping({"/"}) -public class AutoPushController extends RestrictedBaseController{ - - private static final Logger logger = FlexLogger.getLogger(AutoPushController.class); - - private PDPGroupContainer container; - protected List groups = Collections.synchronizedList(new ArrayList()); - - private static PDPPolicyContainer policyContainer; - Set selectedPolicies; - - @Autowired - PolicyVersionDao policyVersionDao; - - public synchronized void refreshGroups() { - synchronized(this.groups) { - this.groups.clear(); - try { - this.groups.addAll(PolicyController.getPapEngine().getEcompPDPGroups()); - } catch (PAPException e) { - String message = "Unable to retrieve Groups from server: " + e; - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + message); - } - - } - } - - @RequestMapping(value={"/get_AutoPushPoliciesContainerData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getPolicyGroupContainerData(HttpServletRequest request, HttpServletResponse response){ - try{ - Path gitPath = PolicyController.getGitPath().toAbsolutePath(); - PrintWriter out = response.getWriter(); - JSONObject j = new JSONObject("{data: " + readFileRepository(gitPath,0,0,request).toString() + "}"); - out.write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - @SuppressWarnings("rawtypes") - public JSONArray readFileRepository(Path path, int id, int parentid, HttpServletRequest request){ - Set scopes = null; - List roles = null; - String userId = null; - try { - userId = UserUtils.getUserIdFromCookie(request); - } catch (Exception e) { - logger.error("Exception Occured while reading userid from cookie" +e); - } - JSONArray fileJSONArray = new JSONArray(); - File root = new File(path.toString()); - if(parentid==0 ){ - parentid = 1; - } - List userRoles = PolicyController.getRoles(userId); - roles = new ArrayList(); - scopes = new HashSet(); - for(Roles userRole: userRoles){ - roles.add(userRole.getRole()); - scopes.add(userRole.getScope()); - } - - for ( File file : root.listFiles()){ - if (!(file.toString().contains(".git") || file.equals(".DS_Store"))) { - if(file.isDirectory()){ - JSONObject el = new JSONObject(); - String fileName = file.getName().toString(); - el.put("categoryId", id+1); - el.put("name", fileName); - el.put("dateModified", lastModified(file)); - el.put("filePath", file.getPath()); - el.put("parentCategoryId", parentid); - el.put("files",readFileRepository(file.toPath(),id+1, id+1, request)); - if (roles.contains("super-admin") || roles.contains("super-editor") || roles.contains("super-guest") ) { - fileJSONArray.put(el); - }else{ - String filePath = file.getPath().toString(); - int startIndex = filePath.indexOf("repository") + 11; - filePath = filePath.substring(startIndex, filePath.length()); - if (scopes.contains(filePath)) { - fileJSONArray.put(el); - } - } - }else{ - JSONObject el = new JSONObject(); - String policyName = ""; - String version = ""; - String fileName = file.getName().toString(); - if(fileName.endsWith(".xml")){ - fileName = fileName.substring(0, fileName.lastIndexOf('.')); - fileName = fileName.substring(0, fileName.lastIndexOf('.')); - //Query the database - String parent = file.toString().substring(file.toString().indexOf("repository")+ 11); - parent = FilenameUtils.removeExtension(parent); - version = parent.substring(parent.indexOf(".")+1); - policyName = parent.substring(0, parent.lastIndexOf(".")); - if(policyName.contains("\\")){ - String scope = policyName.substring(0, policyName.lastIndexOf("\\")); - policyName = scope + "\\" + policyName.substring(policyName.lastIndexOf("\\")); - } - } - el.put("categoryId", id+1); - el.put("name", fileName); - el.put("parentCategoryId", parentid); - el.put("dateModified", lastModified(file)); - el.put("version", version); - el.put("filePath", file.getPath()); - el.put("files",new ArrayList()); - String query = "from PolicyVersion where POLICY_NAME ='" +policyName+"' and ACTIVE_VERSION ='"+version+"'"; - Boolean active = PolicyController.getActivePolicy(query); - if(active){ - if (roles.contains("super-admin") || roles.contains("super-editor") || roles.contains("super-guest") ) { - fileJSONArray.put(el); - }else{ - String filePath = file.getPath().toString(); - int startIndex = filePath.indexOf("repository") + 11; - filePath = filePath.substring(startIndex, filePath.length()); - filePath = filePath.substring(0, filePath.lastIndexOf(File.separator)); - if (scopes.contains(filePath)) { - fileJSONArray.put(el); - } - } - } - } - } - } - return fileJSONArray; - } - - public Date lastModified(File file) { - return new Date(file.lastModified()); - } - - public String getVersion(File file) { - try { - return XACMLPolicyScanner.getVersion(Paths.get(file.getAbsolutePath())); - } catch (IOException e) { - return ""; - } - } - - public String getDomain(File file) { - String filePath = file.getAbsolutePath(); - int startIndex = filePath.indexOf("repository") + 11; - return filePath.substring(startIndex, filePath.length()); - } - - - @RequestMapping(value={"/auto_Push/PushPolicyToPDP.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView PushPolicyToPDPGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { - try { - ArrayList selectedPDPS = new ArrayList(); - ArrayList selectedPoliciesInUI = new ArrayList(); - this.groups.addAll(PolicyController.getPapEngine().getEcompPDPGroups()); - ObjectMapper mapper = new ObjectMapper(); - this.container = new PDPGroupContainer(PolicyController.getPapEngine()); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - AutoPushTabAdapter adapter = (AutoPushTabAdapter) mapper.readValue(root.get("pushTabData").toString(), AutoPushTabAdapter.class); - for (Object pdpGroupId : adapter.getPdpDatas()) { - LinkedHashMap selectedPDP = (LinkedHashMap)pdpGroupId; - for(EcompPDPGroup pdpGroup : this.groups){ - if(pdpGroup.getId().equals(selectedPDP.get("id"))){ - selectedPDPS.add(pdpGroup); - } - } - } - - for (Object policyId : adapter.getPolicyDatas()) { - LinkedHashMap selected = (LinkedHashMap)policyId; - Path file = Paths.get(selected.get("filePath").toString()); - selectedPoliciesInUI.add(file.toFile()); - } - - for (Object pdpDestinationGroupId : selectedPDPS) { - Set currentPoliciesInGroup = new HashSet(); - Set selectedPolicies = new HashSet(); - for (File policyId : selectedPoliciesInUI) { - logger.debug("Handlepolicies..." + pdpDestinationGroupId + policyId); - // - // Get the current selection - File selectedItem = policyId; - // - assert (selectedItem != null); - if (selectedItem.isDirectory()) { - //AdminNotification.warn("Select only the Policy"); - return null; - } - // create the id of the target file - // Our standard for file naming is: - // ...xml - // since the file name usually has a ".xml", we need to strip - // that - // before adding the other parts - String name = selectedItem.getName(); - if(name.endsWith(".xml")){ - name = name.substring(0, name.length() - 4); - name = name.substring(0, name.lastIndexOf(".")); - } - String id = name; - if (id.endsWith(".xml")) { - id = id.substring(0, id.length() - 4); - id = id.substring(0, id.lastIndexOf(".")); - } - // add on the version string - String version = getVersion(selectedItem); - id += "." + version; - // put the .xml on the end - id += ".xml"; - // track on the domain in front. Do this one level at a time - // until we - // reach one of the roots - String domain = getDomain(selectedItem); - String mainDomain = domain.substring(0, domain.lastIndexOf(File.separator) ); - logger.info("print the main domain value"+mainDomain); - String path = mainDomain.replace('\\', '.'); - if(path.contains("/")){ - path = mainDomain.replace('/', '.'); - logger.info("print the path:" +path); - } - id = path + "." + id; - // Default policy to be Root policy; user can change to deferred - // later - URI selectedURI = selectedItem.toURI(); - StdPDPPolicy selectedPolicy = null; - try { - // - // Create the policy - selectedPolicy = new StdPDPPolicy(id, true, name, selectedURI); - } catch (IOException e) { - logger.error("Unable to create policy '" + id + "': "+ e.getMessage()); - //AdminNotification.warn("Unable to create policy '" + id + "': " + e.getMessage()); - } - StdPDPGroup selectedGroup = (StdPDPGroup) pdpDestinationGroupId; - if (selectedPolicy != null) { - // Add Current policies from container - for (EcompPDPGroup group : container.getGroups()) { - if (group.getId().equals(selectedGroup.getId())) { - currentPoliciesInGroup.addAll(group.getPolicies()); - } - } - // copy policy to PAP - try { - PolicyController.getPapEngine().copyPolicy(selectedPolicy, (StdPDPGroup) pdpDestinationGroupId); - } catch (PAPException e) { - e.printStackTrace(); - return null; - } - selectedPolicies.add(selectedPolicy); - } - } - StdPDPGroup pdpGroup = (StdPDPGroup) pdpDestinationGroupId; - StdPDPGroup updatedGroupObject = new StdPDPGroup(pdpGroup.getId(), pdpGroup.isDefaultGroup(), pdpGroup.getName(), pdpGroup.getDescription(), pdpGroup.getDirectory()); - updatedGroupObject.setEcompPdps(pdpGroup.getEcompPdps()); - updatedGroupObject.setPipConfigs(pdpGroup.getPipConfigs()); - updatedGroupObject.setStatus(pdpGroup.getStatus()); - - // replace the original set of Policies with the set from the - // container (possibly modified by the user) - // do not allow multiple copies of same policy - Iterator policyIterator = currentPoliciesInGroup.iterator(); - logger.debug("policyIterator....." + selectedPolicies); - while (policyIterator.hasNext()) { - PDPPolicy existingPolicy = policyIterator.next(); - for (PDPPolicy selPolicy : selectedPolicies) { - if (selPolicy.getName().equals(existingPolicy.getName())) { - if (selPolicy.getVersion().equals(existingPolicy.getVersion())) { - if (selPolicy.getId().equals(existingPolicy.getId())) { - policyIterator.remove(); - logger.debug("Removing policy: " + selPolicy); - break; - } - } else { - policyIterator.remove(); - logger.debug("Removing Old Policy version: "+ selPolicy); - break; - } - } - } - } - - currentPoliciesInGroup.addAll(selectedPolicies); - updatedGroupObject.setPolicies(currentPoliciesInGroup); - this.container.updateGroup(updatedGroupObject); - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - refreshGroups(); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups)); - JSONObject j = new JSONObject(msg); - out.write(j.toString()); - return null; - } - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - @RequestMapping(value={"/auto_Push/remove_GroupPolicies.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView removePDPGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { - try { - this.container = new PDPGroupContainer(PolicyController.getPapEngine()); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - StdPDPGroup group = (StdPDPGroup)mapper.readValue(root.get("activePdpGroup").toString(), StdPDPGroup.class); - JsonNode removePolicyData = root.get("data"); - policyContainer = new PDPPolicyContainer(group); - if(removePolicyData.size() > 0){ - for(int i = 0 ; i < removePolicyData.size(); i++){ - String data = removePolicyData.get(i).toString(); - AutoPushController.policyContainer.removeItem(data); - } - Set changedPolicies = new HashSet(); - changedPolicies.addAll((Collection) AutoPushController.policyContainer.getItemIds()); - StdPDPGroup updatedGroupObject = new StdPDPGroup(group.getId(), group.isDefaultGroup(), group.getName(), group.getDescription(),null); - updatedGroupObject.setPolicies(changedPolicies); - updatedGroupObject.setEcompPdps(group.getEcompPdps()); - updatedGroupObject.setPipConfigs(group.getPipConfigs()); - updatedGroupObject.setStatus(group.getStatus()); - this.container.updateGroup(updatedGroupObject); - } - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - refreshGroups(); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups)); - JSONObject j = new JSONObject(msg); - - out.write(j.toString()); - - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java deleted file mode 100644 index 7a2b24e84..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java +++ /dev/null @@ -1,723 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.JAXBElement; - -import org.json.JSONObject; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.admin.PolicyNotificationMail; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.dao.RuleAlgorithmsDao; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.elk.client.PolicyElasticSearchController; -import org.openecomp.policy.rest.dao.BRMSParamTemplateDao; -import org.openecomp.policy.rest.jpa.BRMSParamTemplate; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.RuleAlgorithms; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.att.research.xacml.api.XACML3; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Joiner; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionsType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeAssignmentExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Controller -@RequestMapping("/") -public class CreateBRMSParamController extends RestrictedBaseController { - private static final Logger logger = FlexLogger.getLogger(CreateBRMSParamController.class); - - private static RuleAlgorithmsDao ruleAlgorithmsDao; - private static BRMSParamTemplateDao bRMSParamTemplateDao; - private static PolicyVersionDao policyVersionDao; - private static WatchPolicyNotificationDao policyNotificationDao; - - @Autowired - private CreateBRMSParamController(RuleAlgorithmsDao ruleAlgorithmsDao, BRMSParamTemplateDao bRMSParamTemplateDao, PolicyVersionDao policyVersionDao, - WatchPolicyNotificationDao policyNotificationDao){ - CreateBRMSParamController.policyVersionDao = policyVersionDao; - CreateBRMSParamController.ruleAlgorithmsDao = ruleAlgorithmsDao; - CreateBRMSParamController.bRMSParamTemplateDao = bRMSParamTemplateDao; - CreateBRMSParamController.policyNotificationDao = policyNotificationDao; - } - - public CreateBRMSParamController(){} - protected PolicyAdapter policyAdapter = null; - private ArrayList attributeList; - private String ruleID = ""; - - private HashMap dynamicLayoutMap; - - public String newPolicyID() { - return Joiner.on(':').skipNulls().join((PolicyController.getDomain().startsWith("urn") ? null: "urn"), - PolicyController.getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID()); - } - - @RequestMapping(value={"/policyController/getBRMSTemplateData.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView getBRMSParamPolicyRuleData(HttpServletRequest request, HttpServletResponse response) throws Exception{ - dynamicLayoutMap = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - String rule = findRule(root.get("policyData").toString().replaceAll("^\"|\"$", "")); - generateUI(rule); - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(dynamicLayoutMap); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } - - protected String findRule(String ruleTemplate) { - for (BRMSParamTemplate bRMSParamTemplate: bRMSParamTemplateDao.getBRMSParamTemplateData()){ - if(bRMSParamTemplate.getRuleName().equals(ruleTemplate)){ - return bRMSParamTemplate.getRule(); - } - } - return null; - } - - protected void generateUI(String rule) { - if(rule!=null){ - try { - String params = ""; - Boolean flag = false; - Boolean comment = false; - String lines[] = rule.split("\n"); - for(String line : lines){ - if (line.isEmpty() || line.startsWith("//")) { - continue; - } - if (line.startsWith("/*")) { - comment = true; - continue; - } - if (line.contains("//")) { - line = line.split("\\/\\/")[0]; - } - if (line.contains("/*")) { - comment = true; - if (line.contains("*/")) { - try { - comment = false; - line = line.split("\\/\\*")[0] - + line.split("\\*\\/")[1].replace("*/", ""); - } catch (Exception e) { - line = line.split("\\/\\*")[0]; - } - } else { - line = line.split("\\/\\*")[0]; - } - } - if (line.contains("*/")) { - comment = false; - try { - line = line.split("\\*\\/")[1].replace("*/", ""); - } catch (Exception e) { - line = ""; - } - } - if (comment) { - continue; - } - if (flag) { - params = params + line; - } - if (line.contains("declare Params")) { - params = params + line; - flag = true; - } - if (line.contains("end") && flag) { - break; - } - } - params = params.replace("declare Params", "").replace("end", "") - .replaceAll("\\s+", ""); - String[] components = params.split(":"); - String caption = ""; - for (int i = 0; i < components.length; i++) { - String type = ""; - if (i == 0) { - caption = components[i]; - } - if(caption.equals("")){ - break; - } - String nextComponent = ""; - try { - nextComponent = components[i + 1]; - } catch (Exception e) { - nextComponent = components[i]; - } - if (nextComponent.startsWith("String")) { - type = "String"; - createField(caption, type); - caption = nextComponent.replace("String", ""); - } else if (nextComponent.startsWith("int")) { - type = "int"; - createField(caption, type); - caption = nextComponent.replace("int", ""); - } - } - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + e); - } - } - } - - private String convertDate(String dateTTL) { - String formateDate = null; - String[] date = dateTTL.split("T"); - String[] parts = date[0].split("-"); - - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - return formateDate; - } - - private void createField(String caption, String type) { - dynamicLayoutMap.put(caption, type); - } - - @RequestMapping(value={"/policyController/save_BRMSParamPolicy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveBRMSParamPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - String userId = UserUtils.getUserIdFromCookie(request); - RESTfulPAPEngine engine = (RESTfulPAPEngine) PolicyController.getPapEngine(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").get("policy").toString(), PolicyAdapter.class); - - if (policyData.getTtlDate()==null){ - policyData.setTtlDate("NA"); - }else{ - String dateTTL = policyData.getTtlDate(); - String newDate = convertDate(dateTTL); - policyData.setTtlDate(newDate); - } - - if(root.get("policyData").get("model").get("type").toString().replace("\"", "").equals("file")){ - policyData.isEditPolicy = true; - } - if(root.get("policyData").get("model").get("path").size() != 0){ - String dirName = ""; - for(int i = 0; i < root.get("policyData").get("model").get("path").size(); i++){ - dirName = dirName.replace("\"", "") + root.get("policyData").get("model").get("path").get(i).toString().replace("\"", "") + File.separator; - } - policyData.setDomainDir(dirName.substring(0, dirName.lastIndexOf(File.separator))); - }else{ - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - } - int version = 0; - int highestVersion = 0; - int descriptionVersion = 0; - //get the highest version of policy from policy version table. - //getting the sub scope domain where the policy is created or updated - String dbCheckPolicyName = policyData.getDomainDir() + File.separator + "Config_BRMS_Param_" + policyData.getPolicyName(); - List policyVersionList = policyVersionDao.getPolicyVersionEntityByName(dbCheckPolicyName); - if (policyVersionList.size() > 0) { - for(int i = 0; i < policyVersionList.size(); i++) { - PolicyVersion entityItem = policyVersionList.get(i); - if(entityItem.getPolicyName().equals(dbCheckPolicyName)){ - highestVersion = entityItem.getHigherVersion(); - } - } - } - if(highestVersion != 0){ - version = highestVersion; - descriptionVersion = highestVersion +1; - }else{ - version = 1; - descriptionVersion = 1; - } - - //set policy adapter values for Building JSON object containing policy data - String createdBy = ""; - String modifiedBy = userId; - if(descriptionVersion == 1){ - createdBy = userId; - }else{ - String policyName = PolicyController.getGitPath().toAbsolutePath().toString() + File.separator + policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - File policyPath = new File(policyName); - try { - createdBy = XACMLPolicyScanner.getCreatedBy(policyPath.toPath()); - } catch (IOException e) { - createdBy = "guest"; - } - } - - policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"); - Map successMap = new HashMap(); - Map attributeMap = new HashMap(); - //set the Rule Combining Algorithm Id to be sent to PAP-REST via JSON - List ruleAlgorithmsList = ruleAlgorithmsDao.getRuleAlgorithms(); - for (int i = 0; i < ruleAlgorithmsList.size(); i++) { - RuleAlgorithms a = ruleAlgorithmsList.get(i); - if (a.getXacmlId().equals(XACML3.ID_RULE_PERMIT_OVERRIDES.stringValue())) { - policyData.setRuleCombiningAlgId(a.getXacmlId()); - break; - } - } - if(policyData.getAttributes().size() > 0){ - for(Object attribute : policyData.getAttributes()){ - if(attribute instanceof LinkedHashMap){ - String key = ((LinkedHashMap) attribute).get("key").toString(); - String value = ((LinkedHashMap) attribute).get("value").toString(); - attributeMap.put(key, value); - } - } - } - - policyData.setEcompName("DROOLS"); - policyData.setConfigName("BRMS_PARAM_RULE"); - policyData.setDynamicFieldConfigAttributes(attributeMap); - //convert drl rule and UI parameters into a map - Map drlRuleAndUIParams = new HashMap(); - // If there is any dynamic field create the matches here - String key="templateName"; - String value=(String) policyData.getRuleName(); - drlRuleAndUIParams.put(key, value); - System.out.println(policyData.getRuleData()); - if(policyData.getRuleData().size() > 0){ - for(Object keyValue: policyData.getRuleData().keySet()){ - drlRuleAndUIParams.put(keyValue.toString(), policyData.getRuleData().get(keyValue).toString()); - } - } - policyData.setBRMSParamBody(drlRuleAndUIParams); - if (policyData.isEditPolicy()){ - //increment the version and set in policyAdapter - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - policyData.setPolicyID(this.newPolicyID()); - policyData.setRuleID(ruleID); - successMap = engine.updatePolicyRequest(policyData); - } else { - //send it for policy creation - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - successMap = engine.createPolicyRequest(policyData); - - } - - if (successMap.containsKey("success")) { - // Add it into our tree - Path finalPolicyPath = null; - finalPolicyPath = Paths.get(successMap.get("success")); - PolicyElasticSearchController controller = new PolicyElasticSearchController(); - controller.updateElk(finalPolicyPath.toString()); - File file = finalPolicyPath.toFile(); - if(file != null){ - String policyName = file.toString(); - String removePath = policyName.substring(policyName.indexOf("repository")+11); - String removeXml = removePath.replace(".xml", ""); - String removeExtension = removeXml.substring(0, removeXml.indexOf(".")); - List versionList = policyVersionDao.getPolicyVersionEntityByName(removeExtension); - if (versionList.size() > 0) { - for(int i = 0; i < versionList.size(); i++) { - PolicyVersion entityItem = versionList.get(i); - if(entityItem.getPolicyName().equals(removeExtension)){ - version = entityItem.getHigherVersion() +1; - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setModifiedBy(userId); - policyVersionDao.update(entityItem); - if(policyData.isEditPolicy){ - PolicyNotificationMail email = new PolicyNotificationMail(); - String mode = "EditPolicy"; - String policyNameForEmail = policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - email.sendMail(entityItem, policyNameForEmail, mode, policyNotificationDao); - } - } - } - }else{ - PolicyVersion entityItem = new PolicyVersion(); - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setPolicyName(removeExtension); - entityItem.setCreatedBy(userId); - entityItem.setModifiedBy(userId); - policyVersionDao.Save(entityItem); - } - } - } - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(successMap); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - public void PrePopulateBRMSParamPolicyData(PolicyAdapter policyAdapter) { - attributeList = new ArrayList(); - dynamicLayoutMap = new HashMap(); - if (policyAdapter.getPolicyData() instanceof PolicyType) { - PolicyType policy = (PolicyType) policyAdapter.getPolicyData(); - policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName()); - // policy name value is the policy name without any prefix and - // Extensions. - String policyNameValue = policyAdapter.getPolicyName().substring(policyAdapter.getPolicyName().indexOf("BRMS_Param_") +11, policyAdapter.getPolicyName().lastIndexOf(".")); - if (logger.isDebugEnabled()) { - logger.debug("Prepopulating form data for BRMS RAW Policy selected:" + policyAdapter.getPolicyName()); - } - policyAdapter.setPolicyName(policyNameValue); - String description = ""; - try{ - description = policy.getDescription().substring(0, policy.getDescription().indexOf("@CreatedBy:")); - }catch(Exception e){ - description = policy.getDescription(); - } - policyAdapter.setPolicyDescription(description); - // Set Attributes. - AdviceExpressionsType expressionTypes = ((RuleType)policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().get(0)).getAdviceExpressions(); - for( AdviceExpressionType adviceExpression: expressionTypes.getAdviceExpression()){ - for(AttributeAssignmentExpressionType attributeAssignment: adviceExpression.getAttributeAssignmentExpression()){ - if(attributeAssignment.getAttributeId().startsWith("key:")){ - Map attribute = new HashMap(); - String key = attributeAssignment.getAttributeId().replace("key:", ""); - attribute.put("key", key); - JAXBElement attributevalue = (JAXBElement) attributeAssignment.getExpression(); - String value = (String) attributevalue.getValue().getContent().get(0); - attribute.put("value", value); - attributeList.add(attribute); - } - } - policyAdapter.setAttributes(attributeList); - } - String ruleConfigName = policyAdapter.getDirPath().replace(File.separator, ".")+ "." + policyAdapter.getOldPolicyFileName() + ".txt"; - policyAdapter.setConfigBodyPath(ruleConfigName); - paramUIGenerate(policyAdapter); - // Get the target data under policy. - policyAdapter.setDynamicLayoutMap(dynamicLayoutMap); - if(policyAdapter.getDynamicLayoutMap().size() > 0){ - LinkedHashMap drlRule = new LinkedHashMap(); - for(Object keyValue: policyAdapter.getDynamicLayoutMap().keySet()){ - drlRule.put(keyValue.toString(), policyAdapter.getDynamicLayoutMap().get(keyValue).toString()); - } - policyAdapter.setRuleData(drlRule); - } - TargetType target = policy.getTarget(); - if (target != null) { - // Under target we have AnyOFType - List anyOfList = target.getAnyOf(); - if (anyOfList != null) { - Iterator iterAnyOf = anyOfList.iterator(); - while (iterAnyOf.hasNext()) { - AnyOfType anyOf = iterAnyOf.next(); - // Under AnyOFType we have AllOFType - List allOfList = anyOf.getAllOf(); - if (allOfList != null) { - Iterator iterAllOf = allOfList.iterator(); - int index = 0; - while (iterAllOf.hasNext()) { - AllOfType allOf = iterAllOf.next(); - // Under AllOFType we have Match - List matchList = allOf.getMatch(); - if (matchList != null) { - Iterator iterMatch = matchList.iterator(); - while (iterMatch.hasNext()) { - MatchType match = iterMatch.next(); - // - // Under the match we have attributevalue and - // attributeDesignator. So,finally down to the actual attribute. - // - AttributeValueType attributeValue = match.getAttributeValue(); - String value = (String) attributeValue.getContent().get(0); - - if (index == 3){ - policyAdapter.setRiskType(value); - } - - if (index == 4){ - policyAdapter.setRiskLevel(value); - } - - if (index == 5){ - policyAdapter.setGuard(value); - } - if (index == 6 && !value.contains("NA")){ - String newDate = convertDate(value, true); - policyAdapter.setTtlDate(newDate); - } - - index++; - } - } - } - } - } - } - } - } - } - - private String convertDate(String dateTTL, boolean portalType) { - String formateDate = null; - String[] date; - String[] parts; - - if (portalType){ - parts = dateTTL.split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z"; - } else { - date = dateTTL.split("T"); - parts = date[0].split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - } - return formateDate; - } - // This method generates the UI from rule configuration - private void paramUIGenerate(PolicyAdapter policyAdapter) { - String fileLocation = null; - String fileName = policyAdapter.getConfigBodyPath(); - if (fileName != null) { - fileLocation = PolicyController.getConfigHome(); - } - if (logger.isDebugEnabled()) { - logger.debug("Attempting to read file from the location: " + fileLocation); - } - if (fileLocation == null) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "Error with the FileName: " + fileName); - return; - } - File dir = new File(fileLocation); - File[] listOfFiles = dir.listFiles(); - for (File file : listOfFiles) { - if (file.isFile() && file.getName().contains(fileName) - && file.toString().endsWith(".txt")) { - // Reading the file - try { - try (BufferedReader br = new BufferedReader(new FileReader(file))) { - StringBuilder sb = new StringBuilder(); - String line = br.readLine(); - while (line != null) { - sb.append(line); - sb.append("\n"); - line = br.readLine(); - } - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+ e.getMessage()); - } - String params = ""; - Boolean flag = false; - Boolean comment = false; - for (String line : Files.readAllLines(Paths.get(file.toString()))) { - if (line.isEmpty() || line.startsWith("//")) { - continue; - } - if(line.contains("<$%BRMSParamTemplate=")){ - String value = line.substring(line.indexOf("<$%"),line.indexOf("%$>")); - value = value.replace("<$%BRMSParamTemplate=", ""); - policyAdapter.setRuleName(value); - } - if (line.startsWith("/*")) { - comment = true; - continue; - } - if (line.contains("//")) { - if(!(line.contains("http://") || line.contains("https://"))){ - line = line.split("\\/\\/")[0]; - } - } - if (line.contains("/*")) { - comment = true; - if (line.contains("*/")) { - try { - comment = false; - line = line.split("\\/\\*")[0] - + line.split("\\*\\/")[1].replace( - "*/", ""); - } catch (Exception e) { - line = line.split("\\/\\*")[0]; - } - } else { - line = line.split("\\/\\*")[0]; - } - } - if (line.contains("*/")) { - comment = false; - try { - line = line.split("\\*\\/")[1] - .replace("*/", ""); - } catch (Exception e) { - line = ""; - } - } - if (comment) { - continue; - } - if (flag) { - params = params + line; - } - if (line.contains("rule \"Params\"")) { - params = params + line; - flag = true; - } - if (line.contains("end") && flag) { - break; - } - } - params = params.replaceAll("\\s+", "").replace("rule\"Params\"salience1000whenthenParamsparams=newParams();","") - .replace("insert(params);end", "") - .replace("params.set", ""); - String[] components = params.split(";"); - if(components!= null && components.length > 0){ - for (int i = 0; i < components.length; i++) { - String value = null; - String caption = components[i].substring(0, - components[i].indexOf("(")); - caption = caption.substring(0, 1).toLowerCase() + caption.substring(1); - if (components[i].contains("(\"")) { - value = components[i] - .substring(components[i].indexOf("(\""), - components[i].indexOf("\")")) - .replace("(\"", "").replace("\")", ""); - } else { - value = components[i] - .substring(components[i].indexOf("("), - components[i].indexOf(")")) - .replace("(", "").replace(")", ""); - } - dynamicLayoutMap.put(caption, value); - - } - } - } catch (FileNotFoundException e) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + e.getMessage()); - } catch (IOException e1) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+ e1.getMessage()); - } - } - } - } - - // set View Rule - @RequestMapping(value={"/policyController/ViewBRMSParamPolicyRule.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView setViewRule(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").get("policy").toString(), PolicyAdapter.class); - - String body = ""; - - body = "/* Autogenerated Code Please Don't change/remove this comment section. This is for the UI purpose. \n\t " + - "<$%BRMSParamTemplate=" + policyData.getRuleName() + "%$> \n */ \n"; - body = body + findRule((String) policyData.getRuleName()) + "\n"; - String generatedRule = "rule \"Params\" \n\tsalience 1000 \n\twhen\n\tthen\n\t\tParams params = new Params();"; - - if(policyData.getRuleData().size() > 0){ - for(Object keyValue: policyData.getRuleData().keySet()){ - String key = keyValue.toString().substring(0, 1).toUpperCase() + keyValue.toString().substring(1); - if (keyValue.equals("String")) { - generatedRule = generatedRule + "\n\t\tparams.set" - + key + "(\"" - + policyData.getRuleData().get(keyValue).toString() + "\");"; - } else { - generatedRule = generatedRule + "\n\t\tparams.set" - + key + "(" - + policyData.getRuleData().get(keyValue).toString() + ");"; - } - } - } - generatedRule = generatedRule - + "\n\t\tinsert(params);\nend"; - logger.info("New rule generated with :" + generatedRule); - body = body + generatedRule; - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(body); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e); - } - return null; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateBRMSRawController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateBRMSRawController.java deleted file mode 100644 index 6dcd8400b..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateBRMSRawController.java +++ /dev/null @@ -1,440 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.JAXBElement; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.json.JSONObject; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.admin.PolicyNotificationMail; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.dao.RuleAlgorithmsDao; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.elk.client.PolicyElasticSearchController; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.RuleAlgorithms; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.att.research.xacml.api.XACML3; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Joiner; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionsType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeAssignmentExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Controller -@RequestMapping("/") -public class CreateBRMSRawController extends RestrictedBaseController { - - private static final Logger logger = FlexLogger.getLogger(CreateBRMSRawController.class); - - private static RuleAlgorithmsDao ruleAlgorithmsDao; - private static PolicyVersionDao policyVersionDao; - private static WatchPolicyNotificationDao policyNotificationDao; - - @Autowired - private CreateBRMSRawController(RuleAlgorithmsDao ruleAlgorithmsDao, PolicyVersionDao policyVersionDao, WatchPolicyNotificationDao policyNotificationDao){ - CreateBRMSRawController.policyVersionDao = policyVersionDao; - CreateBRMSRawController.ruleAlgorithmsDao = ruleAlgorithmsDao; - CreateBRMSRawController.policyNotificationDao = policyNotificationDao; - } - - public CreateBRMSRawController(){} - protected PolicyAdapter policyAdapter = null; - private ArrayList attributeList; - private String ruleID = ""; - public String newPolicyID() { - return Joiner.on(':').skipNulls().join((PolicyController.getDomain().startsWith("urn") ? null: "urn"), - PolicyController.getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID()); - } - - - - @RequestMapping(value={"/policyController/save_BRMSRawPolicy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveBRMSRawPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - String userId = UserUtils.getUserIdFromCookie(request); - RESTfulPAPEngine engine = (RESTfulPAPEngine) PolicyController.getPapEngine(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").get("policy").toString(), PolicyAdapter.class); - - if(root.get("policyData").get("model").get("type").toString().replace("\"", "").equals("file")){ - policyData.isEditPolicy = true; - } - if(root.get("policyData").get("model").get("path").size() != 0){ - String dirName = ""; - for(int i = 0; i < root.get("policyData").get("model").get("path").size(); i++){ - dirName = dirName.replace("\"", "") + root.get("policyData").get("model").get("path").get(i).toString().replace("\"", "") + File.separator; - } - policyData.setDomainDir(dirName.substring(0, dirName.lastIndexOf(File.separator))); - }else{ - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - } - - if (policyData.getTtlDate()==null){ - policyData.setTtlDate("NA"); - }else{ - String dateTTL = policyData.getTtlDate(); - String newDate = convertDate(dateTTL); - policyData.setTtlDate(newDate); - } - - int version = 0; - int highestVersion = 0; - int descriptionVersion = 0; - //get the highest version of policy from policy version table. - //getting the sub scope domain where the policy is created or updated - String dbCheckPolicyName = policyData.getDomainDir() + File.separator + "Config_BRMS_Raw_" + policyData.getPolicyName(); - List policyVersionList = policyVersionDao.getPolicyVersionEntityByName(dbCheckPolicyName); - if (policyVersionList.size() > 0) { - for(int i = 0; i < policyVersionList.size(); i++) { - PolicyVersion entityItem = policyVersionList.get(i); - if(entityItem.getPolicyName().equals(dbCheckPolicyName)){ - highestVersion = entityItem.getHigherVersion(); - } - } - } - if(highestVersion != 0){ - version = highestVersion; - descriptionVersion = highestVersion +1; - }else{ - version = 1; - descriptionVersion = 1; - } - - //set policy adapter values for Building JSON object containing policy data - String createdBy = ""; - String modifiedBy = userId; - if(descriptionVersion == 1){ - createdBy = userId; - }else{ - String policyName = PolicyController.getGitPath().toAbsolutePath().toString() + File.separator + policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - File policyPath = new File(policyName); - try { - createdBy = XACMLPolicyScanner.getCreatedBy(policyPath.toPath()); - } catch (IOException e) { - createdBy = "guest"; - } - } - - policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"); - Map successMap = new HashMap(); - Map attributeMap = new HashMap(); - //set the Rule Combining Algorithm Id to be sent to PAP-REST via JSON - List ruleAlgorithmsList = ruleAlgorithmsDao.getRuleAlgorithms(); - for (int i = 0; i < ruleAlgorithmsList.size(); i++) { - RuleAlgorithms a = ruleAlgorithmsList.get(i); - if (a.getXacmlId().equals(XACML3.ID_RULE_PERMIT_OVERRIDES.stringValue())) { - policyData.setRuleCombiningAlgId(a.getXacmlId()); - break; - } - } - - if(policyData.getAttributes().size() > 0){ - for(Object attribute : policyData.getAttributes()){ - if(attribute instanceof LinkedHashMap){ - String key = ((LinkedHashMap) attribute).get("key").toString(); - String value = ((LinkedHashMap) attribute).get("value").toString(); - attributeMap.put(key, value); - } - } - } - - - policyData.setEcompName("DROOLS"); - policyData.setConfigName("BRMS_RAW_RULE"); - policyData.setDynamicFieldConfigAttributes(attributeMap); - if (policyData.isEditPolicy()){ - //increment the version and set in policyAdapter - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - policyData.setPolicyID(this.newPolicyID()); - policyData.setRuleID(ruleID); - successMap = engine.updatePolicyRequest(policyData); - } else { - //send it for policy creation - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - successMap = engine.createPolicyRequest(policyData); - } - - if (successMap.containsKey("success")) { - // Add it into our tree - Path finalPolicyPath = null; - finalPolicyPath = Paths.get(successMap.get("success")); - PolicyElasticSearchController controller = new PolicyElasticSearchController(); - controller.updateElk(finalPolicyPath.toString()); - File file = finalPolicyPath.toFile(); - if(file != null){ - String policyName = file.toString(); - String removePath = policyName.substring(policyName.indexOf("repository")+11); - String removeXml = removePath.replace(".xml", ""); - String removeExtension = removeXml.substring(0, removeXml.indexOf(".")); - List versionList = policyVersionDao.getPolicyVersionEntityByName(removeExtension); - if (versionList.size() > 0) { - for(int i = 0; i < versionList.size(); i++) { - PolicyVersion entityItem = versionList.get(i); - if(entityItem.getPolicyName().equals(removeExtension)){ - version = entityItem.getHigherVersion() +1; - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setModifiedBy(userId); - policyVersionDao.update(entityItem); - if(policyData.isEditPolicy){ - PolicyNotificationMail email = new PolicyNotificationMail(); - String mode = "EditPolicy"; - String policyNameForEmail = policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - email.sendMail(entityItem, policyNameForEmail, mode, policyNotificationDao); - } - } - } - }else{ - PolicyVersion entityItem = new PolicyVersion(); - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setPolicyName(removeExtension); - entityItem.setCreatedBy(userId); - entityItem.setModifiedBy(userId); - policyVersionDao.Save(entityItem); - } - } - } - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(successMap); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - private String convertDate(String dateTTL) { - String formateDate = null; - String[] date = dateTTL.split("T"); - String[] parts = date[0].split("-"); - - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - return formateDate; - } - - public void PrePopulateBRMSRawPolicyData(PolicyAdapter policyAdapter) { - attributeList = new ArrayList(); - if (policyAdapter.getPolicyData() instanceof PolicyType) { - PolicyType policy = (PolicyType) policyAdapter.getPolicyData(); - policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName()); - // policy name value is the policy name without any prefix and - // Extensions. - String policyNameValue = policyAdapter.getPolicyName().substring(policyAdapter.getPolicyName().indexOf("BRMS_Raw_") +9, policyAdapter.getPolicyName().lastIndexOf(".")); - if (logger.isDebugEnabled()) { - logger.debug("Prepopulating form data for BRMS RAW Policy selected:" + policyAdapter.getPolicyName()); - } - policyAdapter.setPolicyName(policyNameValue); - String description = ""; - try{ - description = policy.getDescription().substring(0, policy.getDescription().indexOf("@CreatedBy:")); - }catch(Exception e){ - description = policy.getDescription(); - } - policyAdapter.setPolicyDescription(description); - // Set Attributes. - AdviceExpressionsType expressionTypes = ((RuleType)policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().get(0)).getAdviceExpressions(); - for( AdviceExpressionType adviceExpression: expressionTypes.getAdviceExpression()){ - for(AttributeAssignmentExpressionType attributeAssignment: adviceExpression.getAttributeAssignmentExpression()){ - if(attributeAssignment.getAttributeId().startsWith("key:")){ - Map attribute = new HashMap(); - String key = attributeAssignment.getAttributeId().replace("key:", ""); - attribute.put("key", key); - JAXBElement attributevalue = (JAXBElement) attributeAssignment.getExpression(); - String value = (String) attributevalue.getValue().getContent().get(0); - attribute.put("value", value); - attributeList.add(attribute); - } - } - policyAdapter.setAttributes(attributeList); - } - String ruleConfigName = policyAdapter.getDirPath().replace(File.separator, ".")+ "." + policyAdapter.getOldPolicyFileName() + "."; - policyAdapter.setConfigBodyPath(ruleConfigName); - // Get the target data under policy. - policyAdapter.setConfigBodyData(readFile(policyAdapter)); - TargetType target = policy.getTarget(); - if (target != null) { - // Under target we have AnyOFType - List anyOfList = target.getAnyOf(); - if (anyOfList != null) { - Iterator iterAnyOf = anyOfList.iterator(); - while (iterAnyOf.hasNext()) { - AnyOfType anyOf = iterAnyOf.next(); - // Under AnyOFType we have AllOFType - List allOfList = anyOf.getAllOf(); - if (allOfList != null) { - Iterator iterAllOf = allOfList.iterator(); - int index = 0; - while (iterAllOf.hasNext()) { - AllOfType allOf = iterAllOf.next(); - // Under AllOFType we have Match - List matchList = allOf.getMatch(); - if (matchList != null) { - Iterator iterMatch = matchList.iterator(); - while (iterMatch.hasNext()) { - MatchType match = iterMatch.next(); - // - // Under the match we have attributevalue and - // attributeDesignator. So,finally down to the actual attribute. - // - AttributeValueType attributeValue = match.getAttributeValue(); - String value = (String) attributeValue.getContent().get(0); - - if (index == 3){ - policyAdapter.setRiskType(value); - } - - if (index == 4){ - policyAdapter.setRiskLevel(value); - } - - if (index == 5){ - policyAdapter.setGuard(value); - } - if (index == 6 && !value.contains("NA")){ - String newDate = convertDate(value, true); - policyAdapter.setTtlDate(newDate); - } - - index++; - } - } - } - } - } - } - } - } - } - - private String convertDate(String dateTTL, boolean portalType) { - String formateDate = null; - String[] date; - String[] parts; - - if (portalType){ - parts = dateTTL.split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z"; - } else { - date = dateTTL.split("T"); - parts = date[0].split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - } - return formateDate; - } - - // Here we are reading the configurations file - protected String readFile(PolicyAdapter policyAdapter) { - String fileLocation = null; - String fileName = policyAdapter.getConfigBodyPath(); - if (fileName != null ) { - fileLocation = PolicyController.getConfigHome(); - } - if (fileLocation == null) { - return fileLocation; - } - File dir = new File(fileLocation); - File[] listOfFiles = dir.listFiles(); - for (File file : listOfFiles) { - if (file.isFile() && file.getName().contains(fileName) && file.toString().endsWith(".txt")) { - // Reading the file - try (BufferedReader br = new BufferedReader(new FileReader(file))) { - StringBuilder sb = new StringBuilder(); - String line = br.readLine(); - while (line != null) { - sb.append(line); - sb.append("\n"); - line = br.readLine(); - } - return sb.toString(); - } catch (FileNotFoundException e) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + e.getMessage()); - } catch (IOException e1) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + e1.getMessage()); - } - } - } - return null; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateClosedLoopFaultController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateClosedLoopFaultController.java deleted file mode 100644 index b41f7e0ef..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateClosedLoopFaultController.java +++ /dev/null @@ -1,889 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.json.Json; -import javax.json.JsonReader; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.json.JSONObject; -import org.openecomp.policy.adapter.ClosedLoopFaultBody; -import org.openecomp.policy.adapter.ClosedLoopFaultTriggerUISignatures; -import org.openecomp.policy.adapter.ClosedLoopSignatures; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.admin.PolicyNotificationMail; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.dao.RuleAlgorithmsDao; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.elk.client.PolicyElasticSearchController; -import org.openecomp.policy.rest.dao.VarbindDictionaryDao; -import org.openecomp.policy.rest.jpa.EcompName; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.RuleAlgorithms; -import org.openecomp.policy.rest.jpa.VarbindDictionary; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.att.research.xacml.api.XACML3; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.google.common.base.Joiner; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; - -@Controller -@RequestMapping("/") -public class CreateClosedLoopFaultController extends RestrictedBaseController{ - - private static RuleAlgorithmsDao ruleAlgorithmsDao; - private static PolicyVersionDao policyVersionDao; - private static VarbindDictionaryDao varbindDictionaryDao; - private static WatchPolicyNotificationDao policyNotificationDao; - - @Autowired - private CreateClosedLoopFaultController(RuleAlgorithmsDao ruleAlgorithmsDao, PolicyVersionDao policyVersionDao, VarbindDictionaryDao varbindDictionaryDao, - WatchPolicyNotificationDao policyNotificationDao){ - CreateClosedLoopFaultController.policyVersionDao = policyVersionDao; - CreateClosedLoopFaultController.ruleAlgorithmsDao = ruleAlgorithmsDao; - CreateClosedLoopFaultController.varbindDictionaryDao = varbindDictionaryDao; - CreateClosedLoopFaultController.policyNotificationDao = policyNotificationDao; - } - - public CreateClosedLoopFaultController(){} - protected PolicyAdapter policyAdapter = null; - private String ruleID = ""; - public String newPolicyID() { - return Joiner.on(':').skipNulls().join((PolicyController.getDomain().startsWith("urn") ? null: "urn"), - PolicyController.getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID()); - } - - @RequestMapping(value={"/policyController/save_Faultpolicy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveFaultPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - String userId = UserUtils.getUserIdFromCookie(request); - RESTfulPAPEngine engine = (RESTfulPAPEngine) PolicyController.getPapEngine(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").get("policy").toString(), PolicyAdapter.class); - TrapDatas trapDatas = mapper.readValue(root.get("trapData").toString(), TrapDatas.class); - TrapDatas faultDatas = mapper.readValue(root.get("faultData").toString(), TrapDatas.class); - ClosedLoopGridJSONData policyJsonData = mapper.readValue(root.get("policyData").get("policy").toString(), ClosedLoopGridJSONData.class); - ClosedLoopFaultBody jsonBody = mapper.readValue(root.get("policyData").get("policy").get("jsonBodyData").toString(), ClosedLoopFaultBody.class); - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - if(root.get("policyData").get("model").get("type").toString().replace("\"", "").equals("file")){ - policyData.isEditPolicy = true; - } - - if (policyData.getTtlDate()==null){ - policyData.setTtlDate("NA"); - }else{ - String dateTTL = policyData.getTtlDate(); - String newDate = convertDate(dateTTL); - policyData.setTtlDate(newDate); - } - - if(root.get("policyData").get("model").get("path").size() != 0){ - String dirName = ""; - for(int i = 0; i < root.get("policyData").get("model").get("path").size(); i++){ - dirName = dirName.replace("\"", "") + root.get("policyData").get("model").get("path").get(i).toString().replace("\"", "") + File.separator; - } - policyData.setDomainDir(dirName.substring(0, dirName.lastIndexOf(File.separator))); - }else{ - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - } - ArrayList trapSignatureDatas = new ArrayList(); - if(trapDatas.getTrap1() != null){ - trapSignatureDatas.add(trapDatas); - } - ArrayList faultSignatureDatas = new ArrayList(); - if(faultDatas.getTrap1() != null){ - faultSignatureDatas.add(faultDatas); - } - - String resultBody = ""; - if(!policyJsonData.getConnecttriggerSignatures().isEmpty()){ - resultBody = resultBody + "("; - for(int i = policyJsonData.getConnecttriggerSignatures().size()-1; i>=0 ; i--){ - String connectBody = connectTriggerSignature(i, policyJsonData.getConnecttriggerSignatures(), trapSignatureDatas.get(0)); - resultBody = resultBody + connectBody; - } - resultBody = resultBody + ")"; - }else{ - if(!trapSignatureDatas.isEmpty()){ - resultBody = callTrap("nill", trapSignatureDatas.get(0)); - } - } - ClosedLoopSignatures triggerSignatures = new ClosedLoopSignatures(); - triggerSignatures.setSignatures(resultBody); - if(policyData.getClearTimeOut() != null){ - triggerSignatures.setTimeWindow(Integer.parseInt(policyData.getClearTimeOut())); - triggerSignatures.setTrapMaxAge(Integer.parseInt(policyData.getTrapMaxAge())); - ClosedLoopFaultTriggerUISignatures uiTriggerSignatures = new ClosedLoopFaultTriggerUISignatures(); - if(!trapSignatureDatas.isEmpty()){ - uiTriggerSignatures.setSignatures(getUITriggerSignature("Trap", trapSignatureDatas.get(0))); - if(!policyJsonData.getConnecttriggerSignatures().isEmpty()){ - uiTriggerSignatures.setConnectSignatures(getUIConnectTraps(policyJsonData.getConnecttriggerSignatures())); - } - } - jsonBody.setTriggerSignaturesUsedForUI(uiTriggerSignatures); - jsonBody.setTriggerTimeWindowUsedForUI(Integer.parseInt(policyData.getClearTimeOut())); - jsonBody.setTrapMaxAgeUsedForUI(Integer.parseInt(policyData.getTrapMaxAge())); - } - - jsonBody.setTriggerSignatures(triggerSignatures); - String faultBody = ""; - if(!policyJsonData.getConnectVerificationSignatures().isEmpty()){ - faultBody = faultBody + "("; - for(int i = policyJsonData.getConnectVerificationSignatures().size()-1; i>=0 ; i--){ - String connectBody = connectTriggerSignature(i, policyJsonData.getConnectVerificationSignatures(), faultSignatureDatas.get(0)); - faultBody = faultBody + connectBody; - } - faultBody = faultBody + ")"; - }else{ - if(!faultSignatureDatas.isEmpty()){ - faultBody = callTrap("nill", faultSignatureDatas.get(0)); - } - } - ClosedLoopSignatures faultSignatures = new ClosedLoopSignatures(); - faultSignatures.setSignatures(faultBody); - if(policyData.getVerificationclearTimeOut() != null){ - faultSignatures.setTimeWindow(Integer.parseInt(policyData.getVerificationclearTimeOut())); - ClosedLoopFaultTriggerUISignatures uifaultSignatures = new ClosedLoopFaultTriggerUISignatures(); - if(!faultSignatureDatas.isEmpty()){ - uifaultSignatures.setSignatures(getUITriggerSignature("Fault", faultSignatureDatas.get(0))); - if(!policyJsonData.getConnectVerificationSignatures().isEmpty()){ - uifaultSignatures.setConnectSignatures(getUIConnectTraps(policyJsonData.getConnectVerificationSignatures())); - } - } - - jsonBody.setVerificationSignaturesUsedForUI(uifaultSignatures); - jsonBody.setVerfificationTimeWindowUsedForUI(Integer.parseInt(policyData.getVerificationclearTimeOut())); - } - jsonBody.setVerificationSignatures(faultSignatures); - ObjectWriter om = new ObjectMapper().writer(); - String json = om.writeValueAsString(jsonBody); - policyData.setJsonBody(json); - - int version = 0; - int highestVersion = 0; - int descriptionVersion = 0; - //get the highest version of policy from policy version table. - //getting the sub scope domain where the policy is created or updated - String dbCheckPolicyName = policyData.getDomainDir() + File.separator + "Config_Fault_" + policyData.getPolicyName(); - List policyVersionList = policyVersionDao.getPolicyVersionEntityByName(dbCheckPolicyName); - if (policyVersionList.size() > 0) { - for(int i = 0; i < policyVersionList.size(); i++) { - PolicyVersion entityItem = policyVersionList.get(i); - if(entityItem.getPolicyName().equals(dbCheckPolicyName)){ - highestVersion = entityItem.getHigherVersion(); - } - } - } - if(highestVersion != 0){ - version = highestVersion; - descriptionVersion = highestVersion +1; - }else{ - version = 1; - descriptionVersion = 1; - } - - //set policy adapter values for Building JSON object containing policy data - String createdBy = ""; - String modifiedBy = userId; - if(descriptionVersion == 1){ - createdBy = userId; - }else{ - String policyName = PolicyController.getGitPath().toAbsolutePath().toString() + File.separator + policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - File policyPath = new File(policyName); - try { - createdBy = XACMLPolicyScanner.getCreatedBy(policyPath.toPath()); - } catch (IOException e) { - createdBy = "guest"; - } - } - - policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"); - Map successMap = new HashMap(); - //set the Rule Combining Algorithm Id to be sent to PAP-REST via JSON - List ruleAlgorithsList = ruleAlgorithmsDao.getRuleAlgorithms(); - for (int i = 0; i < ruleAlgorithsList.size(); i++) { - RuleAlgorithms a = ruleAlgorithsList.get(i); - if (a.getXacmlId().equals(XACML3.ID_RULE_PERMIT_OVERRIDES.stringValue())) { - policyData.setRuleCombiningAlgId(a.getXacmlId()); - break; - } - } - if (policyData.isEditPolicy()){ - //increment the version and set in policyAdapter - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - policyData.setPolicyID(this.newPolicyID()); - policyData.setRuleID(ruleID); - successMap = engine.updatePolicyRequest(policyData); - } else { - //send it for policy creation - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - successMap = engine.createPolicyRequest(policyData); - - } - - if (successMap.containsKey("success")) { - // Add it into our tree - Path finalPolicyPath = null; - finalPolicyPath = Paths.get(successMap.get("success")); - PolicyElasticSearchController controller = new PolicyElasticSearchController(); - controller.updateElk(finalPolicyPath.toString()); - File file = finalPolicyPath.toFile(); - if(file != null){ - String policyName = file.toString(); - String removePath = policyName.substring(policyName.indexOf("repository")+11); - String removeXml = removePath.replace(".xml", ""); - String removeExtension = removeXml.substring(0, removeXml.indexOf(".")); - List versionlist = policyVersionDao.getPolicyVersionEntityByName(removeExtension); - if (versionlist.size() > 0) { - for(int i = 0; i < versionlist.size(); i++) { - PolicyVersion entityItem = versionlist.get(i); - if(entityItem.getPolicyName().equals(removeExtension)){ - version = entityItem.getHigherVersion() +1; - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setModifiedBy(userId); - policyVersionDao.update(entityItem); - if(policyData.isEditPolicy){ - PolicyNotificationMail email = new PolicyNotificationMail(); - String mode = "EditPolicy"; - String policyNameForEmail = policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - email.sendMail(entityItem, policyNameForEmail, mode, policyNotificationDao); - } - } - } - }else{ - PolicyVersion entityItem = new PolicyVersion(); - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setPolicyName(removeExtension); - entityItem.setCreatedBy(userId); - entityItem.setModifiedBy(userId); - policyVersionDao.Save(entityItem); - } - } - } - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(successMap); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - //connect traps data set to JSON Body as String - @SuppressWarnings("rawtypes") - private String getUIConnectTraps(ArrayList connectTrapSignatures) { - String resultBody = ""; - String connectMainBody = ""; - for(int j = 0; j < connectTrapSignatures.size(); j++){ - Map connectTraps = (Map)connectTrapSignatures.get(j); - String connectBody = ""; - Object object = connectTraps; - if(object instanceof LinkedHashMap){ - String notBox = ""; - if(((LinkedHashMap) object).keySet().contains("notBox")){ - notBox = ((LinkedHashMap) object).get("notBox").toString(); - } - String connectTrap1 = ((LinkedHashMap) object).get("connectTrap1").toString(); - String trapCount1 = ((LinkedHashMap) object).get("trapCount1").toString(); - String operatorBox = ((LinkedHashMap) object).get("operatorBox").toString(); - String connectTrap2 = ((LinkedHashMap) object).get("connectTrap2").toString(); - String trapCount2 = ((LinkedHashMap) object).get("trapCount2").toString(); - connectBody = notBox + "@!" + connectTrap1 + "@!" + trapCount1 + "@!" + operatorBox + "@!" + connectTrap2 + "@!" + trapCount2 + "#!?!"; - } - resultBody = resultBody + connectBody; - } - connectMainBody = connectMainBody + resultBody; - return connectMainBody; - } - - - - // get Trigger signature from JSON body - private String getUITriggerSignature(String trap, Object object2) { - String triggerBody = ""; - TrapDatas trapDatas = (TrapDatas) object2; - ArrayList attributeList = new ArrayList<>(); - // Read the Trap - if(trap.startsWith("Trap")){ - if(trapDatas.getTrap1()!= null){ - attributeList.add(trapDatas.getTrap1()); - } - if(trapDatas.getTrap2()!= null){ - attributeList.add(trapDatas.getTrap2()); - } - if(trapDatas.getTrap3()!= null){ - attributeList.add(trapDatas.getTrap3()); - } - if(trapDatas.getTrap4()!= null){ - attributeList.add(trapDatas.getTrap4()); - } - if(trapDatas.getTrap5()!= null){ - attributeList.add(trapDatas.getTrap5()); - } - if(trapDatas.getTrap6()!= null){ - attributeList.add(trapDatas.getTrap6()); - } - }else{ - if(trap.equals("Fault")){ - if(trapDatas.getTrap1()!= null){ - attributeList.add(trapDatas.getTrap1()); - } - if(trapDatas.getTrap2()!= null){ - attributeList.add(trapDatas.getTrap2()); - } - if(trapDatas.getTrap3()!= null){ - attributeList.add(trapDatas.getTrap3()); - } - if(trapDatas.getTrap4()!= null){ - attributeList.add(trapDatas.getTrap4()); - } - if(trapDatas.getTrap5()!= null){ - attributeList.add(trapDatas.getTrap5()); - } - if(trapDatas.getTrap6()!= null){ - attributeList.add(trapDatas.getTrap6()); - } - } - } - - for(int j = 0; j < attributeList.size(); j++){ - String signatureBody = ""; - ArrayList connectTraps = (ArrayList) attributeList.get(j); - for(int i =0 ; i < connectTraps.size(); i++){ - String connectBody = ""; - Object object = connectTraps.get(i); - if(object instanceof LinkedHashMap){ - String notBox = ""; - if(((LinkedHashMap) object).keySet().contains("notBox")){ - notBox = ((LinkedHashMap) object).get("notBox").toString(); - } - String trigger1 = ((LinkedHashMap) object).get("trigger1").toString(); - String operatorBox = ((LinkedHashMap) object).get("operatorBox").toString(); - String trigger2 = ((LinkedHashMap) object).get("trigger2").toString(); - connectBody = notBox + "@!" + trigger1 + "@!" + operatorBox + "@!" + trigger2 + "#!"; - } - signatureBody = signatureBody + connectBody; - } - triggerBody = triggerBody + signatureBody + "?!"; - } - - return triggerBody; - } - - private String convertDate(String dateTTL) { - String formateDate = null; - String[] date = dateTTL.split("T"); - String[] parts = date[0].split("-"); - - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - return formateDate; - } - - private String callTrap(String trap, Object object) { - String signatureBody = ""; - TrapDatas trapDatas = (TrapDatas) object; - ArrayList attributeList = new ArrayList<>(); - // Read the Trap - if(!trap.equals("nill")){ - try{ - if(trap.startsWith("Trap")){ - if(trap.equals("Trap1")){ - attributeList = trapDatas.getTrap1(); - }else if(trap.equals("Trap2")){ - attributeList = trapDatas.getTrap2(); - }else if(trap.equals("Trap3")){ - attributeList = trapDatas.getTrap3(); - }else if(trap.equals("Trap4")){ - attributeList = trapDatas.getTrap4(); - }else if(trap.equals("Trap5")){ - attributeList = trapDatas.getTrap5(); - }else if(trap.equals("Trap6")){ - attributeList = trapDatas.getTrap6(); - } - }else{ - if(trap.equals("Fault")){ - if(trap.equals("Fault1")){ - attributeList = trapDatas.getTrap1(); - }else if(trap.equals("Fault2")){ - attributeList = trapDatas.getTrap2(); - }else if(trap.equals("Fault3")){ - attributeList = trapDatas.getTrap3(); - }else if(trap.equals("Fault4")){ - attributeList = trapDatas.getTrap4(); - }else if(trap.equals("Fault5")){ - attributeList = trapDatas.getTrap5(); - }else if(trap.equals("Fault6")){ - attributeList = trapDatas.getTrap6(); - } - } - } - } catch(Exception e){ - return "(" + trap + ")"; - } - }else{ - if(trapDatas.getTrap1()!=null){ - attributeList = trapDatas.getTrap1(); - }else{ - return ""; - } - } - signatureBody = signatureBody + "(" + readAttributes(attributeList, attributeList.size()-1) + ")"; - return signatureBody; - } - - private String readAttributes(ArrayList object, int index) { - String attributes = ""; - Map trapSignatures = (Map) object.get(index); - // Read the Elements. - Object notBox = ""; - if(trapSignatures.keySet().contains("notBox")){ - notBox = trapSignatures.get("notBox"); - } - if(notBox!=null){ - attributes = attributes + notBox.toString(); - } - Object trapName1 = trapSignatures.get("trigger1"); - if(trapName1!=null){ - String attrib = trapName1.toString(); - if(attrib.startsWith("A")){ - try{ - int iy = Integer.parseInt(attrib.substring(1))-1; - attributes = attributes + "(" + readAttributes(object, iy) + ")"; - }catch(NumberFormatException e){ - try { - attrib = getVarbindOID(attrib); - attributes = attributes + "("+ URLEncoder.encode(attrib, "UTF-8")+ ")"; - } catch (UnsupportedEncodingException e1) { - //logger.error("Caused Exception while Encoding Varbind Dictionary Values"+e1); - } - } - }else{ - try { - attrib = getVarbindOID(attrib); - attributes = attributes + "("+ URLEncoder.encode(attrib, "UTF-8")+ ")"; - } catch (UnsupportedEncodingException e) { - //logger.error("Caused Exception while Encoding Varbind Dictionary Values"+e); - } - } - }else{ - return ""; - } - Object comboBox = trapSignatures.get("operatorBox"); - if(comboBox!=null){ - attributes = attributes + comboBox.toString(); - }else{ - return attributes; - } - Object trapName2 = trapSignatures.get("trigger2"); - if(trapName2!=null){ - String attrib = trapName2.toString(); - if(attrib.startsWith("A")){ - try{ - int iy = Integer.parseInt(attrib.substring(1))-1; - attributes = attributes + "(" + readAttributes(object, iy) + ")"; - }catch(NumberFormatException e){ - try { - attrib = getVarbindOID(attrib); - attributes = attributes + "("+ URLEncoder.encode(attrib, "UTF-8") + ")"; - } catch (UnsupportedEncodingException e1) { - //logger.error("Caused Exception while Encoding Varbind Dictionary Values"+e1); - } - } - }else{ - try { - attrib = getVarbindOID(attrib); - attributes = attributes + "("+ URLEncoder.encode(attrib, "UTF-8") + ")"; - } catch (UnsupportedEncodingException e) { - //logger.error("Caused Exception while Encoding Varbind Dictionary Values"+e); - } - } - } - return attributes; - } - - private String getVarbindOID(String attrib) { - VarbindDictionary varbindId = varbindDictionaryDao.getVarbindEntityByName(attrib).get(0); - return varbindId.getVarbindOID(); - } - - private String connectTriggerSignature(int index, ArrayList triggerSignatures, Object object) { - String resultBody = ""; - Map connectTraps = (Map) triggerSignatures.get(index); - try{ - String notBox = ""; - if(connectTraps.keySet().contains("notBox")){ - notBox = connectTraps.get("notBox"); - } - resultBody = resultBody + "(" + notBox; - }catch(NullPointerException e){ - resultBody = resultBody + "("; - } - String connectTrap1 = connectTraps.get("connectTrap1"); - if(connectTrap1.startsWith("Trap") || connectTrap1.startsWith("Fault")){ - String trapBody = callTrap(connectTrap1, object); - if(trapBody!=null){ - resultBody = resultBody + trapBody; - } - }else if(connectTrap1.startsWith("C")){ - for(int i=0; i<= triggerSignatures.size(); i++){ - Map triggerSignature = (Map) triggerSignatures.get(i); - if(triggerSignature.get("id").equals(connectTrap1)){ - resultBody = resultBody + "("; - String connectBody = connectTriggerSignature(i, triggerSignatures, object); - resultBody = resultBody + connectBody + ")"; - }else{ - i++; - } - } - } - try{ - String trapCount1 = connectTraps.get("trapCount1"); - resultBody = resultBody + ", Time = " + trapCount1 + ")"; - }catch(NullPointerException e){ - } - try{ - String operatorBox = connectTraps.get("operatorBox"); - resultBody = resultBody + operatorBox +"("; - }catch (NullPointerException e){ - } - try{ - String connectTrap2 = connectTraps.get("connectTrap2"); - if(connectTrap2.startsWith("Trap") || connectTrap2.startsWith("Fault")){ - String trapBody = callTrap(connectTrap2, object); - if(trapBody!=null){ - resultBody = resultBody + trapBody; - } - }else if(connectTrap2.startsWith("C")){ - for(int i=0; i<= triggerSignatures.size(); i++){ - Map triggerSignature = (Map) triggerSignatures.get(i); - if(triggerSignature.get("id").equals(connectTrap2)){ - resultBody = resultBody + "("; - String connectBody = connectTriggerSignature(i, triggerSignatures, object); - resultBody = resultBody + connectBody + ")"; - }else{ - i++; - } - } - } - }catch(NullPointerException e){ - } - try{ - String trapCount2 = connectTraps.get("trapCount2"); - resultBody = resultBody + ", Time = " + trapCount2 + ")"; - }catch(NullPointerException e){ - } - return resultBody; - } - - public void PrePopulateClosedLoopFaultPolicyData(PolicyAdapter policyAdapter) { - if (policyAdapter.getPolicyData() instanceof PolicyType) { - Object policyData = policyAdapter.getPolicyData(); - PolicyType policy = (PolicyType) policyData; - policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName()); - String policyNameValue = policyAdapter.getPolicyName().substring(policyAdapter.getPolicyName().indexOf("Fault_") +6 , policyAdapter.getPolicyName().lastIndexOf(".")); - policyAdapter.setPolicyName(policyNameValue); - String description = ""; - try{ - description = policy.getDescription().substring(0, policy.getDescription().indexOf("@CreatedBy:")); - }catch(Exception e){ - description = policy.getDescription(); - } - policyAdapter.setPolicyDescription(description); - // Get the target data under policy. - TargetType target = policy.getTarget(); - if (target != null) { - // Under target we have AnyOFType - List anyOfList = target.getAnyOf(); - if (anyOfList != null) { - Iterator iterAnyOf = anyOfList.iterator(); - while (iterAnyOf.hasNext()) { - AnyOfType anyOf = iterAnyOf.next(); - // Under AnyOFType we have AllOFType - List allOfList = anyOf.getAllOf(); - if (allOfList != null) { - Iterator iterAllOf = allOfList.iterator(); - int index = 0; - while (iterAllOf.hasNext()) { - AllOfType allOf = iterAllOf.next(); - // Under AllOFType we have Match - List matchList = allOf.getMatch(); - if (matchList != null) { - Iterator iterMatch = matchList.iterator(); - while (iterMatch.hasNext()) { - MatchType match = iterMatch.next(); - // - // Under the match we have attributevalue and - // attributeDesignator. So,finally down to the actual attribute. - // - AttributeValueType attributeValue = match.getAttributeValue(); - String value = (String) attributeValue.getContent().get(0); - - // First match in the target is EcompName, so set that value. - if (index == 1) { - policyAdapter.setEcompName(value); - EcompName ecompName = new EcompName(); - ecompName.setEcompName(value); - policyAdapter.setEcompNameField(ecompName); - } - if (index == 2){ - policyAdapter.setRiskType(value); - } - - if (index == 3){ - policyAdapter.setRiskLevel(value); - } - - if (index == 4){ - policyAdapter.setGuard(value); - } - if (index == 5 && !value.contains("NA")){ - String newDate = convertDate(value, true); - policyAdapter.setTtlDate(newDate); - } - index++; - } - } - } - } - } - } - } - String jsonBodyName = policyAdapter.getDirPath().replace(File.separator, ".")+ "." + policyAdapter.getOldPolicyFileName() + "."; - policyAdapter.setConfigBodyPath(jsonBodyName); - readClosedLoopJSONFile(policyAdapter); - } - - } - - private String convertDate(String dateTTL, boolean portalType) { - String formateDate = null; - String[] date; - String[] parts; - - if (portalType){ - parts = dateTTL.split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z"; - } else { - date = dateTTL.split("T"); - parts = date[0].split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - } - return formateDate; - } - - private String readClosedLoopJSONFile(PolicyAdapter policyAdapter) { - String fileLocation = null; - String fileName = policyAdapter.getConfigBodyPath(); - if (fileName != null ) { - fileLocation = PolicyController.getConfigHome(); - } - if (fileLocation == null) { - return fileLocation; - } - File dir = new File(fileLocation); - File[] listOfFiles = dir.listFiles(); - for (File file : listOfFiles) { - if (file.isFile() && file.getName().contains(fileName)) { - FileInputStream inputStream = null; - String location = file.toString(); - try { - inputStream = new FileInputStream(location); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - if (location.endsWith("json")) { - JsonReader jsonReader = null; - jsonReader = Json.createReader(inputStream); - ObjectMapper mapper = new ObjectMapper(); - try { - ClosedLoopFaultBody closedLoopBody = mapper.readValue(jsonReader.read().toString(), ClosedLoopFaultBody.class); - if(closedLoopBody.getClosedLoopPolicyStatus().equalsIgnoreCase("ACTIVE")){ - closedLoopBody.setClosedLoopPolicyStatus("Active"); - }else{ - closedLoopBody.setClosedLoopPolicyStatus("InActive"); - } - policyAdapter.setJsonBodyData(closedLoopBody); - if(closedLoopBody.getTrapMaxAgeUsedForUI() != null){ - policyAdapter.setTrapMaxAge(closedLoopBody.getTrapMaxAgeUsedForUI().toString()); - } - if(closedLoopBody.getTriggerTimeWindowUsedForUI() != null){ - policyAdapter.setClearTimeOut(closedLoopBody.getTriggerTimeWindowUsedForUI().toString()); - } - if(closedLoopBody.getVerfificationTimeWindowUsedForUI() != null){ - policyAdapter.setVerificationclearTimeOut(closedLoopBody.getVerfificationTimeWindowUsedForUI().toString()); - } - - } catch (Exception e) { - e.printStackTrace(); - } - jsonReader.close(); - } - } - } - return null; - } - -} - -class ClosedLoopGridJSONData{ - - private String clearTimeOut; - private String trapMaxAge; - private String verificationclearTimeOut; - private ArrayList connecttriggerSignatures; - private ArrayList connectVerificationSignatures; - - public String getClearTimeOut() { - return clearTimeOut; - } - public void setClearTimeOut(String clearTimeOut) { - this.clearTimeOut = clearTimeOut; - } - public String getTrapMaxAge() { - return trapMaxAge; - } - public void setTrapMaxAge(String trapMaxAge) { - this.trapMaxAge = trapMaxAge; - } - public String getVerificationclearTimeOut() { - return verificationclearTimeOut; - } - public void setVerificationclearTimeOut(String verificationclearTimeOut) { - this.verificationclearTimeOut = verificationclearTimeOut; - } - - - public ArrayList getConnecttriggerSignatures() { - return connecttriggerSignatures; - } - public void setConnecttriggerSignatures(ArrayList connecttriggerSignatures) { - this.connecttriggerSignatures = connecttriggerSignatures; - } - public ArrayList getConnectVerificationSignatures() { - return connectVerificationSignatures; - } - public void setConnectVerificationSignatures(ArrayList connectVerificationSignatures) { - this.connectVerificationSignatures = connectVerificationSignatures; - } -} - -class TrapDatas{ - private ArrayList trap1; - private ArrayList trap2; - private ArrayList trap3; - private ArrayList trap4; - private ArrayList trap5; - private ArrayList trap6; - public ArrayList getTrap1() { - return trap1; - } - public void setTrap1(ArrayList trap1) { - this.trap1 = trap1; - } - public ArrayList getTrap2() { - return trap2; - } - public void setTrap2(ArrayList trap2) { - this.trap2 = trap2; - } - public ArrayList getTrap3() { - return trap3; - } - public void setTrap3(ArrayList trap3) { - this.trap3 = trap3; - } - public ArrayList getTrap4() { - return trap4; - } - public void setTrap4(ArrayList trap4) { - this.trap4 = trap4; - } - public ArrayList getTrap5() { - return trap5; - } - public void setTrap5(ArrayList trap5) { - this.trap5 = trap5; - } - public ArrayList getTrap6() { - return trap6; - } - public void setTrap6(ArrayList trap6) { - this.trap6 = trap6; - } -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateClosedLoopPMController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateClosedLoopPMController.java deleted file mode 100644 index f5e0557f8..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateClosedLoopPMController.java +++ /dev/null @@ -1,422 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.json.Json; -import javax.json.JsonReader; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.json.JSONObject; -import org.openecomp.policy.adapter.ClosedLoopPMBody; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.admin.PolicyNotificationMail; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.dao.RuleAlgorithmsDao; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.elk.client.PolicyElasticSearchController; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.RuleAlgorithms; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.att.research.xacml.api.XACML3; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Joiner; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; - -@Controller -@RequestMapping("/") -public class CreateClosedLoopPMController extends RestrictedBaseController{ - - private static RuleAlgorithmsDao ruleAlgorithmsDao; - private static PolicyVersionDao policyVersionDao; - private static WatchPolicyNotificationDao policyNotificationDao; - - @Autowired - private CreateClosedLoopPMController(RuleAlgorithmsDao ruleAlgorithmsDao, PolicyVersionDao policyVersionDao, WatchPolicyNotificationDao policyNotificationDao){ - CreateClosedLoopPMController.policyVersionDao = policyVersionDao; - CreateClosedLoopPMController.ruleAlgorithmsDao = ruleAlgorithmsDao; - CreateClosedLoopPMController.policyNotificationDao = policyNotificationDao; - } - - public CreateClosedLoopPMController(){} - - protected PolicyAdapter policyAdapter = null; - private String ruleID = ""; - - public String newPolicyID() { - return Joiner.on(':').skipNulls().join((PolicyController.getDomain().startsWith("urn") ? null: "urn"), - PolicyController.getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID()); - } - - @RequestMapping(value={"/policyController/save_PMPolicy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView savePMPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - String userId = UserUtils.getUserIdFromCookie(request); - RESTfulPAPEngine engine = (RESTfulPAPEngine) PolicyController.getPapEngine(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").get("policy").toString(), PolicyAdapter.class); - - if(root.get("policyData").get("model").get("type").toString().replace("\"", "").equals("file")){ - policyData.isEditPolicy = true; - } - if(root.get("policyData").get("model").get("path").size() != 0){ - String dirName = ""; - for(int i = 0; i < root.get("policyData").get("model").get("path").size(); i++){ - dirName = dirName.replace("\"", "") + root.get("policyData").get("model").get("path").get(i).toString().replace("\"", "") + File.separator; - } - policyData.setDomainDir(dirName.substring(0, dirName.lastIndexOf(File.separator))); - }else{ - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - } - - if (policyData.getTtlDate()==null){ - policyData.setTtlDate("NA"); - }else{ - String dateTTL = policyData.getTtlDate(); - String newDate = convertDate(dateTTL); - policyData.setTtlDate(newDate); - } - - int version = 0; - int highestVersion = 0; - int descriptionVersion = 0; - //get the highest version of policy from policy version table. - //getting the sub scope domain where the policy is created or updated - String dbCheckPolicyName = policyData.getDomainDir() + File.separator + "Config_PM_" + policyData.getPolicyName(); - List policyVersionList = policyVersionDao.getPolicyVersionEntityByName(dbCheckPolicyName); - if (policyVersionList.size() > 0) { - for(int i = 0; i < policyVersionList.size(); i++) { - PolicyVersion entityItem = policyVersionList.get(i); - if(entityItem.getPolicyName().equals(dbCheckPolicyName)){ - highestVersion = entityItem.getHigherVersion(); - } - } - } - if(highestVersion != 0){ - version = highestVersion; - descriptionVersion = highestVersion +1; - }else{ - version = 1; - descriptionVersion = 1; - } - - //set policy adapter values for Building JSON object containing policy data - String createdBy = ""; - String modifiedBy = userId; - if(descriptionVersion == 1){ - createdBy = userId; - }else{ - String policyName = PolicyController.getGitPath().toAbsolutePath().toString() + File.separator + policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - File policyPath = new File(policyName); - try { - createdBy = XACMLPolicyScanner.getCreatedBy(policyPath.toPath()); - } catch (IOException e) { - createdBy = "guest"; - } - } - - policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"); - - - if(policyData.getServiceTypePolicyName() != null){ - policyData.setServiceType(policyData.getServiceTypePolicyName().get("serviceTypePolicyName").toString()); - } - - ObjectMapper jsonMapper = new ObjectMapper(); - String jsonBody = jsonMapper.writeValueAsString(policyData.getJsonBodyData()); - jsonBody = jsonBody.replaceFirst("\\{", "\\{\"serviceTypePolicyName\": \"serviceTypeFieldValue\","); - jsonBody = jsonBody.replace("serviceTypeFieldValue", policyData.getServiceType()); - policyData.setJsonBody(jsonBody); - - Map successMap = new HashMap(); - - //set the Rule Combining Algorithm Id to be sent to PAP-REST via JSON - List ruleAlgorithmsList = ruleAlgorithmsDao.getRuleAlgorithms(); - for (int i = 0; i < ruleAlgorithmsList.size(); i++) { - RuleAlgorithms a = ruleAlgorithmsList.get(i); - if (a.getXacmlId().equals(XACML3.ID_RULE_PERMIT_OVERRIDES.stringValue())) { - policyData.setRuleCombiningAlgId(a.getXacmlId()); - break; - } - } - - if (policyData.isEditPolicy()){ - //increment the version and set in policyAdapter - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - policyData.setPolicyID(this.newPolicyID()); - policyData.setRuleID(ruleID); - successMap = engine.updatePolicyRequest(policyData); - } else { - //send it for policy creation - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - successMap = engine.createPolicyRequest(policyData); - - } - - if (successMap.containsKey("success")) { - // Add it into our tree - Path finalPolicyPath = null; - finalPolicyPath = Paths.get(successMap.get("success")); - PolicyElasticSearchController controller = new PolicyElasticSearchController(); - controller.updateElk(finalPolicyPath.toString()); - File file = finalPolicyPath.toFile(); - if(file != null){ - String policyName = file.toString(); - String removePath = policyName.substring(policyName.indexOf("repository")+11); - String removeXml = removePath.replace(".xml", ""); - String removeExtension = removeXml.substring(0, removeXml.indexOf(".")); - List versionList = policyVersionDao.getPolicyVersionEntityByName(removeExtension); - if (versionList.size() > 0) { - for(int i = 0; i < versionList.size(); i++) { - PolicyVersion entityItem = versionList.get(i); - if(entityItem.getPolicyName().equals(removeExtension)){ - version = entityItem.getHigherVersion() +1; - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setModifiedBy(userId); - policyVersionDao.update(entityItem); - if(policyData.isEditPolicy){ - PolicyNotificationMail email = new PolicyNotificationMail(); - String mode = "EditPolicy"; - String policyNameForEmail = policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - email.sendMail(entityItem, policyNameForEmail, mode, policyNotificationDao); - } - } - } - }else{ - PolicyVersion entityItem = new PolicyVersion(); - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setPolicyName(removeExtension); - entityItem.setCreatedBy(userId); - entityItem.setModifiedBy(userId); - policyVersionDao.Save(entityItem); - } - } - } - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(successMap); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - private String convertDate(String dateTTL) { - String formateDate = null; - String[] date = dateTTL.split("T"); - String[] parts = date[0].split("-"); - - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - return formateDate; - } - - public void PrePopulateClosedLoopPMPolicyData(PolicyAdapter policyAdapter) { - if (policyAdapter.getPolicyData() instanceof PolicyType) { - Object policyData = policyAdapter.getPolicyData(); - PolicyType policy = (PolicyType) policyData; - policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName()); - String policyNameValue = policyAdapter.getPolicyName().substring(policyAdapter.getPolicyName().indexOf("PM_") +3 , policyAdapter.getPolicyName().lastIndexOf(".")); - policyAdapter.setPolicyName(policyNameValue); - String description = ""; - try{ - description = policy.getDescription().substring(0, policy.getDescription().indexOf("@CreatedBy:")); - }catch(Exception e){ - description = policy.getDescription(); - } - policyAdapter.setPolicyDescription(description); - // Get the target data under policy. - TargetType target = policy.getTarget(); - if (target != null) { - // Under target we have AnyOFType - List anyOfList = target.getAnyOf(); - if (anyOfList != null) { - Iterator iterAnyOf = anyOfList.iterator(); - while (iterAnyOf.hasNext()) { - AnyOfType anyOf = iterAnyOf.next(); - // Under AnyOFType we have AllOFType - List allOfList = anyOf.getAllOf(); - if (allOfList != null) { - Iterator iterAllOf = allOfList.iterator(); - while (iterAllOf.hasNext()) { - AllOfType allOf = iterAllOf.next(); - // Under AllOFType we have Match - List matchList = allOf.getMatch(); - if (matchList != null) { - int index = 0; - Iterator iterMatch = matchList.iterator(); - while (matchList.size()>1 && iterMatch.hasNext()) { - MatchType match = iterMatch.next(); - // - // Under the match we have attributevalue and - // attributeDesignator. So,finally down to the actual attribute. - // - AttributeValueType attributeValue = match.getAttributeValue(); - String value = (String) attributeValue.getContent().get(0); - - // First match in the target is EcompName, so set that value. - if (index == 0) { - policyAdapter.setEcompName(value); - } - - if (index == 1){ - policyAdapter.setRiskType(value); - } - - if (index == 2){ - policyAdapter.setRiskLevel(value); - } - - if (index == 3){ - policyAdapter.setGuard(value); - } - - if (index == 4 && !value.contains("NA")){ - String newDate = convertDate(value, true); - policyAdapter.setTtlDate(newDate); - } - if (index == 5){ - LinkedHashMap serviceTypePolicyName1 = new LinkedHashMap<>(); - String key = "serviceTypePolicyName"; - serviceTypePolicyName1.put(key, value); - policyAdapter.setServiceTypePolicyName(serviceTypePolicyName1); - } - index++; - } - } - } - } - } - } - } - String jsonBodyName = policyAdapter.getDirPath().replace(File.separator, ".")+"."+ policyAdapter.getOldPolicyFileName() + "."; - policyAdapter.setConfigBodyPath(jsonBodyName); - readClosedLoopJSONFile(policyAdapter); - } - } - - private String convertDate(String dateTTL, boolean portalType) { - String formateDate = null; - String[] date; - String[] parts; - - if (portalType){ - parts = dateTTL.split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z"; - } else { - date = dateTTL.split("T"); - parts = date[0].split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - } - return formateDate; - } - - protected String readClosedLoopJSONFile(PolicyAdapter policyAdapter) { - String fileLocation = null; - String fileName = policyAdapter.getConfigBodyPath(); - if (fileName != null ) { - fileLocation = PolicyController.getConfigHome(); - } - if (fileLocation == null) { - return fileLocation; - } - - File dir = new File(fileLocation); - File[] listOfFiles = dir.listFiles(); - for (File file : listOfFiles) { - if (file.isFile() && file.getName().contains(fileName)) { - FileInputStream inputStream = null; - String location = file.toString(); - try { - inputStream = new FileInputStream(location); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - if (location.endsWith("json")) { - JsonReader jsonReader = null; - jsonReader = Json.createReader(inputStream); - ObjectMapper mapper = new ObjectMapper(); - try { - ClosedLoopPMBody closedLoopBody = mapper.readValue(jsonReader.read().toString(), ClosedLoopPMBody.class); - policyAdapter.setJsonBodyData(closedLoopBody); - } catch (IOException e) { - e.printStackTrace(); - /*logger.error("JSON Body Mapping Error");*/ - } - jsonReader.close(); - } - } - } - return null; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateDcaeMicroServiceController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateDcaeMicroServiceController.java deleted file mode 100644 index c4d4cfd50..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateDcaeMicroServiceController.java +++ /dev/null @@ -1,987 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintWriter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import java.util.Map.Entry; -import java.util.Properties; -import java.util.TreeMap; - -import javax.json.Json; -import javax.json.JsonReader; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.lang.StringUtils; -import org.json.JSONArray; -import org.json.JSONObject; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.admin.PolicyNotificationMail; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.dao.RemoteCatalogValuesDao; -import org.openecomp.policy.dao.RuleAlgorithmsDao; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.elk.client.PolicyElasticSearchController; -import org.openecomp.policy.rest.XACMLRestProperties; -import org.openecomp.policy.rest.dao.GroupPolicyScopeListDao; -import org.openecomp.policy.rest.dao.MicroServiceModelsDao; -import org.openecomp.policy.rest.jpa.GroupPolicyScopeList; -import org.openecomp.policy.rest.jpa.MicroServiceModels; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.RemoteCatalogValues; -import org.openecomp.policy.rest.jpa.RuleAlgorithms; -import org.openecomp.policy.utils.ConfigurableRESTUtils; -import org.openecomp.policy.utils.ConfigurableRESTUtils.RESQUEST_METHOD; -import org.openecomp.policy.utils.ConfigurableRESTUtils.REST_RESPONSE_FORMAT; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.att.research.xacml.api.XACML3; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.att.research.xacml.util.XACMLProperties; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.google.common.base.Joiner; -import com.google.common.base.Splitter; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Controller -@RequestMapping("/") -public class CreateDcaeMicroServiceController extends RestrictedBaseController { - private static final Logger logger = FlexLogger.getLogger(CreateDcaeMicroServiceController.class); - - private static RuleAlgorithmsDao ruleAlgorithmsDao; - private static RemoteCatalogValuesDao remoteCatalogValuesDao; - private static MicroServiceModelsDao microServiceModelsDao; - private static PolicyVersionDao policyVersionDao; - private static GroupPolicyScopeListDao groupPolicyScopeListDao; - private static WatchPolicyNotificationDao policyNotificationDao; - - @Autowired - private CreateDcaeMicroServiceController(RuleAlgorithmsDao ruleAlgorithmsDao, RemoteCatalogValuesDao remoteCatalogValuesDao, - MicroServiceModelsDao microServiceModelsDao, PolicyVersionDao policyVersionDao, GroupPolicyScopeListDao groupPolicyScopeListDao, - WatchPolicyNotificationDao policyNotificationDao){ - CreateDcaeMicroServiceController.groupPolicyScopeListDao = groupPolicyScopeListDao; - CreateDcaeMicroServiceController.policyVersionDao = policyVersionDao; - CreateDcaeMicroServiceController.microServiceModelsDao = microServiceModelsDao; - CreateDcaeMicroServiceController.remoteCatalogValuesDao = remoteCatalogValuesDao; - CreateDcaeMicroServiceController.ruleAlgorithmsDao = ruleAlgorithmsDao; - CreateDcaeMicroServiceController.policyNotificationDao = policyNotificationDao; - } - - public CreateDcaeMicroServiceController(){} - - protected PolicyAdapter policyAdapter = null; - private String ruleID = ""; - private int priorityCount; - private Map attributesListRefMap = new HashMap(); - private Map> arrayTextList = new HashMap>(); - - - public String newPolicyID() { - return Joiner.on(':').skipNulls().join((PolicyController.getDomain().startsWith("urn") ? null: "urn"), - PolicyController.getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID()); - } - - - @RequestMapping(value={"/policyController/getDCAEMSTemplateData.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView getBRMSParamPolicyRuleData(HttpServletRequest request, HttpServletResponse response) throws Exception{ - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - - String value = root.get("policyData").toString().replaceAll("^\"|\"$", ""); - String servicename = value.toString().split("-v")[0]; - String version = null; - if (value.toString().contains("-v")){ - version = value.toString().split("-v")[1]; - } - MicroServiceModels returnModel = getAttributeObject(servicename, version); - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - List list = new ArrayList<>(); - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(returnModel); - JSONObject j = new JSONObject("{dcaeModelData: " + responseString +"}"); - list.add(j); - out.write(list.toString()); - return null; - } - - private MicroServiceModels getAttributeObject(String name, String version) { - MicroServiceModels workingModel = new MicroServiceModels(); - List microServiceModelsData = microServiceModelsDao.getMicroServiceModelsData(); - for (int i = 0; i < microServiceModelsData.size(); i++) { - workingModel = microServiceModelsData.get(i); - if (version!=null && workingModel.getVersion()!=null){ - if (workingModel.getModelName().equals(name) && workingModel.getVersion().equals(version)){ - break; - } - }else{ - if (workingModel.getModelName().equals(name) && workingModel.getVersion() == null){ - break; - } - } - } - return workingModel; - } - - @RequestMapping(value={"/get_DCAEPriorityValues"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getDCAEPriorityValuesData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - List priorityList = new ArrayList(); - priorityCount = 10; - for (int i = 1; i < priorityCount; i++) { - priorityList.add(String.valueOf(i)); - } - model.put("priorityDatas", mapper.writeValueAsString(priorityList)); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - - @RequestMapping(value={"/policyController/save_DCAEMSPolicy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveDCAEMSPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - String userId = UserUtils.getUserIdFromCookie(request); - RESTfulPAPEngine engine = (RESTfulPAPEngine) PolicyController.getPapEngine(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - String jsonContent = null; - try{ - jsonContent = decodeContent(root.get("policyJSON")).toString(); - }catch(Exception e){ - logger.error("Error while decoding microservice content"); - } - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").get("policy").toString(), PolicyAdapter.class); - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - if(root.get("policyData").get("model").get("type").toString().replace("\"", "").equals("file")){ - policyData.isEditPolicy = true; - } - - if(root.get("policyData").get("model").get("path").size() != 0){ - String dirName = ""; - for(int i = 0; i < root.get("policyData").get("model").get("path").size(); i++){ - dirName = dirName.replace("\"", "") + root.get("policyData").get("model").get("path").get(i).toString().replace("\"", "") + File.separator; - } - if(policyData.isEditPolicy){ - policyData.setDomainDir(dirName.substring(0, dirName.lastIndexOf(File.separator))); - }else{ - policyData.setDomainDir(dirName + root.get("policyData").get("model").get("name").toString().replace("\"", "")); - } - }else{ - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - } - - if (policyData.getTtlDate()==null){ - policyData.setTtlDate("NA"); - }else{ - String dateTTL = policyData.getTtlDate(); - String newDate = convertDate(dateTTL); - policyData.setTtlDate(newDate); - } - - int version = 0; - int highestVersion = 0; - int descriptionVersion = 0; - //get the highest version of policy from policy version table. - //getting the sub scope domain where the policy is created or updated - String dbCheckPolicyName = policyData.getDomainDir() + File.separator + "Config_MS_" + policyData.getPolicyName(); - List versionList = policyVersionDao.getPolicyVersionEntityByName(dbCheckPolicyName); - if (versionList.size() > 0) { - for(int i = 0; i < versionList.size(); i++) { - PolicyVersion entityItem = versionList.get(i); - if(entityItem.getPolicyName().equals(dbCheckPolicyName)){ - highestVersion = entityItem.getHigherVersion(); - } - } - } - if(highestVersion != 0){ - version = highestVersion; - descriptionVersion = highestVersion +1; - }else{ - version = 1; - descriptionVersion = 1; - } - - //set policy adapter values for Building JSON object containing policy data - String createdBy = ""; - String modifiedBy = userId; - if(descriptionVersion == 1){ - createdBy = userId; - }else{ - String policyName = PolicyController.getGitPath().toAbsolutePath().toString() + File.separator + policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - File policyPath = new File(policyName); - try { - createdBy = XACMLPolicyScanner.getCreatedBy(policyPath.toPath()); - } catch (IOException e) { - createdBy = "guest"; - } - } - - policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"); - policyData.setEcompName(policyData.getEcompName()); - //get the jsonBody - String jsonBody = null; - try { - jsonBody = constructJson(policyData, jsonContent); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e); - } - policyData.setJsonBody(jsonBody); - Map successMap = new HashMap(); - //set the Rule Combining Algorithm Id to be sent to PAP-REST via JSON - List ruleAlgorithmsList = ruleAlgorithmsDao.getRuleAlgorithms(); - for (int i = 0; i < ruleAlgorithmsList.size(); i++) { - RuleAlgorithms a = ruleAlgorithmsList.get(i); - if (a.getXacmlId().equals(XACML3.ID_RULE_PERMIT_OVERRIDES.stringValue())) { - policyData.setRuleCombiningAlgId(a.getXacmlId()); - break; - } - } - if (policyData.isEditPolicy()){ - //increment the version and set in policyAdapter - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - policyData.setPolicyID(this.newPolicyID()); - policyData.setRuleID(ruleID); - successMap = engine.updatePolicyRequest(policyData); - } else { - //send it for policy creation - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - successMap = engine.createPolicyRequest(policyData); - - } - - if (successMap.containsKey("success")) { - // Add it into our tree - Path finalPolicyPath = null; - finalPolicyPath = Paths.get(successMap.get("success")); - PolicyElasticSearchController controller = new PolicyElasticSearchController(); - controller.updateElk(finalPolicyPath.toString()); - File file = finalPolicyPath.toFile(); - if(file != null){ - String policyName = file.toString(); - String removePath = policyName.substring(policyName.indexOf("repository")+11); - String removeXml = removePath.replace(".xml", ""); - String removeExtension = removeXml.substring(0, removeXml.indexOf(".")); - List policyVersionList = policyVersionDao.getPolicyVersionEntityByName(removeExtension); - if (policyVersionList.size() > 0) { - for(int i = 0; i < policyVersionList.size(); i++) { - PolicyVersion entityItem = policyVersionList.get(i); - if(entityItem.getPolicyName().equals(removeExtension)){ - version = entityItem.getHigherVersion() +1; - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setModifiedBy(userId); - policyVersionDao.update(entityItem); - if(policyData.isEditPolicy){ - PolicyNotificationMail email = new PolicyNotificationMail(); - String mode = "EditPolicy"; - String policyNameForEmail = policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - email.sendMail(entityItem, policyNameForEmail, mode, policyNotificationDao); - } - } - } - }else{ - PolicyVersion entityItem = new PolicyVersion(); - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setPolicyName(removeExtension); - entityItem.setCreatedBy(userId); - entityItem.setModifiedBy(userId); - policyVersionDao.Save(entityItem); - } - } - } - - System.out.println(root); - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(successMap); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - private JSONObject decodeContent(JsonNode jsonNode){ - Iterator jsonElements = jsonNode.elements(); - Iterator jsonKeys = jsonNode.fieldNames(); - Map element = new TreeMap(); - while(jsonElements.hasNext() && jsonKeys.hasNext()){ - element.put(jsonKeys.next(), jsonElements.next().toString()); - } - JSONObject jsonResult = new JSONObject(); - JSONArray jsonArray = null; - String oldValue = null; - String nodeKey = null; - String arryKey = null; - Boolean isArray = false; - JsonNodeFactory nodeFactory = JsonNodeFactory.instance; - ObjectNode node = nodeFactory.objectNode(); - String prevKey = null; - String presKey = null; - for(String key: element.keySet()){ - if(key.contains(".")){ - presKey = key.substring(0,key.indexOf(".")); - }else if(key.contains("@")){ - presKey = key.substring(0,key.indexOf("@")); - }else{ - presKey = key; - } - // first check if we are different from old. - System.out.println(key+"\n"); - if(jsonArray!=null && jsonArray.length()>0 && key.contains("@") && !key.contains(".") && oldValue!=null){ - if(!oldValue.equals(key.substring(0,key.indexOf("@")))){ - jsonResult.put(oldValue, jsonArray); - jsonArray = new JSONArray(); - } - }else if(jsonArray!=null && jsonArray.length()>0 && !presKey.equals(prevKey) && oldValue!=null){ - jsonResult.put(oldValue, jsonArray); - isArray = false; - jsonArray = new JSONArray(); - } - /*if(node.size()!=0 && key.contains("@")){ - - }else{ - if(node.size()!=0){ - - } - }*/ - prevKey = presKey; - // - if(key.contains(".")){ - if(nodeKey==null){ - nodeKey = key.substring(0,key.indexOf(".")); - } - if(nodeKey.equals(key.substring(0,key.indexOf(".")))){ - node.put(key.substring(key.indexOf(".")+1), element.get(key)); - }else{ - if(node.size()!=0){ - if(nodeKey.contains("@")){ - if(arryKey==null){ - arryKey = nodeKey.substring(0,nodeKey.indexOf("@")); - } - if(nodeKey.endsWith("@0")){ - isArray = true; - jsonArray = new JSONArray(); - } - if(arryKey.equals(nodeKey.substring(0,nodeKey.indexOf("@")))){ - jsonArray.put(decodeContent(node)); - } - if(key.contains("@") && !arryKey.equals(key.substring(0,nodeKey.indexOf("@")))){ - jsonResult.put(arryKey, jsonArray); - jsonArray = new JSONArray(); - }else if(!key.contains("@")){ - jsonResult.put(arryKey, jsonArray); - jsonArray = new JSONArray(); - } - arryKey = nodeKey.substring(0,nodeKey.indexOf("@")); - }else{ - isArray = false; - jsonResult.put(nodeKey, decodeContent(node)); - } - node = nodeFactory.objectNode(); - } - nodeKey = key.substring(0,key.indexOf(".")); - if(nodeKey.contains("@")){ - arryKey = nodeKey.substring(0,nodeKey.indexOf("@")); - } - node.put(key.substring(key.indexOf(".")+1), element.get(key)); - } - }else if(node.size()!=0){ - if(nodeKey.contains("@")){ - if(arryKey==null){ - arryKey = nodeKey.substring(0,nodeKey.indexOf("@")); - } - if(nodeKey.endsWith("@0")){ - isArray = true; - jsonArray = new JSONArray(); - } - if(arryKey.equals(nodeKey.substring(0,nodeKey.indexOf("@")))){ - jsonArray.put(decodeContent(node)); - } - jsonResult.put(arryKey, jsonArray); - jsonArray = new JSONArray(); - arryKey = nodeKey.substring(0,nodeKey.indexOf("@")); - }else{ - isArray = false; - jsonResult.put(nodeKey, decodeContent(node)); - } - node = nodeFactory.objectNode(); - if(key.contains("@")){ - isArray = true; - if(key.endsWith("@0")|| jsonArray==null){ - jsonArray = new JSONArray(); - } - }else if(!key.contains("@")){ - isArray = false; - } - if(isArray){ - if(oldValue==null){ - oldValue = key.substring(0,key.indexOf("@")); - } - if(oldValue!=prevKey){ - oldValue = key.substring(0,key.indexOf("@")); - } - if(oldValue.equals(key.substring(0,key.indexOf("@")))){ - jsonArray.put(element.get(key)); - }else{ - jsonResult.put(oldValue, jsonArray); - jsonArray = new JSONArray(); - } - oldValue = key.substring(0,key.indexOf("@")); - }else{ - jsonResult.put(key, element.get(key)); - } - }else{ - if(key.contains("@")){ - isArray = true; - if(key.endsWith("@0")|| jsonArray==null){ - jsonArray = new JSONArray(); - } - }else if(!key.contains("@")){ - isArray = false; - } - if(isArray){ - if(oldValue==null){ - oldValue = key.substring(0,key.indexOf("@")); - } - if(oldValue!=prevKey){ - oldValue = key.substring(0,key.indexOf("@")); - } - if(oldValue.equals(key.substring(0,key.indexOf("@")))){ - jsonArray.put(element.get(key)); - }else{ - jsonResult.put(oldValue, jsonArray); - jsonArray = new JSONArray(); - } - oldValue = key.substring(0,key.indexOf("@")); - }else{ - jsonResult.put(key, element.get(key)); - } - } - } - if(node.size()>0){ - if(nodeKey.contains("@")){ - if(jsonArray==null){ - jsonArray = new JSONArray(); - } - if(arryKey==null){ - arryKey = nodeKey.substring(0,nodeKey.indexOf("@")); - } - jsonArray.put(decodeContent(node)); - jsonResult.put(arryKey, jsonArray); - isArray = false;; - }else{ - jsonResult.put(nodeKey, decodeContent(node)); - } - } - if(isArray && jsonArray.length() > 0){ - jsonResult.put(oldValue, jsonArray); - } - return jsonResult; - } - - public void PrePopulateDCAEMSPolicyData(PolicyAdapter policyAdapter) { - if (policyAdapter.getPolicyData() instanceof PolicyType) { - Object policyData = policyAdapter.getPolicyData(); - PolicyType policy = (PolicyType) policyData; - policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName()); - String policyNameValue = policyAdapter.getPolicyName().substring(policyAdapter.getPolicyName().indexOf("MS_") +3 , policyAdapter.getPolicyName().lastIndexOf(".")); - policyAdapter.setPolicyName(policyNameValue); - String description = ""; - try{ - description = policy.getDescription().substring(0, policy.getDescription().indexOf("@CreatedBy:")); - }catch(Exception e){ - description = policy.getDescription(); - } - policyAdapter.setPolicyDescription(description); - String jsonBodyName = policyAdapter.getDirPath().replace(File.separator, ".")+ "." + policyAdapter.getOldPolicyFileName() + "."; - policyAdapter.setConfigBodyPath(jsonBodyName); - // Get the target data under policy. - TargetType target = policy.getTarget(); - if (target != null) { - // Under target we have AnyOFType - List anyOfList = target.getAnyOf(); - if (anyOfList != null) { - Iterator iterAnyOf = anyOfList.iterator(); - while (iterAnyOf.hasNext()) { - AnyOfType anyOf = iterAnyOf.next(); - // Under AnyOFType we have AllOFType - List allOfList = anyOf.getAllOf(); - if (allOfList != null) { - Iterator iterAllOf = allOfList.iterator(); - while (iterAllOf.hasNext()) { - AllOfType allOf = iterAllOf.next(); - // Under AllOFType we have Match - List matchList = allOf.getMatch(); - if (matchList != null) { - int index = 0; - Iterator iterMatch = matchList.iterator(); - while (matchList.size()>1 && iterMatch.hasNext()) { - MatchType match = iterMatch.next(); - // - // Under the match we have attributevalue and - // attributeDesignator. So,finally down to the actual attribute. - // - AttributeValueType attributeValue = match.getAttributeValue(); - String value = (String) attributeValue.getContent().get(0); - - // First match in the target is EcompName, so set that value. - if (index == 0) { - policyAdapter.setEcompName(value); - } - if (index == 1){ - policyAdapter.setConfigName(value); - } - if (index == 2){ - if(value != null){ - readFile(policyAdapter); - } - } - if (index == 3){ - policyAdapter.setUuid(value); - } - if (index == 4){ - policyAdapter.setLocation(value); - } - if (index == 5){ - policyAdapter.setRiskType(value); - } - - if (index == 6){ - policyAdapter.setRiskLevel(value); - } - - if (index == 7){ - policyAdapter.setGuard(value); - } - if (index == 8 && !value.contains("NA")){ - String newDate = convertDate(value, true); - policyAdapter.setTtlDate(newDate); - } - index++; - } - } - } - } - } - } - } - } - - } - - private String convertDate(String dateTTL, boolean portalType) { - String formateDate = null; - String[] date; - String[] parts; - - if (portalType){ - parts = dateTTL.split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z"; - } else { - date = dateTTL.split("T"); - parts = date[0].split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - } - return formateDate; - } - - @SuppressWarnings("unchecked") - private String readFile(PolicyAdapter policyAdapter) { - String fileLocation = null; - String policyScopeName = null; - String fileName = policyAdapter.getConfigBodyPath(); - if (fileName != null ) { - fileLocation = PolicyController.getConfigHome(); - } - if (fileLocation == null) { - return fileLocation; - } - File dir = new File(fileLocation); - File[] listOfFiles = dir.listFiles(); - for (File file : listOfFiles) { - if (file.isFile() && file.getName().contains(fileName)) { - FileInputStream inputStream = null; - String location = file.toString(); - try { - inputStream = new FileInputStream(location); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - if (location.endsWith("json")) { - JsonReader jsonReader = null; - jsonReader = Json.createReader(inputStream); - ObjectMapper mapper = new ObjectMapper(); - try { - DCAEMicroServiceObject msBody = (DCAEMicroServiceObject) mapper.readValue(jsonReader.read().toString(), DCAEMicroServiceObject.class); - policyScopeName = getPolicyScope(msBody.getPolicyScope()); - policyAdapter.setPolicyScope(policyScopeName); - - policyAdapter.setPriority(msBody.getPriority()); - - if (msBody.getVersion()!= null){ - policyAdapter.setServiceType(msBody.getService() + "-v" + msBody.getVersion()); - }else{ - policyAdapter.setServiceType(msBody.getService()); - } - if(msBody.getContent() != null){ - LinkedHashMap data = new LinkedHashMap(); - LinkedHashMap map = (LinkedHashMap) msBody.getContent(); - readRecursivlyJSONContent(map, data); - policyAdapter.setRuleData(data); - } - - } catch (Exception e) { - e.printStackTrace(); - } - jsonReader.close(); - } - } - } - return fileName; - - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - private void readRecursivlyJSONContent(LinkedHashMap map, LinkedHashMap data){ - for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) { - Object key = iterator.next(); - Object value = map.get(key); - if(value instanceof LinkedHashMap){ - readRecursivlyJSONContent((LinkedHashMap) value, data); - }else if(value instanceof ArrayList){ - ArrayList jsonArrayVal = (ArrayList)value; - for(int i = 0; i < jsonArrayVal.size(); i++){ - Object arrayvalue = jsonArrayVal.get(i); - if(arrayvalue instanceof LinkedHashMap){ - LinkedHashMap newData = new LinkedHashMap(); - readRecursivlyJSONContent((LinkedHashMap) arrayvalue, newData); - for(String objKey: newData.keySet()){ - data.put(key+"@"+i+"." +objKey, newData.get(objKey)); - } - }else if(arrayvalue instanceof ArrayList){ - ArrayList jsonArrayVal1 = (ArrayList)value; - for(int j = 0; j < jsonArrayVal1.size(); j++){ - Object arrayvalue1 = jsonArrayVal1.get(i); - data.put(key+"@"+j, arrayvalue1.toString()); - } - }else{ - data.put(key+"@"+i, arrayvalue.toString()); - } - } - }else{ - data.put(key.toString(), value.toString()); - } - } - } - - private String getPolicyScope(String value) { - GroupPolicyScopeList pScope = new GroupPolicyScopeList(); - List groupList= groupPolicyScopeListDao.getGroupPolicyScopeListData(); - if(groupList.size() > 0){ - for(int i = 0 ; i < groupList.size() ; i ++){ - pScope = groupList.get(i); - if (pScope.getGroupList().equals(value)){ - break; - } - } - } - return pScope.getGroupName(); - } - - private GroupPolicyScopeList getPolicyObject(String policyScope) { - GroupPolicyScopeList pScope = new GroupPolicyScopeList(); - List groupList = groupPolicyScopeListDao.getGroupPolicyScopeListData(); - if(groupList.size() > 0){ - for(int i = 0 ; i < groupList.size() ; i ++){ - pScope = groupList.get(i); - if (pScope.getGroupName().equals(policyScope)){ - break; - } - } - } - return pScope; - } - - private String constructJson(PolicyAdapter policyAdapter, String jsonContent) { - ObjectWriter om = new ObjectMapper().writer(); - String json=""; - DCAEMicroServiceObject microServiceObject = new DCAEMicroServiceObject(); - - microServiceObject.setTemplateVersion(XACMLProperties.getProperty(XACMLRestProperties.TemplateVersion_MS)); - if(policyAdapter.getServiceType() !=null){ - microServiceObject.setService(policyAdapter.getServiceType().toString().split("-v")[0]); - if (policyAdapter.getServiceType().toString().contains("-v")){ - microServiceObject.setVersion(policyAdapter.getServiceType().toString().split("-v")[1]); - } - } - if(policyAdapter.getUuid()!=null){ - microServiceObject.setUuid(policyAdapter.getUuid()); - } - - if(policyAdapter.getLocation()!=null){ - microServiceObject.setLocation(policyAdapter.getLocation()); - } - if(policyAdapter.getPolicyName()!=null){ - microServiceObject.setPolicyName(policyAdapter.getPolicyName()); - } - - if(policyAdapter.getConfigName()!=null){ - microServiceObject.setConfigName(policyAdapter.getConfigName()); - } - if(policyAdapter.getPolicyDescription()!=null){ - microServiceObject.setDescription(policyAdapter.getPolicyDescription()); - } - if (policyAdapter.getPriority()!=null){ - microServiceObject.setPriority(policyAdapter.getPriority()); - }else { - microServiceObject.setPriority("9999"); - } - microServiceObject.setContent(jsonContent); - GroupPolicyScopeList policyScopeValue = getPolicyObject(policyAdapter.getPolicyScope()); - microServiceObject.setPolicyScope(policyScopeValue.getGroupList()); - try { - json = om.writeValueAsString(microServiceObject); - } catch (JsonProcessingException e) { - logger.error("Error writing out the object"); - } - System.out.println(json); - String cleanJson = cleanUPJson(json); - return cleanJson; - } - - private String cleanUPJson(String json) { - String cleanJason = StringUtils.replaceEach(json, new String[]{"\\\\", "\\\\\\", "\\\\\\\\"}, new String[]{"\\", "\\", "\\"}); - cleanJason = StringUtils.replaceEach(json, new String[]{"\\\\\\"}, new String[]{"\\"}); - cleanJason = StringUtils.replaceEach(cleanJason, new String[]{"\\\\", "[[", "]]"}, new String[]{"\\", "[", "]"}); - - cleanJason = StringUtils.replaceEach(cleanJason, new String[]{"\\\\\"", "\\\"", "\"[{", "}]\""}, new String[]{"\"", "\"", "[{", "}]"}); - cleanJason = StringUtils.replaceEach(cleanJason, new String[]{"\"[{", "}]\""}, new String[]{"[{", "}]"}); - cleanJason = StringUtils.replaceEach(cleanJason, new String[]{"\"[", "]\""}, new String[]{"[", "]"}); - cleanJason = StringUtils.replaceEach(cleanJason, new String[]{"\"{", "}\""}, new String[]{"{", "}"}); - cleanJason = StringUtils.replaceEach(cleanJason, new String[]{"\"\"\"", "\"\""}, new String[]{"\"", "\""}); - cleanJason = StringUtils.replaceEach(cleanJason, new String[]{"\\\""}, new String[]{""}); - return cleanJason; - } - - //Convert the map values and set into JSON body - public Map convertMap(Map attributesMap, Map attributesRefMap) { - Map attribute = new HashMap(); - String temp = null; - String key; - String value; - for (Entry entry : attributesMap.entrySet()) { - key = entry.getKey(); - value = entry.getValue(); - attribute.put(key, value); - } - for (Entry entryRef : attributesRefMap.entrySet()) { - key = entryRef.getKey(); - value = entryRef.getValue().toString(); - attribute.put(key, value); - } - for (Entry entryList : attributesListRefMap.entrySet()) { - key = entryList.getKey(); - value = entryList.getValue().toString(); - attribute.put(key, value); - } - for (Entry> arrayList : arrayTextList.entrySet()){ - key = arrayList.getKey(); - temp = null; - for (Object textList : arrayList.getValue()){ - if (temp == null){ - temp = "[" + textList; - }else{ - temp = temp + "," + textList; - } - } - attribute.put(key, temp+ "]"); - } - - return attribute; - } - - private String convertDate(String dateTTL) { - String formateDate = null; - String[] date = dateTTL.split("T"); - String[] parts = date[0].split("-"); - - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - return formateDate; - } -} - -class DCAEMicroServiceObject { - - public String service; - public String location; - public String uuid; - public String policyName; - public String description; - public String configName; - public String templateVersion; - public String version; - public String priority; - public String policyScope; - - public String getPolicyScope() { - return policyScope; - } - public void setPolicyScope(String policyScope) { - this.policyScope = policyScope; - } - - public String getPriority() { - return priority; - } - public void setPriority(String priority) { - this.priority = priority; - } - public String getVersion() { - return version; - } - public void setVersion(String version) { - this.version = version; - } - private Object content; - - - public String getPolicyName() { - return policyName; - } - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public String getConfigName() { - return configName; - } - public void setConfigName(String configName) { - this.configName = configName; - } - public Object getContent() { - return content; - } - public void setContent(Object content) { - this.content = content; - } - - public String getService() { - return service; - } - public void setService(String service) { - this.service = service; - } - public String getLocation() { - return location; - } - public void setLocation(String location) { - this.location = location; - } - - public String getUuid() { - return uuid; - } - public void setUuid(String uuid) { - this.uuid = uuid; - } - public String getTemplateVersion() { - return templateVersion; - } - public void setTemplateVersion(String templateVersion) { - this.templateVersion = templateVersion; - } - -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateFirewallController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateFirewallController.java deleted file mode 100644 index 6d7c0c752..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreateFirewallController.java +++ /dev/null @@ -1,1292 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.hibernate.SQLQuery; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.json.JSONObject; -import org.openecomp.policy.adapter.AddressGroupJson; -import org.openecomp.policy.adapter.AddressJson; -import org.openecomp.policy.adapter.AddressMembers; -import org.openecomp.policy.adapter.DeployNowJson; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.adapter.PrefixIPList; -import org.openecomp.policy.adapter.ServiceGroupJson; -import org.openecomp.policy.adapter.ServiceListJson; -import org.openecomp.policy.adapter.ServiceMembers; -import org.openecomp.policy.adapter.ServicesJson; -import org.openecomp.policy.adapter.Term; -import org.openecomp.policy.adapter.TermCollector; -import org.openecomp.policy.admin.PolicyNotificationMail; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.dao.RuleAlgorithmsDao; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.elk.client.PolicyElasticSearchController; -import org.openecomp.policy.rest.dao.AddressGroupDao; -import org.openecomp.policy.rest.dao.FirewallDictionaryListDao; -import org.openecomp.policy.rest.dao.PrefixListDao; -import org.openecomp.policy.rest.dao.SecurityZoneDao; -import org.openecomp.policy.rest.dao.ServiceGroupDao; -import org.openecomp.policy.rest.dao.ServiceListDao; -import org.openecomp.policy.rest.dao.TermListDao; -import org.openecomp.policy.rest.jpa.AddressGroup; -import org.openecomp.policy.rest.jpa.FirewallDictionaryList; -import org.openecomp.policy.rest.jpa.GroupServiceList; -import org.openecomp.policy.rest.jpa.PREFIXLIST; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.RuleAlgorithms; -import org.openecomp.policy.rest.jpa.SecurityZone; -import org.openecomp.policy.rest.jpa.ServiceList; -import org.openecomp.policy.rest.jpa.TermList; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -import com.att.research.xacml.api.XACML3; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.google.common.base.Joiner; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; - -@Controller -@RequestMapping("/") -public class CreateFirewallController extends RestrictedBaseController { - private static Logger logger = FlexLogger.getLogger(CreateFirewallController.class); - - private static RuleAlgorithmsDao ruleAlgorithmsDao; - private static PolicyVersionDao policyVersionDao; - private static PrefixListDao prefixListDao; - private static ServiceListDao serviceListDao; - private static TermListDao termListDao; - private static ServiceGroupDao serviceGroupDao; - private static AddressGroupDao addressGroupDao; - private static SecurityZoneDao securityZoneDao; - private static SessionFactory sessionFactory; - private static FirewallDictionaryListDao fwDictionaryListDao; - private static WatchPolicyNotificationDao policyNotificationDao; - - List expandablePrefixIPList = new ArrayList(); - List expandableServicesList= new ArrayList(); - - private String parentSecurityZone; - - - public String getParentSecurityZone() { - return parentSecurityZone; - } - - public void setParentSecurityZone(String parentSecurityZone) { - this.parentSecurityZone = parentSecurityZone; - } - - - - @Autowired - private CreateFirewallController(RuleAlgorithmsDao ruleAlgorithmsDao, PolicyVersionDao policyVersionDao, PrefixListDao prefixListDao, - ServiceListDao serviceListDao, TermListDao termListDao, ServiceGroupDao serviceGroupDao, AddressGroupDao addressGroupDao, SecurityZoneDao securityZoneDao, SessionFactory sessionFactory - ,FirewallDictionaryListDao fwDictionaryListDao, WatchPolicyNotificationDao policyNotificationDao){ - CreateFirewallController.addressGroupDao = addressGroupDao; - CreateFirewallController.ruleAlgorithmsDao = ruleAlgorithmsDao; - CreateFirewallController.policyVersionDao = policyVersionDao; - CreateFirewallController.prefixListDao = prefixListDao; - CreateFirewallController.serviceListDao = serviceListDao; - CreateFirewallController.termListDao = termListDao; - CreateFirewallController.serviceGroupDao = serviceGroupDao; - CreateFirewallController.securityZoneDao = securityZoneDao; - CreateFirewallController.sessionFactory = sessionFactory; - CreateFirewallController.fwDictionaryListDao = fwDictionaryListDao; - CreateFirewallController.policyNotificationDao = policyNotificationDao; - } - - public CreateFirewallController(){} - protected PolicyAdapter policyAdapter = null; - private List termCollectorList; - private List parentDictionaryList; - private String ruleID = ""; - private String jsonBody; - private ArrayList attributeList; - private ArrayList fwAttributeList; - - public String newPolicyID() { - return Joiner.on(':').skipNulls().join((PolicyController.getDomain().startsWith("urn") ? null: "urn"), - PolicyController.getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID()); - } - - @RequestMapping(value={"/get_FWParentListDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getFWParentListEntityDataByName(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - String query= "select distinct parent from fwparent"; - model.put("fwParentListDictionaryDatas", mapper.writeValueAsString(queryToDatabase(query))); - - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - @SuppressWarnings("unchecked") - private List queryToDatabase(String query) { - Session session = sessionFactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = null; - try { - SQLQuery sqlquery=session.createSQLQuery(query); - //Query hbquery = session.createQuery(query); - data = sqlquery.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Qurying Parent Child Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - - } - - @SuppressWarnings("unchecked") - private void updateToDatabase(String updateQuery) { - Session session = sessionFactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = null; - try { - SQLQuery sqlquery=session.createSQLQuery(updateQuery); - sqlquery.executeUpdate(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating FWChildParent Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - - @RequestMapping(value={"/policyController/save_FirewallPolicy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveFirewallPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - termCollectorList = new ArrayList(); - parentDictionaryList= new ArrayList(); - try { - String userId = UserUtils.getUserIdFromCookie(request); - RESTfulPAPEngine engine = (RESTfulPAPEngine) PolicyController.getPapEngine(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").get("policy").toString(), PolicyAdapter.class); - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - if(root.get("policyData").get("model").get("type").toString().replace("\"", "").equals("file")){ - policyData.isEditPolicy = true; - } - this.policyAdapter = policyData; - if(root.get("policyData").get("model").get("path").size() != 0){ - String dirName = ""; - for(int i = 0; i < root.get("policyData").get("model").get("path").size(); i++){ - dirName = dirName.replace("\"", "") + root.get("policyData").get("model").get("path").get(i).toString().replace("\"", "") + File.separator; - } - policyData.setDomainDir(dirName.substring(0, dirName.lastIndexOf(File.separator))); - }else{ - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - } - - if (policyData.getTtlDate()==null){ - policyData.setTtlDate("NA"); - }else{ - String dateTTL = policyData.getTtlDate(); - String newDate = convertDate(dateTTL); - policyData.setTtlDate(newDate); - } - - int version = 0; - int highestVersion = 0; - int descriptionVersion = 0; - //get the highest version of policy from policy version table. - //getting the sub scope domain where the policy is created or updated - String dbCheckPolicyName = policyData.getDomainDir() + File.separator + "Config_FW_" + policyData.getPolicyName(); - List policyVersionList = policyVersionDao.getPolicyVersionEntityByName(dbCheckPolicyName); - if (policyVersionList.size() > 0) { - for(int i = 0; i < policyVersionList.size(); i++) { - PolicyVersion entityItem = policyVersionList.get(i); - if(entityItem.getPolicyName().equals(dbCheckPolicyName)){ - highestVersion = entityItem.getHigherVersion(); - } - } - } - if(highestVersion != 0){ - version = highestVersion; - descriptionVersion = highestVersion +1; - }else{ - version = 1; - descriptionVersion = 1; - } - - //set policy adapter values for Building JSON object containing policy data - String createdBy = ""; - String modifiedBy = userId; - if(descriptionVersion == 1){ - createdBy = userId; - }else{ - String policyName = PolicyController.getGitPath().toAbsolutePath().toString() + File.separator + policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - File policyPath = new File(policyName); - try { - createdBy = XACMLPolicyScanner.getCreatedBy(policyPath.toPath()); - } catch (IOException e) { - createdBy = "guest"; - } - } - - if(policyData.getFwPolicyType().equalsIgnoreCase("Parent Policy")){ - String comboNames=""; - int i=0; - for(Object fwattribute : policyData.getFwattributes()){ - if(fwattribute instanceof LinkedHashMap){ - String key = ((LinkedHashMap) fwattribute).get("option").toString(); - if(i>0){ - comboNames = comboNames+","+ key; - } - else{ - comboNames = key; - } - i++; - } - } - policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"+"@comboList:"+comboNames); - } - else{ - policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"); - } - - //policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"); - Map successMap = new HashMap(); - - //set the Rule Combining Algorithm Id to be sent to PAP-REST via JSON - List ruleAlgorithmsList = ruleAlgorithmsDao.getRuleAlgorithms(); - for (int i = 0; i < ruleAlgorithmsList.size(); i++) { - RuleAlgorithms a = ruleAlgorithmsList.get(i); - if (a.getXacmlId().equals(XACML3.ID_RULE_PERMIT_OVERRIDES.stringValue())) { - policyData.setRuleCombiningAlgId(a.getXacmlId()); - break; - } - } - - if(policyData.getAttributes().size() > 0){ - for(Object attribute : policyData.getAttributes()){ - if(attribute instanceof LinkedHashMap){ - String key = ((LinkedHashMap) attribute).get("option").toString(); - termCollectorList.add(key); - } - } - } - if(policyData.getFwattributes()!=null){ - if(policyData.getFwattributes().size() > 0){ - for(Object fwattribute : policyData.getFwattributes()){ - if(fwattribute instanceof LinkedHashMap){ - String key = ((LinkedHashMap) fwattribute).get("option").toString(); - FirewallDictionaryList fwDictValue = fwDictionaryListDao.getFWDictionaryDataById(key); - parentDictionaryList.add(fwDictValue); - if(fwDictValue.getAddressList().contains(",")) { - for(String individualAddressObject:fwDictValue.getAddressList().split(",") ){ - expandablePrefixIPList.add(individualAddressObject); - } - } - else{ - expandablePrefixIPList.add(fwDictValue.getAddressList()); - } - - if(fwDictValue.getServiceList().contains(",")) { - for(String individualAddressObject:fwDictValue.getServiceList().split(",") ){ - expandableServicesList.add(individualAddressObject); - } - } - else{ - expandableServicesList.add(fwDictValue.getServiceList()); - } - } - } - } - } - - jsonBody = constructJson(); - if (jsonBody != null || jsonBody.equalsIgnoreCase("")) { - policyAdapter.setJsonBody(jsonBody); - - } else { - policyAdapter.setJsonBody("{}"); - } - policyData.setJsonBody(jsonBody); - - - if (policyData.isEditPolicy()){ - //increment the version and set in policyAdapter - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - policyData.setPolicyID(this.newPolicyID()); - policyData.setRuleID(ruleID); - successMap = engine.updatePolicyRequest(policyData); - } else { - //send it for policy creation - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - successMap = engine.createPolicyRequest(policyData); - - } - - if (successMap.containsKey("success")) { - // Add it into our tree - Path finalPolicyPath = null; - finalPolicyPath = Paths.get(successMap.get("success")); - PolicyElasticSearchController controller = new PolicyElasticSearchController(); - controller.updateElk(finalPolicyPath.toString()); - File file = finalPolicyPath.toFile(); - if(file != null){ - String policyName = file.toString(); - String removePath = policyName.substring(policyName.indexOf("repository")+11); - String removeXml = removePath.replace(".xml", ""); - String removeExtension = removeXml.substring(0, removeXml.indexOf(".")); - List versionList = policyVersionDao.getPolicyVersionEntityByName(removeExtension); - if (versionList.size() > 0) { - for(int i = 0; i < versionList.size(); i++) { - PolicyVersion entityItem = versionList.get(i); - if(entityItem.getPolicyName().equals(removeExtension)){ - version = entityItem.getHigherVersion() +1; - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setModifiedBy(userId); - policyVersionDao.update(entityItem); - if(policyData.isEditPolicy){ - PolicyNotificationMail email = new PolicyNotificationMail(); - String mode = "EditPolicy"; - String policyNameForEmail = policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - email.sendMail(entityItem, policyNameForEmail, mode, policyNotificationDao); - } - } - } - }else{ - PolicyVersion entityItem = new PolicyVersion(); - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setPolicyName(removeExtension); - entityItem.setCreatedBy(userId); - entityItem.setModifiedBy(userId); - policyVersionDao.Save(entityItem); - } - removeExtension=removeExtension.replace(File.separator, "."); - //PC Feature - if(policyAdapter.getFwPolicyType().equalsIgnoreCase("Parent Policy")){ - //Reads the SecurityZone from the Parent UI and then gets the value from the DB - //Stores the Parent Policy Name and securityZone value to the fwparent table. - String parentSecurityZoneValue= getParentSecurityZone(); - String parentQuery= "INSERT INTO FWPARENT(PARENT,SECURITYZONE) VALUES ('"; - parentQuery=parentQuery+removeExtension+"','"+ parentSecurityZoneValue +"')"; - updateToDatabase(parentQuery); - } - else{ - String updateQuery = ""; - if(policyAdapter.isEditPolicy()){ - updateQuery= "UPDATE FWCHILDTOPARENT SET PARENT='"+policyAdapter.getParentForChild()+"' WHERE CHILD='"+removeExtension+"'"; - } - else{ - updateQuery= "INSERT INTO FWCHILDTOPARENT(CHILD,PARENT) VALUES ('"; - updateQuery =updateQuery+removeExtension+"','"+ policyAdapter.getParentForChild() +"')"; - } - updateToDatabase(updateQuery); - } - } - } - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(successMap); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - private String convertDate(String dateTTL) { - String formateDate = null; - String[] date = dateTTL.split("T"); - String[] parts = date[0].split("-"); - - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - return formateDate; - } - - private String constructJson() { - int ruleCount=1; - //Maps to assosciate the values read from the TermList dictionary - Map srcIP_map =null; - Map destIP_map=null; - Map srcPort_map =null; - Map destPort_map =null; - Map action_map=null; - Map fromZone_map=null; - Map toZone_map=null; - - String ruleDesc=null; - String ruleFromZone=null; - String ruleToZone=null; - String ruleSrcPrefixList=null; - String ruleDestPrefixList=null; - String ruleSrcPort=null; - String ruleDestPort=null; - String ruleAction=null; - - String json = null; - - - List expandableList = new ArrayList(); - TermList jpaTermList; - SecurityZone jpaSecurityZone; - List termList = new ArrayList(); - - ServiceListJson targetSl=null; - try{ - - for (int tl = 0 ; tl< termCollectorList.size(); tl++) { - expandableList.add(termCollectorList.get(tl)); - Term targetTerm = new Term(); - //targetSl= new ServiceListJson(); - targetTerm.setRuleName(termCollectorList.get(tl)); - List termListData = termListDao.getTermListData(); - for (int j =0; j < termListData.size(); j++) { - jpaTermList = termListData.get(j); - if (jpaTermList.getTermName().equals(termCollectorList.get(tl))){ - ruleDesc=jpaTermList.getTermDescription(); - if ((ruleDesc!=null)&& (!ruleDesc.isEmpty())){ - targetTerm.setDescription(ruleDesc); - } - ruleFromZone=jpaTermList.getFromZone(); - - if ((ruleFromZone != null) && (!ruleFromZone.isEmpty())){ - fromZone_map = new HashMap(); - fromZone_map.put(tl, ruleFromZone); - } - ruleToZone=jpaTermList.getToZone(); - - if ((ruleToZone != null) && (!ruleToZone.isEmpty())){ - toZone_map = new HashMap(); - toZone_map.put(tl, ruleToZone); - } - ruleSrcPrefixList=jpaTermList.getSrcIPList(); - - if ((ruleSrcPrefixList != null) && (!ruleSrcPrefixList.isEmpty())){ - srcIP_map = new HashMap(); - srcIP_map.put(tl, ruleSrcPrefixList); - } - - ruleDestPrefixList= jpaTermList.getDestIPList(); - if ((ruleDestPrefixList != null) && (!ruleDestPrefixList.isEmpty())){ - destIP_map = new HashMap(); - destIP_map.put(tl, ruleDestPrefixList); - } - - ruleSrcPort=jpaTermList.getSrcPortList(); - - if (ruleSrcPort != null && (!ruleSrcPort.isEmpty())){ - srcPort_map = new HashMap(); - srcPort_map.put(tl, ruleSrcPort); - } - - ruleDestPort= jpaTermList.getDestPortList(); - - if (ruleDestPort!= null && (!jpaTermList.getDestPortList().isEmpty())){ - destPort_map = new HashMap(); - destPort_map.put(tl, ruleDestPort); - } - - ruleAction=jpaTermList.getAction(); - - if (( ruleAction!= null) && (!ruleAction.isEmpty())){ - action_map = new HashMap(); - action_map.put(tl, ruleAction); - } - } - } - targetTerm.setEnabled(true); - targetTerm.setLog(true); - targetTerm.setNegateSource(false); - targetTerm.setNegateDestination(false); - - if(action_map!=null){ - targetTerm.setAction(action_map.get(tl)); - } - - //FromZone arrays - if(fromZone_map!=null){ - List fromZone= new ArrayList(); - for(String fromZoneStr:fromZone_map.get(tl).split(",") ){ - fromZone.add(fromZoneStr); - } - targetTerm.setFromZones(fromZone); - } - - //ToZone arrays - if(toZone_map!=null){ - List toZone= new ArrayList(); - for(String toZoneStr:toZone_map.get(tl).split(",") ){ - toZone.add(toZoneStr); - } - targetTerm.setToZones(toZone); - } - - //Destination Services. - if(destPort_map!=null){ - Set destServicesJsonList= new HashSet(); - for(String destServices:destPort_map.get(tl).split(",") ){ - ServicesJson destServicesJson= new ServicesJson(); - destServicesJson.setType("REFERENCE"); - if(destServices.equals("ANY")){ - destServicesJson.setName("any"); - destServicesJsonList.add(destServicesJson); - break; - }else{ - if(destServices.startsWith("Group_")){ - destServicesJson.setName(destServices.substring(6,destServices.length())); - } else{ - destServicesJson.setName(destServices); - } - destServicesJsonList.add(destServicesJson); - } - } - targetTerm.setDestServices(destServicesJsonList); - } - //ExpandableServicesList - if((srcPort_map!=null) && (destPort_map!=null)){ - String servicesCollateString = (srcPort_map.get(tl) + "," + destPort_map.get(tl)); - expandableServicesList.add(servicesCollateString); - }else if (srcPort_map!=null){ - expandableServicesList.add(srcPort_map.get(tl)); - }else if (destPort_map!=null){ - expandableServicesList.add(destPort_map.get(tl)); - } - - if(srcIP_map!=null){ - //Source List - List sourceListArrayJson= new ArrayList(); - for(String srcList:srcIP_map.get(tl).split(",") ){ - AddressJson srcListJson= new AddressJson(); - if(srcList.equals("ANY")){ - srcListJson.setType("any"); - sourceListArrayJson.add(srcListJson); - break; - }else{ - srcListJson.setType("REFERENCE"); - if(srcList.startsWith("Group_")){ - srcListJson.setValue(srcList.substring(6,srcList.length())); - }else{ - srcListJson.setValue(srcList); - } - sourceListArrayJson.add(srcListJson); - } - } - targetTerm.setSourceList(sourceListArrayJson); - } - if(destIP_map!=null){ - //Destination List - List destListArrayJson= new ArrayList(); - for(String destList:destIP_map.get(tl).split(",")){ - AddressJson destListJson= new AddressJson(); - if(destList.equals("ANY")){ - destListJson.setType("any"); - destListArrayJson.add(destListJson); - break; - }else{ - destListJson.setType("REFERENCE"); - if(destList.startsWith("Group_")){ - destListJson.setValue(destList.substring(6,destList.length())); - }else{ - destListJson.setValue(destList); - } - destListArrayJson.add(destListJson); - } - } - targetTerm.setDestinationList(destListArrayJson); - } - //ExpandablePrefixIPList - if ((srcIP_map!=null) && (destIP_map!=null)) - { - String collateString = (srcIP_map.get(tl) + "," + destIP_map - .get(tl)); - expandablePrefixIPList.add(collateString); - } - else if(srcIP_map!=null){ - expandablePrefixIPList.add(srcIP_map.get(tl)); - } - else if(destIP_map!=null){ - expandablePrefixIPList.add(destIP_map.get(tl)); - } - termList.add(targetTerm); - targetTerm.setPosition("" + (ruleCount++)); - } - TermCollector tc = new TermCollector(); - List securityZoneData = securityZoneDao.getSecurityZoneData(); - for (int j =0 ; j< securityZoneData.size() ; j++){ - jpaSecurityZone = securityZoneData.get(j); - if (jpaSecurityZone.getZoneName().equals(policyAdapter.getSecurityZone())){ - tc.setSecurityZoneId(jpaSecurityZone.getZoneValue()); - setParentSecurityZone(jpaSecurityZone.getZoneValue());//For storing the securityZone IDs to the DB - break; - } - } - - tc.setServiceTypeId("/v0/firewall/pan"); - tc.setConfigName(policyAdapter.getConfigName()); - - if(policyAdapter.getFwPolicyType().equalsIgnoreCase("Child Policy")){ - String securityZoneQuery="SELECT SECURITYZONE FROM FWPARENT WHERE PARENT='"; - securityZoneQuery=securityZoneQuery+policyAdapter.getParentForChild()+"'"; - List securityZoneValue= queryToDatabase(securityZoneQuery); - tc.setPrimaryParentZoneId(securityZoneValue.get(0)); - } - //Astra is rejecting the packet when it sees a new JSON field, so removing it for now. - //tc.setTemplateVersion(XACMLProperties.getProperty(XACMLRestProperties.TemplateVersion_FW)); - - DeployNowJson deployNow= new DeployNowJson(); - deployNow.setDeployNow(false); - - tc.setDeploymentOption(deployNow); - - Set servListArray = new HashSet(); - Set servGroupArray= new HashSet(); - Set addrGroupArray= new HashSet(); - - ServiceGroupJson targetSg= null; - AddressGroupJson addressSg=null; - ServiceListJson targetAny= null; - ServiceListJson targetAnyTcp=null; - ServiceListJson targetAnyUdp=null; - - for(String serviceList:expandableServicesList){ - for(String t: serviceList.split(",")){ - if((!t.startsWith("Group_"))){ - if(!t.equals("ANY")){ - ServiceList sl = new ServiceList(); - targetSl= new ServiceListJson(); - sl= mappingServiceList(t); - targetSl.setName(sl.getServiceName()); - targetSl.setDescription(sl.getServiceDescription()); - targetSl.setTransportProtocol(sl.getServiceTransProtocol()); - targetSl.setType(sl.getServiceType()); - targetSl.setPorts(sl.getServicePorts()); - servListArray.add(targetSl); - }else{ - //Any for destinationServices. - //Add names any, any-tcp, any-udp to the serviceGroup object. - targetAny= new ServiceListJson(); - targetAny.setName("any"); - targetAny.setType("SERVICE"); - targetAny.setTransportProtocol("any"); - targetAny.setPorts("any"); - - servListArray.add(targetAny); - - targetAnyTcp= new ServiceListJson(); - targetAnyTcp.setName("any-tcp"); - targetAnyTcp.setType("SERVICE"); - targetAnyTcp.setTransportProtocol("tcp"); - targetAnyTcp.setPorts("any"); - - servListArray.add(targetAnyTcp); - - targetAnyUdp= new ServiceListJson(); - targetAnyUdp.setName("any-udp"); - targetAnyUdp.setType("SERVICE"); - targetAnyUdp.setTransportProtocol("udp"); - targetAnyUdp.setPorts("any"); - - servListArray.add(targetAnyUdp); - } - }else{//This is a group - GroupServiceList sg= new GroupServiceList(); - targetSg= new ServiceGroupJson(); - sg= mappingServiceGroup(t); - - String name=sg.getGroupName(); - //Removing the "Group_" prepending string before packing the JSON - targetSg.setName(name.substring(6,name.length())); - List servMembersList= new ArrayList(); - - for(String groupString: sg.getServiceList().split(",")){ - ServiceMembers serviceMembers= new ServiceMembers(); - serviceMembers.setType("REFERENCE"); - serviceMembers.setName(groupString); - servMembersList.add(serviceMembers); - //Expand the group Name - ServiceList expandGroupSl = new ServiceList(); - targetSl= new ServiceListJson(); - expandGroupSl= mappingServiceList(groupString); - - targetSl.setName(expandGroupSl.getServiceName()); - targetSl.setDescription(expandGroupSl.getServiceDescription()); - targetSl.setTransportProtocol(expandGroupSl.getServiceTransProtocol()); - targetSl.setType(expandGroupSl.getServiceType()); - targetSl.setPorts(expandGroupSl.getServicePorts()); - servListArray.add(targetSl); - } - - targetSg.setMembers(servMembersList); - servGroupArray.add(targetSg); - - } - } - } - - Set prefixIPList = new HashSet(); - for(String prefixList:expandablePrefixIPList){ - for(String prefixIP: prefixList.split(",")){ - if((!prefixIP.startsWith("Group_"))){ - if(!prefixIP.equals("ANY")){ - List addMembersList= new ArrayList(); - List valueDesc= new ArrayList(); - PrefixIPList targetAddressList = new PrefixIPList(); - AddressMembers addressMembers= new AddressMembers(); - targetAddressList.setName(prefixIP); - - valueDesc = mapping(prefixIP); - targetAddressList.setDescription(valueDesc.get(1)); - - addressMembers.setType("SUBNET"); - addressMembers.setValue(valueDesc.get(0)); - - addMembersList.add(addressMembers); - - targetAddressList.setMembers(addMembersList); - prefixIPList.add(targetAddressList); - } - } - else{//This is a group - AddressGroup ag= new AddressGroup(); - addressSg= new AddressGroupJson(); - ag= mappingAddressGroup(prefixIP); - - String name=ag.getGroupName(); - //Removing the "Group_" prepending string before packing the JSON - addressSg.setName(name.substring(6,name.length())); - - List addrMembersList= new ArrayList(); - for(String groupString: ag.getPrefixList().split(",")){ - List valueDesc= new ArrayList(); - AddressMembers addressMembers= new AddressMembers(); - valueDesc= mapping (groupString); - if(valueDesc.size() > 0){ - addressMembers.setValue(valueDesc.get(0)); - } - addressMembers.setType("SUBNET"); - addrMembersList.add(addressMembers); - //Expand the group Name - } - addressSg.setMembers(addrMembersList); - addrGroupArray.add(addressSg); - } - - - } - } - - Set serviceGroup= new HashSet(); - - for(Object obj1:servGroupArray){ - serviceGroup.add(obj1); - } - - for(Object obj:servListArray){ - serviceGroup.add(obj); - } - - Set addressGroup= new HashSet(); - - for(Object addObj:prefixIPList){ - addressGroup.add(addObj); - } - - for(Object addObj1:addrGroupArray){ - addressGroup.add(addObj1); - } - - tc.setServiceGroups(serviceGroup); - tc.setAddressGroups(addressGroup); - tc.setFirewallRuleList(termList); - - - ObjectWriter om = new ObjectMapper().writer(); - try { - json = om.writeValueAsString(tc); - } catch (JsonGenerationException e) { - e.printStackTrace(); - } catch (JsonMappingException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - - }catch (Exception e) { - e.printStackTrace(); - } - - return json; - } - - private List mapping(String expandableList) { - String value = new String(); - String desc = new String(); - List valueDesc= new ArrayList(); - List prefixListData = prefixListDao.getPREFIXLISTData(); - for (int i = 0; i< prefixListData.size(); i++) { - PREFIXLIST prefixList = prefixListData.get(i); - if (prefixList.getPrefixListName().equals(expandableList)) { - value = prefixList.getPrefixListValue(); - valueDesc.add(value); - desc= prefixList.getDescription(); - valueDesc.add(desc); - break; - } - } - return valueDesc; - } - - private ServiceList mappingServiceList(String expandableList) { - ServiceList serviceList=null; - List serviceListData = serviceListDao.getServiceListData(); - for (int i = 0; i< serviceListData.size(); i++) { - serviceList = serviceListData.get(i); - if (serviceList.getServiceName().equals(expandableList)) { - break; - } - } - return serviceList; - } - - private GroupServiceList mappingServiceGroup(String expandableList) { - - GroupServiceList serviceGroup=null; - List serviceGroupData = serviceGroupDao.getGroupServiceListData(); - for (int i = 0; i< serviceGroupData.size(); i++) { - serviceGroup = serviceGroupData.get(i); - if (serviceGroup.getGroupName().equals(expandableList)) { - break; - } - } - return serviceGroup; - } - - private AddressGroup mappingAddressGroup(String expandableList) { - - AddressGroup addressGroup=null; - List addressGroupData = addressGroupDao.getAddressGroupData(); - for (int i = 0; i< addressGroupData.size(); i++) { - addressGroup = addressGroupData.get(i); - if (addressGroup.getGroupName().equals(expandableList)) { - break; - } - } - return addressGroup; - } - - public void PrePopulateFWPolicyData(PolicyAdapter policyAdapter) { - attributeList = new ArrayList(); - fwAttributeList = new ArrayList(); - if (policyAdapter.getPolicyData() instanceof PolicyType) { - Object policyData = policyAdapter.getPolicyData(); - PolicyType policy = (PolicyType) policyData; - // policy name value is the policy name without any prefix and Extensions. - policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName()); - String policyNameValue = policyAdapter.getPolicyName().substring(policyAdapter.getPolicyName().indexOf("FW_") +3, policyAdapter.getPolicyName().lastIndexOf(".")); - if (logger.isDebugEnabled()) { - logger.debug("Prepopulating form data for Config Policy selected:"+ policyAdapter.getPolicyName()); - } - policyAdapter.setPolicyName(policyNameValue); - String description = ""; - try{ - description = policy.getDescription().substring(0, policy.getDescription().indexOf("@CreatedBy:")); - }catch(Exception e){ - description = policy.getDescription(); - } - policyAdapter.setPolicyDescription(description); - - ObjectMapper mapper = new ObjectMapper(); - - TermCollector tc1=null; - BufferedReader br=null; - try { - //Json conversion. - String data=null; - SecurityZone jpaSecurityZone; - File file = new File(PolicyController.getConfigHome()+ File.separator+ policyAdapter.getDirPath().replace(File.separator, ".")+"."+ policyAdapter.getOldPolicyFileName() +".json"); - // Get data from this file using a file reader. - FileReader fr = new FileReader(file); - // To store the contents read via File Reader - br = new BufferedReader(fr); - // Read br and store a line in 'data', print data - data = br.readLine(); - tc1 = (TermCollector)mapper.readValue(data, TermCollector.class); - List securityZoneData = securityZoneDao.getSecurityZoneData(); - for (int i = 0; i < securityZoneData.size() ; i++) { - jpaSecurityZone = securityZoneData.get(i); - if (jpaSecurityZone.getZoneValue().equals(tc1.getSecurityZoneId())){ - policyAdapter.setSecurityZone(jpaSecurityZone.getZoneName()); - break; - } - } - if(tc1.getPrimaryParentZoneId()!=null)//Child policy - { - policyAdapter.setFwPolicyType("Child Policy"); - - String pathName=policyAdapter.getParentPath().toString(); - String scope= pathName.substring(pathName.lastIndexOf(File.separator)+1); - String fullPathName=scope+".Config_FW_"+policyNameValue; - - String query= "select parent from FWChildToParent where child='"; - query=query+fullPathName+"'"; - - List parentName=queryToDatabase(query); - policyAdapter.setParentForChild(parentName.get(0)); - - } - else{//Parent Policy - policyAdapter.setFwPolicyType("Parent Policy"); - //Retrieving the Dictionary combo list. - String desc = policy.getDescription(); - String descripComboList = desc.substring(desc.indexOf("@comboList:")+11,desc.length()) ; - Map parentMap = new HashMap(); - for(String value : descripComboList.split(",")){ - parentMap.put("option", value); - fwAttributeList.add(parentMap); - } - policyAdapter.setFwattributes(fwAttributeList); - } - } - catch(Exception e) { - logger.error("Exception Caused while Retriving the JSON body data" +e); - } - finally { - try { - if (br != null)br.close(); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - - for (Term t : tc1.getFirewallRuleList()) { - Map termMap = new HashMap(); - termMap.put("option", t.getRuleName()); - attributeList.add(termMap); - } - policyAdapter.setAttributes(attributeList); - // Get the target data under policy. - TargetType target = policy.getTarget(); - if (target != null) { - // Under target we have AnyOFType - List anyOfList = target.getAnyOf(); - if (anyOfList != null) { - int index = 0; - Iterator iterAnyOf = anyOfList.iterator(); - while (iterAnyOf.hasNext()) { - AnyOfType anyOf = iterAnyOf.next(); - // Under AnyOFType we have AllOFType - List allOfList = anyOf.getAllOf(); - if (allOfList != null) { - Iterator iterAllOf = allOfList.iterator(); - while (iterAllOf.hasNext()) { - AllOfType allOf = iterAllOf.next(); - // Under AllOFType we have Match - List matchList = allOf.getMatch(); - if (matchList != null) { - - Iterator iterMatch = matchList.iterator(); - while (iterMatch.hasNext()) { - MatchType match = iterMatch.next(); - // - // Under the match we have attribute value and - // attributeDesignator. So,finally down to the actual attribute. - // - AttributeValueType attributeValue = match.getAttributeValue(); - String value = (String) attributeValue.getContent().get(0); - if (index == 1) { - policyAdapter.setConfigName(value); - } - if (index == 2){ - policyAdapter.setRiskType(value); - } - - if (index == 3){ - policyAdapter.setRiskLevel(value); - } - - if (index == 4){ - policyAdapter.setGuard(value); - } - if (index == 5 && !value.contains("NA")){ - String newDate = convertDate(value, true); - policyAdapter.setTtlDate(newDate); - } - index++; - } - } - } - } - } - } - } - } - } - - private String convertDate(String dateTTL, boolean portalType) { - String formateDate = null; - String[] date; - String[] parts; - - if (portalType){ - parts = dateTTL.split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z"; - } else { - date = dateTTL.split("T"); - parts = date[0].split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - } - return formateDate; - } - - @RequestMapping(value={"/policyController/ViewFWPolicyRule.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView setFWViewRule(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - termCollectorList = new ArrayList(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").toString(), PolicyAdapter.class); - if(policyData.getAttributes().size() > 0){ - for(Object attribute : policyData.getAttributes()){ - if(attribute instanceof LinkedHashMap){ - String key = ((LinkedHashMap) attribute).get("option").toString(); - termCollectorList.add(key); - } - } - } - TermList jpaTermList; - String ruleSrcList=null; - String ruleDestList=null; - String ruleSrcPort=null; - String ruleDestPort=null; - String ruleAction=null; - List valueDesc= new ArrayList(); - StringBuffer displayString = new StringBuffer(); - for (String id : termCollectorList) { - jpaTermList = termListDao.getTermListValueByName(id); - if (jpaTermList != null){ - ruleSrcList= ((TermList) jpaTermList).getSrcIPList(); - if ((ruleSrcList!= null) && (!ruleSrcList.isEmpty()) && !ruleSrcList.equals("null")){ - displayString.append("Source IP List: " + ((TermList) jpaTermList).getSrcIPList()); - displayString.append(" ; \t\n"); - for(String srcList:ruleSrcList.split(",")){ - if(srcList.startsWith("Group_")){ - AddressGroup ag= new AddressGroup(); - ag= mappingAddressGroup(srcList); - displayString.append("\n\t"+"Group has :"+ag.getPrefixList()+"\n"); - for(String groupItems:ag.getPrefixList().split(",")){ - valueDesc=mapping(groupItems); - displayString.append("\n\t"+"Name: "+groupItems); - if(!valueDesc.isEmpty()){ - displayString.append("\n\t"+"Description: "+valueDesc.get(1)); - displayString.append("\n\t"+"Value: "+valueDesc.get(0)); - } - displayString.append("\n"); - } - }else{ - if(!srcList.equals("ANY")){ - valueDesc=mapping(srcList); - displayString.append("\n\t"+"Name: "+srcList); - displayString.append("\n\t"+"Description: "+valueDesc.get(1)); - displayString.append("\n\t"+"Value: "+valueDesc.get(0)); - displayString.append("\n"); - } - } - } - displayString.append("\n"); - } - ruleDestList= ((TermList) jpaTermList).getDestIPList(); - if ( ruleDestList!= null && (!ruleDestList.isEmpty())&& !ruleDestList.equals("null")){ - displayString.append("Destination IP List: " + ((TermList) jpaTermList).getDestIPList()); - displayString.append(" ; \t\n"); - for(String destList:ruleDestList.split(",")){ - if(destList.startsWith("Group_")){ - AddressGroup ag= new AddressGroup(); - ag= mappingAddressGroup(destList); - displayString.append("\n\t"+"Group has :"+ag.getPrefixList()+"\n"); - for(String groupItems:ag.getPrefixList().split(",")){ - valueDesc=mapping(groupItems); - displayString.append("\n\t"+"Name: "+groupItems); - displayString.append("\n\t"+"Description: "+valueDesc.get(1)); - displayString.append("\n\t"+"Value: "+valueDesc.get(0)); - displayString.append("\n\t"); - } - }else{ - if(!destList.equals("ANY")){ - valueDesc=mapping(destList); - displayString.append("\n\t"+"Name: "+destList); - displayString.append("\n\t"+"Description: "+valueDesc.get(1)); - displayString.append("\n\t"+"Value: "+valueDesc.get(0)); - displayString.append("\n\t"); - } - } - } - displayString.append("\n"); - } - - ruleSrcPort=((TermList) jpaTermList).getSrcPortList(); - if ( ruleSrcPort!= null && (!ruleSrcPort.isEmpty())&& !ruleSrcPort.equals("null")) { - displayString.append("\n"+"Source Port List:" - + ruleSrcPort); - displayString.append(" ; \t\n"); - } - - ruleDestPort= ((TermList) jpaTermList).getDestPortList(); - if (ruleDestPort != null && (!ruleDestPort.isEmpty())&& !ruleDestPort.equals("null")) { - displayString.append("\n"+"Destination Port List:" - + ruleDestPort); - displayString.append(" ; \t\n"); - for(String destServices:ruleDestPort.split(",")){ - if(destServices.startsWith("Group_")){ - GroupServiceList sg= new GroupServiceList(); - sg= mappingServiceGroup(destServices); - displayString.append("\n\t"+"Service Group has :"+sg.getServiceList()+"\n"); - for(String groupItems:sg.getServiceList().split(",")){ - ServiceList sl= new ServiceList(); - sl= mappingServiceList(groupItems); - displayString.append("\n\t"+"Name: "+ - sl.getServiceName()); - displayString.append("\n\t"+"Description: "+ - sl.getServiceDescription()); - displayString.append("\n\t"+"Transport-Protocol: "+ - sl.getServiceTransProtocol()); - displayString.append("\n\t"+"Ports: "+ - sl.getServicePorts()); - displayString.append("\n"); - } - } - else{ - if(!destServices.equals("ANY")){ - ServiceList sl= new ServiceList(); - sl= mappingServiceList(destServices); - displayString.append("\n\t"+"Name: "+ - sl.getServiceName()); - displayString.append("\n\t"+"Description: "+ - sl.getServiceDescription()); - displayString.append("\n\t"+"Transport-Protocol: "+ - sl.getServiceTransProtocol()); - displayString.append("\n\t"+"Ports: "+ - sl.getServicePorts()); - displayString.append("\n"); - } - } - } - displayString.append("\n"); - } - - ruleAction=(jpaTermList).getAction(); - if ( ruleAction!= null && (!ruleAction.isEmpty())) { - displayString.append("\n"+"Action List:" - + ruleAction); - displayString.append(" ; \t\n"); - } - } - } - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(displayString); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e); - } - return null; - } - - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreatePolicyController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreatePolicyController.java deleted file mode 100644 index f5c0a576c..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/CreatePolicyController.java +++ /dev/null @@ -1,484 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.json.JSONObject; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.admin.PolicyNotificationMail; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.dao.RuleAlgorithmsDao; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.elk.client.PolicyElasticSearchController; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.RuleAlgorithms; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -import com.att.research.xacml.api.XACML3; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Joiner; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeDesignatorType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; - -@Controller -@RequestMapping("/") -public class CreatePolicyController extends RestrictedBaseController{ - private static Logger logger = FlexLogger.getLogger(CreatePolicyController.class); - - private static RuleAlgorithmsDao ruleAlgorithmsDao; - private static PolicyVersionDao policyVersionDao; - private static WatchPolicyNotificationDao policyNotificationDao; - - @Autowired - private CreatePolicyController(RuleAlgorithmsDao ruleAlgorithmsDao, PolicyVersionDao policyVersionDao, WatchPolicyNotificationDao policyNotificationDao){ - CreatePolicyController.policyVersionDao = policyVersionDao; - CreatePolicyController.ruleAlgorithmsDao = ruleAlgorithmsDao; - CreatePolicyController.policyNotificationDao = policyNotificationDao; - } - - public CreatePolicyController(){} - - protected PolicyAdapter policyAdapter = null; - private String ruleID = ""; - private ArrayList attributeList; - boolean isValidForm = false; - private int riskLevelCount; - - public String newPolicyID() { - return Joiner.on(':').skipNulls().join((PolicyController.getDomain().startsWith("urn") ? null: "urn"), - PolicyController.getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID()); - } - - @RequestMapping(value={"/get_RiskLevelValues"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getRiskLevelValuesData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - List riskLevelList = new ArrayList(); - riskLevelCount = 5; - for (int i = 1; i <= riskLevelCount; i++) { - riskLevelList.add(String.valueOf(i)); - } - model.put("riskLevelDatas", mapper.writeValueAsString(riskLevelList)); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - @RequestMapping(value={"/get_GuardlValues"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getGuardValuesData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - List guardList = new ArrayList(); - guardList.add("True"); - guardList.add("False"); - model.put("guardDatas", mapper.writeValueAsString(guardList)); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - - @RequestMapping(value={"/policyController/save_policy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView savePolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - String userId = UserUtils.getUserIdFromCookie(request); - RESTfulPAPEngine engine = (RESTfulPAPEngine) PolicyController.getPapEngine(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").get("policy").toString(), PolicyAdapter.class); - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - if(root.get("policyData").get("model").get("type").toString().replace("\"", "").equals("file")){ - policyData.isEditPolicy = true; - } - - if (policyData.getTtlDate()==null){ - policyData.setTtlDate("NA"); - }else{ - String dateTTL = policyData.getTtlDate(); - String newDate = convertDate(dateTTL, false); - policyData.setTtlDate(newDate); - } - - if(root.get("policyData").get("model").get("path").size() != 0){ - String dirName = ""; - for(int i = 0; i < root.get("policyData").get("model").get("path").size(); i++){ - dirName = dirName.replace("\"", "") + root.get("policyData").get("model").get("path").get(i).toString().replace("\"", "") + File.separator; - } - policyData.setDomainDir(dirName.substring(0, dirName.lastIndexOf(File.separator))); - }else{ - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - } - - int version = 0; - int highestVersion = 0; - int descriptionVersion = 0; - //get the highest version of policy from policy version table. - //getting the sub scope domain where the policy is created or updated - String dbCheckPolicyName = policyData.getDomainDir() + File.separator + "Config_" + policyData.getPolicyName(); - List policyVersionlist = policyVersionDao.getPolicyVersionEntityByName(dbCheckPolicyName); - if (policyVersionlist.size() > 0) { - for(int i = 0; i < policyVersionlist.size(); i++) { - PolicyVersion entityItem = policyVersionlist.get(i); - if(entityItem.getPolicyName().equals(dbCheckPolicyName)){ - highestVersion = entityItem.getHigherVersion(); - } - } - } - if(highestVersion != 0){ - version = highestVersion; - descriptionVersion = highestVersion +1; - }else{ - version = 1; - descriptionVersion = 1; - } - - //set policy adapter values for Building JSON object containing policy data - String createdBy = ""; - String modifiedBy = userId; - if(descriptionVersion == 1){ - createdBy = userId; - }else{ - String policyName = PolicyController.getGitPath().toAbsolutePath().toString() + File.separator + policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - File policyPath = new File(policyName); - try { - createdBy = XACMLPolicyScanner.getCreatedBy(policyPath.toPath()); - } catch (IOException e) { - createdBy = "guest"; - } - } - - policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"); - - Map successMap = new HashMap(); - Map attributeMap = new HashMap(); - //set the Rule Combining Algorithm Id to be sent to PAP-REST via JSON - List ruleAlgorithmList = ruleAlgorithmsDao.getRuleAlgorithms(); - for (int i = 0; i < ruleAlgorithmList.size(); i++) { - RuleAlgorithms a = ruleAlgorithmList.get(i); - if (a.getXacmlId().equals(XACML3.ID_RULE_PERMIT_OVERRIDES.stringValue())) { - policyData.setRuleCombiningAlgId(a.getXacmlId()); - break; - } - } - - if(policyData.getAttributes().size() > 0){ - for(Object attribute : policyData.getAttributes()){ - if(attribute instanceof LinkedHashMap){ - String key = ((LinkedHashMap) attribute).get("option").toString(); - String value = ((LinkedHashMap) attribute).get("number").toString(); - attributeMap.put(key, value); - } - } - } - policyData.setDynamicFieldConfigAttributes(attributeMap); - - if (policyData.isEditPolicy()){ - //increment the version and set in policyAdapter - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - policyData.setPolicyID(this.newPolicyID()); - policyData.setRuleID(ruleID); - successMap = engine.updatePolicyRequest(policyData); - } else { - //send it for policy creation - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - successMap = engine.createPolicyRequest(policyData); - - } - - if (successMap.containsKey("success")) { - // Add it into our tree - Path finalPolicyPath = null; - finalPolicyPath = Paths.get(successMap.get("success")); - PolicyElasticSearchController controller = new PolicyElasticSearchController(); - controller.updateElk(finalPolicyPath.toString()); - File file = finalPolicyPath.toFile(); - if(file != null){ - String policyName = file.toString(); - String removePath = policyName.substring(policyName.indexOf("repository")+11); - String removeXml = removePath.replace(".xml", ""); - String removeExtension = removeXml.substring(0, removeXml.indexOf(".")); - List versionList = policyVersionDao.getPolicyVersionEntityByName(removeExtension); - if (versionList.size() > 0) { - for(int i = 0; i < versionList.size(); i++) { - PolicyVersion entityItem = versionList.get(i); - if(entityItem.getPolicyName().equals(removeExtension)){ - version = entityItem.getHigherVersion() +1; - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setModifiedBy(userId); - policyVersionDao.update(entityItem); - if(policyData.isEditPolicy){ - PolicyNotificationMail email = new PolicyNotificationMail(); - String mode = "EditPolicy"; - String policyNameForEmail = policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - email.sendMail(entityItem, policyNameForEmail, mode, policyNotificationDao); - } - } - } - }else{ - PolicyVersion entityItem = new PolicyVersion(); - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setPolicyName(removeExtension); - entityItem.setCreatedBy(userId); - entityItem.setModifiedBy(userId); - policyVersionDao.Save(entityItem); - } - } - } - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(successMap); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - private String convertDate(String dateTTL, boolean portalType) { - String formateDate = null; - String[] date; - String[] parts; - - if (portalType){ - parts = dateTTL.split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0] + "T05:00:00.000Z"; - } else { - date = dateTTL.split("T"); - parts = date[0].split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - } - return formateDate; - } - - public void PrePopulateBaseConfigPolicyData(PolicyAdapter policyAdapter) { - attributeList = new ArrayList(); - if (policyAdapter.getPolicyData() instanceof PolicyType) { - Object policyData = policyAdapter.getPolicyData(); - PolicyType policy = (PolicyType) policyData; - policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName()); - policyAdapter.setConfigBodyData(readBaseConfigJSONFile(policyAdapter)); - String policyNameValue = policyAdapter.getPolicyName().substring(policyAdapter.getPolicyName().indexOf("_") + 1 , policyAdapter.getPolicyName().lastIndexOf(".")); - policyAdapter.setPolicyName(policyNameValue); - String description = ""; - try{ - description = policy.getDescription().substring(0, policy.getDescription().indexOf("@CreatedBy:")); - }catch(Exception e){ - description = policy.getDescription(); - } - policyAdapter.setPolicyDescription(description); - // Get the target data under policy. - TargetType target = policy.getTarget(); - if (target != null) { - // Under target we have AnyOFType - List anyOfList = target.getAnyOf(); - if (anyOfList != null) { - Iterator iterAnyOf = anyOfList.iterator(); - while (iterAnyOf.hasNext()) { - AnyOfType anyOf = iterAnyOf.next(); - // Under AnyOFType we have AllOFType - List allOfList = anyOf.getAllOf(); - if (allOfList != null) { - Iterator iterAllOf = allOfList.iterator(); - int index = 0; - while (iterAllOf.hasNext()) { - AllOfType allOf = iterAllOf.next(); - // Under AllOFType we have Match - List matchList = allOf.getMatch(); - if (matchList != null) { - Iterator iterMatch = matchList.iterator(); - while (iterMatch.hasNext()) { - MatchType match = iterMatch.next(); - // - // Under the match we have attributevalue and - // attributeDesignator. So,finally down to the actual attribute. - // - AttributeValueType attributeValue = match.getAttributeValue(); - String value = (String) attributeValue.getContent().get(0); - AttributeDesignatorType designator = match.getAttributeDesignator(); - String attributeId = designator.getAttributeId(); - // First match in the target is EcompName, so set that value. - if (index == 1) { - policyAdapter.setEcompName(value); - } - if (index == 2){ - policyAdapter.setRiskType(value); - } - - if (index == 3){ - policyAdapter.setRiskLevel(value); - } - - if (index == 4){ - policyAdapter.setGuard(value); - } - if (index == 5 && !value.contains("NA")){ - String newDate = convertDate(value, true); - policyAdapter.setTtlDate(newDate); - } - if (index == 6){ - policyAdapter.setConfigName(value); - } - // After Ecomp and Config it is optional to have attributes, so - // check weather dynamic values or there or not. - if (index >= 7) { - Map attribute = new HashMap(); - attribute.put("option", attributeId); - attribute.put("number", value); - attributeList.add(attribute); - } - index++; - } - } - } - } - } - } - - policyAdapter.setAttributes(attributeList); - } - List ruleList = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition(); - for (Object o : ruleList) { - if (o instanceof RuleType) { - // get the condition data under the rule for rule Algorithms. - policyAdapter.setRuleID(((RuleType) o).getRuleId()); - } - } - } - } - - private String readBaseConfigJSONFile(PolicyAdapter policyAdapter) { - String fileName = policyAdapter.getPolicyName(); - String fileLocation = null; - if (fileName != null && fileName.contains("Config")) { - fileLocation = PolicyController.getConfigHome(); - } - if (logger.isDebugEnabled()) { - logger.debug("Attempting to read file from the location: " + fileLocation); - } - - if (fileLocation == null) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Error with the FileName: " + fileName); - return fileLocation; - } - - - File dir = new File(fileLocation); - File[] listOfFiles = dir.listFiles(); - String extension = null; - for (File file : listOfFiles) { - if (file.isFile() && file.getName().contains(fileName)) { - // For config form we have set the ConfigType Based on the extention. - if (fileName.contains("Config")) { - extension = file.getName().substring(file.getName().lastIndexOf('.') + 1); - // Based on file type set Combobox config value - if (extension.equals("txt")) { - policyAdapter.setConfigType("OTHER"); - } else { - policyAdapter.setConfigType(extension.toUpperCase()); - } - } - // Reading the file - try (BufferedReader br = new BufferedReader(new FileReader(file))) { - StringBuilder sb = new StringBuilder(); - String line = br.readLine(); - while (line != null) { - sb.append(line); - sb.append("\n"); - line = br.readLine(); - } - return sb.toString(); - } catch (FileNotFoundException e) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + e.getMessage()); - } catch (IOException e1) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + e1.getMessage()); - } - } - } - return null; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/DashboardController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/DashboardController.java deleted file mode 100644 index 301c824f0..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/DashboardController.java +++ /dev/null @@ -1,430 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.management.AttributeNotFoundException; -import javax.management.InstanceNotFoundException; -import javax.management.MBeanException; -import javax.management.MalformedObjectNameException; -import javax.management.ObjectName; -import javax.management.ReflectionException; -import javax.management.remote.JMXConnector; -import javax.management.remote.JMXConnectorFactory; -import javax.management.remote.JMXServiceURL; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.json.JSONObject; -import org.openecomp.policy.dao.SystemLogDbDao; -import org.openecomp.policy.model.PDPGroupContainer; -import org.openecomp.policy.rest.XACMLRestProperties; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; -import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.api.pap.EcompPDP; -import org.openecomp.policy.xacml.api.pap.EcompPDPGroup; - -import com.att.research.xacml.api.pap.PAPException; -import com.att.research.xacml.api.pap.PDP; -import com.att.research.xacml.api.pap.PDPGroup; -import com.att.research.xacml.api.pap.PDPPolicy; -import com.att.research.xacml.util.XACMLProperties; -import com.fasterxml.jackson.annotation.PropertyAccessor; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Controller -@RequestMapping({"/"}) -public class DashboardController extends RestrictedBaseController{ - private static final Logger logger = FlexLogger.getLogger(DashboardController.class); - @Autowired - SystemLogDbDao systemDAO; - - private int pdpCount; - private PDPGroupContainer pdpConatiner; - private ArrayList pdpStatusData; - private ArrayList papStatusData; - private ArrayList policyActivityData; - - - - @RequestMapping(value={"/get_DashboardLoggingData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - model.put("availableLoggingDatas", mapper.writeValueAsString(systemDAO.getLoggingData())); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - @RequestMapping(value={"/get_DashboardSystemAlertData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getSystemAlertData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - model.put("systemAlertsTableDatas", mapper.writeValueAsString(systemDAO.getSystemAlertData())); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - @RequestMapping(value={"/get_DashboardPAPStatusData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getPAPStatusData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - mapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY); - addPAPToTable(); - model.put("papTableDatas", mapper.writeValueAsString(papStatusData)); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - @RequestMapping(value={"/get_DashboardPDPStatusData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getPDPStatusData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - mapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY); - this.pdpConatiner = new PDPGroupContainer(PolicyController.getPapEngine()); - addPDPToTable(); - model.put("pdpTableDatas", mapper.writeValueAsString(pdpStatusData)); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - @RequestMapping(value={"/get_DashboardPolicyActivityData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getPolicyActivityData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - mapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY); - this.pdpConatiner = new PDPGroupContainer(PolicyController.getPapEngine()); - addPolicyToTable(); - model.put("policyActivityTableDatas", mapper.writeValueAsString(policyActivityData)); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - /* - * Add the PAP information to the PAP Table - */ - public void addPAPToTable(){ - papStatusData = new ArrayList(); - File folder = new File(PolicyController.getGitPath().toAbsolutePath().toString()); - String papStatus = null; - try { - Set groups = PolicyController.getPapEngine().getEcompPDPGroups(); - if (groups == null) { - papStatus = "UNKNOWN"; - throw new PAPException("PAP not running"); - }else { - papStatus = "IS_OK"; - } - } catch (PAPException | NullPointerException e1) { - papStatus = "CANNOT_CONNECT"; - logger.error("Error getting PAP status, PAP not responding to requests"); - } - String papURL = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL); - JSONObject object = new JSONObject(); - object.put("system", papURL); - object.put("status", papStatus); - object.put("noOfPolicy", countFilesInDirectory(folder)); - object.put("noOfConnectedTrap", pdpCount); - papStatusData.add(0, object); - } - - private int countFilesInDirectory(File directory) { - int count = 0; - for (File file : directory.listFiles()) { - if (file.isFile() && file.getName().endsWith(".xml")) { - count++; - } - if (file.isDirectory()) { - count += countFilesInDirectory(file); - } - } - return count; - } - /** - * Add PDP Information to the PDP Table - * - */ - public void addPDPToTable(){ - pdpCount = 0; - pdpStatusData = new ArrayList(); - long naCount; - long denyCount = 0; - long permitCount = 0; - for (PDPGroup group : this.pdpConatiner.getGroups()){ - for (PDP pdp : group.getPdps()){ - naCount = -1; - if (pdp.getStatus().getStatus().toString() == "UP_TO_DATE" && ((EcompPDP) pdp).getJmxPort() != 0){ - String pdpIpAddress = parseIPSystem(pdp.getId()); - int port = ((EcompPDP) pdp).getJmxPort(); - if (port != 0) - logger.debug("Getting JMX Response Counts from " + pdpIpAddress + " at JMX port " + port); - naCount = getRequestCounts(pdpIpAddress, port, "pdpEvaluationNA"); - permitCount = getRequestCounts(pdpIpAddress, port, "PdpEvaluationPermit"); - denyCount = getRequestCounts(pdpIpAddress, port, "PdpEvaluationDeny"); - } - if (naCount == -1){ - JSONObject object = new JSONObject(); - object.put("id", pdp.getId()); - object.put("name", pdp.getName()); - object.put("groupname", group.getName()); - object.put("status", pdp.getStatus().getStatus().toString()); - object.put("description", pdp.getDescription()); - object.put("permitCount", "NA"); - object.put("denyCount", "NA"); - object.put("naCount", "NA"); - pdpStatusData.add(object); - }else{ - JSONObject object = new JSONObject(); - object.put("id", pdp.getId()); - object.put("name", pdp.getName()); - object.put("groupname", group.getName()); - object.put("status", pdp.getStatus().getStatus().toString()); - object.put("description", pdp.getDescription()); - object.put("permitCount", permitCount); - object.put("denyCount", denyCount); - object.put("naCount", naCount); - pdpStatusData.add(object); - } - pdpCount++; - } - } - } - - private static String parseIPSystem(String line) { - Pattern pattern = Pattern.compile("://(.+?):"); - Matcher ip = pattern.matcher(line); - if (ip.find()) - { - return ip.group(1); - } - return null; - } - - /* - * Contact JMX Connector Sever and return the value of the given jmxAttribute - */ - @SuppressWarnings("rawtypes") - private long getRequestCounts(String host, int port, String jmxAttribute) { - - logger.debug("Create an RMI connector client and connect it to the JMX connector server"); - HashMap map = new HashMap(); - map = null; - JMXConnector jmxConnection; - try { - jmxConnection = JMXConnectorFactory.newJMXConnector(createConnectionURL(host, port), map); - jmxConnection.connect(); - Object o = jmxConnection.getMBeanServerConnection().getAttribute(new ObjectName("PdpRest:type=PdpRestMonitor"), jmxAttribute); - jmxConnection.close(); - logger.debug("pdpEvaluationNA value retreived: " + o); - return (long) o; - } catch (MalformedURLException e) { - logger.error("MalformedURLException for JMX connection"); - } catch (IOException e) { - logger.error("Error in reteriving" + jmxAttribute + " from JMX connection"); - } catch (AttributeNotFoundException e) { - logger.error("AttributeNotFoundException " + jmxAttribute + " for JMX connection"); - } catch (InstanceNotFoundException e) { - logger.error("InstanceNotFoundException " + host + " for JMX connection"); - } catch (MalformedObjectNameException e) { - logger.error("MalformedObjectNameException for JMX connection"); - } catch (MBeanException e) { - logger.error("MBeanException for JMX connection"); - e.printStackTrace(); - } catch (ReflectionException e) { - logger.error("ReflectionException for JMX connection"); - } - - return -1; - } - - private static JMXServiceURL createConnectionURL(String host, int port) throws MalformedURLException{ - return new JMXServiceURL("rmi", "", 0, "/jndi/rmi://" + host + ":" + port + "/jmxrmi"); - } - - - /* - * Add the information to the Policy Table - */ - private void addPolicyToTable() { - policyActivityData = new ArrayList(); - int i = 1; - String policyID = null; - int policyFireCount = 0; - Map policyMap = new HashMap<>(); - Object policyList = null; - //get list of policy - - for (PDPGroup group : this.pdpConatiner.getGroups()){ - for (PDPPolicy policy : group.getPolicies()){ - try{ - policyMap.put(policy.getPolicyId().replace(" ", ""), policy.getId()); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_SCHEMA_INVALID+policy.getName() +e); - } - } - - for (PDP pdp : group.getPdps()){ - // Add rows to the Policy Table - policyList = null; - if (pdp.getStatus().getStatus().toString() == "UP_TO_DATE" && ((EcompPDP) pdp).getJmxPort() != 0){ - String pdpIpAddress = parseIPSystem(pdp.getId()); - policyList = getPolicy(pdpIpAddress, ((EcompPDP) pdp).getJmxPort(), "policyCount"); - } - if (policyList != null && policyList.toString().length() > 3){ - String[] splitPolicy = policyList.toString().split(","); - for (String policyKeyValue : splitPolicy){ - policyID = urnPolicyID(policyKeyValue); - policyFireCount = countPolicyID(policyKeyValue); - if (policyID != null ){ - if (policyMap.containsKey(policyID)){ - JSONObject object = new JSONObject(); - object.put("policyId", policyMap.get(policyID)); - object.put("fireCount", policyFireCount); - object.put("system", pdp.getId()); - policyActivityData.add(i, object); - i++; - } - } - } - }else { - if (policyList != null){ - JSONObject object = new JSONObject(); - object.put("policyId", "Unable to retrieve policy information"); - object.put("fireCount", "NA"); - object.put("system", pdp.getId()); - policyActivityData.add(i, object); - i++; - }else{ - JSONObject object = new JSONObject(); - object.put("policyId", "Unable to access PDP JMX Server"); - object.put("fireCount", "NA"); - object.put("system", pdp.getId()); - policyActivityData.add(i, object); - i++; - } - } - - } - } - } - - /* - * Contact JMX Connector Sever and return the list of {policy id , count} - */ - @SuppressWarnings("rawtypes") - private Object getPolicy(String host, int port, String jmxAttribute){ - logger.debug("Create an RMI connector client and connect it to the JMX connector server for Policy: " + host); - HashMap map = new HashMap(); - map = null; - JMXConnector jmxConnection; - try { - jmxConnection = JMXConnectorFactory.newJMXConnector(createConnectionURL(host, port), map); - jmxConnection.connect(); - Object o = jmxConnection.getMBeanServerConnection().getAttribute(new ObjectName("PdpRest:type=PdpRestMonitor"), "policyMap"); - jmxConnection.close(); - logger.debug("policyMap value retreived: " + o); - return o; - } catch (MalformedURLException e) { - logger.error("MalformedURLException for JMX connection"); - } catch (IOException e) { - logger.error("AttributeNotFoundException for policyMap" ); - } catch (AttributeNotFoundException e) { - logger.error("AttributeNotFoundException for JMX connection"); - } catch (InstanceNotFoundException e) { - logger.error("InstanceNotFoundException " + host + " for JMX connection"); - } catch (MalformedObjectNameException e) { - logger.error("MalformedObjectNameException for JMX connection"); - } catch (MBeanException e) { - logger.error("MBeanException for JMX connection"); - e.printStackTrace(); - } catch (ReflectionException e) { - logger.error("ReflectionException for JMX connection"); - } - - return null; - - } - - private static String urnPolicyID(String line){ - String[] splitLine = line.toString().split("="); - String removeSpaces = splitLine[0].replaceAll("\\s+", ""); - return removeSpaces.replace("{", ""); - } - - private static Integer countPolicyID(String line){ - String[] splitLine = line.toString().split("="); - String sCount = splitLine[1].replace("}", ""); - int intCount = Integer.parseInt(sCount); - return intCount; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/DecisionPolicyController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/DecisionPolicyController.java deleted file mode 100644 index 20cde7f43..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/DecisionPolicyController.java +++ /dev/null @@ -1,507 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.JAXBElement; - -import org.json.JSONObject; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.admin.PolicyNotificationMail; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.dao.RuleAlgorithmsDao; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.elk.client.PolicyElasticSearchController; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.RuleAlgorithms; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -import com.att.research.xacml.api.XACML3; -import org.openecomp.policy.xacml.util.XACMLPolicyScanner; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Joiner; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeDesignatorType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ConditionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.EffectType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.VariableDefinitionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.VariableReferenceType; - -@Controller -@RequestMapping("/") -public class DecisionPolicyController extends RestrictedBaseController { - private static final Logger logger = FlexLogger.getLogger(DecisionPolicyController.class); - - private static RuleAlgorithmsDao ruleAlgorithmsDao; - private static PolicyVersionDao policyVersionDao; - private static WatchPolicyNotificationDao policyNotificationDao; - - @Autowired - private DecisionPolicyController(RuleAlgorithmsDao ruleAlgorithmsDao, PolicyVersionDao policyVersionDao, WatchPolicyNotificationDao policyNotificationDao){ - DecisionPolicyController.policyVersionDao = policyVersionDao; - DecisionPolicyController.ruleAlgorithmsDao = ruleAlgorithmsDao; - DecisionPolicyController.policyNotificationDao = policyNotificationDao; - } - - public DecisionPolicyController(){} - - protected PolicyAdapter policyAdapter = null; - private static String ruleID = ""; - private ArrayList attributeList; - private ArrayList decisionList; - private ArrayList ruleAlgorithmList; - protected LinkedList ruleAlgoirthmTracker; - public static final String FUNCTION_NOT = "urn:oasis:names:tc:xacml:1.0:function:not"; - - public String newPolicyID() { - return Joiner.on(':').skipNulls().join((PolicyController.getDomain().startsWith("urn") ? null: "urn"), - PolicyController.getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID()); - } - - @RequestMapping(value={"/policyController/save_DecisionPolicy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveDecisionPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - String userId = UserUtils.getUserIdFromCookie(request); - RESTfulPAPEngine engine = (RESTfulPAPEngine) PolicyController.getPapEngine(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").get("policy").toString(), PolicyAdapter.class); - if(root.get("policyData").get("model").get("type").toString().replace("\"", "").equals("file")){ - policyData.isEditPolicy = true; - } - if(root.get("policyData").get("model").get("path").size() != 0){ - String dirName = ""; - for(int i = 0; i < root.get("policyData").get("model").get("path").size(); i++){ - dirName = dirName.replace("\"", "") + root.get("policyData").get("model").get("path").get(i).toString().replace("\"", "") + File.separator; - } - policyData.setDomainDir(dirName.substring(0, dirName.lastIndexOf(File.separator))); - }else{ - policyData.setDomainDir(root.get("policyData").get("model").get("name").toString().replace("\"", "")); - } - int version = 0; - int highestVersion = 0; - int descriptionVersion = 0; - //get the highest version of policy from policy version table. - //getting the sub scope domain where the policy is created or updated - String dbCheckPolicyName = policyData.getDomainDir() + File.separator + "Decision_" + policyData.getPolicyName(); - List policyVersionList = policyVersionDao.getPolicyVersionEntityByName(dbCheckPolicyName); - if (policyVersionList.size() > 0) { - for(int i = 0; i < policyVersionList.size(); i++) { - PolicyVersion entityItem = policyVersionList.get(i); - if(entityItem.getPolicyName().equals(dbCheckPolicyName)){ - highestVersion = entityItem.getHigherVersion(); - } - } - } - if(highestVersion != 0){ - version = highestVersion; - descriptionVersion = highestVersion +1; - }else{ - version = 1; - descriptionVersion = 1; - } - - //set policy adapter values for Building JSON object containing policy data - String createdBy = ""; - String modifiedBy = userId; - if(descriptionVersion == 1){ - createdBy = userId; - }else{ - String policyName = PolicyController.getGitPath().toAbsolutePath().toString() + File.separator + policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - File policyPath = new File(policyName); - try { - createdBy = XACMLPolicyScanner.getCreatedBy(policyPath.toPath()); - } catch (IOException e) { - createdBy = "guest"; - } - } - - policyData.setPolicyDescription(policyData.getPolicyDescription()+ "@CreatedBy:" +createdBy + "@CreatedBy:" + "@ModifiedBy:" +modifiedBy + "@ModifiedBy:"); - Map successMap = new HashMap(); - Map attributeMap = new HashMap(); - Map settingsMap = new HashMap(); - - List dynamicRuleAlgorithmLabels = new LinkedList(); - List dynamicRuleAlgorithmCombo = new LinkedList(); - List dynamicRuleAlgorithmField1 = new LinkedList(); - List dynamicRuleAlgorithmField2 = new LinkedList(); - List dynamicVariableList = new LinkedList(); - List dataTypeList = new LinkedList(); - - //set the Rule Combining Algorithm Id to be sent to PAP-REST via JSON - List ruleAlgorithmsList = ruleAlgorithmsDao.getRuleAlgorithms(); - for (int i = 0; i < ruleAlgorithmsList.size(); i++) { - RuleAlgorithms a = ruleAlgorithmsList.get(i); - if (a.getXacmlId().equals(XACML3.ID_RULE_PERMIT_OVERRIDES.stringValue())) { - policyData.setRuleCombiningAlgId(a.getXacmlId()); - break; - } - } - - if(policyData.getAttributes().size() > 0){ - for(Object attribute : policyData.getAttributes()){ - if(attribute instanceof LinkedHashMap){ - String key = ((LinkedHashMap) attribute).get("option").toString(); - String value = ((LinkedHashMap) attribute).get("number").toString(); - attributeMap.put(key, value); - } - } - } - - if(policyData.getSettings().size() > 0){ - for(Object settingsData : policyData.getSettings()){ - if(settingsData instanceof LinkedHashMap){ - String key = ((LinkedHashMap) settingsData).get("option").toString(); - String value = ((LinkedHashMap) settingsData).get("number").toString(); - settingsMap.put(key, value); - } - } - } - - if(policyData.getRuleAlgorithmschoices().size() > 0){ - for(Object attribute : policyData.getRuleAlgorithmschoices()){ - if(attribute instanceof LinkedHashMap){ - String label = ((LinkedHashMap) attribute).get("id").toString(); - String key = ((LinkedHashMap) attribute).get("dynamicRuleAlgorithmField1").toString(); - String rule = ((LinkedHashMap) attribute).get("dynamicRuleAlgorithmCombo").toString(); - String value = ((LinkedHashMap) attribute).get("dynamicRuleAlgorithmField2").toString(); - dynamicRuleAlgorithmLabels.add(label); - dynamicRuleAlgorithmField1.add(key); - dynamicRuleAlgorithmCombo.add(rule); - dynamicRuleAlgorithmField2.add(value); - } - } - } - - policyData.setDynamicRuleAlgorithmLabels(dynamicRuleAlgorithmLabels); - policyData.setDynamicRuleAlgorithmCombo(dynamicRuleAlgorithmCombo); - policyData.setDynamicRuleAlgorithmField1(dynamicRuleAlgorithmField1); - policyData.setDynamicRuleAlgorithmField2(dynamicRuleAlgorithmField2); - policyData.setDynamicVariableList(dynamicVariableList); - policyData.setDynamicSettingsMap(settingsMap); - policyData.setDynamicFieldConfigAttributes(attributeMap); - policyData.setDataTypeList(dataTypeList); - if (policyData.isEditPolicy()){ - //increment the version and set in policyAdapter - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - policyData.setPolicyID(this.newPolicyID()); - policyData.setRuleID(ruleID); - successMap = engine.updatePolicyRequest(policyData); - } else { - //send it for policy creation - policyData.setVersion(String.valueOf(version)); - policyData.setHighestVersion(version); - successMap = engine.createPolicyRequest(policyData); - - } - - if (successMap.containsKey("success")) { - // Add it into our tree - Path finalPolicyPath = null; - finalPolicyPath = Paths.get(successMap.get("success")); - PolicyElasticSearchController controller = new PolicyElasticSearchController(); - controller.updateElk(finalPolicyPath.toString()); - File file = finalPolicyPath.toFile(); - if(file != null){ - String policyName = file.toString(); - String removePath = policyName.substring(policyName.indexOf("repository")+11); - String removeXml = removePath.replace(".xml", ""); - String removeExtension = removeXml.substring(0, removeXml.indexOf(".")); - List vesionList = policyVersionDao.getPolicyVersionEntityByName(removeExtension); - if (vesionList.size() > 0) { - for(int i = 0; i < vesionList.size(); i++) { - PolicyVersion entityItem = vesionList.get(i); - if(entityItem.getPolicyName().equals(removeExtension)){ - version = entityItem.getHigherVersion() +1; - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setModifiedBy(userId); - policyVersionDao.update(entityItem); - if(policyData.isEditPolicy){ - PolicyNotificationMail email = new PolicyNotificationMail(); - String mode = "EditPolicy"; - String policyNameForEmail = policyData.getDomainDir() + File.separator + policyData.getOldPolicyFileName() + ".xml"; - email.sendMail(entityItem, policyNameForEmail, mode, policyNotificationDao); - } - } - } - }else{ - PolicyVersion entityItem = new PolicyVersion(); - entityItem.setActiveVersion(version); - entityItem.setHigherVersion(version); - entityItem.setPolicyName(removeExtension); - entityItem.setCreatedBy(userId); - entityItem.setModifiedBy(userId); - policyVersionDao.Save(entityItem); - } - } - } - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(successMap); - JSONObject j = new JSONObject("{policyData: " + responseString + "}"); - out.write(j.toString()); - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - public void PrePopulateDecisionPolicyData(PolicyAdapter policyAdapter) { - attributeList = new ArrayList(); - decisionList = new ArrayList(); - ruleAlgorithmList = new ArrayList(); - if (policyAdapter.getPolicyData() instanceof PolicyType) { - Object policyData = policyAdapter.getPolicyData(); - PolicyType policy = (PolicyType) policyData; - policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName()); - String policyNameValue = policyAdapter.getPolicyName().substring(policyAdapter.getPolicyName().indexOf("_") + 1, policyAdapter.getPolicyName().lastIndexOf(".")); - policyAdapter.setPolicyName(policyNameValue); - String description = ""; - try{ - description = policy.getDescription().substring(0, policy.getDescription().indexOf("@CreatedBy:")); - }catch(Exception e){ - description = policy.getDescription(); - } - policyAdapter.setPolicyDescription(description); - // Get the target data under policy for Action. - TargetType target = policy.getTarget(); - if (target != null) { - // under target we have AnyOFType - List anyOfList = target.getAnyOf(); - if (anyOfList != null) { - Iterator iterAnyOf = anyOfList.iterator(); - while (iterAnyOf.hasNext()) { - AnyOfType anyOf = iterAnyOf.next(); - // Under AntOfType we have AllOfType - List allOfList = anyOf.getAllOf(); - if (allOfList != null) { - Iterator iterAllOf = allOfList.iterator(); - while (iterAllOf.hasNext()) { - AllOfType allOf = iterAllOf.next(); - // Under AllOfType we have Mathch. - List matchList = allOf.getMatch(); - int index = 0; - if (matchList != null) { - Iterator iterMatch = matchList.iterator(); - while (iterMatch.hasNext()) { - MatchType match = iterMatch.next(); - // - // Under the match we have attributevalue and - // attributeDesignator. So,finally down to the actual attribute. - // - AttributeValueType attributeValue = match.getAttributeValue(); - String value = (String) attributeValue.getContent().get(0); - AttributeDesignatorType designator = match.getAttributeDesignator(); - String attributeId = designator.getAttributeId(); - // First match in the target is EcompName, so set that value. - if (index == 0) { - policyAdapter.setEcompName(value); - } - // Component attributes are saved under Target here we are fetching them back. - // One row is default so we are not adding dynamic componet at index 0. - if (index >= 1) { - Map attribute = new HashMap(); - attribute.put("option", attributeId); - attribute.put("number", value); - attributeList.add(attribute); - } - index++; - } - } - policyAdapter.setAttributes(attributeList); - } - } - } - } - - List ruleList = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition(); - int index = 0; - for (Object object : ruleList) { - if (object instanceof VariableDefinitionType) { - VariableDefinitionType variableDefinitionType = (VariableDefinitionType) object; - Map settings = new HashMap(); - settings.put("option", variableDefinitionType.getVariableId()); - JAXBElement attributeValueTypeElement = (JAXBElement) variableDefinitionType.getExpression(); - if (attributeValueTypeElement != null) { - AttributeValueType attributeValueType = attributeValueTypeElement.getValue(); - settings.put("number", attributeValueType.getContent().get(0).toString()); - } - decisionList.add(settings); - } else if (object instanceof RuleType) { - // get the condition data under the rule for rule Algorithms. - ruleID = ((RuleType) object).getRuleId(); - if (((RuleType) object).getEffect().equals(EffectType.PERMIT)) { - ConditionType condition = ((RuleType) object).getCondition(); - if (condition != null) { - ApplyType decisionApply = (ApplyType) condition.getExpression().getValue(); - ruleAlgoirthmTracker = new LinkedList(); - // Populating Rule Algorithms starting from compound. - prePopulateDecisionCompoundRuleAlgorithm(index, decisionApply); - policyAdapter.setRuleAlgorithmschoices(ruleAlgorithmList); - } - }else if(((RuleType) object).getEffect().equals(EffectType.DENY)) { - if(((RuleType) object).getAdviceExpressions()!=null){ - if(((RuleType) object).getAdviceExpressions().getAdviceExpression().get(0).getAdviceId().toString().equalsIgnoreCase("AAF")){ - policyAdapter.setRuleProvider("AAF"); - break; - } - }else{ - policyAdapter.setRuleProvider("Custom"); - } - } - } - } - } - policyAdapter.setSettings(decisionList); - } - - } - - private void prePopulateDecisionRuleAlgorithms(int index, ApplyType decisionApply, List> jaxbDecisionTypes) { - Map ruleMap = new HashMap(); - ruleMap.put("id", "A" + (index +1)); - Map dropDownMap = PolicyController.getDropDownMap(); - for (String key : dropDownMap.keySet()) { - String keyValue = dropDownMap.get(key); - if (keyValue.equals(decisionApply.getFunctionId())) { - ruleMap.put("dynamicRuleAlgorithmCombo", key); - } - } - // Populate the key and value fields - if (((jaxbDecisionTypes.get(0).getValue()) instanceof AttributeValueType)) { - ApplyType innerDecisionApply = (ApplyType) jaxbDecisionTypes.get(1).getValue(); - List> jaxbInnerDecisionTypes = innerDecisionApply.getExpression(); - if (jaxbInnerDecisionTypes.get(0).getValue() instanceof AttributeDesignatorType) { - AttributeDesignatorType attributeDesignator = (AttributeDesignatorType) jaxbInnerDecisionTypes.get(0).getValue(); - ruleMap.put("dynamicRuleAlgorithmField1", attributeDesignator.getAttributeId()); - - // Get from Attribute Value - AttributeValueType actionConditionAttributeValue = (AttributeValueType) jaxbDecisionTypes.get(0).getValue(); - String attributeValue = (String) actionConditionAttributeValue.getContent().get(0); - ruleMap.put("dynamicRuleAlgorithmField2", attributeValue); - } - } else if ((jaxbDecisionTypes.get(0).getValue()) instanceof VariableReferenceType) { - VariableReferenceType variableReference = (VariableReferenceType) jaxbDecisionTypes.get(0).getValue(); - ruleMap.put("dynamicRuleAlgorithmField1", "S_"+ variableReference.getVariableId()); - - - // Get from Attribute Value - AttributeValueType actionConditionAttributeValue = (AttributeValueType) jaxbDecisionTypes.get(1).getValue(); - String attributeValue = (String) actionConditionAttributeValue.getContent().get(0); - ruleMap.put("dynamicRuleAlgorithmField2", attributeValue); - } - ruleAlgorithmList.add(ruleMap); - } - - private int prePopulateDecisionCompoundRuleAlgorithm(int index, ApplyType decisionApply) { - boolean isCompoundRule = true; - List> jaxbDecisionTypes = decisionApply.getExpression(); - for (JAXBElement jaxbElement : jaxbDecisionTypes) { - // If There is Attribute Value under Decision Type that means we came to the final child - if (logger.isDebugEnabled()) { - logger.debug("Prepopulating rule algoirthm: " + index); - } - // Check to see if Attribute Value exists, if yes then it is not a compound rule - if(jaxbElement.getValue() instanceof AttributeValueType) { - prePopulateDecisionRuleAlgorithms(index, decisionApply, jaxbDecisionTypes); - ruleAlgoirthmTracker.addLast(index); - isCompoundRule = false; - index++; - } - } - if (isCompoundRule) { - // As it's compound rule, Get the Apply types - for (JAXBElement jaxbElement : jaxbDecisionTypes) { - ApplyType innerDecisionApply = (ApplyType) jaxbElement.getValue(); - index = prePopulateDecisionCompoundRuleAlgorithm(index, innerDecisionApply); - } - // Populate combo box - if (logger.isDebugEnabled()) { - logger.debug("Prepopulating Compound rule algorithm: " + index); - } - Map rule = new HashMap(); - for (String key : PolicyController.getDropDownMap().keySet()) { - String keyValue = PolicyController.getDropDownMap().get(key); - if (keyValue.equals(decisionApply.getFunctionId())) { - rule.put("dynamicRuleAlgorithmCombo", key); - } - } - - rule.put("id", "A" + (index +1)); - // Populate Key and values for Compound Rule - rule.put("dynamicRuleAlgorithmField1", "A" + (ruleAlgoirthmTracker.getLast() + 1 )); - ruleAlgoirthmTracker.removeLast(); - rule.put("dynamicRuleAlgorithmField2", "A" + (ruleAlgoirthmTracker.getLast() + 1)); - ruleAlgoirthmTracker.removeLast(); - ruleAlgoirthmTracker.addLast(index); - ruleAlgorithmList.add(rule); - index++; - } - return index; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PDPController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PDPController.java deleted file mode 100644 index add650b1e..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PDPController.java +++ /dev/null @@ -1,302 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.json.JSONObject; -import org.openecomp.policy.dao.GroupEntityDao; -import org.openecomp.policy.dao.PDPEntityDao; -import org.openecomp.policy.model.PDPGroupContainer; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.api.pap.EcompPDPGroup; - -import com.att.research.xacml.api.pap.PAPException; -import com.att.research.xacml.api.pap.PDPGroup; -import org.openecomp.policy.xacml.std.pap.StdPDP; -import org.openecomp.policy.xacml.std.pap.StdPDPGroup; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Controller -@RequestMapping({"/"}) -public class PDPController extends RestrictedBaseController { - private static final Logger logger = FlexLogger.getLogger(PDPController.class); - - @Autowired - GroupEntityDao groupDAO; - - @Autowired - PDPEntityDao pdpDAO; - - protected List groups = Collections.synchronizedList(new ArrayList()); - private PDPGroupContainer container; - - public synchronized void refreshGroups() { - synchronized(this.groups) { - this.groups.clear(); - try { - this.groups.addAll(PolicyController.getPapEngine().getEcompPDPGroups()); - } catch (PAPException e) { - String message = "Unable to retrieve Groups from server: " + e; - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR+"Pap Engine is Null" + message); - } - - } - } - - @RequestMapping(value={"/get_PDPGroupContainerData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getPDPGroupContainerData(HttpServletRequest request, HttpServletResponse response){ - try{ - ObjectMapper mapper = new ObjectMapper(); - refreshGroups(); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Error Occured while retrieving the PDP Group Container data" + e); - } - } - - @RequestMapping(value={"/get_PDPGroupData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getPDPGroupEntityData(HttpServletRequest request, HttpServletResponse response){ - try{ - ObjectMapper mapper = new ObjectMapper(); - refreshGroups(); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Error Occured while retrieving the PDP Group data" + e); - } - } - - @RequestMapping(value={"/pdp_Group/save_pdp_group"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView savePDPGroup(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - this.container = new PDPGroupContainer(PolicyController.getPapEngine()); - StdPDPGroup pdpGroupData = mapper.readValue(root.get("pdpGroupData").toString().replace("groupName", "name"), StdPDPGroup.class); - try { - if(pdpGroupData.getId() == null){ - this.container.addNewGroup(pdpGroupData.getName(), pdpGroupData.getDescription()); - }else{ - this.container.updateGroup(pdpGroupData); - } - - } catch (Exception e) { - String message = "Unable to create Group. Reason:\n" + e.getMessage(); - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Error Occured while creating the PDP Group" + message); - } - - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - refreshGroups(); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups)); - JSONObject j = new JSONObject(msg); - out.write(j.toString()); - - return null; - } - catch (Exception e){ - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Error Occured while Saving the PDP Group" + e); - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - @RequestMapping(value={"/pdp_Group/remove_pdp_group"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView removePDPGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { - try{ - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - this.container = new PDPGroupContainer(PolicyController.getPapEngine()); - StdPDPGroup pdpGroupData = mapper.readValue(root.get("pdpGroupData").toString(), StdPDPGroup.class); - if(pdpGroupData.getName().equals("Default")) { - throw new UnsupportedOperationException("You can't remove the Default Group."); - }else{ - this.container.removeGroup(pdpGroupData, null); - } - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - - refreshGroups(); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups)); - JSONObject j = new JSONObject(msg); - out.write(j.toString()); - - return null; - } - catch (Exception e){ - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Error Occured while Removing the PDP Group" + e); - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - @RequestMapping(value={"/pdp_Group/save_pdpTogroup"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView savePDPToGroup(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - this.container = new PDPGroupContainer(PolicyController.getPapEngine()); - String update = root.get("update").toString(); - PdpData pdpGroupData = (PdpData)mapper.readValue(root.get("pdpInGroup").toString(), PdpData.class); - StdPDPGroup activeGroupData = mapper.readValue(root.get("activePDP").toString(), StdPDPGroup.class); - try { - - if(update.contains("false")){ - this.container.addNewPDP(pdpGroupData.getId(), activeGroupData, pdpGroupData.getName(), pdpGroupData.getDescription(), pdpGroupData.getJmxPort()); - }else{ - this.container.updateGroup(activeGroupData); - } - } catch (Exception e) { - String message = "Unable to create Group. Reason:\n" + e.getMessage(); - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Error Occured while Creating Pdp in PDP Group" + message); - } - - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - refreshGroups(); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups)); - JSONObject j = new JSONObject(msg); - out.write(j.toString()); - - return null; - } - catch (Exception e){ - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Error Occured while Creating Pdp in PDP Group" + e); - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - @RequestMapping(value={"/pdp_Group/remove_pdpFromGroup"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView removePDPFromGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { - try{ - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - this.container = new PDPGroupContainer(PolicyController.getPapEngine()); - StdPDP deletePdp = mapper.readValue(root.get("data").toString(), StdPDP.class); - StdPDPGroup activeGroupData = mapper.readValue(root.get("activePDP").toString(), StdPDPGroup.class); - - this.container.removePDP(deletePdp, activeGroupData); - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - refreshGroups(); - String responseString = mapper.writeValueAsString(groups); - JSONObject j = new JSONObject("{pdpEntityDatas: " + responseString + "}"); - out.write(j.toString()); - - return null; - } - catch (Exception e){ - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Error Occured while Removing Pdp from PDP Group" + e); - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } -} - -class PdpData{ - String id; - int jmxPort; - String name; - String description; - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public int getJmxPort() { - return jmxPort; - } - public void setJmxPort(int jmxPort) { - this.jmxPort = jmxPort; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyController.java deleted file mode 100644 index c4b254c8e..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyController.java +++ /dev/null @@ -1,418 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.File; -import java.io.FileFilter; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.annotation.PostConstruct; -import javax.mail.MessagingException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.io.filefilter.WildcardFileFilter; -import org.json.JSONObject; -import org.openecomp.policy.admin.PolicyNotificationMail; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.dao.FunctionDefinitionDao; -import org.openecomp.policy.dao.PolicyEditorScopesDao; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.dao.RolesDao; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.model.PDPGroupContainer; -import org.openecomp.policy.model.Roles; -import org.openecomp.policy.rest.XACMLRestProperties; -import org.openecomp.policy.rest.XacmlAdminAuthorization; -import org.openecomp.policy.rest.dao.UserInfoDao; -import org.openecomp.policy.rest.jpa.Datatype; -import org.openecomp.policy.rest.jpa.FunctionDefinition; -import org.openecomp.policy.rest.jpa.PolicyEditorScopes; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.util.Webapps; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -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 org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.api.pap.PAPPolicyEngine; - -import com.att.research.xacml.api.pap.PAPEngine; -import com.att.research.xacml.util.XACMLProperties; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - -@Controller -@RequestMapping("/") -public class PolicyController extends RestrictedBaseController { - private static final Logger LOGGER = FlexLogger.getLogger(PolicyController.class); - private static UserInfoDao userInfoDao; - private static PolicyVersionDao policyVersionDao; - private static RolesDao rolesDao; - private static PolicyEditorScopesDao policyEditorScopesDao; - private static WatchPolicyNotificationDao watchPolicyNotificationDao; - // Our authorization object - // - XacmlAdminAuthorization authorizer = new XacmlAdminAuthorization(); - // - // The PAP Engine - // - private static PAPPolicyEngine papEngine; - private Path repositoryPath = null; - private static Path workspacePath; - private static Path gitPath; - public static String logTableLimit; - public static String systemAlertTableLimit; - public static String CONFIG_HOME = PolicyController.getConfigHome(); - public static String ACTION_HOME = PolicyController.getActionHome(); - protected static Map dropDownMap = new HashMap(); - public static Map getDropDownMap() { - return dropDownMap; - } - - public static void setDropDownMap(Map dropDownMap) { - PolicyController.dropDownMap = dropDownMap; - } - - public static String getDomain() { - return XACMLProperties.getProperty(XACMLRestProperties.PROP_ADMIN_DOMAIN, "urn"); - } - - private static final Object mapAccess = new Object(); - private static Map> mapDatatype2Function = null; - private static Map mapID2Function = null; - - private static FunctionDefinitionDao functionDefinitionDao; - - //Smtp Java Mail Properties - public static String smtpHost = null; - public static String smtpPort = null; - public static String smtpUsername = null; - public static String smtpPassword = null; - public static String smtpApplicationName = null; - public static String smtpEmailExtension = null; - //log db Properties - public static String logdbDriver = null; - public static String logdbUrl = null; - public static String logdbUserName = null; - public static String logdbPassword = null; - public static String logdbDialect = null; - - - @Autowired - private PolicyController(UserInfoDao userinfoDao, PolicyVersionDao policyVersionDao, FunctionDefinitionDao functionDefinitionDao, - RolesDao rolesDao, PolicyEditorScopesDao policyEditorScopesDao, WatchPolicyNotificationDao watchPolicyNotificationDao){ - PolicyController.userInfoDao = userinfoDao; - PolicyController.policyVersionDao = policyVersionDao; - PolicyController.functionDefinitionDao = functionDefinitionDao; - PolicyController.rolesDao = rolesDao; - PolicyController.policyEditorScopesDao = policyEditorScopesDao; - PolicyController.watchPolicyNotificationDao = watchPolicyNotificationDao; - } - - public PolicyController() { - } - - @PostConstruct - public void init(){ - Properties prop = new Properties(); - InputStream input = null; - try { - input = new FileInputStream("xacml.admin.properties"); - // load a properties file - prop.load(input); - // get the property values - smtpHost = prop.getProperty("ecomp.smtp.host"); - smtpPort = prop.getProperty("ecomp.smtp.port"); - smtpUsername = prop.getProperty("ecomp.smtp.userName"); - smtpPassword = prop.getProperty("ecomp.smtp.password"); - smtpApplicationName = prop.getProperty("ecomp.application.name"); - smtpEmailExtension = prop.getProperty("ecomp.smtp.emailExtension"); - //Log Database Properties - logdbDriver = prop.getProperty("xacml.log.db.driver"); - logdbUrl = prop.getProperty("xacml.log.db.url"); - logdbUserName = prop.getProperty("xacml.log.db.user"); - logdbPassword = prop.getProperty("xacml.log.db.password"); - logdbDialect = prop.getProperty("ecomp.dialect"); - //Get the Property Values for Dashboard tab Limit - try{ - logTableLimit = prop.getProperty("xacml.ecomp.dashboard.logTableLimit"); - systemAlertTableLimit = prop.getProperty("xacml.ecomp.dashboard.systemAlertTableLimit"); - }catch(Exception e){ - LOGGER.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Dashboard tab Property fields are missing" +e); - logTableLimit = "5000"; - systemAlertTableLimit = "2000"; - } - repositoryPath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_ADMIN_REPOSITORY)); - PolicyController.workspacePath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_ADMIN_WORKSPACE), getDefaultWorkspace()); - setGitPath(Paths.get(workspacePath.toString(), repositoryPath.getFileName().toString())); - System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME, "xacml.admin.properties"); - } catch (IOException ex) { - LOGGER.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Exception Occured while reading the Smtp properties from xacml.admin.properties file" +ex); - } finally { - if (input != null) { - try { - input.close(); - } catch (IOException e) { - LOGGER.error(XACMLErrorConstants.ERROR_DATA_ISSUE+"Exception Occured while Closing the xacml.admin.properties file" +e); - } - } - } - - //Initialize the FunctionDefinition table at Server Start up - Map> functionMap = getFunctionDatatypeMap(); - for (Datatype id : functionMap.keySet()) { - List functionDefinations = (List) functionMap.get(id); - for (FunctionDefinition functionDef : functionDefinations) { - dropDownMap.put(functionDef.getShortname(),functionDef.getXacmlid()); - } - } - - } - - public static Map> getFunctionDatatypeMap() { - synchronized(mapAccess) { - if (mapDatatype2Function == null) { - buildFunctionMaps(); - } - } - return mapDatatype2Function; - } - - public static Map getFunctionIDMap() { - synchronized(mapAccess) { - if (mapID2Function == null) { - buildFunctionMaps(); - } - } - return mapID2Function; - } - - private static void buildFunctionMaps() { - mapDatatype2Function = new HashMap>(); - mapID2Function = new HashMap(); - List functiondefinitions = functionDefinitionDao.getFunctionDefinition(); - for (int i = 0; i < functiondefinitions.size(); i ++) { - FunctionDefinition value = functiondefinitions.get(i); - mapID2Function.put(value.getXacmlid(), value); - if (mapDatatype2Function.containsKey(value.getDatatypeBean()) == false) { - mapDatatype2Function.put(value.getDatatypeBean(), new ArrayList()); - } - mapDatatype2Function.get(value.getDatatypeBean()).add(value); - } - } - - public static Map getUserRoles(String userId) { - Map scopes = new HashMap(); - List roles = rolesDao.getUserRoles(userId); - if (roles != null && roles.size() > 0) { - for (Roles role : roles) { - scopes.put(role.getScope(), role); - } - } - return scopes; - } - - public static List getRolesOfUser(String userId) { - List rolesList = new ArrayList(); - List roles = rolesDao.getUserRoles(userId); - for (Roles role: roles) { - rolesList.add(role.getRole()); - } - return rolesList; - } - - public static List getRoles(String userId) { - return rolesDao.getUserRoles(userId); - } - - //Get List of User Roles - @RequestMapping(value={"/get_UserRolesData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getUserRolesEntityData(HttpServletRequest request, HttpServletResponse response){ - try{ - String userId = UserUtils.getUserIdFromCookie(request); - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - model.put("userRolesDatas", mapper.writeValueAsString(getRolesOfUser(userId))); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - //Policy tabs Model and View - @RequestMapping(value= {"/policy", "/policy/*" }, method = RequestMethod.GET) - public ModelAndView view(HttpServletRequest request){ - String myRequestURL = request.getRequestURL().toString(); - try { - // - // Set the URL for the RESTful PAP Engine - // - setPapEngine((PAPPolicyEngine) new RESTfulPAPEngine(myRequestURL)); - new PDPGroupContainer((PAPPolicyEngine) new RESTfulPAPEngine(myRequestURL)); - } catch (Exception e) { - LOGGER.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR+"Exception Occured while loading PAP"+e); - } - Map model = new HashMap(); - return new ModelAndView("policy_Editor","model", model); - } - - public static String getDefaultWorkspace() { - return "admin"; - } - - public static PAPPolicyEngine getPapEngine() { - return papEngine; - } - - public void setPapEngine(PAPPolicyEngine papEngine) { - PolicyController.papEngine = papEngine; - } - - //Config and Action Directory's - public static String getConfigHome() { - return Webapps.getConfigHome(); - } - - public static String getActionHome() { - return Webapps.getActionHome(); - } - - public static Path getGitPath() { - return gitPath; - } - - public static void setGitPath(Path gitPath) { - PolicyController.gitPath = gitPath; - } - - public static String getUserName(String createdBy) { - String loginId = createdBy; - return userInfoDao.getUserName(loginId); - } - - public static boolean getActivePolicy(String query) { - if(policyVersionDao.getActiveVersionPolicy(query).size() > 0){ - return true; - }else{ - return false; - } - - } - - //Get the Active Version of Policy List from Policy Version table - public static List getListOfActivePolicies(String query){ - return policyVersionDao.getActiveVersionPolicy(query); - } - - public static void updatePolicyVersion(String query) { - policyVersionDao.updateQuery(query); - } - - public static void SaveToPolicyVersion(PolicyVersion policyversion) { - policyVersionDao.Save(policyversion); - } - - public static PolicyVersion getPolicyEntityFromPolicyVersion(String query){ - PolicyVersion policyVersionEntity = policyVersionDao.getPolicyVersionEntityByName(query).get(0); - return policyVersionEntity; - } - - public static void SavePolicyScope(PolicyEditorScopes policyScope){ - policyEditorScopesDao.Save(policyScope); - } - - public static List getListOfPolicyEditorScopes(String query){ - return policyEditorScopesDao.getListOfPolicyScopes(query); - } - - public static void updatePolicyScopeEditorWithQuery(String policyScopeQuery) { - policyEditorScopesDao.updateQuery(policyScopeQuery); - - } - - public static void updatePolicyScopeEditor(PolicyEditorScopes policyScopeQuery) { - policyEditorScopesDao.update(policyScopeQuery); - - } - - public void WatchPolicyFunction(PolicyVersion entity, String policyName, String mode){ - PolicyNotificationMail email = new PolicyNotificationMail(); - try { - email.sendMail(entity, policyName, mode, watchPolicyNotificationDao); - } catch (MessagingException e) { - LOGGER.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "Excepton Occured while Renaming/Deleting a Policy or Scope" + e); - } - } - - //Switch Version - public JSONObject SwitchVersionPolicyContent(File policyFile) { - Path parent = Paths.get(policyFile.toString().substring(0, policyFile.toString().lastIndexOf(File.separator))); - String policyName = policyFile.toString().substring(policyFile.toString().indexOf("repository") +11); - String removeExtension = policyName.replace(".xml", ""); - String activeVersion = removeExtension.substring(removeExtension.lastIndexOf(".")+1); - String dbPolicyName = removeExtension.substring(0, removeExtension.lastIndexOf(".")); - String filterPolicyName = dbPolicyName.substring(dbPolicyName.lastIndexOf(File.separator)+1); - FileFilter fileFilter = new WildcardFileFilter(filterPolicyName + "." + "*" + ".xml"); - File[] files = ((File) parent.toFile()).listFiles(fileFilter); - List av = new ArrayList(); - for(File file : files){ - String fileName = file.toString().substring(file.toString().indexOf("repository") +11); - String removeXMLExtension = fileName.replace(".xml", ""); - String availableVersion = removeXMLExtension.substring(removeXMLExtension.lastIndexOf(".")+1); - av.add(availableVersion); - } - PolicyVersion entity = (PolicyVersion) policyVersionDao.getPolicyVersionEntityByName(dbPolicyName).get(0); - String highestVersion = Integer.toString(entity.getHigherVersion()); - JSONObject el = new JSONObject(); - el.put("activeVersion", activeVersion); - el.put("availableVersions", av); - el.put("highestVersion", highestVersion); - return el; - } - - public static Path getUserWorkspace() { - return PolicyController.workspacePath; - } - -} - diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyExportAndImportController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyExportAndImportController.java deleted file mode 100644 index 76fadb59d..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyExportAndImportController.java +++ /dev/null @@ -1,563 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.compress.archivers.tar.TarArchiveEntry; -import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; -import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.io.IOUtils; -import org.json.JSONObject; -import org.openecomp.policy.adapter.PolicyExportAdapter; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.elk.client.ElkConnector; -import org.openecomp.policy.model.Roles; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.utils.XACMLPolicyWriterWithPapNotify; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - -@Controller -@RequestMapping("/") -public class PolicyExportAndImportController extends RestrictedBaseController { - private static Logger logger = FlexLogger.getLogger(PolicyExportAndImportController.class); - private ArrayList selectedPolicy; - public static String CONFIG_HOME = PolicyController.getConfigHome(); - public static String ACTION_HOME = PolicyController.getActionHome(); - - private Set scopes = null; - private List roles = null; - private Boolean superadmin = false; - private Boolean showMessage = false; - private static final int BUFFER_SIZE = 4096; - private Path directory = PolicyController.getGitPath(); - - //Scopes Which Super Editor can't import - private Set sEditorScopesCantCreate = new HashSet(); - //List of scopes in Tar file - private Set listOfTarNewScopes = new HashSet(); - //List of xml policies - private ArrayList xacmlFiles = new ArrayList(); - //Scopes of the User based on the Roles - private List userScopes = null; - //Directory names from tar file - private Set directoryNames = new HashSet(); - //compare the scopes of the user and tar file get unique - private Set finalScopesToImport = new HashSet(); - //final scopes User can import - private Set finalScopes = new HashSet(); - //User don't have permissions to import to scopes - private Set roleIsNotSufficient = new HashSet(); - //User don't have access to import new scopes - private Set userDontHavePermission = new HashSet(); - - private Map scopeAndRoles = null; - - private static PolicyVersionDao policyVersionDao; - - @Autowired - ServletContext servletContext; - - @Autowired - private PolicyExportAndImportController(PolicyVersionDao policyVersionDao){ - PolicyExportAndImportController.policyVersionDao = policyVersionDao; - } - - public PolicyExportAndImportController(){} - - @RequestMapping(value={"/policy_download/exportPolicy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView ExportPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try{ - selectedPolicy = new ArrayList(); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyExportAdapter adapter = mapper.readValue(root.get("exportData").toString(), PolicyExportAdapter.class); - for (Object policyId : adapter.getPolicyDatas()) { - LinkedHashMap selected = (LinkedHashMap)policyId; - Path file = Paths.get(selected.get("filePath").toString()); - selectedPolicy.add(file.toFile()); - } - // Grab our working repository - // - final Path repoPath = PolicyController.getGitPath().toAbsolutePath(); - if(CONFIG_HOME == null || ACTION_HOME == null ){ - CONFIG_HOME = PolicyController.getConfigHome(); - ACTION_HOME = PolicyController.getActionHome(); - } - Path configPath = Paths.get(CONFIG_HOME); - Path actionPath = Paths.get(ACTION_HOME); - String tempDir = System.getProperty("catalina.base") + File.separator + "webapps" + File.separator + "temp"; - File temPath = new File(tempDir); - if(!temPath.exists()){ - temPath.mkdir(); - } - final Path tarFile = Paths.get(tempDir, "Repository.tar"); - try (OutputStream os = Files.newOutputStream(tarFile)) { - try (TarArchiveOutputStream tarOut = new TarArchiveOutputStream(os)) { - tarOut.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); - Files.walkFileTree(configPath, new SimpleFileVisitor() { - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - for (File policyId : selectedPolicy) { - // Get the current selection - String policyDir = policyId.toString(); - policyDir = policyDir.substring(policyDir.indexOf("repository")+11); - String path = policyDir.replace('\\', '.'); - if(path.contains("/")){ - path = policyDir.replace('/', '.'); - logger.info("print the path:" +path); - } - path = FilenameUtils.removeExtension(path); - if (path.endsWith(".xml")) { - path = path.substring(0, path.length() - 4); - } - File configFile = new File(path); - String fileName = FilenameUtils.removeExtension(file.getFileName().toString()); - File configHome = new File(fileName); - if(configFile.equals(configHome)) { - Path relative = configPath.relativize(file); - TarArchiveEntry entry = new TarArchiveEntry(relative.toFile()); - entry.setSize(Files.size(file)); - tarOut.putArchiveEntry(entry); - try { - IOUtils.copy(Files.newInputStream(file), tarOut); - } catch (IOException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e); - } - tarOut.closeArchiveEntry(); - return super.visitFile(file, attrs); - } - } - return super.visitFile(file, attrs); - } - }); - - Files.walkFileTree(actionPath, new SimpleFileVisitor() { - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - for (File policyId : selectedPolicy) { - // Get the current selection - String policyDir = policyId.toString(); - policyDir = policyDir.substring(policyDir.indexOf("repository")+11); - String path = policyDir.replace('\\', '.'); - if(path.contains("/")){ - path = policyDir.replace('/', '.'); - logger.info("print the path:" +path); - } - path = FilenameUtils.removeExtension(path); - if (path.endsWith(".xml")) { - path = path.substring(0, path.length() - 4); - } - File actionFile = new File(path); - String fileName = FilenameUtils.removeExtension(file.getFileName().toString()); - File actionHome = new File(fileName); - if(actionFile.equals(actionHome)) { - Path relative = actionPath.relativize(file); - TarArchiveEntry entry = new TarArchiveEntry(relative.toFile()); - entry.setSize(Files.size(file)); - tarOut.putArchiveEntry(entry); - try { - IOUtils.copy(Files.newInputStream(file), tarOut); - } catch (IOException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e); - } - tarOut.closeArchiveEntry(); - return super.visitFile(file, attrs); - } - } - return super.visitFile(file, attrs); - } - }); - - Files.walkFileTree(repoPath, new SimpleFileVisitor() { - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - if (file.getFileName().toString().endsWith(".xml") == false) { - return super.visitFile(file, attrs); - } - for (File policyId : selectedPolicy) { - // Get the current selection - if(policyId.getAbsoluteFile().getName().equals(file.getFileName().toString())) { - Path relative = repoPath.relativize(file); - TarArchiveEntry entry = new TarArchiveEntry(relative.toFile()); - entry.setSize(Files.size(file)); - tarOut.putArchiveEntry(entry); - try { - IOUtils.copy(Files.newInputStream(file), tarOut); - } catch (IOException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e); - } - tarOut.closeArchiveEntry(); - return super.visitFile(file, attrs); - } - } - return super.visitFile(file, attrs); - } - }); - - tarOut.closeArchiveEntry(); - tarOut.finish(); - logger.debug("closing the tar file"); - } - } catch (IOException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "getting IOexception"); - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e); - } - logger.info("trying to send tar file "+tarFile.toAbsolutePath().toString()); - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - String successMap = tarFile.toString().substring(tarFile.toString().lastIndexOf("webapps")+8); - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(successMap); - JSONObject j = new JSONObject("{data: " + responseString + "}"); - out.write(j.toString()); - - - return null; - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR+"Exception Occured while Exporting Policies"+e); - } - return null; - } - - //Policy Import - public JSONObject ImportRepositoryFile(String file, HttpServletRequest request){ - TarArchiveEntry entry = null; - TarArchiveInputStream extractFile = null; - try { - extractFile = new TarArchiveInputStream (new FileInputStream(file)); - } catch (FileNotFoundException e1) { - e1.printStackTrace(); - } - String userId = null; - try { - userId = UserUtils.getUserIdFromCookie(request); - } catch (Exception e) { - logger.error("Exception Occured while reading userid from cookie" +e); - } - scopeAndRoles = PolicyController.getUserRoles(userId); - //Check if the Role and Scope Size are Null get the values from db. - List userRoles = PolicyController.getRoles(userId); - roles = new ArrayList(); - scopes = new HashSet(); - for(Roles userRole: userRoles){ - roles.add(userRole.getRole()); - scopes.add(userRole.getScope()); - } - //Create a loop to read every single entry in TAR file - try { - if (roles.contains("super-admin") || roles.contains("super-editor") || roles.contains("super-guest") ) { - while ((entry = extractFile.getNextTarEntry()) != null) { - this.superadmin = true; - try{ - copyFileToLocation(extractFile, entry, xacmlFiles, null, superadmin); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR+"Exception while Importing Polcies"+e); - } - } - }else{ - this.showMessage = true; - //get the directory names from tar file and add to the list - while ((entry = extractFile.getNextTarEntry()) != null) { - if(entry.getName().endsWith(".xls")) { - this.superadmin = true; - try{ - copyFileToLocation(extractFile, entry, xacmlFiles, finalScopes, superadmin); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR+"Exception while Importing Polcies"+e); - } - } - if(entry.getName().endsWith(".xml")){ - String filename = null; - if(entry.getName().contains("\\")){ - filename = entry.getName().replace("\\", File.separator); - }else{ - filename = entry.getName().replace("/", File.separator); - } - directoryNames.add(filename.substring(0, filename.lastIndexOf(File.separator))); - } - - //get the matching scopes on comparing user scopes and tar file scopes - for(int i=0;i< userScopes.size(); i++){ - for(int j=0; j xacmlFiles, Set finalScopes, Boolean superadminValue ) throws IOException{ - String individualFiles = ""; - int offset = 0; - FileOutputStream outputFile=null; - // Get the name of the file - if(superadminValue){ - individualFiles = entry.getName(); - //Add the list of scopes - if(entry.getName().endsWith(".xml")){ - String filename = null; - if(entry.getName().contains("\\")){ - filename = entry.getName().replace("\\", File.separator); - }else{ - filename = entry.getName().replace("/", File.separator); - } - if(roles.contains("super-editor")){ - listOfTarNewScopes.add(filename.substring(0, filename.lastIndexOf(File.separator))); - } - } - }else{ - for(int i =0; i< finalScopes.size(); i++){ - if(entry.getName().startsWith(finalScopes.toArray()[i].toString())){ - individualFiles = entry.getName(); - } - } - } - - //Filter the new Scopes which Super-Editor can't create - if(roles.contains("super-editor")){ - for(int j= 0; j< listOfTarNewScopes.size(); j++){ - boolean scopeExistsFlag = false; // This Flag is used to know if the Scope Exists. - for(int i=0; i < scopes.size(); i++ ){ - if(scopes.contains(listOfTarNewScopes.toArray()[j])){ - scopeExistsFlag = true; - } - } - if(!scopeExistsFlag){ - sEditorScopesCantCreate.add(listOfTarNewScopes.toArray()[j].toString()); - showMessage = true; - } - } - } - - individualFiles = individualFiles.replace("/", File.separator); - individualFiles = individualFiles.replace("\\", File.separator); - - //Create the path with the entry name - String filePath = directory + File.separator + individualFiles; - String configPath = CONFIG_HOME + File.separator + individualFiles; - String actionPath = ACTION_HOME + File.separator + individualFiles; - logger.info("File Name in TAR File is: " + individualFiles); - logger.info("Xml directory file path: " + filePath); - logger.info("Config Home directory file path: " + configPath); - logger.info("Action Home directory file path: " + actionPath); - - - // Get Size of the file and create a byte array for the size - byte[] content = new byte[(int) entry.getSize()]; - - offset=0; - logger.info("File Name in TAR File is: " + individualFiles); - logger.info("Size of the File is: " + entry.getSize()); - // Read file from the archive into byte array - extractFile.read(content, offset, content.length - offset); - if (!entry.isDirectory()) { - if(!individualFiles.contains(".Config_") || !individualFiles.contains(".Action_")){ - // if the entry is a file, extracts it - String filePath1 = filePath.substring(0, filePath.lastIndexOf(File.separator)); - File newFile = new File(filePath1); - if(!(newFile.exists()) && !(roles.contains("super-editor") || roles.contains("editor"))) { - File dir = new File(filePath1); - dir.mkdir(); - extractFile(extractFile, filePath); - } - } - } else { - // if the entry is a directory, make the directory - if(!(roles.contains("super-editor") || roles.contains("editor"))){ - File dir = new File(filePath); - dir.mkdir(); - } - } - // Define OutputStream for writing the file - if(individualFiles.contains(".Config_")){ - outputFile=new FileOutputStream(new File(configPath)); - }else if(individualFiles.contains(".Action_")){ - outputFile=new FileOutputStream(new File(actionPath)); - }else{ - if(filePath != null){ - outputFile=new FileOutputStream(new File(filePath)); - xacmlFiles.add(filePath); - } - } - - // Use IOUtiles to write content of byte array to physical file - IOUtils.write(content,outputFile); - - // Close Output Stream - try { - outputFile.close(); - } catch (IOException e) { - logger.info("IOException:" +e); - e.printStackTrace(); - } - } - - private void extractFile(TarArchiveInputStream extractFile, String filePath) throws IOException { - BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath)); - byte[] bytesIn = new byte[BUFFER_SIZE]; - int read = 0; - while ((read = extractFile.read(bytesIn)) != -1) { - bos.write(bytesIn, 0, read); - } - bos.close(); - - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyNotificationController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyNotificationController.java deleted file mode 100644 index 203f3dcc6..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyNotificationController.java +++ /dev/null @@ -1,122 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -/* - * - * */ -import java.io.File; -import java.io.PrintWriter; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.json.JSONObject; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.rest.jpa.WatchPolicyNotificationTable; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; - -@Controller -@RequestMapping({"/"}) -public class PolicyNotificationController extends RestrictedBaseController { - - @Autowired - WatchPolicyNotificationDao policyNotificationDao; - - @RequestMapping(value={"/watchPolicy"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView watchPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - String path = ""; - String responseValue = ""; - try { - String userId = UserUtils.getUserIdFromCookie(request); - System.out.println(userId); - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - String name = root.get("watchData").get("name").toString(); - JsonNode pathList = root.get("watchData").get("path"); - String finalName = ""; - if(pathList.isArray()){ - ArrayNode arrayNode = (ArrayNode) pathList; - for (int i = 0; i < arrayNode.size(); i++) { - JsonNode individualElement = arrayNode.get(i); - if(i == 0){ - path = path + individualElement.toString().replace("\"", "").trim(); - }else{ - path = path + File.separator + individualElement.toString().replace("\"", "").trim(); - } - } - } - - if(pathList.size() > 0){ - finalName = path + File.separator + name.replace("\"", "").trim(); - }else{ - finalName = name.replace("\"", "").trim(); - } - if(finalName.contains("\\")){ - finalName = finalName.replace("\\", "\\\\"); - } - String query = "from WatchPolicyNotificationTable where POLICYNAME = '"+finalName+"' and LOGINIDS = '"+userId+"'"; - List watchList = policyNotificationDao.watchListQuery(query); - if(watchList.isEmpty()){ - if(finalName.contains("\\\\")){ - finalName = finalName.replace("\\\\", File.separator); - } - WatchPolicyNotificationTable watch = new WatchPolicyNotificationTable(); - watch.setPolicyName(finalName); - watch.setLoginIds(userId); - policyNotificationDao.save(watch); - responseValue = "You have Subscribed Successfully"; - }else{ - policyNotificationDao.delete(watchList.get(0)); - responseValue = "You have UnSubscribed Successfully"; - } - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(responseValue); - JSONObject j = new JSONObject("{watchData: " + responseString + "}"); - out.write(j.toString()); - return null; - }catch(Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyRolesController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyRolesController.java deleted file mode 100644 index dea341ea9..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyRolesController.java +++ /dev/null @@ -1,137 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.File; -import java.io.PrintWriter; -import java.nio.file.Path; -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.json.JSONObject; -import org.openecomp.policy.dao.PolicyRolesDao; -import org.openecomp.policy.rest.jpa.PolicyRoles; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; -import com.fasterxml.jackson.annotation.PropertyAccessor; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Controller -@RequestMapping("/") -public class PolicyRolesController extends RestrictedBaseController{ - - @Autowired - PolicyRolesDao policyRolesDao; - List scopelist; - - @RequestMapping(value={"/get_RolesData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getPolicyRolesEntityData(HttpServletRequest request, HttpServletResponse response){ - try{ - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - model.put("rolesDatas", mapper.writeValueAsString(policyRolesDao.getUserRoles())); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - @RequestMapping(value={"/save_NonSuperRolesData"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView SaveRolesEntityData(HttpServletRequest request, HttpServletResponse response){ - try{ - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyRoles adapter = mapper.readValue(root.get("editRoleData").toString(), PolicyRoles.class); - policyRolesDao.update(adapter); - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - String responseString = mapper.writeValueAsString(policyRolesDao.getUserRoles()); - JSONObject j = new JSONObject("{rolesDatas: " + responseString + "}"); - - out.write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - return null; - } - - @RequestMapping(value={"/get_PolicyRolesScopeData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) - public void getPolicyScopesEntityData(HttpServletRequest request, HttpServletResponse response){ - try{ - scopelist = new ArrayList(); - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - mapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY); - Path gitPath = PolicyController.getGitPath().toAbsolutePath(); - model.put("scopeDatas", mapper.writeValueAsString(readFileRepository(gitPath))); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - } - catch (Exception e){ - e.printStackTrace(); - } - } - - public List readFileRepository(Path path){ - File root = new File(path.toString()); - for ( File file : root.listFiles()){ - if(file.isDirectory()){ - String fileName = getDomain(file); - if (!(fileName.contains(".git") || fileName.equals(".DS_Store"))) { - scopelist.add(fileName); - } - readFileRepository(file.toPath()); - } - } - return scopelist; - } - - public String getDomain(File file) { - String filePath = file.getAbsolutePath(); - int startIndex = filePath.indexOf("repository") + 11; - return filePath.substring(startIndex, filePath.length()); - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyValidationController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyValidationController.java deleted file mode 100644 index 5ffdd062a..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/controller/PolicyValidationController.java +++ /dev/null @@ -1,300 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.controller; - - -import java.io.PrintWriter; -import java.util.Arrays; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.json.JSONObject; -import org.openecomp.policy.adapter.ClosedLoopFaultBody; -import org.openecomp.policy.adapter.ClosedLoopPMBody; -import org.openecomp.policy.adapter.PolicyAdapter; -import org.openecomp.policy.admin.RESTfulPAPEngine; -import org.openecomp.policy.rest.dao.SafePolicyWarningDao; -import org.openecomp.policy.rest.jpa.SafePolicyWarning; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.CharMatcher; - -@Controller -@RequestMapping("/") -public class PolicyValidationController extends RestrictedBaseController { - - public static final String CONFIG_POLICY = "Config"; - public static final String ACTION_POLICY = "Action"; - public static final String DECISION_POLICY = "Decision"; - public static final String CLOSEDLOOP_POLICY = "ClosedLoop_Fault"; - public static final String CLOSEDLOOP_PM = "ClosedLoop_PM"; - public static final String ENFORCER_CONFIG_POLICY= "Enforcer Config"; - public static final String MICROSERVICES="DCAE Micro Service"; - private Pattern pattern; - private Matcher matcher; - - private static final String EMAIL_PATTERN = - "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@" - + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; - - @Autowired - SafePolicyWarningDao safePolicyWarningDao; - - @RequestMapping(value={"/policyController/validate_policy.htm"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView validatePolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try{ - boolean valid = true; - String responseString = ""; - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PolicyAdapter policyData = (PolicyAdapter)mapper.readValue(root.get("policyData").toString(), PolicyAdapter.class); - if(policyData.getPolicyName() != null){ - String policyNameValidate = emptyValidator(policyData.getPolicyName()); - if(!policyNameValidate.contains("success")){ - responseString = responseString + "PolicyName:" + policyNameValidate; - valid = false; - }; - }else{ - responseString = responseString + "PolicyName: PolicyName Should not be empty" + "
    "; - } - if(policyData.getPolicyDescription() != null){ - String descriptionValidate = descriptionValidator(policyData.getPolicyDescription()); - if(!descriptionValidate.contains("success")){ - responseString = responseString + "Description:" + descriptionValidate; - valid = false; - } - } - - if(policyData.getPolicyType().equals(CONFIG_POLICY)){ - if (policyData.getConfigPolicyType().equals("Base") || policyData.getConfigPolicyType().equals(CLOSEDLOOP_POLICY) - || policyData.getConfigPolicyType().equals(CLOSEDLOOP_PM) || policyData.getConfigPolicyType().equals(ENFORCER_CONFIG_POLICY) || policyData.getConfigPolicyType().equals(MICROSERVICES)) { - if(policyData.getEcompName() != null){ - String ecompNameValidate = emptyValidator(policyData.getEcompName()); - if(!ecompNameValidate.contains("success")){ - responseString = responseString + "EcompName:" + ecompNameValidate; - valid = false; - } - }else{ - responseString = responseString + "Ecomp Name: Ecomp Name Should not be empty" + "
    "; - } - } - - if(policyData.getRiskType() != null){ - String riskTypeValidate = emptyValidator(policyData.getRiskType()); - if(!riskTypeValidate.contains("success")){ - responseString = responseString + "RiskType:" + riskTypeValidate; - valid = false; - }else { - SafePolicyWarning safePolicyWarningData = safePolicyWarningDao.getSafePolicyWarningDataById(policyData.getRiskType()); - if (safePolicyWarningData!=null){ - safePolicyWarningData.getMessage(); - responseString = responseString + "Messaage:" + safePolicyWarningData.getMessage(); - } - } - }else { - responseString = responseString + "Risk Type: Risk Type Should not be Empty" + "
    "; - valid = false; - } - - if(policyData.getRiskLevel() != null){ - String validateRiskLevel = emptyValidator(policyData.getRiskLevel()); - if(!validateRiskLevel.contains("success")){ - responseString = responseString + "RiskLevel:" + validateRiskLevel; - valid = false; - } - }else { - responseString = responseString + "Risk Level: Risk Level Should not be Empty" + "
    "; - valid = false; - } - - if(policyData.getGuard() != null){ - String validateGuard = emptyValidator(policyData.getGuard()); - if(!validateGuard.contains("success")){ - responseString = responseString + "Guard:" + validateGuard; - valid = false; - } - }else { - responseString = responseString + "Guard: Guard Value Should not be Empty" + "
    "; - valid = false; - } - - if(policyData.getConfigPolicyType().equals("Base")){ - if(policyData.getConfigName() != null){ - String configNameValidate = emptyValidator(policyData.getConfigName()); - if(!configNameValidate.contains("success")){ - responseString = responseString + "ConfigName:" + configNameValidate; - valid = false; - } - }else{ - responseString = responseString + "Config Name: Config Name Should not be Empty" + "
    "; - } - if(policyData.getConfigType() != null){ - String configTypeValidate = emptyValidator(policyData.getConfigType()); - if(!configTypeValidate.contains("success")){ - responseString = responseString + "ConfigType:" + configTypeValidate; - valid = false; - } - }else{ - responseString = responseString + "Config Type: Config Type Should not be Empty" + "
    "; - } - if(policyData.getConfigBodyData() != null){ - String policyType = policyData.getPolicyType(); - RESTfulPAPEngine engine = (RESTfulPAPEngine) PolicyController.getPapEngine(); - if(!engine.validatePolicyRequest(policyData, policyType)){ - responseString = responseString + "ConfigBody: Validation Failed"; - valid = false; - } - }else{ - responseString = responseString + "Config Body: Config Body Should not be Empty" + "
    "; - } - } - - - if(policyData.getJsonBodyData() != null){ - if(policyData.getConfigPolicyType().equals("ClosedLoop_PM")){ - ClosedLoopPMBody pmBody = (ClosedLoopPMBody)mapper.readValue(root.get("policyData").get("jsonBodyData").toString(), ClosedLoopPMBody.class); - if(pmBody.getEmailAddress() != null){ - String validateEmail = validateEmailAddress(pmBody.getEmailAddress().toString()); - if(!validateEmail.contains("success")){ - responseString = responseString + "Email:" + validateEmail; - valid = false; - } - }else{ - valid = true; - } - }else if(policyData.getConfigPolicyType().equals("ClosedLoop_Fault")){ - ClosedLoopFaultBody faultBody = (ClosedLoopFaultBody)mapper.readValue(root.get("policyData").get("jsonBodyData").toString(), ClosedLoopFaultBody.class); - if(faultBody.getEmailAddress() != null){ - String validateEmail = validateEmailAddress(faultBody.getEmailAddress().toString()); - if(!validateEmail.contains("success")){ - responseString = responseString + "Email:" + validateEmail; - valid = false; - } - }else{ - valid = true; - } - } - } - } - if (policyData.getPolicyType().equals(DECISION_POLICY)){ - String ecompNameValidate = emptyValidator(policyData.getEcompName()); - if(!ecompNameValidate.contains("success")){ - responseString = responseString + "EcompName:" + ecompNameValidate; - valid = false; - } - } - - if(policyData.getPolicyType().equals(ACTION_POLICY)){ - String actionPerformer = emptyValidator(policyData.getActionPerformer()); - String actionAttribute = emptyValidator(policyData.getActionAttributeValue()); - if(!actionPerformer.contains("success")){ - responseString = responseString + "ActionPerformer:" + actionPerformer; - valid = false; - }; - if(!actionAttribute.contains("success")){ - responseString = responseString + "ActionAttribute:" + actionAttribute; - valid = false; - }; - } - - if(policyData.getPolicyType().equals(CONFIG_POLICY)){ - if(valid){ - responseString = "success" + "@#"+ responseString; - } - }else{ - if(valid){ - responseString = "success"; - } - } - - PrintWriter out = response.getWriter(); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(responseString)); - JSONObject j = new JSONObject(msg); - out.write(j.toString()); - - return null; - } - catch (Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - protected String emptyValidator(String field){ - String error = "success"; - if (field.equals("") || field.contains(" ") || !field.matches("^[a-zA-Z0-9_]*$")) { - error = "The Value in Required Field will allow only '{0-9}, {a-z}, {A-Z}, _' following set of Combinations"; - return error; - } else { - if(CharMatcher.ASCII.matchesAllOf((CharSequence) field)){ - error = "success"; - }else{ - error = "The Value Contains Non ASCII Characters"; - return error; - } - } - return error; - } - - protected String descriptionValidator(String field) { - String error = "success"; - if (field.contains("@CreatedBy:") || field.contains("@ModifiedBy:")) { - error = "The value in the description shouldn't contain @CreatedBy: or @ModifiedBy:"; - return error; - } else { - error = "success"; - } - return error; - } - - public String validateEmailAddress(String emailAddressValue) { - String error = "success"; - List emailList = Arrays.asList(emailAddressValue.toString().split(",")); - for(int i =0 ; i < emailList.size() ; i++){ - pattern = Pattern.compile(EMAIL_PATTERN); - matcher = pattern.matcher(emailList.get(i).trim()); - if(!matcher.matches()){ - error = "Please check the Following Email Address is not Valid .... " +emailList.get(i).toString(); - return error; - }else{ - error = "success"; - } - } - return error; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/FunctionDefinitionDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/FunctionDefinitionDao.java deleted file mode 100644 index c216ca589..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/FunctionDefinitionDao.java +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.FunctionDefinition; - -public interface FunctionDefinitionDao { - - List getFunctionDefinition(); - List getFunctionDefinitionByName(); -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/GlobalRoleSettingsDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/GlobalRoleSettingsDao.java deleted file mode 100644 index 35aab5211..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/GlobalRoleSettingsDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.GlobalRoleSettings; - -public interface GlobalRoleSettingsDao { - - void update(GlobalRoleSettings globalRoleSettings); - List getGlobalRoleSettings(); - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/GroupEntityDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/GroupEntityDao.java deleted file mode 100644 index 8983382f7..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/GroupEntityDao.java +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.GroupEntity; - - -public abstract interface GroupEntityDao { - - public abstract List getGroupEntityData(); - - public abstract GroupEntity getPDPGroupEntity(String string); - - public abstract void savePDPGroupEntity(GroupEntity pdpGroupDataFunction); - - public abstract void deletePDPGroupEntity(GroupEntity pdpGroupDataFunction); - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PDPEntityDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PDPEntityDao.java deleted file mode 100644 index 60f7441b3..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PDPEntityDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PdpEntity; - - -public abstract interface PDPEntityDao { - - public abstract List getPDPEntityData(); - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyEditorScopesDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyEditorScopesDao.java deleted file mode 100644 index f40de6d50..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyEditorScopesDao.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PolicyEditorScopes; - - -public interface PolicyEditorScopesDao { - List getPolicyEditorScopesData(); - List getPolicyEditorScopesDataByName(); - void Save(PolicyEditorScopes policyEditorScopes); - void delete(PolicyEditorScopes policyEditorScopes); - void update(PolicyEditorScopes policyEditorScopes); - List getListOfPolicyScopes(String query); - void updateQuery(String policyScopeQuery); -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyRolesDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyRolesDao.java deleted file mode 100644 index 49cd17c10..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyRolesDao.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PolicyRoles; - -public interface PolicyRolesDao { - - List getRoles(); - List getUserRoles(); - void save(PolicyRoles role); - - void update(PolicyRoles role); - - void delete(PolicyRoles role); -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyVersionDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyVersionDao.java deleted file mode 100644 index 0c2692e6c..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/PolicyVersionDao.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.PolicyVersion; - - -public interface PolicyVersionDao { - List getPolicyVersionData(); - List getPolicyVersionEntityByName(String policyVersion); - List getPolicyVersionDataByName(); - List getActiveVersionPolicy(String query); - void Save(PolicyVersion policyVersion); - void delete(PolicyVersion policyVersion); - void update(PolicyVersion policyVersion); - void updateQuery(String policyVersion); -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RemoteCatalogValuesDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RemoteCatalogValuesDao.java deleted file mode 100644 index c2ff0f7b8..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RemoteCatalogValuesDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.RemoteCatalogValues; - -public interface RemoteCatalogValuesDao { - List getRemoteCatalogValuesData(); - List getRemoteCatalogValuesDataByName(); - void Save(RemoteCatalogValues attribute); - void delete(RemoteCatalogValues attribute); - void update(RemoteCatalogValues attribute); -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RolesDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RolesDao.java deleted file mode 100644 index 4612daea0..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RolesDao.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.model.Roles; - - - -public interface RolesDao { - - List getUserRoles(String userId); - - void save(Roles role); - - void delete(Roles role); - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RuleAlgorithmsDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RuleAlgorithmsDao.java deleted file mode 100644 index 6a9c6b303..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/RuleAlgorithmsDao.java +++ /dev/null @@ -1,31 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.RuleAlgorithms; - -public interface RuleAlgorithmsDao { - - List getRuleAlgorithms(); -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/SystemLogDbDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/SystemLogDbDao.java deleted file mode 100644 index bdfdd8f0a..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/SystemLogDbDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.SystemLogDB; - - - -public abstract interface SystemLogDbDao { - public abstract List getLoggingData(); - public abstract List getSystemAlertData(); -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/WatchPolicyNotificationDao.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/WatchPolicyNotificationDao.java deleted file mode 100644 index a43294e94..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/dao/WatchPolicyNotificationDao.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.dao; - - -import java.util.List; - -import org.openecomp.policy.rest.jpa.WatchPolicyNotificationTable; - -public interface WatchPolicyNotificationDao { - List getListData(); - List getListDataByPolicyName(String policyName); - void save(WatchPolicyNotificationTable data); - void update(WatchPolicyNotificationTable data); - void delete(WatchPolicyNotificationTable data); - List watchListQuery(String query); -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ActionPolicyDictDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ActionPolicyDictDaoImpl.java deleted file mode 100644 index b29aafec2..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ActionPolicyDictDaoImpl.java +++ /dev/null @@ -1,178 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.rest.dao.ActionPolicyDictDao; -import org.openecomp.policy.rest.jpa.ActionPolicyDict; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("ActionPolicyDictDao") -public class ActionPolicyDictDaoImpl implements ActionPolicyDictDao { - private static final Logger logger = FlexLogger.getLogger(ActionPolicyDictDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getActionDictData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - - List actionDictData = null; - try { - Criteria cr = session.createCriteria(ActionPolicyDict.class); - actionDictData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying ActionDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return actionDictData; - } - - @Override - public void Save(ActionPolicyDict action) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(action); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving ActionDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void delete(ActionPolicyDict action) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(action); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting ActionDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(ActionPolicyDict action) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(action); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating ActionDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getActionDictDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(ActionPolicyDict.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getAttributeName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying ActionDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @SuppressWarnings("unchecked") - @Override - public ActionPolicyDict getActionEntityDatabyId(String action) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - ActionPolicyDict data = null; - try { - Criteria cr = session.createCriteria(ActionPolicyDict.class); - List attributeData = cr.add(Restrictions.eq("attributeName", action)).list(); - for(Object entity : attributeData){ - data = (ActionPolicyDict) entity; - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying ActionDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/AddressGroupDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/AddressGroupDaoImpl.java deleted file mode 100644 index 132220f5f..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/AddressGroupDaoImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.rest.dao.AddressGroupDao; -import org.openecomp.policy.rest.jpa.AddressGroup; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("AddressGroupDao") -public class AddressGroupDaoImpl implements AddressGroupDao{ - private static final Logger logger = FlexLogger.getLogger(AddressGroupDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getAddressGroupData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(AddressGroup.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying AddressGroup Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - - } - - @Override - public void Save(AddressGroup attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving AddressGroup Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(AddressGroup attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting AddressGroup Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(AddressGroup attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating AddressGroup Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getAddressGroupDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(AddressGroup.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getGroupName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying AddressGroup Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/BRMSParamTemplateDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/BRMSParamTemplateDaoImpl.java deleted file mode 100644 index 0b634ff73..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/BRMSParamTemplateDaoImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.rest.dao.BRMSParamTemplateDao; -import org.openecomp.policy.rest.jpa.BRMSParamTemplate; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("BRMSParamTemplateDao") -public class BRMSParamTemplateDaoImpl implements BRMSParamTemplateDao{ - private static final Logger logger = FlexLogger.getLogger(BRMSParamTemplateDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getBRMSParamTemplateData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData =null; - try { - Criteria cr = session.createCriteria(BRMSParamTemplate.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying BRMSParamTemplate Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - - } - - @Override - public void Save(BRMSParamTemplate attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving BRMSParamTemplate Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(BRMSParamTemplate attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting BRMSParamTemplate Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(BRMSParamTemplate attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating BRMSParamTemplate Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getBRMSParamDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(BRMSParamTemplate.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getRuleName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying BRMSParamTemplate Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/DescriptiveScopeDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/DescriptiveScopeDaoImpl.java deleted file mode 100644 index 600b42ce7..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/DescriptiveScopeDaoImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.rest.dao.DescriptiveScopeDao; -import org.openecomp.policy.rest.jpa.DescriptiveScope; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("DescriptiveScopeDao") -public class DescriptiveScopeDaoImpl implements DescriptiveScopeDao{ - private static final Logger logger = FlexLogger.getLogger(DescriptiveScopeDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getDescriptiveScope() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List descriptiveScopeData = null; - try { - Criteria cr = session.createCriteria(DescriptiveScope.class); - descriptiveScopeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying DescriptiveScope Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return descriptiveScopeData; - } - - @Override - public void Save(DescriptiveScope descriptiveScope) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(descriptiveScope); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving DescriptiveScope Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(DescriptiveScope descriptiveScope) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(descriptiveScope); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting DescriptiveScope Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void update(DescriptiveScope descriptiveScope) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(descriptiveScope); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating DescriptiveScope Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getDescriptiveScopeDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(DescriptiveScope.class); - List descriptiveScopeData = cr.list(); - for(int i = 0; i < descriptiveScopeData.size(); i++){ - data.add(descriptiveScopeData.get(i).getScopeName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying DescriptiveScope Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @Override - public DescriptiveScope getDescriptiveScopeById(String name) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - DescriptiveScope data = null; - try { - Criteria cr = session.createCriteria(PolicyVersion.class); - cr.add(Restrictions.eq("scopename",name)); - data = (DescriptiveScope) cr.list().get(0); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying DescriptiveScope Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/FirewallDictionaryListDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/FirewallDictionaryListDaoImpl.java deleted file mode 100644 index e002aa962..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/FirewallDictionaryListDaoImpl.java +++ /dev/null @@ -1,196 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.rest.dao.FirewallDictionaryListDao; -import org.openecomp.policy.rest.jpa.FirewallDictionaryList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("FirewallDictionaryListDao") -public class FirewallDictionaryListDaoImpl implements FirewallDictionaryListDao { - private static final Logger logger = FlexLogger.getLogger(FirewallDictionaryListDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getFWDictionaryListData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(FirewallDictionaryList.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying FirewallDictionaryList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - - } - - @SuppressWarnings("unchecked") - @Override - public List getFWDictionaryListDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(FirewallDictionaryList.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getParentItemName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying FirewallDictionaryList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @Override - public void Save(FirewallDictionaryList firewallDictionaryList) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(firewallDictionaryList); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving FirewallDictionaryList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(FirewallDictionaryList firewallDictionaryList) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(firewallDictionaryList); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting FirewallDictionaryList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void update(FirewallDictionaryList firewallDictionaryList) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(firewallDictionaryList); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating FirewallDictionaryList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void updateQuery(String query) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - Query hbquery = session.createQuery(query); - hbquery.executeUpdate(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating FirewallDictionaryList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public FirewallDictionaryList getFWDictionaryDataById(String value) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - FirewallDictionaryList data = null; - try { - Criteria cr = session.createCriteria(FirewallDictionaryList.class); - cr = cr.add(Restrictions.eq("parentItemName",value)); - data = (FirewallDictionaryList) cr.list().get(0); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying FirewallDictionaryList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/FunctionDefinitionDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/FunctionDefinitionDaoImpl.java deleted file mode 100644 index ebb833585..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/FunctionDefinitionDaoImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.dao.FunctionDefinitionDao; -import org.openecomp.policy.rest.jpa.FunctionDefinition; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("FunctionDefinitionDao") -public class FunctionDefinitionDaoImpl implements FunctionDefinitionDao{ - private static final Logger logger = FlexLogger.getLogger(FunctionDefinitionDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getFunctionDefinitionByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(FunctionDefinition.class); - List functionDefinitionData = cr.list(); - for(int i = 0; i < functionDefinitionData.size(); i++){ - data.add(functionDefinitionData.get(i).getShortname()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying FunctionDefinition Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @SuppressWarnings("unchecked") - @Override - public List getFunctionDefinition() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List functionDefinitionData = null; - try { - Criteria cr = session.createCriteria(FunctionDefinition.class); - functionDefinitionData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying FunctionDefinition Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return functionDefinitionData; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GlobalRoleSettingsDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GlobalRoleSettingsDaoImpl.java deleted file mode 100644 index 718b8e98f..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GlobalRoleSettingsDaoImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.dao.GlobalRoleSettingsDao; -import org.openecomp.policy.rest.jpa.GlobalRoleSettings; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - -@Service("GlobalRoleSettingsDao") -public class GlobalRoleSettingsDaoImpl implements GlobalRoleSettingsDao{ - private static final Logger logger = FlexLogger.getLogger(GlobalRoleSettingsDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - - - @SuppressWarnings("unchecked") - @Override - public List getGlobalRoleSettings() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List lockdownData = null; - try { - Criteria cr = session.createCriteria(GlobalRoleSettings.class); - lockdownData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying GlobalRoleSettings Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return lockdownData; - } - - - - @Override - public void update(GlobalRoleSettings globalRoleSettings) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(globalRoleSettings); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating GlobalRoleSettings Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GroupEntityDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GroupEntityDaoImpl.java deleted file mode 100644 index 1a468253c..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GroupEntityDaoImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.dao.GroupEntityDao; -import org.openecomp.policy.rest.jpa.GroupEntity; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("PDPGroupDataDao") -public class GroupEntityDaoImpl implements GroupEntityDao{ - private static final Logger logger = FlexLogger.getLogger(GroupEntityDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getGroupEntityData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - Criteria cr = session.createCriteria(GroupEntity.class); - List groupData = null; - try { - groupData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying GroupEntity Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return groupData; - } - - @Override - public GroupEntity getPDPGroupEntity(String getgroupName) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - GroupEntity entity = null; - try { - entity = (GroupEntity) session.get(GroupEntity.class, getgroupName); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying GroupEntity Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return entity; - } - - @Override - public void savePDPGroupEntity(GroupEntity pdpGroupDataFunction) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(pdpGroupDataFunction); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving GroupEntity Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void deletePDPGroupEntity(GroupEntity pdpGroupDataFunction) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(pdpGroupDataFunction); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting GroupEntity Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GroupPolicyScopeListDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GroupPolicyScopeListDaoImpl.java deleted file mode 100644 index a51eef102..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/GroupPolicyScopeListDaoImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.rest.dao.GroupPolicyScopeListDao; -import org.openecomp.policy.rest.jpa.GroupPolicyScopeList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("GroupPolicyScopeListDao") -public class GroupPolicyScopeListDaoImpl implements GroupPolicyScopeListDao { - private static final Logger logger = FlexLogger.getLogger(GroupPolicyScopeListDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getGroupPolicyScopeListData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(GroupPolicyScopeList.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying GroupPolicyScopeList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - } - - @SuppressWarnings("unchecked") - @Override - public List getGroupPolicyScopeListDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(GroupPolicyScopeList.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getGroupName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying GroupPolicyScopeList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @Override - public void Save(GroupPolicyScopeList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving GroupPolicyScopeList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(GroupPolicyScopeList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting Attribute Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void update(GroupPolicyScopeList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating Attribute Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List CheckDuplicateEntry(String value) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = null; - try { - Criteria cr = session.createCriteria(GroupPolicyScopeList.class); - cr.add(Restrictions.eq("name",value)); - data = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying GroupPolicyScopeList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/MicroServiceModelsDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/MicroServiceModelsDaoImpl.java deleted file mode 100644 index 6c198aa11..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/MicroServiceModelsDaoImpl.java +++ /dev/null @@ -1,156 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.rest.dao.MicroServiceModelsDao; -import org.openecomp.policy.rest.jpa.MicroServiceModels; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("MicroServiceModelsDao") -public class MicroServiceModelsDaoImpl implements MicroServiceModelsDao{ - private static final Logger logger = FlexLogger.getLogger(MicroServiceModelsDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getMicroServiceModelsData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(MicroServiceModels.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying MicroServiceModels Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - - } - - @Override - public void Save(MicroServiceModels attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving MicroServiceModels Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(MicroServiceModels attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting MicroServiceModels Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(MicroServiceModels attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating MicroServiceModels Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getMSModelsDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(MicroServiceModels.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - if(attributeData.get(i).getVersion() == null || attributeData.get(i).getVersion().equals("")){ - data.add(attributeData.get(i).getModelName()); - }else{ - data.add(attributeData.get(i).getModelName() + "-v" + attributeData.get(i).getVersion()); - } - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying MicroServiceModels Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PDPEntityDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PDPEntityDaoImpl.java deleted file mode 100644 index 2a2250e87..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PDPEntityDaoImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.dao.PDPEntityDao; -import org.openecomp.policy.rest.jpa.PdpEntity; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("PDPEntityDataDao") -public class PDPEntityDaoImpl implements PDPEntityDao { - private static final Logger logger = FlexLogger.getLogger(PDPEntityDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getPDPEntityData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List pdpData = null; - try { - Criteria cr = session.createCriteria(PdpEntity.class); - pdpData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PdpEntity Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return pdpData; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyEditorScopesDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyEditorScopesDaoImpl.java deleted file mode 100644 index 4aad7efbd..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyEditorScopesDaoImpl.java +++ /dev/null @@ -1,193 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.dao.PolicyEditorScopesDao; -import org.openecomp.policy.rest.jpa.PolicyEditorScopes; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -@Service("PolicyEditorScopesDao") -public class PolicyEditorScopesDaoImpl implements PolicyEditorScopesDao { - private static final Log logger = LogFactory.getLog(PolicyEditorScopesDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getPolicyEditorScopesData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List scopeNameData = null; - try { - Criteria cr = session.createCriteria(PolicyEditorScopes.class); - scopeNameData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PolicyEditorScopes Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return scopeNameData; - } - - @SuppressWarnings("unchecked") - @Override - public List getPolicyEditorScopesDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(PolicyEditorScopes.class); - List scopeNameData = cr.list(); - for(int i = 0; i < scopeNameData.size(); i++){ - data.add(scopeNameData.get(i).getScopeName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PolicyEditorScopes Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @Override - public void Save(PolicyEditorScopes policyEditorScopes) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(policyEditorScopes); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving PolicyEditorScopes Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(PolicyEditorScopes policyEditorScopes) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(policyEditorScopes); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting PolicyEditorScopes Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void update(PolicyEditorScopes policyEditorScopes) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(policyEditorScopes); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating PolicyEditorScopes Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getListOfPolicyScopes(String query) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = null; - try { - Query hbquery = session.createQuery(query); - data = hbquery.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PolicyEditorScopes Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @Override - public void updateQuery(String policyScopeQuery) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - Query hbquery = session.createQuery(policyScopeQuery); - hbquery.executeUpdate(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating PolicyEditorScopes Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyRolesDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyRolesDaoImpl.java deleted file mode 100644 index f10a94229..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyRolesDaoImpl.java +++ /dev/null @@ -1,159 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Conjunction; -import org.hibernate.criterion.Disjunction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.dao.PolicyRolesDao; -import org.openecomp.policy.rest.jpa.PolicyRoles; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("PolicyRolesDao") -public class PolicyRolesDaoImpl implements PolicyRolesDao{ - private static final Logger logger = FlexLogger.getLogger(PolicyRolesDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getUserRoles() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List rolesData = null; - try { - Criteria cr = session.createCriteria(PolicyRoles.class); - Disjunction disjunction = Restrictions.disjunction(); - Conjunction conjunction1 = Restrictions.conjunction(); - conjunction1.add(Restrictions.eq("role", "admin")); - Conjunction conjunction2 = Restrictions.conjunction(); - conjunction2.add(Restrictions.eq("role", "editor")); - Conjunction conjunction3 = Restrictions.conjunction(); - conjunction3.add(Restrictions.eq("role", "guest")); - disjunction.add(conjunction1); - disjunction.add(conjunction2); - disjunction.add(conjunction3); - rolesData = cr.add(disjunction).list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PolicyRoles Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return rolesData; - } - - @Override - public void save(PolicyRoles role) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(role); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving PolicyRoles Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(PolicyRoles role) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(role); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting PolicyRoles Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void update(PolicyRoles role) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(role); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating PolicyRoles Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getRoles() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List rolesData = null; - try { - Criteria cr = session.createCriteria(PolicyRoles.class); - rolesData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PolicyRoles Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return rolesData; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyVersionDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyVersionDaoImpl.java deleted file mode 100644 index 02188ec47..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PolicyVersionDaoImpl.java +++ /dev/null @@ -1,216 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("PolicyVersionDao") -public class PolicyVersionDaoImpl implements PolicyVersionDao { - private static final Logger logger = FlexLogger.getLogger(PolicyVersionDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getPolicyVersionData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List versionData = null; - try { - Criteria cr = session.createCriteria(PolicyVersion.class); - versionData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PolicyVersion Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return versionData; - - } - - @SuppressWarnings("unchecked") - @Override - public List getPolicyVersionDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(PolicyVersion.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getPolicyName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PolicyVersion Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @Override - public void Save(PolicyVersion policyVersion) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(policyVersion); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving PolicyVersion Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void delete(PolicyVersion policyVersion) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(policyVersion); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting PolicyVersion Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(PolicyVersion policyVersion) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(policyVersion); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating PolicyVersion Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @SuppressWarnings("unchecked") - @Override - public List getPolicyVersionEntityByName(String policyVersion) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = null; - try { - Criteria cr = session.createCriteria(PolicyVersion.class); - cr.add(Restrictions.eq("policyName",policyVersion)); - data = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PolicyVersion Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @SuppressWarnings("unchecked") - @Override - public List getActiveVersionPolicy(String query) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = null; - try { - Query hbquery = session.createQuery(query); - data = hbquery.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PolicyVersion Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @Override - public void updateQuery(String policyVersion) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - Query hbquery = session.createQuery(policyVersion); - hbquery.executeUpdate(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating PolicyVersion Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PrefixListDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PrefixListDaoImpl.java deleted file mode 100644 index cc8701361..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/PrefixListDaoImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.rest.dao.PrefixListDao; -import org.openecomp.policy.rest.jpa.PREFIXLIST; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("PrefixListDao") -public class PrefixListDaoImpl implements PrefixListDao{ - private static final Logger logger = FlexLogger.getLogger(PrefixListDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getPREFIXLISTData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(PREFIXLIST.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PREFIXLIST Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - - } - - @Override - public void Save(PREFIXLIST attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving PREFIXLIST Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(PREFIXLIST attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting PREFIXLIST Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(PREFIXLIST attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating PREFIXLIST Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getPrefixListDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(PREFIXLIST.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getPrefixListName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PREFIXLIST Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RemoteCatalogValuesDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RemoteCatalogValuesDaoImpl.java deleted file mode 100644 index 5f42ba73e..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RemoteCatalogValuesDaoImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.dao.RemoteCatalogValuesDao; -import org.openecomp.policy.rest.jpa.RemoteCatalogValues; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("RemoteCatalogValuesDao") -public class RemoteCatalogValuesDaoImpl implements RemoteCatalogValuesDao { - private static final Logger logger = FlexLogger.getLogger(RemoteCatalogValuesDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - - @SuppressWarnings("unchecked") - @Override - public List getRemoteCatalogValuesData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(RemoteCatalogValues.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying RemoteCatalogValues Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - } - - @SuppressWarnings("unchecked") - @Override - public List getRemoteCatalogValuesDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(RemoteCatalogValues.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying RemoteCatalogValues Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @Override - public void Save(RemoteCatalogValues attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving RemoteCatalogValues Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void delete(RemoteCatalogValues attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting RemoteCatalogValues Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(RemoteCatalogValues attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating RemoteCatalogValues Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RolesDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RolesDaoImpl.java deleted file mode 100644 index 7e5c860de..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RolesDaoImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.dao.RolesDao; -import org.openecomp.policy.model.Roles; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("RolesDao") -public class RolesDaoImpl implements RolesDao{ - private static final Logger logger = FlexLogger.getLogger(RolesDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @Override - public void save(Roles role) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(role); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving Roles Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void delete(Roles role) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - System.out.println("delete from Roles where loginid = '"+role.getLoginId()+"'"); - Query q = session.createQuery(" delete from Roles where loginid = '"+role.getLoginId()+"'"); - q.executeUpdate(); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting Roles Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @SuppressWarnings("unchecked") - @Override - public List getUserRoles(String userId) { - System.out.println("User Id:"+userId); - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List rolesData = null; - try { - Criteria cr = session.createCriteria(Roles.class); - cr = cr.add(Restrictions.eq("loginId",userId)); - rolesData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying Roles Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return rolesData; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RuleAlgorithmsDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RuleAlgorithmsDaoImpl.java deleted file mode 100644 index 149038501..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/RuleAlgorithmsDaoImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.dao.RuleAlgorithmsDao; -import org.openecomp.policy.rest.jpa.RuleAlgorithms; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("RuleAlgorithmsDao") -public class RuleAlgorithmsDaoImpl implements RuleAlgorithmsDao{ - private static final Logger logger = FlexLogger.getLogger(RuleAlgorithmsDaoImpl.class); - @Autowired - SessionFactory sessionFactory; - - @SuppressWarnings("unchecked") - @Override - public List getRuleAlgorithms() { - Session session = sessionFactory.openSession(); - Transaction tx = session.beginTransaction(); - List ruleAlgorithmsData = null; - try { - Criteria cr = session.createCriteria(RuleAlgorithms.class); - ruleAlgorithmsData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying RuleAlgorithms Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return ruleAlgorithmsData; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SafePolicyWarningDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SafePolicyWarningDaoImpl.java deleted file mode 100644 index 209d60b2d..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SafePolicyWarningDaoImpl.java +++ /dev/null @@ -1,181 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.rest.dao.SafePolicyWarningDao; -import org.openecomp.policy.rest.jpa.SafePolicyWarning; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -@Service("SafePolicyWarningDao") -public class SafePolicyWarningDaoImpl implements SafePolicyWarningDao { - private static final Log logger = LogFactory.getLog(SafePolicyWarningDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - public SessionFactory getSessionfactory() { - return sessionfactory; - } - - public void setSessionfactory(SessionFactory sessionfactory) { - this.sessionfactory = sessionfactory; - } - - @SuppressWarnings("unchecked") - @Override - public List getSafePolicyWarningData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(SafePolicyWarning.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SafePolicyWarning Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - } - - @SuppressWarnings("unchecked") - @Override - public List getSafePolicyWarningDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(SafePolicyWarning.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SafePolicyWarning Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @Override - public void Save(SafePolicyWarning attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving SafePolicyWarning Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(SafePolicyWarning attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting Attribute Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void update(SafePolicyWarning attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating Attribute Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public SafePolicyWarning getSafePolicyWarningDataById(String riskType) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - SafePolicyWarning data = null; - try { - Criteria cr = session.createCriteria(SafePolicyWarning.class); - cr.add(Restrictions.eq("riskType",riskType)); - data = (SafePolicyWarning) cr.list().get(0); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SafePolicyWarning Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SecurityZoneDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SecurityZoneDaoImpl.java deleted file mode 100644 index e3661ceb9..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SecurityZoneDaoImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.rest.dao.SecurityZoneDao; -import org.openecomp.policy.rest.jpa.SecurityZone; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("SecurityZoneDao") -public class SecurityZoneDaoImpl implements SecurityZoneDao{ - private static final Logger logger = FlexLogger.getLogger(SecurityZoneDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getSecurityZoneData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(SecurityZone.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SecurityZone Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - - } - - @Override - public void Save(SecurityZone attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving SecurityZone Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void delete(SecurityZone attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting SecurityZone Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(SecurityZone attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating SecurityZone Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getSecurityZoneDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(SecurityZone.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getZoneName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SecurityZone Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ServiceGroupDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ServiceGroupDaoImpl.java deleted file mode 100644 index f2e9c5be8..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ServiceGroupDaoImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.rest.dao.ServiceGroupDao; -import org.openecomp.policy.rest.jpa.GroupServiceList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("ServiceGroupDao") -public class ServiceGroupDaoImpl implements ServiceGroupDao{ - private static final Logger logger = FlexLogger.getLogger(ServiceGroupDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getGroupServiceListData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(GroupServiceList.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying GroupServiceList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - - } - - @Override - public void Save(GroupServiceList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving GroupServiceList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(GroupServiceList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting GroupServiceList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(GroupServiceList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating GroupServiceList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getGroupServiceDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(GroupServiceList.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getGroupName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying GroupServiceList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ServiceListDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ServiceListDaoImpl.java deleted file mode 100644 index 0f80a16d3..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/ServiceListDaoImpl.java +++ /dev/null @@ -1,154 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.rest.dao.ServiceListDao; -import org.openecomp.policy.rest.jpa.ServiceList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("ServiceListDao") -public class ServiceListDaoImpl implements ServiceListDao { - private static final Logger logger = FlexLogger.getLogger(ServiceListDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getServiceListData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(ServiceList.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying ServiceList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - - } - - @Override - public void Save(ServiceList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving ServiceList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(ServiceList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting ServiceList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(ServiceList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating ServiceList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getServiceListDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(ServiceList.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getServiceName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying ServiceList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SystemLogDbDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SystemLogDbDaoImpl.java deleted file mode 100644 index 927d20f2f..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/SystemLogDbDaoImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.conf.HibernateSession; -import org.openecomp.policy.controller.PolicyController; -import org.openecomp.policy.dao.SystemLogDbDao; -import org.openecomp.policy.rest.jpa.SystemLogDB; -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - -@Service("SystemLogDbDao") -public class SystemLogDbDaoImpl implements SystemLogDbDao { - private static final Logger logger = FlexLogger.getLogger(SystemLogDbDaoImpl.class); - @SuppressWarnings("unchecked") - @Override - public List getLoggingData() { - Session session = HibernateSession.getSession(); - Transaction tx = session.beginTransaction(); - List system = null; - try { - String sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) ORDER BY date DESC limit "+PolicyController.logTableLimit+""; - Criteria cr = session.createCriteria(SystemLogDB.class); - cr.add(Restrictions.sqlRestriction(sqlWhere)); - system = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDB Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return system; - } - - @SuppressWarnings("unchecked") - @Override - public List getSystemAlertData() { - Session session = HibernateSession.getSession();; - Transaction tx = session.beginTransaction(); - List system = null; - try { - String sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) and logtype = 'error' ORDER BY date DESC limit "+PolicyController.systemAlertTableLimit+""; - Criteria cr = session.createCriteria(SystemLogDB.class); - cr.add(Restrictions.sqlRestriction(sqlWhere)); - system = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDB Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return system; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/TermListDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/TermListDaoImpl.java deleted file mode 100644 index ff8f1f26d..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/TermListDaoImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.rest.dao.TermListDao; -import org.openecomp.policy.rest.jpa.TermList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("TermListDao") -public class TermListDaoImpl implements TermListDao{ - private static final Logger logger = FlexLogger.getLogger(TermListDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getTermListData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData = null; - try { - Criteria cr = session.createCriteria(TermList.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying TermList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - - } - - @Override - public void Save(TermList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving TermList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(TermList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting TermList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(TermList attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating TermList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getTermListDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(TermList.class); - List attributeData = cr.list(); - for(int i = 0; i < attributeData.size(); i++){ - data.add(attributeData.get(i).getTermName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying TermList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @Override - public TermList getTermListValueByName(String name) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - TermList data = null; - try { - Criteria cr = session.createCriteria(TermList.class); - cr.add(Restrictions.eq("termName",name)); - data = (TermList) cr.list().get(0); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying TermList Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/UserInfoDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/UserInfoDaoImpl.java deleted file mode 100644 index ad13b5940..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/UserInfoDaoImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.openecomp.policy.rest.dao.UserInfoDao; -import org.openecomp.policy.rest.jpa.UserInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - -@Service("UserInfoDao") -public class UserInfoDaoImpl implements UserInfoDao{ - private static final Logger logger = FlexLogger.getLogger(UserInfoDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - public SessionFactory getSessionfactory() { - return sessionfactory; - } - - public void setSessionfactory(SessionFactory sessionfactory) { - this.sessionfactory = sessionfactory; - } - - @Override - public void save(UserInfo userInfo) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(userInfo); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving UserInfo Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @SuppressWarnings("unchecked") - @Override - public List getUserInfo() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List userData = null; - try { - Criteria cr = session.createCriteria(UserInfo.class); - userData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying UserInfo Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return userData; - } - - @Override - public String getUserName(String loginid) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - UserInfo user = null; - try { - user = (UserInfo) session.get(UserInfo.class, loginid); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying UserInfo Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return user.getUserName().toString(); - } - - @Override - public UserInfo getUserInfoByLoginId(String loginid) { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/VarbindDictionaryDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/VarbindDictionaryDaoImpl.java deleted file mode 100644 index a24c0e7ad..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/VarbindDictionaryDaoImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.ArrayList; -import java.util.List; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.rest.dao.VarbindDictionaryDao; -import org.openecomp.policy.rest.jpa.VarbindDictionary; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("VarbindDictionaryDao") -public class VarbindDictionaryDaoImpl implements VarbindDictionaryDao { - private static final Logger logger = FlexLogger.getLogger(VarbindDictionaryDaoImpl.class); - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getVarbindDictionaryData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List varbindDictionaryData = null; - try { - Criteria cr = session.createCriteria(VarbindDictionary.class); - varbindDictionaryData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying VarbindDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return varbindDictionaryData; - - } - - @Override - public void Save(VarbindDictionary varbindDictionary) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(varbindDictionary); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving VarbindDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(VarbindDictionary varbindDictionary) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(varbindDictionary); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting VarbindDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(VarbindDictionary varbindDictionary) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(varbindDictionary); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating VarbindDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getVarbindDataByName() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = new ArrayList(); - try { - Criteria cr = session.createCriteria(VarbindDictionary.class); - List varbindDictionaryData = cr.list(); - for(int i = 0; i < varbindDictionaryData.size(); i++){ - data.add(varbindDictionaryData.get(i).getVarbindName()); - } - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying VarbindDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @SuppressWarnings("unchecked") - @Override - public List getVarbindEntityByName(String value) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = null; - try { - Criteria cr = session.createCriteria(VarbindDictionary.class); - cr.add(Restrictions.eq("varbindName",value)); - data = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying VarbindDictionary Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/WatchPolicyNotificationDaoImpl.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/WatchPolicyNotificationDaoImpl.java deleted file mode 100644 index b4b807fbd..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/daoImp/WatchPolicyNotificationDaoImpl.java +++ /dev/null @@ -1,173 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.daoImp; - - -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.criterion.Restrictions; -import org.openecomp.policy.dao.WatchPolicyNotificationDao; -import org.openecomp.policy.rest.jpa.WatchPolicyNotificationTable; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("WatchPolicyNotificationDao") -public class WatchPolicyNotificationDaoImpl implements WatchPolicyNotificationDao{ - - private static final Logger logger = FlexLogger.getLogger(WatchPolicyNotificationDaoImpl.class); - - @Autowired - SessionFactory sessionfactory; - - @SuppressWarnings("unchecked") - @Override - public List getListData() { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List attributeData =null; - try { - Criteria cr = session.createCriteria(WatchPolicyNotificationTable.class); - attributeData = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying WatchPolicyNotificationTable Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return attributeData; - } - - @Override - public void save(WatchPolicyNotificationTable attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.persist(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving WatchPolicyNotificationTable Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @Override - public void delete(WatchPolicyNotificationTable attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.delete(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting WatchPolicyNotificationTable Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - } - - @Override - public void update(WatchPolicyNotificationTable attribute) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - try { - session.update(attribute); - tx.commit(); - }catch(Exception e){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating WatchPolicyNotificationTable Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - - } - - @SuppressWarnings("unchecked") - @Override - public List getListDataByPolicyName(String policyName) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = null; - try { - Criteria cr = session.createCriteria(WatchPolicyNotificationTable.class); - cr.add(Restrictions.eq("policyName",policyName)); - data = cr.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying WatchPolicyNotificationTable Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - - @SuppressWarnings("unchecked") - @Override - public List watchListQuery(String query) { - Session session = sessionfactory.openSession(); - Transaction tx = session.beginTransaction(); - List data = null; - try { - Query hbquery = session.createQuery(query); - data = hbquery.list(); - tx.commit(); - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying WatchPolicyNotificationTable Table"+e); - }finally{ - try{ - session.close(); - }catch(Exception e1){ - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1); - } - } - return data; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/ElkConnector.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/ElkConnector.java deleted file mode 100644 index 617e67ccb..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/ElkConnector.java +++ /dev/null @@ -1,1235 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.elk.client; - - -import io.searchbox.action.Action; -import io.searchbox.client.JestClient; -import io.searchbox.client.JestClientFactory; -import io.searchbox.client.JestResult; -import io.searchbox.client.config.HttpClientConfig; -import io.searchbox.core.Delete; -import io.searchbox.core.Get; -import io.searchbox.core.Index; -import io.searchbox.core.Search; -import io.searchbox.core.Search.Builder; -import io.searchbox.indices.IndicesExists; -import io.searchbox.indices.type.TypeExist; -import io.searchbox.params.Parameters; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Map.Entry; - -import javax.xml.bind.JAXBException; - -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.index.query.QueryStringQueryBuilder; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.kohsuke.args4j.CmdLineException; -import org.kohsuke.args4j.CmdLineParser; -import org.kohsuke.args4j.Option; -import org.openecomp.policy.elk.converter.ElkRecord; -import org.openecomp.policy.elk.converter.Xacml2Elk; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -public interface ElkConnector { - - public static final String ELK_URL = "http://localhost:9200"; - public static final String ELK_INDEX_POLICY = "policy"; - - public enum PolicyIndexType { - config, - action, - decision, - closedloop, - all, - } - - public enum PolicyType { - Config, - Action, - Decision, - Config_Fault, - Config_PM, - Config_FW, - Config_MS, - none, - } - - public enum PolicyBodyType { - json, - xml, - properties, - txt, - none, - } - - public ElkRecord create(PolicyType type, String name, String owner, String scope, - File xacmlFile, PolicyBodyType bodyType, String body, - File destinationDir) - throws IllegalStateException; - - public boolean testAndUpdate(File xacmlFile) throws IllegalStateException; - - public JestResult policy(String policyId) - throws IllegalStateException, IllegalArgumentException; - - public boolean clone(String origPolicyId, String clonePolicyId) - throws IllegalStateException; - - public boolean delete(File xacmlFile) - throws IllegalStateException; - - public ArrayList policyLocators(PolicyIndexType type, String text,int connector) - throws IllegalStateException, IllegalArgumentException; - - public ArrayList policyLocators(PolicyIndexType type, String text, - ArrayList,ArrayList>> filter_s,int connector) - throws IllegalStateException, IllegalArgumentException; - - public JestResult search(PolicyIndexType type, String text) - throws IllegalStateException, IllegalArgumentException; - - public JestResult search(PolicyIndexType type, String text, - ArrayList,ArrayList>> filter_s) - throws IllegalStateException, IllegalArgumentException; - - public boolean update(File xacmlFile) throws IllegalStateException; - - public ElkConnector singleton = new ElkConnectorImpl(); - - public static PolicyIndexType toPolicyIndexType(PolicyType type) - throws IllegalArgumentException { - if (type == null) - throw new IllegalArgumentException("Unsupported NULL type conversion"); - - switch(type) { - case Config: - return PolicyIndexType.config; - case Action: - return PolicyIndexType.action; - case Decision: - return PolicyIndexType.decision; - case Config_Fault: - return PolicyIndexType.closedloop; - case Config_PM: - return PolicyIndexType.closedloop; - case Config_FW: - return PolicyIndexType.config; - case Config_MS: - return PolicyIndexType.config; - case none: - return PolicyIndexType.all; - default: - throw new IllegalArgumentException("Unsupported type conversion to index: " + type.name()); - } - } - - public static PolicyIndexType toPolicyIndexType(String policyName) - throws IllegalArgumentException { - if (policyName == null) - throw new IllegalArgumentException("Unsupported NULL policy name conversion"); - - if (policyName.startsWith("Config_Fault")) { - return PolicyIndexType.closedloop; - } else if (policyName.startsWith("Config_PM")) { - return PolicyIndexType.closedloop; - } else if (policyName.startsWith("Config_FW")) { - return PolicyIndexType.config; - } else if (policyName.startsWith("Config_MS")) { - return PolicyIndexType.config; - }else if (policyName.startsWith("Action")) { - return PolicyIndexType.action; - } else if (policyName.startsWith("Decision")) { - return PolicyIndexType.decision; - } else if (policyName.startsWith("Config")) { - return PolicyIndexType.config; - } else { - throw new IllegalArgumentException - ("Unsupported policy name conversion to index: " + - policyName); - } - } - - public static PolicyType toPolicyType(String policyName) - throws IllegalArgumentException { - if (policyName == null) - throw new IllegalArgumentException("Unsupported NULL policy name conversion to Policy Type"); - - if (policyName.startsWith("Config_Fault")) { - return PolicyType.Config_Fault; - } else if (policyName.startsWith("Config_PM")) { - return PolicyType.Config_PM; - } else if (policyName.startsWith("Config_FW")) { - return PolicyType.Config_FW; - } else if (policyName.startsWith("Config_MS")) { - return PolicyType.Config_MS; - }else if (policyName.startsWith("Action")) { - return PolicyType.Action; - } else if (policyName.startsWith("Decision")) { - return PolicyType.Decision; - } else if (policyName.startsWith("Config")) { - return PolicyType.Config; - } else { - throw new IllegalArgumentException - ("Unsupported policy name conversion to index: " + - policyName); - } - } - - public static void main(String args[]) - throws JAXBException, IOException, CmdLineException, IllegalStateException { - ElkConnectorImpl.CLIOptions cliOptions = new ElkConnectorImpl.CLIOptions(); - CmdLineParser cliParser= new CmdLineParser(cliOptions); - try { - cliParser.parseArgument(args); - } catch (CmdLineException e) { - System.out.println("Usage: ElkConnector"); - cliParser.printUsage(System.out); - throw e; - } - - if (cliOptions.searchText != null && !cliOptions.searchText.isEmpty()) { - ArrayList locators = - ElkConnector.singleton.policyLocators(PolicyIndexType.all, cliOptions.searchText,0); - for (PolicyLocator l: locators) { - System.out.println(l); - } - } else if (cliOptions.testFile != null && cliOptions.testFile.canRead()) { - boolean ok = ElkConnector.singleton.testAndUpdate(cliOptions.testFile); - System.out.println(cliOptions.testFile.getName() + ":" + ok); - } - } -} - -class ElkConnectorImpl implements ElkConnector { - - protected static class CLIOptions { - @Option(name="-s", usage="search", aliases={"-search", "--search"}, required=false, metaVar="") - protected String searchText; - - @Option(name="-e", usage="test and update policy if not exists", aliases={"-exist", "--exists"}, required=false, metaVar="") - protected File testFile; - - @Option(name = "-h", aliases = {"-help", "--help"}, usage = "print this message") - private boolean help = false; - }; - - private static final String POLICY_RESULT_FIELDS = "[ \"Policy.PolicyType\", " + - "\"Policy.PolicyName\", " + - "\"Policy.Owner\", " + - "\"Policy.Scope\", " + - "\"Policy.PolicyId\", " + - "\"Policy.Version\" ]"; - - private static final String SOURCE_RESULT_FIELDS = "\"_source\": " + POLICY_RESULT_FIELDS; - - private static final Logger logger = FlexLogger.getLogger(ElkConnector.class); - - protected final JestClientFactory jestFactory = new JestClientFactory(); - protected final JestClient jestClient; - protected static int QUERY_MAXRECORDS = 1000; - - public ElkConnectorImpl() { - if (logger.isDebugEnabled()) logger.debug("ENTER: -"); - - HttpClientConfig jestClientConfig = - new HttpClientConfig.Builder(ELK_URL).multiThreaded(true).build(); - jestFactory.setHttpClientConfig(jestClientConfig); - jestClient = jestFactory.getObject(); - } - - protected boolean isType(PolicyIndexType type) throws IOException { - if (logger.isDebugEnabled()) logger.debug("ENTER: -"); - - try { - Action typeQuery = new TypeExist.Builder(ELK_INDEX_POLICY). - addType(type.toString()). - build(); - JestResult result = jestClient.execute(typeQuery); - - if (logger.isInfoEnabled()) { - logger.info("JSON:" + result.getJsonString()); - logger.info("ERROR:" + result.getErrorMessage()); - logger.info("PATH:" + result.getPathToResult()); - logger.info(result.getJsonObject()); - } - return result.isSucceeded(); - } catch (IOException e) { - logger.warn("Error checking type existance of " + type.toString() + - ": " + e.getMessage(), e); - throw e; - } - } - - protected boolean isIndex() throws IOException { - try { - Action indexQuery = - new IndicesExists.Builder(ELK_INDEX_POLICY).build(); - - JestResult result = jestClient.execute(indexQuery); - if (logger.isInfoEnabled()) { - logger.info("JSON:" + result.getJsonString()); - logger.info("ERROR:" + result.getErrorMessage()); - logger.info("PATH:" + result.getPathToResult()); - logger.info(result.getJsonObject()); - } - return result.isSucceeded(); - } catch (IOException e) { - logger.warn("Error checking index existance of " + - ELK_INDEX_POLICY + - ": " + e.getMessage(), e); - throw e; - } - } - - @Override - public JestResult search(PolicyIndexType type, String text) throws IllegalStateException, IllegalArgumentException { - if (logger.isTraceEnabled()) - logger.trace("ENTER: " + text); - - if (text == null || text.isEmpty()) { - throw new IllegalArgumentException("No search string provided"); - } - - // MatchQueryBuilder mQ = QueryBuilders.matchQuery("_all", text); - QueryStringQueryBuilder mQ = QueryBuilders.queryStringQuery(text); - SearchSourceBuilder searchSourceBuilder = - new SearchSourceBuilder().query(mQ). - fetchSource(new String[]{"Policy.PolicyType", - "Policy.PolicyName", - "Policy.Owner", - "Policy.Scope", - "Policy.PolicyId", - "Policy.Version"}, - null); - Builder searchBuilder = new Search.Builder(searchSourceBuilder.toString()). - addIndex(ELK_INDEX_POLICY). - setParameter(Parameters.SIZE, ElkConnectorImpl.QUERY_MAXRECORDS); - - if (type == null || type == PolicyIndexType.all) { - for (PolicyIndexType pT: PolicyIndexType.values()) { - if (pT != PolicyIndexType.all) { - searchBuilder.addType(pT.toString()); - } - } - } else { - searchBuilder.addType(type.toString()); - } - - Search search = searchBuilder.build(); - - JestResult result; - try { - result = jestClient.execute(search); - } catch (IOException ioe) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - search + ": " + ioe.getMessage(), ioe); - throw new IllegalStateException(ioe); - } - - if (result.isSucceeded()) { - if (logger.isInfoEnabled()) - logger.info("OK:" + result.getResponseCode() + ":" + search + ": " + - result.getPathToResult() + ":" + System.lineSeparator() + - result.getJsonString()); - } else { - /* Unsuccessful search */ - if (logger.isWarnEnabled()) - logger.warn(XACMLErrorConstants.ERROR_PROCESS_FLOW + ":" + - result.getResponseCode() + ": " + - search.getURI() + ":" + - result.getPathToResult() + ":" + - result.getJsonString() + ":" + - result.getErrorMessage()); - - String errorMessage = result.getErrorMessage(); - if (errorMessage != null && !errorMessage.isEmpty()) { - String xMessage = errorMessage; - if (errorMessage.contains("TokenMgrError")) { - int indexError = errorMessage.lastIndexOf("TokenMgrError"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("QueryParsingException")) { - int indexError = errorMessage.lastIndexOf("QueryParsingException"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("JsonParseException")) { - int indexError = errorMessage.lastIndexOf("JsonParseException"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("Parse Failure")) { - int indexError = errorMessage.lastIndexOf("Parse Failure"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("SearchParseException")) { - int indexError = errorMessage.lastIndexOf("SearchParseException"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else { - xMessage = result.getErrorMessage(); - } - throw new IllegalStateException(xMessage); - } - } - - return result; - } - - public JestResult searchKey(PolicyIndexType type, String text, - ArrayList,ArrayList>> filter_s,int connector) - throws IllegalStateException, IllegalArgumentException { - if (logger.isTraceEnabled()) - logger.trace("ENTER: " + text); - - if (filter_s == null || filter_s.size() <= 0) { - return search(type, text); - } - - String matches_s = ""; - - if(connector==0)// AND CONNECTOR - { - matches_s = "{\n" + - " " + SOURCE_RESULT_FIELDS + ",\n" + - " \"size\" : "+ ElkConnectorImpl.QUERY_MAXRECORDS + ",\n" + - " \"query\": {\n" + - " \"bool\" : {\n" + - " \"must\" : ["; - } - else if (connector ==1)//OR CONNECTOR - { - matches_s = "{\n" + - " " + SOURCE_RESULT_FIELDS + ",\n" + - " \"size\" : "+ ElkConnectorImpl.QUERY_MAXRECORDS + ",\n" + - " \"query\": {\n" + - " \"bool\" : {\n" + - " \"should\" : ["; - } - - for (Pair,ArrayList> p : filter_s) { - ArrayList name_s = p.left(); - ArrayList value_s = p.right(); - - if (name_s == null || name_s.size() <= 0) { - if (logger.isWarnEnabled()) - logger.warn("Defaulting to text search: Empty field name array passed in"); - return search(type, text); - } - - if (logger.isDebugEnabled()) { - for (String n: name_s) { - logger.debug("Filter Name: " + n); - } - } - - if (value_s == null || value_s.size() <= 0) { - if (logger.isWarnEnabled()) - logger.warn("Defaulting to text search: Empty field value array passed in"); - return search(type, text); - } - - if (logger.isDebugEnabled()) { - for (String v: value_s) { - logger.debug("Filter Value: " + v); - } - } - - /* common case: # filter names == # filter values */ - if (name_s.size() == value_s.size()) { - String match = ""; - for (int i=0; i value_s.size() && (value_s.size() == 1)) { - String match = - "{ \"multi_match\": { \"query\": \"" + value_s.get(0) + "\", \"type\": \"phrase\", \"fields\": ["; - for (String n: name_s) { - match += " \"" + n + "\","; - } - match = match.substring(0, match.length()-1); - //match += " ] } },"; - match += " ] } },";//debug - if (logger.isDebugEnabled()) - logger.debug("Adding Match Line: " + match); - matches_s = matches_s + "\n " + match; - } else { - if (logger.isWarnEnabled()) - logger.warn("Defaulting to text search: different number of filter names and values"); - return search(type, text); - } - } - - matches_s = matches_s.substring(0, matches_s.length()-1); // remove last comma - - matches_s = matches_s + - " ]\n" + - " }\n" + - " }\n" + - "}"; - - if (logger.isDebugEnabled()) { - logger.debug(matches_s); - } - - Builder searchBuilder = new Search.Builder(matches_s). - addIndex(ELK_INDEX_POLICY); - - if (type == null || type == PolicyIndexType.all) { - for (PolicyIndexType pT: PolicyIndexType.values()) { - if (pT != PolicyIndexType.all) { - searchBuilder.addType(pT.toString()); - } - } - } else { - searchBuilder.addType(type.toString()); - } - - Search search = searchBuilder.build(); - - JestResult result; - try { - result = jestClient.execute(search); - } catch (IOException ioe) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - search + ": " + ioe.getMessage(), ioe); - throw new IllegalStateException(ioe); - } - - if (result.isSucceeded()) { - if (logger.isInfoEnabled()) - logger.info("OK:" + result.getResponseCode() + ":" + search + ": " + - result.getPathToResult() + ":" + System.lineSeparator() + - result.getJsonString()); - } else { - /* Unsuccessful search */ - if (logger.isWarnEnabled()) - logger.warn(XACMLErrorConstants.ERROR_PROCESS_FLOW + ":" + - result.getResponseCode() + ": " + - search.getURI() + ":" + - result.getPathToResult() + ":" + - result.getJsonString() + ":" + - result.getErrorMessage()); - - String errorMessage = result.getErrorMessage(); - if (errorMessage != null && !errorMessage.isEmpty()) { - String xMessage = errorMessage; - if (errorMessage.contains("TokenMgrError")) { - int indexError = errorMessage.lastIndexOf("TokenMgrError"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("QueryParsingException")) { - int indexError = errorMessage.lastIndexOf("QueryParsingException"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("JsonParseException")) { - int indexError = errorMessage.lastIndexOf("JsonParseException"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("Parse Failure")) { - int indexError = errorMessage.lastIndexOf("Parse Failure"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("SearchParseException")) { - int indexError = errorMessage.lastIndexOf("SearchParseException"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else { - xMessage = result.getErrorMessage(); - } - throw new IllegalStateException(xMessage); - } - } - - return result; - } - - - @Override - public JestResult search(PolicyIndexType type, String text, - ArrayList,ArrayList>> filter_s) - throws IllegalStateException, IllegalArgumentException { - if (logger.isTraceEnabled()) - logger.trace("ENTER: " + text); - - if (filter_s == null || filter_s.size() <= 0) { - return search(type, text); - } - - String matches_s = ""; - matches_s = "{\n" + - " " + SOURCE_RESULT_FIELDS + ",\n" + - " \"size\" : "+ ElkConnectorImpl.QUERY_MAXRECORDS + ",\n" + - " \"query\": {\n" + - " \"bool\" : {\n" + - " \"must\" : ["; - for (Pair,ArrayList> p : filter_s) { - ArrayList name_s = p.left(); - ArrayList value_s = p.right(); - - if (name_s == null || name_s.size() <= 0) { - if (logger.isWarnEnabled()) - logger.warn("Defaulting to text search: Empty field name array passed in"); - return search(type, text); - } - - if (logger.isDebugEnabled()) { - for (String n: name_s) { - logger.debug("Filter Name: " + n); - } - } - - if (value_s == null || value_s.size() <= 0) { - if (logger.isWarnEnabled()) - logger.warn("Defaulting to text search: Empty field value array passed in"); - return search(type, text); - } - - if (logger.isDebugEnabled()) { - for (String v: value_s) { - logger.debug("Filter Value: " + v); - } - } - - /* common case: # filter names == # filter values */ - if (name_s.size() == value_s.size()) { - String match = ""; - for (int i=0; i value_s.size() && (value_s.size() == 1)) { - String match = - "{ \"multi_match\": { \"query\": \"" + value_s.get(0) + "\", \"type\": \"phrase\", \"fields\": ["; - for (String n: name_s) { - match += " \"" + n + "\","; - } - match = match.substring(0, match.length()-1); - match += " ] } },"; - if (logger.isDebugEnabled()) - logger.debug("Adding Match Line: " + match); - matches_s = matches_s + "\n " + match; - } else { - if (logger.isWarnEnabled()) - logger.warn("Defaulting to text search: different number of filter names and values"); - return search(type, text); - } - } - if (text != null && !text.isEmpty()) { - if (logger.isDebugEnabled()) - logger.debug("Adding Match Line for search text: " + text); - - final JsonObject jsonText = new JsonObject(); - jsonText.addProperty("_all", text); - String escapedText = jsonText.toString(); - - matches_s = matches_s + "\n " + - "{ \"match\": " + - escapedText + " },"; - } - matches_s = matches_s.substring(0, matches_s.length()-1); // remove last comma - matches_s = matches_s + "\n" + - " ]\n" + - " }\n" + - " }\n" + - "}"; - - if (logger.isDebugEnabled()) { - logger.debug(matches_s); - } - - Builder searchBuilder = new Search.Builder(matches_s). - addIndex(ELK_INDEX_POLICY); - - if (type == null || type == PolicyIndexType.all) { - for (PolicyIndexType pT: PolicyIndexType.values()) { - if (pT != PolicyIndexType.all) { - searchBuilder.addType(pT.toString()); - } - } - } else { - searchBuilder.addType(type.toString()); - } - - Search search = searchBuilder.build(); - - JestResult result; - try { - result = jestClient.execute(search); - } catch (IOException ioe) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - search + ": " + ioe.getMessage(), ioe); - throw new IllegalStateException(ioe); - } - - if (result.isSucceeded()) { - if (logger.isInfoEnabled()) - logger.info("OK:" + result.getResponseCode() + ":" + search + ": " + - result.getPathToResult() + ":" + System.lineSeparator() + - result.getJsonString()); - } else { - /* Unsuccessful search */ - if (logger.isWarnEnabled()) - logger.warn(XACMLErrorConstants.ERROR_PROCESS_FLOW + ":" + - result.getResponseCode() + ": " + - search.getURI() + ":" + - result.getPathToResult() + ":" + - result.getJsonString() + ":" + - result.getErrorMessage()); - - String errorMessage = result.getErrorMessage(); - if (errorMessage != null && !errorMessage.isEmpty()) { - String xMessage = errorMessage; - if (errorMessage.contains("TokenMgrError")) { - int indexError = errorMessage.lastIndexOf("TokenMgrError"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("QueryParsingException")) { - int indexError = errorMessage.lastIndexOf("QueryParsingException"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("JsonParseException")) { - int indexError = errorMessage.lastIndexOf("JsonParseException"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("Parse Failure")) { - int indexError = errorMessage.lastIndexOf("Parse Failure"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else if (errorMessage.contains("SearchParseException")) { - int indexError = errorMessage.lastIndexOf("SearchParseException"); - xMessage = "Invalid Search Expression. Details: " + errorMessage.substring(indexError); - } else { - xMessage = result.getErrorMessage(); - } - throw new IllegalStateException(xMessage); - } - } - - return result; - } - - @Override - public JestResult policy(String policyId) - throws IllegalStateException, IllegalArgumentException { - if (logger.isTraceEnabled()) - logger.trace("ENTER: " + policyId); - - if (policyId == null || policyId.isEmpty()) { - throw new IllegalArgumentException("No policy id string provided"); - } - - Get policyRequest = new Get.Builder(ELK_INDEX_POLICY, policyId).build(); - - if (logger.isInfoEnabled()) - logger.info("ELK Search body request: " + policyRequest.toString()); - - JestResult result; - try { - result = jestClient.execute(policyRequest); - } catch (IOException ioe) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - policyId + ": " + ioe.getMessage(), ioe); - throw new IllegalStateException(ioe); - } - - if (result.isSucceeded()) { - if (logger.isInfoEnabled()) - logger.info("OK:" + result.getResponseCode() + ":" + policyId + ":" + - result.getPathToResult() + ":" + System.lineSeparator() + - result.getJsonString()); - - return result; - } - - /* Unsuccessful search */ - if (logger.isWarnEnabled()) - logger.warn(XACMLErrorConstants.ERROR_PROCESS_FLOW + ":" + - result.getResponseCode() + ": " + policyId + ":" + - result.getPathToResult() + ":" + - result.getErrorMessage()); - - return result; - } - - protected JsonObject getJsonObject(JsonObject jsonObject, String member) throws IllegalArgumentException { - if (jsonObject == null) { - if (logger.isWarnEnabled()) - logger.warn("No JSON object provided to get " + member); - - throw new IllegalArgumentException("No JSON Object provided"); - } - - if (logger.isTraceEnabled()) { - logger.trace("ENTER: " + member); - for (Entry entry: jsonObject.entrySet()) { - logger.trace("JSONOBJECT: " + entry.getKey() + "->" + entry.getValue()); - } - } - - if (jsonObject.has(member)) { - JsonElement element = jsonObject.getAsJsonObject(member); - if (element.isJsonObject()) { - return (JsonObject) element; - } - } - - throw new IllegalArgumentException(member + " is not a JSON Object"); - } - - protected JsonArray getJsonArray(JsonObject jsonObject, String member) throws IllegalArgumentException { - if (jsonObject == null) { - throw new IllegalArgumentException("No JSON Object provided"); - } - - if (jsonObject.has(member)) { - if (jsonObject.get(member).isJsonArray()) { - return (JsonArray) jsonObject.get(member); - } - } - - throw new IllegalArgumentException(member + " is not a JSON Array"); - } - - protected String getJsonPolicyMember(JsonObject aHit, String member) throws IllegalArgumentException { - if (aHit == null) { - throw new IllegalArgumentException("No JSON Object provided"); - } - - JsonObject jSource = getJsonObject(aHit, "_source"); - JsonObject jPolicy = getJsonObject(jSource, "Policy"); - JsonElement jMember = jPolicy.get(member); - if (jMember == null) { - throw new IllegalArgumentException(member + " is not a JSON Object"); - } - return jMember.getAsString(); - } - - @Override - public ArrayList policyLocators(PolicyIndexType indexType, String text, int connector) - throws IllegalStateException, IllegalArgumentException { - return policyLocators(indexType, text, new ArrayList,ArrayList>>(),connector); - } - - @Override - public ArrayList policyLocators(PolicyIndexType indexType, - String text, - ArrayList,ArrayList>> filter_s, int connector) - throws IllegalStateException, IllegalArgumentException { - final ArrayList policyLocators = new ArrayList(); - - JestResult results = searchKey(indexType, text, filter_s,connector); - if (!results.isSucceeded()) { - return policyLocators; - } - - JsonArray jsonHit_s = null; - try { - JsonObject jsonHits = getJsonObject(results.getJsonObject(), "hits"); - jsonHit_s = getJsonArray(jsonHits, "hits"); - } catch (IllegalArgumentException e) { - logger.warn("SEARCH:" + text + " no valid element provided", e); - return policyLocators; - } - - for (JsonElement e : jsonHit_s) { - JsonObject elkSource = (JsonObject) e; - try { - String policyType = getJsonPolicyMember(elkSource,"PolicyType"); - String policyName = getJsonPolicyMember(elkSource,"PolicyName"); - String owner = getJsonPolicyMember(elkSource,"Owner"); - String scope = getJsonPolicyMember(elkSource,"Scope"); - String policyId = getJsonPolicyMember(elkSource,"PolicyId"); - String version = getJsonPolicyMember(elkSource,"Version"); - PolicyLocator policyLocator = - new PolicyLocator(policyType, policyName, owner, - scope, policyId, version); - policyLocators.add(policyLocator); - if (logger.isInfoEnabled()) { - logger.info("SEARCH:" + text + "|FOUND:" + policyLocator); - } - } catch (IllegalArgumentException ex) { - logger.warn("SEARCH:" + text + " missing locator information.", ex); - } - } - return policyLocators; - } - - public boolean put(String record, PolicyType type, String id) - throws IOException, IllegalStateException { - if (logger.isTraceEnabled()) logger.trace("ENTER"); - - PolicyIndexType indexType; - try { - indexType = ElkConnector.toPolicyIndexType(type); - } catch (IllegalArgumentException e) { - throw new IllegalStateException("ELK: Index: " + ELK_INDEX_POLICY + - " Type: " + type + " :" + e.getMessage()); - } - - if (indexType == PolicyIndexType.all) { - throw new IllegalStateException("ELK: Index: " + ELK_INDEX_POLICY + - " Bad Type: " + type.toString()); - } - - if (!isType(indexType)) { - throw new IllegalStateException("ELK: Index: " + ELK_INDEX_POLICY + - " Type: " + type.toString() + - " is not configured"); - } - - Index elkPut = new Index.Builder(record). - index(ELK_INDEX_POLICY). - type(indexType.name()). - id(id). - build(); - - JestResult result = jestClient.execute(elkPut); - - if (result.isSucceeded()) { - if (logger.isInfoEnabled()) - logger.info("OK: PUT operation of " + type.name() + "->" + indexType + ":" + id + ": " + - "success=" + result.isSucceeded() + "[" + result.getResponseCode() + ":" + - result.getPathToResult() + "]" + System.lineSeparator() + - result.getJsonString()); - } else { - if (logger.isWarnEnabled()) - logger.warn("FAILURE: PUT operation of " + type.name() + "->" + indexType + ":" + id + ": " + - "success=" + result.isSucceeded() + "[" + result.getResponseCode() + ":" + - result.getPathToResult() + "]" + System.lineSeparator() + - result.getJsonString()); - - } - - return result.isSucceeded(); - } - - @Override - public boolean clone(String origPolicyId, String clonePolicyId) - throws IllegalStateException { - if (logger.isTraceEnabled()) logger.trace("ENTER"); - - String methodLog = "[" + - "original-policy-id:" + origPolicyId + "|" + - "cloned-policy-id:" + clonePolicyId + "]"; - - if (logger.isDebugEnabled()) - logger.debug(methodLog); - - if (origPolicyId == null || clonePolicyId == null || - origPolicyId.isEmpty() || clonePolicyId.isEmpty()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "Internal Error: original and cloned policy ids are identical: " + - origPolicyId + "->" + clonePolicyId + " :" + - methodLog); - throw new IllegalStateException(": " + "original and cloned policy ids are identical."); - } - - // GET original record - JestResult result = this.policy(origPolicyId); - if (!result.isSucceeded()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "Internal Error: not found policy id: " + - origPolicyId + " :" + - methodLog); - throw new IllegalStateException(": " + "policy id: " + origPolicyId + " not found"); - } - - try { - String policyId = getJsonPolicyMember(result.getJsonObject(),"PolicyId"); - String policyType = getJsonPolicyMember(result.getJsonObject(),"PolicyType"); - if (policyType == null || policyType.isEmpty()) { - throw new IllegalStateException(": " + origPolicyId + - " invalid policy type: " + policyType); - } - PolicyType policyTypeEnum = PolicyType.valueOf(policyType); - String newPolicyId = policyId.replace(origPolicyId, clonePolicyId); - - JsonObject jsonSource = getJsonObject(result.getJsonObject(), "_source"); - JsonObject jsonPolicy = getJsonObject(jsonSource, "Policy"); - jsonPolicy.addProperty("PolicyId", newPolicyId); - String sourcePolicy = new Gson().toJson(jsonPolicy); - return put(sourcePolicy, policyTypeEnum, clonePolicyId); - } catch (IllegalArgumentException e) { - logger.warn("POLICY-SEARCH:" + origPolicyId + " not properly found", e); - throw new IllegalStateException(": " + origPolicyId + " not found in ELK"); - } catch (IOException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "cannot create searchable record for " + methodLog + - ". Reason: " + e.getMessage(), e); - throw new IllegalStateException(": Communication Problem with ELK server"); - } - } - - @Override - public boolean delete(File xacmlFile) throws IllegalStateException { - if (logger.isDebugEnabled()) - logger.debug("ENTER: " + "[xacml-file:" + - ((xacmlFile != null) ? xacmlFile.getPath() : "null")+ "]"); - - if (xacmlFile == null || !xacmlFile.canRead()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "Internal Error: invalid arguments provided: " + - ((xacmlFile != null) ? xacmlFile.getPath() : "null")+ "]"); - throw new IllegalStateException(": " + "Invalid arguments to convert to ELK format."); - } - - String policyId = ""; - PolicyIndexType indexType = null; - JestResult result; - try { - indexType = ElkConnector.toPolicyIndexType(xacmlFile.getName()); - if (!isType(indexType)) { - throw new IllegalStateException("ELK: Index: " + ELK_INDEX_POLICY + - " Type: " + indexType + - " is not configured"); - } - Xacml2Elk searchablePolicy = new Xacml2Elk(xacmlFile, true); - policyId = searchablePolicy.getPolicy().getValue().getPolicyId(); - policyId = policyId.substring(policyId.lastIndexOf(":")+1); - Delete deleteRequest = - new Delete.Builder(policyId).index(ELK_INDEX_POLICY). - type(indexType.name()).build(); - result = jestClient.execute(deleteRequest); - } catch (IllegalArgumentException | IOException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ": delete:" + - ((indexType != null) ? indexType.name() : "null") + ":" + policyId + ": " + - e.getMessage(), e); - throw new IllegalStateException(e); - } - - if (result.isSucceeded()) { - if (logger.isInfoEnabled()) - logger.info("OK: DELETE operation of " + indexType + ":" + policyId + ": " + - "success=" + result.isSucceeded() + "[" + result.getResponseCode() + ":" + - result.getPathToResult() + "]" + System.lineSeparator() + - result.getJsonString()); - } else { - if (logger.isWarnEnabled()) - logger.warn("FAILURE: DELETE operation of " + indexType + ":" + policyId + ": " + - "success=" + result.isSucceeded() + "[" + result.getResponseCode() + ":" + - result.getPathToResult() + "]" + System.lineSeparator() + - result.getJsonString()); - } - - return result.isSucceeded(); - } - - @Override - public ElkRecord create(PolicyType policyType, - String name, - String owner, - String scope, - File xacmlFile, - PolicyBodyType bodyType, - String body, - File destinationDir) - throws IllegalStateException { - if (logger.isTraceEnabled()) logger.trace("ENTER"); - - String methodLog = "[" + - "type:" + policyType.name() + "|" + - "owner:" + owner + "|" + - "scope:" + scope + "|" + - "xacml-file:" + ((xacmlFile != null) ? xacmlFile.getPath() : "null")+ "|" + - "body-type:" + bodyType.name() + "|" + - "body:" + body + "|" + - "destination-dir:" + ((destinationDir != null) ? destinationDir.getPath() : "null")+ "]"; - - if (logger.isDebugEnabled()) - logger.debug(methodLog); - - if (policyType == null || name == null || owner == null || scope == null || - xacmlFile == null) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "Internal Error: invalid arguments provided for " + methodLog); - throw new IllegalStateException(": " + "Invalid arguments to convert to ELK format."); - } - - try { - Xacml2Elk searchablePolicy = - new Xacml2Elk(policyType.name(), - name, - owner, - scope, - xacmlFile, - bodyType, - body, - destinationDir); - ElkRecord elkRecord = searchablePolicy.record(); - put(elkRecord.record, policyType, elkRecord.policyId); - return elkRecord; - } catch (JAXBException | JsonProcessingException | IllegalArgumentException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "cannot create searchable record for " + methodLog + - ". Reason: " + e.getMessage(), e); - throw new IllegalStateException(": " + "Error encountered converting to ELK format."); - } catch (IOException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "cannot create searchable record for " + methodLog + - ". Reason: " + e.getMessage(), e); - throw new IllegalStateException(": " + "Communication Problem with ELK server."); - } - } - - @Override - public boolean update(File xacmlFile) throws IllegalStateException { - if (logger.isDebugEnabled()) - logger.debug("ENTER: " + "[xacml-file:" + - ((xacmlFile != null) ? xacmlFile.getPath() : "null")+ "]"); - - if (xacmlFile == null || !xacmlFile.canRead()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "Internal Error: invalid arguments provided: " + - ((xacmlFile != null) ? xacmlFile.getPath() : "null")+ "]"); - throw new IllegalStateException(": " + "Invalid arguments to convert to ELK format."); - } - - Xacml2Elk searchablePolicy = new Xacml2Elk(xacmlFile, false); - return update(xacmlFile, searchablePolicy); - } - - protected boolean update(File xacmlFile, Xacml2Elk searchablePolicy) throws IllegalStateException { - if (logger.isDebugEnabled()) - logger.debug("ENTER"); - - try { - ElkRecord elkRecord = searchablePolicy.record(); - boolean success = put(elkRecord.record, ElkConnector.toPolicyType(xacmlFile.getName()), elkRecord.policyId); - return success; - } catch (JAXBException | JsonProcessingException | IllegalArgumentException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "cannot create searchable record for " + xacmlFile.getAbsolutePath() + - ". Reason: " + e.getMessage(), e); - throw new IllegalStateException(": " + "Error encountered converting to ELK format for " + - xacmlFile.getAbsolutePath()); - } catch (IOException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "cannot create ELK searchable record for " + xacmlFile.getAbsolutePath() + - ". Reason: " + e.getMessage(), e); - throw new IllegalStateException(": " + "Communication Problem with ELK server."); - } catch (IllegalStateException e) { - /* unexpected */ - throw e; - } catch (Exception e) { - logger.warn(XACMLErrorConstants.ERROR_UNKNOWN + ":" + "cannot test and update", e); - throw new IllegalStateException(e); - } - } - - @Override - public boolean testAndUpdate(File xacmlFile) throws IllegalStateException { - if (logger.isDebugEnabled()) - logger.debug("ENTER: " + "[xacml-file:" + - ((xacmlFile != null) ? xacmlFile.getPath() : "null")+ "]"); - - if (xacmlFile == null || !xacmlFile.canRead()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "Internal Error: invalid arguments provided: " + - ((xacmlFile != null) ? xacmlFile.getPath() : "null")+ "]"); - throw new IllegalStateException(": " + "Invalid arguments to convert to ELK format."); - } - - try { - Xacml2Elk searchablePolicy = new Xacml2Elk(xacmlFile, true); - String policyId = searchablePolicy.getPolicy().getValue().getPolicyId(); - policyId = policyId.substring(policyId.lastIndexOf(":")+1); - JestResult result = this.policy(policyId); - if (result.isSucceeded()) { - logger.info("Policy exists: " + policyId); - - /* validation tests */ - - String policyType = getJsonPolicyMember(result.getJsonObject(), "PolicyType"); - String scope = getJsonPolicyMember(result.getJsonObject(), "Scope"); - String policyName = getJsonPolicyMember(result.getJsonObject(), "PolicyName"); - if (policyType == null || policyType.isEmpty() || - scope == null || scope.isEmpty() || - policyName == null || policyName.isEmpty()) { - logger.warn("Policy metadata not found. Updating record .."); - update(xacmlFile, searchablePolicy); - return false; - } - - if (!xacmlFile.getName().startsWith(policyType)) { - logger.warn(xacmlFile.getName() + " does not match Policy Type: " + - policyType); - update(xacmlFile, searchablePolicy); - return false; - } - - java.nio.file.Path xacmlElkPath = Paths.get(scope, policyType + "_" + policyName + ".xml"); - java.nio.file.Path xacmlPath = xacmlFile.toPath(); - - if (logger.isDebugEnabled()) { - logger.debug(xacmlElkPath + " in " + xacmlElkPath + "? "); - } - - if (!xacmlPath.endsWith(xacmlElkPath)) { - logger.warn(xacmlPath + " does not match ELK inferred path: " + - xacmlElkPath); - update(xacmlFile, searchablePolicy); - return false; - } - - if (logger.isInfoEnabled()) { - logger.warn("OK: " + xacmlPath + " matches ELK inferred path: " + - xacmlElkPath); - } - return true; - } else { - logger.info("Policy ID not found. Adding to database: " + policyId); - update(xacmlFile, searchablePolicy); - return false; - } - } catch (Exception e) { - logger.warn(XACMLErrorConstants.ERROR_UNKNOWN + ":" + "cannot test and update", e); - throw new IllegalStateException(e); - } - } -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/Pair.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/Pair.java deleted file mode 100644 index 3c7b9951d..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/Pair.java +++ /dev/null @@ -1,35 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.elk.client; - - -public class Pair { - private L left; - private R right; - public Pair(L l, R r){ - this.left = l; - this.right = r; - } - public L left(){ return left; } - public R right(){ return right; } - public void left(L l){ this.left = l; } - public void right(R r){ this.right = r; } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/PolicyElasticSearchController.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/PolicyElasticSearchController.java deleted file mode 100644 index ee745236f..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/PolicyElasticSearchController.java +++ /dev/null @@ -1,756 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.elk.client; - - -import java.io.File; -import java.io.PrintWriter; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.regex.Pattern; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.json.JSONObject; -import org.openecomp.policy.adapter.ClosedLoopPerformanceMetrics; -import org.openecomp.policy.adapter.ClosedLoopPolicy; -import org.openecomp.policy.dao.PolicyVersionDao; -import org.openecomp.policy.elk.client.ElkConnector.PolicyIndexType; -import org.openecomp.policy.rest.dao.DescriptiveScopeDao; -import org.openecomp.policy.rest.jpa.ActionPolicyDict; -import org.openecomp.policy.rest.jpa.Attribute; -import org.openecomp.policy.rest.jpa.BRMSParamTemplate; -import org.openecomp.policy.rest.jpa.ClosedLoopD2Services; -import org.openecomp.policy.rest.jpa.ClosedLoopSite; -import org.openecomp.policy.rest.jpa.DCAEuuid; -import org.openecomp.policy.rest.jpa.DecisionSettings; -import org.openecomp.policy.rest.jpa.DescriptiveScope; -import org.openecomp.policy.rest.jpa.EcompName; -import org.openecomp.policy.rest.jpa.EnforcingType; -import org.openecomp.policy.rest.jpa.GroupPolicyScopeList; -import org.openecomp.policy.rest.jpa.MicroServiceLocation; -import org.openecomp.policy.rest.jpa.MicroServiceModels; -import org.openecomp.policy.rest.jpa.PEPOptions; -import org.openecomp.policy.rest.jpa.PolicyVersion; -import org.openecomp.policy.rest.jpa.RiskType; -import org.openecomp.policy.rest.jpa.SafePolicyWarning; -import org.openecomp.policy.rest.jpa.TermList; -import org.openecomp.policy.rest.jpa.VNFType; -import org.openecomp.policy.rest.jpa.VSCLAction; -import org.openecomp.policy.rest.jpa.VarbindDictionary; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Controller -@RequestMapping({"/"}) -public class PolicyElasticSearchController extends RestrictedBaseController{ - - private static final Logger logger = FlexLogger.getLogger(PolicyElasticSearchController.class); - private volatile HashMap filteredPolicies = new HashMap(); - private List policyNames = null; - - enum Mode{ - attribute, ecompName, actionPolicy, brmsParam, pepOptions, clSite, clService, clVarbind, clVnf, clVSCL, decision, enforcer, fwTerm, gocEventAlarm, - gocTraversal, gocRootCause, gocVnfType, gocServerScope, gocHPEventSource, msDCAEUUID, msConfigName, msLocation, msModels, - psGroupPolicy, safeRisk, safePolicyWarning - } - - public static final HashMap name2jsonPath = new HashMap() { - private static final long serialVersionUID = 1L; - { - put(ClosedLoopPolicy.CLFAULT_UIFIELD_D2_SERVICES_TRINITY, ClosedLoopPolicy.CLFAULT_UIJSON_D2_SERVICES_TRINITY); - put(ClosedLoopPolicy.CLFAULT_UIFIELD_D2_SERVICES_VUSP, ClosedLoopPolicy.CLFAULT_UIJSON_D2_SERVICES_VUSP); - put(ClosedLoopPolicy.CLFAULT_UIFIELD_D2_SERVICES_MCR, ClosedLoopPolicy.CLFAULT_UIJSON_D2_SERVICES_MCR); - put(ClosedLoopPolicy.CLFAULT_UIFIELD_D2_SERVICES_GAMMA, ClosedLoopPolicy.CLFAULT_UIJSON_D2_SERVICES_GAMMA); - put(ClosedLoopPolicy.CLFAULT_UIFIELD_D2_SERVICES_VDNS, ClosedLoopPolicy.CLFAULT_UIJSON_D2_SERVICES_VDNS); - - put(ClosedLoopPolicy.CLFAULT_UIFIELD_EMAIL_ADDRESS, ClosedLoopPolicy.CLFAULT_UIJSON_EMAIL_ADDRESS); - put(ClosedLoopPolicy.CLFAULT_UIFIELD_TRIGGER_SIGNATURE, ClosedLoopPolicy.CLFAULT_UIJSON_TRIGGER_SIGNATURE); - put(ClosedLoopPolicy.CLFAULT_UIFIELD_VERIFICATION_SIGNATURE, ClosedLoopPolicy.CLFAULT_UIJSON_VERIFICATION_SIGNATURE); - put(ClosedLoopPolicy.CLFAULT_UIFIELD_CONNECT_ALL_TRAPS, ClosedLoopPolicy.CLFAULT_UIJSON_CONNECT_ALL_TRAPS); - put(ClosedLoopPolicy.CLFAULT_UIFIELD_CONNECT_ALL_FAULTS, ClosedLoopPolicy.CLFAULT_UIJSON_CONNECT_ALL_FAULTS); - - put(ClosedLoopPolicy.CLFAULT_UIFIELD_POLICY_STATUS_INACTIVE, ClosedLoopPolicy.CLFAULT_UIJSON_POLICY_STATUS_ACTIVE); - put(ClosedLoopPolicy.CLFAULT_UIFIELD_POLICY_STATUS_ACTIVE, ClosedLoopPolicy.CLFAULT_UIJSON_POLICY_STATUS_INACTIVE); - - put(ClosedLoopPerformanceMetrics.CLPM_UIFIELD_ONSET_MESSAGE, ClosedLoopPerformanceMetrics.CLPM_UIJSON_ONSET_MESSAGE); - put(ClosedLoopPerformanceMetrics.CLPM_UIFIELD_POLICY_NAME, ClosedLoopPerformanceMetrics.CLPM_UIJSON_POLICY_NAME); - put(ClosedLoopPerformanceMetrics.CLPM_UIFIELD_ABATEMENT_MESSAGE, ClosedLoopPerformanceMetrics.CLPM_UIJSON_ABATEMENT_MESSAGE); - put(ClosedLoopPerformanceMetrics.CLPM_UIFIELD_GEOLINK, ClosedLoopPerformanceMetrics.CLPM_UIJSON_GEOLINK); - }}; - - - //For AND and OR logical connector AND=0 and OR=1 - private int connectorSelected; - - public static DescriptiveScopeDao descriptiveScopeDao; - public static PolicyVersionDao policyVersionDao; - - @Autowired - public PolicyElasticSearchController(DescriptiveScopeDao descriptiveScopeDao, PolicyVersionDao policyVersionDao) { - PolicyElasticSearchController.descriptiveScopeDao = descriptiveScopeDao; - PolicyElasticSearchController.policyVersionDao = policyVersionDao; - - } - - public PolicyElasticSearchController() { - } - - @RequestMapping(value={"/searchPolicy"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView searchPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ - List resultList = new ArrayList(); - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - SearchData searchData = (SearchData)mapper.readValue(root.get("searchdata").toString(), SearchData.class); - - String policyType = searchData.getPolicyType(); - ArrayList,ArrayList>> filter_s = new ArrayList,ArrayList>>(); - - String searchText = searchData.getQuery(); - if (searchText == null || searchText.isEmpty()) { - String descriptiveValue = searchData.getDescriptiveScope(); - if(descriptiveValue != null){ - searchText = "Descriptive-Scope="+descriptiveValue; - } - if (policyType == null || policyType.isEmpty() && - !policyType.equals(ElkConnector.PolicyIndexType.closedloop.toString())) { - if (logger.isDebugEnabled()) { - logger.debug("Clearing search filters, nothing to search and not closed loop."); - } - } - } else { - searchText = searchText.trim(); - //Descriptive Scope. - /* - When a item is selected in the "descriptiveScope" comboBox, the name of the item - is added to the Search-Text Box with the prefix "Descriptive-Scope" - User needs to press the "Search" button to perform the search. - */ - if(searchText.contains("Descriptive-Scope=")){ - if (logger.isDebugEnabled()) { - logger.debug("Inside the Descriptive Scope"); - } - /* - First item is always String "Descriptive-Scope" before the "=", - So taking the second item of "split using =" - */ - String[] dsName= searchText.split("=",2); - /* - Trying to find the search String by traversing different items from the dictionary by Scope-Name - Once when the the "scope-name" is found, we get the search string from dictionary. - */ - if(searchData.getDescriptiveScope() != null){ - DescriptiveScope dsSearch = descriptiveScopeDao.getDescriptiveScopeById(searchData.getDescriptiveScope()); - if(dsSearch.getScopeName().equals(dsName[1])){ - searchText=dsSearch.getSearch(); - if (logger.isDebugEnabled()) { - logger.debug("DescriptiveScope Search String is " +searchText ); - } - } - } - - } - // '&' turned to "AND" to make it inline with Freeform search. - if(searchText.contains(":")){ - String connector="AND"; - if(searchText.contains("AND")){ - connector="AND"; - connectorSelected=0; - }else if(searchText.contains("OR")){ - connector=Pattern.quote("OR"); - connectorSelected=1; - } - for (String retval: searchText.split(connector)){ - - int index= retval.indexOf(':'); - String filterKey=null; - String filterValue=null; - - filterKey=retval.substring(0,index).trim(); - filterValue= retval.substring(index+1).trim(); - - logger.debug("Key is "+filterKey+" and value is "+filterValue); - String clSearchBoxFilter=filterKey; - - ArrayList clSearchBoxFilterField_s = new ArrayList(); - - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_Fault.name() + "_Body." + clSearchBoxFilter); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_PM.name() + "_Body." + clSearchBoxFilter); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_FW.name() + "_Body." + clSearchBoxFilter); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_MS.name() + "_Body." + clSearchBoxFilter); - - - ArrayList clSearchBoxFilterValue_s = new ArrayList(); - clSearchBoxFilterValue_s.add(filterValue); - - filter_s.add(new Pair,ArrayList>(clSearchBoxFilterField_s, clSearchBoxFilterValue_s)); - } - } - } - - if (policyType != null && !policyType.isEmpty() && - policyType.equals(ElkConnector.PolicyIndexType.closedloop.toString())) { - - /* closed loop policy type */ - - String clPolicyType = searchData.getClosedLooppolicyType(); - if (clPolicyType != null && !clPolicyType.isEmpty()) { - ArrayList clPolicyTypeField_s = new ArrayList(); - clPolicyTypeField_s.add("Policy.PolicyType"); - - ArrayList clPolicyTypeValue_s = new ArrayList(); - clPolicyTypeValue_s.add(clPolicyType); - - filter_s.add(new Pair,ArrayList>(clPolicyTypeField_s, clPolicyTypeValue_s)); - } - - String clEcompName = searchData.getEcompName(); - if (clEcompName != null && !clEcompName.isEmpty()) { - clSearchBody(clPolicyType, "ecompname", clEcompName, filter_s); - } - - String clD2Services = searchData.getD2Service(); - if (clD2Services != null && !clD2Services.isEmpty()) { - switch (clD2Services) { - case ClosedLoopPolicy.CLFAULT_UIFIELD_D2_SERVICES_TRINITY: - case ClosedLoopPolicy.CLFAULT_UIFIELD_D2_SERVICES_VUSP: - case ClosedLoopPolicy.CLFAULT_UIFIELD_D2_SERVICES_MCR: - case ClosedLoopPolicy.CLFAULT_UIFIELD_D2_SERVICES_GAMMA: - case ClosedLoopPolicy.CLFAULT_UIFIELD_D2_SERVICES_VDNS: - clSearchBody(clPolicyType, name2jsonPath.get(clD2Services), "true", filter_s); - break; - default: - if (logger.isWarnEnabled()) - logger.warn("Unexpected D2 Service: " + clD2Services); - break; - } - } - - String clFaultAction = searchData.getVproAction(); - if (clFaultAction != null && !clFaultAction.isEmpty()) { - if (clPolicyType == null || clPolicyType.equals(ElkConnector.PolicyType.Config_Fault.name())) { - clSearchFilter(ElkConnector.PolicyType.Config_Fault.name(), "actions", clFaultAction, filter_s); - } - } - - String clFaultStatus = searchData.getPolicyStatus(); - if (clFaultStatus != null && !clFaultStatus.isEmpty()) { - if (clPolicyType == null || clPolicyType.equals(ElkConnector.PolicyType.Config_Fault.name())) { - clSearchFilter(ElkConnector.PolicyType.Config_Fault.name(), "closedLoopPolicyStatus", clFaultStatus, filter_s); - } - } - - String clFaultVnfTypes = searchData.getVnfType(); - if (clFaultVnfTypes != null && !clFaultVnfTypes.isEmpty()) { - if (clPolicyType == null || clPolicyType.equals(ElkConnector.PolicyType.Config_Fault.name())) { - clSearchFilter(ElkConnector.PolicyType.Config_Fault.name(), "vnfType", clFaultVnfTypes, filter_s); - } - } - - String clPMServiceType = searchData.getServiceType(); - if (clPMServiceType != null && !clPMServiceType.isEmpty()) { - if (clPolicyType == null || clPolicyType.equals(ElkConnector.PolicyType.Config_PM.name())) { - clSearchFilter(ElkConnector.PolicyType.Config_PM.name(), "serviceTypePolicyName", clPMServiceType, filter_s); - } - } - - String clSearchBoxFilter = searchData.getBindTextSearch(); - if (clSearchBoxFilter != null && !clSearchBoxFilter.isEmpty() && - searchText != null && !searchText.isEmpty()) { - - if (name2jsonPath.containsKey(clSearchBoxFilter)) { - clSearchBoxFilter = name2jsonPath.get(clSearchBoxFilter); - } - - ArrayList clSearchBoxFilterField_s = new ArrayList(); - if (clPolicyType == null || clPolicyType.isEmpty()) { - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_Fault.name() + "_Body." + clSearchBoxFilter); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_PM.name() + "_Body." + clSearchBoxFilter); - } else { - clSearchBoxFilterField_s.add("Policy.Body." + clPolicyType + "_Body." + clSearchBoxFilter); - } - - ArrayList clSearchBoxFilterValue_s = new ArrayList(); - clSearchBoxFilterValue_s.add(searchText); - - filter_s.add(new Pair,ArrayList>(clSearchBoxFilterField_s, clSearchBoxFilterValue_s)); - - // deactivate search all fields in case a searchbox filter is provided - searchText = ""; - } - } - - if ((searchText == null || searchText.isEmpty()) && - (filter_s == null || filter_s.size() <=0) ) { - if (logger.isWarnEnabled()) { - logger.warn("Clearing search filters, closed loop but nothing to search nor filters"); - } - } - - ArrayList locators = null; - try { - locators = ElkConnector.singleton.policyLocators(toPolicyIndexType(policyType), - searchText, filter_s,connectorSelected); - } catch (Exception ise) { - logger.warn("Search is unavailable: " + ise.getMessage()); - } - - synchronized(this.filteredPolicies) { - if (locators.isEmpty()) { - if (logger.isInfoEnabled()) { - logger.info("No match has been found"); - } - logger.warn("No match has been found"); - } - - HashMap policyVersion_s = new HashMap(); - List policyVersionList = policyVersionDao.getPolicyVersionData(); - for(int i = 0; i < policyVersionList.size(); i++) { - PolicyVersion entityVersion = policyVersionList.get(i); - String dbPolicy = entityVersion.getPolicyName() + "." + entityVersion.getActiveVersion(); - policyVersion_s.put(dbPolicy, true); - if (logger.isDebugEnabled()) - logger.debug("Map addition: DB Policy Name: " + dbPolicy); - } - - this.filteredPolicies.clear(); - for (PolicyLocator p: locators) { - String dbPolicyName = p.scope + File.separator + p.policyType + "_" + p.policyName; - if (policyVersion_s.containsKey(dbPolicyName)) { - String filterPolicyName = dbPolicyName + ".xml"; - this.filteredPolicies.put(Paths.get(filterPolicyName), filterPolicyName); - JSONObject el = new JSONObject(); - el.put("name", dbPolicyName); - resultList.add(el); - if (logger.isInfoEnabled()) - logger.info("Active Version Policy found in search: " + dbPolicyName + " -> " + filterPolicyName); - } else { - if (logger.isInfoEnabled()) - logger.info("Inactive Version Policy found in search: " + dbPolicyName); - } - } - - if (this.filteredPolicies.isEmpty()) { - if (logger.isInfoEnabled()) { - logger.info("No match has been found for active versions"); - } - JSONObject result = new JSONObject(); - result.put("success", false); - result.put("error", "No match has been found for active versions"); - resultList.add(result); - logger.warn("No match has been found for active versions"); - - } - - System.out.println(this.filteredPolicies); - } - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - JSONObject j = new JSONObject("{result: " + resultList + "}"); - out.write(j.toString()); - return null; - }catch(Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - protected void clSearchBody(String clPolicyType, String bodyField, String bodyValue, - ArrayList, ArrayList>> filter_s) { - if (logger.isDebugEnabled()) - logger.debug("ENTER: " + clPolicyType + ":" + bodyField + ":" + bodyValue); - - final ArrayList clBodyField_s = new ArrayList(); - final ArrayList clBodyValue_s = new ArrayList(); - - if (clPolicyType == null || clPolicyType.isEmpty()) { - clBodyField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_Fault.name() + "_Body." + bodyField); - clBodyField_s.add("Policy.Body."+ ElkConnector.PolicyType.Config_PM.name() + "_Body." + bodyField); - clBodyValue_s.add(bodyValue); - } else { - clBodyField_s.add("Policy.Body." + clPolicyType + "_Body." + bodyField); - clBodyValue_s.add(bodyValue); - } - filter_s.add(new Pair, ArrayList>(clBodyField_s, clBodyValue_s)); - } - - protected void clSearchFilter(String clType, String clField, String clValue, - ArrayList,ArrayList>> filter_s) { - if (logger.isDebugEnabled()) - logger.debug("ENTER: " + clType + ":" + clField + ":" + clValue); - - ArrayList clSearchField_s = new ArrayList(); - clSearchField_s.add("Policy.Body." + clType + "_Body." + clField); - - ArrayList clSearchValue_s = new ArrayList(); - clSearchValue_s.add(clValue); - - filter_s.add(new Pair,ArrayList>(clSearchField_s, clSearchValue_s)); - } - - public ElkConnector.PolicyIndexType toPolicyIndexType(String type) throws IllegalArgumentException { - if (type == null || type.isEmpty()) - return PolicyIndexType.all; - - return PolicyIndexType.valueOf(type); - } - - public boolean updateElk(String xacmlFilePath) { - boolean success = true; - try { - File xacmlPolicy = new File(xacmlFilePath); - success = ElkConnector.singleton.update(xacmlPolicy); - if (!success) { - if (logger.isWarnEnabled()) { - logger.warn("FAILURE to create ELK record created for " + xacmlPolicy.getPath()); - } - } else { - if (logger.isInfoEnabled()) { - logger.warn("SUCCESS creating ELK record created for " + xacmlPolicy.getPath()); - } - } - } catch (Exception e) { - logger.warn(XACMLErrorConstants.ERROR_DATA_ISSUE + ": " + e.getMessage(), e); - success = false; - } - return success; - } - - @RequestMapping(value={"/searchDictionary"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView searchDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{ - try{ - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - String dictionaryType = root.get("type").textValue(); - Mode mode = Mode.valueOf(dictionaryType); - String value; - String msg; - switch (mode){ - case attribute : - Attribute attributedata = (Attribute)mapper.readValue(root.get("data").toString(), Attribute.class); - value = attributedata.getXacmlId(); - msg = searchElkDatabase("pholder",value); - break; - case ecompName : - EcompName ecompName = (EcompName)mapper.readValue(root.get("data").toString(), EcompName.class); - value = ecompName.getEcompName(); - msg = searchElkDatabase("pholder",value); - break; - case actionPolicy : - ActionPolicyDict actionPolicyDict = (ActionPolicyDict)mapper.readValue(root.get("data").toString(), ActionPolicyDict.class); - value = actionPolicyDict.getAttributeName(); - msg = searchElkDatabase("pholder",value); - break; - case brmsParam : - BRMSParamTemplate bRMSParamTemplate = (BRMSParamTemplate)mapper.readValue(root.get("data").toString(), BRMSParamTemplate.class); - value = bRMSParamTemplate.getRuleName(); - msg = searchElkDatabase("BRMSParamTemplate AND " + value); - break; - case pepOptions : - PEPOptions pEPOptions = (PEPOptions)mapper.readValue(root.get("data").toString(), PEPOptions.class); - value = pEPOptions.getPepName(); - msg = searchElkDatabase("pepName",value); - break; - case clSite : - ClosedLoopSite closedLoopSite = (ClosedLoopSite)mapper.readValue(root.get("data").toString(), ClosedLoopSite.class); - value = closedLoopSite.getSiteName(); - msg = searchElkDatabase("siteNames",value); - break; - case clService : - ClosedLoopD2Services closedLoopD2Services = (ClosedLoopD2Services)mapper.readValue(root.get("data").toString(), ClosedLoopD2Services.class); - value = closedLoopD2Services.getServiceName(); - msg = searchElkDatabase("d2Services",value); - break; - case clVarbind : - VarbindDictionary varbindDictionary = (VarbindDictionary)mapper.readValue(root.get("data").toString(), VarbindDictionary.class); - value = varbindDictionary.getVarbindName(); - msg = searchElkDatabase("triggerSignaturesUsedForUI.signatures",value); - break; - case clVnf : - VNFType vNFType = (VNFType)mapper.readValue(root.get("data").toString(), VNFType.class); - value = vNFType.getVnftype(); - msg = searchElkDatabase("vnfType",value); - break; - case clVSCL : - VSCLAction vsclAction = (VSCLAction)mapper.readValue(root.get("data").toString(), VSCLAction.class); - value = vsclAction.getVsclaction(); - msg = searchElkDatabase("actions",value); - break; - case decision : - DecisionSettings decisionSettings = (DecisionSettings)mapper.readValue(root.get("data").toString(), DecisionSettings.class); - value = decisionSettings.getXacmlId(); - msg = searchElkDatabase("pholder",value); - break; - case enforcer : - EnforcingType enforcingType = (EnforcingType)mapper.readValue(root.get("data").toString(), EnforcingType.class); - value = enforcingType.getEnforcingType(); - msg = searchElkDatabase("pholder",value); - break; - case fwTerm : - TermList term = (TermList)mapper.readValue(root.get("data").toString(), TermList.class); - value = term.getTermName(); - msg = searchElkDatabase("firewallRuleList.ruleName",value); - break; - case msDCAEUUID : - DCAEuuid dcaeUUID = (DCAEuuid)mapper.readValue(root.get("data").toString(), DCAEuuid.class); - value = dcaeUUID.getName(); - msg = searchElkDatabase("uuid",value); - break; - case msLocation : - MicroServiceLocation mslocation = (MicroServiceLocation)mapper.readValue(root.get("data").toString(), MicroServiceLocation.class); - value = mslocation.getName(); - msg = searchElkDatabase("location",value); - break; - case msModels : - MicroServiceModels msModels = (MicroServiceModels)mapper.readValue(root.get("data").toString(), MicroServiceModels.class); - value = msModels.getModelName(); - msg = searchElkDatabase("configName",value); - break; - case psGroupPolicy : - GroupPolicyScopeList groupPoilicy = (GroupPolicyScopeList)mapper.readValue(root.get("data").toString(), GroupPolicyScopeList.class); - value = groupPoilicy.getGroupName(); - msg = searchElkDatabase("PolicyScope",value); - break; - case safeRisk : - RiskType riskType= (RiskType)mapper.readValue(root.get("data").toString(), RiskType.class); - value = riskType.getRiskName(); - msg = searchElkDatabase("Risk Type",value); - break; - case safePolicyWarning : - SafePolicyWarning safePolicy = (SafePolicyWarning)mapper.readValue(root.get("data").toString(), SafePolicyWarning.class); - value = safePolicy.getName(); - msg = searchElkDatabase("Safe Warning",value); - break; - default: - } - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - JSONObject j = new JSONObject("{result: " + policyNames + "}"); - out.write(j.toString()); - return null; - }catch(Exception e){ - response.setCharacterEncoding("UTF-8"); - request.setCharacterEncoding("UTF-8"); - PrintWriter out = response.getWriter(); - out.write(e.getMessage()); - } - return null; - } - - //Search Elk database - public String searchElkDatabase(String value){ - String policyType = ""; - String searchText = value; - ArrayList locators; - ArrayList,ArrayList>> filter_s = new ArrayList,ArrayList>>(); - try { - locators = ElkConnector.singleton.policyLocators(toPolicyIndexType(policyType), searchText, filter_s,0); - } catch (Exception ise) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR+"Search is unavailable: " + ise.getMessage()); - value = "$notSuccess%"; - return value; - } - policyNames = new ArrayList(); - for (PolicyLocator p: locators) { - String dbPolicyName = p.scope + "/" + p.policyType + "_" + p.policyName + "." +p.version + ".xml"; - logger.debug(dbPolicyName); - JSONObject el = new JSONObject(); - el.put("name", dbPolicyName); - policyNames.add(el); - } - if(!locators.isEmpty()){ - value = "$success%"; - return value; - } - return value; - } - - //Search the Elk database - public String searchElkDatabase(String key, String value){ - String policyType = ""; - String searchText = key+":"+value; - ArrayList locators; - ArrayList,ArrayList>> filter_s = new ArrayList,ArrayList>>(); - logger.debug("Parameter value is"+value); - - String clSearchKey=null; - clSearchKey=key; - - logger.debug("Filter value is"+clSearchKey); - - ArrayList clSearchBoxFilterField_s = new ArrayList(); - - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_Fault.name() + "_Body." + clSearchKey); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_PM.name() + "_Body." + clSearchKey); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_FW.name() + "_Body." + clSearchKey); - clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_MS.name() + "_Body." + clSearchKey); - //clSearchBoxFilterField_s.add("Policy.Body." + ElkConnector.PolicyType.Config_PM.name() + "_Body." + clSearchKey); - - String clSearchValue=null; - clSearchValue=value; - - logger.debug("Search value is"+clSearchValue); - - ArrayList clSearchBoxFilterValue_s = new ArrayList(); - clSearchBoxFilterValue_s.add(clSearchValue); - - filter_s.add(new Pair,ArrayList>(clSearchBoxFilterField_s, clSearchBoxFilterValue_s)); - - try { - locators = ElkConnector.singleton.policyLocators(toPolicyIndexType(policyType), searchText, filter_s,0); - logger.debug("No Exceptions"); - for (PolicyLocator l: locators) { - logger.debug(l.policyName); - } - logger.debug("After for"); - } catch (Exception ise) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR+"Search is unavailable: " + ise.getMessage()); - //PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR, ise, "AttributeDictionary", " Exception while searching Elk database "); - logger.debug("Exceptions"); - value = "$notSuccess%"; - return value; - } - policyNames = new ArrayList(); - for (PolicyLocator p: locators) { - String dbPolicyName = p.scope + File.separator + p.policyType + "_" + p.policyName + ".xml"; - logger.debug(dbPolicyName); - JSONObject el = new JSONObject(); - el.put("name", dbPolicyName); - policyNames.add(el); - } - if(!locators.isEmpty()){ - value = "$success%"; - logger.debug("Success"); - return value; - } - return value; - } - -} - - -class SearchData{ - private String query; - private String policyType; - private String descriptiveScope; - private String closedLooppolicyType; - private String ecompName; - private String d2Service; - private String vnfType; - private String policyStatus; - private String vproAction; - private String serviceType; - private String bindTextSearch; - public String getQuery() { - return query; - } - public void setQuery(String query) { - this.query = query; - } - public String getPolicyType() { - return policyType; - } - public void setPolicyType(String policyType) { - this.policyType = policyType; - } - public String getDescriptiveScope() { - return descriptiveScope; - } - public void setDescriptiveScope(String descriptiveScope) { - this.descriptiveScope = descriptiveScope; - } - public String getClosedLooppolicyType() { - return closedLooppolicyType; - } - public void setClosedLooppolicyType(String closedLooppolicyType) { - this.closedLooppolicyType = closedLooppolicyType; - } - public String getEcompName() { - return ecompName; - } - public void setEcompName(String ecompName) { - this.ecompName = ecompName; - } - public String getD2Service() { - return d2Service; - } - public void setD2Service(String d2Service) { - this.d2Service = d2Service; - } - public String getVnfType() { - return vnfType; - } - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - public String getPolicyStatus() { - return policyStatus; - } - public void setPolicyStatus(String policyStatus) { - this.policyStatus = policyStatus; - } - public String getVproAction() { - return vproAction; - } - public void setVproAction(String vproAction) { - this.vproAction = vproAction; - } - public String getServiceType() { - return serviceType; - } - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - public String getBindTextSearch() { - return bindTextSearch; - } - public void setBindTextSearch(String bindTextSearch) { - this.bindTextSearch = bindTextSearch; - } -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/PolicyLocator.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/PolicyLocator.java deleted file mode 100644 index f7cc58fa2..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/client/PolicyLocator.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.elk.client; - - -public class PolicyLocator { - public final String policyType; - public final String policyName; - public final String owner; - public final String scope; - public final String policyId; - public final String version; - - public PolicyLocator(String policyType, String policyName, - String owner, String scope, String policyId, - String version) { - this.policyType = policyType; - this.policyName= policyName; - this.owner = owner; - this.scope = scope; - this.policyId = policyId; - this.version = version; - } - - public String toString() { - return "[" + - this.owner + "|" + - this.scope + "|" + - this.policyType + "|" + - this.policyName + "|" + - this.policyId + "|" + - "v" + this.version + "|" + "]"; - - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/converter/ElkRecord.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/converter/ElkRecord.java deleted file mode 100644 index 40bdb7929..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/converter/ElkRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.elk.converter; - - -import com.fasterxml.jackson.databind.JsonNode; - -public class ElkRecord { - public final String record; - public final String policyId; - public final JsonNode jsonRecord; - public final boolean bodyAttached; - - public ElkRecord(final String policyId, - final String record, - final JsonNode jsonRecord, - final boolean bodyAttached) { - this.policyId = policyId; - this.record = record; - this.jsonRecord = jsonRecord; - this.bodyAttached = bodyAttached; - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/converter/Xacml2Elk.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/converter/Xacml2Elk.java deleted file mode 100644 index f7aa34ff2..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/elk/converter/Xacml2Elk.java +++ /dev/null @@ -1,978 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.elk.converter; - - -import io.searchbox.core.Update; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.StringReader; -import java.io.StringWriter; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.nio.file.FileSystems; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.bind.Unmarshaller; -import javax.xml.transform.Result; -import javax.xml.transform.stream.StreamResult; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeAssignmentExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.EffectType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; - -import org.apache.commons.io.IOUtils; -import org.eclipse.persistence.jaxb.JAXBContextFactory; -import org.eclipse.persistence.jaxb.MarshallerProperties; -import org.eclipse.persistence.jaxb.json.JsonSchemaOutputResolver; - -import com.att.research.xacml.api.Advice; -import com.att.research.xacml.api.AttributeAssignment; -import com.att.research.xacml.api.Identifier; -import com.att.research.xacml.api.Obligation; -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import com.att.research.xacml.util.XACMLPolicyScanner; -import com.att.research.xacml.util.XACMLProperties; -import com.att.research.xacml.util.XACMLPolicyScanner.CallbackResult; -import com.att.research.xacml.util.XACMLPolicyScanner.SimpleCallback; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule; -import com.fasterxml.jackson.module.jsonSchema.JsonSchema; -import com.fasterxml.jackson.module.jsonSchema.factories.SchemaFactoryWrapper; - -import org.kohsuke.args4j.CmdLineException; -import org.kohsuke.args4j.CmdLineParser; -import org.kohsuke.args4j.Option; -import org.openecomp.policy.elk.client.ElkConnector; -import org.openecomp.policy.elk.client.ElkConnector.PolicyBodyType; -import org.openecomp.policy.rest.XACMLRestProperties; -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - -@SuppressWarnings("unused") -public class Xacml2Elk { - public static final String URLID_ATTRIBUTE = "URLID"; - public static final String BODY_ATTRIBUTE = "body"; - - protected static final Logger logger = FlexLogger.getLogger(Xacml2Elk.class); - protected static JAXBContext jaxbContext = jaxbContext(); - - protected static String toConfigsWebDirectory(String policyType) - throws IllegalArgumentException { - if (policyType == null || policyType.isEmpty()) - throw new IllegalArgumentException("Unexpected policy type: " + policyType); - - ElkConnector.PolicyType type = ElkConnector.PolicyType.valueOf(policyType); - switch(type) { - case Config: - return type.name(); - case Action: - return type.name(); - case Decision: - return type.name(); - case Config_Fault: - case Config_PM: - case Config_FW: - case Config_MS: - return ElkConnector.PolicyType.Config.name(); - default: - throw new IllegalArgumentException("Unexpected policy type: " + policyType); - } - } - - protected synchronized static JAXBContext jaxbContext() { - if (jaxbContext != null) { - return jaxbContext; - } - - try { - jaxbContext = JAXBContextFactory.createContext(new Class[] {PolicyType.class}, null); - } catch (JAXBException e) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + ":" + - "JAXB Context cannot be created"); - return null; - } - - return jaxbContext; - } - - protected static class CLIOptions { - @Option(name="-t", usage="policy type", aliases={"-type", "--type"}, required=true) - protected String type; - - @Option(name="-n", usage="policy name", aliases={"-name", "--name"}, required=true) - protected String name; - - @Option(name="-o", usage="git repository owner", aliases={"-owner", "--owner"}, required=true) - protected String owner; - - @Option(name="-s", usage="enclosing scope", aliases={"-scope", "--scope"}, required=true) - protected String scope; - - @Option(name="-x", usage="xacml input file", aliases={"-xacml", "--xacml"}, required=true, metaVar="") - protected File xacmlFile; - - @Option(name="-p", usage="payload body type", aliases={"-payloadType", "--payloadType"}, required=false, metaVar="", depends={"-b"}) - protected PolicyBodyType bodyType; - - @Option(name="-b", usage="payload body", aliases={"-body", "--body"}, required=false, metaVar="", depends={"-p"}) - protected String body; - - @Option(name="-d", usage="elk record output directory", aliases={"-d", "--directory"}, required=true, metaVar="") - protected File elkDirectory; - - @Option(name = "-h", aliases = {"-help", "--help"}, usage = "print this message") - private boolean help = false; - }; - - class AttributeAssignmentFinderProcessor extends SimpleCallback { - protected final String attributeId; - protected String attributeValue = null; - - public AttributeAssignmentFinderProcessor(String attributeId) { - this.attributeId = attributeId; - } - - public String getAttributeValue() { - return attributeValue; - } - - public boolean isAttributeValue() { - return (this.attributeValue != null && !this.attributeValue.isEmpty()); - } - - private boolean processAssignments( - List assignments) { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - for (AttributeAssignmentExpressionType assignment : assignments) { - if (!assignment.getAttributeId().equals(attributeId)) { - if (logger.isDebugEnabled()) - logger.debug("Ignoring: " + assignment.getAttributeId()); - continue; - } - - if (logger.isDebugEnabled()) - logger.debug("Found Attribute ID: " + assignment.getAttributeId()); - - JAXBElement jaxbExp = assignment.getExpression(); - Object assignmentObject = jaxbExp.getValue(); - if (assignmentObject instanceof AttributeValueType) { - AttributeValueType avt = (AttributeValueType) assignmentObject; - if (avt.getContent().size() <= 0) { - logger.warn("Ignoring: " + assignment.getAttributeId() + ": No values"); - continue; - } - - this.attributeValue = avt.getContent().get(0).toString(); - if (logger.isInfoEnabled()) - logger.info("Found: " + this.attributeValue); - - return true; - } - } - return false; - } - - @Override - public CallbackResult onAdvice(Object parent, AdviceExpressionType expression, Advice advice) { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - List assignments = - expression.getAttributeAssignmentExpression(); - - if (assignments != null) { - boolean found = processAssignments(assignments); - if (found) - return CallbackResult.STOP; - } - - return super.onAdvice(parent, expression, advice); - } - - @Override - public CallbackResult onObligation(Object parent, ObligationExpressionType expression, Obligation obligation) { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - List assignments = - expression.getAttributeAssignmentExpression(); - - if (assignments != null) { - boolean found = processAssignments(assignments); - if (found) - return CallbackResult.STOP; - } - - return super.onObligation(parent, expression, obligation); - - } - } - - final protected String type; - final protected String name; - final protected String owner; - final protected String scope; - final protected File xacmlFile; - final protected File elkDirectory; - - final protected JAXBElement policy; - - protected PolicyBodyType bodyType; - protected String body; - - - public Xacml2Elk(String type, String name, - String owner, String scope, - File xacmlFile, File elkDirectory) - throws IllegalArgumentException { - - this.type = type; - this.name = name; - this.owner = owner; - this.scope = scope; - this.xacmlFile = xacmlFile; - this.elkDirectory = elkDirectory; - - this.policy = jaxbXacml(xacmlFile); - - this.body = ""; - this.bodyType = PolicyBodyType.none; - bodyFromXacml(); - } - - public Xacml2Elk(CLIOptions args) throws IllegalArgumentException { - this.type = args.type; - this.name = args.name; - this.owner = args.owner; - this.scope = args.scope; - this.xacmlFile = args.xacmlFile; - this.elkDirectory = args.elkDirectory; - - this.policy = jaxbXacml(xacmlFile); - - if (args.body == null || args.body.isEmpty()) { - this.body = ""; - this.bodyType = PolicyBodyType.none; - bodyFromXacml(); - } else { - this.body = args.body; - this.bodyType = args.bodyType; - } - } - - public Xacml2Elk(String type, String name, String owner, - String scope, File xacmlFile, PolicyBodyType bodyType, - String body, File destinationDir) - throws IllegalArgumentException { - this.type = type; - this.name = name; - this.owner = owner; - this.scope = scope; - this.xacmlFile = xacmlFile; - this.bodyType = bodyType; - this.body = body; - this.elkDirectory = destinationDir; - - this.policy = jaxbXacml(xacmlFile); - } - - public Xacml2Elk(File xacmlFile, boolean skipBody) - throws IllegalArgumentException { - this.policy = jaxbXacml(xacmlFile); - PolicyType jPolicy = this.policy.getValue(); - - this.xacmlFile = xacmlFile; - - this.type = ElkConnector.toPolicyType(xacmlFile.getName()).name(); - String fileName = xacmlFile.getName().replaceFirst(this.type + "_", ""); - if (fileName.indexOf(".") > 0) - this.name = fileName.substring(0, fileName.lastIndexOf(".")); - else - this.name = fileName; - - this.owner = "admin"; - this.scope = getScope(xacmlFile.getParent()); - this.elkDirectory = null; - - this.body = ""; - this.bodyType = PolicyBodyType.none; - if (!skipBody) { - bodyFromXacml(); - } - } - - @SuppressWarnings("unchecked") - protected JAXBElement jaxbXacml(File xacmlFile) throws IllegalArgumentException { - Path xacmlPath = xacmlFile.toPath(); - if (!Files.isReadable(xacmlPath) || !Files.isRegularFile(xacmlPath)) { - if (logger.isWarnEnabled()) { - logger.warn("Error: " + xacmlPath + " is invalid."); - } - throw new IllegalArgumentException("Error: " + xacmlPath + " is invalid."); - } - - try { - Unmarshaller u = jaxbContext.createUnmarshaller(); - return (JAXBElement) u.unmarshal(xacmlFile); - } catch (Exception e) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLErrorConstants.ERROR_DATA_ISSUE + " - error: " + xacmlPath + " is invalid."); - } - throw new IllegalArgumentException(xacmlFile.getAbsolutePath() + " does not contain valid XACML"); - } - } - - public JAXBElement getPolicy() { - return policy; - } - - protected String getScope(String xacmlDirPath) { - if (logger.isTraceEnabled()) logger.trace("ENTER"); - - xacmlDirPath = xacmlDirPath.replaceAll("//", "/"); - xacmlDirPath = xacmlDirPath.replaceAll("\\\\", "/"); - xacmlDirPath = xacmlDirPath.replace('\\', '/'); - - String ws = XACMLProperties.getProperty(XACMLRestProperties.PROP_ADMIN_WORKSPACE); - String adminRepo = XACMLProperties.getProperty(XACMLRestProperties.PROP_ADMIN_REPOSITORY); - Path wsPath = Paths.get(ws, "admin", adminRepo); - File repoDir = wsPath.toFile(); - String repoPath = repoDir.getPath(); - repoPath = repoPath.replaceAll("//", "/"); - repoPath = repoPath.replaceAll("\\\\", "/"); - repoPath = repoPath.replace('\\', '/'); - - int startIndex = xacmlDirPath.indexOf(repoPath.toString()) + repoPath.toString().length() + 1; - String scope = xacmlDirPath.substring(startIndex, xacmlDirPath.length()); - - if (logger.isInfoEnabled()) - logger.info("xacml-policy-path=" + xacmlDirPath + "|" + - "repository-path=" + repoPath + "|" + - "scope=" + scope); - - return scope; - } - - @SuppressWarnings("deprecation") - private boolean bodyFromXacml() { - if (logger.isTraceEnabled()) - logger.trace("ENTER"); - - String urlAttribute = URLID_ATTRIBUTE; - try { - switch (ElkConnector.toPolicyType(this.type)) { - case Action: - urlAttribute = BODY_ATTRIBUTE; - break; - case Decision: - case none: - /* no body attached to decision policies */ - if (logger.isInfoEnabled()) - logger.info("No body attached for this type of policy: " + this.xacmlFile.getAbsolutePath()); - return false; - default: - /* a flavour of a config policy - default is fine */ - break; - } - } catch (IllegalArgumentException iae) { - if (logger.isWarnEnabled()) { - logger.warn(this.type + " cannot be converted to a valid type: " + iae.getMessage(), iae); - } - return false; - } - - AttributeAssignmentFinderProcessor - processor = new AttributeAssignmentFinderProcessor(urlAttribute); - XACMLPolicyScanner xacmlScanner = - new XACMLPolicyScanner(this.policy.getValue(), processor); - xacmlScanner.scan(); - if (!processor.isAttributeValue()) { - if (logger.isInfoEnabled()) - logger.info(urlAttribute + " not found in " + this.xacmlFile.getAbsolutePath()); - return false; - } - - String configsUrl = XACMLProperties.getProperty(XACMLRestProperties.PROP_CONFIG_URL); - if (configsUrl == null || configsUrl.isEmpty() || !configsUrl.startsWith("http")) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLRestProperties.PROP_CONFIG_URL + " property is not set."); - } - configsUrl = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL); - if (configsUrl == null || configsUrl.isEmpty() || !configsUrl.startsWith("http")) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLRestProperties.PROP_PAP_URL + " property is not set."); - } - return false; - } else { - configsUrl = configsUrl.replaceFirst("/pap", ""); - } - } - - if (!configsUrl.endsWith("/")) { - configsUrl += "/"; - } - - String urlXacml = processor.getAttributeValue(); - if (logger.isDebugEnabled()) { - logger.debug("configs url is " + configsUrl + "and url in xacml is " + urlXacml); - } - - if (urlXacml.startsWith("http")) { - // assuming this an unescaped url - } else if (urlXacml.startsWith("$URLConfig/")) { - urlXacml = urlXacml.replace("$URLConfig/", configsUrl); - } else if (urlXacml.startsWith("$URL/")) { - urlXacml = urlXacml.replace("$URL/", configsUrl); - } else{ - if (logger.isWarnEnabled()) { - logger.warn("XACML url is not in the expected format: " + urlXacml); - } - return false; - } - - if (urlXacml.endsWith(".properties")) { - this.bodyType = PolicyBodyType.properties; - } else if (urlXacml.endsWith(".json")) { - this.bodyType = PolicyBodyType.json; - } else if (urlXacml.endsWith(".xml")) { - this.bodyType = PolicyBodyType.xml; - } else if (urlXacml.endsWith(".txt")) { - this.bodyType = PolicyBodyType.txt; - } - - if (logger.isDebugEnabled()) { - logger.debug("converted url from xacml is " + urlXacml + ", body-type is " + this.bodyType); - } - - InputStream inConfigs = null; - try { - URL url = new URL(urlXacml); - URLConnection connection = url.openConnection(); - inConfigs = connection.getInputStream(); - String encoding = connection.getContentEncoding(); - encoding = (encoding == null ? "UTF-8" : encoding); - this.body = IOUtils.toString(inConfigs, encoding); - if (logger.isInfoEnabled()) { - logger.info("The following document of type " + this.bodyType.toString() + - " has been fetched from " + urlXacml + System.lineSeparator() + - this.body); - } - try { - inConfigs.close(); - } catch (IOException e) { - // ignore - logger.warn("Unexpected error closing stream to " + urlXacml, e); - } - return true; - } catch (Exception e) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- XACML url is not in the expected format: " + e.getMessage() + - ": " + urlXacml, e); - } - // continue - } finally { - if (inConfigs != null) { - try { - inConfigs.close(); - } catch (IOException e) { - // ignore - logger.warn("Unexpected error closing stream to " + urlXacml, e); - } - } - } - - // if retrieval through PAP url was not possible, try to retrieve it from - // filesystem instead. - - if (this.body == null || this.body.isEmpty()) { - Path webappsPath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WEBAPPS)); - if (webappsPath == null) { - logger.error("Invalid Webapps Path Location property : " + - XACMLRestProperties.PROP_PAP_WEBAPPS); - return false; - } - String waPath = webappsPath.toFile().getAbsolutePath(); - - String typeDir = null; - try { - typeDir = Xacml2Elk.toConfigsWebDirectory(this.type); - } catch (IllegalArgumentException iae) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- " + this.type + - " cannot be converted to body-directory: " + iae.getMessage(), - iae); - } - this.bodyType = PolicyBodyType.none; - return false; - } - - String scopePrefix = this.scope.replace('/', '.'); - Path bodyPath = Paths.get(waPath, - typeDir, - scopePrefix + "." + this.type + "_" + - this.name + "." + this.bodyType.name()); - File bodyFile = bodyPath.toFile(); - if (Files.notExists(bodyPath)) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "The following document of type " + this.bodyType.toString() + - " does not exist at filesystem location " + bodyFile.getAbsolutePath()); - } - this.bodyType = PolicyBodyType.none; - return false; - } else { - if (logger.isInfoEnabled()) { - logger.info("The following document of type " + this.bodyType.toString() + - " will be fetched from filesystem location " + bodyFile.getAbsolutePath()); - } - } - - try { - inConfigs = new FileInputStream(bodyFile); - this.body = IOUtils.toString(inConfigs); - inConfigs.close(); - if (logger.isInfoEnabled()) { - logger.info("The document of type " + this.bodyType.toString() + - " has been found at filesystem location " + bodyFile.getAbsolutePath()); - } - } catch (Exception e) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- XACML Body File cannot be read: " + bodyFile.getAbsolutePath(), e); - } - this.bodyType = PolicyBodyType.none; - return false; - } finally { - if (inConfigs != null) { - try { - inConfigs.close(); - } catch (IOException e) { - // ignore - logger.warn("Unexpected error closing stream to " + urlXacml, e); - } - } else { - return false; - } - } - } - return true; - } - - public boolean attachJsonBody(JsonNode jPolicy) { - if (this.body == null) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- JSON Body expected but none provided from " + - this.scope + ":" + this.type + ":" + this.name); - } - return true; - } - - ObjectNode jPolicyRoot = (ObjectNode) jPolicy; - - // verify the json is valid - final ObjectMapper mapper = new ObjectMapper(); - JsonNode jBodyContent; - try { - jBodyContent = mapper.readTree(this.body); - } catch (IOException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- JSON Body is invalid in " + - this.scope + ":" + this.type + ":" + this.name + ":" + - e.getMessage() + System.lineSeparator() + this.body, e); - return false; - } - - String jBodyName = this.type + "_" + "Body"; - ObjectNode jBodyContainer = mapper.createObjectNode(); - jBodyContainer.set(jBodyName, jBodyContent); - - jPolicyRoot.set("Body", jBodyContainer); - - if (logger.isDebugEnabled()) - logger.debug("Attaching JSON to " + - this.scope + ":" + - this.type + ":" + this.name + ":" + - jBodyName + System.lineSeparator() + - jBodyContent); - - return true; - } - - @SuppressWarnings("unchecked") - public boolean attachXmlBody(JsonNode jPolicy) { - if (this.body == null) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- JSON Body expected but none provided from " + - this.scope + ":" + this.type + ":" + this.name); - } - return true; - } - - XmlMapper xmlMapper = new XmlMapper(); - xmlMapper.setConfig(xmlMapper.getSerializationConfig().withRootName("")); - Map map; - try { - map = xmlMapper.readValue(this.body, Map.class); - } catch (IOException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- XML Body is invalid in " + - this.scope + ":" + this.type + ":" + this.name + ":" + - e.getMessage() + System.lineSeparator() + this.body, e); - return false; - } - - final ObjectMapper mapper = new ObjectMapper(); - String jXmlBody; - try { - jXmlBody = mapper.writeValueAsString(map); - } catch (JsonProcessingException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- Cannot convert XML Body to JSON in " + - this.scope + ":" + this.type + ":" + this.name + ":" + - e.getMessage() + System.lineSeparator() + this.body, e); - return false; - } - - if (logger.isDebugEnabled()) - logger.debug("XML-to-JSON Body conversion: " + this.scope + ":" + - this.type + ":" + this.name +jXmlBody); - - JsonNode jBodyContent; - try { - jBodyContent = mapper.readTree(jXmlBody); - } catch (IOException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- JSON Body (converted from XML) is invalid in " + - this.scope + ":" + this.type + ":" + this.name + ":" + - e.getMessage() + System.lineSeparator() + jXmlBody, e); - return false; - } - - ObjectNode jPolicyRoot = (ObjectNode) jPolicy; - - String jBodyName = this.type + "_" + "Body"; - ObjectNode jBodyContainer = mapper.createObjectNode(); - jBodyContainer.set(jBodyName, jBodyContent); - - jPolicyRoot.set("Body", jBodyContainer); - - - if (logger.isDebugEnabled()) - logger.debug("Attaching JSON to " + - this.scope + ":" + - this.type + ":" + this.name + ":" + - jBodyName + System.lineSeparator() + - jBodyContent); - - return true; - } - - protected boolean attachPropertiesBody(JsonNode jPolicy) { - if (this.body == null) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- JSON Body expected but none provided from " + - this.scope + ":" + this.type + ":" + this.name); - } - return true; - } - - final Properties propBody = new Properties(); - try { - propBody.load(new StringReader(this.body)); - } catch (IOException e) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- JSON Body is invalid in " + - this.scope + ":" + this.type + ":" + this.name + ":" + - e.getMessage() + System.lineSeparator() + this.body, e); - return false; - } - - if (propBody.isEmpty()) { - if (logger.isInfoEnabled()) { - logger.info("Empty set of properties: " + - this.scope + ":" + this.type + ":" + this.name + - System.lineSeparator() + this.body); - } - return true; - } - - - final ObjectMapper mapper = new ObjectMapper(); - - ObjectNode jPolicyRoot = (ObjectNode) jPolicy; - ObjectNode jBody = jPolicyRoot.putObject("Body"); - String jBodyName = this.type + "_" + "Body"; - ObjectNode jBodyContainer = jBody.putObject(jBodyName); - - // ObjectNode jBodyContainer = mapper.createObjectNode(); - - for(String key : propBody.stringPropertyNames()) { - String value = propBody.getProperty(key); - if (logger.isDebugEnabled()) { - logger.debug("Attaching JSON field to " + jBodyName + " for " + - this.type.toString() + ":" + - this.scope + ":" + this.name + ":" + jBodyName + ":" + - " <" + key +"," + value + ">"); - } - jBodyContainer.put(key, propBody.getProperty(key)); - } - - return true; - } - - public boolean attachTextBody(JsonNode jPolicy) { - if (this.body == null) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- JSON Body expected but none provided from " + - this.scope + ":" + this.type + ":" + this.name); - } - return true; - } - - final ObjectMapper mapper = new ObjectMapper(); - StringWriter jsonEscapedTextWriter = new StringWriter(); - try { - mapper.writer().writeValue(jsonEscapedTextWriter, this.body); - } catch (IOException e) { - if (logger.isWarnEnabled()) { - logger.warn(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "- Text Body cannot be converted from " + - this.scope + ":" + this.type + ":" + this.name + ":" + - e.getMessage() + ":" + jsonEscapedTextWriter , e); - } - return false; - } - String jTextBody = jsonEscapedTextWriter.toString(); - - if (logger.isDebugEnabled()) - logger.debug("XML 2JSON Body conversion: " + this.scope + ":" + - this.type + ":" + this.name + ":" + jTextBody); - - ObjectNode jPolicyRoot = (ObjectNode) jPolicy; - - String jBodyName = this.type + "_" + "Body"; - ObjectNode jBodyContainer = mapper.createObjectNode(); - jBodyContainer.put(jBodyName, jTextBody); - - jPolicyRoot.set("Body", jBodyContainer); - - if (logger.isDebugEnabled()) - logger.debug("Attaching JSON to " + - this.scope + ":" + - this.type + ":" + this.name + ":" + - jBodyName + ":" + - jTextBody); - - return true; - } - - protected boolean attachBody(JsonNode jPolicy) { - if (logger.isTraceEnabled()) logger.trace("ENTER"); - - if (this.bodyType == PolicyBodyType.none) { - if (logger.isInfoEnabled()) - logger.info("No body to attach for policy " + - this.scope + "/" + this.type + "_" + this.name); - - return true; - } - - if (this.body == null || this.body.isEmpty()) { - if (logger.isWarnEnabled()) - logger.warn("No body to attach for policy " + - this.bodyType + this.type + this.scope + this.name); - - return true; - } - - switch (this.bodyType) { - case json: - return attachJsonBody(jPolicy); - case properties: - return attachPropertiesBody(jPolicy); - case xml: - return attachXmlBody(jPolicy); - case txt: - return attachTextBody(jPolicy); - case none: - default: - if (logger.isWarnEnabled()) - logger.warn("Unexpected body type: " + this.bodyType + - this.bodyType + this.type + this.scope + this.name); - return false; - } - } - - public ElkRecord record() throws JAXBException, JsonProcessingException, - IOException, IllegalArgumentException { - if (logger.isTraceEnabled()) logger.trace("ENTER"); - - Marshaller m = jaxbContext.createMarshaller(); - m.setProperty(MarshallerProperties.MEDIA_TYPE, "application/json"); - m.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, true); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); - m.setProperty(MarshallerProperties.JSON_REDUCE_ANY_ARRAYS, true); - m.setProperty(MarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS, false); - - StringWriter policyStringWriter = new StringWriter(); - m.marshal(policy, policyStringWriter); - - // add metadata to elk record - - final ObjectMapper mapper = new ObjectMapper(); - JsonNode jRoot = mapper.readTree(policyStringWriter.toString()); - JsonNode jPolicy = jRoot.path("Policy"); - if (jPolicy.isMissingNode()) { - logger.warn("Aborting: Policy root node is missing."); - throw new IllegalArgumentException("Missing policy root node"); - } - - ((ObjectNode) jPolicy).put("PolicyType", this.type.toString()); - ((ObjectNode) jPolicy).put("PolicyName", this.name); - ((ObjectNode) jPolicy).put("Owner", this.owner); - ((ObjectNode) jPolicy).put("Scope", this.scope); - - JsonNode jPolicyId = jPolicy.path("PolicyId"); - if (jPolicyId.isMissingNode()) { - logger.warn("Aborting: Policy ID node is missing."); - throw new IllegalArgumentException("Missing policy id"); - } - - if (!jPolicyId.isTextual() || !jPolicyId.isValueNode()) { - logger.warn("Aborting: Policy ID invalid."); - throw new IllegalArgumentException("Invalid policy id"); - } - - String xacmlPolicyId = jPolicyId.asText(); - String policyId = xacmlPolicyId.substring(xacmlPolicyId.lastIndexOf(":")+1); - - boolean success = attachBody(jPolicy); - - mapper.configure(SerializationFeature.INDENT_OUTPUT, true); - mapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true); - mapper.configure(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS, false); - mapper.configure(SerializationFeature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED, true); - - String recordText = mapper.writeValueAsString(jRoot); - if (logger.isDebugEnabled()) { - logger.debug("ELK Record: " + System.lineSeparator() + recordText); - } - - ElkRecord elkRecord = new ElkRecord(policyId, recordText, jRoot, success); - return elkRecord; - } - - public void store(String policyId, String record) throws IOException { - if (logger.isTraceEnabled()) logger.trace("ENTER"); - - if (this.elkDirectory != null) { - Files.createDirectories(this.elkDirectory.toPath());; - Path elkPolicyFile = Paths.get(this.elkDirectory.getPath(), policyId + ".json"); - - if (logger.isDebugEnabled()) { - logger.info("Output: " + elkPolicyFile.toAbsolutePath().toString()); - logger.info("---------------------------------------------------"); - } - - Files.write(elkPolicyFile, record.getBytes()); - } - } - - public static void main(String args[]) - throws JAXBException, IOException, CmdLineException, IllegalStateException { - - CLIOptions cliOptions = new CLIOptions(); - CmdLineParser cliParser= new CmdLineParser(cliOptions); - - try { - cliParser.parseArgument(args); - } catch (CmdLineException e) { - System.err.println("Usage: Xacml2elk"); - cliParser.printUsage(System.err); - throw e; - } - - System.out.println("---------------------------------------------------"); - System.out.println("Converting " + cliOptions.xacmlFile.getName() + " to ELK format"); - System.out.println("Metadata=" + "[type:" + cliOptions.type + - "|name:" + cliOptions.name + - "|owner:" + cliOptions.owner + - "|scope:" + cliOptions.scope + "]"); - - // generate json from jaxb input file - - Path xacmlPath = cliOptions.xacmlFile.toPath(); - if (!Files.isReadable(xacmlPath) || !Files.isRegularFile(xacmlPath)) { - System.out.println("Error: " + xacmlPath + " is invalid."); - throw new IllegalArgumentException("Error: " + xacmlPath + " is invalid."); - } - - - Xacml2Elk convertor = new Xacml2Elk(cliOptions); - ElkRecord elkRecord = convertor.record(); - System.out.println(elkRecord.record); - - Path elkOutDir = cliOptions.elkDirectory.toPath(); - if (!Files.isReadable(elkOutDir) || !Files.isDirectory(elkOutDir) || - !Files.isWritable(elkOutDir) || !Files.isExecutable(elkOutDir)) { - System.out.println("Error: " + elkOutDir.getFileName() + " is invalid."); - throw new IllegalArgumentException("Error: " + elkOutDir.getFileName() + " is invalid."); - } - - convertor.store(elkRecord.policyId, elkRecord.record); - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/model/PDPGroupContainer.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/model/PDPGroupContainer.java deleted file mode 100644 index fd996f444..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/model/PDPGroupContainer.java +++ /dev/null @@ -1,531 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.model; - - -import java.awt.Checkbox; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -import org.openecomp.policy.utils.PolicyContainer; -import org.openecomp.policy.utils.PolicyItemSetChangeNotifier; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.api.pap.EcompPDP; -import org.openecomp.policy.xacml.api.pap.EcompPDPGroup; -import org.openecomp.policy.xacml.api.pap.PAPPolicyEngine; - -import com.att.research.xacml.api.pap.PAPEngine; -import com.att.research.xacml.api.pap.PAPException; -import com.att.research.xacml.api.pap.PDP; -//import com.att.research.xacml.api.pap.PDP; -//import com.att.research.xacml.api.pap.PDPGroup; -import com.att.research.xacml.api.pap.PDPPIPConfig; -import com.att.research.xacml.api.pap.PDPPolicy; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -public class PDPGroupContainer extends PolicyItemSetChangeNotifier implements PolicyContainer.Indexed, PolicyContainer.ItemSetChangeNotifier { - private static final long serialVersionUID = 1L; - private static Logger logger = FlexLogger.getLogger(PDPGroupContainer.class); - - /** - * String identifier of a file's "Id" property. - */ - public static String PROPERTY_ID = "Id"; - - /** - * String identifier of a file's "name" property. - */ - public static String PROPERTY_NAME = "Name"; - - /** - * String identifier of a file's "Description" property. - */ - public static String PROPERTY_DESCRIPTION = "Description"; - - /** - * String identifier of a file's "Default" property. - */ - public static String PROPERTY_DEFAULT = "Default"; - - /** - * String identifier of a file's "icon" property. - */ - public static String PROPERTY_ICON = "Icon"; - - /** - * String identifier of a file's "Status" property. - */ - public static String PROPERTY_STATUS = "Status"; - - /** - * String identifier of a file's "PDPs" property. - */ - public static String PROPERTY_PDPS = "PDPs"; - - /** - * String identifier of a file's "Policies" property. - */ - public static String PROPERTY_POLICIES = "Policies"; - - /** - * String identifier of a file's "PIP Configurations" property. - */ - public static String PROPERTY_PIPCONFIG = "PIP Configurations"; - - /** - * String identifier of a file's "Selected" property. - */ - public static String PROPERTY_SELECTED = "Selected"; - - /** - * List of the string identifiers for the available properties. - */ - public static Collection PDP_PROPERTIES; - - private PAPPolicyEngine papEngine = null; - protected List groups = Collections.synchronizedList(new ArrayList()); - - public PDPGroupContainer(PAPPolicyEngine papPolicyEngine) { - super(); - this.setContainer(this); - // - // - // - this.papEngine = (PAPPolicyEngine) papPolicyEngine; - // - // - // - this.refreshGroups(); - } - - public boolean isSupported(Object itemId) { - if (itemId instanceof EcompPDPGroup) { - return true; - } - return false; - } - - public synchronized void refreshGroups() { - synchronized(this.groups) { - this.groups.clear(); - try { - this.groups.addAll(this.papEngine.getEcompPDPGroups()); - } catch (PAPException e) { - String message = "Unable to retrieve Groups from server: " + e; - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + message, e); - } - logger.info("refreshGroups"); - } - // - // Notify that we have changed - // - this.fireItemSetChange(); - } - - public List getGroups() { - return Collections.unmodifiableList(this.groups); - } - - public void makeDefault(EcompPDPGroup group) { - try { - this.papEngine.SetDefaultGroup(group); - } catch (PAPException e) { - String message = "Unable to set Default Group on server: " + e; - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + message, e); - } - return; - } - - public void removeGroup(EcompPDPGroup group, EcompPDPGroup newGroup) throws PAPException { - if (logger.isTraceEnabled()) { - logger.trace("removeGroup: " + group + " new group for PDPs: " + newGroup); - } - if (group.isDefaultGroup()) { - throw new UnsupportedOperationException("You can't remove the Default Group."); - } - try { - this.papEngine.removeGroup(group, newGroup); - } catch (NullPointerException | PAPException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to removeGroup " + group.getId(), e); - throw new PAPException("Failed to remove group '" + group.getId()+ "'", e); - } - } - - public void removePDP(EcompPDP pdp, EcompPDPGroup group) throws PAPException { - if (logger.isTraceEnabled()) { - logger.trace("removePDP: " + pdp + " from group: " + group); - } - try { - this.papEngine.removePDP(pdp); - } catch (PAPException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to removePDP " + pdp.getId(), e); - throw new PAPException("Failed to remove pdp '" + pdp.getId()+ "'", e); - } - } - - public void updatePDP(EcompPDP pdp) { - try { - papEngine.updatePDP(pdp); - } catch (PAPException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e); - } - } - - public void updateGroup(EcompPDPGroup group) { - try { - papEngine.updateGroup(group); - } catch (PAPException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e); - } - } - - @Override - public Collection getContainerPropertyIds() { - return PDP_PROPERTIES; - } - - @Override - public Collection getItemIds() { - final Collection items = new ArrayList(); - items.addAll(this.groups); - if (logger.isTraceEnabled()) { - logger.trace("getItemIds: " + items); - } - return Collections.unmodifiableCollection(items); - } - - @Override - public Class getType(Object propertyId) { - if (propertyId.equals(PROPERTY_ID)) { - return String.class; - } - if (propertyId.equals(PROPERTY_NAME)) { - return String.class; - } - if (propertyId.equals(PROPERTY_DESCRIPTION)) { - return String.class; - } - if (propertyId.equals(PROPERTY_DEFAULT)) { - return Boolean.class; - } - if (propertyId.equals(PROPERTY_STATUS)) { - return String.class; - } - if (propertyId.equals(PROPERTY_PDPS)) { - return Set.class; - } - if (propertyId.equals(PROPERTY_POLICIES)) { - return Set.class; - } - if (propertyId.equals(PROPERTY_PIPCONFIG)) { - return Set.class; - } - if (propertyId.equals(PROPERTY_SELECTED)) { - return Checkbox.class; - } - return null; - } - - @Override - public int size() { - return this.groups.size(); - } - - @Override - public boolean containsId(Object itemId) { - if (logger.isTraceEnabled()) { - logger.trace("containsId: " + itemId); - } - if (this.isSupported(itemId) == false) { - return false; - } - return this.groups.contains(itemId); - } - - @Override - public Object addItem() throws UnsupportedOperationException { - throw new UnsupportedOperationException("PDP Container cannot add a given item."); - } - - public void addNewGroup(String name, String description) throws NullPointerException, PAPException { - if (logger.isTraceEnabled()) { - logger.trace("addNewGroup " + name + " " + description); - } - this.papEngine.newGroup(name, description); - } - - public void addNewPDP(String id, EcompPDPGroup group, String name, String description, int jmxport) throws NullPointerException, PAPException { - if (logger.isTraceEnabled()) { - logger.trace("addNewPDP " + id + " " + name + " " + description + " " + jmxport); - } - this.papEngine.newPDP(id, group, name, description, jmxport); - } - - public void movePDP(EcompPDP pdp, EcompPDPGroup group) { - try { - this.papEngine.movePDP(pdp, group); - } catch (PAPException e) { - String message = "Unable to move PDP to new group on server: " + e; - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + message, e); - } - return; - } - - @Override - public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Cannot add a container property."); - } - - @Override - public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Cannot remove a container property."); - } - - @Override - public boolean removeAllItems() throws UnsupportedOperationException { - throw new UnsupportedOperationException("PDP Container cannot remove all items. You must have at least the Default group."); - } - - @Override - public void addItemSetChangeListener(ItemSetChangeListener listener) { - if (getItemSetChangeListeners() == null) { - setItemSetChangeListeners(new LinkedList()); - } - getItemSetChangeListeners().add(listener); - } - - @Override - public Object nextItemId(Object itemId) { - if (this.isSupported(itemId) == false) { - return null; - } - int index = this.groups.indexOf(itemId); - if (index == -1) { - // - // We don't know this group - // - return null; - } - // - // Is it the last one? - // - if (index == this.groups.size() - 1) { - // - // Yes - // - return null; - } - // - // Return the next one - // - return this.groups.get(index + 1); - } - - @Override - public Object prevItemId(Object itemId) { - if (this.isSupported(itemId) == false) { - return null; - } - int index = this.groups.indexOf(itemId); - if (index == -1) { - // - // We don't know this group - // - return null; - } - // - // Is it the first one? - // - if (index == 0) { - // - // Yes - // - return null; - } - // - // Return the previous one - // - return this.groups.get(index - 1); - } - - @Override - public Object firstItemId() { - synchronized (this.groups) { - if (this.groups.size() > 0) { - return this.groups.get(0); - } - } - return null; - } - - @Override - public Object lastItemId() { - synchronized (this.groups) { - if (this.groups.size() > 0) { - return this.groups.get(this.groups.size() - 1); - } - } - return null; - } - - @Override - public boolean isFirstId(Object itemId) { - synchronized (this.groups) { - if (this.groups.size() > 0) { - return (this.groups.get(0).equals(itemId)); - } - } - return false; - } - - @Override - public boolean isLastId(Object itemId) { - synchronized (this.groups) { - if (this.groups.size() > 0) { - return (this.groups.get(this.groups.size() - 1).equals(itemId)); - } - } - return false; - } - - @Override - public Object addItemAfter(Object previousItemId) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Cannot addItemAfter, there really is no real ordering."); - } - - @Override - public int indexOfId(Object itemId) { - return this.groups.indexOf(itemId); - } - - @Override - public Object getIdByIndex(int index) { - return this.groups.get(index); - } - - @Override - public List getItemIds(int startIndex, int numberOfItems) { - synchronized (this.groups) { - int endIndex = startIndex + numberOfItems; - if (endIndex > this.groups.size()) { - endIndex = this.groups.size() - 1; - } - return this.groups.subList(startIndex, endIndex); - } - } - - @Override - public Object addItemAt(int index) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Cannot addItemAt"); - } - - @Override - public boolean removeItem(Object itemId) throws UnsupportedOperationException { - if (logger.isTraceEnabled()) { - logger.trace("removeItem: " + itemId); - } - if (this.isSupported(itemId) == false) { - return false; - } - // - // You cannot remove the default group - // - if (((EcompPDPGroup) itemId).getId().equals("Default")) { - throw new UnsupportedOperationException("You can't remove the Default Group."); - } - // - // Remove PDPGroup and move any PDP's in it into the default group - // - try { - this.papEngine.removeGroup((EcompPDPGroup) itemId, this.papEngine.getDefaultGroup()); - return true; - } catch (NullPointerException | PAPException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to remove group", e); - } - return false; - } - - public class PDPGroupItem{ - private final EcompPDPGroup group; - - public PDPGroupItem(EcompPDPGroup itemId) { - this.group = itemId; - } - - public String getId() { - if (logger.isTraceEnabled()) { - logger.trace("getId: " + this.group); - } - return this.group.getId(); - } - - public String getName() { - if (logger.isTraceEnabled()) { - logger.trace("getName: " + this.group); - } - return this.group.getName(); - } - - public String getDescription() { - if (logger.isTraceEnabled()) { - logger.trace("getDescription: " + this.group); - } - return this.group.getDescription(); - } - - public Boolean getDefault() { - if (logger.isTraceEnabled()) { - logger.trace("getDefault: " + this.group); - } - return this.group.isDefaultGroup(); - } - - - public String getStatus() { - return this.group.getStatus().getStatus().toString(); - } - - public Set getPDPs() { - return Collections.unmodifiableSet(this.group.getPdps()); - } - - public Set getPolicies() { - if (logger.isTraceEnabled()) { - logger.trace("getPolicies: " + this.group); - } - return this.group.getPolicies(); - } - - public Set getPipConfigs() { - if (logger.isTraceEnabled()) { - logger.trace("getPIPConfigs: " + this.group); - } - return this.group.getPipConfigs(); - } - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/model/PDPPolicyContainer.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/model/PDPPolicyContainer.java deleted file mode 100644 index bea7915a4..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/model/PDPPolicyContainer.java +++ /dev/null @@ -1,348 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.model; - - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Set; - -import org.openecomp.policy.utils.PolicyContainer; -import org.openecomp.policy.utils.PolicyItemSetChangeNotifier; -import org.openecomp.policy.common.logging.flexlogger.*; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import com.att.research.xacml.api.pap.PDP; -import com.att.research.xacml.api.pap.PDPGroup; -import com.att.research.xacml.api.pap.PDPPolicy; -import org.openecomp.policy.xacml.std.pap.StdPDPPolicy; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class PDPPolicyContainer extends PolicyItemSetChangeNotifier implements PolicyContainer.Indexed { - private static final long serialVersionUID = 1L; - private static Logger logger = FlexLogger.getLogger(PDPPolicyContainer.class); - - /** - * String identifier of a file's "Id" property. - */ - public static String PROPERTY_ID = "Id"; - - /** - * String identifier of a file's "name" property. - */ - public static String PROPERTY_NAME = "Name"; - - /** - * String identifier of a file's "name" property. - */ - public static String PROPERTY_VERSION = "Version"; - - /** - * String identifier of a file's "Description" property. - */ - public static String PROPERTY_DESCRIPTION = "Description"; - - /** - * String identifier of a file's "IsRoot" property. - */ - public static String PROPERTY_ISROOT = "Root"; - - /** - * List of the string identifiers for the available properties. - */ - public static Collection PDPPOLICY_PROPERTIES; - - private final Object data; - private List policies; - - @SuppressWarnings("unchecked") - public PDPPolicyContainer(Object data) { - super(); - this.data = data; - if (this.data instanceof PDPGroup) { - policies = new ArrayList (((PDPGroup) this.data).getPolicies()); - } - if (this.data instanceof PDP) { - policies = new ArrayList (((PDP) this.data).getPolicies()); - } - if (this.data instanceof Set) { - policies = new ArrayList ((Set)data); - } - if (this.policies == null) { - logger.info("NULL policies"); - throw new NullPointerException("PDPPolicyContainer created with unexpected Object type '" + data.getClass().getName() + "'"); - } - this.setContainer(this); - } - - @Override - public Object nextItemId(Object itemId) { - if (logger.isTraceEnabled()) { - logger.trace("nextItemId: " + itemId); - } - int index = this.policies.indexOf(itemId); - if (index == -1 || ((index + 1) >= this.policies.size())) { - return null; - } - return new PDPPolicyItem(this.policies.get(index + 1)); - } - - @Override - public Object prevItemId(Object itemId) { - if (logger.isTraceEnabled()) { - logger.trace("prevItemId: " + itemId); - } - int index = this.policies.indexOf(itemId); - if (index <= 0) { - return null; - } - return new PDPPolicyItem(this.policies.get(index - 1)); - } - - @Override - public Object firstItemId() { - if (logger.isTraceEnabled()) { - logger.trace("firstItemId: "); - } - if (this.policies.isEmpty()) { - return null; - } - return new PDPPolicyItem(this.policies.get(0)); - } - - @Override - public Object lastItemId() { - if (logger.isTraceEnabled()) { - logger.trace("lastItemid: "); - } - if (this.policies.isEmpty()) { - return null; - } - return new PDPPolicyItem(this.policies.get(this.policies.size() - 1)); - } - - @Override - public boolean isFirstId(Object itemId) { - if (logger.isTraceEnabled()) { - logger.trace("isFirstId: " + itemId); - } - if (this.policies.isEmpty()) { - return false; - } - return (itemId.equals(this.policies.get(0))); - } - - @Override - public boolean isLastId(Object itemId) { - if (logger.isTraceEnabled()) { - logger.trace("isLastId: " + itemId); - } - if (this.policies.isEmpty()) { - return false; - } - return (itemId.equals(this.policies.get(this.policies.size() - 1))); - } - - @Override - public Object addItemAfter(Object previousItemId) - throws UnsupportedOperationException { - return null; - } - - @Override - public Collection getContainerPropertyIds() { - return PDPPOLICY_PROPERTIES; - } - - @Override - public Collection getItemIds() { - final Collection items = new ArrayList(); - items.addAll(this.policies); - return Collections.unmodifiableCollection(items); - } - - - @Override - public Class getType(Object propertyId) { - if (propertyId.equals(PROPERTY_ID)) { - return String.class; - } - if (propertyId.equals(PROPERTY_NAME)) { - return String.class; - } - if (propertyId.equals(PROPERTY_VERSION)) { - return String.class; - } - if (propertyId.equals(PROPERTY_DESCRIPTION)) { - return String.class; - } - if (propertyId.equals(PROPERTY_ISROOT)) { - return Boolean.class; - } - return null; - } - - @Override - public int size() { - if (logger.isTraceEnabled()) { - logger.trace("size: " + this.policies.size()); - } - return this.policies.size(); - } - - @Override - public boolean containsId(Object itemId) { - if (logger.isTraceEnabled()) { - logger.trace("containsId: " + itemId); - } - return this.policies.contains(itemId); - } - - @Override - public Object addItem() throws UnsupportedOperationException { - throw new UnsupportedOperationException("Cannot add an empty policy."); - } - - @Override - public boolean removeItem(Object itemId) - throws UnsupportedOperationException { - if (logger.isTraceEnabled()) { - logger.trace("removeItem: " + itemId); - } - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - StdPDPPolicy pdpPolicy = null; - try { - pdpPolicy = mapper.readValue(itemId.toString() , StdPDPPolicy.class); - for(int i = 0; i< policies.size(); i++){ - if(policies.get(i).getId().equalsIgnoreCase(pdpPolicy.getId())){ - return this.policies.remove(this.policies.get(i)); - } - } - } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "Exception Occured While Mapping the Removing Policy from PDP Group to Std Policy"+e); - } - return this.policies.remove(itemId); - } - - @Override - public boolean addContainerProperty(Object propertyId, Class type, - Object defaultValue) throws UnsupportedOperationException { - return false; - } - - @Override - public boolean removeContainerProperty(Object propertyId) - throws UnsupportedOperationException { - return false; - } - - @Override - public boolean removeAllItems() throws UnsupportedOperationException { - return false; - } - - @Override - public int indexOfId(Object itemId) { - if (logger.isTraceEnabled()) { - logger.trace("indexOfId: " + itemId); - } - return this.policies.indexOf(itemId); - } - - @Override - public Object getIdByIndex(int index) { - if (logger.isTraceEnabled()) { - logger.trace("getIdByIndex: " + index); - } - return this.policies.get(index); - } - - @Override - public List getItemIds(int startIndex, int numberOfItems) { - if (logger.isTraceEnabled()) { - logger.trace("getItemIds: " + startIndex + " " + numberOfItems); - } - if (numberOfItems < 0) { - throw new IllegalArgumentException(); - } - return this.policies.subList(startIndex, startIndex + numberOfItems); - } - - @Override - public Object addItemAt(int index) throws UnsupportedOperationException { - if (logger.isTraceEnabled()) { - logger.trace("addItemAt: " + index); - } - return null; - } - - public class PDPPolicyItem { - private final PDPPolicy policy; - - public PDPPolicyItem(PDPPolicy itemId) { - this.policy = itemId; - } - - public String getId() { - if (logger.isTraceEnabled()) { - logger.trace("getId: " + this.policy); - } - return this.policy.getId(); - } - - public String getName() { - if (logger.isTraceEnabled()) { - logger.trace("getName: " + this.policy); - } - return this.policy.getName(); - } - - public String getVersion() { - if (logger.isTraceEnabled()) { - logger.trace("getVersion: " + this.policy); - } - return this.policy.getVersion(); - } - - public String getDescription() { - if (logger.isTraceEnabled()) { - logger.trace("getDescription: " + this.policy); - } - return this.policy.getDescription(); - } - - public boolean getRoot() { - if (logger.isTraceEnabled()) { - logger.trace("isRoot: " + this.policy); - } - return this.policy.isRoot(); - } - - public void setRoot(Boolean root) { - ((StdPDPPolicy)this.policy).setRoot(root); - } - - } -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/model/Roles.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/model/Roles.java deleted file mode 100644 index 5cad87f41..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/model/Roles.java +++ /dev/null @@ -1,95 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.model; - - -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; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -@Entity -@Table(name="Roles") -@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) -public class Roles implements Serializable{ - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - - @Column(name="id") - private int id; - - private String loginId; - private String name; - private String scope; - private String role; - - public Roles(){ - - } - - public int getId() { - return this.id; - } - - public void setId(int id) { - this.id = id; - } - - public String getLoginId() { - return this.loginId; - } - - public void setLoginId(String loginId) { - this.loginId = loginId; - - } - public String getScope() { - return this.scope; - } - - public void setScope(String scope) { - this.scope = scope; - - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - public String getRole() { - return this.role; - } - - public void setRole(String role) { - this.role = role; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/ConfigurableRESTUtils.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/ConfigurableRESTUtils.java deleted file mode 100644 index eafd2196d..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/ConfigurableRESTUtils.java +++ /dev/null @@ -1,163 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.utils; - - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStreamWriter; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.Map; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - - -public class ConfigurableRESTUtils { - - protected Logger logger = FlexLogger.getLogger(this.getClass()); - - // - // How the value is returned from the RESTful server - // httpResponseCode means the result is simply the HTTP Response code (e.g. 200, 505, etc.) - // other values identify the encoding used for the string in the body of the HTTP response - // - public enum REST_RESPONSE_FORMAT {httpResponseCode, json } - public enum RESQUEST_METHOD { - GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; - } - - public String ERROR_RECEIVED = "ERROR - Unexpected HTTP response: "; - - public ConfigurableRESTUtils() { - - } - - - /** - * Call the RESTful API and return a string containing the result. The string may be either a httpResponseCode or json body - * - * @param fullURI - * @param hardCodedHeaders - * @param httpResponseCodes - * @param responseFormat - * @param jsonBody - * @param requestMethod - * @return String - */ - public String sendRESTRequest(String fullURI, Map hardCodedHeaderMap, - Map httpResponseCodeMap, - REST_RESPONSE_FORMAT responseFormat, - String jsonBody, - RESQUEST_METHOD requestMethod ){ - - String responseString = null; - HttpURLConnection connection = null; - try { - - URL url = new URL(fullURI); - - // - // Open up the connection - // - connection = (HttpURLConnection)url.openConnection(); - // - // Setup our method and headers - // - connection.setRequestMethod(requestMethod.toString()); - - connection.setUseCaches(false); - - // add hard-coded headers - for (String headerName : hardCodedHeaderMap.keySet()) { - connection.addRequestProperty(headerName, hardCodedHeaderMap.get(headerName)); - } - - - - if (jsonBody != null){ - connection.setDoInput(true); - connection.setDoOutput(true); - OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream()); - out.write(jsonBody); - out.flush(); - out.close(); - } else{ - connection.connect(); - } - - int responseCode = connection.getResponseCode(); - - // check that the response is one we expected (and get the associated value at the same time) - responseString = httpResponseCodeMap.get(responseCode); - if (responseString == null) { - // the response was not configured, meaning it is unexpected and therefore an error - logger.error("Unexpected HTTP response code '" + responseCode + "' from RESTful Server"); - return ERROR_RECEIVED + " code" + responseCode + " from RESTful Server"; - } - - // if the response is contained only in the http code we are done. Otherwise we need to read the body - if (responseFormat == REST_RESPONSE_FORMAT.httpResponseCode) { - return responseString; - } - - // Need to read the body and return that as the responseString. - - responseString = null; - // read the inputStream into a buffer (trick found online scans entire input looking for end-of-file) - java.util.Scanner scanner = new java.util.Scanner(connection.getInputStream()); - scanner.useDelimiter("\\A"); - responseString = scanner.hasNext() ? scanner.next() : ""; - scanner.close(); - logger.debug("RESTful body: " + responseString); - return responseString; - - } catch (Exception e) { - logger.error("HTTP Request/Response from RESTFUL server: " + e); - responseString = ERROR_RECEIVED + e; - } finally { - // cleanup the connection - if (connection != null) { - try { - // For some reason trying to get the inputStream from the connection - // throws an exception rather than returning null when the InputStream does not exist. - InputStream is = null; - try { - is = connection.getInputStream(); - } catch (Exception e1) { - // ignore this - } - if (is != null) { - is.close(); - } - - } catch (IOException ex) { - logger.error("Failed to close connection: " + ex, ex); - } - connection.disconnect(); - } - } - return responseString; - - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/PolicyContainer.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/PolicyContainer.java deleted file mode 100644 index fdca336ea..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/PolicyContainer.java +++ /dev/null @@ -1,121 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.utils; - -import java.io.Serializable; -import java.util.Collection; -import java.util.List; - - -public interface PolicyContainer extends Serializable{ - - public Collection getContainerPropertyIds(); - - public Collection getItemIds(); - - public Class getType(Object propertyId); - - public int size(); - - public boolean containsId(Object itemId); - - public Object addItem() throws UnsupportedOperationException; - - public boolean removeItem(Object itemId) - throws UnsupportedOperationException; - - public boolean addContainerProperty(Object propertyId, Class type, - Object defaultValue) throws UnsupportedOperationException; - - public boolean removeContainerProperty(Object propertyId) - throws UnsupportedOperationException; - - public boolean removeAllItems() throws UnsupportedOperationException; - - public interface Ordered extends PolicyContainer { - - public Object nextItemId(Object itemId); - - public Object prevItemId(Object itemId); - - public Object firstItemId(); - - public Object lastItemId(); - - public boolean isFirstId(Object itemId); - - public boolean isLastId(Object itemId); - - public Object addItemAfter(Object previousItemId) - throws UnsupportedOperationException; - - } - - - public interface Indexed extends Ordered { - - public int indexOfId(Object itemId); - - public Object getIdByIndex(int index); - - public List getItemIds(int startIndex, int numberOfItems); - - public Object addItemAt(int index) throws UnsupportedOperationException; - - public interface ItemAddEvent extends ItemSetChangeEvent { - - public Object getFirstItemId(); - - public int getFirstIndex(); - - public int getAddedItemsCount(); - } - - - public interface ItemRemoveEvent extends ItemSetChangeEvent { - - public Object getFirstItemId(); - - public int getFirstIndex(); - - public int getRemovedItemsCount(); - } - } - - public interface ItemSetChangeEvent extends Serializable { - - public PolicyContainer getContainer(); - } - - public interface ItemSetChangeListener extends Serializable { - - public void containerItemSetChange(PolicyContainer.ItemSetChangeEvent event); - } - - public interface ItemSetChangeNotifier extends Serializable { - - public void addItemSetChangeListener( - PolicyContainer.ItemSetChangeListener listener); - - public void removeItemSetChangeListener( - PolicyContainer.ItemSetChangeListener listener); - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/PolicyItemSetChangeNotifier.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/PolicyItemSetChangeNotifier.java deleted file mode 100644 index 934c30564..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/PolicyItemSetChangeNotifier.java +++ /dev/null @@ -1,95 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.utils; - - -import java.io.Serializable; -import java.util.Collection; -import java.util.EventObject; -import java.util.LinkedList; - -import org.openecomp.policy.utils.PolicyContainer.ItemSetChangeEvent; -import org.openecomp.policy.utils.PolicyContainer.ItemSetChangeListener; - - - -public class PolicyItemSetChangeNotifier implements PolicyContainer.ItemSetChangeNotifier { - private static final long serialVersionUID = 1L; - private Collection itemSetChangeListeners = null; - private PolicyContainer container = null; - - public PolicyItemSetChangeNotifier() { - } - - protected void setContainer(PolicyContainer c) { - this.container = c; - } - - @Override - public void addItemSetChangeListener(ItemSetChangeListener listener) { - if (getItemSetChangeListeners() == null) { - setItemSetChangeListeners(new LinkedList()); - } - getItemSetChangeListeners().add(listener); } - - @Override - public void removeItemSetChangeListener(ItemSetChangeListener listener) { - if (getItemSetChangeListeners() != null) { - getItemSetChangeListeners().remove(listener); - } - } - - protected static class BaseItemSetChangeEvent extends EventObject implements - PolicyContainer.ItemSetChangeEvent, Serializable { - private static final long serialVersionUID = 1L; - - protected BaseItemSetChangeEvent(PolicyContainer source) { - super(source); - } - - @Override - public PolicyContainer getContainer() { - return (PolicyContainer) getSource(); - } - } - - protected void setItemSetChangeListeners( - Collection itemSetChangeListeners) { - this.itemSetChangeListeners = itemSetChangeListeners; - } - protected Collection getItemSetChangeListeners() { - return itemSetChangeListeners; - } - - protected void fireItemSetChange() { - fireItemSetChange(new BaseItemSetChangeEvent(this.container)); - } - - protected void fireItemSetChange(ItemSetChangeEvent event) { - if (getItemSetChangeListeners() != null) { - final Object[] l = getItemSetChangeListeners().toArray(); - for (int i = 0; i < l.length; i++) { - ((PolicyContainer.ItemSetChangeListener) l[i]) - .containerItemSetChange(event); - } - } - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/XACMLPolicyWriterWithPapNotify.java b/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/XACMLPolicyWriterWithPapNotify.java deleted file mode 100644 index 20bfa1a50..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/policy/utils/XACMLPolicyWriterWithPapNotify.java +++ /dev/null @@ -1,494 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.policy.utils; - - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.ProtocolException; -import java.net.URL; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.nio.file.DirectoryNotEmptyException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Base64; -import java.util.UUID; - -import org.openecomp.policy.rest.XACMLRestProperties; - -import org.openecomp.policy.xacml.api.XACMLErrorConstants; -import org.openecomp.policy.xacml.util.XACMLPolicyWriter; -import com.att.research.xacml.util.XACMLProperties; - -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicySetType; -import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -/** - * Helper static class that wraps XACMLPolicyWriter - * - * - */ -public class XACMLPolicyWriterWithPapNotify{ - private static final Logger logger = FlexLogger.getLogger(XACMLPolicyWriterWithPapNotify.class); - - /** - * Helper static class that does the work to write a policy set to a file on disk and notify PAP - * - * - */ - public static Path writePolicyFile(Path filename, PolicySetType policySet) { - if(logger.isDebugEnabled()){ - logger.debug("\nXACMLPolicyWriterWithPapNotify.writePolicyFile(Path filename, PolicySetType policySet)" - + "\nfilename = " + filename - + "\npolicySet = " + policySet); - } - //write to file - Path path = XACMLPolicyWriter.writePolicyFile(filename, policySet); - - if(path!=null){ - //write to DB - if(notifyPapOfCreateUpdate(filename.toAbsolutePath().toString())){ - return path; - }else{ - //write to DB failed. So, delete the file - try{ - Files.deleteIfExists(path); - }catch(DirectoryNotEmptyException e){ - //We are trying to delete a directory and it is not empty - logger.error("\nXACMLPolicyWriterWithPapNotify.writePolicyFile(Path filename, PolicySetType policySet): Files.deleteIfExists(path)" - + "\nDirectoryNotEmptyException for path = " + path - + "\nException message = " + e); - }catch(IOException e) { - // File permission problems are caught here. - logger.error("\nXACMLPolicyWriterWithPapNotify.writePolicyFile(Path filename, PolicySetType policySet): Files.deleteIfExists(path)" - + "\nIOException for path = " + path - + "\nException message = " + e); - }catch(Exception e){ - logger.error("\nXACMLPolicyWriterWithPapNotify.writePolicyFile(Path filename, PolicySetType policySet): Files.deleteIfExists(path)" - + "\nException for path = " + path - + "\nException message = " + e); - } - return null; - } - - }else{ - return null; - } - } - - /** - * Helper static class that does the work to write a policy set to an output stream and notify PAP - * - * - */ - public static void writePolicyFile(OutputStream os, PolicySetType policySet) { - if(logger.isDebugEnabled()){ - logger.debug("\nXACMLPolicyWriterWithPapNotify.writePolicyFile(OutputStream os, PolicySetType policySet)" - + "\nos = " + os - + "\npolicySet = " + policySet); - } - //Only used for writing a byte array output stream for a message. No file is written - XACMLPolicyWriter.writePolicyFile(os, policySet); - } - - /** - * Helper static class that does the work to write a policy to a file on disk. - * - * - */ - public static Path writePolicyFile(Path filename, PolicyType policy) { - if(logger.isDebugEnabled()){ - logger.debug("\nXACMLPolicyWriterWithPapNotify.writePolicyFile(Path filename, PolicyType policy)" - + "\nfilename = " + filename - + "\npolicy = " + policy); - } - - //write to file - Path path = XACMLPolicyWriter.writePolicyFile(filename, policy); - - if(path!=null){ - //write to DB - if(notifyPapOfCreateUpdate(filename.toAbsolutePath().toString())){ - return path; - }else{ - //write to DB failed so delete the file - try{ - Files.deleteIfExists(path); - }catch(DirectoryNotEmptyException e){ - //We are trying to delete a directory and it is not empty - logger.error("\nXACMLPolicyWriterWithPapNotify.writePolicyFile(Path filename, PolicySetType policySet)Files.deleteIfExists(path) :" - + "\nDirectoryNotEmptyException for path = " + path - + "\nException message = " + e); - }catch(IOException e) { - // File permission problems are caught here. - logger.error("\nXACMLPolicyWriterWithPapNotify.writePolicyFile(Path filename, PolicySetType policySet): Files.deleteIfExists(path)" - + "\nIOException for path = " + path - + "\nException message = " + e); - }catch(Exception e){ - logger.error("\nXACMLPolicyWriterWithPapNotify.writePolicyFile(Path filename, PolicySetType policySet): Files.deleteIfExists(path)" - + "\nException for path = " + path - + "\nException message = " + e); - } - return null; - } - - }else{ - return null; - } - } - - - /** - * Helper static class that does the work to write a policy to a file on disk. - * - * - */ - public static InputStream getXmlAsInputStream(PolicyType policy) { - if(logger.isDebugEnabled()){ - logger.debug("\nXACMLPolicyWriterWithPapNotify.getXmlAsInputStream(PolicyType policy)" - + "\npolicy = " + policy); - } - return XACMLPolicyWriter.getXmlAsInputStream(policy); - } - /** - * Helper static class that does the work to write a policy set to an output stream. - * - * - */ - public static void writePolicyFile(OutputStream os, PolicyType policy) { - if(logger.isDebugEnabled()){ - logger.debug("\nXACMLPolicyWriterWithPapNotify.writePolicyFile(OutputStream os, PolicyType policy)" - + "\nos = " + os - + "\npolicy = " + policy); - } - //There are no references to this and if there were, it would most likely be used in an http message - XACMLPolicyWriter.writePolicyFile(os, policy); - } - - public static String changeFileNameInXmlWhenRenamePolicy(Path filename) { - if(logger.isDebugEnabled()){ - logger.debug("\nXACMLPolicyWriterWithPapNotify.changeFileNameInXmlWhenRenamePolicy(Path filename)" - + "\nfilename = " + filename); - } - return XACMLPolicyWriter.changeFileNameInXmlWhenRenamePolicy(filename); - } - - public static boolean notifyPapOfPolicyRename(String oldPolicyName, String newPolicyName){ - if(logger.isDebugEnabled()){ - logger.debug("\nXACMLPolicyWriterWithPapNotify.notifyPapOfCreateUpdate(String policyToCreateUpdate) " - + "\npolicyToCreateUpdate = " + " "); - } - Base64.Encoder encoder = Base64.getEncoder(); - String encoding = encoder.encodeToString((XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_USERID)+":"+XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_PASS)).getBytes(StandardCharsets.UTF_8)); - HttpURLConnection connection = null; - UUID requestID = UUID.randomUUID(); - //loggingContext.setRequestID(requestID.toString()); - //loggingContext.transactionStarted(); - URL url; - try { - url = new URL(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL)+"?oldPolicyName="+ URLEncoder.encode(oldPolicyName, "UTF-8")+"&newPolicyName="+URLEncoder.encode(newPolicyName,"UTF-8")); - if(logger.isDebugEnabled()){ - logger.debug("\nnotifyPapOfCreateUpdate: URL = " + url); - } - } catch (MalformedURLException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nMalformedURLException message = " + e); - - return false; - } catch (UnsupportedEncodingException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nUnsupportedEncodingException message = " + e); - - return false; - } - // - // Open up the connection - // - try { - connection = (HttpURLConnection)url.openConnection(); - } catch (IOException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nurl.openConnection() IOException message = " + e); - return false; - } - // - // Setup our method and headers - // - try { - connection.setRequestMethod("PUT"); - } catch (ProtocolException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nconnection.setRequestMethod(PUT) ProtocolException message = " + e); - connection.disconnect(); - return false; - } - connection.setRequestProperty("Authorization", "Basic " + encoding); - connection.setRequestProperty("Accept", "text/x-java-properties"); - connection.setRequestProperty("Content-Type", "text/x-java-properties"); - connection.setRequestProperty("requestID", requestID.toString()); - connection.setUseCaches(false); - // - // Adding this in. It seems the HttpUrlConnection class does NOT - // properly forward our headers for POST re-direction. It does so - // for a GET re-direction. - // - // So we need to handle this ourselves. - // - connection.setInstanceFollowRedirects(false); - connection.setDoOutput(true); - connection.setDoInput(true); - try { - connection.connect(); - } catch (IOException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nconnection.connect() IOException message = " + e); - connection.disconnect(); - return false; - } - try { - int responseCode = connection.getResponseCode(); - if(logger.isDebugEnabled()){ - logger.debug("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nconnection.getResponseCode() = " + responseCode); - } - if (responseCode == 200) { - connection.disconnect(); - return true; - } else { - connection.disconnect(); - return false; - //System.out.println(connection.getResponseMessage()); - //System.out.println(connection.getResponseCode()); - //System.out.println(connection.g); - } - } catch (IOException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nconnection.getResponseCode() IOException message = " + e); - connection.disconnect(); - return false; - } - } - - public static boolean notifyPapOfDelete(String policyToDelete){ - Base64.Encoder encoder = Base64.getEncoder(); - String encoding = encoder.encodeToString((XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_USERID)+":"+XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_PASS)).getBytes(StandardCharsets.UTF_8)); - HttpURLConnection connection = null; - UUID requestID = UUID.randomUUID(); - //loggingContext.setRequestID(requestID.toString()); - //loggingContext.transactionStarted(); - String papUrl = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL); - if(papUrl == null){ - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + - "PAP url property does not exist"); - return false; - } - String urlString = ""; - try{ - urlString = papUrl+"?groupId=0&isDeleteNotify=1&policyToDelete="+ URLEncoder.encode(policyToDelete, "UTF-8"); - } catch(UnsupportedEncodingException e){ - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + - "Invalid encoding: UTF-8", e); - return false; - } - URL url; - try { - url = new URL(urlString); - } catch (MalformedURLException e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + - "Error parsing PAP url: " - + urlString - , e); - return false; - } - // - // Open up the connection - // - try { - connection = (HttpURLConnection)url.openConnection(); - } catch (IOException e) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "Error opening HttpURLConnection to: " - + url.toString() - , e); - return false; - } - // - // Setup our method and headers - // - try { - connection.setRequestMethod("DELETE"); - } catch (ProtocolException e) { - logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + - "Invalid request method: DELETE", e); - connection.disconnect(); - return false; - } - connection.setRequestProperty("Authorization", "Basic " + encoding); - connection.setRequestProperty("Accept", "text/x-java-properties"); - connection.setRequestProperty("Content-Type", "text/x-java-properties"); - connection.setRequestProperty("requestID", requestID.toString()); - connection.setUseCaches(false); - // - // Adding this in. It seems the HttpUrlConnection class does NOT - // properly forward our headers for POST re-direction. It does so - // for a GET re-direction. - // - // So we need to handle this ourselves. - // - connection.setInstanceFollowRedirects(false); - connection.setDoOutput(true); - connection.setDoInput(true); - try { - connection.connect(); - } catch (IOException e) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "Error connecting HttpURLConnection to: " - + connection.getURL().toString() - , e); - connection.disconnect(); - return false; - } - try { - if (connection.getResponseCode() == 200) { - connection.disconnect(); - //worked - return true; - } else { - connection.disconnect(); - return false; - //System.out.println(connection.getResponseMessage()); - //System.out.println(connection.getResponseCode()); - //System.out.println(connection.g); - } - } catch (IOException e) { - logger.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR + - "Error getting HttpUrlConnection response code for: " - + connection.getURL().toString() - , e); - connection.disconnect(); - return false; - } - } - - public static boolean notifyPapOfCreateUpdate(String policyToCreateUpdate){ - if(logger.isDebugEnabled()){ - logger.debug("\nXACMLPolicyWriterWithPapNotify.notifyPapOfCreateUpdate(String policyToCreateUpdate) " - + "\npolicyToCreateUpdate = " + policyToCreateUpdate); - } - Base64.Encoder encoder = Base64.getEncoder(); - String encoding = encoder.encodeToString((XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_USERID)+":"+XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_PASS)).getBytes(StandardCharsets.UTF_8)); - HttpURLConnection connection = null; - UUID requestID = UUID.randomUUID(); - //loggingContext.setRequestID(requestID.toString()); - //loggingContext.transactionStarted(); - URL url; - try { - url = new URL(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL)+"?policyToCreateUpdate="+ URLEncoder.encode(policyToCreateUpdate, "UTF-8")); - if(logger.isDebugEnabled()){ - logger.debug("\nnotifyPapOfCreateUpdate: URL = " + url); - } - } catch (MalformedURLException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nMalformedURLException message = " + e); - - return false; - } catch (UnsupportedEncodingException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nUnsupportedEncodingException message = " + e); - - return false; - } - // - // Open up the connection - // - try { - connection = (HttpURLConnection)url.openConnection(); - } catch (IOException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nurl.openConnection() IOException message = " + e); - return false; - } - // - // Setup our method and headers - // - try { - connection.setRequestMethod("PUT"); - } catch (ProtocolException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nconnection.setRequestMethod(PUT) ProtocolException message = " + e); - connection.disconnect(); - return false; - } - connection.setRequestProperty("Authorization", "Basic " + encoding); - connection.setRequestProperty("Accept", "text/x-java-properties"); - connection.setRequestProperty("Content-Type", "text/x-java-properties"); - connection.setRequestProperty("requestID", requestID.toString()); - connection.setUseCaches(false); - // - // Adding this in. It seems the HttpUrlConnection class does NOT - // properly forward our headers for POST re-direction. It does so - // for a GET re-direction. - // - // So we need to handle this ourselves. - // - connection.setInstanceFollowRedirects(false); - connection.setDoOutput(true); - connection.setDoInput(true); - try { - connection.connect(); - } catch (IOException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nconnection.connect() IOException message = " + e); - connection.disconnect(); - return false; - } - try { - int responseCode = connection.getResponseCode(); - if(logger.isDebugEnabled()){ - logger.debug("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nconnection.getResponseCode() = " + responseCode); - } - if (responseCode == 200) { - connection.disconnect(); - return true; - } else { - connection.disconnect(); - return false; - //System.out.println(connection.getResponseMessage()); - //System.out.println(connection.getResponseCode()); - //System.out.println(connection.g); - } - } catch (IOException e) { - logger.error("\nnotifyPapOfCreateUpdate(String policyToCreateUpdate)" - + "\nconnection.getResponseCode() IOException message = " + e); - connection.disconnect(); - return false; - } - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java deleted file mode 100644 index ff9f0f1ab..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java +++ /dev/null @@ -1,188 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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.ArrayList; -import java.util.List; - -import org.openecomp.portalapp.scheduler.RegistryAdapter; -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.objectcache.AbstractCacheManager; -import org.openecomp.portalsdk.core.service.DataAccessService; -import org.openecomp.portalsdk.core.util.CacheManager; -import org.openecomp.portalsdk.core.util.SystemProperties; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Profile; -import org.springframework.context.annotation.PropertySource; -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; - -/** - * Configures Spring features in the ECOMP Portal SDK sample application. - * Subclasses the ECOMP Portal SDK core AppConfig class to reuse interceptors, - * view resolvers and other features defined there. - */ -@Configuration -@EnableWebMvc -@ComponentScan(basePackages = "org.openecomp") -@PropertySource(value = { "${container.classpath:}/WEB-INF/conf/app/test.properties" }, ignoreResourceNotFound = true) -@Profile("src") -@EnableAsync -@EnableScheduling -public class ExternalAppConfig extends AppConfig implements Configurable { - - private RegistryAdapter schedulerRegistryAdapter; - - @Configuration - @Import(SystemProperties.class) - static class InnerConfiguration { - } - - /** - * @see org.openecomp.portalsdk.core.conf.AppConfig#viewResolver() - */ - public ViewResolver viewResolver() { - return super.viewResolver(); - } - - /** - * @see org.openecomp.portalsdk.core.conf.AppConfig#addResourceHandlers(ResourceHandlerRegistry) - * - * @param registry - */ - public void addResourceHandlers(ResourceHandlerRegistry registry) { - super.addResourceHandlers(registry); - } - - /** - * @see org.openecomp.portalsdk.core.conf.AppConfig#dataAccessService() - */ - public DataAccessService dataAccessService() { - return super.dataAccessService(); - } - - /** - * Creates a new list with a single entry that is the external app - * definitions.xml path. - * - * @return List of String, size 1 - */ - public List addTileDefinitions() { - List definitions = new ArrayList(); - definitions.add("/WEB-INF/defs/definitions.xml"); - return definitions; - } - - /** - * Adds request interceptors to the specified registry by calling - * {@link AppConfig#addInterceptors(InterceptorRegistry)}, but excludes - * certain paths from the session timeout interceptor. - */ - @Override - public void addInterceptors(InterceptorRegistry registry) { - super.setExcludeUrlPathsForSessionTimeout("/login_external", "*/login_external.htm", "login", "/login.htm", - "/api*","/single_signon.htm","/single_signon"); - super.addInterceptors(registry); - } - - /** - * Creates and returns a new instance of a {@link CacheManager} class. - * - * @return New instance of {@link CacheManager} - */ - @Bean - public AbstractCacheManager cacheManager() { - return new CacheManager(); - } - - /** - * 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 SchedulerFactoryBean} and - * populates it with triggers. - * - * @return New instance of {@link SchedulerFactoryBean} - * @throws Exception - */ - // @Bean // ANNOTATION COMMENTED OUT - // APPLICATIONS REQUIRING QUARTZ SHOULD RESTORE ANNOTATION - public SchedulerFactoryBean schedulerFactoryBean() throws Exception { - SchedulerFactoryBean scheduler = new SchedulerFactoryBean(); - scheduler.setTriggers(schedulerRegistryAdapter.getTriggers()); - scheduler.setConfigLocation(appApplicationContext.getResource("WEB-INF/conf/quartz.properties")); - scheduler.setDataSource(dataSource()); - return scheduler; - } - - - /** - * Sets the scheduler registry adapter. - * - * @param schedulerRegistryAdapter - */ - @Autowired - public void setSchedulerRegistryAdapter(final RegistryAdapter schedulerRegistryAdapter) { - this.schedulerRegistryAdapter = schedulerRegistryAdapter; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java deleted file mode 100644 index dfdfcadec..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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-sdk-app/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java deleted file mode 100644 index 3e1d89d25..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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/Workflow.hbm.xml"), new ClassPathResource("../fusion/orm/RNoteBookIntegration.hbm.xml")}; - } - - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/AngularSinglePageController.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/AngularSinglePageController.java deleted file mode 100644 index e654a51c0..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/AngularSinglePageController.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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.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 for a single-page application sample. The view is restricted to - * authenticated users. The named view resolves to page singlePageSample.html, - * which uses Angular. - */ -@Controller -@RequestMapping("/") -public class AngularSinglePageController extends RestrictedBaseController { - - @RequestMapping(value = { "/singlePageSample" }, method = RequestMethod.GET) - public ModelAndView view(HttpServletRequest request) { - Map model = new HashMap(); - return new ModelAndView("single_page_sample", "model", model); - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/CallflowController.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/CallflowController.java deleted file mode 100644 index a3d1be5f0..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/CallflowController.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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 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 for a message sequence chart view. The view is restricted to - * authenticated users. The view name defaults to the request name with no - * suffix, "callflow", which resolves to page details.jsp. That page is an - * iframe around page details.html. - */ -@Controller -@RequestMapping("/") -public class CallflowController extends RestrictedBaseController { - - @RequestMapping(value = { "/callflow" }, method = RequestMethod.GET) - public ModelAndView plot() { - final String defaultViewName = null; - return new ModelAndView(defaultViewName); - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/ElasticSearchController.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/ElasticSearchController.java deleted file mode 100644 index 69ff63db6..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/ElasticSearchController.java +++ /dev/null @@ -1,128 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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 org.json.JSONObject; -import org.openecomp.portalapp.model.Result; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.ModelAndView; - -import io.searchbox.client.JestClient; -import io.searchbox.client.JestClientFactory; -import io.searchbox.client.config.HttpClientConfig; -import io.searchbox.core.Search; -import io.searchbox.core.SearchResult; -import io.searchbox.core.Suggest; -import io.searchbox.core.SuggestResult; -import io.searchbox.params.Parameters; - -/** - * Controller for views that demonstrate Elastic Search features. - */ -@RestController -public class ElasticSearchController extends RestrictedBaseController{ - - @RequestMapping(value = {"/es_search_demo" }, method = RequestMethod.GET) - public ModelAndView search() { - return new ModelAndView("es_search_demo"); - } - - @RequestMapping(value = {"/es_suggest_demo" }, method = RequestMethod.GET) - public ModelAndView suggest() { - return new ModelAndView("es_suggest_demo"); - } - - @RequestMapping(value="/es_suggest/{task}",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity doSuggest(@PathVariable("task") String task) throws IOException { - JSONObject obj = new JSONObject(task); - String searchTerm = obj.getString("data"); - String searchSize = obj.getString("size"); - String searchFuzzy = obj.getString("fuzzy"); - String resultName = obj.getString("resultname"); - - JestClientFactory factory = new JestClientFactory(); - factory.setHttpClientConfig(new HttpClientConfig - .Builder("http://todo_elastic_search_server") - .multiThreaded(true) - .build()); - JestClient client = factory.getObject(); - - - Suggest suggest = new Suggest.Builder("{\n" - +"\"" + resultName +"\" : {\n" - +"\"text\" : \""+ searchTerm +"\",\n" - +"\"completion\" : {\n" - +"\"field\" : \"suggest\",\n" - +"\"size\" : " + searchSize + ",\n" - +"\"fuzzy\" : \"" + searchFuzzy + "\"\n" - +"}\n" - +"}\n" - +"}").addIndex("customer").build(); - - SuggestResult result = client.execute(suggest); - System.err.println(result.getJsonObject().toString()); - return new ResponseEntity(new Result(result.getJsonObject().toString()),HttpStatus.OK); - } - - @RequestMapping(value="/es_search/{task}",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity doSearch(@PathVariable("task") String task) throws IOException { - JSONObject obj = new JSONObject(task); - String searchTerm = obj.getString("data"); - String searchSize = obj.getString("size"); - // String searchFuzzy = obj.getString("fuzzy"); - - JestClientFactory factory = new JestClientFactory(); - factory.setHttpClientConfig(new HttpClientConfig - .Builder("http://todo_elastic_search_server") - .multiThreaded(true) - .build()); - JestClient client = factory.getObject(); - - Search search = new Search.Builder("{\n" - +"\"query\" : {\n" - +"\"query_string\" : {\n" - +"\"query\" : \"name:"+ searchTerm +"\"\n" - +"}\n" - +"}\n" - +"}").addIndex("customer").setParameter(Parameters.SIZE,Integer.valueOf(searchSize)).build(); - - SearchResult result = client.execute(search); - System.err.println(result.getJsonObject().toString()); - return new ResponseEntity(new Result(result.getJsonObject().toString()),HttpStatus.OK); - } - - public ResponseEntity sendResult(Result result) { - return new ResponseEntity(result, HttpStatus.OK); - } - - @Override - public boolean isRESTfulCall() { - return true; - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/LeafletMapContoller.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/LeafletMapContoller.java deleted file mode 100644 index 4c603fe19..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/LeafletMapContoller.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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 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 for geographic map view. The view is restricted to authenticated - * users. The view name defaults to the request name with no suffix, - * "leafletMap", which resolves to page leafletMap.jsp. - */ -@Controller -@RequestMapping("/") -public class LeafletMapContoller extends RestrictedBaseController { - - @RequestMapping(value = { "/leafletMap" }, method = RequestMethod.GET) - public ModelAndView plot() { - final String defaultViewName = null; - return new ModelAndView(defaultViewName); - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/PostDroolsController.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/PostDroolsController.java deleted file mode 100644 index 2729e8731..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/PostDroolsController.java +++ /dev/null @@ -1,138 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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.io.PrintWriter; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.json.JSONObject; -import org.openecomp.portalsdk.core.command.PostDroolsBean; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.service.PostDroolsService; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.servlet.ModelAndView; - -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Controller -@RequestMapping("/") -public class PostDroolsController extends RestrictedBaseController{ - - @Autowired - private PostDroolsService postDroolsService; - - @RequestMapping(value = {"/drools" }, method = RequestMethod.GET) - public ModelAndView drools(HttpServletRequest request) { - - return new ModelAndView(getViewName()); - } - - - @RequestMapping(value = {"/getDrools" }, method = RequestMethod.GET) - public void getDrools(HttpServletRequest request, HttpServletResponse response) { - // Map model = new HashMap(); - - ObjectMapper mapper = new ObjectMapper(); - try { - List beanList = postDroolsService.fetchDroolBeans(); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(beanList)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - - } catch (JsonGenerationException e) { - e.printStackTrace(); - } catch (JsonMappingException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @RequestMapping(value = {"/getDroolDetails" }, method = RequestMethod.GET) - public void getDroolDetails(HttpServletRequest request, HttpServletResponse response) { - - ObjectMapper mapper = new ObjectMapper(); - try { - - PostDroolsBean postDroolsBean = new PostDroolsBean(); - String selectedFile = request.getParameter("selectedFile"); - postDroolsBean.setDroolsFile(selectedFile);//sample populated - //postDroolsBean.setSelectedRules("[\"NJ\",\"NY\",\"KY\"]"); - postDroolsBean.setClassName(postDroolsService.retrieveClass(selectedFile)); - - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(postDroolsBean)); - JSONObject j = new JSONObject(msg); - response.getWriter().write(j.toString()); - - } catch (JsonGenerationException e) { - e.printStackTrace(); - } catch (JsonMappingException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @RequestMapping(value = {"/post_drools/execute" }, method = RequestMethod.POST) - public ModelAndView search(HttpServletRequest request, - HttpServletResponse response) throws Exception { - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - JsonNode root = mapper.readTree(request.getReader()); - PostDroolsBean postDroolsBean = mapper.readValue(root.get("postDroolsBean").toString(), PostDroolsBean.class); - - String resultsString = postDroolsService.execute(postDroolsBean.getDroolsFile(), postDroolsBean.getClassName(), postDroolsBean.getSelectedRules()); - - response.setCharacterEncoding("UTF-8"); - response.setContentType("application / json"); - request.setCharacterEncoding("UTF-8"); - - PrintWriter out = response.getWriter(); - //String responseString = mapper.writeValueAsString(resultsString); - JSONObject j = new JSONObject("{resultsString: "+resultsString+"}"); - - out.write(j.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return null; - } - - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/UserProfileController.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/UserProfileController.java deleted file mode 100644 index 2f4ea93de..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/UserProfileController.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.domain.Profile; -import org.openecomp.portalsdk.core.service.ProfileService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.servlet.ModelAndView; - -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -/** - * Controller for user profile view. The view is restricted to authenticated - * users. The view name resolves to page user_profile.jsp which uses Angular. - */ - -@Controller -@RequestMapping("/") -public class UserProfileController extends RestrictedBaseController { - - @Autowired - ProfileService service; - - @RequestMapping(value = { "/user_profile" }, method = RequestMethod.GET) - public ModelAndView ProfileSearch(HttpServletRequest request) { - Map model = new HashMap(); - ObjectMapper mapper = new ObjectMapper(); - List profileList = service.findAll(); - try { - model.put("customerInfo", mapper.writeValueAsString(profileList)); - } catch (JsonGenerationException e) { - e.printStackTrace(); - } catch (JsonMappingException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - - return new ModelAndView("user_profile", "model", model); - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/WelcomeController.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/WelcomeController.java deleted file mode 100644 index 06853f0e3..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/controller/WelcomeController.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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 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 for welcome view. The view is restricted to authenticated users. - * The view name defaults to the request name with no suffix, "welcome", which - * resolves to page welcome.jsp. - */ -@Controller -@RequestMapping("/") -public class WelcomeController extends RestrictedBaseController { - @RequestMapping(value = { "/welcome" }, method = RequestMethod.GET) - public ModelAndView welcome(HttpServletRequest request) { - final String defaultViewName = null; - return new ModelAndView(defaultViewName); - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/model/Result.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/model/Result.java deleted file mode 100644 index 5e09cb2cc..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/model/Result.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java deleted file mode 100644 index b308efbb2..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java +++ /dev/null @@ -1,47 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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.portalapp.conf.ExternalAppConfig; -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(ExternalAppConfig.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-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java deleted file mode 100644 index dce9e26bf..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/Register.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/Register.java deleted file mode 100644 index 3a29520ec..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/Register.java +++ /dev/null @@ -1,82 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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.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", "systemProperties"}) -public class Register implements Registerable { - - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(Register.class); - - - private List scheduleTriggers = new ArrayList(); - Trigger trigger[] = new Trigger[1]; - - - @Autowired - private LogRegistry logRegistry; - - - - @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.info(EELFLoggerDelegate.debugLogger, ("Log Cron not available")); - } - - - } - - - public List getScheduleTriggers() { - return scheduleTriggers; - } - - public void setScheduleTriggers(List scheduleTriggers) { - this.scheduleTriggers = scheduleTriggers; - } - - - - - - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java deleted file mode 100644 index 1bc43fee6..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java +++ /dev/null @@ -1,108 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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[1]; - - 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-sdk-app/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java deleted file mode 100644 index 1b9e020c5..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java +++ /dev/null @@ -1,84 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.portalapp.service; - - -import org.openecomp.policy.dao.RolesDao; -import org.openecomp.policy.model.Roles; -import org.openecomp.policy.rest.dao.UserInfoDao; -import org.openecomp.policy.rest.jpa.UserInfo; -import org.openecomp.portalsdk.core.domain.Role; -import org.openecomp.portalsdk.core.domain.User; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import org.openecomp.policy.common.logging.flexlogger.FlexLogger; -import org.openecomp.policy.common.logging.flexlogger.Logger; - -@Service("adminAuthExtension") -@Transactional -public class AdminAuthExtension { - - @Autowired - RolesDao rolesDAO; - - @Autowired - UserInfoDao userInfoDao; - - private static Logger logger = FlexLogger.getLogger(AdminAuthExtension.class); - public void saveUserExtension(User user){ - System.out.println("User Object Recieved"); - try{ - Roles roles = new Roles(); - roles.setName(user.getFullName()); - roles.setLoginId(user.getLoginId()); - if(user.getRoles() != null){ - rolesDAO.delete(roles); - for(Role role : user.getRoles()){ - if(role.getName().trim().equalsIgnoreCase("Policy Super Admin") || role.getName().trim().equalsIgnoreCase("System Administrator") || role.getName().trim().equalsIgnoreCase("Standard User") ){ - roles.setRole("super-admin"); - }else if(role.getName().trim().equalsIgnoreCase("Policy Super Editor")){ - roles.setRole("super-editor"); - }else if(role.getName().trim().equalsIgnoreCase("Policy Super Guest")){ - roles.setRole("super-guest"); - }else if(role.getName().trim().equalsIgnoreCase("Policy Admin")){ - roles.setRole("admin"); - }else if(role.getName().trim().equalsIgnoreCase("Policy Editor")){ - roles.setRole("editor"); - }else if(role.getName().trim().equalsIgnoreCase("Policy Guest")){ - roles.setRole("guest"); - } - rolesDAO.save(roles); - } - } - - UserInfo userInfo = new UserInfo(); - userInfo.setUserLoginId(user.getLoginId()); - userInfo.setUserName(user.getFullName()); - userInfoDao.save(userInfo); - } - catch(Exception e){ - logger.error("Exception caused while Setting role to Policy DB"+e); - } - } - -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/service/OnBoardingApiServiceImplPolicy.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/service/OnBoardingApiServiceImplPolicy.java deleted file mode 100644 index 083c57683..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/service/OnBoardingApiServiceImplPolicy.java +++ /dev/null @@ -1,348 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - - -package org.openecomp.portalapp.service; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -import javax.servlet.http.HttpServletRequest; - -import org.openecomp.portalsdk.core.domain.Role; -import org.openecomp.portalsdk.core.domain.User; -import org.openecomp.portalsdk.core.domain.UserApp; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.client.AppContextManager; -import org.openecomp.portalsdk.core.onboarding.crossapi.IPortalRestAPIService; -import org.openecomp.portalsdk.core.onboarding.crossapi.PortalAPIException; -import org.openecomp.portalsdk.core.onboarding.crossapi.PortalTimeoutHandler; -import org.openecomp.portalsdk.core.restful.domain.EcompRole; -import org.openecomp.portalsdk.core.restful.domain.EcompUser; -import org.openecomp.portalsdk.core.service.RoleService; -import org.openecomp.portalsdk.core.service.UserProfileService; -import org.openecomp.portalsdk.core.service.WebServiceCallService; -import org.openecomp.portalsdk.core.util.JSONUtil; -import org.openecomp.portalsdk.core.util.SystemProperties; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.slf4j.MDC; - - -public class OnBoardingApiServiceImplPolicy implements IPortalRestAPIService { - RoleService roleService; - UserProfileService userProfileService; - AdminAuthExtension adminAuthExtension; - - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(OnBoardingApiServiceImplPolicy.class); - - public OnBoardingApiServiceImplPolicy(){ - roleService = AppContextManager.getAppContext().getBean(RoleService.class); - userProfileService = AppContextManager.getAppContext().getBean(UserProfileService.class); - adminAuthExtension = AppContextManager.getAppContext().getBean(AdminAuthExtension.class); - } - - private void setCurrentAttributes(User user, EcompUser userJson){ - user.setEmail(userJson.getEmail()); - user.setFirstName(userJson.getFirstName()); - user.setHrid(userJson.getHrid()); - user.setJobTitle(userJson.getJobTitle()); - user.setLastName(userJson.getLastName()); - user.setLoginId(userJson.getLoginId()); - user.setOrgManagerUserId(userJson.getOrgManagerUserId()); - user.setMiddleInitial(userJson.getMiddleInitial()); - user.setOrgCode(userJson.getOrgCode()); - user.setOrgId(userJson.getOrgId()); - user.setPhone(userJson.getPhone()); - user.setOrgUserId(userJson.getOrgUserId()); - user.setActive(userJson.isActive()); - } - - - @Override - public void pushUser(EcompUser userJson) throws PortalAPIException { - - logger.debug(EELFLoggerDelegate.debugLogger, "pushUser was invoked" + userJson); - - User user = new User(); - String response = ""; - - logger.debug(EELFLoggerDelegate.debugLogger, "## REST API ## userJson: " + userJson); - - try { - - //Set input attributes to the object about to be saved - setCurrentAttributes(user, userJson); - - user.setRoles(new TreeSet()); - user.setUserApps(new TreeSet()); - user.setPseudoRoles(new TreeSet()); - - userProfileService.saveUser(user); - adminAuthExtension.saveUserExtension(user); - logger.debug(EELFLoggerDelegate.debugLogger, "push user success."); - response = "push user success."; - response = JSONUtil.convertResponseToJSON(response); - } catch (Exception e) { - e.printStackTrace(); - response = "push user failed with error: " + e.getMessage(); - logger.error(EELFLoggerDelegate.debugLogger, response); - logger.error(EELFLoggerDelegate.errorLogger, "Error happened during OnboardingApiService.pushUser operation: " + response); - logger.error(EELFLoggerDelegate.debugLogger, "Error happened during OnboardingApiService.pushUser operation: " + response); - logger.info(EELFLoggerDelegate.metricsLogger, "OnboardingApiService.pushUser operation has failed."); - throw new PortalAPIException(response, e); - }finally { - MDC.remove(SystemProperties.MDC_TIMER); - } - } - - @Override - public void editUser(String loginId, EcompUser userJson) throws PortalAPIException { - - logger.debug(EELFLoggerDelegate.debugLogger, "OnboardingApi editUser was invoked" + userJson); - - User editUser = new User(); - String response = ""; - logger.debug(EELFLoggerDelegate.debugLogger, "## REST API ## loginId: " + loginId); - logger.debug(EELFLoggerDelegate.debugLogger, "## REST API ## userJson: " + userJson); - - try { - - setCurrentAttributes(editUser, userJson); - - if (editUser.getOrgUserId() != null) { - editUser.setLoginId(editUser.getOrgUserId()); - } - - User domainUser = userProfileService.getUserByLoginId(loginId); - if (domainUser != null) - domainUser = JSONUtil.mapToDomainUser(domainUser, editUser); - else - domainUser = editUser; - userProfileService.saveUser(domainUser); - adminAuthExtension.saveUserExtension(domainUser); - - logger.debug(EELFLoggerDelegate.debugLogger, "edit user success."); - response = "edit user success."; - response = JSONUtil.convertResponseToJSON(response); - } catch (Exception e) { - e.printStackTrace(); - response = "edit user failed with error: " + e.getMessage(); - logger.error(EELFLoggerDelegate.errorLogger, response); - logger.error(EELFLoggerDelegate.debugLogger, "Error happened during OnboardingApiService.editUser operation: " + response); - logger.error(EELFLoggerDelegate.errorLogger, "Error happened during OnboardingApiService.editUser operation: " + response); - throw new PortalAPIException(response, e); - }finally { - MDC.remove(SystemProperties.MDC_TIMER); - } - - //return response; - } - - @Override - public EcompUser getUser(String loginId) throws PortalAPIException { - try{ - logger.debug(EELFLoggerDelegate.debugLogger, "## REST API ## loginId: " + loginId); - - User user = userProfileService.getUserByLoginId(loginId); - - if(user == null){ - logger.info(EELFLoggerDelegate.debugLogger, "User + " + loginId + " doesn't exist"); - return null; - } - else - return UserUtils.convertToEcompUser(user); - } - catch(Exception e){ - logger.error(EELFLoggerDelegate.errorLogger, e.getMessage()); - return null; - } - - } - - @Override - public List getUsers() throws PortalAPIException { - - - String response = ""; - - try { - - List users = userProfileService.findAllActive(); - List ecompUsers = new ArrayList(); - for(User user : users) - ecompUsers.add(UserUtils.convertToEcompUser(user)); - - return ecompUsers; - - } - catch (Exception pe){ - - response = "getUsers failed with error: " + pe.getMessage(); - pe.printStackTrace(); - logger.error(EELFLoggerDelegate.debugLogger, response); - logger.error(EELFLoggerDelegate.errorLogger, response); - throw new PortalAPIException(response, pe); - } - - - } - - @Override - public List getAvailableRoles() throws PortalAPIException{ - - String response = ""; - - try{ - List roles = roleService.getActiveRoles(); - List ecompRoles = new ArrayList(); - - for(Role role : roles) - ecompRoles.add(UserUtils.convertToEcompRole(role)); - - return ecompRoles; - - } - catch (Exception pe){ - response = "getUsers failed with error: " + pe.getMessage(); - pe.printStackTrace(); - logger.error(EELFLoggerDelegate.debugLogger, response); - logger.error(EELFLoggerDelegate.errorLogger, response); - throw new PortalAPIException(response, pe); - } - } - - @Override - public void pushUserRole(String loginId, List rolesJson) throws PortalAPIException { - - - String response = ""; - try { - logger.debug(EELFLoggerDelegate.debugLogger, "## REST API ## loginId: " + loginId); - logger.debug(EELFLoggerDelegate.debugLogger, "## REST API ## rolesJson: " + rolesJson); - User user = userProfileService.getUserByLoginId(loginId); - - SortedSet roles = new TreeSet(); - for (EcompRole role : rolesJson) { - roles.add(roleService.getRole(role.getId())); - } - // Replace existing roles with new ones - replaceExistingRoles(roles, user); - - logger.debug(EELFLoggerDelegate.debugLogger, "push user role success."); - response = "push user role success."; - response = JSONUtil.convertResponseToJSON(response); - - } catch (Exception e) { - response = "pushUserRole failed with error: " + e.getMessage(); - e.printStackTrace(); - logger.error(EELFLoggerDelegate.debugLogger, response); - logger.error(EELFLoggerDelegate.errorLogger, response); - throw new PortalAPIException(response, e); - }finally { - MDC.remove(SystemProperties.MDC_TIMER); - } - - } - - @Override - public List getUserRoles(String loginId) throws PortalAPIException { - - logger.debug(EELFLoggerDelegate.debugLogger, "## REST API ## loginId: " + loginId); - - List ecompRoles = new ArrayList(); - try { - - - User user = userProfileService.getUserByLoginId(loginId); - - SortedSet currentRoles = null; - if(user != null){ - - currentRoles = user.getRoles(); - - if(currentRoles != null) - for(Role role : currentRoles) - ecompRoles.add(UserUtils.convertToEcompRole(role)); - } - return ecompRoles; - } - catch (Exception e){ - String response = "getUserRoles failed with error: " + e.getMessage(); - e.printStackTrace(); - logger.error(EELFLoggerDelegate.debugLogger, response); - logger.debug(EELFLoggerDelegate.errorLogger, response); - throw new PortalAPIException(response, e); - } - } - - private void replaceExistingRoles(SortedSet roles, User user) { - // 1. remove existing roles - Set userApps = user.getUserApps(); - Iterator appsItr = (Iterator) userApps.iterator(); - while (appsItr.hasNext()) { - UserApp tempUserApp = (UserApp)appsItr.next(); - boolean roleFound = false; - for (Role role : roles) { - if (tempUserApp.getRole().getId().equals(role.getId())) { - roleFound = true; - break; - } - } - if (!roleFound) - appsItr.remove(); - } - user.setUserApps(userApps); - userProfileService.saveUser(user); - - // 2. add new roles - user.setRoles(roles); - userProfileService.saveUser(user); - adminAuthExtension.saveUserExtension(user); - } - - - @Override - public boolean isAppAuthenticated(HttpServletRequest request) throws PortalAPIException { - WebServiceCallService securityService = AppContextManager.getAppContext().getBean(WebServiceCallService.class); - try { - String appUser = request.getHeader("username"); - String password = request.getHeader("password"); - boolean flag = securityService.verifyRESTCredential(null, appUser, password); - return flag; - - } catch (Exception e) { - logger.error(EELFLoggerDelegate.errorLogger, "Failed to authenticate" + e.getMessage()); - throw new PortalAPIException("Failed to authenticate: " + e.getMessage()); - } - - } - - public String getSessionTimeOuts() throws Exception{ - return PortalTimeoutHandler.gatherSessionExtensions(); - } - - public void updateSessionTimeOuts(String sessionMap) throws Exception{ - PortalTimeoutHandler.updateSessionExtensions(sessionMap); - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java deleted file mode 100644 index c052187af..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java +++ /dev/null @@ -1,73 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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.portalsdk.core.logging.format.AlarmSeverityEnum; -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; - -// -// 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 -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.debugLogger, ("Returned from initiating mainUebHandler...")); - } - else { - logger.info(EELFLoggerDelegate.debugLogger, ("Not starting UEB listening thread because ueb_listeners_enable is not set to true in the properties file.")); - } - } - catch (Exception e) { - logger.error(EELFLoggerDelegate.debugLogger, ("Not starting UEB listening thread because property could not be read " + PortalApiConstants.UEB_LISTENERS_ENABLE),AlarmSeverityEnum.MAJOR); - } - - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java deleted file mode 100644 index 7ff07dd4e..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java +++ /dev/null @@ -1,104 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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 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.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -//------------------------------------------------------------------------- -// 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 { - - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MainUebHandler.class); - - - ConcurrentLinkedQueue inboxQueue = null; - - @Autowired - WidgetNotificationHandler widgetNotificationHandler; - - @Async - public void runHandler(ConcurrentLinkedQueue queue) { - inboxQueue = queue; - - logger.info(EELFLoggerDelegate.debugLogger, ("==> MainUebHandler started")); - - while (true) { - UebMsg msg = null; - while ((msg = inboxQueue.poll()) != null) { - if (msg.getMsgType() != null) { - logger.debug(EELFLoggerDelegate.debugLogger, ("<== Received UEB message : " + msg.toString())); - - switch (msg.getMsgType()) { - /* - * Add your own defined handler objects, use @Component for - * the class. See WidgetNotificationHandler as an example. - * - * Use @Async on methods for performance - * - * For syncronous replies use UebManager publishReply and - * echo back the msgId in your response ie - * msg.putMsgId(requestMsg.getMsgId()) - * - * case UebMsgTypes.UEB_MSG_TYPE_XYZ: { - * XYZHandler.handleMsg(msg); break; } - */ - case UebMsgTypes.UEB_MSG_TYPE_WIDGET_NOTIFICATION: { - widgetNotificationHandler.handleWidgetNotification(msg); - break; - } - default: { - - logger.info(EELFLoggerDelegate.debugLogger, ("Unknown message type [" + msg.getMsgType() + "] from " + msg.getSourceTopicName())); - - break; - } - } - } - } - - if (Thread.interrupted()) { - - logger.info(EELFLoggerDelegate.debugLogger, ("==> UebMainHandler exiting")); - - break; - } - - try { - Thread.sleep(10); - } catch (InterruptedException e) { - logger.info(EELFLoggerDelegate.debugLogger, ("UebMainHandler interrupted during sleep" + e.getMessage())); - - } - } - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java deleted file mode 100644 index dd2213dae..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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 org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -@Component -public class WidgetNotificationHandler { - - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetNotificationHandler.class); - - - public WidgetNotificationHandler() { - } - - @Async - public void handleWidgetNotification(UebMsg requestMsg) { - logger.debug(EELFLoggerDelegate.debugLogger, ("handleWidgetNotification received notification: " + requestMsg.toString())); - /* - * Here the notification msg can be handled - * - * requestMsg.getPayload() - returns string that contains the - * Application defined content - */ - } -} diff --git a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/util/CustomLoggingFilter.java b/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/util/CustomLoggingFilter.java deleted file mode 100644 index 48c51195f..000000000 --- a/ecomp-sdk-app/src/main/java/org/openecomp/portalapp/util/CustomLoggingFilter.java +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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 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. - */ - @Override - public FilterReply decide(ILoggingEvent event) { - try { - if ((event.getLevel() != Level.ERROR || event.getLevel() != Level.WARN) && - (event.getThreadName().equalsIgnoreCase("UEBConsumerThread")) && - (event.getLoggerName().contains("org.openecomp.nsa") || event.getLoggerName().contains("org.apache.http")) - ) { - return FilterReply.DENY; - } else { - return FilterReply.NEUTRAL; - } - } catch(Exception e) { - return FilterReply.NEUTRAL; - } - } -} diff --git a/ecomp-sdk-app/src/main/resources/att-rules.drl b/ecomp-sdk-app/src/main/resources/att-rules.drl deleted file mode 100644 index e15c3fb18..000000000 --- a/ecomp-sdk-app/src/main/resources/att-rules.drl +++ /dev/null @@ -1,16 +0,0 @@ -package org.openecomp.portalsdk.core.drools; - - -rule "Drools NJ" -when -$droolsRuleService : DroolsRuleServiceImpl( state == "NJ" ) -then -$droolsRuleService.setResultsString("NJ state :" + " Garden State"); -end - -rule "Drools NY" -when -$droolsRuleService : DroolsRuleServiceImpl( state == "NY" ) -then -$droolsRuleService.setResultsString("NY state :" + " Empire State"); -end diff --git a/ecomp-sdk-app/src/main/resources/cache.ccf b/ecomp-sdk-app/src/main/resources/cache.ccf deleted file mode 100644 index d21404b09..000000000 --- a/ecomp-sdk-app/src/main/resources/cache.ccf +++ /dev/null @@ -1,30 +0,0 @@ -# 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=/tmp - - -# 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-sdk-app/src/main/resources/logback.xml b/ecomp-sdk-app/src/main/resources/logback.xml deleted file mode 100644 index 4f773ee2b..000000000 --- a/ecomp-sdk-app/src/main/resources/logback.xml +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${defaultLoggerPattern} - - - - - - - - - - - - ${logDirectory}/${generalLogName}.log - - - ${logDirectory}/${generalLogName}.%d{yyyy-MM-dd}.log.zip - - - 30 - 3GB - - - - ${applicationLoggerPattern} - - - - - - 256 - - true - - - - - - - - - - - - - - - - - - - ${logDirectory}/${auditLogName}.log - - - ${logDirectory}/${auditLogName}.%d{yyyy-MM-dd}.log.zip - - - 30 - 3GB - - - - ${auditLoggerPattern} - - - - 256 - - - - - ${logDirectory}/${metricsLogName}.log - - - ${logDirectory}/${metricsLogName}.%d{yyyy-MM-dd}.log.zip - - - 30 - 3GB - - - - ${metricsLoggerPattern} - - - - - - 256 - - - - - ${logDirectory}/${errorLogName}.log - - - ${logDirectory}/${errorLogName}.%d{yyyy-MM-dd}.log.zip - - - 30 - 3GB - - - - ${errorLoggerPattern} - - - - - 256 - - - - - ${debugLogDirectory}/${debugLogName}.log - - - ${logDirectory}/${debugLogName}.%d{yyyy-MM-dd}.log.zip - - - 30 - 3GB - - - - ${defaultLoggerPattern} - - - - - 256 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ecomp-sdk-app/src/main/resources/mchange-log.properties b/ecomp-sdk-app/src/main/resources/mchange-log.properties deleted file mode 100644 index 77e260bbc..000000000 --- a/ecomp-sdk-app/src/main/resources/mchange-log.properties +++ /dev/null @@ -1,23 +0,0 @@ -### -# ================================================================================ -# eCOMP Portal SDK -# ================================================================================ -# Copyright (C) 2017 AT&T 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. -# ================================================================================ -### -# Direct the proprietary logger used by com.mchange.c3p0 to use slf4j - -com.mchange.v2.log.MLog=com.mchange.v2.log.FallbackMLog -com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL=OFF diff --git a/ecomp-sdk-app/src/main/resources/portal.properties b/ecomp-sdk-app/src/main/resources/portal.properties deleted file mode 100644 index f20bc2c2e..000000000 --- a/ecomp-sdk-app/src/main/resources/portal.properties +++ /dev/null @@ -1,69 +0,0 @@ -### -# ================================================================================ -# eCOMP Portal SDK -# ================================================================================ -# Copyright (C) 2017 AT&T 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. -# ================================================================================ -### -# Properties read by ECOMP Framework library, ecompFW.jar - -########################################################################## -# The following properties should NOT be changed by partner applications. -########################################################################## - -portal.api.prefix = /api -max.idle.time = 5 -user.attribute.name = user_attribute - -testing=testing - -#Use REST API instead of UEB to fetch the functional menu data -use_rest_for_functional_menu=true - -########################################################################## -# The following properties MUST be changed by partner applications. -########################################################################## - -# Name of java class that implements the OnBoardingApiService interface. -portal.api.impl.class = org.openecomp.portalapp.service.OnBoardingApiServiceImplPolicy - -# CSP Global Log On for single sign on -ecomp_redirect_url = http://todo_enter_portal_hostname:8080/ecompportal/login.htm - -# URL of the ECOMP Portal REST API - -ecomp_rest_url = TODO_Portal_URL - -# Applications do not need to run a UEB listener in 1610. -ueb_listeners_enable = false - -# UEB Configuration -# In release 1607, all 6 entries below were required. -# In release 1610, if key ueb_listeners_enable is set to false, -# then only the ueb_app_key is required. -# UEB servers -ueb_url_list = todo_ueb_url_list -# ECOMP Portal listens on this UEB topic -ecomp_portal_inbox_name = ECOMP-PORTAL-INBOX-TEST-DEMETER -# Replace these 3 default values with the ones for your specific App, -# as shown on the on-boarding page on the ECOMP Portal web application. -ueb_app_key = ZOicEniw7BWDL1pM -ueb_app_secret = PJIsBErHfo2RGKzuu03CZKgV -ueb_app_mailbox_name = ECOMP-PORTAL-OUTBOX-TEST-32756 -# Consumer group name for UEB topic. -# Use the special tag '{UUID}' to generate a unique one for each sdk-app server. -ueb_app_consumer_group_name = {UUID} - -decryption_key = AGLDdG4D04BKm2IxIWEr8o== diff --git a/ecomp-sdk-app/src/main/resources/state-rules.drl b/ecomp-sdk-app/src/main/resources/state-rules.drl deleted file mode 100644 index 586ae6b77..000000000 --- a/ecomp-sdk-app/src/main/resources/state-rules.drl +++ /dev/null @@ -1,38 +0,0 @@ -package org.openecomp.portalsdk.core.drools; -global String age - -rule "Default" -when -$droolsRuleService : DroolsRuleServiceImpl( state != null ) -then -System.out.println($droolsRuleService.accessLabel() +" "+ $droolsRuleService.getState() +" state legal age is " + getDefaultIfNull(age)); -$droolsRuleService.setResultsString($droolsRuleService.getState()+" state legal age is " + getDefaultIfNull(age)); -end - -rule "Drools NJ" -when -$droolsRuleService : DroolsRuleServiceImpl( state == "NJ" ) -then -System.out.println($droolsRuleService.accessLabel() +" "+ "NJ state legal age is " + getDefaultIfNull(age)); -$droolsRuleService.setResultsString("NJ state legal age is " + getDefaultIfNull(age)); -end - -rule "Drools KY" -when -$droolsRuleService : DroolsRuleServiceImpl( state == "KY" ) -then -System.out.println($droolsRuleService.accessLabel() +" "+ "KY state legal age is " + getDefaultIfNull("20")); -$droolsRuleService.setResultsString("KY state legal age is " + getDefaultIfNull("20")); -end - -rule "Drools NY" -when -$droolsRuleService : DroolsRuleServiceImpl( state == "NY" ) -then -System.out.println($droolsRuleService.accessLabel() +" "+ "NY state legal age is " + getDefaultIfNull("21")); -$droolsRuleService.setResultsString("NY state legal age is " + getDefaultIfNull("21")); -end - -function String getDefaultIfNull(String age) { -return age == null ? "18" : age; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/quartz.properties b/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/quartz.properties deleted file mode 100644 index 23340ddc1..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/quartz.properties +++ /dev/null @@ -1,30 +0,0 @@ -################################################################################# -# 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 -#============================================================================ - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor.properties b/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor.properties deleted file mode 100644 index 68b1f707e..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor.properties +++ /dev/null @@ -1,187 +0,0 @@ -### -# ================================================================================ -# eCOMP Portal SDK -# ================================================================================ -# Copyright (C) 2017 AT&T 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=yes -##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=no -##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=isEmbedded -print_footer_in_download=yes -## footer mentioned here appears in downloaded excel -footer_first_line=TODO footer first line -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 -#db_type=oracle -db_type=mysql diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_app_fusion.properties b/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_app_fusion.properties deleted file mode 100644 index ce9d57c37..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_app_fusion.properties +++ /dev/null @@ -1,39 +0,0 @@ -### -# ================================================================================ -# eCOMP Portal SDK -# ================================================================================ -# Copyright (C) 2017 AT&T 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=/demeter/WebApps/dev/ECOMP_PORTAL/temp/ -upload_folder_path=/demeter/WebApps/dev/ECOMP_PORTAL/files/ -excel_template_path=/demeter/WebApps/dev/ECOMP_PORTAL/files/raptor_template/ -temp_folder_url=temp/ -upload_folder_url=upload/ -smtp_server=todo.smtp.com -default_email_sender=email-name@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=report.htm#/report_run/ -drill_action_url=report.htm#/report_run/c_master= -base_action_url=report_wizard.htm?action= -base_action_url_ng=report#/ -base_action_param=c_master= -super_role_id=1 -admin_role_ids=1 -quick_links_menu_ids=HOME,CUSTOMER,REPORTS diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_db_fusion.properties b/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_db_fusion.properties deleted file mode 100644 index 8b9870686..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_db_fusion.properties +++ /dev/null @@ -1,19 +0,0 @@ -### -# ================================================================================ -# eCOMP Portal SDK -# ================================================================================ -# Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/conf/raptor_pdf.properties b/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_pdf.properties deleted file mode 100644 index d98a47cd6..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/raptor_pdf.properties +++ /dev/null @@ -1,49 +0,0 @@ -### -# ================================================================================ -# eCOMP Portal SDK -# ================================================================================ -# Copyright (C) 2017 AT&T 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=Proprietary\nUse Pursuant to Company Instructions -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-sdk-app/src/main/webapp/WEB-INF/conf/sql.properties b/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/sql.properties deleted file mode 100644 index 671690237..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/sql.properties +++ /dev/null @@ -1,322 +0,0 @@ -### -# ================================================================================ -# eCOMP Portal SDK -# ================================================================================ -# Copyright (C) 2017 AT&T 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=? - -# need to copy to oracle -load.remoteDB.schema = SELECT 'local' SCHEMA_ID, 'local' SCHEMA_DESC, null DATASOURCE_TYPE FROM dual union SELECT a.SCHEMA_ID, a.SCHEMA_DESC, DATASOURCE_TYPE FROM SCHEMA_INFO a where schema_id <> 'local' order by schema_id -load.remoteDB.schema.where = SELECT a.SCHEMA_ID, a.SCHEMA_DESC, DATASOURCE_TYPE FROM SCHEMA_INFO a where schema_id = '[schema_id]' -#formfield rendering - -formfield.id.name.sql.prefix=SELECT id, name FROM ( -formfield.id.name.sql=SELECT id, name - -formfield.id.name.sql.suffix= - -report.security.create= SELECT coalesce(cr.owner_id, cr.create_id) AS owner_id, cr.create_id, DATE_FORMAT(cr.create_date, '%m/%d/%Y') create_date, maint_id, DATE_FORMAT(cr.maint_date, '%m/%d/%Y') update_date, cr.public_yn FROM cr_report cr WHERE cr.rep_id = [rw.getReportID()] - -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=STR_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 = ? - -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()], STR_TO_DATE('[rw.getCreateDate()]', '[Globals.getOracleTimeFormat()]'), [rw.getUpdateID()], STR_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 = ? - -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 finalcr.rep_id, finalcr.title, finalcr.descr from (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) UNION SELECT cr.rep_id, cr.title, cr.descr FROM cr_report cr WHERE cr.menu_id LIKE '%[nvls(menuId)]%' AND (coalesce(cr.owner_id, cr.create_id) = [userID] OR cr.public_yn = 'Y' or EXISTS (select * from fn_user_role where user_id=[userID] and role_id in (1)))) finalcr ORDER BY finalcr.title - -load.folder.reports = SELECT cr.rep_id, cr.rep_id report_id, concat([rep_title_sql] , (CASE WHEN cr.public_yn = 'Y' THEN '' ELSE '[PRIVATE_ICON]' END),cr.title,'') title, cr.descr, concat(au.first_name,' ',au.last_name) owner_name, DATE_FORMAT(cr.create_date, '%m/%d/%Y') 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,DATE_FORMAT(a.dwnld_start_time, '%W %d-%m-%Y %H:%i:%s') 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) >= STR_TO_DATE(DATE_FORMAT(now() - INTERVAL 1 DAY, '%m/%d/%Y'), '%m/%d/%Y') 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 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 LIMIT 1, 6 - -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() + INTERVAL 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 concat('',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 concat('\"Run') ELSE 'N/A' END) run_image, x.name FROM (SELECT rl.rep_id, DATE_FORMAT(rl.log_time, '%m/%d/%Y %h:%i:%s %p') log_time, rl.action_value, concat(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 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 DATE_FORMAT(now(),'%m/%d/%Y %H:%i:%s') - -get.next.day.date.time = select DATE_FORMAT(NOW() + INTERVAL 1 DAY,'%m/%d/%Y %H:%i:%s') - -get.next.fifteen.minutes.date.time = select DATE_FORMAT(NOW() + INTERVAL 15 MINUTES,'%m/%d/%Y %H:%i:%s') - -get.next.thirty.minutes.date.time = select DATE_FORMAT(NOW() + INTERVAL 30 MINUTES,'%m/%d/%Y %H:%i:%s') - -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, DATE_FORMAT(cr.create_date, '[Globals.getOracleTimeFormat()]') create_date, maint_id, DATE_FORMAT(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 [colNames.toString()] FROM ([reportSQL]) AS x ) AS y - -report.sql.only.first.part = SELECT [colNames.toString()] FROM (SELECT [colNames.toString()] FROM ( - -report.sql.only.second.part.a = [startRow] - -report.sql.only.second.part.b = [pageSize] -#MYSQL: LIMIT [startRow], [pageSize] -#ORacle: rownum >= [startRow] and rownum <= ([startRow]+[pageSize]) -#Postgre: limit [pageSize] offset [startRow] - -report.sql.only.second.part.b.noorderby = LIMIT [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 [colNames.toString()] FROM ( [reportSQL] - -#RaptorRunHandler.java - -generate.sql.handler = SELECT x.* from ([sql]) AS x LIMIT 2 - -generate.sql.select = SELECT [colNames.toString()] FROM (SELECT [colNames.toString()] FROM ([sql]) AS y) AS x - -#ReportSchedule.java - -load.schedule.data = SELECT rs.enabled_yn, DATE_FORMAT(rs.start_date, '%m/%d/%Y') start_date, DATE_FORMAT(rs.end_date, '%m/%d/%Y') end_date, DATE_FORMAT(rs.run_date, '%m/%d/%Y') run_date, coalesce(DATE_FORMAT(rs.run_date, '%h'), '12') run_hour, coalesce(DATE_FORMAT(rs.run_date, '%i'), '00') run_min, coalesce(DATE_FORMAT(rs.run_date, '%p'), 'AM') run_ampm, rs.recurrence, rs.conditional_yn, rs.notify_type, rs.max_row, rs.initial_formfields, rs.schedule_id, coalesce(DATE_FORMAT(rs.end_date, '%h'), '11') end_hour, coalesce(DATE_FORMAT(rs.end_date, '%i'), '45') end_min, coalesce(DATE_FORMAT(rs.end_date, '%p'), 'PM') end_ampm, encrypt_yn, attachment_yn FROM cr_report_schedule rs WHERE rs.rep_id = [reportID] - -load.schedule.getid = SELECT rsu.user_id, concat(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 coalesce(max(schedule_id),0)+1 AS sequence from cr_report_schedule - -new.report.data = select coalesce(max(rep_id),0)+1 AS rep_id from cr_report - -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=? - -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] title, cr.descr, concat(au.first_name,' ',au.last_name) owner_name, DATE_FORMAT(cr.create_date, '%m/%d/%Y') 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 [fReportID] [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(concat(au.first_name,' ',au.last_name))' ELSE 'upper(cr.title)' END - -load.folder.report.result = SELECT cr.rep_id, cr.rep_id report_id, concat([rep_title_sql] , (CASE WHEN cr.public_yn = 'Y' THEN '' ELSE '[PRIVATE_ICON]' END),cr.title,'') title, cr.descr, concat(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 '(concat(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 ( concat('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 - -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 WHERE FU.USER_ID \= FUR.USER_ID and FUR.app_id \= ? and ACTIVE_YN \= 'Y' and 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 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 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 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 - -# report security -report.user.access = SELECT ra.role_id, ra.user_id, ra.read_only_yn FROM cr_report_access ra WHERE ra.rep_id = [reportID] -add.user.access = INSERT INTO cr_report_access (rep_id, order_no, role_id, user_id, read_only_yn) VALUES([reportID], IFNULL((select order_no from (SELECT MAX(order_no) AS order_no FROM cr_report_access WHERE rep_id=[reportID]) AS temp), 0)+1, NULL, [userID], '[readOnlyAccess]') -update.user.access = UPDATE cr_report_access SET read_only_yn='[readOnlyAccess]' WHERE rep_id=[reportID] AND user_id=[userID] -remove.user.access = DELETE FROM cr_report_access WHERE rep_id=[reportID] AND user_id=[userID] -add.role.access = INSERT INTO cr_report_access (rep_id, order_no, role_id, user_id, read_only_yn) VALUES([reportID], IFNULL((select order_no from (SELECT MAX(order_no) AS order_no FROM cr_report_access WHERE rep_id=[reportID]) AS temp), 0)+1, [roleID], NULL, '[readOnlyAccess]') -update.role.access = UPDATE cr_report_access SET read_only_yn='[readOnlyAccess]' WHERE rep_id=[reportID] AND role_id=[roleID] -remove.role.access = DELETE FROM cr_report_access WHERE rep_id=[reportID] AND role_id=[roleID] - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/system.properties b/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/system.properties deleted file mode 100644 index af7425ebe..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/conf/system.properties +++ /dev/null @@ -1,105 +0,0 @@ -### -# ================================================================================ -# eCOMP Portal SDK -# ================================================================================ -# Copyright (C) 2017 AT&T 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. -# ================================================================================ -### -# Properties read by ECOMP Core library, ecompSDK-core.jar - -########################################################################## -# The following properties should NOT be changed by partner applications. -########################################################################## - -application_user_id = 30000 -post_default_role_id = 16 -clustered = true - -#Enable Fusion Mobile capabilities for the application -mobile_enable = false - -# Cache config file is needed on the classpath -cache_config_file_path = /WEB-INF/classes/cache.ccf -cache_switch = 199 -cache_load_on_startup = false - -user_name = fullName -decryption_key = AGLDdG4D04BKm2IxIWEr8o== - -########################################################################## -# The following properties MAY require changes by partner applications. -########################################################################## - -#Oracle -#db.userName=quantumbd -#db.password=c1syn2yhmr -#db.connectionURL=jdbc:oracle:thin:todo.link -#db.hib.dialect=org.hibernate.dialect.Oracle10gDialect -#db.driver=oracle.jdbc.driver.OracleDriver -#Hibernate -#hb.dialect=org.hibernate.dialect.Oracle10gDialect -#hb.show_sql=true - -#Postgres -#db.userName=quantumbd -#db.password=c1syn2yhmr -#db.connectionURL=jdbc:postgresql:todo.link -#db.hib.dialect=org.hibernate.dialect.PostgreSQLDialect -#db.driver=org.postgresql.Driver -#hb.dialect=org.hibernate.dialect.PostgreSQLDialect -#hb.show_sql=true - -#Mysql -db.driver = com.mysql.jdbc.Driver -db.connectionURL = jdbc:mysql://localhost:3306/ecomp_sdk -db.userName = root -db.password = -db.min_pool_size = 5 -db.max_pool_size = 10 -hb.dialect = org.hibernate.dialect.MySQLDialect -# SQL statements are logged to stdout -hb.show_sql = false -hb.idle_connection_test_period = 3600 - -app_display_name = EP SDK App -files_path = /tmp - -#element map files -element_map_file_path = /tmp -element_map_icon_path = app/fusionapp/icons/ - -#Cron Schedules -log_cron = 0 0/1 * * * ?; -mylogins_feed_cron = 0 0/60 * * * ?; -#sessiontimeout_feed_cron = 0 * * * * ? * -my_login_feed_output_dir = /tmp/MyLogins - -# ECOMP Portal Shared Context REST API URL -ecomp_shared_context_rest_url= http://todo_enter_be_hostname:9000/ecompportal/context -# Link shown in Help menu -contact_us_link = https://todo_contact_us_link.com - -# An Unique 128-bit value defined to identify a specific version -# of an application deployed on a specific virtual machine. -# This value must be generated and updated by the application -# which is using the ECOMP SDK at the time of its deployment. -# Online Unique UUID generator - https://www.uuidgenerator.net/ -instance_uuid=8da691c9-987d-43ed-a358-00ac2f35685d - -# R Cloud feature - configure this property to enable notebook feature - for more details on RCloud please visit https://rcloud.social/index.html -guard_notebook_url= - -#authenticate user server -authenticate_user_server=http://todo_enter_auth_server_hostname:8383/openid-connect-server-webapp/allUsers diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/defs/definitions.xml b/ecomp-sdk-app/src/main/webapp/WEB-INF/defs/definitions.xml deleted file mode 100644 index 74287d0e8..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/defs/definitions.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/conf/fusion.properties b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/conf/fusion.properties deleted file mode 100644 index b2cef9f89..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/conf/fusion.properties +++ /dev/null @@ -1,61 +0,0 @@ -### -# ================================================================================ -# eCOMP Portal SDK -# ================================================================================ -# Copyright (C) 2017 AT&T 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. -# ================================================================================ -### - - -# validator settings -#default_error_message = Default error message - -#login message -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. - -authentication_mechanism = BOTH - -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 - - -# 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/ - -# Role settings -sys_admin_role_id = 1 -#sys_admin_role_function_delete_from_ui = true - -# Profile Search settings -#profile_search_report_id=181 -#callable_profile_search_report_id=386 diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/defs/definitions.xml b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/defs/definitions.xml deleted file mode 100644 index fb18cb798..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/defs/definitions.xml +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/.gitignore b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/broadcast.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/broadcast.jsp deleted file mode 100644 index d4e7810c1..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/broadcast.jsp +++ /dev/null @@ -1,137 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.web.support.UserUtils" %> -<%@ page import="org.openecomp.portalsdk.core.web.support.ControllerProperties" %> -<%@ page import="org.openecomp.portalsdk.core.util.SystemProperties" %> - -<%-- <%@ 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" %> - - - "/> - - - -
    -

    - - -

    Broadcast Message Edit

    -
    - -

    Broadcast Message Create

    -
    -
    -

    -
    - -
    - Please edit the broadcast message details below: 

    -
    -
    - -
    -
    -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - -
    - - -
    -
    -
    -
    -
    -
    -
    - -
    -
    - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/broadcast_list.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/broadcast_list.jsp deleted file mode 100644 index 2f6c68b51..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/broadcast_list.jsp +++ /dev/null @@ -1,201 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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" %> -<%@ page import="java.io.StringWriter" %> -<%@ page import="org.openecomp.portalsdk.core.web.support.ControllerProperties" %> -<%@ 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" %> - - - - -
    -

    - Broadcast Messages -

    -
    - - <%-- Display a table for the broadcast messages of each message location --%> -
    - -
    - {{location.label}} Messages -
    - - - - - - - - - - - - - - - - - {{message.id}} - - - - - - - - - - - -
    No.Message TextStart DateEnd DateSort OrderServerActive?Delete?
    {{$index+1}}{{message.messageText}} - {{message.displayStartDate}} - {{message.displayEndDate}}{{message.sortOrder}}{{message.siteCd}} -
    - -
    -
    -
    -
    -
    - -


    -
    -
    - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/collaborateList.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/collaborateList.jsp deleted file mode 100644 index b1fbfab14..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/collaborateList.jsp +++ /dev/null @@ -1,146 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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" %> - -
    -
    -

    User List

    -
    - - - - - - - - - - - - - - - - - - - - - - -
    User IDLast NameFirst NameEmailUserIdOnline/Offline
    - Offline - Online -
    -
    -
    -
    - Rows Per Page: - -
    -
    - Current Page: - -
    -
    - Total Page(s): - -
    - - -
    - - - - - - - - - - - -
    diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/data_out.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/data_out.jsp deleted file mode 100644 index f3fb7a747..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/data_out.jsp +++ /dev/null @@ -1,20 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> -${model.output_string} diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/ebz_footer.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/ebz_footer.jsp deleted file mode 100644 index 5a33314f2..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/ebz_footer.jsp +++ /dev/null @@ -1,46 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/ebz_header.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/ebz_header.jsp deleted file mode 100644 index 285ffd76f..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/ebz_header.jsp +++ /dev/null @@ -1,799 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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"%> -<%@ page import="org.openecomp.portalsdk.core.onboarding.crossapi.PortalApiProperties"%> -<%@ page import="org.openecomp.portalsdk.core.onboarding.crossapi.PortalApiConstants"%> -<%@ page import="org.openecomp.portalsdk.core.domain.MenuData"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" /> -" /> - -<% - String contactUsLink = SystemProperties.getProperty(SystemProperties.CONTACT_US_LINK); - String redirectUrl = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REDIRECT_URL); - String portalUrl = redirectUrl.substring(0, redirectUrl.lastIndexOf('/')) + "/processSingleSignOn"; - String getAccessLink = redirectUrl.substring(0, redirectUrl.lastIndexOf('/')) + "/get_access"; -%> - - - - -<%@include file="/WEB-INF/fusion/jsp/ebz/loginSnippet.html" %> - -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    -
  • - - ECOMP Portal -
  • -
    -
    - -
    -
    - - -
    - - -
    -
    -
    -
  • - Unable to load menus -
  • -
    - -
    -
  • -
    - - -
    -
  • -
  •  
  • -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    - - - -     {{app_name}} - -
    -
    -
    -
    - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/loginSnippet.html b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/loginSnippet.html deleted file mode 100644 index 0f29ee776..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz/loginSnippet.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template.jsp deleted file mode 100644 index 59b61d198..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template.jsp +++ /dev/null @@ -1,45 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template_noheader_nofooter.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template_noheader_nofooter.jsp deleted file mode 100644 index 98dccb4c0..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template_noheader_nofooter.jsp +++ /dev/null @@ -1,35 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template_report_embedded.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template_report_embedded.jsp deleted file mode 100644 index 4281a0636..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/ebz_template_report_embedded.jsp +++ /dev/null @@ -1,48 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/es_search_demo.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/es_search_demo.jsp deleted file mode 100644 index 9dc2102f9..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/es_search_demo.jsp +++ /dev/null @@ -1,97 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> - - - -
    -
    Elastic Search - Corporate Location Data System
    -
    -
    - -   -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    Customer NamePhoneStreetCityStateZIPCLLI
    {{options._source.name}}{{options._source.suggest.payload.tn}}{{options._source.suggest.payload.addr}}{{options._source.suggest.payload.city}}{{options._source.suggest.payload.st}}{{options._source.suggest.payload.zip}}{{options._source.suggest.payload.clli}}
    -
    -
    diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/es_suggest_demo.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/es_suggest_demo.jsp deleted file mode 100644 index 95b5e7cff..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/es_suggest_demo.jsp +++ /dev/null @@ -1,97 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> - - - -
    -
    Elastic Search - Corporate Location Data System
    -
    -
    - -   -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    Customer NamePhoneStreetCityStateZIPCLLI
    {{options.text}}{{options.payload.tn}}{{options.payload.addr}}{{options.payload.city}}{{options.payload.st}}{{options.payload.zip}}{{options.payload.clli}}
    -
    -
    diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/frame_insert.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/frame_insert.jsp deleted file mode 100644 index 5f550c683..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/frame_insert.jsp +++ /dev/null @@ -1,44 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/include.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/include.jsp deleted file mode 100644 index cd6a5e09e..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/include.jsp +++ /dev/null @@ -1,30 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/jcs_admin.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/jcs_admin.jsp deleted file mode 100644 index 845beac2f..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/jcs_admin.jsp +++ /dev/null @@ -1,144 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.html" %> - -
    -

    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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/meta.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/meta.jsp deleted file mode 100644 index 3c4ff52ae..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/meta.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal.html b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal.html deleted file mode 100644 index 0766cecdc..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal.html +++ /dev/null @@ -1,324 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal_role.html b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal_role.html deleted file mode 100644 index c163002d9..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal_role.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal_rolefunction.html b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal_rolefunction.html deleted file mode 100644 index ee0b51215..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/popup_modal_rolefunction.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/post_search.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/post_search.jsp deleted file mode 100644 index 94d4b0bf6..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/post_search.jsp +++ /dev/null @@ -1,356 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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" %> -<%@ 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.html" %> -<%@ include file="/WEB-INF/fusion/jsp/popup_modal_rolefunction.html" %> -<%@ include file="/WEB-INF/fusion/jsp/popup_modal_role.html" %> - - -
    - -

    WEBPHONE Search

    -
    - Please enter search criteria below:
    - -
    - Last Name:
    - -
    - -
    - First Name:
    - -
    - -
    - UserId:
    - -
    - -
    - Manager OrgUserId:
    - -
    -
    -
    - Organization:
    - -
    - -
    - Email:
    - -
    -
    - -
    - - - -
    -
    - {{noResultsString}} -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NoNameOrgUserIdOrganizationPhoneEmailImport?
    - {{$index + 1}} - -
    - {{profile.lastName}}, {{profile.firstName}} -
    - - -
    - {{profile.orgUserId}} - - {{profile.orgCode}} - - {{profile.phone}} - - {{profile.email}} - -
    -
    - -
    -
    -
    - Exists -
    -
    -
    - Rows Per Page: - -
    -
    - Current Page: - -
    -
    - Total Page(s): - -
    - -
    - -
    - -
    - - - - -
    - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/profile.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/profile.jsp deleted file mode 100644 index b8e0106ec..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/profile.jsp +++ /dev/null @@ -1,442 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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/popup_modal.html" %> - -<%@ include file="/WEB-INF/fusion/jsp/include.jsp"%> - -
    -

    - - -

    Profile Edit

    -
    - -

    Profile Edit

    -
    -
    -

    -
    - -
    - - Please edit the profile details below: 

    - -
    -
    - -
    - -
    -
    - -
    - -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    - -
    - -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    - -
    - -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    - - - -
    - - - - - - - - - - - - - - - - -
    NameRemove?
    {{ role.name }} - -
    - - - -
    - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/profile_search.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/profile_search.jsp deleted file mode 100644 index 295faf035..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/profile_search.jsp +++ /dev/null @@ -1,104 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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 NameEmailOrgUserIdManager OrgUserIdEditActive?
    {{rowData.id}}{{rowData.lastName}}{{rowData.firstName}}{{rowData.email}}{{rowData.orgUserId}}{{rowData.managerId}} -
    - -
    -
    -
    -
    -
    - Rows Per Page: - -
    -
    - Current Page: - -
    -
    - Total Page(s): - -
    -
    - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role.jsp deleted file mode 100644 index 9e944aa47..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role.jsp +++ /dev/null @@ -1,286 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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" %> - -<%@ include file="/WEB-INF/fusion/jsp/popup_modal.html" %> -<%@ include file="/WEB-INF/fusion/jsp/popup_modal_rolefunction.html" %> -<%@ 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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role_function_list.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role_function_list.jsp deleted file mode 100644 index 2df44ce1f..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role_function_list.jsp +++ /dev/null @@ -1,213 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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" %> -<%@ include file="/WEB-INF/fusion/jsp/popup_modal.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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role_list.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role_list.jsp deleted file mode 100644 index c27c360b9..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/role_list.jsp +++ /dev/null @@ -1,139 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.html" %> - -
    -

    Roles

    -
    -
    -Click on a Role to view its details. - -
    -
    - - - - - - - - - - - - - - - - - - -
    NamePriorityActive?Delete?
    {{ availableRole.name }}{{ availableRole.priority }} -
    - -
    -
    -
    -
    -
    - -
    - -
    - -
    - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/usage_list.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/usage_list.jsp deleted file mode 100644 index 4e45ffb37..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/usage_list.jsp +++ /dev/null @@ -1,87 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.html" %> - -
    -
    -

    - 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-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/webrtc/collaboration.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/webrtc/collaboration.jsp deleted file mode 100644 index ff6c985e3..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/jsp/webrtc/collaboration.jsp +++ /dev/null @@ -1,492 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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" %> - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - -
    - - - - -
    - -
    -
    - - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/Fusion.hbm.xml b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/Fusion.hbm.xml deleted file mode 100644 index 28060a7c4..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/Fusion.hbm.xml +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - - - - - - - seq_fn_user - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - seq_fn_audit_log - - - - - - - - - - - - - seq_fn_role - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - seq_fn_menu - - - - - - - - - - - - - - - - - - - - - - - - seq_fn_menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - seq_fn_broadcast_message - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select distinct md.parentMenu.id from MenuData as md where md.label = :paramLabel and md.label is not null - - - - select distinct md.id from MenuData as md where md.label = :paramLabel - - - - select distinct md.id, md.label, md.parentMenu.id from MenuData as md where md.label is not null - - - - select distinct functionCd from MenuData - - - - select distinct code from RoleFunction - - - - 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 - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/RNoteBookIntegration.hbm.xml b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/RNoteBookIntegration.hbm.xml deleted file mode 100644 index 6638b4bc7..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/RNoteBookIntegration.hbm.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/Workflow.hbm.xml b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/Workflow.hbm.xml deleted file mode 100644 index 3d8852cb3..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/orm/Workflow.hbm.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/custom_header_include.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/custom_header_include.jsp deleted file mode 100644 index 0bd373b75..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/custom_header_include.jsp +++ /dev/null @@ -1,135 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.model.runtime.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - -<%@ page import="java.net.*" %> - - - - - - -<%@ include file="/WEB-INF/fusion/jsp/include.jsp" %> - -<% - String url = request.getParameter("returnUrl"); - - if (url != null) { - request.setAttribute("returnUrl", URLDecoder.decode(url, "UTF-8")); - } - -%> - - -
    " method="POST" target="_parent"> - -
    - - - - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/custom_js_include.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/custom_js_include.jsp deleted file mode 100644 index 5abbb5ad0..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/custom_js_include.jsp +++ /dev/null @@ -1,31 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/date_end_field_run_sql.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/date_end_field_run_sql.jsp deleted file mode 100644 index fd2f9c366..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/date_end_field_run_sql.jsp +++ /dev/null @@ -1,38 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> - - - -
    - - - -
    - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/date_start_field_run_sql.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/date_start_field_run_sql.jsp deleted file mode 100644 index 698272621..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/date_start_field_run_sql.jsp +++ /dev/null @@ -1,39 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> - - - -
    - - - -
    - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/default_field_run_sql.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/default_field_run_sql.jsp deleted file mode 100644 index 95c99f378..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/default_field_run_sql.jsp +++ /dev/null @@ -1,39 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> - - - -
    - - - -
    - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/disclaimer.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/disclaimer.jsp deleted file mode 100644 index d5d252492..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/disclaimer.jsp +++ /dev/null @@ -1,38 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> -<% if(org.openecomp.portalsdk.analytics.system.Globals.getShowDisclaimer()) { %> - - - - <%if(!org.openecomp.portalsdk.analytics.system.Globals.hideRaptorFooter()) { %> - - - - - <% } %> - - - - - -
     
       
       
     
    - -<% } %> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/error_include.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/error_include.jsp deleted file mode 100644 index 8158e6046..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/error_include.jsp +++ /dev/null @@ -1,58 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.util.*" %> - -<% ArrayList alErrorList = (ArrayList) request.getAttribute(AppConstants.RI_ERROR_LIST); - if((alErrorList!=null)&&(alErrorList.size()>0)) { %> -
    - - - - -<% for(int i=0; i=0) - sErrorMsg = sErrorMsg.substring(sErrorMsg.indexOf("|")+1); - if((i%2)==0) { %> - -<% } %> - -<% if((i%2)==1) { %> - -<% } - } // for -%> -<% if((alErrorList.size()%2)==1) { %> - - - -<% } %> -
    - Validation Errors Found
    - Following errors need to be corrected to continue: -
    -
  • <%= sErrorMsg %> -
  • -   -
    -<% } // if -%> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/error_page.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/error_page.jsp deleted file mode 100644 index 8ee73be01..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/error_page.jsp +++ /dev/null @@ -1,229 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.io.*" %> -<%@ page import="java.util.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.error.UserAccessException"%> -<%@ page import="org.openecomp.portalsdk.analytics.error.RaptorException"%> -<%@ page import="org.openecomp.portalsdk.analytics.error.UserDefinedException"%> -<%@ page isErrorPage="true" %> - - -<% java.lang.Exception ex = (Exception) request.getAttribute(AppConstants.RI_EXCEPTION); %> -<% boolean showEditLink = false; - if(AppUtils.getRequestNvlValue(request, "r_action").equals("report.run")) { - ReportRuntime rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); - if(rr!=null) - try { - rr.checkUserWriteAccess(request); - showEditLink = true; - } catch(Exception e) {} - } // if -%> - - - - - - - - - - - Application Error - - - -<%-- jsp:include page="custom_header_include.jsp" flush="true" /--%> - -
    - - - "> - - -
    - - - - -<% if(ex!=null) { %> - <% if(ex instanceof org.openecomp.portalsdk.analytics.error.RaptorSchedularException) { %> - <% if(AppUtils.isAdminUser(request)) { %> - - - - <% } %> - - - - <% } %> - <% if(ex!=null) ex.printStackTrace(); %> - <% if(AppUtils.isAdminUser(request)) { - if ((ex instanceof org.openecomp.portalsdk.analytics.error.ReportSQLException)|| - (request.getAttribute("c_error_sql")!=null && !((String) request.getAttribute("c_error_sql")).trim().equals(""))) { - String sql = ""; - if(ex instanceof org.openecomp.portalsdk.analytics.error.ReportSQLException) - sql = ((org.openecomp.portalsdk.analytics.error.ReportSQLException) ex).getReportSQL(); - else - sql = (String) request.getAttribute("c_error_sql"); %> - <% if (sql!=null && sql.length() > 0) { %> - - - - - - - <% request.setAttribute("c_error_sql", sql); - %> - <% } %> - - - - <% if(request.getAttribute("c_error_url")!=null && !((String) request.getAttribute("c_error_url")).trim().equals("")) { %> - - - - <% } // if %> - <% } else { // reportSQLException - if (ex instanceof RaptorException) { %> - - - - <%} %> - <% } %> - <% } else { - if (ex instanceof UserAccessException) { %> - - - - <% } else if (ex instanceof UserDefinedException) { %> - - - - <% } - } %> - - - -<% } else { %> -<% if(exception instanceof org.openecomp.portalsdk.analytics.error.RaptorSchedularException) { %> - <% if(AppUtils.isAdminUser(request)) { %> - - - - <% } %> - - - <% if(exception!=null) exception.printStackTrace(); %> - -<% } %> -<% if(AppUtils.isAdminUser(request)) { - if ((exception instanceof org.openecomp.portalsdk.analytics.error.ReportSQLException)|| - (request.getAttribute("c_error_sql")!=null && !((String) request.getAttribute("c_error_sql")).trim().equals(""))) { - String sql = ""; - if(exception instanceof org.openecomp.portalsdk.analytics.error.ReportSQLException) - sql = ((org.openecomp.portalsdk.analytics.error.ReportSQLException) ex).getReportSQL(); - else - sql = (String) request.getAttribute("c_error_sql"); %> - <% if (sql!=null && sql.length() > 0) { %> - - - - - - -<% request.setAttribute("c_error_sql", sql); - %> - <% } %> - - - -<% if(request.getAttribute("c_error_url")!=null && !((String) request.getAttribute("c_error_url")).trim().equals("")) { %> - - - -<% } %> -<% } %> -<% } %> - - - -<% if(AppUtils.isAdminUser(request)) { %> - -<% } %> -<% if(exception!=null) exception.printStackTrace(); %> - -<% } // else -%> -
    -<% if(showEditLink) { %> - -<% } %> - Error/User-Alert Message: -
    - Exception Class: <%= (ex!=null && ex instanceof org.openecomp.portalsdk.analytics.error.RaptorSchedularException)?ex.getClass().toString():"" %> -
    Message: <%= (ex!=null && ex instanceof org.openecomp.portalsdk.analytics.error.RaptorSchedularException)?ex.getMessage():"" %> -
    - SQL Execution Error: -
    - <%= sql %> -
    - Error Message:
    - <%= AppUtils.getRequestNvlValue(request, "error_extra_msg") %><%= ex.getMessage() %> -
    - Please ">click here to edit report definition. -
    - Error Message:
    - <%= AppUtils.getRequestNvlValue(request, "error_extra_msg") %><%= ex.getMessage() %> -
    - Error Message:
    - <%= AppUtils.getRequestNvlValue(request, "error_extra_msg") %><%= ex.getMessage() %> -
    - Error Message:
    - <%= AppUtils.getRequestNvlValue(request, "error_extra_msg") %><%= ex.getMessage() %> -
    - ** The system administrator has been notified for this error. -
    - Exception Class: <%= (exception!=null && exception instanceof org.openecomp.portalsdk.analytics.error.RaptorSchedularException)?exception.getClass().toString():"" %> -
    Message: <%= (exception!=null && exception instanceof org.openecomp.portalsdk.analytics.error.RaptorSchedularException)?exception.getMessage():"" %> -
    - SQL Execution Error: -
    - <%= sql %> -
    - Error Message:
    - <%= AppUtils.getRequestNvlValue(request, "error_extra_msg") %><%= ex.getMessage() %> -
    - Please ">click here to edit report definition. -
    - ** The system administrator has been notified for this error. -
    - -
    - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/footer.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/footer.jsp deleted file mode 100644 index c4fbe9e84..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/footer.jsp +++ /dev/null @@ -1,25 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_drill_down_report.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_drill_down_report.jsp deleted file mode 100644 index 53959482c..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_drill_down_report.jsp +++ /dev/null @@ -1,601 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.xmlobj.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - -<% ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION); - List reportCols = rdef.getAllColumns(); - List rFormFields = null; - if(rdef.getFormFieldList()!=null&&rdef.getFormFieldList().getFormField().size()>0) - rFormFields = rdef.getFormFieldList().getFormField(); - - ReportFormFields ddReportFormFields = (ReportFormFields) request.getAttribute(AppConstants.RI_FORM_FIELDS); - - String drillDownSuppress = AppUtils.getRequestNvlValue(request, "drillDownSuppress"); - String drillDownParams = AppUtils.getRequestNvlValue(request, "drillDownParams"); - String drillDownRequest = AppUtils.getRequestNvlValue(request, "drillDownRequest"); - - Hashtable paramDefinitions = new Hashtable(); - StringTokenizer st = new StringTokenizer(drillDownParams, "&"); - //Added for passing request parameters in Drill Down - String[] reqParameters = Globals.getRequestParams().split(","); - int icnt=0; - // - while(st.hasMoreTokens()) { - String param = st.nextToken(); - DrillDownParamDef paramDef = new DrillDownParamDef(param); - if(paramDef.getFieldName().length()>0) - paramDefinitions.put(paramDef.getFieldName(), paramDef); - } // while -%> - - - - Drill-down Parameters Configuration - - - - - - - -
    - - - - - -<% if(ddReportFormFields!=null) - for(ddReportFormFields.resetNext(); ddReportFormFields.hasNext(); ) { - FormField ff = ddReportFormFields.getNext(); - if(!ff.getFieldType().equals(FormField.FFT_BLANK)) { - - DrillDownParamDef paramDef = (DrillDownParamDef) paramDefinitions.get(ff.getFieldName()); - if(paramDef==null) - paramDef = new DrillDownParamDef(""); %> - - <% if (ff!=null && (ff.getValidationType().equals(FormField.VT_TIMESTAMP_HR) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_MIN) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) ) { - %> - - - - - - - - - - - - - - - -<% if(rFormFields!=null) { %> - - - - - - - - -<% } // if - -%> - - <% - paramDef = (DrillDownParamDef) paramDefinitions.get(ff.getFieldName()+"_Hr"); - if(paramDef==null) - paramDef = new DrillDownParamDef(""); - %> - - - - - - - - - - - -<% - if (ff.getValidationType().equals(FormField.VT_TIMESTAMP_MIN) || ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) { -%> - <% - paramDef = (DrillDownParamDef) paramDefinitions.get(ff.getFieldName()+"_Min"); - if(paramDef==null) - paramDef = new DrillDownParamDef(""); - %> - - - - - - - - - - - -<% - } - if(ff.getValidationType().equals(FormField.VT_TIMESTAMP_SEC)) { -%> - <% - paramDef = (DrillDownParamDef) paramDefinitions.get(ff.getFieldName()+"_Sec"); - if(paramDef==null) - paramDef = new DrillDownParamDef(""); - %> - - - - - - - - - - - -<% - - } - - } else { -%> - - - - - - - - - - - - - - - -<% if(rFormFields!=null) { %> - - - - - - - - -<% } // if - } // else - } // if BLANK - } // for -%> - - - - - - - - - - - - - - - - - <% if(!Globals.getPassRequestParamInDrilldown() && (!(reqParameters.length==1 && reqParameters[0].length()<=0))) { - %> - - - - - <% - icnt=0; - - for (int i = 0; i < reqParameters.length; i++) { - icnt++; - - %> - > - - - - - <% - } //for - %> - - <% - } // if requestParam - %> - - - - - - - -
    - DRILL-DOWN PARAMETERS CONFIGURATION -
    -  <%= ff.getFieldDisplayName() %> -
    -       - >No value - - Accept default -
    -       - >Fixed value - - " onChange="document.dataform.r_<%= ff.getFieldName() %>[1].click();"> -
    -       - >Value of column - - -
    -       - >Value of form field - - -
    -       - >Value set - - Pass the value of the selected column if not empty,
    - otherwise pass the value of the selected form field
    -
    -  <%= ff.getFieldDisplayName() %> (Hour) -
    -       - >No value - - Accept default -
    -       - >Value of column - - - - -
    -  <%= ff.getFieldDisplayName() %> (Minutes) -
    -       - >No value - - Accept default -
    -       - >Value of column - - - - -
    -  <%= ff.getFieldDisplayName() %> (Seconds) -
    -       - >No value - - Accept default -
    -       - >Value of column - - - - -
    -  <%= ff.getFieldDisplayName() %> -
    -       - >No value - - Accept default -
    -       - >Fixed value - - " onChange="document.dataform.r_<%= ff.getFieldName() %>[1].click();"> -
    -       - >Value of column - - -
    -       - >Value of form field - - -
    -       - >Value set - - Pass the value of the selected column if not empty,
    - otherwise pass the value of the selected form field
    -
     
    -  Parameter values not to be passed to the drill-down report
    -       - Suppress values - - -
    separate by | if multiple values
    -
     
    -  Request Parameter values to be passed to the drill-down report
    <%= reqParameters[i]%> - > -
    - Show Drilled Down Report In Popup Window: -
    -
    -

    - - - - -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_import_semaphore.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_import_semaphore.jsp deleted file mode 100644 index d73a7fe25..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_import_semaphore.jsp +++ /dev/null @@ -1,80 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.xmlobj.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - -<% ArrayList importedList = (ArrayList) request.getAttribute(AppConstants.RI_DATA_SET); %> - - - - Advanced Display Formatting - - - - - - -
    - - - - - - - - - - - -
     Advanced Display Formatting Import
    -<% if(importedList!=null&&importedList.size()>0) { %> - <%= importedList.size() %> Advanced Display Formattings successfully imported. -<% } else { %> - The selected report does not have Advanced Display Formattings
    - defined. No Advanced Display Formattings were imported. -<% } %> -
    -
    - -
    - - - - - - -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_semaphore.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_semaphore.jsp deleted file mode 100644 index 39eafb249..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_semaphore.jsp +++ /dev/null @@ -1,419 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.xmlobj.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - -<% ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION); - - String semaphoreId = AppUtils.getRequestNvlValue(request, "semaphoreId"); - String semaphoreType = AppUtils.getRequestNvlValue(request, "semaphoreType"); - SemaphoreType semaphore = rdef.getSemaphoreById(semaphoreId); - String semaphoreName = null; - List listColumns = rdef.getAllColumns(); - if(semaphore!=null) - semaphoreName = semaphore.getSemaphoreName(); - else - if(rdef.getSemaphoreList()!=null) - semaphoreName = "Display Formatting "+(rdef.getSemaphoreList().getSemaphore().size()+1); - else - semaphoreName = "Display Formatting 1"; - - String submitBtn = AppUtils.getRequestNvlValue(request, "submit_btn"); %> - - - - Advanced Display Formatting - - -<% if(submitBtn.startsWith("Save")) { %> - -<% } %> - -<% if(submitBtn.equals("Save")) { %> - - - Please wait... -<% } else { %> - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<% for(int i = 0; i<3+((semaphore==null)?2:semaphore.getFormatList().getFormat().size()); i++) { - FormatType ft = null; - if(semaphore!=null&&i - > - <% if(i==0) { %> - - <% } else { %> - - - - <% } %> - - - - - - - - - - -<% } // for -%> - - - -
     Advanced Display Formatting Definition
    Display Name: - -
    Apply Formatting To: - <% String sValue = AppConstants.ST_CELL; - if(semaphore!=null) - sValue = nvl(semaphore.getSemaphoreType(), AppConstants.ST_CELL); %> -
     
    Column Value IsBold?Italic?Under-
    line?
    Background ColorFont ColorFont FaceFont Size     Preview     
    - Any Other - "> - - - - - "> - <% sValue = "="; - if(ft!=null) - sValue = nvl(ft.getExpression(), "="); %> - - - "> - - <% boolean bValue = false; - if(ft!=null) - bValue = ft.isBold(); %> - "> - onClick="setBold(<%= i %>)"> - - <% bValue = false; - if(ft!=null) - bValue = ft.isItalic(); %> - "> - onClick="setItalic(<%= i %>)"> - - <% bValue = false; - if(ft!=null) - bValue = ft.isUnderline(); %> - "> - onClick="setUnderline(<%= i %>)"> - - <% sValue = ""; - if(ft!=null) - sValue = nvl(ft.getBgColor()); %> - - - <% sValue = ""; - if(ft!=null) - sValue = nvl(ft.getFontColor()); %> - - - <% sValue = ""; - if(ft!=null) - sValue = nvl(ft.getFontFace()); %> - - - <% sValue = "11"; - if(ft!=null) - sValue = nvl(ft.getFontSize(), "11"); %> - - - Sample -
    -
    - - - -
    - -
    - -<% } // if(submitBtn.equals("Save")) { ... } else { -%> - - - - -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_sql.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_sql.jsp deleted file mode 100644 index c685bb138..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_sql.jsp +++ /dev/null @@ -1,55 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - - - - <%= nvl((String) request.getAttribute(AppConstants.RI_PAGE_TITLE)) %> - - - - - - - - - - - - - -
    - <%= nvl((String) request.getAttribute(AppConstants.RI_PAGE_SUBTITLE), nvl((String) request.getAttribute(AppConstants.RI_PAGE_TITLE))) %> -
    > - <%= nvl((String) request.getAttribute(AppConstants.RI_FORMATTED_SQL)) %> -
    -
    - -
    -
    - - - -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_table_cols.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_table_cols.jsp deleted file mode 100644 index 9dec6a53a..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_table_cols.jsp +++ /dev/null @@ -1,171 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.xmlobj.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - -<% String tableName = AppUtils.getRequestValue(request, AppConstants.RI_TABLE_NAME); - String remoteDbPrefix = (String) session.getAttribute("remoteDB"); - Vector tableSources = null; - Vector dbColumns = null; - if(tableName==null) { - tableSources = DataCache.getReportTableSources(remoteDbPrefix); - if(tableSources.size()>0) - tableName = ((TableSource) DataCache.getReportTableSources(remoteDbPrefix).get(0)).getTableName(); - } - if(tableName!=null) - dbColumns = DataCache.getReportTableDbColumns(tableName.toUpperCase(),remoteDbPrefix); - - - boolean isSingleValueChoice = AppUtils.getRequestFlag(request, "single_value"); - boolean includeTableNameInResult = AppUtils.getRequestFlag(request, "return_table_name"); - boolean includeColTypeInResult = AppUtils.getRequestFlag(request, "return_col_type"); %> - - - - Table Columns - - - - - - - - -<% if(! isSingleValueChoice) { %> - -<% } // if -%> - - -
    - - -<% if(isSingleValueChoice) { %> - -<% } %> -<% if(includeTableNameInResult) { %> - -<% } %> -<% if(includeColTypeInResult) { %> - -<% } %> - - - - - - - <% int rNum = 0; - if(dbColumns!=null) - for(rNum=0; rNum - > - - <% if(isSingleValueChoice) { %> - - <% } else { %> - - - <% } // else - %> - - <% } // for - if(rNum==0) { %> - - - - <% } else { // if - %> - - - - <% - } - %> - - - - -
      - <% if(! isSingleValueChoice) { %> -   - <% } %> - - - DB Table Columns -
    <%= (rNum+1) %><%= sDisplay %> - - <%= sDisplay %>
    No columns found for table [<%= tableName %>]
    <%= "CLEAR VALUE" %>
      - <% if(! isSingleValueChoice) { %> -   - <% } %> -  
    - - - -
    - - - - -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_testrun_sql.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_testrun_sql.jsp deleted file mode 100644 index a5dbd5026..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/popup_testrun_sql.jsp +++ /dev/null @@ -1,103 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.io.*" %> -<%@ page import="java.util.*" %> - -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - -<% Exception ex = (Exception) request.getAttribute(AppConstants.RI_EXCEPTION); - DataSet ds = (DataSet) request.getAttribute(AppConstants.RI_DATA_SET); %> - - - -SQL Statement Test Run - - - - - - - - -<% if(ex!=null) { %> - - - -<% } else if(ds!=null) { %> - - - <% for(int c=0; c - - <% } %> - - <% for(int r=0; r - > - - <% for(int c=0; c - - <% } %> - - <% } // for r - if(ds.getRowCount()>Globals.getDefaultPageSize()) { %> - > - - - - <% } else if(ds.getRowCount()==0) { %> - - - - <% } // else if - } // else if -%> - - - -
    -
    -
    - <%= nvl(ex.getMessage(), " ") %> -

    - -
     <%= ds.getColumnName(c) %>
    <%= (r+1) %><%= nvl(ds.getString(r, c), " ") %>
    <%= (Globals.getDefaultPageSize()+1) %>...
    No data found
    -
    -
    - - - -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_csv.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_csv.jsp deleted file mode 100644 index 811580474..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_csv.jsp +++ /dev/null @@ -1,89 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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 trimDirectiveWhitespaces="true" %> -<%@ page import="java.util.*" %><%@ page import="java.text.*" %><%@ page import="java.io.*" %><%@ page import="org.openecomp.portalsdk.analytics.model.*" %><%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %><%@ page import="org.openecomp.portalsdk.analytics.view.*" %><%@ page import="org.openecomp.portalsdk.analytics.system.*" %><%@ page import="org.openecomp.portalsdk.analytics.util.*" %><% - ReportRuntime rr = null; - ReportData rd = null; - String parent = ""; - int parentFlag = 0; - if(!nvl(request.getParameter("parent"), "").equals("N")) parent = nvl(request.getParameter("parent"), ""); - if(parent.startsWith("parent_")) parentFlag = 1; - if(parentFlag == 1) { - rr = (ReportRuntime) request.getSession().getAttribute(parent+"_rr"); - rd = (ReportData) request.getSession().getAttribute(parent+"_rd"); - } - if(rr==null) rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); - if(rd==null) rd = (ReportData) request.getSession().getAttribute(AppConstants.RI_REPORT_DATA); - String formattedReportName = new HtmlStripper().stripSpecialCharacters(rr.getReportName()); - String formattedDate = new SimpleDateFormat("MMddyyyyHHmm").format(new Date()); - String fName = formattedReportName+formattedDate+AppUtils.getUserID(request); - boolean raw = AppUtils.getRequestFlag(request, "raw"); - if(true && !raw) - response.setContentType("application/octet-stream"); - else - response.setContentType("application/csv"); - String fileName = fName+".csv"; - String sql_whole = (String) request.getAttribute(AppConstants.RI_REPORT_SQL_WHOLE); - if(true && !raw) - response.setHeader("Content-disposition","attachment;filename="+fName+".zip"); - else - response.setHeader("Content-disposition","attachment;filename="+fName+".csv"); - try {(new ReportHandler()).createCSVFileContent(out, rd, rr, sql_whole, request,fName); - //out.flush(); - //out.close(); - if(true) { - // response.reset(); - ServletOutputStream outS = response.getOutputStream(); - java.io.File file = null; - if(true && !raw) { - response.setContentType("application/octet-stream"); - response.setHeader("Content-disposition","attachment;filename="+fName+".zip"); - file = new java.io.File(AppUtils.getTempFolderPath()+""+fName+".zip"); - } else { - response.setContentType("application/csv"); - response.setHeader("Content-disposition","attachment;filename="+fName+".csv"); - file = new java.io.File(AppUtils.getTempFolderPath()+""+fName+".csv"); - } - FileInputStream fileIn = new FileInputStream(file); - int c; - while((c=fileIn.read()) != -1){ - outS.write(c); - } - outS.flush(); - outS.close(); - fileIn.close(); - - - /*byte[] outputByte = new byte[4096]; - //copy binary contect to output stream - while(fileIn.read(outputByte, 0, 4096) != -1) { - outS.write(outputByte, 0, 4096); - } - fileIn.close(); - outS.flush(); - outS.close();*/ - } - } catch(Exception e) { - e.printStackTrace(); - Log.write("Fatal error [report_download_csv.jsp]: "+e.getMessage()); - } -%> -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %> diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_pdf.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_pdf.jsp deleted file mode 100644 index e5ae9ddef..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_pdf.jsp +++ /dev/null @@ -1,40 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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 trimDirectiveWhitespaces="true" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.pdf.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.view.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> -<% - ReportRuntime rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); - ReportData rd = (ReportData) request.getSession().getAttribute(AppConstants.RI_REPORT_DATA); - try { - new PdfReportHandler().createPdfFileContent(request,response, 3); - } catch(Exception e) { - Log.write("Fatal error [report_download_pdf.jsp]: "+e.getMessage()); - e.printStackTrace(); - } - out.clear(); - out = pageContext.pushBody(); -%> - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_xls.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_xls.jsp deleted file mode 100644 index a82470d81..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_download_xls.jsp +++ /dev/null @@ -1,64 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.model.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.view.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> -<% -ReportRuntime rr = null; -ReportData rd = null; -String parent = ""; -int parentFlag = 0; -if(!nvl(request.getParameter("parent"), "").equals("N")) parent = nvl(request.getParameter("parent"), ""); -if(parent.startsWith("parent_")) parentFlag = 1; -if(parentFlag == 1) { - rr = (ReportRuntime) request.getSession().getAttribute(parent+"_rr"); - rd = (ReportData) request.getSession().getAttribute(parent+"_rd"); -} -if(rr==null) rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); -if(rd==null) rd = (ReportData) request.getSession().getAttribute(AppConstants.RI_REPORT_DATA); - - if(rr != null && rr.getReportType().equals(AppConstants.RT_DASHBOARD)) { - //rr = (ReportRuntime) request.getSession().getAttribute("FirstDashReport"); - } else if (rr == null) - rr = (ReportRuntime) request.getSession().getAttribute("FirstDashReport"); - //rd = (ReportData) request.getSession().getAttribute(AppConstants.RI_REPORT_DATA); - - //response.setContentType("application/vnd.ms-excel"); - //response.setHeader("Content-disposition","attachment;filename=download_all_"+AppUtils.getUserID(request)+".xls"); - String user_id = AppUtils.getUserID(request); - try { -/* if (rr.getReportType().equals(AppConstants.RT_CROSSTAB)) { - int downloadLimit = (rr.getMaxRowsInExcelDownload()>0)?rr.getMaxRowsInExcelDownload():Globals.getDownloadLimit(); - rd = rr.loadReportData(-1, AppUtils.getUserID(request), downloadLimit,request); - } -*/ - new ReportHandler().createExcelFileContent(out, rd, rr, request, response, user_id, 3); //3 whole - } catch(Exception e) { - e.printStackTrace(); - Log.write("Fatal error [report_download_xls.jsp]: "+e.getMessage()); - } - out.clear(); - out = pageContext.pushBody(); -%> -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_ebz.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_ebz.jsp deleted file mode 100644 index 8d42b65ba..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_ebz.jsp +++ /dev/null @@ -1,179 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    Loading...
    -
    -
    -
    - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_import.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_import.jsp deleted file mode 100644 index 014f98ac5..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_import.jsp +++ /dev/null @@ -1,69 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - - - - Import - - - - -

    - -
    - - - - - - - - - - - - - -
    - <%= Globals.getBaseTitle() %> > IMPORT REPORT XML -
    - - - -
    -
    - -
    - - - -
    - - - - - - -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_sample.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_sample.jsp deleted file mode 100644 index cfbfad14e..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_sample.jsp +++ /dev/null @@ -1,40 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> -

    Customizable Analytics Dashboard

    - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_search.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_search.jsp deleted file mode 100644 index 480bdbcb9..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_search.jsp +++ /dev/null @@ -1,2432 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_wizard.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_wizard.jsp deleted file mode 100644 index cdfe943a5..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/report_wizard.jsp +++ /dev/null @@ -1,309 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> -<%-- - Name: report_wizard.jsp - Use : Master JSP which navigates to specific JSP when different tab is selected. Default it navigates to the wizard_definition.jsp - - Change Log - ========== - - 22-Jun-2009 : Version 8.4 (Sundar); - -
      -
    • Save button is suppressed from showing when wizard is in the last page (Run page).
    • -
    • width of the content_iframe is changed back to default one when navigated from >100% report's run page.
    • -
    ---%> -<%@ page import="java.util.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - -<%@ page errorPage="error_page.jsp" %> - - - - - - -<% ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION); - - String reportID = rdef.getReportID(); - WizardSequence ws = rdef.getWizardSequence(); - - String curStep = ws.getCurrentStep(); - String curSubStep = ws.getCurrentSubStep(); - - String dbInfo = null; - dbInfo = rdef.getDBInfo(); - int sessionflag = 0; - if(dbInfo == null || dbInfo.length() == 0) { - dbInfo = (String) session.getAttribute("remoteDB"); - sessionflag = 1; - } - session.setAttribute("remoteDB", dbInfo); - if((dbInfo == null) && (request.getParameter("dataSource")!=null)) - session.setAttribute("remoteDB", request.getParameter("dataSource")); - - String title = (reportID.equals("-1")?"Create Report":"Edit Report"); - String navTitle = Globals.getBaseTitle()+" > " + title; - - boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB); - boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED); -%> - -<% - request.setAttribute(AppConstants.SI_REPORT_DEFINITION,rdef); -%> - - - - - - - - - - - - - -
    - -
    -
    -
    - -
    - - - - - - - - - - -
    - - -<% for(ws.resetNext(); ws.hasNext(); ) { - String sTab = ws.getNext(); %> - - - -<% } // for -%> - - -
    " width="9" height="24"> align="center" valign="middle"> - <% if(sTab.equals(curStep)) { %> -  <%= clearSpaces(sTab) %>  - <% } else if(reportID.equals("-1")) { %> -  <%= clearSpaces(sTab) %>  - <% } else { %> -  <%= clearSpaces(sTab) %>  - <% } %> - " width="9" height="24"> 
    -
    - - - - -
    <%= navTitle %>
    -
    <% if(curStep.equals(AppConstants.WS_DEFINITION)) { %> - <% if(sessionflag == 1) dbInfo = ""; %> - -<% } else if(curStep.equals(AppConstants.WS_SQL)) { %> - -<% } else if(curStep.equals(AppConstants.WS_TABLES)&&curSubStep.equals("")) { %> - -<% } else if(curStep.equals(AppConstants.WS_TABLES)&&(curSubStep.equals(AppConstants.WSS_ADD)||curSubStep.equals(AppConstants.WSS_EDIT))) { %> - -<% } else if(curStep.equals(AppConstants.WS_COLUMNS)&&curSubStep.equals("")) { %> - -<% } else if(curStep.equals(AppConstants.WS_COLUMNS)&&curSubStep.equals(AppConstants.WSS_ADD_MULTI)) { %> - -<% } else if(curStep.equals(AppConstants.WS_COLUMNS)&&curSubStep.equals(AppConstants.WSS_ORDER_ALL)) { %> - -<% } else if(curStep.equals(AppConstants.WS_COLUMNS)&&(curSubStep.equals(AppConstants.WSS_ADD)||curSubStep.equals(AppConstants.WSS_EDIT) ||curSubStep.equals(AppConstants.WA_MODIFY))) { %> - -<% } else if(curStep.equals(AppConstants.WS_FORM_FIELDS)&&curSubStep.equals("")||curSubStep.equals(AppConstants.WSS_ADD_BLANK)) { %> - -<% } else if(curStep.equals(AppConstants.WS_FORM_FIELDS)&&(curSubStep.equals(AppConstants.WSS_ADD)||curSubStep.equals(AppConstants.WSS_EDIT))) { %> - -<% } else if(curStep.equals(AppConstants.WS_FILTERS)&&curSubStep.equals("")) { %> - -<% } else if(curStep.equals(AppConstants.WS_FILTERS)&&(curSubStep.equals(AppConstants.WSS_ADD)||curSubStep.equals(AppConstants.WSS_EDIT))) { %> - -<% } else if(curStep.equals(AppConstants.WS_SORTING)&&curSubStep.equals("")) { %> - -<% } else if(curStep.equals(AppConstants.WS_SORTING)&&curSubStep.equals(AppConstants.WSS_ORDER_ALL)) { %> - -<% } else if(curStep.equals(AppConstants.WS_SORTING)&&(curSubStep.equals(AppConstants.WSS_ADD)||curSubStep.equals(AppConstants.WSS_EDIT))) { %> - -<% } else if(curStep.equals(AppConstants.WS_JAVASCRIPT)) { %> - -<% } else if(curStep.equals(AppConstants.WS_CHART)) { %> - -<% } else if(curStep.equals(AppConstants.WS_USER_ACCESS)) { %> - -<% } else if(curStep.equals(AppConstants.WS_SCHEDULE)) { %> - -<% } else if(curStep.equals(AppConstants.WS_REPORT_LOG)) { %> - -<% } else if(curStep.equals(AppConstants.WS_MAP)) { %> - -<% } else if(curStep.equals(AppConstants.WS_DATA_FORECASTING)) { %> - -<% } else { %> - -<% } %> - -
    - - - - - -
    -   - - <% if(! ws.isInitialStep()) { %> - - <% } %> - - <% if(! ws.isFinalStep()) { %> - - - <% } %> -
    -
    - -
    - - - - - -
    -
    -<%----%> - -<%! private String HTMLEncode(String value) { - StringBuffer sb = new StringBuffer(value); - - for(int i=0; i') - sb.replace(i, i+1, ">"); - else if(sb.charAt(i)=='"') - sb.replace(i, i+1, """); - - return sb.toString(); - } // HTMLEncode - - private String clearSpaces(String value) { - StringBuffer sb = new StringBuffer(value); - - for(int i=0; i - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/test_field_run_sql.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/test_field_run_sql.jsp deleted file mode 100644 index 2fdcee46e..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/test_field_run_sql.jsp +++ /dev/null @@ -1,39 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> - - - -
    - - - -
    - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/test_run_sql.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/test_run_sql.jsp deleted file mode 100644 index 1c30437bc..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/test_run_sql.jsp +++ /dev/null @@ -1,38 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> - - - -
    - - - -
    - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/tree/folderNav.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/tree/folderNav.jsp deleted file mode 100644 index ca091bab5..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/tree/folderNav.jsp +++ /dev/null @@ -1,483 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.system.AppUtils" %> -<%@page import="org.openecomp.portalsdk.analytics.model.runtime.ReportRuntime"%> -<%@page import="org.openecomp.portalsdk.analytics.util.AppConstants"%> -<%@page import="org.openecomp.portalsdk.analytics.system.Globals"%> - -<% - boolean isFolderAllowed = false; - ReportRuntime rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); - boolean adminUser = AppUtils.isAdminUser(request); - if (Globals.isFolderTreeAllowed()) { - if(adminUser) { - isFolderAllowed = true; - } else if (!Globals.isFolderTreeAllowedOnlyForAdminUsers()) { - isFolderAllowed = true; - } else isFolderAllowed = false; - } - - - -%> - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - <% if(isFolderAllowed) { %> - - <% } %> - - - - <% if(isFolderAllowed) { %> -
    - Show Folder Tree -
    - <% } %> - - - -
    - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/tree/testTree.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/tree/testTree.jsp deleted file mode 100644 index 951bf379c..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/tree/testTree.jsp +++ /dev/null @@ -1,248 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.system.AppUtils" %> - - - - - - - - Folder tree with Drag and Drop capabilities - - - - - - - - - - - - - -
    - - - - - - - - - -
    - -
    -
    - - - - -
    - Hide Folder Tree -     - - Create Folder | - Delete Fodler | - Run Report | - Edit Report -
    -
    -
    -
    - - - - - - - -
    -
    - - - - -
    - <%=request.getAttribute("folderList")%> -
    -
    -
    - - - -
    - Collapse all | - Expand all -
    - - -
    - -
    -
    -
    -
    - -
    -
    -
    - - - -
    - - - - -
    - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_adhoc_schedule.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_adhoc_schedule.jsp deleted file mode 100644 index 76fe7a58c..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_adhoc_schedule.jsp +++ /dev/null @@ -1,733 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> -<%-- - Name: wizard_adhoc_schedule.jsp - Use : This JSP is used for accepting user parameters for scheduling the report. - - Change Log - ========== - - 28-Aug-2009 : Version 8.4 (Sundar); initFormFields function is removed as it is handled in back end. - 23-Jun-2009 : Version 8.4 (Sundar); - -
      -
    • Bug related to creating startDate variable (in Javascript) for the Validation purpose is fixed.
    • -
    - - ---%> - -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.Vector" %> -<%@ page import="java.util.List" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataSourceType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.DBColumnInfo" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableSource" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.SemaphoreType" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportSchedule" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %> - -<% - ReportSchedule reportSchedule = (ReportSchedule) request.getSession().getAttribute(AppConstants.SI_REPORT_SCHEDULE); - ReportDefinition rdefRecurrance = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - session.setAttribute("login_id", AppUtils.getUserBackdoorLoginId(request)); - if(reportSchedule==null) reportSchedule = (ReportSchedule) request.getAttribute(AppConstants.SI_REPORT_SCHEDULE); - String remoteDbPrefix = (String) session.getAttribute("remoteDB"); - boolean isSQLAllowed = Globals.getAllowSQLBasedReports(); -%> -<%@page import="java.util.Calendar"%> -<%@page import="java.text.DateFormat"%> -<%@page import="java.text.SimpleDateFormat"%> -<%@page import="java.util.TimeZone"%> -<%@page import="java.util.Date"%> -<%@page import="org.openecomp.portalsdk.analytics.model.ReportLoader"%> - - - - - - - - - - - -
    - <% - Calendar startCalendarDate = Calendar.getInstance(); - startCalendarDate.add(Calendar.DAY_OF_MONTH, - 540); - Calendar endCalendarDate = Calendar.getInstance(); - endCalendarDate.add(Calendar.DAY_OF_MONTH, 540); - SimpleDateFormat dtf = new SimpleDateFormat("MM/dd/yyyy"); - SimpleDateFormat oracleDateFormat = new SimpleDateFormat("MM/dd/yyyy kk:mm:ss"); - Date sysdate = oracleDateFormat.parse(ReportLoader.getSystemDateTime()); - SimpleDateFormat dtimestamp = new SimpleDateFormat(Globals.getScheduleDatePattern()); - Calendar systemCalendar = Calendar.getInstance(); - systemCalendar.setTime(sysdate); - Date sysNext15date = oracleDateFormat.parse(ReportLoader.getNext15MinutesOfSystemDateTime()); - //dtimestamp = new SimpleDateFormat(Globals.getScheduleDatePattern()); - Calendar systemNext15Calendar = Calendar.getInstance(); - systemNext15Calendar.setTime(sysNext15date); - Date sysNext30date = oracleDateFormat.parse(ReportLoader.getNext30MinutesOfSystemDateTime()); - //dtimestamp = new SimpleDateFormat(Globals.getScheduleDatePattern()); - Calendar systemNext30Calendar = Calendar.getInstance(); - systemNext30Calendar.setTime(sysNext30date); - - System.out.println(" systemNext15Calendar " + systemNext15Calendar); - System.out.println(" systemNext30Calendar " + systemNext30Calendar); - - //dtimestamp.setTimeZone(TimeZone.getTimeZone(Globals.getTimeZone())); - -%> - - - - - - - - - - - - <%if(nvl(Globals.getScheduleHelpMessage()).length()>0) { %> - - - - <% } %> - - - - - - - - - - - - - - - - - - - - - - - - - - <% if(AppUtils.isAdminUser(request) || isSQLAllowed ) { %> - - - - - - - - - <% } %> - - - - - - - - - - - - - - - -<% List emailToUsers = reportSchedule.getEmailToUsers(); - for(int i=0; i - - - - -<% } // for - List emailToRoles = reportSchedule.getEmailToRoles(); - for(int i=0; i - - - - -<% } // for - - Vector remainingUsers = Utils.getUsersNotInList(emailToUsers,request); - Vector remainingRoles = Utils.getRolesNotInList(emailToRoles,request); - if((emailToUsers.size()+emailToRoles.size()==0)||(remainingUsers.size()>0)||(remainingRoles.size()>0)) { %> - - - -<% } // if -%> -
    - <%if(nvl(Globals.getScheduleHelpMessage()).trim().length()>0) { %> - - <% } %> - Please enter Time in <%= Globals.getTimeZone()%>. The Current System Time is <%=dtimestamp.format(sysdate)%> <%=Globals.getTimeZone()%> -
    -
    -

    Report Desc: - <%= Globals.getScheduleHelpMessage() %>

    -
    -
    Schedule Emails: - toolTipText="This is used for the enabling or disabling the scheduling feature for this report."/>Yes -   - toolTipText="This is used for the enabling or disabling the scheduling feature for this report."/>No - -
    Email Attachment: - - <%if(!rdefRecurrance.getReportType().equals(AppConstants.RT_HIVE)) {%> - toolTipText="Provides the capability to attach reports as PDF format to the email."/>PDF Attachment -    - toolTipText="Provides the capability to attach reports as Excel format to the email."/>Excel Attachment -    - <% } %> - toolTipText="Provides the capability to attach reports as Excel format to the email."/>Excelx Attachment -    - toolTipText="Provides the capability to attach reports as CSV format to the email."/>CSV Attachment - <%if(!rdefRecurrance.getReportType().equals(AppConstants.RT_HIVE)) {%> - <% if(nvl(Globals.getShellScriptDir()).length()>1) { %> - toolTipText="Provides the capability to send only links to the generated report in the email."/>Link to Generated report - <% } %> - <% } %> - - -
    Recurrence: - -
    First Schedule Date: - - - -       - - - - <%= Globals.getTimeZone()%> - - -
    Last Schedule Date: - - - -       - - - - <%= Globals.getTimeZone()%> - - -
    Use Condition: - > Send Emails Only When Condition Is Met -
    Condition SQL: - - -   -
    Max rows in attachment: - - -
    - Form Fields -

    <%= (i==0)?"Email To: ":" " %> - <%= userValue.getName() %> -       - -
    <%= (emailToUsers.size()==0&&i==0)?"Email To: ":" " %>Everyone With Role:  - <%= roleValue.getName() %> -       - -
    - - - - <% if ( nvl(Globals.getEncryptedSMTPServer(),"").length() > 0 ) { %> - - <% } %> - <% if (Globals.generateSchedReportsInFileSystem()) { %> - - <% } %> - -
    <%= (emailToUsers.size()+emailToRoles.size()==0)?"Email To: ":" " %> -<% if(remainingUsers.size()>0) { %> - -<% } else { %> - No user emails available -<% } %> -       -<% if(remainingRoles.size()>0) { %> - -<% } else { %> - No roles available -<% } %> - - Encrypt Attachment - toolTipText="Choose the encryption mode."/>Yes -    - toolTipText="Choose the encryption mode."/>No - Send as Attachment - toolTipText="Send As Attachment"/>Yes -    - toolTipText="Store it in file system."/>No -
    -
    - - -
    - - - - - - -<%! - private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } -%> diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_chart.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_chart.jsp deleted file mode 100644 index 959adc230..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_chart.jsp +++ /dev/null @@ -1,1335 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> -<%-- - Name: wizard_chart.jsp - Use : This JSP is invoked when chart tab is selected. This is used for creating chart configuration for the report. - - Change Log - ========== - - 12-Aug-2009 : Version 8.5 (Sundar); -
      -
    • For Line Chart Category can be configured. For this UI is added.
    • -
    • Line Chart can be displayed as 3D or 2D.
    • -
    - 29-Jun-2009 : Version 8.4 (Sundar); -
      -
    • For Bar Chart Last Series/Category can be configured as Line Chart or Bar Chart. For this UI is added.
    • -
    • UI options for compare to prev year chart has been added.
    • -
    - - 23-Jun-2009 : Version 8.4 (Sundar); -
      -
    • Hiding/ Unhiding parameters based on chart type is checked throughly and missing elements were added.
    • -
    • Table width is made 100% for special input parameters
    • -
    - - 22-Jun-2009 : Version 8.4 (Sundar); - -
      -
    • Calendar JS and CSS were added to this page as it is used in customizable input parameters for Time Difference Chart.
    • -
    • JS method and configurable input parameters were added for Multiple Pie Chart, Bar Chart 3D, Pareto, Time Difference Chart and Multiple - Time Series Chart.
    • -
    ---%> -<%@page import="org.openecomp.portalsdk.analytics.model.runtime.FormField"%> -<%@page import="org.openecomp.portalsdk.analytics.model.runtime.ReportFormFields"%> -<%@page import="org.openecomp.portalsdk.analytics.model.runtime.ReportRuntime"%> -<%@page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue"%> -<%@page import="org.openecomp.portalsdk.analytics.model.DataCache"%> -<%@page import="org.openecomp.portalsdk.analytics.model.ReportHandler"%> -<%@page import="java.util.Vector"%> -<%@ page import="java.util.List" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.Reports"%> - -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB); - boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED) || rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED_DATAMIN); - - String legendColId = null; - String valueColId = null; - - //String firstColId = null; - //String firstNumColId = null; - - List reportCols = rdef.getAllColumns(); - List chartValueCols = rdef.getChartValueColumnsList(AppConstants.CHART_ALL_COLUMNS, null); - - ArrayList unusedNumCols = new ArrayList(reportCols.size()); - int numColsCount = 0; - for(Iterator iter=reportCols.iterator(); iter.hasNext(); ) { - DataColumnType dct = (DataColumnType) iter.next(); - - if(nvl(dct.getColOnChart()).equals(AppConstants.GC_LEGEND)) - legendColId = dct.getColId(); - - if(isSQLBased||nvl(dct.getColType()).equals(AppConstants.CT_NUMBER)) { - numColsCount++; - if(nvl(dct.getColOnChart()).length()==0) //dct.getChartSeq()<0) - unusedNumCols.add(dct); - } // if - -/* if(dct.getChartSeq()>0) - valueColId = dct.getColId(); - - if(firstColId==null) - firstColId = dct.getColId(); - if(firstNumColId==null) - if(isSQLBased) - firstNumColId = dct.getColId(); - else - if(nvl(dct.getColType()).equals(AppConstants.CT_NUMBER)) - firstNumColId = dct.getColId();*/ - } // for - - String chartType = nvl(rdef.getChartType()); %> - - - - - - - - -
    - - - - - - -<% if(numColsCount==0) { %> - - - - - - - -<% } else { %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<% if(chartValueCols.size()==0) { %> - - - - - -<% } else { - int count = 1; - String colIdx = ""; - for(Iterator iterV=chartValueCols.iterator(); iterV.hasNext(); count++) { - colIdx = ""; - DataColumnType dctV = (DataColumnType) iterV.next(); - colIdx = dctV.getColId(); - int colAxisIdx = 0; - boolean newChart = false; - try { - colAxisIdx = Integer.parseInt(dctV.getColOnChart()); - } catch(Exception e) {} - newChart = (dctV.isCreateInNewChart()!=null)?dctV.isCreateInNewChart().booleanValue():false; - %> - - - - - - - - -<% } // for - } // else (chartValueCols.size()==0) - if(unusedNumCols.size()>0) { %> - - - - - - -<% } // if(unusedNumCols.size()==0) - if(chartValueCols.size()>1 || rdef.hasSeriesColumn()) { %> - - - - - - - - -<% } // if(chartValueCols.size()>1) -%> - - - - - - - -<%! - private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } -%> - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_log.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_log.jsp deleted file mode 100644 index 2b1703852..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_log.jsp +++ /dev/null @@ -1,109 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.List" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %> -<%@ page import="java.util.Vector" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.ReportLoader" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.ReportWrapper" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.FormField" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.Log" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportLogEntry" %> -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - String curSubStep = ws.getCurrentSubStep(); - String reportID = rdef.getReportID(); - boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB); - boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED); - -%> - -<% String errorMsg = null; - Vector reportLogEntries = null; - try { - reportLogEntries = ReportLoader.loadReportLogEntries(reportID); - } catch(Exception e) { - Log.write("ERROR [wizard_log.jsp] Unable to load report log entries. Exception: "+e.getMessage()); - errorMsg = "ERROR: Unable to load report log entries from the database "; - } %> - -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %>
    No numeric columns found - chart not available
    - - - - - - -
    Chart Type: - - > -  Do NOT allow user to change chart type at runtime -
    -
    Chart Width (px): - " size="10" maxlength="4">
    Chart Height (px): - " size="10" maxlength="4">
    Domain Axis: -
    Category: -
    last Category display As Line Chart - - > -
    last Category display As Bar Chart - - > -
    Multi Series - 0? (AppUtils.getRequestNvlValue(request, "multiSeries").equals("Y")? " checked ":""): (rdef.isMultiSeries() ? " checked ":" checked ")) %>>Yes - 0? (AppUtils.getRequestNvlValue(request, "multiSeries").equals("N")? " checked ":""): (!rdef.isMultiSeries() ? " checked":"")) %>>No -
    Range Axis: - - <% String sValue = ""; %> - -
    Range Axis <%= count %>: - - <% if(count>1) { %> -   - - <% } %> -   - - <% - String chartGroupOrg = dctV.getChartGroup(); - String yAxisGroup = dctV.getYAxis(); - String chartGroup = (chartGroupOrg!=null && chartGroupOrg.length()>0 && chartGroupOrg.indexOf("|")!= -1)?chartGroupOrg.substring(0,chartGroupOrg.lastIndexOf("|")):""; - String yAxis = (yAxisGroup!=null && yAxisGroup.length()>0 && yAxisGroup.indexOf("|")!= -1)?yAxisGroup.substring(0,yAxisGroup.lastIndexOf("|")):""; - %> -
    - Chart Title:"/> - YAxis:"/> -
    - -
    - <% String sValue = nvl(dctV.getChartColor()); %> - - - <% if(count>1) { %> -
    - > -  Create in New Chart -
    - 0)?" checked":"" %>> -  Use secondary axis (Line chart only) - <% } %> -  
    Add Values Column: - - - <% String sValue = ""; %> - - - -  Use secondary axis (Line chart only) -
    Primary Axis Label: - -  (Multi-series Chart Only)
    Secondary Axis Label: - -  (Multi-series Chart Only)
      - Note: Some chart types (like Pie) will only display Series 1 Values.
    - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - -<% int iCount = 0; - if(reportLogEntries!=null) - for(Iterator iter=reportLogEntries.iterator(); iter.hasNext(); iCount++) { - ReportLogEntry logEntry = (ReportLogEntry) iter.next(); %> - > - - - - - - - - -<% } // for - if(errorMsg!=null) { %> - - - -<% } else if(iCount==0) { %> - - - -<% } else { %> - - - -<% } // if -%> -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %>
      No  Date/TimeUser NameActionExecution TimeRun
    <%= iCount+1 %><%= logEntry.getLogTime() %><%= logEntry.getUserName() %><%= logEntry.getAction() %><%= logEntry.getTimeTaken() %><%= logEntry.getRunIcon() %>
    <%= errorMsg %>
    No log entries found
    - -
    -
    - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_map.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_map.jsp deleted file mode 100644 index 50fe1da68..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_map.jsp +++ /dev/null @@ -1,424 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.List" %> -<%@ page import="java.util.Iterator" %> -<%@page import="org.openecomp.portalsdk.analytics.xmlobj.ReportMap"%> -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB); - boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED); - ReportMap repMap = rdef.getReportMap(); - String addressColumn = ""; - String latColumn = ""; - String longColumn = ""; - String legendColumn = ""; - String colorColumn = ""; - String dataColumn = ""; - String isMapAllowed = ""; - String addAddress = "N"; - String useDefaultSize = ""; - String width = ""; - String height = ""; - - int reportMapSize = 0; - if (repMap != null){ - if (repMap.getAddressColumn() != null) - addressColumn = repMap.getAddressColumn(); - - if (repMap.getDataColumn() != null) - dataColumn = repMap.getDataColumn(); - if (repMap.getIsMapAllowedYN() != null) - isMapAllowed = repMap.getIsMapAllowedYN(); - if (repMap.getAddAddressInDataYN() != null) - addAddress = repMap.getAddAddressInDataYN(); - if (repMap.getLatColumn() != null) - latColumn = repMap.getLatColumn(); - if (repMap.getLongColumn() != null) - longColumn = repMap.getLongColumn(); - if (repMap.getColorColumn() != null) - colorColumn = repMap.getColorColumn(); - if (repMap.getLegendColumn() != null) - legendColumn = repMap.getLegendColumn(); - if (repMap.getUseDefaultSize() != null) - useDefaultSize = repMap.getUseDefaultSize(); - if (repMap.getHeight() != null) - height = repMap.getHeight(); - if (repMap.getWidth() != null) - width = repMap.getWidth(); - - reportMapSize = repMap.getMarkers().size(); - } - -%> -<%@page import="org.openecomp.portalsdk.analytics.xmlobj.Marker"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<% for (int i = 1; repMap != null && i < repMap.getMarkers().size(); i ++){ - Marker marker = (Marker) repMap.getMarkers().get(i); -%> - - - - - - - - - - <%}%> - - - -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %>
    Map Enabled ? - checked <%} %>/> -
    Default Size ? - checked <%} %>/> - Height - - - - Width - -  
    Lat Column - - - - Long Column - - - - Color Column - - - - Legend Column - - - -
      - -
    Data Header - - Display Column - - - - - Remove -  
    -
    - - - - - - -<%! - private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } -%> diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_run.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_run.jsp deleted file mode 100644 index 688e7ff74..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_run.jsp +++ /dev/null @@ -1,74 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.List" %> -<%@ page import="java.util.Iterator" %> -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); -%> - - - - - - - - - -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %>
    - - - - - - - - - - -
    - - SQL Click here to view the generated SQL  - -
    - - Report definition successfully completed.
    -
    - - - Run -
    -
     
    -
    -
    - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule.jsp deleted file mode 100644 index b8d1ad1ca..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule.jsp +++ /dev/null @@ -1,376 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.Vector" %> -<%@ page import="java.util.List" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataSourceType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.DBColumnInfo" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableSource" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.SemaphoreType" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportSchedule" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %> - -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - ReportSchedule reportSchedule = rdef.getReportSchedule(); - String remoteDbPrefix = (String) session.getAttribute("remoteDB"); - boolean isSQLAllowed = Globals.getAllowSQLBasedReports(); - -%> -<%@page import="java.util.Calendar"%> -<%@page import="java.text.DateFormat"%> -<%@page import="java.text.SimpleDateFormat"%> -<%@page import="java.util.TimeZone"%> -<%@page import="java.util.Date"%> -<%@page import="org.openecomp.portalsdk.analytics.model.ReportLoader"%> - - - - - - - <% - Calendar startCalendarDate = Calendar.getInstance(); - startCalendarDate.add(Calendar.DAY_OF_MONTH, - 540); - Calendar endCalendarDate = Calendar.getInstance(); - endCalendarDate.add(Calendar.DAY_OF_MONTH, 540); - SimpleDateFormat dtf = new SimpleDateFormat("MM/dd/yyyy"); - SimpleDateFormat oracleDateFormat = new SimpleDateFormat("MM/dd/yyyy kk:mm:ss"); - Date sysdate = oracleDateFormat.parse(ReportLoader.getSystemDateTime()); - SimpleDateFormat dtimestamp = new SimpleDateFormat(Globals.getScheduleDatePattern()); - //dtimestamp.setTimeZone(TimeZone.getTimeZone(Globals.getTimeZone())); - - - - - %> - - - - <% if(request.getAttribute("schedule_only")!=null) { %> - - - - <% } %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <% if(AppUtils.isAdminUser(request) || isSQLAllowed ) { %> - - - - - - - - - <% } %> - - - - - - - - - -<% List emailToUsers = reportSchedule.getEmailToUsers(); - for(int i=0; i - - - - -<% } // for - List emailToRoles = reportSchedule.getEmailToRoles(); - for(int i=0; i - - - - -<% } // for - - Vector remainingUsers = Utils.getUsersNotInList(emailToUsers,request); - Vector remainingRoles = Utils.getRolesNotInList(emailToRoles,request); - if((emailToUsers.size()+emailToRoles.size()==0)||(remainingUsers.size()>0)||(remainingRoles.size()>0)) { %> - - - - -<% } // if -%> -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %>
    Please enter Time in <%= Globals.getTimeZone()%>. The Current System Time is <%=dtimestamp.format(sysdate)%> <%=Globals.getTimeZone()%>
    -
    -

    Quick Help: -

    -
    -
    Schedule Emails: - />Yes -   - />No -
    Email Attachment: - - />PDF Attachment -    - />Excel Attachment - - -
    Recurrence: -
    Start Date: - - - -       - - - - -
    End Date: - - - -
    Use Condition: - > Send Emails Only When Condition Is Met -
    Condition SQL:SELECT 1 FROM DUAL WHERE EXISTS (
    - - ) -      - -   -
    Max rows in attachment: - -
    <%= (i==0)?"Email To: ":" " %> - <%= userValue.getName() %> -       - -
    <%= (emailToUsers.size()==0&&i==0)?"Email To: ":" " %>Everyone With Role:  - <%= roleValue.getName() %> -       - -
    <%= (emailToUsers.size()+emailToRoles.size()==0)?"Email To: ":" " %> -<% if(remainingUsers.size()>0) { %> - -<% } else { %> - No user emails available -<% } %> -       -<% if(remainingRoles.size()>0) { %> - -<% } else { %> - No roles available -<% } %> -
    -
    - - - -<%! - private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } -%> diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_formfield_include.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_formfield_include.jsp deleted file mode 100644 index 206e23de1..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_formfield_include.jsp +++ /dev/null @@ -1,754 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> -<%-- - Name: wizard_schedule_formfield_include.jsp - Use : Shows formfield of the report in the schedule page. - - Change Log - ========== - - 28-Aug-2009 : Version 8.5.1 (Sundar); Checkbox and Radio button are also handled. - 18-Aug-2009 : Version 8.5.1 (Sundar); - - a) ajax.js is loaded in startup for AJAX functionality. - b) showArgPopupNew is modified as per report_form.jsp - c) Ajax function is added very similiar to report_form.jsp - d) "auto" bug is resolved. - -14-Jul-2009 : Version 8.4 (Sundar); - -
      -
    • Shows the form field of the first Dashboard report in schedule page if the report is dashboard.
    • -
    ---%> -<%@ page import="java.io.*" %> -<%@ page import="java.util.*" %> -<%@ page import="java.text.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.ReportHandler" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.JavascriptItemType"%> -<%@ page import="java.util.regex.*"%> -<%@ page import="javax.servlet.http.*"%> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportSchedule" %> - - -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - ReportHandler rh = new ReportHandler(); - ReportRuntime rr = rh.loadReportRuntime(request, rdef.getReportID()); - request.getSession().setAttribute(AppConstants.SI_REPORT_RUNTIME, rr); - boolean isDashboard = rr.isDashboardType(); - ReportFormFields rff = rr.getReportFormFields(); - ReportFormFields rff1 = (ReportFormFields) rff.clone(); - ReportFormFields rff2 = (ReportFormFields) rff.clone(); - ReportFormFields rff5 = (ReportFormFields) rff.clone(); - boolean isFirstTime = nvl(request.getParameter("refresh")).toUpperCase().startsWith("Y"); - ReportSchedule reportSchedule = (ReportSchedule) request.getSession().getAttribute(AppConstants.SI_REPORT_SCHEDULE); - - int dashboardFlag = 0; - ReportRuntime rr1 = null; - java.text.SimpleDateFormat sdf = null; - -%> - - - -<%--=(rr.getJavascriptElement()!=null && rr.getJavascriptElement().length()>0)?rr.getJavascriptElement().replaceAll("formd","forma"):""--%> - - <% - if(rr.getReportType().equals(AppConstants.RT_DASHBOARD)) { - dashboardFlag = 1; - String strHTML = rr.getDashboardLayoutHTML(); //getdashboardLayoutHTML(); - String rep_id = parseAndGetFirstReportID(strHTML); - ReportHandler rh1 = new ReportHandler(); - rr1 = null; - int requestFlag = 1; - try { - rr1 = rh1.loadReportRuntime(request, rep_id, true, requestFlag); - } catch(Exception e) { - } - rff = rr1.getReportFormFields(); - } - %> - <%if((dashboardFlag == 0 && rr.needFormInput()) || (dashboardFlag == 1 && rr1.needFormInput())) { %> - - - - Please input values into the Form Fields for email attachment. Note those fields user must provide value can not leave as blank. - - - <% - int colidx = 0; - java.util.HashMap paramsMap = Globals.getRequestParamtersMap(request, false); - java.util.HashMap getScheduleMap = getFormFieldsHashMap (request, reportSchedule.getFormFields()); - java.util.HashMap paramsScheduleMap = Globals.getRequestParametersMap(request, getScheduleMap); - for (int i = 0; i < rff.size(); i ++){ - FormField ff = (FormField) rff.get(i); - ff.setDbInfo(rr.getDbInfo()); - ff.setUserId(AppUtils.getUserID(request)); - if(ff.getFieldType().equals(FormField.FFT_HIDDEN)) { - %> - <% - if(nvl(reportSchedule.getFormFields()).length() <= 0) - out.println(ff.getHtml(rr.getParamValue(ff.getFieldName()), paramsMap, rr, true)); - else - out.println(ff.getHtml(getParameterString(request, ff.getFieldName(), getScheduleMap), paramsScheduleMap, rr, true).replaceAll("formd","forma")); - - - %> - <% } - if(!ff.getFieldType().equals(FormField.FFT_HIDDEN) && ff.isVisible()) { - - %> - <%if (colidx == 0){%><%}%> - - - - <%colidx++;%> - <%if (colidx == rr.getNumFormColsAsInt()){%><%colidx=0;}%> - <% } - } //for %> -
    - - <%if (!ff.getFieldType().equals(FormField.FFT_BLANK)){%> - <%= ff.getDisplayNameHtml() %>: - <%}%> - - - <%-- ff.getHtml(rr.getParamValue(ff.getFieldName()), paramsMap,rr, true).replaceAll("formd","forma") --%> - <% - if(nvl(reportSchedule.getFormFields()).length() <= 0) - out.println(ff.getHtml(rr.getParamValue(ff.getFieldName()), paramsMap, rr, true).replaceAll("formd","forma")); - else - out.println(ff.getHtml(getParameterString(request, ff.getFieldName(), getScheduleMap), paramsScheduleMap, rr, true).replaceAll("formd","forma")); - %> -
    - - -<% } //if(rr.needFormInput()) %> - - - - -<% /* if(request.getAttribute(AppConstants.RI_REPORT_DATA) == null){ */ %> - - -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } - private String getCallableJavascriptForSubmit(ReportRuntime rr) { - JavascriptItemType javascriptItemType = null; - StringBuffer callJavascriptText = new StringBuffer(""); - if(rr.getJavascriptList()!=null) { - for (Iterator iter = rr.getJavascriptList().getJavascriptItem().iterator(); iter.hasNext();) { - javascriptItemType = (JavascriptItemType)iter.next(); - if(javascriptItemType.getFieldId().equals("os1")) { - callJavascriptText.append(" "+javascriptItemType.getCallText()); - break; - } - } - } - return callJavascriptText.toString(); - } - - private HashMap getFormFieldsHashMap (HttpServletRequest request, String formFieldsString) { - String splitName[] = null; - ArrayList keyValue = new ArrayList(); - HashMap keyValueMap = new HashMap(); - String newValue = ""; - //System.out.println("Request Str "+ formFieldsString); - StringTokenizer st = null; - StringTokenizer st2 = null; - String key1 = ""; - String value = ""; - - if(formFieldsString.length() > 0) { - st = new StringTokenizer(formFieldsString, "&"); - while (st.hasMoreTokens()) { - keyValue.add(st.nextToken()); - } - if(keyValue.size() > 0) { - - for (int num = 0; num < keyValue.size(); num++) { - st2 = new StringTokenizer((String) keyValue.get(num), "="); - while(st2.hasMoreTokens()) { - key1 = ""; value = ""; - key1 = st2.nextToken(); - key1 = Utils.replaceInString(key1, "_auto", ""); - try { - value = st2.nextToken(); - }catch (NoSuchElementException ex) { value = "";} - if(!keyValueMap.containsKey(key1)) - keyValueMap.put(key1,value); - else { - String value1 = (String) keyValueMap.get(key1); - value = value+"|"+value1; - keyValueMap.put(key1,value); - } - } - } - - } - } - return keyValueMap; - } - - private String getParameterString (HttpServletRequest request, String key, HashMap keyValueMap) { - String newValue = ""; - if(keyValueMap.containsKey(key)) { - //System.out.println("VALUE IN MAP IS " +key+ " "+ (String) keyValueMap.get(key)); - newValue = XSSFilter.filterRequestOnlyScript((String) keyValueMap.get(key)); - if(nvl(newValue).length()<=0) { - newValue = XSSFilter.filterRequestOnlyScript((String) keyValueMap.get(key+"_auto")); - } - } - return newValue; - } - private String parseAndGetFirstReportID(String strHTML) { - String sourcestring = strHTML; - //System.out.println("String HTML1 " + strHTML); - Pattern re = Pattern.compile("\\[(.*?)\\]"); //\\[(.*?)\\] - Matcher m = re.matcher(sourcestring); - int mIdx = 0; - while (m.find()){ - for( int groupIdx = 0; groupIdx < m.groupCount(); groupIdx++ ){ - String str = m.group(groupIdx); - //System.out.println("REP ID1 " + str.substring(str.indexOf("#")+1, str.length()-1)) ; - return str.substring(str.indexOf("#")+1, str.length()-1); - } - mIdx++; - - }return ""; - } -%> diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_multiple.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_multiple.jsp deleted file mode 100644 index 70c9812a8..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_multiple.jsp +++ /dev/null @@ -1,157 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.xmlobj.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - -<%@ page errorPage="error_page.jsp" %> -<%! -class ValueComparator implements Comparator { - public int compare(Object o1, Object o2) { - Map.Entry e1 = (Map.Entry) o1; - Map.Entry e2 = (Map.Entry) o2; - Comparable c1 = (Comparable)e1.getValue(); - Comparable c2 = (Comparable)e2.getValue(); - return c1.compareTo(c2); - } -} -%> -<% -HashMap hashMap = ReportLoader.loadReportsToSchedule(request); -ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); -if(rdef ==null) rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION); -Set mapSet = hashMap.entrySet(); -List entrylist = new ArrayList(mapSet); -Collections.sort(entrylist, new ValueComparator()); -Map.Entry me; -session.removeAttribute(AppConstants.SI_REPORT_SCHEDULE); -session.removeAttribute(AppConstants.SI_REPORT_DEFINITION); -ReportSchedule reportSchedule = (ReportSchedule) session.getAttribute(AppConstants.SI_REPORT_SCHEDULE); -%> - - - - - - -


    -<% if (rdef == null || request.getSession().getAttribute(AppConstants.SI_REPORT_SCHEDULE) == null) {%> - -
    - - - - - - - - -
    - - - - - - <% if(request.getAttribute("message")!=null) { %> - - - - <% } %> -
    <%= "Scheduling Report" %>
    <%= (String) request.getAttribute("message") %>
    -
    Reports: - <% if (rdef !=null && request.getSession().getAttribute(AppConstants.SI_REPORT_SCHEDULE) != null ) {%> - <%= rdef.getReportName()%> - <% } else { %> - - <% } %> - -
    -
    -<% } %> -<% if(reportSchedule!=null) { %> - -<% } %> - - - - - -<%----%> - -<%! private String HTMLEncode(String value) { - StringBuffer sb = new StringBuffer(value); - - for(int i=0; i') - sb.replace(i, i+1, ">"); - else if(sb.charAt(i)=='"') - sb.replace(i, i+1, """); - - return sb.toString(); - } // HTMLEncode - - private String clearSpaces(String value) { - StringBuffer sb = new StringBuffer(value); - - for(int i=0; i - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_only.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_only.jsp deleted file mode 100644 index ad3c612ee..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_only.jsp +++ /dev/null @@ -1,172 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.xmlobj.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - -<%@ page errorPage="error_page.jsp" %> - - - -<% ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION); - - String reportID = rdef.getReportID(); - - - - String dbInfo = null; - dbInfo = rdef.getDBInfo(); - int sessionflag = 0; - if(dbInfo == null || dbInfo.length() == 0) { - dbInfo = (String) session.getAttribute("remoteDB"); - sessionflag = 1; - } - session.setAttribute("remoteDB", dbInfo); - if((dbInfo == null) && (request.getParameter("dataSource")!=null)) - session.setAttribute("remoteDB", request.getParameter("dataSource")); - - StringBuffer title = new StringBuffer(""); - title.append(Globals.getBaseTitle()+" > "+(reportID.equals("-1")?"Create Report":"Schedule Report")); - title.append(" > "+rdef.getReportName()); - - boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB); - boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED); -%> - -<% - request.setAttribute(AppConstants.SI_REPORT_DEFINITION,rdef); -%> - - - - - - - - - - - - -
    - -
    -
    -
    -
    - - - - - - - - - - - -
    - - - - - <% if(request.getAttribute("message")!=null) { %> - - - - <% } %> -
    <%= title.toString() %>
    <%= (String) request.getAttribute("message") %>
    -
    - -
    - - - - - -
    -   - - - <%----%> - -
    -
    -
    - - -
    -
    -<%----%> - -<%! private String HTMLEncode(String value) { - StringBuffer sb = new StringBuffer(value); - - for(int i=0; i') - sb.replace(i, i+1, ">"); - else if(sb.charAt(i)=='"') - sb.replace(i, i+1, """); - - return sb.toString(); - } // HTMLEncode - - private String clearSpaces(String value) { - StringBuffer sb = new StringBuffer(value); - - for(int i=0; i - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_only_from_search.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_only_from_search.jsp deleted file mode 100644 index af951cc23..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_schedule_only_from_search.jsp +++ /dev/null @@ -1,173 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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="org.openecomp.portalsdk.analytics.xmlobj.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> - -<%@ page errorPage="error_page.jsp" %> - - - -<% ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION); - - String reportID = rdef.getReportID(); - - - - String dbInfo = null; - dbInfo = rdef.getDBInfo(); - int sessionflag = 0; - if(dbInfo == null || dbInfo.length() == 0) { - dbInfo = (String) session.getAttribute("remoteDB"); - sessionflag = 1; - } - session.setAttribute("remoteDB", dbInfo); - if((dbInfo == null) && (request.getParameter("dataSource")!=null)) - session.setAttribute("remoteDB", request.getParameter("dataSource")); - - StringBuffer title = new StringBuffer(""); - title.append(Globals.getBaseTitle()+" > "+(reportID.equals("-1")?"Create Report":"Schedule Report")); - title.append(" > "+rdef.getReportName()); - - boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB); - boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED); -%> - -<% - request.setAttribute(AppConstants.SI_REPORT_DEFINITION,rdef); -%> - - - - - - - - - - - - -
    - -
    -
    -
    -
    - - - - - - - - - - - -
    - - <% if(request.getAttribute("message")!=null) { %> - - - - <% } %> - - - - -
    <%= (String) request.getAttribute("message") %>
    <%= title.toString() %>
    -
    - -
    - - - - - -
    -   - - - <%----%> - -
    -
    -
    - - -
    -
    -<%----%> - -<%! private String HTMLEncode(String value) { - StringBuffer sb = new StringBuffer(value); - - for(int i=0; i') - sb.replace(i, i+1, ">"); - else if(sb.charAt(i)=='"') - sb.replace(i, i+1, """); - - return sb.toString(); - } // HTMLEncode - - private String clearSpaces(String value) { - StringBuffer sb = new StringBuffer(value); - - for(int i=0; i - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_edit.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_edit.jsp deleted file mode 100644 index 18c450ba9..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_edit.jsp +++ /dev/null @@ -1,86 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.List" %> -<%@ page import="java.util.Iterator" %> -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - String curSubStep = ws.getCurrentSubStep(); - boolean isEdit = curSubStep.equals(AppConstants.WSS_EDIT); - DataColumnType currColumn = null; - if(isEdit) - currColumn = rdef.getColumnById(AppUtils.getRequestNvlValue(request, AppConstants.RI_DETAIL_ID)); %> - - - - - - - - - - - - - -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %><%= curSubStep.equals(AppConstants.WSS_EDIT)?"Edit Sorting":(curSubStep.equals(AppConstants.WSS_ADD)?"Add Sorting":"") %>
    - Sort By Column: - - <% if(isEdit) { %> - <%= currColumn.getDisplayName() %> - <% } else { %> - - <% } // else - %> -
    Sort Type: - -
    -
    - - - -<%! - private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } -%> diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_list.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_list.jsp deleted file mode 100644 index 63bf9cd32..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_list.jsp +++ /dev/null @@ -1,116 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.List" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %> -<%@ page import="java.util.Vector" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.ReportLoader" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.ReportWrapper" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.FormField" %> -<%@ page import="java.util.Collections" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.OrderSeqComparator" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.OrderBySeqComparator" %> - -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - String curSubStep = ws.getCurrentSubStep(); - String reportID = rdef.getReportID(); - boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB); - boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED); - List reportCols = rdef.getAllColumns(); - Collections.sort(reportCols, new OrderSeqComparator()); - int numSortCols = rdef.getNumSortColumns(); %> - - - - - - - - - - - -<% int iCount = 0; - Collections.sort(reportCols,new OrderBySeqComparator()); - for(Iterator iter=reportCols.iterator(); iter.hasNext(); ) { - DataColumnType dct = (DataColumnType) iter.next(); - if(dct.getOrderBySeq()>0) { %> - > - - - - - - - -<% - iCount++; - } // if - } // for - Collections.sort(reportCols, new OrderSeqComparator()); -%> -<% if(numSortCols==0) { %> - - - -<% } %> -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %>
    Sort OrderSort By ColumnSort TypeRe-order - <% if(numSortCols - - -
    - <% } %> - - <% if(numSortCols -
    - <% } %> -
    <%= iCount+1 %><%= dct.getDisplayName() %><%= dct.getOrderByAscDesc().equals(AppConstants.SO_ASC)?"Ascending":"Descending" %> -<% if(iCount==0) { %> - -<% } else { %> - -<% } %> -<% if(iCount==numSortCols-1) { %> - -<% } else { %> - -<% } %> -
    No sorting defined
    -
    - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_order_all.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_order_all.jsp deleted file mode 100644 index 9e04f2b84..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sorting_order_all.jsp +++ /dev/null @@ -1,112 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.List" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %> -<%@ page import="java.util.Vector" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.ReportLoader" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.ReportWrapper" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.FormField" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.OrderBySeqComparator" %> -<%@ page import="java.util.Collections" %> -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - String curSubStep = ws.getCurrentSubStep(); - String reportID = rdef.getReportID(); - boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB); - boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED); - -%> - - - - - - - - - - -<% int icnt = 0; - for(Iterator iter=rdef.getAllColumns().iterator(); iter.hasNext(); icnt++) { - DataColumnType dct = (DataColumnType) iter.next(); %> - > - - - - - -<% } // for -%> -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %> - <%= curSubStep %>
      No  ColumnSort OrderSort Type
    <%= icnt+1 %><%= dct.getDisplayName() %> - - "> - - -
    - - -
    - - - -<%! - private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } -%> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sql_def.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sql_def.jsp deleted file mode 100644 index d8152c05f..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_sql_def.jsp +++ /dev/null @@ -1,226 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.List" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %> -<%@ page import="java.util.Vector" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.ReportLoader" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.ReportWrapper" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.FormField" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.OrderBySeqComparator" %> -<%@ page import="java.util.Collections" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableSource" %> -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - String curSubStep = ws.getCurrentSubStep(); - String reportID = rdef.getReportID(); - boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB); - boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED); - -%> - - - - - - - - - - - - - - - - - -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %>
    -  Report SQL:
    - <% boolean sqlValidated = (nvl(AppUtils.getRequestValue(request, "sqlValidated"), nvl(rdef.getReportSQL())).length()>0); - if(request.getAttribute(AppConstants.RI_ERROR_LIST)!=null) - sqlValidated = false; - - String sql = nvl(rdef.getReportSQL(), "SELECT "); - if(! sqlValidated) - sql = nvl(AppUtils.getRequestValue(request, "reportSQL"), sql); %> - "> -   -
    -  Keyword Assistance
    - -       SELECT  DISTINCT 
    -       FROM 
    -       WHERE 
    -       GROUP BY 
    -       HAVING 
    -       ORDER BY  ASC  DESC 
    -
    -       UNION  ALL  INTERSECT  MINUS 
    -
    -       AND  OR  NOT  EXISTS 
    -       IS  NULL  IN  BETWEEN 
    -
    -       COUNT(  SUM(  AVG(  MAX(  MIN( 
    -
    -       NVL(  DECODE(  SYSDATE 
    -       TO_CHAR(  TO_NUMBER(  TO_DATE( 
    -       TRUNC(  ROUND(  ABS( 
    -       SUBSTR(  REPLACE(  LOWER(  UPPER( 
    -       LTRIM(  RTRIM(  LPAD(  RPAD( 
    -
    -
    - - -   - -   - -   - -
    You need to click the "Validate SQL" button in order to store the SQL before going forward
    -
    - - - -<%! - private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } -%> diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_tables_edit.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_tables_edit.jsp deleted file mode 100644 index 88ecda311..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_tables_edit.jsp +++ /dev/null @@ -1,369 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.Vector" %> -<%@ page import="java.util.List" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataSourceType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.DBColumnInfo" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableSource" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.SemaphoreType" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableJoin" %> -<%@ page import="org.openecomp.portalsdk.analytics.error.UserDefinedException"%> - -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - String curSubStep = ws.getCurrentSubStep(); - boolean isEdit = curSubStep.equals(AppConstants.WSS_EDIT); - DataSourceType currTable = null; - if(isEdit) - currTable = rdef.getTableById(AppUtils.getRequestNvlValue(request, AppConstants.RI_DETAIL_ID)); - Vector reportTableSources = (isEdit)?DataCache.getReportTableSources((String) session.getAttribute("remoteDB")):DataCache.getReportTableSources(AppUtils.getUserRoles(request),((String) session.getAttribute("remoteDB")), AppUtils.getUserID(request), request); - if(reportTableSources.size()<=0) { - request.setAttribute(AppConstants.RI_EXCEPTION, new Exception("Please add table name to the raptor table for generating report")); - throw new UserDefinedException("Please add table name to the raptor table for generating report"); - } - Vector reportTableJoins = (isEdit)?DataCache.getReportTableJoins():DataCache.getReportTableJoins(AppUtils.getUserRoles(request)); %> - -<% if(! isEdit) { %> - -<% } %> - - - - - - - - - - - - - - - -<% if(rdef.getDataSourceList().getDataSource().size()>(isEdit?1:0)) { - String outerJoinType = (isEdit?rdef.getOuterJoinType(currTable):""); %> - - - - - - - - - - <% if(isEdit) { %> - - <%} %> - - - - - -<% } %> -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %> - <%= curSubStep %>
    Table Name - <% if(isEdit) { - String tName = null; - for(int i=0; i - <%= nvl(tName, currTable.getTableName()) %> - - <% } else { %> - - <% } %> - -
    Display Name -
    Join To Table - <% if(isEdit) { %> - <% if(currTable.getRefTableId()==null){%> - --- Table Not Joined --- - <%} else { %> - <%=rdef.getTableById(currTable.getRefTableId()).getDisplayName() %> -
    on : <%=currTable.getRefDefinition() %> - <%} %> - - - <% } else { %> - - <% } %> -
    All availabe Join Options - -
    Join Type - -
    -
    - - - -<%! - private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } -%> diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_tables_list.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_tables_list.jsp deleted file mode 100644 index 47fd435ff..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_tables_list.jsp +++ /dev/null @@ -1,85 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.Vector" %> -<%@ page import="java.util.List" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataSourceType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.DBColumnInfo" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableSource" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.SemaphoreType" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableJoin" %> - -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - String curSubStep = ws.getCurrentSubStep(); -%> - - - - - - - - - -<% int iCount = 0; - for(Iterator iter=rdef.getDataSourceList().getDataSource().iterator(); iter.hasNext(); iCount++) { - DataSourceType dst = (DataSourceType) iter.next(); %> - > - - - - - -<% } %> -<% if(iCount==0) { %> - - - -<% } %> -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %>
      No  Table
    <%= iCount+1 %><%= nvl(dst.getDisplayName()).length()>0?dst.getDisplayName():dst.getTableName()%>
    No tables defined
    -
    - - - -<%! private String nvl(String s) { return (s==null)?"":s; } - private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } -%> - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_user_access.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_user_access.jsp deleted file mode 100644 index b5c68045f..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/wizard_user_access.jsp +++ /dev/null @@ -1,184 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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.analytics.xmlobj.DataColumnType" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> -<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> -<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> -<%@ page import="java.util.Vector" %> -<%@ page import="java.util.List" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataSourceType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.DBColumnInfo" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableSource" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.SemaphoreType" %> -<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.TableJoin" %> -<%@ page import="org.openecomp.portalsdk.analytics.model.definition.SecurityEntry" %> -<%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %> - -<% - ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); - WizardSequence ws = rdef.getWizardSequence(); - String curSubStep = ws.getCurrentSubStep(); -%> - - - - - - - - - - - - - - - - - - - - - - -
    Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %>
    Created By: <%= AppUtils.getUserName(rdef.getCreateID()) %>Created Date: <%= rdef.getCreateDate() %>
    Last Updated By: <%= AppUtils.getUserName(rdef.getUpdateID()) %>Last Updated: <%= rdef.getUpdateDate() %>
    Report Owner: - - Public? (All users can run the report) - -
    -
    - - - - - - - - - - - - -<% int iCount = 0; - Vector reportUsers = rdef.getReportUsers(request); - for(Iterator iter=reportUsers.iterator(); iter.hasNext(); iCount++) { - SecurityEntry rUser = (SecurityEntry) iter.next(); %> - "> - - - - - - -<% } // for -// if(iCount==0) { %> - -<% //} - Vector remainingUsers = Utils.getUsersNotInList(reportUsers,request); - if(remainingUsers.size()>0) { %> - - -<% } // if -%> - -
    Report Users
      No  User NameRun AccessEdit AccessRemove
    <%= iCount+1 %><%= rUser.getName() %>" alt="<%= rUser.isReadOnly()?"Grant":"Revoke" %> edit access" width="16" height="16" border="0" onClick="document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= rUser.isReadOnly()?AppConstants.WA_GRANT_USER:AppConstants.WA_REVOKE_USER %>'; document.forma.<%= AppConstants.RI_DETAIL_ID %>.value='<%= rUser.getId() %>';">
    Grant Access To  - -
    -
    - - - - - - - - - - - - -<% iCount = 0; - Vector reportRoles = rdef.getReportRoles(request); - for(Iterator iter=reportRoles.iterator(); iter.hasNext(); iCount++) { - SecurityEntry rRole = (SecurityEntry) iter.next(); %> - "> - - - - - - -<% } // for -// if(iCount==0) { %> - -<% //} - Vector remainingRoles = Utils.getRolesNotInList(reportRoles,request); - if(remainingRoles.size()>0) { %> - - -<% } // if -%> - -
    Report Roles
      No  Role NameRun AccessEdit AccessRemove
    <%= iCount+1 %><%= rRole.getName() %>" alt="<%= rRole.isReadOnly()?"Grant":"Revoke" %> edit access" width="16" height="16" border="0" onClick="document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= rRole.isReadOnly()?AppConstants.WA_GRANT_ROLE:AppConstants.WA_REVOKE_ROLE %>'; document.forma.<%= AppConstants.RI_DETAIL_ID %>.value='<%= rRole.getId() %>';">
    Grant Access To  - -
    -
    - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/error.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/error.jsp deleted file mode 100644 index 2a48507c9..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/error.jsp +++ /dev/null @@ -1,20 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/jsp/leafletMap.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/leafletMap.jsp deleted file mode 100644 index 77981f736..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/leafletMap.jsp +++ /dev/null @@ -1,288 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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. - ================================================================================ - --%> - - - - - - - - - - - - - - - - - - -
    - - -
    - - - - - - - - - -
    SiteUsage
    - - - - - - - - - -
    LinkUsage
    -
    - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/login_external.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/login_external.jsp deleted file mode 100644 index b4e3c0932..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/login_external.jsp +++ /dev/null @@ -1,154 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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" %> - -" /> - - - - - - - Login - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    -
    - -

    ECOMP Portal

    - - -
    -
    - - -
    -
    -                - -
    -
    -
    -






    - -
    - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/net_map.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/net_map.jsp deleted file mode 100644 index 2a341467f..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/net_map.jsp +++ /dev/null @@ -1,38 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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-sdk-app/src/main/webapp/WEB-INF/jsp/user_profile.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/user_profile.jsp deleted file mode 100644 index cb5c4e3bf..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/user_profile.jsp +++ /dev/null @@ -1,84 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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 NameEmailOrgUserIdManager OrgUserId
    {{rowData.id}}{{rowData.last_name}}{{rowData.first_name}}{{rowData.email}}{{rowData.orgUserId}}{{rowData.org_manager_userid}}
    -
    -
    -
    - Rows Per Page: - -
    -
    - Current Page: - -
    -
    - Total Page(s): - -
    -
    - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/welcome.jsp b/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/welcome.jsp deleted file mode 100644 index d7d3b8967..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/jsp/welcome.jsp +++ /dev/null @@ -1,629 +0,0 @@ -<%-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T 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}) -
    - -
    -
    -
    -
    -
    - -
    - - - - -
    - -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    - -
    - - -
    -
    - -
    - -
    -
    -
      -
    • {{Daytab.title}}
    • -
    -
    -
    -
    - - - - - - - -
    -
    - -
    -
    -
      -
    • {{TrafficTab.title}}
    • -
    -
    -
    -
    - - - - - -
    -
    - -
    - - - - - - - - - - - - - - - - - - -
    JQuery - -
    Animated Map - -
    Chat Session - -
    -
    -
    -
    -
    - -
    - - - - - - - - - -
    - -
    - - -
    - -
    -
    -
    -
    - -
    - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/WEB-INF/web.xml b/ecomp-sdk-app/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 32cfa88ec..000000000 --- a/ecomp-sdk-app/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - ecomp-sdk-app - - - - - FileManagerServlet - org.openecomp.policy.admin.PolicyManagerServlet - - - FileManagerServlet - /fm/* - - - 7 - COOKIE - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-animate.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-animate.js deleted file mode 100644 index 2778fc564..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-animate.js +++ /dev/null @@ -1,4121 +0,0 @@ -/** - * @license AngularJS v1.5.0 - * (c) 2010-2016 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular, undefined) {'use strict'; - -/* jshint ignore:start */ -var noop = angular.noop; -var copy = angular.copy; -var extend = angular.extend; -var jqLite = angular.element; -var forEach = angular.forEach; -var isArray = angular.isArray; -var isString = angular.isString; -var isObject = angular.isObject; -var isUndefined = angular.isUndefined; -var isDefined = angular.isDefined; -var isFunction = angular.isFunction; -var isElement = angular.isElement; - -var ELEMENT_NODE = 1; -var COMMENT_NODE = 8; - -var ADD_CLASS_SUFFIX = '-add'; -var REMOVE_CLASS_SUFFIX = '-remove'; -var EVENT_CLASS_PREFIX = 'ng-'; -var ACTIVE_CLASS_SUFFIX = '-active'; -var PREPARE_CLASS_SUFFIX = '-prepare'; - -var NG_ANIMATE_CLASSNAME = 'ng-animate'; -var NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren'; - -// Detect proper transitionend/animationend event names. -var CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT; - -// If unprefixed events are not supported but webkit-prefixed are, use the latter. -// Otherwise, just use W3C names, browsers not supporting them at all will just ignore them. -// Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend` -// but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`. -// Register both events in case `window.onanimationend` is not supported because of that, -// do the same for `transitionend` as Safari is likely to exhibit similar behavior. -// Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit -// therefore there is no reason to test anymore for other vendor prefixes: -// http://caniuse.com/#search=transition -if (isUndefined(window.ontransitionend) && isDefined(window.onwebkittransitionend)) { - CSS_PREFIX = '-webkit-'; - TRANSITION_PROP = 'WebkitTransition'; - TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend'; -} else { - TRANSITION_PROP = 'transition'; - TRANSITIONEND_EVENT = 'transitionend'; -} - -if (isUndefined(window.onanimationend) && isDefined(window.onwebkitanimationend)) { - CSS_PREFIX = '-webkit-'; - ANIMATION_PROP = 'WebkitAnimation'; - ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend'; -} else { - ANIMATION_PROP = 'animation'; - ANIMATIONEND_EVENT = 'animationend'; -} - -var DURATION_KEY = 'Duration'; -var PROPERTY_KEY = 'Property'; -var DELAY_KEY = 'Delay'; -var TIMING_KEY = 'TimingFunction'; -var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount'; -var ANIMATION_PLAYSTATE_KEY = 'PlayState'; -var SAFE_FAST_FORWARD_DURATION_VALUE = 9999; - -var ANIMATION_DELAY_PROP = ANIMATION_PROP + DELAY_KEY; -var ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY; -var TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY; -var TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY; - -var isPromiseLike = function(p) { - return p && p.then ? true : false; -}; - -var ngMinErr = angular.$$minErr('ng'); -function assertArg(arg, name, reason) { - if (!arg) { - throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required")); - } - return arg; -} - -function mergeClasses(a,b) { - if (!a && !b) return ''; - if (!a) return b; - if (!b) return a; - if (isArray(a)) a = a.join(' '); - if (isArray(b)) b = b.join(' '); - return a + ' ' + b; -} - -function packageStyles(options) { - var styles = {}; - if (options && (options.to || options.from)) { - styles.to = options.to; - styles.from = options.from; - } - return styles; -} - -function pendClasses(classes, fix, isPrefix) { - var className = ''; - classes = isArray(classes) - ? classes - : classes && isString(classes) && classes.length - ? classes.split(/\s+/) - : []; - forEach(classes, function(klass, i) { - if (klass && klass.length > 0) { - className += (i > 0) ? ' ' : ''; - className += isPrefix ? fix + klass - : klass + fix; - } - }); - return className; -} - -function removeFromArray(arr, val) { - var index = arr.indexOf(val); - if (val >= 0) { - arr.splice(index, 1); - } -} - -function stripCommentsFromElement(element) { - if (element instanceof jqLite) { - switch (element.length) { - case 0: - return []; - break; - - case 1: - // there is no point of stripping anything if the element - // is the only element within the jqLite wrapper. - // (it's important that we retain the element instance.) - if (element[0].nodeType === ELEMENT_NODE) { - return element; - } - break; - - default: - return jqLite(extractElementNode(element)); - break; - } - } - - if (element.nodeType === ELEMENT_NODE) { - return jqLite(element); - } -} - -function extractElementNode(element) { - if (!element[0]) return element; - for (var i = 0; i < element.length; i++) { - var elm = element[i]; - if (elm.nodeType == ELEMENT_NODE) { - return elm; - } - } -} - -function $$addClass($$jqLite, element, className) { - forEach(element, function(elm) { - $$jqLite.addClass(elm, className); - }); -} - -function $$removeClass($$jqLite, element, className) { - forEach(element, function(elm) { - $$jqLite.removeClass(elm, className); - }); -} - -function applyAnimationClassesFactory($$jqLite) { - return function(element, options) { - if (options.addClass) { - $$addClass($$jqLite, element, options.addClass); - options.addClass = null; - } - if (options.removeClass) { - $$removeClass($$jqLite, element, options.removeClass); - options.removeClass = null; - } - } -} - -function prepareAnimationOptions(options) { - options = options || {}; - if (!options.$$prepared) { - var domOperation = options.domOperation || noop; - options.domOperation = function() { - options.$$domOperationFired = true; - domOperation(); - domOperation = noop; - }; - options.$$prepared = true; - } - return options; -} - -function applyAnimationStyles(element, options) { - applyAnimationFromStyles(element, options); - applyAnimationToStyles(element, options); -} - -function applyAnimationFromStyles(element, options) { - if (options.from) { - element.css(options.from); - options.from = null; - } -} - -function applyAnimationToStyles(element, options) { - if (options.to) { - element.css(options.to); - options.to = null; - } -} - -function mergeAnimationDetails(element, oldAnimation, newAnimation) { - var target = oldAnimation.options || {}; - var newOptions = newAnimation.options || {}; - - var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || ''); - var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || ''); - var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove); - - if (newOptions.preparationClasses) { - target.preparationClasses = concatWithSpace(newOptions.preparationClasses, target.preparationClasses); - delete newOptions.preparationClasses; - } - - // noop is basically when there is no callback; otherwise something has been set - var realDomOperation = target.domOperation !== noop ? target.domOperation : null; - - extend(target, newOptions); - - // TODO(matsko or sreeramu): proper fix is to maintain all animation callback in array and call at last,but now only leave has the callback so no issue with this. - if (realDomOperation) { - target.domOperation = realDomOperation; - } - - if (classes.addClass) { - target.addClass = classes.addClass; - } else { - target.addClass = null; - } - - if (classes.removeClass) { - target.removeClass = classes.removeClass; - } else { - target.removeClass = null; - } - - oldAnimation.addClass = target.addClass; - oldAnimation.removeClass = target.removeClass; - - return target; -} - -function resolveElementClasses(existing, toAdd, toRemove) { - var ADD_CLASS = 1; - var REMOVE_CLASS = -1; - - var flags = {}; - existing = splitClassesToLookup(existing); - - toAdd = splitClassesToLookup(toAdd); - forEach(toAdd, function(value, key) { - flags[key] = ADD_CLASS; - }); - - toRemove = splitClassesToLookup(toRemove); - forEach(toRemove, function(value, key) { - flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS; - }); - - var classes = { - addClass: '', - removeClass: '' - }; - - forEach(flags, function(val, klass) { - var prop, allow; - if (val === ADD_CLASS) { - prop = 'addClass'; - allow = !existing[klass]; - } else if (val === REMOVE_CLASS) { - prop = 'removeClass'; - allow = existing[klass]; - } - if (allow) { - if (classes[prop].length) { - classes[prop] += ' '; - } - classes[prop] += klass; - } - }); - - function splitClassesToLookup(classes) { - if (isString(classes)) { - classes = classes.split(' '); - } - - var obj = {}; - forEach(classes, function(klass) { - // sometimes the split leaves empty string values - // incase extra spaces were applied to the options - if (klass.length) { - obj[klass] = true; - } - }); - return obj; - } - - return classes; -} - -function getDomNode(element) { - return (element instanceof angular.element) ? element[0] : element; -} - -function applyGeneratedPreparationClasses(element, event, options) { - var classes = ''; - if (event) { - classes = pendClasses(event, EVENT_CLASS_PREFIX, true); - } - if (options.addClass) { - classes = concatWithSpace(classes, pendClasses(options.addClass, ADD_CLASS_SUFFIX)); - } - if (options.removeClass) { - classes = concatWithSpace(classes, pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX)); - } - if (classes.length) { - options.preparationClasses = classes; - element.addClass(classes); - } -} - -function clearGeneratedClasses(element, options) { - if (options.preparationClasses) { - element.removeClass(options.preparationClasses); - options.preparationClasses = null; - } - if (options.activeClasses) { - element.removeClass(options.activeClasses); - options.activeClasses = null; - } -} - -function blockTransitions(node, duration) { - // we use a negative delay value since it performs blocking - // yet it doesn't kill any existing transitions running on the - // same element which makes this safe for class-based animations - var value = duration ? '-' + duration + 's' : ''; - applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]); - return [TRANSITION_DELAY_PROP, value]; -} - -function blockKeyframeAnimations(node, applyBlock) { - var value = applyBlock ? 'paused' : ''; - var key = ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY; - applyInlineStyle(node, [key, value]); - return [key, value]; -} - -function applyInlineStyle(node, styleTuple) { - var prop = styleTuple[0]; - var value = styleTuple[1]; - node.style[prop] = value; -} - -function concatWithSpace(a,b) { - if (!a) return b; - if (!b) return a; - return a + ' ' + b; -} - -var $$rAFSchedulerFactory = ['$$rAF', function($$rAF) { - var queue, cancelFn; - - function scheduler(tasks) { - // we make a copy since RAFScheduler mutates the state - // of the passed in array variable and this would be difficult - // to track down on the outside code - queue = queue.concat(tasks); - nextTick(); - } - - queue = scheduler.queue = []; - - /* waitUntilQuiet does two things: - * 1. It will run the FINAL `fn` value only when an uncanceled RAF has passed through - * 2. It will delay the next wave of tasks from running until the quiet `fn` has run. - * - * The motivation here is that animation code can request more time from the scheduler - * before the next wave runs. This allows for certain DOM properties such as classes to - * be resolved in time for the next animation to run. - */ - scheduler.waitUntilQuiet = function(fn) { - if (cancelFn) cancelFn(); - - cancelFn = $$rAF(function() { - cancelFn = null; - fn(); - nextTick(); - }); - }; - - return scheduler; - - function nextTick() { - if (!queue.length) return; - - var items = queue.shift(); - for (var i = 0; i < items.length; i++) { - items[i](); - } - - if (!cancelFn) { - $$rAF(function() { - if (!cancelFn) nextTick(); - }); - } - } -}]; - -/** - * @ngdoc directive - * @name ngAnimateChildren - * @restrict AE - * @element ANY - * - * @description - * - * ngAnimateChildren allows you to specify that children of this element should animate even if any - * of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move` - * (structural) animation, child elements that also have an active structural animation are not animated. - * - * Note that even if `ngAnimteChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation). - * - * - * @param {string} ngAnimateChildren If the value is empty, `true` or `on`, - * then child animations are allowed. If the value is `false`, child animations are not allowed. - * - * @example - * - -
    - - -
    -
    -
    - List of items: -
    Item {{item}}
    -
    -
    -
    -
    - - - .container.ng-enter, - .container.ng-leave { - transition: all ease 1.5s; - } - - .container.ng-enter, - .container.ng-leave-active { - opacity: 0; - } - - .container.ng-leave, - .container.ng-enter-active { - opacity: 1; - } - - .item { - background: firebrick; - color: #FFF; - margin-bottom: 10px; - } - - .item.ng-enter, - .item.ng-leave { - transition: transform 1.5s ease; - } - - .item.ng-enter { - transform: translateX(50px); - } - - .item.ng-enter-active { - transform: translateX(0); - } - - - angular.module('ngAnimateChildren', ['ngAnimate']) - .controller('mainController', function() { - this.animateChildren = false; - this.enterElement = false; - }); - -
    - */ -var $$AnimateChildrenDirective = ['$interpolate', function($interpolate) { - return { - link: function(scope, element, attrs) { - var val = attrs.ngAnimateChildren; - if (angular.isString(val) && val.length === 0) { //empty attribute - element.data(NG_ANIMATE_CHILDREN_DATA, true); - } else { - // Interpolate and set the value, so that it is available to - // animations that run right after compilation - setData($interpolate(val)(scope)); - attrs.$observe('ngAnimateChildren', setData); - } - - function setData(value) { - value = value === 'on' || value === 'true'; - element.data(NG_ANIMATE_CHILDREN_DATA, value); - } - } - }; -}]; - -var ANIMATE_TIMER_KEY = '$$animateCss'; - -/** - * @ngdoc service - * @name $animateCss - * @kind object - * - * @description - * The `$animateCss` service is a useful utility to trigger customized CSS-based transitions/keyframes - * from a JavaScript-based animation or directly from a directive. The purpose of `$animateCss` is NOT - * to side-step how `$animate` and ngAnimate work, but the goal is to allow pre-existing animations or - * directives to create more complex animations that can be purely driven using CSS code. - * - * Note that only browsers that support CSS transitions and/or keyframe animations are capable of - * rendering animations triggered via `$animateCss` (bad news for IE9 and lower). - * - * ## Usage - * Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that - * is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however, - * any automatic control over cancelling animations and/or preventing animations from being run on - * child elements will not be handled by Angular. For this to work as expected, please use `$animate` to - * trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger - * the CSS animation. - * - * The example below shows how we can create a folding animation on an element using `ng-if`: - * - * ```html - * - *
    - * This element will go BOOM - *
    - * - * ``` - * - * Now we create the **JavaScript animation** that will trigger the CSS transition: - * - * ```js - * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) { - * return { - * enter: function(element, doneFn) { - * var height = element[0].offsetHeight; - * return $animateCss(element, { - * from: { height:'0px' }, - * to: { height:height + 'px' }, - * duration: 1 // one second - * }); - * } - * } - * }]); - * ``` - * - * ## More Advanced Uses - * - * `$animateCss` is the underlying code that ngAnimate uses to power **CSS-based animations** behind the scenes. Therefore CSS hooks - * like `.ng-EVENT`, `.ng-EVENT-active`, `.ng-EVENT-stagger` are all features that can be triggered using `$animateCss` via JavaScript code. - * - * This also means that just about any combination of adding classes, removing classes, setting styles, dynamically setting a keyframe animation, - * applying a hardcoded duration or delay value, changing the animation easing or applying a stagger animation are all options that work with - * `$animateCss`. The service itself is smart enough to figure out the combination of options and examine the element styling properties in order - * to provide a working animation that will run in CSS. - * - * The example below showcases a more advanced version of the `.fold-animation` from the example above: - * - * ```js - * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) { - * return { - * enter: function(element, doneFn) { - * var height = element[0].offsetHeight; - * return $animateCss(element, { - * addClass: 'red large-text pulse-twice', - * easing: 'ease-out', - * from: { height:'0px' }, - * to: { height:height + 'px' }, - * duration: 1 // one second - * }); - * } - * } - * }]); - * ``` - * - * Since we're adding/removing CSS classes then the CSS transition will also pick those up: - * - * ```css - * /* since a hardcoded duration value of 1 was provided in the JavaScript animation code, - * the CSS classes below will be transitioned despite them being defined as regular CSS classes */ - * .red { background:red; } - * .large-text { font-size:20px; } - * - * /* we can also use a keyframe animation and $animateCss will make it work alongside the transition */ - * .pulse-twice { - * animation: 0.5s pulse linear 2; - * -webkit-animation: 0.5s pulse linear 2; - * } - * - * @keyframes pulse { - * from { transform: scale(0.5); } - * to { transform: scale(1.5); } - * } - * - * @-webkit-keyframes pulse { - * from { -webkit-transform: scale(0.5); } - * to { -webkit-transform: scale(1.5); } - * } - * ``` - * - * Given this complex combination of CSS classes, styles and options, `$animateCss` will figure everything out and make the animation happen. - * - * ## How the Options are handled - * - * `$animateCss` is very versatile and intelligent when it comes to figuring out what configurations to apply to the element to ensure the animation - * works with the options provided. Say for example we were adding a class that contained a keyframe value and we wanted to also animate some inline - * styles using the `from` and `to` properties. - * - * ```js - * var animator = $animateCss(element, { - * from: { background:'red' }, - * to: { background:'blue' } - * }); - * animator.start(); - * ``` - * - * ```css - * .rotating-animation { - * animation:0.5s rotate linear; - * -webkit-animation:0.5s rotate linear; - * } - * - * @keyframes rotate { - * from { transform: rotate(0deg); } - * to { transform: rotate(360deg); } - * } - * - * @-webkit-keyframes rotate { - * from { -webkit-transform: rotate(0deg); } - * to { -webkit-transform: rotate(360deg); } - * } - * ``` - * - * The missing pieces here are that we do not have a transition set (within the CSS code nor within the `$animateCss` options) and the duration of the animation is - * going to be detected from what the keyframe styles on the CSS class are. In this event, `$animateCss` will automatically create an inline transition - * style matching the duration detected from the keyframe style (which is present in the CSS class that is being added) and then prepare both the transition - * and keyframe animations to run in parallel on the element. Then when the animation is underway the provided `from` and `to` CSS styles will be applied - * and spread across the transition and keyframe animation. - * - * ## What is returned - * - * `$animateCss` works in two stages: a preparation phase and an animation phase. Therefore when `$animateCss` is first called it will NOT actually - * start the animation. All that is going on here is that the element is being prepared for the animation (which means that the generated CSS classes are - * added and removed on the element). Once `$animateCss` is called it will return an object with the following properties: - * - * ```js - * var animator = $animateCss(element, { ... }); - * ``` - * - * Now what do the contents of our `animator` variable look like: - * - * ```js - * { - * // starts the animation - * start: Function, - * - * // ends (aborts) the animation - * end: Function - * } - * ``` - * - * To actually start the animation we need to run `animation.start()` which will then return a promise that we can hook into to detect when the animation ends. - * If we choose not to run the animation then we MUST run `animation.end()` to perform a cleanup on the element (since some CSS classes and styles may have been - * applied to the element during the preparation phase). Note that all other properties such as duration, delay, transitions and keyframes are just properties - * and that changing them will not reconfigure the parameters of the animation. - * - * ### runner.done() vs runner.then() - * It is documented that `animation.start()` will return a promise object and this is true, however, there is also an additional method available on the - * runner called `.done(callbackFn)`. The done method works the same as `.finally(callbackFn)`, however, it does **not trigger a digest to occur**. - * Therefore, for performance reasons, it's always best to use `runner.done(callback)` instead of `runner.then()`, `runner.catch()` or `runner.finally()` - * unless you really need a digest to kick off afterwards. - * - * Keep in mind that, to make this easier, ngAnimate has tweaked the JS animations API to recognize when a runner instance is returned from $animateCss - * (so there is no need to call `runner.done(doneFn)` inside of your JavaScript animation code). - * Check the {@link ngAnimate.$animateCss#usage animation code above} to see how this works. - * - * @param {DOMElement} element the element that will be animated - * @param {object} options the animation-related options that will be applied during the animation - * - * * `event` - The DOM event (e.g. enter, leave, move). When used, a generated CSS class of `ng-EVENT` and `ng-EVENT-active` will be applied - * to the element during the animation. Multiple events can be provided when spaces are used as a separator. (Note that this will not perform any DOM operation.) - * * `structural` - Indicates that the `ng-` prefix will be added to the event class. Setting to `false` or omitting will turn `ng-EVENT` and - * `ng-EVENT-active` in `EVENT` and `EVENT-active`. Unused if `event` is omitted. - * * `easing` - The CSS easing value that will be applied to the transition or keyframe animation (or both). - * * `transitionStyle` - The raw CSS transition style that will be used (e.g. `1s linear all`). - * * `keyframeStyle` - The raw CSS keyframe animation style that will be used (e.g. `1s my_animation linear`). - * * `from` - The starting CSS styles (a key/value object) that will be applied at the start of the animation. - * * `to` - The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition. - * * `addClass` - A space separated list of CSS classes that will be added to the element and spread across the animation. - * * `removeClass` - A space separated list of CSS classes that will be removed from the element and spread across the animation. - * * `duration` - A number value representing the total duration of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `0` - * is provided then the animation will be skipped entirely. - * * `delay` - A number value representing the total delay of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `true` is - * used then whatever delay value is detected from the CSS classes will be mirrored on the elements styles (e.g. by setting delay true then the style value - * of the element will be `transition-delay: DETECTED_VALUE`). Using `true` is useful when you want the CSS classes and inline styles to all share the same - * CSS delay value. - * * `stagger` - A numeric time value representing the delay between successively animated elements - * ({@link ngAnimate#css-staggering-animations Click here to learn how CSS-based staggering works in ngAnimate.}) - * * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a - * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`) - * * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occurring on the classes being added and removed.) - * * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once - * the animation is closed. This is useful for when the styles are used purely for the sake of - * the animation and do not have a lasting visual effect on the element (e.g. a collapse and open animation). - * By default this value is set to `false`. - * - * @return {object} an object with start and end methods and details about the animation. - * - * * `start` - The method to start the animation. This will return a `Promise` when called. - * * `end` - This method will cancel the animation and remove all applied CSS classes and styles. - */ -var ONE_SECOND = 1000; -var BASE_TEN = 10; - -var ELAPSED_TIME_MAX_DECIMAL_PLACES = 3; -var CLOSING_TIME_BUFFER = 1.5; - -var DETECT_CSS_PROPERTIES = { - transitionDuration: TRANSITION_DURATION_PROP, - transitionDelay: TRANSITION_DELAY_PROP, - transitionProperty: TRANSITION_PROP + PROPERTY_KEY, - animationDuration: ANIMATION_DURATION_PROP, - animationDelay: ANIMATION_DELAY_PROP, - animationIterationCount: ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY -}; - -var DETECT_STAGGER_CSS_PROPERTIES = { - transitionDuration: TRANSITION_DURATION_PROP, - transitionDelay: TRANSITION_DELAY_PROP, - animationDuration: ANIMATION_DURATION_PROP, - animationDelay: ANIMATION_DELAY_PROP -}; - -function getCssKeyframeDurationStyle(duration) { - return [ANIMATION_DURATION_PROP, duration + 's']; -} - -function getCssDelayStyle(delay, isKeyframeAnimation) { - var prop = isKeyframeAnimation ? ANIMATION_DELAY_PROP : TRANSITION_DELAY_PROP; - return [prop, delay + 's']; -} - -function computeCssStyles($window, element, properties) { - var styles = Object.create(null); - var detectedStyles = $window.getComputedStyle(element) || {}; - forEach(properties, function(formalStyleName, actualStyleName) { - var val = detectedStyles[formalStyleName]; - if (val) { - var c = val.charAt(0); - - // only numerical-based values have a negative sign or digit as the first value - if (c === '-' || c === '+' || c >= 0) { - val = parseMaxTime(val); - } - - // by setting this to null in the event that the delay is not set or is set directly as 0 - // then we can still allow for negative values to be used later on and not mistake this - // value for being greater than any other negative value. - if (val === 0) { - val = null; - } - styles[actualStyleName] = val; - } - }); - - return styles; -} - -function parseMaxTime(str) { - var maxValue = 0; - var values = str.split(/\s*,\s*/); - forEach(values, function(value) { - // it's always safe to consider only second values and omit `ms` values since - // getComputedStyle will always handle the conversion for us - if (value.charAt(value.length - 1) == 's') { - value = value.substring(0, value.length - 1); - } - value = parseFloat(value) || 0; - maxValue = maxValue ? Math.max(value, maxValue) : value; - }); - return maxValue; -} - -function truthyTimingValue(val) { - return val === 0 || val != null; -} - -function getCssTransitionDurationStyle(duration, applyOnlyDuration) { - var style = TRANSITION_PROP; - var value = duration + 's'; - if (applyOnlyDuration) { - style += DURATION_KEY; - } else { - value += ' linear all'; - } - return [style, value]; -} - -function createLocalCacheLookup() { - var cache = Object.create(null); - return { - flush: function() { - cache = Object.create(null); - }, - - count: function(key) { - var entry = cache[key]; - return entry ? entry.total : 0; - }, - - get: function(key) { - var entry = cache[key]; - return entry && entry.value; - }, - - put: function(key, value) { - if (!cache[key]) { - cache[key] = { total: 1, value: value }; - } else { - cache[key].total++; - } - } - }; -} - -// we do not reassign an already present style value since -// if we detect the style property value again we may be -// detecting styles that were added via the `from` styles. -// We make use of `isDefined` here since an empty string -// or null value (which is what getPropertyValue will return -// for a non-existing style) will still be marked as a valid -// value for the style (a falsy value implies that the style -// is to be removed at the end of the animation). If we had a simple -// "OR" statement then it would not be enough to catch that. -function registerRestorableStyles(backup, node, properties) { - forEach(properties, function(prop) { - backup[prop] = isDefined(backup[prop]) - ? backup[prop] - : node.style.getPropertyValue(prop); - }); -} - -var $AnimateCssProvider = ['$animateProvider', function($animateProvider) { - var gcsLookup = createLocalCacheLookup(); - var gcsStaggerLookup = createLocalCacheLookup(); - - this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout', - '$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue', - function($window, $$jqLite, $$AnimateRunner, $timeout, - $$forceReflow, $sniffer, $$rAFScheduler, $$animateQueue) { - - var applyAnimationClasses = applyAnimationClassesFactory($$jqLite); - - var parentCounter = 0; - function gcsHashFn(node, extraClasses) { - var KEY = "$$ngAnimateParentKey"; - var parentNode = node.parentNode; - var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter); - return parentID + '-' + node.getAttribute('class') + '-' + extraClasses; - } - - function computeCachedCssStyles(node, className, cacheKey, properties) { - var timings = gcsLookup.get(cacheKey); - - if (!timings) { - timings = computeCssStyles($window, node, properties); - if (timings.animationIterationCount === 'infinite') { - timings.animationIterationCount = 1; - } - } - - // we keep putting this in multiple times even though the value and the cacheKey are the same - // because we're keeping an internal tally of how many duplicate animations are detected. - gcsLookup.put(cacheKey, timings); - return timings; - } - - function computeCachedCssStaggerStyles(node, className, cacheKey, properties) { - var stagger; - - // if we have one or more existing matches of matching elements - // containing the same parent + CSS styles (which is how cacheKey works) - // then staggering is possible - if (gcsLookup.count(cacheKey) > 0) { - stagger = gcsStaggerLookup.get(cacheKey); - - if (!stagger) { - var staggerClassName = pendClasses(className, '-stagger'); - - $$jqLite.addClass(node, staggerClassName); - - stagger = computeCssStyles($window, node, properties); - - // force the conversion of a null value to zero incase not set - stagger.animationDuration = Math.max(stagger.animationDuration, 0); - stagger.transitionDuration = Math.max(stagger.transitionDuration, 0); - - $$jqLite.removeClass(node, staggerClassName); - - gcsStaggerLookup.put(cacheKey, stagger); - } - } - - return stagger || {}; - } - - var cancelLastRAFRequest; - var rafWaitQueue = []; - function waitUntilQuiet(callback) { - rafWaitQueue.push(callback); - $$rAFScheduler.waitUntilQuiet(function() { - gcsLookup.flush(); - gcsStaggerLookup.flush(); - - // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable. - // PLEASE EXAMINE THE `$$forceReflow` service to understand why. - var pageWidth = $$forceReflow(); - - // we use a for loop to ensure that if the queue is changed - // during this looping then it will consider new requests - for (var i = 0; i < rafWaitQueue.length; i++) { - rafWaitQueue[i](pageWidth); - } - rafWaitQueue.length = 0; - }); - } - - function computeTimings(node, className, cacheKey) { - var timings = computeCachedCssStyles(node, className, cacheKey, DETECT_CSS_PROPERTIES); - var aD = timings.animationDelay; - var tD = timings.transitionDelay; - timings.maxDelay = aD && tD - ? Math.max(aD, tD) - : (aD || tD); - timings.maxDuration = Math.max( - timings.animationDuration * timings.animationIterationCount, - timings.transitionDuration); - - return timings; - } - - return function init(element, initialOptions) { - // all of the animation functions should create - // a copy of the options data, however, if a - // parent service has already created a copy then - // we should stick to using that - var options = initialOptions || {}; - if (!options.$$prepared) { - options = prepareAnimationOptions(copy(options)); - } - - var restoreStyles = {}; - var node = getDomNode(element); - if (!node - || !node.parentNode - || !$$animateQueue.enabled()) { - return closeAndReturnNoopAnimator(); - } - - var temporaryStyles = []; - var classes = element.attr('class'); - var styles = packageStyles(options); - var animationClosed; - var animationPaused; - var animationCompleted; - var runner; - var runnerHost; - var maxDelay; - var maxDelayTime; - var maxDuration; - var maxDurationTime; - var startTime; - var events = []; - - if (options.duration === 0 || (!$sniffer.animations && !$sniffer.transitions)) { - return closeAndReturnNoopAnimator(); - } - - var method = options.event && isArray(options.event) - ? options.event.join(' ') - : options.event; - - var isStructural = method && options.structural; - var structuralClassName = ''; - var addRemoveClassName = ''; - - if (isStructural) { - structuralClassName = pendClasses(method, EVENT_CLASS_PREFIX, true); - } else if (method) { - structuralClassName = method; - } - - if (options.addClass) { - addRemoveClassName += pendClasses(options.addClass, ADD_CLASS_SUFFIX); - } - - if (options.removeClass) { - if (addRemoveClassName.length) { - addRemoveClassName += ' '; - } - addRemoveClassName += pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX); - } - - // there may be a situation where a structural animation is combined together - // with CSS classes that need to resolve before the animation is computed. - // However this means that there is no explicit CSS code to block the animation - // from happening (by setting 0s none in the class name). If this is the case - // we need to apply the classes before the first rAF so we know to continue if - // there actually is a detected transition or keyframe animation - if (options.applyClassesEarly && addRemoveClassName.length) { - applyAnimationClasses(element, options); - } - - var preparationClasses = [structuralClassName, addRemoveClassName].join(' ').trim(); - var fullClassName = classes + ' ' + preparationClasses; - var activeClasses = pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX); - var hasToStyles = styles.to && Object.keys(styles.to).length > 0; - var containsKeyframeAnimation = (options.keyframeStyle || '').length > 0; - - // there is no way we can trigger an animation if no styles and - // no classes are being applied which would then trigger a transition, - // unless there a is raw keyframe value that is applied to the element. - if (!containsKeyframeAnimation - && !hasToStyles - && !preparationClasses) { - return closeAndReturnNoopAnimator(); - } - - var cacheKey, stagger; - if (options.stagger > 0) { - var staggerVal = parseFloat(options.stagger); - stagger = { - transitionDelay: staggerVal, - animationDelay: staggerVal, - transitionDuration: 0, - animationDuration: 0 - }; - } else { - cacheKey = gcsHashFn(node, fullClassName); - stagger = computeCachedCssStaggerStyles(node, preparationClasses, cacheKey, DETECT_STAGGER_CSS_PROPERTIES); - } - - if (!options.$$skipPreparationClasses) { - $$jqLite.addClass(element, preparationClasses); - } - - var applyOnlyDuration; - - if (options.transitionStyle) { - var transitionStyle = [TRANSITION_PROP, options.transitionStyle]; - applyInlineStyle(node, transitionStyle); - temporaryStyles.push(transitionStyle); - } - - if (options.duration >= 0) { - applyOnlyDuration = node.style[TRANSITION_PROP].length > 0; - var durationStyle = getCssTransitionDurationStyle(options.duration, applyOnlyDuration); - - // we set the duration so that it will be picked up by getComputedStyle later - applyInlineStyle(node, durationStyle); - temporaryStyles.push(durationStyle); - } - - if (options.keyframeStyle) { - var keyframeStyle = [ANIMATION_PROP, options.keyframeStyle]; - applyInlineStyle(node, keyframeStyle); - temporaryStyles.push(keyframeStyle); - } - - var itemIndex = stagger - ? options.staggerIndex >= 0 - ? options.staggerIndex - : gcsLookup.count(cacheKey) - : 0; - - var isFirst = itemIndex === 0; - - // this is a pre-emptive way of forcing the setup classes to be added and applied INSTANTLY - // without causing any combination of transitions to kick in. By adding a negative delay value - // it forces the setup class' transition to end immediately. We later then remove the negative - // transition delay to allow for the transition to naturally do it's thing. The beauty here is - // that if there is no transition defined then nothing will happen and this will also allow - // other transitions to be stacked on top of each other without any chopping them out. - if (isFirst && !options.skipBlocking) { - blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE); - } - - var timings = computeTimings(node, fullClassName, cacheKey); - var relativeDelay = timings.maxDelay; - maxDelay = Math.max(relativeDelay, 0); - maxDuration = timings.maxDuration; - - var flags = {}; - flags.hasTransitions = timings.transitionDuration > 0; - flags.hasAnimations = timings.animationDuration > 0; - flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty == 'all'; - flags.applyTransitionDuration = hasToStyles && ( - (flags.hasTransitions && !flags.hasTransitionAll) - || (flags.hasAnimations && !flags.hasTransitions)); - flags.applyAnimationDuration = options.duration && flags.hasAnimations; - flags.applyTransitionDelay = truthyTimingValue(options.delay) && (flags.applyTransitionDuration || flags.hasTransitions); - flags.applyAnimationDelay = truthyTimingValue(options.delay) && flags.hasAnimations; - flags.recalculateTimingStyles = addRemoveClassName.length > 0; - - if (flags.applyTransitionDuration || flags.applyAnimationDuration) { - maxDuration = options.duration ? parseFloat(options.duration) : maxDuration; - - if (flags.applyTransitionDuration) { - flags.hasTransitions = true; - timings.transitionDuration = maxDuration; - applyOnlyDuration = node.style[TRANSITION_PROP + PROPERTY_KEY].length > 0; - temporaryStyles.push(getCssTransitionDurationStyle(maxDuration, applyOnlyDuration)); - } - - if (flags.applyAnimationDuration) { - flags.hasAnimations = true; - timings.animationDuration = maxDuration; - temporaryStyles.push(getCssKeyframeDurationStyle(maxDuration)); - } - } - - if (maxDuration === 0 && !flags.recalculateTimingStyles) { - return closeAndReturnNoopAnimator(); - } - - if (options.delay != null) { - var delayStyle; - if (typeof options.delay !== "boolean") { - delayStyle = parseFloat(options.delay); - // number in options.delay means we have to recalculate the delay for the closing timeout - maxDelay = Math.max(delayStyle, 0); - } - - if (flags.applyTransitionDelay) { - temporaryStyles.push(getCssDelayStyle(delayStyle)); - } - - if (flags.applyAnimationDelay) { - temporaryStyles.push(getCssDelayStyle(delayStyle, true)); - } - } - - // we need to recalculate the delay value since we used a pre-emptive negative - // delay value and the delay value is required for the final event checking. This - // property will ensure that this will happen after the RAF phase has passed. - if (options.duration == null && timings.transitionDuration > 0) { - flags.recalculateTimingStyles = flags.recalculateTimingStyles || isFirst; - } - - maxDelayTime = maxDelay * ONE_SECOND; - maxDurationTime = maxDuration * ONE_SECOND; - if (!options.skipBlocking) { - flags.blockTransition = timings.transitionDuration > 0; - flags.blockKeyframeAnimation = timings.animationDuration > 0 && - stagger.animationDelay > 0 && - stagger.animationDuration === 0; - } - - if (options.from) { - if (options.cleanupStyles) { - registerRestorableStyles(restoreStyles, node, Object.keys(options.from)); - } - applyAnimationFromStyles(element, options); - } - - if (flags.blockTransition || flags.blockKeyframeAnimation) { - applyBlocking(maxDuration); - } else if (!options.skipBlocking) { - blockTransitions(node, false); - } - - // TODO(matsko): for 1.5 change this code to have an animator object for better debugging - return { - $$willAnimate: true, - end: endFn, - start: function() { - if (animationClosed) return; - - runnerHost = { - end: endFn, - cancel: cancelFn, - resume: null, //this will be set during the start() phase - pause: null - }; - - runner = new $$AnimateRunner(runnerHost); - - waitUntilQuiet(start); - - // we don't have access to pause/resume the animation - // since it hasn't run yet. AnimateRunner will therefore - // set noop functions for resume and pause and they will - // later be overridden once the animation is triggered - return runner; - } - }; - - function endFn() { - close(); - } - - function cancelFn() { - close(true); - } - - function close(rejected) { // jshint ignore:line - // if the promise has been called already then we shouldn't close - // the animation again - if (animationClosed || (animationCompleted && animationPaused)) return; - animationClosed = true; - animationPaused = false; - - if (!options.$$skipPreparationClasses) { - $$jqLite.removeClass(element, preparationClasses); - } - $$jqLite.removeClass(element, activeClasses); - - blockKeyframeAnimations(node, false); - blockTransitions(node, false); - - forEach(temporaryStyles, function(entry) { - // There is only one way to remove inline style properties entirely from elements. - // By using `removeProperty` this works, but we need to convert camel-cased CSS - // styles down to hyphenated values. - node.style[entry[0]] = ''; - }); - - applyAnimationClasses(element, options); - applyAnimationStyles(element, options); - - if (Object.keys(restoreStyles).length) { - forEach(restoreStyles, function(value, prop) { - value ? node.style.setProperty(prop, value) - : node.style.removeProperty(prop); - }); - } - - // the reason why we have this option is to allow a synchronous closing callback - // that is fired as SOON as the animation ends (when the CSS is removed) or if - // the animation never takes off at all. A good example is a leave animation since - // the element must be removed just after the animation is over or else the element - // will appear on screen for one animation frame causing an overbearing flicker. - if (options.onDone) { - options.onDone(); - } - - if (events && events.length) { - // Remove the transitionend / animationend listener(s) - element.off(events.join(' '), onAnimationProgress); - } - - //Cancel the fallback closing timeout and remove the timer data - var animationTimerData = element.data(ANIMATE_TIMER_KEY); - if (animationTimerData) { - $timeout.cancel(animationTimerData[0].timer); - element.removeData(ANIMATE_TIMER_KEY); - } - - // if the preparation function fails then the promise is not setup - if (runner) { - runner.complete(!rejected); - } - } - - function applyBlocking(duration) { - if (flags.blockTransition) { - blockTransitions(node, duration); - } - - if (flags.blockKeyframeAnimation) { - blockKeyframeAnimations(node, !!duration); - } - } - - function closeAndReturnNoopAnimator() { - runner = new $$AnimateRunner({ - end: endFn, - cancel: cancelFn - }); - - // should flush the cache animation - waitUntilQuiet(noop); - close(); - - return { - $$willAnimate: false, - start: function() { - return runner; - }, - end: endFn - }; - } - - function onAnimationProgress(event) { - event.stopPropagation(); - var ev = event.originalEvent || event; - - // we now always use `Date.now()` due to the recent changes with - // event.timeStamp in Firefox, Webkit and Chrome (see #13494 for more info) - var timeStamp = ev.$manualTimeStamp || Date.now(); - - /* Firefox (or possibly just Gecko) likes to not round values up - * when a ms measurement is used for the animation */ - var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES)); - - /* $manualTimeStamp is a mocked timeStamp value which is set - * within browserTrigger(). This is only here so that tests can - * mock animations properly. Real events fallback to event.timeStamp, - * or, if they don't, then a timeStamp is automatically created for them. - * We're checking to see if the timeStamp surpasses the expected delay, - * but we're using elapsedTime instead of the timeStamp on the 2nd - * pre-condition since animationPauseds sometimes close off early */ - if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) { - // we set this flag to ensure that if the transition is paused then, when resumed, - // the animation will automatically close itself since transitions cannot be paused. - animationCompleted = true; - close(); - } - } - - function start() { - if (animationClosed) return; - if (!node.parentNode) { - close(); - return; - } - - // even though we only pause keyframe animations here the pause flag - // will still happen when transitions are used. Only the transition will - // not be paused since that is not possible. If the animation ends when - // paused then it will not complete until unpaused or cancelled. - var playPause = function(playAnimation) { - if (!animationCompleted) { - animationPaused = !playAnimation; - if (timings.animationDuration) { - var value = blockKeyframeAnimations(node, animationPaused); - animationPaused - ? temporaryStyles.push(value) - : removeFromArray(temporaryStyles, value); - } - } else if (animationPaused && playAnimation) { - animationPaused = false; - close(); - } - }; - - // checking the stagger duration prevents an accidentally cascade of the CSS delay style - // being inherited from the parent. If the transition duration is zero then we can safely - // rely that the delay value is an intentional stagger delay style. - var maxStagger = itemIndex > 0 - && ((timings.transitionDuration && stagger.transitionDuration === 0) || - (timings.animationDuration && stagger.animationDuration === 0)) - && Math.max(stagger.animationDelay, stagger.transitionDelay); - if (maxStagger) { - $timeout(triggerAnimationStart, - Math.floor(maxStagger * itemIndex * ONE_SECOND), - false); - } else { - triggerAnimationStart(); - } - - // this will decorate the existing promise runner with pause/resume methods - runnerHost.resume = function() { - playPause(true); - }; - - runnerHost.pause = function() { - playPause(false); - }; - - function triggerAnimationStart() { - // just incase a stagger animation kicks in when the animation - // itself was cancelled entirely - if (animationClosed) return; - - applyBlocking(false); - - forEach(temporaryStyles, function(entry) { - var key = entry[0]; - var value = entry[1]; - node.style[key] = value; - }); - - applyAnimationClasses(element, options); - $$jqLite.addClass(element, activeClasses); - - if (flags.recalculateTimingStyles) { - fullClassName = node.className + ' ' + preparationClasses; - cacheKey = gcsHashFn(node, fullClassName); - - timings = computeTimings(node, fullClassName, cacheKey); - relativeDelay = timings.maxDelay; - maxDelay = Math.max(relativeDelay, 0); - maxDuration = timings.maxDuration; - - if (maxDuration === 0) { - close(); - return; - } - - flags.hasTransitions = timings.transitionDuration > 0; - flags.hasAnimations = timings.animationDuration > 0; - } - - if (flags.applyAnimationDelay) { - relativeDelay = typeof options.delay !== "boolean" && truthyTimingValue(options.delay) - ? parseFloat(options.delay) - : relativeDelay; - - maxDelay = Math.max(relativeDelay, 0); - timings.animationDelay = relativeDelay; - delayStyle = getCssDelayStyle(relativeDelay, true); - temporaryStyles.push(delayStyle); - node.style[delayStyle[0]] = delayStyle[1]; - } - - maxDelayTime = maxDelay * ONE_SECOND; - maxDurationTime = maxDuration * ONE_SECOND; - - if (options.easing) { - var easeProp, easeVal = options.easing; - if (flags.hasTransitions) { - easeProp = TRANSITION_PROP + TIMING_KEY; - temporaryStyles.push([easeProp, easeVal]); - node.style[easeProp] = easeVal; - } - if (flags.hasAnimations) { - easeProp = ANIMATION_PROP + TIMING_KEY; - temporaryStyles.push([easeProp, easeVal]); - node.style[easeProp] = easeVal; - } - } - - if (timings.transitionDuration) { - events.push(TRANSITIONEND_EVENT); - } - - if (timings.animationDuration) { - events.push(ANIMATIONEND_EVENT); - } - - startTime = Date.now(); - var timerTime = maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime; - var endTime = startTime + timerTime; - - var animationsData = element.data(ANIMATE_TIMER_KEY) || []; - var setupFallbackTimer = true; - if (animationsData.length) { - var currentTimerData = animationsData[0]; - setupFallbackTimer = endTime > currentTimerData.expectedEndTime; - if (setupFallbackTimer) { - $timeout.cancel(currentTimerData.timer); - } else { - animationsData.push(close); - } - } - - if (setupFallbackTimer) { - var timer = $timeout(onAnimationExpired, timerTime, false); - animationsData[0] = { - timer: timer, - expectedEndTime: endTime - }; - animationsData.push(close); - element.data(ANIMATE_TIMER_KEY, animationsData); - } - - if (events.length) { - element.on(events.join(' '), onAnimationProgress); - } - - if (options.to) { - if (options.cleanupStyles) { - registerRestorableStyles(restoreStyles, node, Object.keys(options.to)); - } - applyAnimationToStyles(element, options); - } - } - - function onAnimationExpired() { - var animationsData = element.data(ANIMATE_TIMER_KEY); - - // this will be false in the event that the element was - // removed from the DOM (via a leave animation or something - // similar) - if (animationsData) { - for (var i = 1; i < animationsData.length; i++) { - animationsData[i](); - } - element.removeData(ANIMATE_TIMER_KEY); - } - } - } - }; - }]; -}]; - -var $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationProvider) { - $$animationProvider.drivers.push('$$animateCssDriver'); - - var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim'; - var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor'; - - var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out'; - var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in'; - - function isDocumentFragment(node) { - return node.parentNode && node.parentNode.nodeType === 11; - } - - this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$sniffer', '$$jqLite', '$document', - function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $sniffer, $$jqLite, $document) { - - // only browsers that support these properties can render animations - if (!$sniffer.animations && !$sniffer.transitions) return noop; - - var bodyNode = $document[0].body; - var rootNode = getDomNode($rootElement); - - var rootBodyElement = jqLite( - // this is to avoid using something that exists outside of the body - // we also special case the doc fragment case because our unit test code - // appends the $rootElement to the body after the app has been bootstrapped - isDocumentFragment(rootNode) || bodyNode.contains(rootNode) ? rootNode : bodyNode - ); - - var applyAnimationClasses = applyAnimationClassesFactory($$jqLite); - - return function initDriverFn(animationDetails) { - return animationDetails.from && animationDetails.to - ? prepareFromToAnchorAnimation(animationDetails.from, - animationDetails.to, - animationDetails.classes, - animationDetails.anchors) - : prepareRegularAnimation(animationDetails); - }; - - function filterCssClasses(classes) { - //remove all the `ng-` stuff - return classes.replace(/\bng-\S+\b/g, ''); - } - - function getUniqueValues(a, b) { - if (isString(a)) a = a.split(' '); - if (isString(b)) b = b.split(' '); - return a.filter(function(val) { - return b.indexOf(val) === -1; - }).join(' '); - } - - function prepareAnchoredAnimation(classes, outAnchor, inAnchor) { - var clone = jqLite(getDomNode(outAnchor).cloneNode(true)); - var startingClasses = filterCssClasses(getClassVal(clone)); - - outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME); - inAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME); - - clone.addClass(NG_ANIMATE_ANCHOR_CLASS_NAME); - - rootBodyElement.append(clone); - - var animatorIn, animatorOut = prepareOutAnimation(); - - // the user may not end up using the `out` animation and - // only making use of the `in` animation or vice-versa. - // In either case we should allow this and not assume the - // animation is over unless both animations are not used. - if (!animatorOut) { - animatorIn = prepareInAnimation(); - if (!animatorIn) { - return end(); - } - } - - var startingAnimator = animatorOut || animatorIn; - - return { - start: function() { - var runner; - - var currentAnimation = startingAnimator.start(); - currentAnimation.done(function() { - currentAnimation = null; - if (!animatorIn) { - animatorIn = prepareInAnimation(); - if (animatorIn) { - currentAnimation = animatorIn.start(); - currentAnimation.done(function() { - currentAnimation = null; - end(); - runner.complete(); - }); - return currentAnimation; - } - } - // in the event that there is no `in` animation - end(); - runner.complete(); - }); - - runner = new $$AnimateRunner({ - end: endFn, - cancel: endFn - }); - - return runner; - - function endFn() { - if (currentAnimation) { - currentAnimation.end(); - } - } - } - }; - - function calculateAnchorStyles(anchor) { - var styles = {}; - - var coords = getDomNode(anchor).getBoundingClientRect(); - - // we iterate directly since safari messes up and doesn't return - // all the keys for the coords object when iterated - forEach(['width','height','top','left'], function(key) { - var value = coords[key]; - switch (key) { - case 'top': - value += bodyNode.scrollTop; - break; - case 'left': - value += bodyNode.scrollLeft; - break; - } - styles[key] = Math.floor(value) + 'px'; - }); - return styles; - } - - function prepareOutAnimation() { - var animator = $animateCss(clone, { - addClass: NG_OUT_ANCHOR_CLASS_NAME, - delay: true, - from: calculateAnchorStyles(outAnchor) - }); - - // read the comment within `prepareRegularAnimation` to understand - // why this check is necessary - return animator.$$willAnimate ? animator : null; - } - - function getClassVal(element) { - return element.attr('class') || ''; - } - - function prepareInAnimation() { - var endingClasses = filterCssClasses(getClassVal(inAnchor)); - var toAdd = getUniqueValues(endingClasses, startingClasses); - var toRemove = getUniqueValues(startingClasses, endingClasses); - - var animator = $animateCss(clone, { - to: calculateAnchorStyles(inAnchor), - addClass: NG_IN_ANCHOR_CLASS_NAME + ' ' + toAdd, - removeClass: NG_OUT_ANCHOR_CLASS_NAME + ' ' + toRemove, - delay: true - }); - - // read the comment within `prepareRegularAnimation` to understand - // why this check is necessary - return animator.$$willAnimate ? animator : null; - } - - function end() { - clone.remove(); - outAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME); - inAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME); - } - } - - function prepareFromToAnchorAnimation(from, to, classes, anchors) { - var fromAnimation = prepareRegularAnimation(from, noop); - var toAnimation = prepareRegularAnimation(to, noop); - - var anchorAnimations = []; - forEach(anchors, function(anchor) { - var outElement = anchor['out']; - var inElement = anchor['in']; - var animator = prepareAnchoredAnimation(classes, outElement, inElement); - if (animator) { - anchorAnimations.push(animator); - } - }); - - // no point in doing anything when there are no elements to animate - if (!fromAnimation && !toAnimation && anchorAnimations.length === 0) return; - - return { - start: function() { - var animationRunners = []; - - if (fromAnimation) { - animationRunners.push(fromAnimation.start()); - } - - if (toAnimation) { - animationRunners.push(toAnimation.start()); - } - - forEach(anchorAnimations, function(animation) { - animationRunners.push(animation.start()); - }); - - var runner = new $$AnimateRunner({ - end: endFn, - cancel: endFn // CSS-driven animations cannot be cancelled, only ended - }); - - $$AnimateRunner.all(animationRunners, function(status) { - runner.complete(status); - }); - - return runner; - - function endFn() { - forEach(animationRunners, function(runner) { - runner.end(); - }); - } - } - }; - } - - function prepareRegularAnimation(animationDetails) { - var element = animationDetails.element; - var options = animationDetails.options || {}; - - if (animationDetails.structural) { - options.event = animationDetails.event; - options.structural = true; - options.applyClassesEarly = true; - - // we special case the leave animation since we want to ensure that - // the element is removed as soon as the animation is over. Otherwise - // a flicker might appear or the element may not be removed at all - if (animationDetails.event === 'leave') { - options.onDone = options.domOperation; - } - } - - // We assign the preparationClasses as the actual animation event since - // the internals of $animateCss will just suffix the event token values - // with `-active` to trigger the animation. - if (options.preparationClasses) { - options.event = concatWithSpace(options.event, options.preparationClasses); - } - - var animator = $animateCss(element, options); - - // the driver lookup code inside of $$animation attempts to spawn a - // driver one by one until a driver returns a.$$willAnimate animator object. - // $animateCss will always return an object, however, it will pass in - // a flag as a hint as to whether an animation was detected or not - return animator.$$willAnimate ? animator : null; - } - }]; -}]; - -// TODO(matsko): use caching here to speed things up for detection -// TODO(matsko): add documentation -// by the time... - -var $$AnimateJsProvider = ['$animateProvider', function($animateProvider) { - this.$get = ['$injector', '$$AnimateRunner', '$$jqLite', - function($injector, $$AnimateRunner, $$jqLite) { - - var applyAnimationClasses = applyAnimationClassesFactory($$jqLite); - // $animateJs(element, 'enter'); - return function(element, event, classes, options) { - var animationClosed = false; - - // the `classes` argument is optional and if it is not used - // then the classes will be resolved from the element's className - // property as well as options.addClass/options.removeClass. - if (arguments.length === 3 && isObject(classes)) { - options = classes; - classes = null; - } - - options = prepareAnimationOptions(options); - if (!classes) { - classes = element.attr('class') || ''; - if (options.addClass) { - classes += ' ' + options.addClass; - } - if (options.removeClass) { - classes += ' ' + options.removeClass; - } - } - - var classesToAdd = options.addClass; - var classesToRemove = options.removeClass; - - // the lookupAnimations function returns a series of animation objects that are - // matched up with one or more of the CSS classes. These animation objects are - // defined via the module.animation factory function. If nothing is detected then - // we don't return anything which then makes $animation query the next driver. - var animations = lookupAnimations(classes); - var before, after; - if (animations.length) { - var afterFn, beforeFn; - if (event == 'leave') { - beforeFn = 'leave'; - afterFn = 'afterLeave'; // TODO(matsko): get rid of this - } else { - beforeFn = 'before' + event.charAt(0).toUpperCase() + event.substr(1); - afterFn = event; - } - - if (event !== 'enter' && event !== 'move') { - before = packageAnimations(element, event, options, animations, beforeFn); - } - after = packageAnimations(element, event, options, animations, afterFn); - } - - // no matching animations - if (!before && !after) return; - - function applyOptions() { - options.domOperation(); - applyAnimationClasses(element, options); - } - - function close() { - animationClosed = true; - applyOptions(); - applyAnimationStyles(element, options); - } - - var runner; - - return { - $$willAnimate: true, - end: function() { - if (runner) { - runner.end(); - } else { - close(); - runner = new $$AnimateRunner(); - runner.complete(true); - } - return runner; - }, - start: function() { - if (runner) { - return runner; - } - - runner = new $$AnimateRunner(); - var closeActiveAnimations; - var chain = []; - - if (before) { - chain.push(function(fn) { - closeActiveAnimations = before(fn); - }); - } - - if (chain.length) { - chain.push(function(fn) { - applyOptions(); - fn(true); - }); - } else { - applyOptions(); - } - - if (after) { - chain.push(function(fn) { - closeActiveAnimations = after(fn); - }); - } - - runner.setHost({ - end: function() { - endAnimations(); - }, - cancel: function() { - endAnimations(true); - } - }); - - $$AnimateRunner.chain(chain, onComplete); - return runner; - - function onComplete(success) { - close(success); - runner.complete(success); - } - - function endAnimations(cancelled) { - if (!animationClosed) { - (closeActiveAnimations || noop)(cancelled); - onComplete(cancelled); - } - } - } - }; - - function executeAnimationFn(fn, element, event, options, onDone) { - var args; - switch (event) { - case 'animate': - args = [element, options.from, options.to, onDone]; - break; - - case 'setClass': - args = [element, classesToAdd, classesToRemove, onDone]; - break; - - case 'addClass': - args = [element, classesToAdd, onDone]; - break; - - case 'removeClass': - args = [element, classesToRemove, onDone]; - break; - - default: - args = [element, onDone]; - break; - } - - args.push(options); - - var value = fn.apply(fn, args); - if (value) { - if (isFunction(value.start)) { - value = value.start(); - } - - if (value instanceof $$AnimateRunner) { - value.done(onDone); - } else if (isFunction(value)) { - // optional onEnd / onCancel callback - return value; - } - } - - return noop; - } - - function groupEventedAnimations(element, event, options, animations, fnName) { - var operations = []; - forEach(animations, function(ani) { - var animation = ani[fnName]; - if (!animation) return; - - // note that all of these animations will run in parallel - operations.push(function() { - var runner; - var endProgressCb; - - var resolved = false; - var onAnimationComplete = function(rejected) { - if (!resolved) { - resolved = true; - (endProgressCb || noop)(rejected); - runner.complete(!rejected); - } - }; - - runner = new $$AnimateRunner({ - end: function() { - onAnimationComplete(); - }, - cancel: function() { - onAnimationComplete(true); - } - }); - - endProgressCb = executeAnimationFn(animation, element, event, options, function(result) { - var cancelled = result === false; - onAnimationComplete(cancelled); - }); - - return runner; - }); - }); - - return operations; - } - - function packageAnimations(element, event, options, animations, fnName) { - var operations = groupEventedAnimations(element, event, options, animations, fnName); - if (operations.length === 0) { - var a,b; - if (fnName === 'beforeSetClass') { - a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass'); - b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass'); - } else if (fnName === 'setClass') { - a = groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass'); - b = groupEventedAnimations(element, 'addClass', options, animations, 'addClass'); - } - - if (a) { - operations = operations.concat(a); - } - if (b) { - operations = operations.concat(b); - } - } - - if (operations.length === 0) return; - - // TODO(matsko): add documentation - return function startAnimation(callback) { - var runners = []; - if (operations.length) { - forEach(operations, function(animateFn) { - runners.push(animateFn()); - }); - } - - runners.length ? $$AnimateRunner.all(runners, callback) : callback(); - - return function endFn(reject) { - forEach(runners, function(runner) { - reject ? runner.cancel() : runner.end(); - }); - }; - }; - } - }; - - function lookupAnimations(classes) { - classes = isArray(classes) ? classes : classes.split(' '); - var matches = [], flagMap = {}; - for (var i=0; i < classes.length; i++) { - var klass = classes[i], - animationFactory = $animateProvider.$$registeredAnimations[klass]; - if (animationFactory && !flagMap[klass]) { - matches.push($injector.get(animationFactory)); - flagMap[klass] = true; - } - } - return matches; - } - }]; -}]; - -var $$AnimateJsDriverProvider = ['$$animationProvider', function($$animationProvider) { - $$animationProvider.drivers.push('$$animateJsDriver'); - this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) { - return function initDriverFn(animationDetails) { - if (animationDetails.from && animationDetails.to) { - var fromAnimation = prepareAnimation(animationDetails.from); - var toAnimation = prepareAnimation(animationDetails.to); - if (!fromAnimation && !toAnimation) return; - - return { - start: function() { - var animationRunners = []; - - if (fromAnimation) { - animationRunners.push(fromAnimation.start()); - } - - if (toAnimation) { - animationRunners.push(toAnimation.start()); - } - - $$AnimateRunner.all(animationRunners, done); - - var runner = new $$AnimateRunner({ - end: endFnFactory(), - cancel: endFnFactory() - }); - - return runner; - - function endFnFactory() { - return function() { - forEach(animationRunners, function(runner) { - // at this point we cannot cancel animations for groups just yet. 1.5+ - runner.end(); - }); - }; - } - - function done(status) { - runner.complete(status); - } - } - }; - } else { - return prepareAnimation(animationDetails); - } - }; - - function prepareAnimation(animationDetails) { - // TODO(matsko): make sure to check for grouped animations and delegate down to normal animations - var element = animationDetails.element; - var event = animationDetails.event; - var options = animationDetails.options; - var classes = animationDetails.classes; - return $$animateJs(element, event, classes, options); - } - }]; -}]; - -var NG_ANIMATE_ATTR_NAME = 'data-ng-animate'; -var NG_ANIMATE_PIN_DATA = '$ngAnimatePin'; -var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) { - var PRE_DIGEST_STATE = 1; - var RUNNING_STATE = 2; - var ONE_SPACE = ' '; - - var rules = this.rules = { - skip: [], - cancel: [], - join: [] - }; - - function makeTruthyCssClassMap(classString) { - if (!classString) { - return null; - } - - var keys = classString.split(ONE_SPACE); - var map = Object.create(null); - - forEach(keys, function(key) { - map[key] = true; - }); - return map; - } - - function hasMatchingClasses(newClassString, currentClassString) { - if (newClassString && currentClassString) { - var currentClassMap = makeTruthyCssClassMap(currentClassString); - return newClassString.split(ONE_SPACE).some(function(className) { - return currentClassMap[className]; - }); - } - } - - function isAllowed(ruleType, element, currentAnimation, previousAnimation) { - return rules[ruleType].some(function(fn) { - return fn(element, currentAnimation, previousAnimation); - }); - } - - function hasAnimationClasses(animation, and) { - var a = (animation.addClass || '').length > 0; - var b = (animation.removeClass || '').length > 0; - return and ? a && b : a || b; - } - - rules.join.push(function(element, newAnimation, currentAnimation) { - // if the new animation is class-based then we can just tack that on - return !newAnimation.structural && hasAnimationClasses(newAnimation); - }); - - rules.skip.push(function(element, newAnimation, currentAnimation) { - // there is no need to animate anything if no classes are being added and - // there is no structural animation that will be triggered - return !newAnimation.structural && !hasAnimationClasses(newAnimation); - }); - - rules.skip.push(function(element, newAnimation, currentAnimation) { - // why should we trigger a new structural animation if the element will - // be removed from the DOM anyway? - return currentAnimation.event == 'leave' && newAnimation.structural; - }); - - rules.skip.push(function(element, newAnimation, currentAnimation) { - // if there is an ongoing current animation then don't even bother running the class-based animation - return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural; - }); - - rules.cancel.push(function(element, newAnimation, currentAnimation) { - // there can never be two structural animations running at the same time - return currentAnimation.structural && newAnimation.structural; - }); - - rules.cancel.push(function(element, newAnimation, currentAnimation) { - // if the previous animation is already running, but the new animation will - // be triggered, but the new animation is structural - return currentAnimation.state === RUNNING_STATE && newAnimation.structural; - }); - - rules.cancel.push(function(element, newAnimation, currentAnimation) { - var nA = newAnimation.addClass; - var nR = newAnimation.removeClass; - var cA = currentAnimation.addClass; - var cR = currentAnimation.removeClass; - - // early detection to save the global CPU shortage :) - if ((isUndefined(nA) && isUndefined(nR)) || (isUndefined(cA) && isUndefined(cR))) { - return false; - } - - return hasMatchingClasses(nA, cR) || hasMatchingClasses(nR, cA); - }); - - this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap', - '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow', - function($$rAF, $rootScope, $rootElement, $document, $$HashMap, - $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow) { - - var activeAnimationsLookup = new $$HashMap(); - var disabledElementsLookup = new $$HashMap(); - var animationsEnabled = null; - - function postDigestTaskFactory() { - var postDigestCalled = false; - return function(fn) { - // we only issue a call to postDigest before - // it has first passed. This prevents any callbacks - // from not firing once the animation has completed - // since it will be out of the digest cycle. - if (postDigestCalled) { - fn(); - } else { - $rootScope.$$postDigest(function() { - postDigestCalled = true; - fn(); - }); - } - }; - } - - // Wait until all directive and route-related templates are downloaded and - // compiled. The $templateRequest.totalPendingRequests variable keeps track of - // all of the remote templates being currently downloaded. If there are no - // templates currently downloading then the watcher will still fire anyway. - var deregisterWatch = $rootScope.$watch( - function() { return $templateRequest.totalPendingRequests === 0; }, - function(isEmpty) { - if (!isEmpty) return; - deregisterWatch(); - - // Now that all templates have been downloaded, $animate will wait until - // the post digest queue is empty before enabling animations. By having two - // calls to $postDigest calls we can ensure that the flag is enabled at the - // very end of the post digest queue. Since all of the animations in $animate - // use $postDigest, it's important that the code below executes at the end. - // This basically means that the page is fully downloaded and compiled before - // any animations are triggered. - $rootScope.$$postDigest(function() { - $rootScope.$$postDigest(function() { - // we check for null directly in the event that the application already called - // .enabled() with whatever arguments that it provided it with - if (animationsEnabled === null) { - animationsEnabled = true; - } - }); - }); - } - ); - - var callbackRegistry = {}; - - // remember that the classNameFilter is set during the provider/config - // stage therefore we can optimize here and setup a helper function - var classNameFilter = $animateProvider.classNameFilter(); - var isAnimatableClassName = !classNameFilter - ? function() { return true; } - : function(className) { - return classNameFilter.test(className); - }; - - var applyAnimationClasses = applyAnimationClassesFactory($$jqLite); - - function normalizeAnimationDetails(element, animation) { - return mergeAnimationDetails(element, animation, {}); - } - - // IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259. - var contains = Node.prototype.contains || function(arg) { - // jshint bitwise: false - return this === arg || !!(this.compareDocumentPosition(arg) & 16); - // jshint bitwise: true - }; - - function findCallbacks(parent, element, event) { - var targetNode = getDomNode(element); - var targetParentNode = getDomNode(parent); - - var matches = []; - var entries = callbackRegistry[event]; - if (entries) { - forEach(entries, function(entry) { - if (contains.call(entry.node, targetNode)) { - matches.push(entry.callback); - } else if (event === 'leave' && contains.call(entry.node, targetParentNode)) { - matches.push(entry.callback); - } - }); - } - - return matches; - } - - return { - on: function(event, container, callback) { - var node = extractElementNode(container); - callbackRegistry[event] = callbackRegistry[event] || []; - callbackRegistry[event].push({ - node: node, - callback: callback - }); - }, - - off: function(event, container, callback) { - var entries = callbackRegistry[event]; - if (!entries) return; - - callbackRegistry[event] = arguments.length === 1 - ? null - : filterFromRegistry(entries, container, callback); - - function filterFromRegistry(list, matchContainer, matchCallback) { - var containerNode = extractElementNode(matchContainer); - return list.filter(function(entry) { - var isMatch = entry.node === containerNode && - (!matchCallback || entry.callback === matchCallback); - return !isMatch; - }); - } - }, - - pin: function(element, parentElement) { - assertArg(isElement(element), 'element', 'not an element'); - assertArg(isElement(parentElement), 'parentElement', 'not an element'); - element.data(NG_ANIMATE_PIN_DATA, parentElement); - }, - - push: function(element, event, options, domOperation) { - options = options || {}; - options.domOperation = domOperation; - return queueAnimation(element, event, options); - }, - - // this method has four signatures: - // () - global getter - // (bool) - global setter - // (element) - element getter - // (element, bool) - element setter - enabled: function(element, bool) { - var argCount = arguments.length; - - if (argCount === 0) { - // () - Global getter - bool = !!animationsEnabled; - } else { - var hasElement = isElement(element); - - if (!hasElement) { - // (bool) - Global setter - bool = animationsEnabled = !!element; - } else { - var node = getDomNode(element); - var recordExists = disabledElementsLookup.get(node); - - if (argCount === 1) { - // (element) - Element getter - bool = !recordExists; - } else { - // (element, bool) - Element setter - disabledElementsLookup.put(node, !bool); - } - } - } - - return bool; - } - }; - - function queueAnimation(element, event, initialOptions) { - // we always make a copy of the options since - // there should never be any side effects on - // the input data when running `$animateCss`. - var options = copy(initialOptions); - - var node, parent; - element = stripCommentsFromElement(element); - if (element) { - node = getDomNode(element); - parent = element.parent(); - } - - options = prepareAnimationOptions(options); - - // we create a fake runner with a working promise. - // These methods will become available after the digest has passed - var runner = new $$AnimateRunner(); - - // this is used to trigger callbacks in postDigest mode - var runInNextPostDigestOrNow = postDigestTaskFactory(); - - if (isArray(options.addClass)) { - options.addClass = options.addClass.join(' '); - } - - if (options.addClass && !isString(options.addClass)) { - options.addClass = null; - } - - if (isArray(options.removeClass)) { - options.removeClass = options.removeClass.join(' '); - } - - if (options.removeClass && !isString(options.removeClass)) { - options.removeClass = null; - } - - if (options.from && !isObject(options.from)) { - options.from = null; - } - - if (options.to && !isObject(options.to)) { - options.to = null; - } - - // there are situations where a directive issues an animation for - // a jqLite wrapper that contains only comment nodes... If this - // happens then there is no way we can perform an animation - if (!node) { - close(); - return runner; - } - - var className = [node.className, options.addClass, options.removeClass].join(' '); - if (!isAnimatableClassName(className)) { - close(); - return runner; - } - - var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0; - - // this is a hard disable of all animations for the application or on - // the element itself, therefore there is no need to continue further - // past this point if not enabled - // Animations are also disabled if the document is currently hidden (page is not visible - // to the user), because browsers slow down or do not flush calls to requestAnimationFrame - var skipAnimations = !animationsEnabled || $document[0].hidden || disabledElementsLookup.get(node); - var existingAnimation = (!skipAnimations && activeAnimationsLookup.get(node)) || {}; - var hasExistingAnimation = !!existingAnimation.state; - - // there is no point in traversing the same collection of parent ancestors if a followup - // animation will be run on the same element that already did all that checking work - if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state != PRE_DIGEST_STATE)) { - skipAnimations = !areAnimationsAllowed(element, parent, event); - } - - if (skipAnimations) { - close(); - return runner; - } - - if (isStructural) { - closeChildAnimations(element); - } - - var newAnimation = { - structural: isStructural, - element: element, - event: event, - addClass: options.addClass, - removeClass: options.removeClass, - close: close, - options: options, - runner: runner - }; - - if (hasExistingAnimation) { - var skipAnimationFlag = isAllowed('skip', element, newAnimation, existingAnimation); - if (skipAnimationFlag) { - if (existingAnimation.state === RUNNING_STATE) { - close(); - return runner; - } else { - mergeAnimationDetails(element, existingAnimation, newAnimation); - return existingAnimation.runner; - } - } - var cancelAnimationFlag = isAllowed('cancel', element, newAnimation, existingAnimation); - if (cancelAnimationFlag) { - if (existingAnimation.state === RUNNING_STATE) { - // this will end the animation right away and it is safe - // to do so since the animation is already running and the - // runner callback code will run in async - existingAnimation.runner.end(); - } else if (existingAnimation.structural) { - // this means that the animation is queued into a digest, but - // hasn't started yet. Therefore it is safe to run the close - // method which will call the runner methods in async. - existingAnimation.close(); - } else { - // this will merge the new animation options into existing animation options - mergeAnimationDetails(element, existingAnimation, newAnimation); - - return existingAnimation.runner; - } - } else { - // a joined animation means that this animation will take over the existing one - // so an example would involve a leave animation taking over an enter. Then when - // the postDigest kicks in the enter will be ignored. - var joinAnimationFlag = isAllowed('join', element, newAnimation, existingAnimation); - if (joinAnimationFlag) { - if (existingAnimation.state === RUNNING_STATE) { - normalizeAnimationDetails(element, newAnimation); - } else { - applyGeneratedPreparationClasses(element, isStructural ? event : null, options); - - event = newAnimation.event = existingAnimation.event; - options = mergeAnimationDetails(element, existingAnimation, newAnimation); - - //we return the same runner since only the option values of this animation will - //be fed into the `existingAnimation`. - return existingAnimation.runner; - } - } - } - } else { - // normalization in this case means that it removes redundant CSS classes that - // already exist (addClass) or do not exist (removeClass) on the element - normalizeAnimationDetails(element, newAnimation); - } - - // when the options are merged and cleaned up we may end up not having to do - // an animation at all, therefore we should check this before issuing a post - // digest callback. Structural animations will always run no matter what. - var isValidAnimation = newAnimation.structural; - if (!isValidAnimation) { - // animate (from/to) can be quickly checked first, otherwise we check if any classes are present - isValidAnimation = (newAnimation.event === 'animate' && Object.keys(newAnimation.options.to || {}).length > 0) - || hasAnimationClasses(newAnimation); - } - - if (!isValidAnimation) { - close(); - clearElementAnimationState(element); - return runner; - } - - // the counter keeps track of cancelled animations - var counter = (existingAnimation.counter || 0) + 1; - newAnimation.counter = counter; - - markElementAnimationState(element, PRE_DIGEST_STATE, newAnimation); - - $rootScope.$$postDigest(function() { - var animationDetails = activeAnimationsLookup.get(node); - var animationCancelled = !animationDetails; - animationDetails = animationDetails || {}; - - // if addClass/removeClass is called before something like enter then the - // registered parent element may not be present. The code below will ensure - // that a final value for parent element is obtained - var parentElement = element.parent() || []; - - // animate/structural/class-based animations all have requirements. Otherwise there - // is no point in performing an animation. The parent node must also be set. - var isValidAnimation = parentElement.length > 0 - && (animationDetails.event === 'animate' - || animationDetails.structural - || hasAnimationClasses(animationDetails)); - - // this means that the previous animation was cancelled - // even if the follow-up animation is the same event - if (animationCancelled || animationDetails.counter !== counter || !isValidAnimation) { - // if another animation did not take over then we need - // to make sure that the domOperation and options are - // handled accordingly - if (animationCancelled) { - applyAnimationClasses(element, options); - applyAnimationStyles(element, options); - } - - // if the event changed from something like enter to leave then we do - // it, otherwise if it's the same then the end result will be the same too - if (animationCancelled || (isStructural && animationDetails.event !== event)) { - options.domOperation(); - runner.end(); - } - - // in the event that the element animation was not cancelled or a follow-up animation - // isn't allowed to animate from here then we need to clear the state of the element - // so that any future animations won't read the expired animation data. - if (!isValidAnimation) { - clearElementAnimationState(element); - } - - return; - } - - // this combined multiple class to addClass / removeClass into a setClass event - // so long as a structural event did not take over the animation - event = !animationDetails.structural && hasAnimationClasses(animationDetails, true) - ? 'setClass' - : animationDetails.event; - - markElementAnimationState(element, RUNNING_STATE); - var realRunner = $$animation(element, event, animationDetails.options); - - realRunner.done(function(status) { - close(!status); - var animationDetails = activeAnimationsLookup.get(node); - if (animationDetails && animationDetails.counter === counter) { - clearElementAnimationState(getDomNode(element)); - } - notifyProgress(runner, event, 'close', {}); - }); - - // this will update the runner's flow-control events based on - // the `realRunner` object. - runner.setHost(realRunner); - notifyProgress(runner, event, 'start', {}); - }); - - return runner; - - function notifyProgress(runner, event, phase, data) { - runInNextPostDigestOrNow(function() { - var callbacks = findCallbacks(parent, element, event); - if (callbacks.length) { - // do not optimize this call here to RAF because - // we don't know how heavy the callback code here will - // be and if this code is buffered then this can - // lead to a performance regression. - $$rAF(function() { - forEach(callbacks, function(callback) { - callback(element, phase, data); - }); - }); - } - }); - runner.progress(event, phase, data); - } - - function close(reject) { // jshint ignore:line - clearGeneratedClasses(element, options); - applyAnimationClasses(element, options); - applyAnimationStyles(element, options); - options.domOperation(); - runner.complete(!reject); - } - } - - function closeChildAnimations(element) { - var node = getDomNode(element); - var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']'); - forEach(children, function(child) { - var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME)); - var animationDetails = activeAnimationsLookup.get(child); - if (animationDetails) { - switch (state) { - case RUNNING_STATE: - animationDetails.runner.end(); - /* falls through */ - case PRE_DIGEST_STATE: - activeAnimationsLookup.remove(child); - break; - } - } - }); - } - - function clearElementAnimationState(element) { - var node = getDomNode(element); - node.removeAttribute(NG_ANIMATE_ATTR_NAME); - activeAnimationsLookup.remove(node); - } - - function isMatchingElement(nodeOrElmA, nodeOrElmB) { - return getDomNode(nodeOrElmA) === getDomNode(nodeOrElmB); - } - - /** - * This fn returns false if any of the following is true: - * a) animations on any parent element are disabled, and animations on the element aren't explicitly allowed - * b) a parent element has an ongoing structural animation, and animateChildren is false - * c) the element is not a child of the body - * d) the element is not a child of the $rootElement - */ - function areAnimationsAllowed(element, parentElement, event) { - var bodyElement = jqLite($document[0].body); - var bodyElementDetected = isMatchingElement(element, bodyElement) || element[0].nodeName === 'HTML'; - var rootElementDetected = isMatchingElement(element, $rootElement); - var parentAnimationDetected = false; - var animateChildren; - var elementDisabled = disabledElementsLookup.get(getDomNode(element)); - - var parentHost = element.data(NG_ANIMATE_PIN_DATA); - if (parentHost) { - parentElement = parentHost; - } - - while (parentElement && parentElement.length) { - if (!rootElementDetected) { - // angular doesn't want to attempt to animate elements outside of the application - // therefore we need to ensure that the rootElement is an ancestor of the current element - rootElementDetected = isMatchingElement(parentElement, $rootElement); - } - - var parentNode = parentElement[0]; - if (parentNode.nodeType !== ELEMENT_NODE) { - // no point in inspecting the #document element - break; - } - - var details = activeAnimationsLookup.get(parentNode) || {}; - // either an enter, leave or move animation will commence - // therefore we can't allow any animations to take place - // but if a parent animation is class-based then that's ok - if (!parentAnimationDetected) { - var parentElementDisabled = disabledElementsLookup.get(parentNode); - - if (parentElementDisabled === true && elementDisabled !== false) { - // disable animations if the user hasn't explicitly enabled animations on the - // current element - elementDisabled = true; - // element is disabled via parent element, no need to check anything else - break; - } else if (parentElementDisabled === false) { - elementDisabled = false; - } - parentAnimationDetected = details.structural; - } - - if (isUndefined(animateChildren) || animateChildren === true) { - var value = parentElement.data(NG_ANIMATE_CHILDREN_DATA); - if (isDefined(value)) { - animateChildren = value; - } - } - - // there is no need to continue traversing at this point - if (parentAnimationDetected && animateChildren === false) break; - - if (!bodyElementDetected) { - // we also need to ensure that the element is or will be a part of the body element - // otherwise it is pointless to even issue an animation to be rendered - bodyElementDetected = isMatchingElement(parentElement, bodyElement); - } - - if (bodyElementDetected && rootElementDetected) { - // If both body and root have been found, any other checks are pointless, - // as no animation data should live outside the application - break; - } - - if (!rootElementDetected) { - // If no rootElement is detected, check if the parentElement is pinned to another element - parentHost = parentElement.data(NG_ANIMATE_PIN_DATA); - if (parentHost) { - // The pin target element becomes the next parent element - parentElement = parentHost; - continue; - } - } - - parentElement = parentElement.parent(); - } - - var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true; - return allowAnimation && rootElementDetected && bodyElementDetected; - } - - function markElementAnimationState(element, state, details) { - details = details || {}; - details.state = state; - - var node = getDomNode(element); - node.setAttribute(NG_ANIMATE_ATTR_NAME, state); - - var oldValue = activeAnimationsLookup.get(node); - var newValue = oldValue - ? extend(oldValue, details) - : details; - activeAnimationsLookup.put(node, newValue); - } - }]; -}]; - -var $$AnimationProvider = ['$animateProvider', function($animateProvider) { - var NG_ANIMATE_REF_ATTR = 'ng-animate-ref'; - - var drivers = this.drivers = []; - - var RUNNER_STORAGE_KEY = '$$animationRunner'; - - function setRunner(element, runner) { - element.data(RUNNER_STORAGE_KEY, runner); - } - - function removeRunner(element) { - element.removeData(RUNNER_STORAGE_KEY); - } - - function getRunner(element) { - return element.data(RUNNER_STORAGE_KEY); - } - - this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$HashMap', '$$rAFScheduler', - function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$HashMap, $$rAFScheduler) { - - var animationQueue = []; - var applyAnimationClasses = applyAnimationClassesFactory($$jqLite); - - function sortAnimations(animations) { - var tree = { children: [] }; - var i, lookup = new $$HashMap(); - - // this is done first beforehand so that the hashmap - // is filled with a list of the elements that will be animated - for (i = 0; i < animations.length; i++) { - var animation = animations[i]; - lookup.put(animation.domNode, animations[i] = { - domNode: animation.domNode, - fn: animation.fn, - children: [] - }); - } - - for (i = 0; i < animations.length; i++) { - processNode(animations[i]); - } - - return flatten(tree); - - function processNode(entry) { - if (entry.processed) return entry; - entry.processed = true; - - var elementNode = entry.domNode; - var parentNode = elementNode.parentNode; - lookup.put(elementNode, entry); - - var parentEntry; - while (parentNode) { - parentEntry = lookup.get(parentNode); - if (parentEntry) { - if (!parentEntry.processed) { - parentEntry = processNode(parentEntry); - } - break; - } - parentNode = parentNode.parentNode; - } - - (parentEntry || tree).children.push(entry); - return entry; - } - - function flatten(tree) { - var result = []; - var queue = []; - var i; - - for (i = 0; i < tree.children.length; i++) { - queue.push(tree.children[i]); - } - - var remainingLevelEntries = queue.length; - var nextLevelEntries = 0; - var row = []; - - for (i = 0; i < queue.length; i++) { - var entry = queue[i]; - if (remainingLevelEntries <= 0) { - remainingLevelEntries = nextLevelEntries; - nextLevelEntries = 0; - result.push(row); - row = []; - } - row.push(entry.fn); - entry.children.forEach(function(childEntry) { - nextLevelEntries++; - queue.push(childEntry); - }); - remainingLevelEntries--; - } - - if (row.length) { - result.push(row); - } - - return result; - } - } - - // TODO(matsko): document the signature in a better way - return function(element, event, options) { - options = prepareAnimationOptions(options); - var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0; - - // there is no animation at the current moment, however - // these runner methods will get later updated with the - // methods leading into the driver's end/cancel methods - // for now they just stop the animation from starting - var runner = new $$AnimateRunner({ - end: function() { close(); }, - cancel: function() { close(true); } - }); - - if (!drivers.length) { - close(); - return runner; - } - - setRunner(element, runner); - - var classes = mergeClasses(element.attr('class'), mergeClasses(options.addClass, options.removeClass)); - var tempClasses = options.tempClasses; - if (tempClasses) { - classes += ' ' + tempClasses; - options.tempClasses = null; - } - - var prepareClassName; - if (isStructural) { - prepareClassName = 'ng-' + event + PREPARE_CLASS_SUFFIX; - $$jqLite.addClass(element, prepareClassName); - } - - animationQueue.push({ - // this data is used by the postDigest code and passed into - // the driver step function - element: element, - classes: classes, - event: event, - structural: isStructural, - options: options, - beforeStart: beforeStart, - close: close - }); - - element.on('$destroy', handleDestroyedElement); - - // we only want there to be one function called within the post digest - // block. This way we can group animations for all the animations that - // were apart of the same postDigest flush call. - if (animationQueue.length > 1) return runner; - - $rootScope.$$postDigest(function() { - var animations = []; - forEach(animationQueue, function(entry) { - // the element was destroyed early on which removed the runner - // form its storage. This means we can't animate this element - // at all and it already has been closed due to destruction. - if (getRunner(entry.element)) { - animations.push(entry); - } else { - entry.close(); - } - }); - - // now any future animations will be in another postDigest - animationQueue.length = 0; - - var groupedAnimations = groupAnimations(animations); - var toBeSortedAnimations = []; - - forEach(groupedAnimations, function(animationEntry) { - toBeSortedAnimations.push({ - domNode: getDomNode(animationEntry.from ? animationEntry.from.element : animationEntry.element), - fn: function triggerAnimationStart() { - // it's important that we apply the `ng-animate` CSS class and the - // temporary classes before we do any driver invoking since these - // CSS classes may be required for proper CSS detection. - animationEntry.beforeStart(); - - var startAnimationFn, closeFn = animationEntry.close; - - // in the event that the element was removed before the digest runs or - // during the RAF sequencing then we should not trigger the animation. - var targetElement = animationEntry.anchors - ? (animationEntry.from.element || animationEntry.to.element) - : animationEntry.element; - - if (getRunner(targetElement)) { - var operation = invokeFirstDriver(animationEntry); - if (operation) { - startAnimationFn = operation.start; - } - } - - if (!startAnimationFn) { - closeFn(); - } else { - var animationRunner = startAnimationFn(); - animationRunner.done(function(status) { - closeFn(!status); - }); - updateAnimationRunners(animationEntry, animationRunner); - } - } - }); - }); - - // we need to sort each of the animations in order of parent to child - // relationships. This ensures that the child classes are applied at the - // right time. - $$rAFScheduler(sortAnimations(toBeSortedAnimations)); - }); - - return runner; - - // TODO(matsko): change to reference nodes - function getAnchorNodes(node) { - var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']'; - var items = node.hasAttribute(NG_ANIMATE_REF_ATTR) - ? [node] - : node.querySelectorAll(SELECTOR); - var anchors = []; - forEach(items, function(node) { - var attr = node.getAttribute(NG_ANIMATE_REF_ATTR); - if (attr && attr.length) { - anchors.push(node); - } - }); - return anchors; - } - - function groupAnimations(animations) { - var preparedAnimations = []; - var refLookup = {}; - forEach(animations, function(animation, index) { - var element = animation.element; - var node = getDomNode(element); - var event = animation.event; - var enterOrMove = ['enter', 'move'].indexOf(event) >= 0; - var anchorNodes = animation.structural ? getAnchorNodes(node) : []; - - if (anchorNodes.length) { - var direction = enterOrMove ? 'to' : 'from'; - - forEach(anchorNodes, function(anchor) { - var key = anchor.getAttribute(NG_ANIMATE_REF_ATTR); - refLookup[key] = refLookup[key] || {}; - refLookup[key][direction] = { - animationID: index, - element: jqLite(anchor) - }; - }); - } else { - preparedAnimations.push(animation); - } - }); - - var usedIndicesLookup = {}; - var anchorGroups = {}; - forEach(refLookup, function(operations, key) { - var from = operations.from; - var to = operations.to; - - if (!from || !to) { - // only one of these is set therefore we can't have an - // anchor animation since all three pieces are required - var index = from ? from.animationID : to.animationID; - var indexKey = index.toString(); - if (!usedIndicesLookup[indexKey]) { - usedIndicesLookup[indexKey] = true; - preparedAnimations.push(animations[index]); - } - return; - } - - var fromAnimation = animations[from.animationID]; - var toAnimation = animations[to.animationID]; - var lookupKey = from.animationID.toString(); - if (!anchorGroups[lookupKey]) { - var group = anchorGroups[lookupKey] = { - structural: true, - beforeStart: function() { - fromAnimation.beforeStart(); - toAnimation.beforeStart(); - }, - close: function() { - fromAnimation.close(); - toAnimation.close(); - }, - classes: cssClassesIntersection(fromAnimation.classes, toAnimation.classes), - from: fromAnimation, - to: toAnimation, - anchors: [] // TODO(matsko): change to reference nodes - }; - - // the anchor animations require that the from and to elements both have at least - // one shared CSS class which effectively marries the two elements together to use - // the same animation driver and to properly sequence the anchor animation. - if (group.classes.length) { - preparedAnimations.push(group); - } else { - preparedAnimations.push(fromAnimation); - preparedAnimations.push(toAnimation); - } - } - - anchorGroups[lookupKey].anchors.push({ - 'out': from.element, 'in': to.element - }); - }); - - return preparedAnimations; - } - - function cssClassesIntersection(a,b) { - a = a.split(' '); - b = b.split(' '); - var matches = []; - - for (var i = 0; i < a.length; i++) { - var aa = a[i]; - if (aa.substring(0,3) === 'ng-') continue; - - for (var j = 0; j < b.length; j++) { - if (aa === b[j]) { - matches.push(aa); - break; - } - } - } - - return matches.join(' '); - } - - function invokeFirstDriver(animationDetails) { - // we loop in reverse order since the more general drivers (like CSS and JS) - // may attempt more elements, but custom drivers are more particular - for (var i = drivers.length - 1; i >= 0; i--) { - var driverName = drivers[i]; - if (!$injector.has(driverName)) continue; // TODO(matsko): remove this check - - var factory = $injector.get(driverName); - var driver = factory(animationDetails); - if (driver) { - return driver; - } - } - } - - function beforeStart() { - element.addClass(NG_ANIMATE_CLASSNAME); - if (tempClasses) { - $$jqLite.addClass(element, tempClasses); - } - if (prepareClassName) { - $$jqLite.removeClass(element, prepareClassName); - prepareClassName = null; - } - } - - function updateAnimationRunners(animation, newRunner) { - if (animation.from && animation.to) { - update(animation.from.element); - update(animation.to.element); - } else { - update(animation.element); - } - - function update(element) { - getRunner(element).setHost(newRunner); - } - } - - function handleDestroyedElement() { - var runner = getRunner(element); - if (runner && (event !== 'leave' || !options.$$domOperationFired)) { - runner.end(); - } - } - - function close(rejected) { // jshint ignore:line - element.off('$destroy', handleDestroyedElement); - removeRunner(element); - - applyAnimationClasses(element, options); - applyAnimationStyles(element, options); - options.domOperation(); - - if (tempClasses) { - $$jqLite.removeClass(element, tempClasses); - } - - element.removeClass(NG_ANIMATE_CLASSNAME); - runner.complete(!rejected); - } - }; - }]; -}]; - -/** - * @ngdoc directive - * @name ngAnimateSwap - * @restrict A - * @scope - * - * @description - * - * ngAnimateSwap is a animation-oriented directive that allows for the container to - * be removed and entered in whenever the associated expression changes. A - * common usecase for this directive is a rotating banner component which - * contains one image being present at a time. When the active image changes - * then the old image will perform a `leave` animation and the new element - * will be inserted via an `enter` animation. - * - * @example - * - * - *
    - *
    - * {{ number }} - *
    - *
    - *
    - * - * angular.module('ngAnimateSwapExample', ['ngAnimate']) - * .controller('AppCtrl', ['$scope', '$interval', function($scope, $interval) { - * $scope.number = 0; - * $interval(function() { - * $scope.number++; - * }, 1000); - * - * var colors = ['red','blue','green','yellow','orange']; - * $scope.colorClass = function(number) { - * return colors[number % colors.length]; - * }; - * }]); - * - * - * .container { - * height:250px; - * width:250px; - * position:relative; - * overflow:hidden; - * border:2px solid black; - * } - * .container .cell { - * font-size:150px; - * text-align:center; - * line-height:250px; - * position:absolute; - * top:0; - * left:0; - * right:0; - * border-bottom:2px solid black; - * } - * .swap-animation.ng-enter, .swap-animation.ng-leave { - * transition:0.5s linear all; - * } - * .swap-animation.ng-enter { - * top:-250px; - * } - * .swap-animation.ng-enter-active { - * top:0px; - * } - * .swap-animation.ng-leave { - * top:0px; - * } - * .swap-animation.ng-leave-active { - * top:250px; - * } - * .red { background:red; } - * .green { background:green; } - * .blue { background:blue; } - * .yellow { background:yellow; } - * .orange { background:orange; } - * - *
    - */ -var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $rootScope) { - return { - restrict: 'A', - transclude: 'element', - terminal: true, - priority: 600, // we use 600 here to ensure that the directive is caught before others - link: function(scope, $element, attrs, ctrl, $transclude) { - var previousElement, previousScope; - scope.$watchCollection(attrs.ngAnimateSwap || attrs['for'], function(value) { - if (previousElement) { - $animate.leave(previousElement); - } - if (previousScope) { - previousScope.$destroy(); - previousScope = null; - } - if (value || value === 0) { - previousScope = scope.$new(); - $transclude(previousScope, function(element) { - previousElement = element; - $animate.enter(element, null, $element); - }); - } - }); - } - }; -}]; - -/* global angularAnimateModule: true, - - ngAnimateSwapDirective, - $$AnimateAsyncRunFactory, - $$rAFSchedulerFactory, - $$AnimateChildrenDirective, - $$AnimateQueueProvider, - $$AnimationProvider, - $AnimateCssProvider, - $$AnimateCssDriverProvider, - $$AnimateJsProvider, - $$AnimateJsDriverProvider, -*/ - -/** - * @ngdoc module - * @name ngAnimate - * @description - * - * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via - * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an Angular app. - * - *
    - * - * # Usage - * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based - * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For - * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within - * the HTML element that the animation will be triggered on. - * - * ## Directive Support - * The following directives are "animation aware": - * - * | Directive | Supported Animations | - * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------| - * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave and move | - * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave | - * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave | - * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave | - * | {@link ng.directive:ngIf#animations ngIf} | enter and leave | - * | {@link ng.directive:ngClass#animations ngClass} | add and remove (the CSS class(es) present) | - * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide} | add and remove (the ng-hide class value) | - * | {@link ng.directive:form#animation-hooks form} & {@link ng.directive:ngModel#animation-hooks ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) | - * | {@link module:ngMessages#animations ngMessages} | add and remove (ng-active & ng-inactive) | - * | {@link module:ngMessages#animations ngMessage} | enter and leave | - * - * (More information can be found by visiting each the documentation associated with each directive.) - * - * ## CSS-based Animations - * - * CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML - * and CSS code we can create an animation that will be picked up by Angular when an the underlying directive performs an operation. - * - * The example below shows how an `enter` animation can be made possible on an element using `ng-if`: - * - * ```html - *
    - * Fade me in out - *
    - * - * - * ``` - * - * Notice the CSS class **fade**? We can now create the CSS transition code that references this class: - * - * ```css - * /* The starting CSS styles for the enter animation */ - * .fade.ng-enter { - * transition:0.5s linear all; - * opacity:0; - * } - * - * /* The finishing CSS styles for the enter animation */ - * .fade.ng-enter.ng-enter-active { - * opacity:1; - * } - * ``` - * - * The key thing to remember here is that, depending on the animation event (which each of the directives above trigger depending on what's going on) two - * generated CSS classes will be applied to the element; in the example above we have `.ng-enter` and `.ng-enter-active`. For CSS transitions, the transition - * code **must** be defined within the starting CSS class (in this case `.ng-enter`). The destination class is what the transition will animate towards. - * - * If for example we wanted to create animations for `leave` and `move` (ngRepeat triggers move) then we can do so using the same CSS naming conventions: - * - * ```css - * /* now the element will fade out before it is removed from the DOM */ - * .fade.ng-leave { - * transition:0.5s linear all; - * opacity:1; - * } - * .fade.ng-leave.ng-leave-active { - * opacity:0; - * } - * ``` - * - * We can also make use of **CSS Keyframes** by referencing the keyframe animation within the starting CSS class: - * - * ```css - * /* there is no need to define anything inside of the destination - * CSS class since the keyframe will take charge of the animation */ - * .fade.ng-leave { - * animation: my_fade_animation 0.5s linear; - * -webkit-animation: my_fade_animation 0.5s linear; - * } - * - * @keyframes my_fade_animation { - * from { opacity:1; } - * to { opacity:0; } - * } - * - * @-webkit-keyframes my_fade_animation { - * from { opacity:1; } - * to { opacity:0; } - * } - * ``` - * - * Feel free also mix transitions and keyframes together as well as any other CSS classes on the same element. - * - * ### CSS Class-based Animations - * - * Class-based animations (animations that are triggered via `ngClass`, `ngShow`, `ngHide` and some other directives) have a slightly different - * naming convention. Class-based animations are basic enough that a standard transition or keyframe can be referenced on the class being added - * and removed. - * - * For example if we wanted to do a CSS animation for `ngHide` then we place an animation on the `.ng-hide` CSS class: - * - * ```html - *
    - * Show and hide me - *
    - * - * - * - * ``` - * - * All that is going on here with ngShow/ngHide behind the scenes is the `.ng-hide` class is added/removed (when the hidden state is valid). Since - * ngShow and ngHide are animation aware then we can match up a transition and ngAnimate handles the rest. - * - * In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods that we can use to further decorate the animation - * with CSS styles. - * - * ```html - *
    - * Highlight this box - *
    - * - * - * - * ``` - * - * We can also make use of CSS keyframes by placing them within the CSS classes. - * - * - * ### CSS Staggering Animations - * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a - * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be - * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for - * the animation. The style property expected within the stagger class can either be a **transition-delay** or an - * **animation-delay** property (or both if your animation contains both transitions and keyframe animations). - * - * ```css - * .my-animation.ng-enter { - * /* standard transition code */ - * transition: 1s linear all; - * opacity:0; - * } - * .my-animation.ng-enter-stagger { - * /* this will have a 100ms delay between each successive leave animation */ - * transition-delay: 0.1s; - * - * /* As of 1.4.4, this must always be set: it signals ngAnimate - * to not accidentally inherit a delay property from another CSS class */ - * transition-duration: 0s; - * } - * .my-animation.ng-enter.ng-enter-active { - * /* standard transition styles */ - * opacity:1; - * } - * ``` - * - * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations - * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this - * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation - * will also be reset if one or more animation frames have passed since the multiple calls to `$animate` were fired. - * - * The following code will issue the **ng-leave-stagger** event on the element provided: - * - * ```js - * var kids = parent.children(); - * - * $animate.leave(kids[0]); //stagger index=0 - * $animate.leave(kids[1]); //stagger index=1 - * $animate.leave(kids[2]); //stagger index=2 - * $animate.leave(kids[3]); //stagger index=3 - * $animate.leave(kids[4]); //stagger index=4 - * - * window.requestAnimationFrame(function() { - * //stagger has reset itself - * $animate.leave(kids[5]); //stagger index=0 - * $animate.leave(kids[6]); //stagger index=1 - * - * $scope.$digest(); - * }); - * ``` - * - * Stagger animations are currently only supported within CSS-defined animations. - * - * ### The `ng-animate` CSS class - * - * When ngAnimate is animating an element it will apply the `ng-animate` CSS class to the element for the duration of the animation. - * This is a temporary CSS class and it will be removed once the animation is over (for both JavaScript and CSS-based animations). - * - * Therefore, animations can be applied to an element using this temporary class directly via CSS. - * - * ```css - * .zipper.ng-animate { - * transition:0.5s linear all; - * } - * .zipper.ng-enter { - * opacity:0; - * } - * .zipper.ng-enter.ng-enter-active { - * opacity:1; - * } - * .zipper.ng-leave { - * opacity:1; - * } - * .zipper.ng-leave.ng-leave-active { - * opacity:0; - * } - * ``` - * - * (Note that the `ng-animate` CSS class is reserved and it cannot be applied on an element directly since ngAnimate will always remove - * the CSS class once an animation has completed.) - * - * - * ### The `ng-[event]-prepare` class - * - * This is a special class that can be used to prevent unwanted flickering / flash of content before - * the actual animation starts. The class is added as soon as an animation is initialized, but removed - * before the actual animation starts (after waiting for a $digest). - * It is also only added for *structural* animations (`enter`, `move`, and `leave`). - * - * In practice, flickering can appear when nesting elements with structural animations such as `ngIf` - * into elements that have class-based animations such as `ngClass`. - * - * ```html - *
    - *
    - *
    - *
    - *
    - * ``` - * - * It is possible that during the `enter` animation, the `.message` div will be briefly visible before it starts animating. - * In that case, you can add styles to the CSS that make sure the element stays hidden before the animation starts: - * - * ```css - * .message.ng-enter-prepare { - * opacity: 0; - * } - * - * ``` - * - * ## JavaScript-based Animations - * - * ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared - * CSS class that is referenced in our HTML code) but in addition we need to register the JavaScript animation on the module. By making use of the - * `module.animation()` module function we can register the animation. - * - * Let's see an example of a enter/leave animation using `ngRepeat`: - * - * ```html - *
    - * {{ item }} - *
    - * ``` - * - * See the **slide** CSS class? Let's use that class to define an animation that we'll structure in our module code by using `module.animation`: - * - * ```js - * myModule.animation('.slide', [function() { - * return { - * // make note that other events (like addClass/removeClass) - * // have different function input parameters - * enter: function(element, doneFn) { - * jQuery(element).fadeIn(1000, doneFn); - * - * // remember to call doneFn so that angular - * // knows that the animation has concluded - * }, - * - * move: function(element, doneFn) { - * jQuery(element).fadeIn(1000, doneFn); - * }, - * - * leave: function(element, doneFn) { - * jQuery(element).fadeOut(1000, doneFn); - * } - * } - * }]); - * ``` - * - * The nice thing about JS-based animations is that we can inject other services and make use of advanced animation libraries such as - * greensock.js and velocity.js. - * - * If our animation code class-based (meaning that something like `ngClass`, `ngHide` and `ngShow` triggers it) then we can still define - * our animations inside of the same registered animation, however, the function input arguments are a bit different: - * - * ```html - *
    - * this box is moody - *
    - * - * - * - * ``` - * - * ```js - * myModule.animation('.colorful', [function() { - * return { - * addClass: function(element, className, doneFn) { - * // do some cool animation and call the doneFn - * }, - * removeClass: function(element, className, doneFn) { - * // do some cool animation and call the doneFn - * }, - * setClass: function(element, addedClass, removedClass, doneFn) { - * // do some cool animation and call the doneFn - * } - * } - * }]); - * ``` - * - * ## CSS + JS Animations Together - * - * AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of Angular, - * defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore the example below will only result in **JS animations taking - * charge of the animation**: - * - * ```html - *
    - * Slide in and out - *
    - * ``` - * - * ```js - * myModule.animation('.slide', [function() { - * return { - * enter: function(element, doneFn) { - * jQuery(element).slideIn(1000, doneFn); - * } - * } - * }]); - * ``` - * - * ```css - * .slide.ng-enter { - * transition:0.5s linear all; - * transform:translateY(-100px); - * } - * .slide.ng-enter.ng-enter-active { - * transform:translateY(0); - * } - * ``` - * - * Does this mean that CSS and JS animations cannot be used together? Do JS-based animations always have higher priority? We can make up for the - * lack of CSS animations by using the `$animateCss` service to trigger our own tweaked-out, CSS-based animations directly from - * our own JS-based animation code: - * - * ```js - * myModule.animation('.slide', ['$animateCss', function($animateCss) { - * return { - * enter: function(element) { -* // this will trigger `.slide.ng-enter` and `.slide.ng-enter-active`. - * return $animateCss(element, { - * event: 'enter', - * structural: true - * }); - * } - * } - * }]); - * ``` - * - * The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and we don't need to rely on a 3rd-party animation framework. - * - * The `$animateCss` service is very powerful since we can feed in all kinds of extra properties that will be evaluated and fed into a CSS transition or - * keyframe animation. For example if we wanted to animate the height of an element while adding and removing classes then we can do so by providing that - * data into `$animateCss` directly: - * - * ```js - * myModule.animation('.slide', ['$animateCss', function($animateCss) { - * return { - * enter: function(element) { - * return $animateCss(element, { - * event: 'enter', - * structural: true, - * addClass: 'maroon-setting', - * from: { height:0 }, - * to: { height: 200 } - * }); - * } - * } - * }]); - * ``` - * - * Now we can fill in the rest via our transition CSS code: - * - * ```css - * /* the transition tells ngAnimate to make the animation happen */ - * .slide.ng-enter { transition:0.5s linear all; } - * - * /* this extra CSS class will be absorbed into the transition - * since the $animateCss code is adding the class */ - * .maroon-setting { background:red; } - * ``` - * - * And `$animateCss` will figure out the rest. Just make sure to have the `done()` callback fire the `doneFn` function to signal when the animation is over. - * - * To learn more about what's possible be sure to visit the {@link ngAnimate.$animateCss $animateCss service}. - * - * ## Animation Anchoring (via `ng-animate-ref`) - * - * ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between - * structural areas of an application (like views) by pairing up elements using an attribute - * called `ng-animate-ref`. - * - * Let's say for example we have two views that are managed by `ng-view` and we want to show - * that there is a relationship between two components situated in within these views. By using the - * `ng-animate-ref` attribute we can identify that the two components are paired together and we - * can then attach an animation, which is triggered when the view changes. - * - * Say for example we have the following template code: - * - * ```html - * - *
    - *
    - * - * - * - * - * - * - * - * - * ``` - * - * Now, when the view changes (once the link is clicked), ngAnimate will examine the - * HTML contents to see if there is a match reference between any components in the view - * that is leaving and the view that is entering. It will scan both the view which is being - * removed (leave) and inserted (enter) to see if there are any paired DOM elements that - * contain a matching ref value. - * - * The two images match since they share the same ref value. ngAnimate will now create a - * transport element (which is a clone of the first image element) and it will then attempt - * to animate to the position of the second image element in the next view. For the animation to - * work a special CSS class called `ng-anchor` will be added to the transported element. - * - * We can now attach a transition onto the `.banner.ng-anchor` CSS class and then - * ngAnimate will handle the entire transition for us as well as the addition and removal of - * any changes of CSS classes between the elements: - * - * ```css - * .banner.ng-anchor { - * /* this animation will last for 1 second since there are - * two phases to the animation (an `in` and an `out` phase) */ - * transition:0.5s linear all; - * } - * ``` - * - * We also **must** include animations for the views that are being entered and removed - * (otherwise anchoring wouldn't be possible since the new view would be inserted right away). - * - * ```css - * .view-animation.ng-enter, .view-animation.ng-leave { - * transition:0.5s linear all; - * position:fixed; - * left:0; - * top:0; - * width:100%; - * } - * .view-animation.ng-enter { - * transform:translateX(100%); - * } - * .view-animation.ng-leave, - * .view-animation.ng-enter.ng-enter-active { - * transform:translateX(0%); - * } - * .view-animation.ng-leave.ng-leave-active { - * transform:translateX(-100%); - * } - * ``` - * - * Now we can jump back to the anchor animation. When the animation happens, there are two stages that occur: - * an `out` and an `in` stage. The `out` stage happens first and that is when the element is animated away - * from its origin. Once that animation is over then the `in` stage occurs which animates the - * element to its destination. The reason why there are two animations is to give enough time - * for the enter animation on the new element to be ready. - * - * The example above sets up a transition for both the in and out phases, but we can also target the out or - * in phases directly via `ng-anchor-out` and `ng-anchor-in`. - * - * ```css - * .banner.ng-anchor-out { - * transition: 0.5s linear all; - * - * /* the scale will be applied during the out animation, - * but will be animated away when the in animation runs */ - * transform: scale(1.2); - * } - * - * .banner.ng-anchor-in { - * transition: 1s linear all; - * } - * ``` - * - * - * - * - * ### Anchoring Demo - * - - - Home -
    -
    -
    -
    -
    - - angular.module('anchoringExample', ['ngAnimate', 'ngRoute']) - .config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/', { - templateUrl: 'home.html', - controller: 'HomeController as home' - }); - $routeProvider.when('/profile/:id', { - templateUrl: 'profile.html', - controller: 'ProfileController as profile' - }); - }]) - .run(['$rootScope', function($rootScope) { - $rootScope.records = [ - { id:1, title: "Miss Beulah Roob" }, - { id:2, title: "Trent Morissette" }, - { id:3, title: "Miss Ava Pouros" }, - { id:4, title: "Rod Pouros" }, - { id:5, title: "Abdul Rice" }, - { id:6, title: "Laurie Rutherford Sr." }, - { id:7, title: "Nakia McLaughlin" }, - { id:8, title: "Jordon Blanda DVM" }, - { id:9, title: "Rhoda Hand" }, - { id:10, title: "Alexandrea Sauer" } - ]; - }]) - .controller('HomeController', [function() { - //empty - }]) - .controller('ProfileController', ['$rootScope', '$routeParams', function($rootScope, $routeParams) { - var index = parseInt($routeParams.id, 10); - var record = $rootScope.records[index - 1]; - - this.title = record.title; - this.id = record.id; - }]); - - -

    Welcome to the home page

    -

    Please click on an element

    - - {{ record.title }} - -
    - -
    - {{ profile.title }} -
    -
    - - .record { - display:block; - font-size:20px; - } - .profile { - background:black; - color:white; - font-size:100px; - } - .view-container { - position:relative; - } - .view-container > .view.ng-animate { - position:absolute; - top:0; - left:0; - width:100%; - min-height:500px; - } - .view.ng-enter, .view.ng-leave, - .record.ng-anchor { - transition:0.5s linear all; - } - .view.ng-enter { - transform:translateX(100%); - } - .view.ng-enter.ng-enter-active, .view.ng-leave { - transform:translateX(0%); - } - .view.ng-leave.ng-leave-active { - transform:translateX(-100%); - } - .record.ng-anchor-out { - background:red; - } - -
    - * - * ### How is the element transported? - * - * When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly where the starting - * element is located on screen via absolute positioning. The cloned element will be placed inside of the root element - * of the application (where ng-app was defined) and all of the CSS classes of the starting element will be applied. The - * element will then animate into the `out` and `in` animations and will eventually reach the coordinates and match - * the dimensions of the destination element. During the entire animation a CSS class of `.ng-animate-shim` will be applied - * to both the starting and destination elements in order to hide them from being visible (the CSS styling for the class - * is: `visibility:hidden`). Once the anchor reaches its destination then it will be removed and the destination element - * will become visible since the shim class will be removed. - * - * ### How is the morphing handled? - * - * CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to figure out - * what CSS classes differ between the starting element and the destination element. These different CSS classes - * will be added/removed on the anchor element and a transition will be applied (the transition that is provided - * in the anchor class). Long story short, ngAnimate will figure out what classes to add and remove which will - * make the transition of the element as smooth and automatic as possible. Be sure to use simple CSS classes that - * do not rely on DOM nesting structure so that the anchor element appears the same as the starting element (since - * the cloned element is placed inside of root element which is likely close to the body element). - * - * Note that if the root element is on the `` element then the cloned node will be placed inside of body. - * - * - * ## Using $animate in your directive code - * - * So far we've explored how to feed in animations into an Angular application, but how do we trigger animations within our own directives in our application? - * By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's - * imagine we have a greeting box that shows and hides itself when the data changes - * - * ```html - * Hi there - * ``` - * - * ```js - * ngModule.directive('greetingBox', ['$animate', function($animate) { - * return function(scope, element, attrs) { - * attrs.$observe('active', function(value) { - * value ? $animate.addClass(element, 'on') : $animate.removeClass(element, 'on'); - * }); - * }); - * }]); - * ``` - * - * Now the `on` CSS class is added and removed on the greeting box component. Now if we add a CSS class on top of the greeting box element - * in our HTML code then we can trigger a CSS or JS animation to happen. - * - * ```css - * /* normally we would create a CSS class to reference on the element */ - * greeting-box.on { transition:0.5s linear all; background:green; color:white; } - * ``` - * - * The `$animate` service contains a variety of other methods like `enter`, `leave`, `animate` and `setClass`. To learn more about what's - * possible be sure to visit the {@link ng.$animate $animate service API page}. - * - * - * ### Preventing Collisions With Third Party Libraries - * - * Some third-party frameworks place animation duration defaults across many element or className - * selectors in order to make their code small and reuseable. This can lead to issues with ngAnimate, which - * is expecting actual animations on these elements and has to wait for their completion. - * - * You can prevent this unwanted behavior by using a prefix on all your animation classes: - * - * ```css - * /* prefixed with animate- */ - * .animate-fade-add.animate-fade-add-active { - * transition:1s linear all; - * opacity:0; - * } - * ``` - * - * You then configure `$animate` to enforce this prefix: - * - * ```js - * $animateProvider.classNameFilter(/animate-/); - * ``` - * - * This also may provide your application with a speed boost since only specific elements containing CSS class prefix - * will be evaluated for animation when any DOM changes occur in the application. - * - * ## Callbacks and Promises - * - * When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger - * an animation (within our directive code) then we can continue performing directive and scope related activities after the animation has - * ended by chaining onto the returned promise that animation method returns. - * - * ```js - * // somewhere within the depths of the directive - * $animate.enter(element, parent).then(function() { - * //the animation has completed - * }); - * ``` - * - * (Note that earlier versions of Angular prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case - * anymore.) - * - * In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering - * an event listener using the `$animate` service. Let's say for example that an animation was triggered on our view - * routing controller to hook into that: - * - * ```js - * ngModule.controller('HomePageController', ['$animate', function($animate) { - * $animate.on('enter', ngViewElement, function(element) { - * // the animation for this route has completed - * }]); - * }]) - * ``` - * - * (Note that you will need to trigger a digest within the callback to get angular to notice any scope-related changes.) - */ - -/** - * @ngdoc service - * @name $animate - * @kind object - * - * @description - * The ngAnimate `$animate` service documentation is the same for the core `$animate` service. - * - * Click here {@link ng.$animate to learn more about animations with `$animate`}. - */ -angular.module('ngAnimate', []) - .directive('ngAnimateSwap', ngAnimateSwapDirective) - - .directive('ngAnimateChildren', $$AnimateChildrenDirective) - .factory('$$rAFScheduler', $$rAFSchedulerFactory) - - .provider('$$animateQueue', $$AnimateQueueProvider) - .provider('$$animation', $$AnimationProvider) - - .provider('$animateCss', $AnimateCssProvider) - .provider('$$animateCssDriver', $$AnimateCssDriverProvider) - - .provider('$$animateJs', $$AnimateJsProvider) - .provider('$$animateJsDriver', $$AnimateJsDriverProvider); - - -})(window, window.angular); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-animate.min.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-animate.min.js deleted file mode 100644 index 8e8e41dfd..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-animate.min.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - AngularJS v1.5.0 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(D,r,Va){'use strict';function ya(a,b,c){if(!a)throw Ka("areq",b||"?",c||"required");return a}function za(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;ba(a)&&(a=a.join(" "));ba(b)&&(b=b.join(" "));return a+" "+b}function La(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function X(a,b,c){var d="";a=ba(a)?a:a&&R(a)&&a.length?a.split(/\s+/):[];s(a,function(a,g){a&&0=a&&(a=e,e=0,b.push(t),t=[]);t.push(g.fn);g.children.forEach(function(a){e++; -c.push(a)});a--}t.length&&b.push(t);return b}(c)}var M=[],r=U(a);return function(u,A,v){function z(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];s(a,function(a){var c=a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)});return b}function K(a){var b=[],c={};s(a,function(a,f){var d=G(a.element),h=0<=["enter","move"].indexOf(a.event),d=a.structural?z(d):[];if(d.length){var e=h?"to":"from";s(d,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]|| -{};c[b][e]={animationID:f,element:I(a)}})}else b.push(a)});var d={},h={};s(c,function(c,e){var l=c.from,t=c.to;if(l&&t){var g=a[l.animationID],E=a[t.animationID],k=l.animationID.toString();if(!h[k]){var z=h[k]={structural:!0,beforeStart:function(){g.beforeStart();E.beforeStart()},close:function(){g.close();E.close()},classes:J(g.classes,E.classes),from:g,to:E,anchors:[]};z.classes.length?b.push(z):(b.push(g),b.push(E))}h[k].anchors.push({out:l.element,"in":t.element})}else l=l?l.animationID:t.animationID, -t=l.toString(),d[t]||(d[t]=!0,b.push(a[l]))});return b}function J(a,b){a=a.split(" ");b=b.split(" ");for(var c=[],d=0;d=P&&b>=O&&(wa=!0,q())}function L(){function b(){if(!A){t(!1);s(m, -function(a){l.style[a[0]]=a[1]});z(a,f);e.addClass(a,ca);if(p.recalculateTimingStyles){ja=l.className+" "+da;ga=r(l,ja);F=v(l,ja,ga);$=F.maxDelay;n=Math.max($,0);O=F.maxDuration;if(0===O){q();return}p.hasTransitions=0B.expectedEndTime)?H.cancel(B.timer):g.push(q)}L&&(k=H(c,k,!1),g[0]={timer:k,expectedEndTime:d},g.push(q),a.data("$$animateCss",g));if(ea.length)a.on(ea.join(" "),E);f.to&&(f.cleanupStyles&&Ga(x,l,Object.keys(f.to)),Ba(a, -f))}}function c(){var b=a.data("$$animateCss");if(b){for(var d=1;dARIA](http://www.w3.org/TR/wai-aria/) - * attributes that convey state or semantic information about the application for users - * of assistive technologies, such as screen readers. - * - *
    - * - * ## Usage - * - * For ngAria to do its magic, simply include the module `ngAria` as a dependency. The following - * directives are supported: - * `ngModel`, `ngChecked`, `ngRequired`, `ngValue`, `ngDisabled`, `ngShow`, `ngHide`, `ngClick`, - * `ngDblClick`, and `ngMessages`. - * - * Below is a more detailed breakdown of the attributes handled by ngAria: - * - * | Directive | Supported Attributes | - * |---------------------------------------------|----------------------------------------------------------------------------------------| - * | {@link ng.directive:ngModel ngModel} | aria-checked, aria-valuemin, aria-valuemax, aria-valuenow, aria-invalid, aria-required, input roles | - * | {@link ng.directive:ngDisabled ngDisabled} | aria-disabled | - * | {@link ng.directive:ngRequired ngRequired} | aria-required | - * | {@link ng.directive:ngChecked ngChecked} | aria-checked | - * | {@link ng.directive:ngValue ngValue} | aria-checked | - * | {@link ng.directive:ngShow ngShow} | aria-hidden | - * | {@link ng.directive:ngHide ngHide} | aria-hidden | - * | {@link ng.directive:ngDblclick ngDblclick} | tabindex | - * | {@link module:ngMessages ngMessages} | aria-live | - * | {@link ng.directive:ngClick ngClick} | tabindex, keypress event, button role | - * - * Find out more information about each directive by reading the - * {@link guide/accessibility ngAria Developer Guide}. - * - * ##Example - * Using ngDisabled with ngAria: - * ```html - * - * ``` - * Becomes: - * ```html - * - * ``` - * - * ##Disabling Attributes - * It's possible to disable individual attributes added by ngAria with the - * {@link ngAria.$ariaProvider#config config} method. For more details, see the - * {@link guide/accessibility Developer Guide}. - */ - /* global -ngAriaModule */ -var ngAriaModule = angular.module('ngAria', ['ng']). - provider('$aria', $AriaProvider); - -/** -* Internal Utilities -*/ -var nodeBlackList = ['BUTTON', 'A', 'INPUT', 'TEXTAREA', 'SELECT', 'DETAILS', 'SUMMARY']; - -var isNodeOneOf = function(elem, nodeTypeArray) { - if (nodeTypeArray.indexOf(elem[0].nodeName) !== -1) { - return true; - } -}; -/** - * @ngdoc provider - * @name $ariaProvider - * - * @description - * - * Used for configuring the ARIA attributes injected and managed by ngAria. - * - * ```js - * angular.module('myApp', ['ngAria'], function config($ariaProvider) { - * $ariaProvider.config({ - * ariaValue: true, - * tabindex: false - * }); - * }); - *``` - * - * ## Dependencies - * Requires the {@link ngAria} module to be installed. - * - */ -function $AriaProvider() { - var config = { - ariaHidden: true, - ariaChecked: true, - ariaDisabled: true, - ariaRequired: true, - ariaInvalid: true, - ariaValue: true, - tabindex: true, - bindKeypress: true, - bindRoleForClick: true - }; - - /** - * @ngdoc method - * @name $ariaProvider#config - * - * @param {object} config object to enable/disable specific ARIA attributes - * - * - **ariaHidden** – `{boolean}` – Enables/disables aria-hidden tags - * - **ariaChecked** – `{boolean}` – Enables/disables aria-checked tags - * - **ariaDisabled** – `{boolean}` – Enables/disables aria-disabled tags - * - **ariaRequired** – `{boolean}` – Enables/disables aria-required tags - * - **ariaInvalid** – `{boolean}` – Enables/disables aria-invalid tags - * - **ariaValue** – `{boolean}` – Enables/disables aria-valuemin, aria-valuemax and aria-valuenow tags - * - **tabindex** – `{boolean}` – Enables/disables tabindex tags - * - **bindKeypress** – `{boolean}` – Enables/disables keypress event binding on `div` and - * `li` elements with ng-click - * - **bindRoleForClick** – `{boolean}` – Adds role=button to non-interactive elements like `div` - * using ng-click, making them more accessible to users of assistive technologies - * - * @description - * Enables/disables various ARIA attributes - */ - this.config = function(newConfig) { - config = angular.extend(config, newConfig); - }; - - function watchExpr(attrName, ariaAttr, nodeBlackList, negate) { - return function(scope, elem, attr) { - var ariaCamelName = attr.$normalize(ariaAttr); - if (config[ariaCamelName] && !isNodeOneOf(elem, nodeBlackList) && !attr[ariaCamelName]) { - scope.$watch(attr[attrName], function(boolVal) { - // ensure boolean value - boolVal = negate ? !boolVal : !!boolVal; - elem.attr(ariaAttr, boolVal); - }); - } - }; - } - /** - * @ngdoc service - * @name $aria - * - * @description - * @priority 200 - * - * The $aria service contains helper methods for applying common - * [ARIA](http://www.w3.org/TR/wai-aria/) attributes to HTML directives. - * - * ngAria injects common accessibility attributes that tell assistive technologies when HTML - * elements are enabled, selected, hidden, and more. To see how this is performed with ngAria, - * let's review a code snippet from ngAria itself: - * - *```js - * ngAriaModule.directive('ngDisabled', ['$aria', function($aria) { - * return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nodeBlackList, false); - * }]) - *``` - * Shown above, the ngAria module creates a directive with the same signature as the - * traditional `ng-disabled` directive. But this ngAria version is dedicated to - * solely managing accessibility attributes on custom elements. The internal `$aria` service is - * used to watch the boolean attribute `ngDisabled`. If it has not been explicitly set by the - * developer, `aria-disabled` is injected as an attribute with its value synchronized to the - * value in `ngDisabled`. - * - * Because ngAria hooks into the `ng-disabled` directive, developers do not have to do - * anything to enable this feature. The `aria-disabled` attribute is automatically managed - * simply as a silent side-effect of using `ng-disabled` with the ngAria module. - * - * The full list of directives that interface with ngAria: - * * **ngModel** - * * **ngChecked** - * * **ngRequired** - * * **ngDisabled** - * * **ngValue** - * * **ngShow** - * * **ngHide** - * * **ngClick** - * * **ngDblclick** - * * **ngMessages** - * - * Read the {@link guide/accessibility ngAria Developer Guide} for a thorough explanation of each - * directive. - * - * - * ## Dependencies - * Requires the {@link ngAria} module to be installed. - */ - this.$get = function() { - return { - config: function(key) { - return config[key]; - }, - $$watchExpr: watchExpr - }; - }; -} - - -ngAriaModule.directive('ngShow', ['$aria', function($aria) { - return $aria.$$watchExpr('ngShow', 'aria-hidden', [], true); -}]) -.directive('ngHide', ['$aria', function($aria) { - return $aria.$$watchExpr('ngHide', 'aria-hidden', [], false); -}]) -.directive('ngValue', ['$aria', function($aria) { - return $aria.$$watchExpr('ngValue', 'aria-checked', nodeBlackList, false); -}]) -.directive('ngChecked', ['$aria', function($aria) { - return $aria.$$watchExpr('ngChecked', 'aria-checked', nodeBlackList, false); -}]) -.directive('ngRequired', ['$aria', function($aria) { - return $aria.$$watchExpr('ngRequired', 'aria-required', nodeBlackList, false); -}]) -.directive('ngModel', ['$aria', function($aria) { - - function shouldAttachAttr(attr, normalizedAttr, elem, allowBlacklistEls) { - return $aria.config(normalizedAttr) && !elem.attr(attr) && (allowBlacklistEls || !isNodeOneOf(elem, nodeBlackList)); - } - - function shouldAttachRole(role, elem) { - // if element does not have role attribute - // AND element type is equal to role (if custom element has a type equaling shape) <-- remove? - // AND element is not INPUT - return !elem.attr('role') && (elem.attr('type') === role) && (elem[0].nodeName !== 'INPUT'); - } - - function getShape(attr, elem) { - var type = attr.type, - role = attr.role; - - return ((type || role) === 'checkbox' || role === 'menuitemcheckbox') ? 'checkbox' : - ((type || role) === 'radio' || role === 'menuitemradio') ? 'radio' : - (type === 'range' || role === 'progressbar' || role === 'slider') ? 'range' : ''; - } - - return { - restrict: 'A', - require: 'ngModel', - priority: 200, //Make sure watches are fired after any other directives that affect the ngModel value - compile: function(elem, attr) { - var shape = getShape(attr, elem); - - return { - pre: function(scope, elem, attr, ngModel) { - if (shape === 'checkbox') { - //Use the input[checkbox] $isEmpty implementation for elements with checkbox roles - ngModel.$isEmpty = function(value) { - return value === false; - }; - } - }, - post: function(scope, elem, attr, ngModel) { - var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem, false); - - function ngAriaWatchModelValue() { - return ngModel.$modelValue; - } - - function getRadioReaction(newVal) { - var boolVal = (attr.value == ngModel.$viewValue); - elem.attr('aria-checked', boolVal); - } - - function getCheckboxReaction() { - elem.attr('aria-checked', !ngModel.$isEmpty(ngModel.$viewValue)); - } - - switch (shape) { - case 'radio': - case 'checkbox': - if (shouldAttachRole(shape, elem)) { - elem.attr('role', shape); - } - if (shouldAttachAttr('aria-checked', 'ariaChecked', elem, false)) { - scope.$watch(ngAriaWatchModelValue, shape === 'radio' ? - getRadioReaction : getCheckboxReaction); - } - if (needsTabIndex) { - elem.attr('tabindex', 0); - } - break; - case 'range': - if (shouldAttachRole(shape, elem)) { - elem.attr('role', 'slider'); - } - if ($aria.config('ariaValue')) { - var needsAriaValuemin = !elem.attr('aria-valuemin') && - (attr.hasOwnProperty('min') || attr.hasOwnProperty('ngMin')); - var needsAriaValuemax = !elem.attr('aria-valuemax') && - (attr.hasOwnProperty('max') || attr.hasOwnProperty('ngMax')); - var needsAriaValuenow = !elem.attr('aria-valuenow'); - - if (needsAriaValuemin) { - attr.$observe('min', function ngAriaValueMinReaction(newVal) { - elem.attr('aria-valuemin', newVal); - }); - } - if (needsAriaValuemax) { - attr.$observe('max', function ngAriaValueMinReaction(newVal) { - elem.attr('aria-valuemax', newVal); - }); - } - if (needsAriaValuenow) { - scope.$watch(ngAriaWatchModelValue, function ngAriaValueNowReaction(newVal) { - elem.attr('aria-valuenow', newVal); - }); - } - } - if (needsTabIndex) { - elem.attr('tabindex', 0); - } - break; - } - - if (!attr.hasOwnProperty('ngRequired') && ngModel.$validators.required - && shouldAttachAttr('aria-required', 'ariaRequired', elem, false)) { - // ngModel.$error.required is undefined on custom controls - attr.$observe('required', function() { - elem.attr('aria-required', !!attr['required']); - }); - } - - if (shouldAttachAttr('aria-invalid', 'ariaInvalid', elem, true)) { - scope.$watch(function ngAriaInvalidWatch() { - return ngModel.$invalid; - }, function ngAriaInvalidReaction(newVal) { - elem.attr('aria-invalid', !!newVal); - }); - } - } - }; - } - }; -}]) -.directive('ngDisabled', ['$aria', function($aria) { - return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nodeBlackList, false); -}]) -.directive('ngMessages', function() { - return { - restrict: 'A', - require: '?ngMessages', - link: function(scope, elem, attr, ngMessages) { - if (!elem.attr('aria-live')) { - elem.attr('aria-live', 'assertive'); - } - } - }; -}) -.directive('ngClick',['$aria', '$parse', function($aria, $parse) { - return { - restrict: 'A', - compile: function(elem, attr) { - var fn = $parse(attr.ngClick, /* interceptorFn */ null, /* expensiveChecks */ true); - return function(scope, elem, attr) { - - if (!isNodeOneOf(elem, nodeBlackList)) { - - if ($aria.config('bindRoleForClick') && !elem.attr('role')) { - elem.attr('role', 'button'); - } - - if ($aria.config('tabindex') && !elem.attr('tabindex')) { - elem.attr('tabindex', 0); - } - - if ($aria.config('bindKeypress') && !attr.ngKeypress) { - elem.on('keypress', function(event) { - var keyCode = event.which || event.keyCode; - if (keyCode === 32 || keyCode === 13) { - scope.$apply(callback); - } - - function callback() { - fn(scope, { $event: event }); - } - }); - } - } - }; - } - }; -}]) -.directive('ngDblclick', ['$aria', function($aria) { - return function(scope, elem, attr) { - if ($aria.config('tabindex') && !elem.attr('tabindex') && !isNodeOneOf(elem, nodeBlackList)) { - elem.attr('tabindex', 0); - } - }; -}]); - - -})(window, window.angular); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-aria.min.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-aria.min.js deleted file mode 100644 index cf0fd7425..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-aria.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - AngularJS v1.5.0 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(s,q,t){'use strict';var f="BUTTON A INPUT TEXTAREA SELECT DETAILS SUMMARY".split(" "),l=function(a,c){if(-1!==c.indexOf(a[0].nodeName))return!0};q.module("ngAria",["ng"]).provider("$aria",function(){function a(a,h,p,n){return function(d,e,b){var g=b.$normalize(h);!c[g]||l(e,p)||b[g]||d.$watch(b[a],function(b){b=n?!b:!!b;e.attr(h,b)})}}var c={ariaHidden:!0,ariaChecked:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeypress:!0,bindRoleForClick:!0};this.config= -function(a){c=q.extend(c,a)};this.$get=function(){return{config:function(a){return c[a]},$$watchExpr:a}}}).directive("ngShow",["$aria",function(a){return a.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(a){return a.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(a){return a.$$watchExpr("ngValue","aria-checked",f,!1)}]).directive("ngChecked",["$aria",function(a){return a.$$watchExpr("ngChecked","aria-checked",f,!1)}]).directive("ngRequired", -["$aria",function(a){return a.$$watchExpr("ngRequired","aria-required",f,!1)}]).directive("ngModel",["$aria",function(a){function c(c,n,d,e){return a.config(n)&&!d.attr(c)&&(e||!l(d,f))}function m(a,c){return!c.attr("role")&&c.attr("type")===a&&"INPUT"!==c[0].nodeName}function h(a,c){var d=a.type,e=a.role;return"checkbox"===(d||e)||"menuitemcheckbox"===e?"checkbox":"radio"===(d||e)||"menuitemradio"===e?"radio":"range"===d||"progressbar"===e||"slider"===e?"range":""}return{restrict:"A",require:"ngModel", -priority:200,compile:function(f,n){var d=h(n,f);return{pre:function(a,b,c,k){"checkbox"===d&&(k.$isEmpty=function(a){return!1===a})},post:function(e,b,g,k){function f(){return k.$modelValue}function h(a){b.attr("aria-checked",g.value==k.$viewValue)}function n(){b.attr("aria-checked",!k.$isEmpty(k.$viewValue))}var l=c("tabindex","tabindex",b,!1);switch(d){case "radio":case "checkbox":m(d,b)&&b.attr("role",d);c("aria-checked","ariaChecked",b,!1)&&e.$watch(f,"radio"===d?h:n);l&&b.attr("tabindex",0); -break;case "range":m(d,b)&&b.attr("role","slider");if(a.config("ariaValue")){var p=!b.attr("aria-valuemin")&&(g.hasOwnProperty("min")||g.hasOwnProperty("ngMin")),q=!b.attr("aria-valuemax")&&(g.hasOwnProperty("max")||g.hasOwnProperty("ngMax")),r=!b.attr("aria-valuenow");p&&g.$observe("min",function(a){b.attr("aria-valuemin",a)});q&&g.$observe("max",function(a){b.attr("aria-valuemax",a)});r&&e.$watch(f,function(a){b.attr("aria-valuenow",a)})}l&&b.attr("tabindex",0)}!g.hasOwnProperty("ngRequired")&& -k.$validators.required&&c("aria-required","ariaRequired",b,!1)&&g.$observe("required",function(){b.attr("aria-required",!!g.required)});c("aria-invalid","ariaInvalid",b,!0)&&e.$watch(function(){return k.$invalid},function(a){b.attr("aria-invalid",!!a)})}}}}}]).directive("ngDisabled",["$aria",function(a){return a.$$watchExpr("ngDisabled","aria-disabled",f,!1)}]).directive("ngMessages",function(){return{restrict:"A",require:"?ngMessages",link:function(a,c,f,h){c.attr("aria-live")||c.attr("aria-live", -"assertive")}}}).directive("ngClick",["$aria","$parse",function(a,c){return{restrict:"A",compile:function(m,h){var p=c(h.ngClick,null,!0);return function(c,d,e){if(!l(d,f)&&(a.config("bindRoleForClick")&&!d.attr("role")&&d.attr("role","button"),a.config("tabindex")&&!d.attr("tabindex")&&d.attr("tabindex",0),a.config("bindKeypress")&&!e.ngKeypress))d.on("keypress",function(a){function d(){p(c,{$event:a})}var e=a.which||a.keyCode;32!==e&&13!==e||c.$apply(d)})}}}}]).directive("ngDblclick",["$aria",function(a){return function(c, -m,h){!a.config("tabindex")||m.attr("tabindex")||l(m,f)||m.attr("tabindex",0)}}])})(window,window.angular); -//# sourceMappingURL=angular-aria.min.js.map diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-aria.min.js.map b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-aria.min.js.map deleted file mode 100644 index b1db15b5d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-aria.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular-aria.min.js", -"lineCount":13, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CA6DtC,IAAIC,EAAgB,gDAAA,MAAA,CAAA,GAAA,CAApB,CAEIC,EAAcA,QAAQ,CAACC,CAAD,CAAOC,CAAP,CAAsB,CAC9C,GAAiD,EAAjD,GAAIA,CAAAC,QAAA,CAAsBF,CAAA,CAAK,CAAL,CAAAG,SAAtB,CAAJ,CACE,MAAO,CAAA,CAFqC,CAR7BP,EAAAQ,OAAA,CAAe,QAAf,CAAyB,CAAC,IAAD,CAAzB,CAAAC,SAAAC,CACc,OADdA,CAkCnBC,QAAsB,EAAG,CAsCvBC,QAASA,EAAS,CAACC,CAAD,CAAWC,CAAX,CAAqBZ,CAArB,CAAoCa,CAApC,CAA4C,CAC5D,MAAO,SAAQ,CAACC,CAAD,CAAQZ,CAAR,CAAca,CAAd,CAAoB,CACjC,IAAIC,EAAgBD,CAAAE,WAAA,CAAgBL,CAAhB,CAChB,EAAAM,CAAA,CAAOF,CAAP,CAAJ,EAA8Bf,CAAA,CAAYC,CAAZ,CAAkBF,CAAlB,CAA9B,EAAmEe,CAAA,CAAKC,CAAL,CAAnE,EACEF,CAAAK,OAAA,CAAaJ,CAAA,CAAKJ,CAAL,CAAb,CAA6B,QAAQ,CAACS,CAAD,CAAU,CAE7CA,CAAA,CAAUP,CAAA,CAAS,CAACO,CAAV,CAAoB,CAAEA,CAAAA,CAChClB,EAAAa,KAAA,CAAUH,CAAV,CAAoBQ,CAApB,CAH6C,CAA/C,CAH+B,CADyB,CArC9D,IAAIF,EAAS,CACXG,WAAY,CAAA,CADD,CAEXC,YAAa,CAAA,CAFF,CAGXC,aAAc,CAAA,CAHH,CAIXC,aAAc,CAAA,CAJH,CAKXC,YAAa,CAAA,CALF,CAMXC,UAAW,CAAA,CANA,CAOXC,SAAU,CAAA,CAPC,CAQXC,aAAc,CAAA,CARH,CASXC,iBAAkB,CAAA,CATP,CAiCb,KAAAX,OAAA;AAAcY,QAAQ,CAACC,CAAD,CAAY,CAChCb,CAAA,CAASpB,CAAAkC,OAAA,CAAed,CAAf,CAAuBa,CAAvB,CADuB,CAiElC,KAAAE,KAAA,CAAYC,QAAQ,EAAG,CACrB,MAAO,CACLhB,OAAQA,QAAQ,CAACiB,CAAD,CAAM,CACpB,MAAOjB,EAAA,CAAOiB,CAAP,CADa,CADjB,CAILC,YAAa1B,CAJR,CADc,CAnGA,CAlCNF,CAgJnB6B,UAAA,CAAuB,QAAvB,CAAiC,CAAC,OAAD,CAAU,QAAQ,CAACC,CAAD,CAAQ,CACzD,MAAOA,EAAAF,YAAA,CAAkB,QAAlB,CAA4B,aAA5B,CAA2C,EAA3C,CAA+C,CAAA,CAA/C,CADkD,CAA1B,CAAjC,CAAAC,UAAA,CAGW,QAHX,CAGqB,CAAC,OAAD,CAAU,QAAQ,CAACC,CAAD,CAAQ,CAC7C,MAAOA,EAAAF,YAAA,CAAkB,QAAlB,CAA4B,aAA5B,CAA2C,EAA3C,CAA+C,CAAA,CAA/C,CADsC,CAA1B,CAHrB,CAAAC,UAAA,CAMW,SANX,CAMsB,CAAC,OAAD,CAAU,QAAQ,CAACC,CAAD,CAAQ,CAC9C,MAAOA,EAAAF,YAAA,CAAkB,SAAlB,CAA6B,cAA7B,CAA6CpC,CAA7C,CAA4D,CAAA,CAA5D,CADuC,CAA1B,CANtB,CAAAqC,UAAA,CASW,WATX,CASwB,CAAC,OAAD,CAAU,QAAQ,CAACC,CAAD,CAAQ,CAChD,MAAOA,EAAAF,YAAA,CAAkB,WAAlB,CAA+B,cAA/B,CAA+CpC,CAA/C,CAA8D,CAAA,CAA9D,CADyC,CAA1B,CATxB,CAAAqC,UAAA,CAYW,YAZX;AAYyB,CAAC,OAAD,CAAU,QAAQ,CAACC,CAAD,CAAQ,CACjD,MAAOA,EAAAF,YAAA,CAAkB,YAAlB,CAAgC,eAAhC,CAAiDpC,CAAjD,CAAgE,CAAA,CAAhE,CAD0C,CAA1B,CAZzB,CAAAqC,UAAA,CAeW,SAfX,CAesB,CAAC,OAAD,CAAU,QAAQ,CAACC,CAAD,CAAQ,CAE9CC,QAASA,EAAgB,CAACxB,CAAD,CAAOyB,CAAP,CAAuBtC,CAAvB,CAA6BuC,CAA7B,CAAgD,CACvE,MAAOH,EAAApB,OAAA,CAAasB,CAAb,CAAP,EAAuC,CAACtC,CAAAa,KAAA,CAAUA,CAAV,CAAxC,GAA4D0B,CAA5D,EAAiF,CAACxC,CAAA,CAAYC,CAAZ,CAAkBF,CAAlB,CAAlF,CADuE,CAIzE0C,QAASA,EAAgB,CAACC,CAAD,CAAOzC,CAAP,CAAa,CAIpC,MAAO,CAACA,CAAAa,KAAA,CAAU,MAAV,CAAR,EAA8Bb,CAAAa,KAAA,CAAU,MAAV,CAA9B,GAAoD4B,CAApD,EAAmF,OAAnF,GAA8DzC,CAAA,CAAK,CAAL,CAAAG,SAJ1B,CAOtCuC,QAASA,EAAQ,CAAC7B,CAAD,CAAOb,CAAP,CAAa,CAAA,IACxB2C,EAAO9B,CAAA8B,KADiB,CAExBF,EAAO5B,CAAA4B,KAEX,OAA2B,UAApB,IAAEE,CAAF,EAAUF,CAAV,GAA2C,kBAA3C,GAAkCA,CAAlC,CAAiE,UAAjE,CACoB,OAApB,IAAEE,CAAF,EAAUF,CAAV,GAA2C,eAA3C,GAAkCA,CAAlC,CAA8D,OAA9D,CACU,OAAV,GAACE,CAAD,EAA2C,aAA3C,GAAkCF,CAAlC,EAAqE,QAArE,GAA4DA,CAA5D,CAAiF,OAAjF,CAA2F,EANtE,CAS9B,MAAO,CACLG,SAAU,GADL,CAELC,QAAS,SAFJ;AAGLC,SAAU,GAHL,CAILC,QAASA,QAAQ,CAAC/C,CAAD,CAAOa,CAAP,CAAa,CAC5B,IAAImC,EAAQN,CAAA,CAAS7B,CAAT,CAAeb,CAAf,CAEZ,OAAO,CACLiD,IAAKA,QAAQ,CAACrC,CAAD,CAAQZ,CAAR,CAAca,CAAd,CAAoBqC,CAApB,CAA6B,CAC1B,UAAd,GAAIF,CAAJ,GAEEE,CAAAC,SAFF,CAEqBC,QAAQ,CAACC,CAAD,CAAQ,CACjC,MAAiB,CAAA,CAAjB,GAAOA,CAD0B,CAFrC,CADwC,CADrC,CASLC,KAAMA,QAAQ,CAAC1C,CAAD,CAAQZ,CAAR,CAAca,CAAd,CAAoBqC,CAApB,CAA6B,CAGzCK,QAASA,EAAqB,EAAG,CAC/B,MAAOL,EAAAM,YADwB,CAIjCC,QAASA,EAAgB,CAACC,CAAD,CAAS,CAEhC1D,CAAAa,KAAA,CAAU,cAAV,CADeA,CAAAwC,MACf,EAD6BH,CAAAS,WAC7B,CAFgC,CAKlCC,QAASA,EAAmB,EAAG,CAC7B5D,CAAAa,KAAA,CAAU,cAAV,CAA0B,CAACqC,CAAAC,SAAA,CAAiBD,CAAAS,WAAjB,CAA3B,CAD6B,CAX/B,IAAIE,EAAgBxB,CAAA,CAAiB,UAAjB,CAA6B,UAA7B,CAAyCrC,CAAzC,CAA+C,CAAA,CAA/C,CAepB,QAAQgD,CAAR,EACE,KAAK,OAAL,CACA,KAAK,UAAL,CACMR,CAAA,CAAiBQ,CAAjB,CAAwBhD,CAAxB,CAAJ,EACEA,CAAAa,KAAA,CAAU,MAAV,CAAkBmC,CAAlB,CAEEX,EAAA,CAAiB,cAAjB,CAAiC,aAAjC,CAAgDrC,CAAhD,CAAsD,CAAA,CAAtD,CAAJ,EACEY,CAAAK,OAAA,CAAasC,CAAb,CAA8C,OAAV,GAAAP,CAAA,CAChCS,CADgC,CACbG,CADvB,CAGEC,EAAJ,EACE7D,CAAAa,KAAA,CAAU,UAAV,CAAsB,CAAtB,CAEF;KACF,MAAK,OAAL,CACM2B,CAAA,CAAiBQ,CAAjB,CAAwBhD,CAAxB,CAAJ,EACEA,CAAAa,KAAA,CAAU,MAAV,CAAkB,QAAlB,CAEF,IAAIuB,CAAApB,OAAA,CAAa,WAAb,CAAJ,CAA+B,CAC7B,IAAI8C,EAAoB,CAAC9D,CAAAa,KAAA,CAAU,eAAV,CAArBiD,GACCjD,CAAAkD,eAAA,CAAoB,KAApB,CADDD,EAC+BjD,CAAAkD,eAAA,CAAoB,OAApB,CAD/BD,CAAJ,CAEIE,EAAoB,CAAChE,CAAAa,KAAA,CAAU,eAAV,CAArBmD,GACCnD,CAAAkD,eAAA,CAAoB,KAApB,CADDC,EAC+BnD,CAAAkD,eAAA,CAAoB,OAApB,CAD/BC,CAFJ,CAIIC,EAAoB,CAACjE,CAAAa,KAAA,CAAU,eAAV,CAErBiD,EAAJ,EACEjD,CAAAqD,SAAA,CAAc,KAAd,CAAqBC,QAA+B,CAACT,CAAD,CAAS,CAC3D1D,CAAAa,KAAA,CAAU,eAAV,CAA2B6C,CAA3B,CAD2D,CAA7D,CAIEM,EAAJ,EACEnD,CAAAqD,SAAA,CAAc,KAAd,CAAqBC,QAA+B,CAACT,CAAD,CAAS,CAC3D1D,CAAAa,KAAA,CAAU,eAAV,CAA2B6C,CAA3B,CAD2D,CAA7D,CAIEO,EAAJ,EACErD,CAAAK,OAAA,CAAasC,CAAb,CAAoCa,QAA+B,CAACV,CAAD,CAAS,CAC1E1D,CAAAa,KAAA,CAAU,eAAV,CAA2B6C,CAA3B,CAD0E,CAA5E,CAlB2B,CAuB3BG,CAAJ,EACE7D,CAAAa,KAAA,CAAU,UAAV,CAAsB,CAAtB,CA1CN,CA+CK,CAAAA,CAAAkD,eAAA,CAAoB,YAApB,CAAL;AAA0Cb,CAAAmB,YAAAC,SAA1C,EACKjC,CAAA,CAAiB,eAAjB,CAAkC,cAAlC,CAAkDrC,CAAlD,CAAwD,CAAA,CAAxD,CADL,EAGEa,CAAAqD,SAAA,CAAc,UAAd,CAA0B,QAAQ,EAAG,CACnClE,CAAAa,KAAA,CAAU,eAAV,CAA2B,CAAE,CAAAA,CAAA,SAA7B,CADmC,CAArC,CAKEwB,EAAA,CAAiB,cAAjB,CAAiC,aAAjC,CAAgDrC,CAAhD,CAAsD,CAAA,CAAtD,CAAJ,EACEY,CAAAK,OAAA,CAAasD,QAA2B,EAAG,CACzC,MAAOrB,EAAAsB,SADkC,CAA3C,CAEGC,QAA8B,CAACf,CAAD,CAAS,CACxC1D,CAAAa,KAAA,CAAU,cAAV,CAA0B,CAAE6C,CAAAA,CAA5B,CADwC,CAF1C,CAxEuC,CATtC,CAHqB,CAJzB,CAtBuC,CAA1B,CAftB,CAAAvB,UAAA,CAwIW,YAxIX,CAwIyB,CAAC,OAAD,CAAU,QAAQ,CAACC,CAAD,CAAQ,CACjD,MAAOA,EAAAF,YAAA,CAAkB,YAAlB,CAAgC,eAAhC,CAAiDpC,CAAjD,CAAgE,CAAA,CAAhE,CAD0C,CAA1B,CAxIzB,CAAAqC,UAAA,CA2IW,YA3IX,CA2IyB,QAAQ,EAAG,CAClC,MAAO,CACLS,SAAU,GADL,CAELC,QAAS,aAFJ,CAGL6B,KAAMA,QAAQ,CAAC9D,CAAD,CAAQZ,CAAR,CAAca,CAAd,CAAoB8D,CAApB,CAAgC,CACvC3E,CAAAa,KAAA,CAAU,WAAV,CAAL,EACEb,CAAAa,KAAA,CAAU,WAAV;AAAuB,WAAvB,CAF0C,CAHzC,CAD2B,CA3IpC,CAAAsB,UAAA,CAsJW,SAtJX,CAsJqB,CAAC,OAAD,CAAU,QAAV,CAAoB,QAAQ,CAACC,CAAD,CAAQwC,CAAR,CAAgB,CAC/D,MAAO,CACLhC,SAAU,GADL,CAELG,QAASA,QAAQ,CAAC/C,CAAD,CAAOa,CAAP,CAAa,CAC5B,IAAIgE,EAAKD,CAAA,CAAO/D,CAAAiE,QAAP,CAAyC,IAAzC,CAAqE,CAAA,CAArE,CACT,OAAO,SAAQ,CAAClE,CAAD,CAAQZ,CAAR,CAAca,CAAd,CAAoB,CAEjC,GAAK,CAAAd,CAAA,CAAYC,CAAZ,CAAkBF,CAAlB,CAAL,GAEMsC,CAAApB,OAAA,CAAa,kBAAb,CAQA,EARqC,CAAAhB,CAAAa,KAAA,CAAU,MAAV,CAQrC,EAPFb,CAAAa,KAAA,CAAU,MAAV,CAAkB,QAAlB,CAOE,CAJAuB,CAAApB,OAAA,CAAa,UAAb,CAIA,EAJ6B,CAAAhB,CAAAa,KAAA,CAAU,UAAV,CAI7B,EAHFb,CAAAa,KAAA,CAAU,UAAV,CAAsB,CAAtB,CAGE,CAAAuB,CAAApB,OAAA,CAAa,cAAb,CAAA,EAAiC+D,CAAAlE,CAAAkE,WAVvC,EAWI/E,CAAAgF,GAAA,CAAQ,UAAR,CAAoB,QAAQ,CAACC,CAAD,CAAQ,CAMlCC,QAASA,EAAQ,EAAG,CAClBL,CAAA,CAAGjE,CAAH,CAAU,CAAEuE,OAAQF,CAAV,CAAV,CADkB,CALpB,IAAIG,EAAUH,CAAAI,MAAVD,EAAyBH,CAAAG,QACb,GAAhB,GAAIA,CAAJ,EAAkC,EAAlC,GAAsBA,CAAtB,EACExE,CAAA0E,OAAA,CAAaJ,CAAb,CAHgC,CAApC,CAb6B,CAFP,CAFzB,CADwD,CAA5C,CAtJrB,CAAA/C,UAAA,CAwLW,YAxLX,CAwLyB,CAAC,OAAD,CAAU,QAAQ,CAACC,CAAD,CAAQ,CACjD,MAAO,SAAQ,CAACxB,CAAD;AAAQZ,CAAR,CAAca,CAAd,CAAoB,CAC7B,CAAAuB,CAAApB,OAAA,CAAa,UAAb,CAAJ,EAAiChB,CAAAa,KAAA,CAAU,UAAV,CAAjC,EAA2Dd,CAAA,CAAYC,CAAZ,CAAkBF,CAAlB,CAA3D,EACEE,CAAAa,KAAA,CAAU,UAAV,CAAsB,CAAtB,CAF+B,CADc,CAA1B,CAxLzB,CAvMsC,CAArC,CAAD,CAwYGlB,MAxYH,CAwYWA,MAAAC,QAxYX;", -"sources":["angular-aria.js"], -"names":["window","angular","undefined","nodeBlackList","isNodeOneOf","elem","nodeTypeArray","indexOf","nodeName","module","provider","ngAriaModule","$AriaProvider","watchExpr","attrName","ariaAttr","negate","scope","attr","ariaCamelName","$normalize","config","$watch","boolVal","ariaHidden","ariaChecked","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeypress","bindRoleForClick","this.config","newConfig","extend","$get","this.$get","key","$$watchExpr","directive","$aria","shouldAttachAttr","normalizedAttr","allowBlacklistEls","shouldAttachRole","role","getShape","type","restrict","require","priority","compile","shape","pre","ngModel","$isEmpty","ngModel.$isEmpty","value","post","ngAriaWatchModelValue","$modelValue","getRadioReaction","newVal","$viewValue","getCheckboxReaction","needsTabIndex","needsAriaValuemin","hasOwnProperty","needsAriaValuemax","needsAriaValuenow","$observe","ngAriaValueMinReaction","ngAriaValueNowReaction","$validators","required","ngAriaInvalidWatch","$invalid","ngAriaInvalidReaction","link","ngMessages","$parse","fn","ngClick","ngKeypress","on","event","callback","$event","keyCode","which","$apply"] -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.js deleted file mode 100644 index 2157ef03f..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.js +++ /dev/null @@ -1,322 +0,0 @@ -/** - * @license AngularJS v1.5.0 - * (c) 2010-2016 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular, undefined) {'use strict'; - -/** - * @ngdoc module - * @name ngCookies - * @description - * - * # ngCookies - * - * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies. - * - * - *
    - * - * See {@link ngCookies.$cookies `$cookies`} for usage. - */ - - -angular.module('ngCookies', ['ng']). - /** - * @ngdoc provider - * @name $cookiesProvider - * @description - * Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service. - * */ - provider('$cookies', [function $CookiesProvider() { - /** - * @ngdoc property - * @name $cookiesProvider#defaults - * @description - * - * Object containing default options to pass when setting cookies. - * - * The object may have following properties: - * - * - **path** - `{string}` - The cookie will be available only for this path and its - * sub-paths. By default, this is the URL that appears in your `` tag. - * - **domain** - `{string}` - The cookie will be available only for this domain and - * its sub-domains. For security reasons the user agent will not accept the cookie - * if the current domain is not a sub-domain of this domain or equal to it. - * - **expires** - `{string|Date}` - String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT" - * or a Date object indicating the exact date/time this cookie will expire. - * - **secure** - `{boolean}` - If `true`, then the cookie will only be available through a - * secured connection. - * - * Note: By default, the address that appears in your `` tag will be used as the path. - * This is important so that cookies will be visible for all routes when html5mode is enabled. - * - **/ - var defaults = this.defaults = {}; - - function calcOptions(options) { - return options ? angular.extend({}, defaults, options) : defaults; - } - - /** - * @ngdoc service - * @name $cookies - * - * @description - * Provides read/write access to browser's cookies. - * - *
    - * Up until Angular 1.3, `$cookies` exposed properties that represented the - * current browser cookie values. In version 1.4, this behavior has changed, and - * `$cookies` now provides a standard api of getters, setters etc. - *
    - * - * Requires the {@link ngCookies `ngCookies`} module to be installed. - * - * @example - * - * ```js - * angular.module('cookiesExample', ['ngCookies']) - * .controller('ExampleController', ['$cookies', function($cookies) { - * // Retrieving a cookie - * var favoriteCookie = $cookies.get('myFavorite'); - * // Setting a cookie - * $cookies.put('myFavorite', 'oatmeal'); - * }]); - * ``` - */ - this.$get = ['$$cookieReader', '$$cookieWriter', function($$cookieReader, $$cookieWriter) { - return { - /** - * @ngdoc method - * @name $cookies#get - * - * @description - * Returns the value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {string} Raw cookie value. - */ - get: function(key) { - return $$cookieReader()[key]; - }, - - /** - * @ngdoc method - * @name $cookies#getObject - * - * @description - * Returns the deserialized value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {Object} Deserialized cookie value. - */ - getObject: function(key) { - var value = this.get(key); - return value ? angular.fromJson(value) : value; - }, - - /** - * @ngdoc method - * @name $cookies#getAll - * - * @description - * Returns a key value object with all the cookies - * - * @returns {Object} All cookies - */ - getAll: function() { - return $$cookieReader(); - }, - - /** - * @ngdoc method - * @name $cookies#put - * - * @description - * Sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {string} value Raw value to be stored. - * @param {Object=} options Options object. - * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults} - */ - put: function(key, value, options) { - $$cookieWriter(key, value, calcOptions(options)); - }, - - /** - * @ngdoc method - * @name $cookies#putObject - * - * @description - * Serializes and sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {Object} value Value to be stored. - * @param {Object=} options Options object. - * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults} - */ - putObject: function(key, value, options) { - this.put(key, angular.toJson(value), options); - }, - - /** - * @ngdoc method - * @name $cookies#remove - * - * @description - * Remove given cookie - * - * @param {string} key Id of the key-value pair to delete. - * @param {Object=} options Options object. - * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults} - */ - remove: function(key, options) { - $$cookieWriter(key, undefined, calcOptions(options)); - } - }; - }]; - }]); - -angular.module('ngCookies'). -/** - * @ngdoc service - * @name $cookieStore - * @deprecated - * @requires $cookies - * - * @description - * Provides a key-value (string-object) storage, that is backed by session cookies. - * Objects put or retrieved from this storage are automatically serialized or - * deserialized by angular's toJson/fromJson. - * - * Requires the {@link ngCookies `ngCookies`} module to be installed. - * - *
    - * **Note:** The $cookieStore service is **deprecated**. - * Please use the {@link ngCookies.$cookies `$cookies`} service instead. - *
    - * - * @example - * - * ```js - * angular.module('cookieStoreExample', ['ngCookies']) - * .controller('ExampleController', ['$cookieStore', function($cookieStore) { - * // Put cookie - * $cookieStore.put('myFavorite','oatmeal'); - * // Get cookie - * var favoriteCookie = $cookieStore.get('myFavorite'); - * // Removing a cookie - * $cookieStore.remove('myFavorite'); - * }]); - * ``` - */ - factory('$cookieStore', ['$cookies', function($cookies) { - - return { - /** - * @ngdoc method - * @name $cookieStore#get - * - * @description - * Returns the value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist. - */ - get: function(key) { - return $cookies.getObject(key); - }, - - /** - * @ngdoc method - * @name $cookieStore#put - * - * @description - * Sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {Object} value Value to be stored. - */ - put: function(key, value) { - $cookies.putObject(key, value); - }, - - /** - * @ngdoc method - * @name $cookieStore#remove - * - * @description - * Remove given cookie - * - * @param {string} key Id of the key-value pair to delete. - */ - remove: function(key) { - $cookies.remove(key); - } - }; - - }]); - -/** - * @name $$cookieWriter - * @requires $document - * - * @description - * This is a private service for writing cookies - * - * @param {string} name Cookie name - * @param {string=} value Cookie value (if undefined, cookie will be deleted) - * @param {Object=} options Object with options that need to be stored for the cookie. - */ -function $$CookieWriter($document, $log, $browser) { - var cookiePath = $browser.baseHref(); - var rawDocument = $document[0]; - - function buildCookieString(name, value, options) { - var path, expires; - options = options || {}; - expires = options.expires; - path = angular.isDefined(options.path) ? options.path : cookiePath; - if (angular.isUndefined(value)) { - expires = 'Thu, 01 Jan 1970 00:00:00 GMT'; - value = ''; - } - if (angular.isString(expires)) { - expires = new Date(expires); - } - - var str = encodeURIComponent(name) + '=' + encodeURIComponent(value); - str += path ? ';path=' + path : ''; - str += options.domain ? ';domain=' + options.domain : ''; - str += expires ? ';expires=' + expires.toUTCString() : ''; - str += options.secure ? ';secure' : ''; - - // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum: - // - 300 cookies - // - 20 cookies per unique domain - // - 4096 bytes per cookie - var cookieLength = str.length + 1; - if (cookieLength > 4096) { - $log.warn("Cookie '" + name + - "' possibly not set or overflowed because it was too large (" + - cookieLength + " > 4096 bytes)!"); - } - - return str; - } - - return function(name, value, options) { - rawDocument.cookie = buildCookieString(name, value, options); - }; -} - -$$CookieWriter.$inject = ['$document', '$log', '$browser']; - -angular.module('ngCookies').provider('$$cookieWriter', function $$CookieWriterProvider() { - this.$get = $$CookieWriter; -}); - - -})(window, window.angular); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.min.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.min.js deleted file mode 100644 index d0f126a95..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - AngularJS v1.5.0 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(p,c,n){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,n,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore", -["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular); -//# sourceMappingURL=angular-cookies.min.js.map diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.min.js.map b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.min.js.map deleted file mode 100644 index 555b5103b..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-cookies.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular-cookies.min.js", -"lineCount":8, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CA2QtCC,QAASA,EAAc,CAACC,CAAD,CAAYC,CAAZ,CAAkBC,CAAlB,CAA4B,CACjD,IAAIC,EAAaD,CAAAE,SAAA,EAAjB,CACIC,EAAcL,CAAA,CAAU,CAAV,CAmClB,OAAO,SAAQ,CAACM,CAAD,CAAOC,CAAP,CAAcC,CAAd,CAAuB,CAjCW,IAC3CC,CAD2C,CACrCC,CACVF,EAAA,CAgCoDA,CAhCpD,EAAqB,EACrBE,EAAA,CAAUF,CAAAE,QACVD,EAAA,CAAOZ,CAAAc,UAAA,CAAkBH,CAAAC,KAAlB,CAAA,CAAkCD,CAAAC,KAAlC,CAAiDN,CACpDN,EAAAe,YAAA,CAAoBL,CAApB,CAAJ,GACEG,CACA,CADU,+BACV,CAAAH,CAAA,CAAQ,EAFV,CAIIV,EAAAgB,SAAA,CAAiBH,CAAjB,CAAJ,GACEA,CADF,CACY,IAAII,IAAJ,CAASJ,CAAT,CADZ,CAIIK,EAAAA,CAAMC,kBAAA,CAqB6BV,CArB7B,CAANS,CAAiC,GAAjCA,CAAuCC,kBAAA,CAAmBT,CAAnB,CAE3CQ,EAAA,CADAA,CACA,EADON,CAAA,CAAO,QAAP,CAAkBA,CAAlB,CAAyB,EAChC,GAAOD,CAAAS,OAAA,CAAiB,UAAjB,CAA8BT,CAAAS,OAA9B,CAA+C,EAAtD,CACAF,EAAA,EAAOL,CAAA,CAAU,WAAV,CAAwBA,CAAAQ,YAAA,EAAxB,CAAgD,EACvDH,EAAA,EAAOP,CAAAW,OAAA,CAAiB,SAAjB,CAA6B,EAMhCC,EAAAA,CAAeL,CAAAM,OAAfD,CAA4B,CACb,KAAnB,CAAIA,CAAJ,EACEnB,CAAAqB,KAAA,CAAU,UAAV,CASqChB,CATrC,CACE,6DADF;AAEEc,CAFF,CAEiB,iBAFjB,CASFf,EAAAkB,OAAA,CAJOR,CAG6B,CArCW,CAzPnDlB,CAAA2B,OAAA,CAAe,WAAf,CAA4B,CAAC,IAAD,CAA5B,CAAAC,SAAA,CAOY,UAPZ,CAOwB,CAACC,QAAyB,EAAG,CAwBjD,IAAIC,EAAW,IAAAA,SAAXA,CAA2B,EAiC/B,KAAAC,KAAA,CAAY,CAAC,gBAAD,CAAmB,gBAAnB,CAAqC,QAAQ,CAACC,CAAD,CAAiBC,CAAjB,CAAiC,CACxF,MAAO,CAWLC,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOH,EAAA,EAAA,CAAiBG,CAAjB,CADU,CAXd,CAyBLC,UAAWA,QAAQ,CAACD,CAAD,CAAM,CAEvB,MAAO,CADHzB,CACG,CADK,IAAAwB,IAAA,CAASC,CAAT,CACL,EAAQnC,CAAAqC,SAAA,CAAiB3B,CAAjB,CAAR,CAAkCA,CAFlB,CAzBpB,CAuCL4B,OAAQA,QAAQ,EAAG,CACjB,MAAON,EAAA,EADU,CAvCd,CAuDLO,IAAKA,QAAQ,CAACJ,CAAD,CAAMzB,CAAN,CAAaC,CAAb,CAAsB,CACjCsB,CAAA,CAAeE,CAAf,CAAoBzB,CAApB,CAAuCC,CAvFpC,CAAUX,CAAAwC,OAAA,CAAe,EAAf,CAAmBV,CAAnB,CAuF0BnB,CAvF1B,CAAV,CAAkDmB,CAuFrD,CADiC,CAvD9B,CAuELW,UAAWA,QAAQ,CAACN,CAAD,CAAMzB,CAAN,CAAaC,CAAb,CAAsB,CACvC,IAAA4B,IAAA,CAASJ,CAAT,CAAcnC,CAAA0C,OAAA,CAAehC,CAAf,CAAd,CAAqCC,CAArC,CADuC,CAvEpC,CAsFLgC,OAAQA,QAAQ,CAACR,CAAD,CAAMxB,CAAN,CAAe,CAC7BsB,CAAA,CAAeE,CAAf,CAAoBlC,CAApB,CAA2CU,CAtHxC,CAAUX,CAAAwC,OAAA,CAAe,EAAf,CAAmBV,CAAnB,CAsH8BnB,CAtH9B,CAAV,CAAkDmB,CAsHrD,CAD6B,CAtF1B,CADiF,CAA9E,CAzDqC,CAA7B,CAPxB,CA8JA9B,EAAA2B,OAAA,CAAe,WAAf,CAAAiB,QAAA,CAiCS,cAjCT;AAiCyB,CAAC,UAAD,CAAa,QAAQ,CAACC,CAAD,CAAW,CAErD,MAAO,CAWLX,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOU,EAAAT,UAAA,CAAmBD,CAAnB,CADU,CAXd,CAyBLI,IAAKA,QAAQ,CAACJ,CAAD,CAAMzB,CAAN,CAAa,CACxBmC,CAAAJ,UAAA,CAAmBN,CAAnB,CAAwBzB,CAAxB,CADwB,CAzBrB,CAsCLiC,OAAQA,QAAQ,CAACR,CAAD,CAAM,CACpBU,CAAAF,OAAA,CAAgBR,CAAhB,CADoB,CAtCjB,CAF8C,CAAhC,CAjCzB,CAqIAjC,EAAA4C,QAAA,CAAyB,CAAC,WAAD,CAAc,MAAd,CAAsB,UAAtB,CAEzB9C,EAAA2B,OAAA,CAAe,WAAf,CAAAC,SAAA,CAAqC,gBAArC,CAAuDmB,QAA+B,EAAG,CACvF,IAAAhB,KAAA,CAAY7B,CAD2E,CAAzF,CAvTsC,CAArC,CAAD,CA4TGH,MA5TH,CA4TWA,MAAAC,QA5TX;", -"sources":["angular-cookies.js"], -"names":["window","angular","undefined","$$CookieWriter","$document","$log","$browser","cookiePath","baseHref","rawDocument","name","value","options","path","expires","isDefined","isUndefined","isString","Date","str","encodeURIComponent","domain","toUTCString","secure","cookieLength","length","warn","cookie","module","provider","$CookiesProvider","defaults","$get","$$cookieReader","$$cookieWriter","get","key","getObject","fromJson","getAll","put","extend","putObject","toJson","remove","factory","$cookies","$inject","$$CookieWriterProvider"] -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-csp.css b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-csp.css deleted file mode 100644 index 23134fdfb..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-csp.css +++ /dev/null @@ -1,20 +0,0 @@ - -@charset "UTF-8"; - -[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], -.ng-cloak, .x-ng-cloak, -.ng-hide:not(.ng-hide-animate) { - display: none !important; -} - -ng\:form { - display: block; -} - -.ng-animate-shim { - visibility:hidden; -} - -.ng-anchor { - position:absolute; -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-loader.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-loader.js deleted file mode 100644 index 77948fd58..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-loader.js +++ /dev/null @@ -1,484 +0,0 @@ -/** - * @license AngularJS v1.5.0 - * (c) 2010-2016 Google, Inc. http://angularjs.org - * License: MIT - */ - -(function() {'use strict'; - function isFunction(value) {return typeof value === 'function';}; - -/* global: toDebugString: true */ - -function serializeObject(obj) { - var seen = []; - - return JSON.stringify(obj, function(key, val) { - val = toJsonReplacer(key, val); - if (isObject(val)) { - - if (seen.indexOf(val) >= 0) return '...'; - - seen.push(val); - } - return val; - }); -} - -function toDebugString(obj) { - if (typeof obj === 'function') { - return obj.toString().replace(/ \{[\s\S]*$/, ''); - } else if (isUndefined(obj)) { - return 'undefined'; - } else if (typeof obj !== 'string') { - return serializeObject(obj); - } - return obj; -} - -/** - * @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. - * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning - * error from returned function, for cases when a particular type of error is useful. - * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance - */ - -function minErr(module, ErrorConstructor) { - ErrorConstructor = ErrorConstructor || Error; - return function() { - var SKIP_INDEXES = 2; - - var templateArgs = arguments, - code = templateArgs[0], - message = '[' + (module ? module + ':' : '') + code + '] ', - template = templateArgs[1], - paramPrefix, i; - - message += template.replace(/\{\d+\}/g, function(match) { - var index = +match.slice(1, -1), - shiftedIndex = index + SKIP_INDEXES; - - if (shiftedIndex < templateArgs.length) { - return toDebugString(templateArgs[shiftedIndex]); - } - - return match; - }); - - message += '\nhttp://errors.angularjs.org/1.5.0/' + - (module ? module + '/' : '') + code; - - for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') { - message += paramPrefix + 'p' + (i - SKIP_INDEXES) + '=' + - encodeURIComponent(toDebugString(templateArgs[i])); - } - - return new ErrorConstructor(message); - }; -} - -/** - * @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. - * - * Passing one argument retrieves an existing {@link angular.Module}, - * whereas passing more than one argument creates a new {@link angular.Module} - * - * - * # 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 {angular.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 configBlocks = []; - - /** @type {!Array.} */ - var runBlocks = []; - - var config = invokeLater('$injector', 'invoke', 'push', configBlocks); - - /** @type {angular.Module} */ - var moduleInstance = { - // Private state - _invokeQueue: invokeQueue, - _configBlocks: configBlocks, - _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: invokeLaterAndSetModuleName('$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: invokeLaterAndSetModuleName('$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: invokeLaterAndSetModuleName('$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 constants 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#decorator - * @module ng - * @param {string} The name of the service to decorate. - * @param {Function} This function will be invoked when the service needs to be - * instantiated and should return the decorated service instance. - * @description - * See {@link auto.$provide#decorator $provide.decorator()}. - */ - decorator: invokeLaterAndSetModuleName('$provide', 'decorator'), - - /** - * @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 $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 ng.$animateProvider#register $animateProvider.register()} and - * {@link ngAnimate ngAnimate module} for more information. - */ - animation: invokeLaterAndSetModuleName('$animateProvider', 'register'), - - /** - * @ngdoc method - * @name angular.Module#filter - * @module ng - * @param {string} name Filter name - this must be a valid angular expression identifier - * @param {Function} filterFactory Factory function for creating new instance of filter. - * @description - * See {@link ng.$filterProvider#register $filterProvider.register()}. - * - *
    - * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`. - * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace - * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores - * (`myapp_subsection_filterx`). - *
    - */ - filter: invokeLaterAndSetModuleName('$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: invokeLaterAndSetModuleName('$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: invokeLaterAndSetModuleName('$compileProvider', 'directive'), - - /** - * @ngdoc method - * @name angular.Module#component - * @module ng - * @param {string} name Name of the component in camel-case (i.e. myComp which will match as my-comp) - * @param {Object} options Component definition object (a simplified - * {@link ng.$compile#directive-definition-object directive definition object}) - * - * @description - * See {@link ng.$compileProvider#component $compileProvider.component()}. - */ - component: invokeLaterAndSetModuleName('$compileProvider', 'component'), - - /** - * @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#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, queue) { - if (!queue) queue = invokeQueue; - return function() { - queue[insertMethod || 'push']([provider, method, arguments]); - return moduleInstance; - }; - } - - /** - * @param {string} provider - * @param {string} method - * @returns {angular.Module} - */ - function invokeLaterAndSetModuleName(provider, method) { - return function(recipeName, factoryFunction) { - if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name; - invokeQueue.push([provider, method, arguments]); - return moduleInstance; - }; - } - }); - }; - }); - -} - -setupModuleLoader(window); -})(window); - -/** - * Closure compiler type information - * - * @typedef { { - * requires: !Array., - * invokeQueue: !Array.>, - * - * service: function(string, Function):angular.Module, - * factory: function(string, Function):angular.Module, - * value: function(string, *):angular.Module, - * - * filter: function(string, Function):angular.Module, - * - * init: function(Function):angular.Module - * } } - */ -angular.Module; - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-loader.min.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-loader.min.js deleted file mode 100644 index 316ee26e9..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-loader.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - AngularJS v1.5.0 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(){'use strict';function d(b){return function(){var a=arguments[0],e;e="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.5.0/"+(b?b+"/":"")+a;for(a=1;a= line.length) { - index -= line.length; - } else { - return { line: i + 1, column: index + 1 }; - } - } -} -var PARSE_CACHE_FOR_TEXT_LITERALS = Object.create(null); - -function parseTextLiteral(text) { - var cachedFn = PARSE_CACHE_FOR_TEXT_LITERALS[text]; - if (cachedFn != null) { - return cachedFn; - } - function parsedFn(context) { return text; } - parsedFn['$$watchDelegate'] = function watchDelegate(scope, listener, objectEquality) { - var unwatch = scope['$watch'](noop, - function textLiteralWatcher() { - if (isFunction(listener)) { listener.call(null, text, text, scope); } - unwatch(); - }, - objectEquality); - return unwatch; - }; - PARSE_CACHE_FOR_TEXT_LITERALS[text] = parsedFn; - parsedFn['exp'] = text; // Needed to pretend to be $interpolate for tests copied from interpolateSpec.js - parsedFn['expressions'] = []; // Require this to call $compile.$$addBindingInfo() which allows Protractor to find elements by binding. - return parsedFn; -} - -function subtractOffset(expressionFn, offset) { - if (offset === 0) { - return expressionFn; - } - function minusOffset(value) { - return (value == void 0) ? value : value - offset; - } - function parsedFn(context) { return minusOffset(expressionFn(context)); } - var unwatch; - parsedFn['$$watchDelegate'] = function watchDelegate(scope, listener, objectEquality) { - unwatch = scope['$watch'](expressionFn, - function pluralExpressionWatchListener(newValue, oldValue) { - if (isFunction(listener)) { listener.call(null, minusOffset(newValue), minusOffset(oldValue), scope); } - }, - objectEquality); - return unwatch; - }; - return parsedFn; -} - -// NOTE: ADVANCED_OPTIMIZATIONS mode. -// -// This file is compiled with Closure compiler's ADVANCED_OPTIMIZATIONS flag! Be wary of using -// constructs incompatible with that mode. - -/* global $interpolateMinErr: false */ -/* global isFunction: false */ -/* global noop: false */ - -/** - * @constructor - * @private - */ -function MessageSelectorBase(expressionFn, choices) { - var self = this; - this.expressionFn = expressionFn; - this.choices = choices; - if (choices["other"] === void 0) { - throw $interpolateMinErr('reqother', '“other†is a required option.'); - } - this.parsedFn = function(context) { return self.getResult(context); }; - this.parsedFn['$$watchDelegate'] = function $$watchDelegate(scope, listener, objectEquality) { - return self.watchDelegate(scope, listener, objectEquality); - }; - this.parsedFn['exp'] = expressionFn['exp']; - this.parsedFn['expressions'] = expressionFn['expressions']; -} - -MessageSelectorBase.prototype.getMessageFn = function getMessageFn(value) { - return this.choices[this.categorizeValue(value)]; -}; - -MessageSelectorBase.prototype.getResult = function getResult(context) { - return this.getMessageFn(this.expressionFn(context))(context); -}; - -MessageSelectorBase.prototype.watchDelegate = function watchDelegate(scope, listener, objectEquality) { - var watchers = new MessageSelectorWatchers(this, scope, listener, objectEquality); - return function() { watchers.cancelWatch(); }; -}; - -/** - * @constructor - * @private - */ -function MessageSelectorWatchers(msgSelector, scope, listener, objectEquality) { - var self = this; - this.scope = scope; - this.msgSelector = msgSelector; - this.listener = listener; - this.objectEquality = objectEquality; - this.lastMessage = void 0; - this.messageFnWatcher = noop; - var expressionFnListener = function(newValue, oldValue) { return self.expressionFnListener(newValue, oldValue); }; - this.expressionFnWatcher = scope['$watch'](msgSelector.expressionFn, expressionFnListener, objectEquality); -} - -MessageSelectorWatchers.prototype.expressionFnListener = function expressionFnListener(newValue, oldValue) { - var self = this; - this.messageFnWatcher(); - var messageFnListener = function(newMessage, oldMessage) { return self.messageFnListener(newMessage, oldMessage); }; - var messageFn = this.msgSelector.getMessageFn(newValue); - this.messageFnWatcher = this.scope['$watch'](messageFn, messageFnListener, this.objectEquality); -}; - -MessageSelectorWatchers.prototype.messageFnListener = function messageFnListener(newMessage, oldMessage) { - if (isFunction(this.listener)) { - this.listener.call(null, newMessage, newMessage === oldMessage ? newMessage : this.lastMessage, this.scope); - } - this.lastMessage = newMessage; -}; - -MessageSelectorWatchers.prototype.cancelWatch = function cancelWatch() { - this.expressionFnWatcher(); - this.messageFnWatcher(); -}; - -/** - * @constructor - * @extends MessageSelectorBase - * @private - */ -function SelectMessage(expressionFn, choices) { - MessageSelectorBase.call(this, expressionFn, choices); -} - -function SelectMessageProto() {} -SelectMessageProto.prototype = MessageSelectorBase.prototype; - -SelectMessage.prototype = new SelectMessageProto(); -SelectMessage.prototype.categorizeValue = function categorizeSelectValue(value) { - return (this.choices[value] !== void 0) ? value : "other"; -}; - -/** - * @constructor - * @extends MessageSelectorBase - * @private - */ -function PluralMessage(expressionFn, choices, offset, pluralCat) { - MessageSelectorBase.call(this, expressionFn, choices); - this.offset = offset; - this.pluralCat = pluralCat; -} - -function PluralMessageProto() {} -PluralMessageProto.prototype = MessageSelectorBase.prototype; - -PluralMessage.prototype = new PluralMessageProto(); -PluralMessage.prototype.categorizeValue = function categorizePluralValue(value) { - if (isNaN(value)) { - return "other"; - } else if (this.choices[value] !== void 0) { - return value; - } else { - var category = this.pluralCat(value - this.offset); - return (this.choices[category] !== void 0) ? category : "other"; - } -}; - -// NOTE: ADVANCED_OPTIMIZATIONS mode. -// -// This file is compiled with Closure compiler's ADVANCED_OPTIMIZATIONS flag! Be wary of using -// constructs incompatible with that mode. - -/* global $interpolateMinErr: false */ -/* global isFunction: false */ -/* global parseTextLiteral: false */ - -/** - * @constructor - * @private - */ -function InterpolationParts(trustedContext, allOrNothing) { - this.trustedContext = trustedContext; - this.allOrNothing = allOrNothing; - this.textParts = []; - this.expressionFns = []; - this.expressionIndices = []; - this.partialText = ''; - this.concatParts = null; -} - -InterpolationParts.prototype.flushPartialText = function flushPartialText() { - if (this.partialText) { - if (this.concatParts == null) { - this.textParts.push(this.partialText); - } else { - this.textParts.push(this.concatParts.join('')); - this.concatParts = null; - } - this.partialText = ''; - } -}; - -InterpolationParts.prototype.addText = function addText(text) { - if (text.length) { - if (!this.partialText) { - this.partialText = text; - } else if (this.concatParts) { - this.concatParts.push(text); - } else { - this.concatParts = [this.partialText, text]; - } - } -}; - -InterpolationParts.prototype.addExpressionFn = function addExpressionFn(expressionFn) { - this.flushPartialText(); - this.expressionIndices.push(this.textParts.length); - this.expressionFns.push(expressionFn); - this.textParts.push(''); -}; - -InterpolationParts.prototype.getExpressionValues = function getExpressionValues(context) { - var expressionValues = new Array(this.expressionFns.length); - for (var i = 0; i < this.expressionFns.length; i++) { - expressionValues[i] = this.expressionFns[i](context); - } - return expressionValues; -}; - -InterpolationParts.prototype.getResult = function getResult(expressionValues) { - for (var i = 0; i < this.expressionIndices.length; i++) { - var expressionValue = expressionValues[i]; - if (this.allOrNothing && expressionValue === void 0) return; - this.textParts[this.expressionIndices[i]] = expressionValue; - } - return this.textParts.join(''); -}; - - -InterpolationParts.prototype.toParsedFn = function toParsedFn(mustHaveExpression, originalText) { - var self = this; - this.flushPartialText(); - if (mustHaveExpression && this.expressionFns.length === 0) { - return void 0; - } - if (this.textParts.length === 0) { - return parseTextLiteral(''); - } - if (this.trustedContext && this.textParts.length > 1) { - $interpolateMinErr['throwNoconcat'](originalText); - } - if (this.expressionFns.length === 0) { - if (this.textParts.length != 1) { this.errorInParseLogic(); } - return parseTextLiteral(this.textParts[0]); - } - var parsedFn = function(context) { - return self.getResult(self.getExpressionValues(context)); - }; - parsedFn['$$watchDelegate'] = function $$watchDelegate(scope, listener, objectEquality) { - return self.watchDelegate(scope, listener, objectEquality); - }; - - parsedFn['exp'] = originalText; // Needed to pretend to be $interpolate for tests copied from interpolateSpec.js - parsedFn['expressions'] = new Array(this.expressionFns.length); // Require this to call $compile.$$addBindingInfo() which allows Protractor to find elements by binding. - for (var i = 0; i < this.expressionFns.length; i++) { - parsedFn['expressions'][i] = this.expressionFns[i]['exp']; - } - - return parsedFn; -}; - -InterpolationParts.prototype.watchDelegate = function watchDelegate(scope, listener, objectEquality) { - var watcher = new InterpolationPartsWatcher(this, scope, listener, objectEquality); - return function() { watcher.cancelWatch(); }; -}; - -function InterpolationPartsWatcher(interpolationParts, scope, listener, objectEquality) { - this.interpolationParts = interpolationParts; - this.scope = scope; - this.previousResult = (void 0); - this.listener = listener; - var self = this; - this.expressionFnsWatcher = scope['$watchGroup'](interpolationParts.expressionFns, function(newExpressionValues, oldExpressionValues) { - self.watchListener(newExpressionValues, oldExpressionValues); - }); -} - -InterpolationPartsWatcher.prototype.watchListener = function watchListener(newExpressionValues, oldExpressionValues) { - var result = this.interpolationParts.getResult(newExpressionValues); - if (isFunction(this.listener)) { - this.listener.call(null, result, newExpressionValues === oldExpressionValues ? result : this.previousResult, this.scope); - } - this.previousResult = result; -}; - -InterpolationPartsWatcher.prototype.cancelWatch = function cancelWatch() { - this.expressionFnsWatcher(); -}; - -// NOTE: ADVANCED_OPTIMIZATIONS mode. -// -// This file is compiled with Closure compiler's ADVANCED_OPTIMIZATIONS flag! Be wary of using -// constructs incompatible with that mode. - -/* global $interpolateMinErr: false */ -/* global indexToLineAndColumn: false */ -/* global InterpolationParts: false */ -/* global PluralMessage: false */ -/* global SelectMessage: false */ -/* global subtractOffset: false */ - -// The params src and dst are exactly one of two types: NestedParserState or MessageFormatParser. -// This function is fully optimized by V8. (inspect via IRHydra or --trace-deopt.) -// The idea behind writing it this way is to avoid repeating oneself. This is the ONE place where -// the parser state that is saved/restored when parsing nested mustaches is specified. -function copyNestedParserState(src, dst) { - dst.expressionFn = src.expressionFn; - dst.expressionMinusOffsetFn = src.expressionMinusOffsetFn; - dst.pluralOffset = src.pluralOffset; - dst.choices = src.choices; - dst.choiceKey = src.choiceKey; - dst.interpolationParts = src.interpolationParts; - dst.ruleChoiceKeyword = src.ruleChoiceKeyword; - dst.msgStartIndex = src.msgStartIndex; - dst.expressionStartIndex = src.expressionStartIndex; -} - -function NestedParserState(parser) { - copyNestedParserState(parser, this); -} - -/** - * @constructor - * @private - */ -function MessageFormatParser(text, startIndex, $parse, pluralCat, stringifier, - mustHaveExpression, trustedContext, allOrNothing) { - this.text = text; - this.index = startIndex || 0; - this.$parse = $parse; - this.pluralCat = pluralCat; - this.stringifier = stringifier; - this.mustHaveExpression = !!mustHaveExpression; - this.trustedContext = trustedContext; - this.allOrNothing = !!allOrNothing; - this.expressionFn = null; - this.expressionMinusOffsetFn = null; - this.pluralOffset = null; - this.choices = null; - this.choiceKey = null; - this.interpolationParts = null; - this.msgStartIndex = null; - this.nestedStateStack = []; - this.parsedFn = null; - this.rule = null; - this.ruleStack = null; - this.ruleChoiceKeyword = null; - this.interpNestLevel = null; - this.expressionStartIndex = null; - this.stringStartIndex = null; - this.stringQuote = null; - this.stringInterestsRe = null; - this.angularOperatorStack = null; - this.textPart = null; -} - -// preserve v8 optimization. -var EMPTY_STATE = new NestedParserState(new MessageFormatParser( - /* text= */ '', /* startIndex= */ 0, /* $parse= */ null, /* pluralCat= */ null, /* stringifier= */ null, - /* mustHaveExpression= */ false, /* trustedContext= */ null, /* allOrNothing */ false)); - -MessageFormatParser.prototype.pushState = function pushState() { - this.nestedStateStack.push(new NestedParserState(this)); - copyNestedParserState(EMPTY_STATE, this); -}; - -MessageFormatParser.prototype.popState = function popState() { - if (this.nestedStateStack.length === 0) { - this.errorInParseLogic(); - } - var previousState = this.nestedStateStack.pop(); - copyNestedParserState(previousState, this); -}; - -// Oh my JavaScript! Who knew you couldn't match a regex at a specific -// location in a string but will always search forward?! -// Apparently you'll be growing this ability via the sticky flag (y) in -// ES6. I'll just to work around you for now. -MessageFormatParser.prototype.matchRe = function matchRe(re, search) { - re.lastIndex = this.index; - var match = re.exec(this.text); - if (match != null && (search === true || (match.index == this.index))) { - this.index = re.lastIndex; - return match; - } - return null; -}; - -MessageFormatParser.prototype.searchRe = function searchRe(re) { - return this.matchRe(re, true); -}; - - -MessageFormatParser.prototype.consumeRe = function consumeRe(re) { - // Without the sticky flag, we can't use the .test() method to consume a - // match at the current index. Instead, we'll use the slower .exec() method - // and verify match.index. - return !!this.matchRe(re); -}; - -// Run through our grammar avoiding deeply nested function call chains. -MessageFormatParser.prototype.run = function run(initialRule) { - this.ruleStack = [initialRule]; - do { - this.rule = this.ruleStack.pop(); - while (this.rule) { - this.rule(); - } - this.assertRuleOrNull(this.rule); - } while (this.ruleStack.length > 0); -}; - -MessageFormatParser.prototype.errorInParseLogic = function errorInParseLogic() { - throw $interpolateMinErr('logicbug', - 'The messageformat parser has encountered an internal error. Please file a github issue against the AngularJS project and provide this message text that triggers the bug. Text: “{0}â€', - this.text); -}; - -MessageFormatParser.prototype.assertRuleOrNull = function assertRuleOrNull(rule) { - if (rule === void 0) { - this.errorInParseLogic(); - } -}; - -var NEXT_WORD_RE = /\s*(\w+)\s*/g; -MessageFormatParser.prototype.errorExpecting = function errorExpecting() { - // What was wrong with the syntax? Unsupported type, missing comma, or something else? - var match = this.matchRe(NEXT_WORD_RE), position; - if (match == null) { - position = indexToLineAndColumn(this.text, this.index); - throw $interpolateMinErr('reqarg', - 'Expected one of “plural†or “select†at line {0}, column {1} of text “{2}â€', - position.line, position.column, this.text); - } - var word = match[1]; - if (word == "select" || word == "plural") { - position = indexToLineAndColumn(this.text, this.index); - throw $interpolateMinErr('reqcomma', - 'Expected a comma after the keyword “{0}†at line {1}, column {2} of text “{3}â€', - word, position.line, position.column, this.text); - } else { - position = indexToLineAndColumn(this.text, this.index); - throw $interpolateMinErr('unknarg', - 'Unsupported keyword “{0}†at line {0}, column {1}. Only “plural†and “select†are currently supported. Text: “{3}â€', - word, position.line, position.column, this.text); - } -}; - -var STRING_START_RE = /['"]/g; -MessageFormatParser.prototype.ruleString = function ruleString() { - var match = this.matchRe(STRING_START_RE); - if (match == null) { - var position = indexToLineAndColumn(this.text, this.index); - throw $interpolateMinErr('wantstring', - 'Expected the beginning of a string at line {0}, column {1} in text “{2}â€', - position.line, position.column, this.text); - } - this.startStringAtMatch(match); -}; - -MessageFormatParser.prototype.startStringAtMatch = function startStringAtMatch(match) { - this.stringStartIndex = match.index; - this.stringQuote = match[0]; - this.stringInterestsRe = this.stringQuote == "'" ? SQUOTED_STRING_INTEREST_RE : DQUOTED_STRING_INTEREST_RE; - this.rule = this.ruleInsideString; -}; - -var SQUOTED_STRING_INTEREST_RE = /\\(?:\\|'|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{2}|[0-7]{3}|\r\n|\n|[\s\S])|'/g; -var DQUOTED_STRING_INTEREST_RE = /\\(?:\\|"|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{2}|[0-7]{3}|\r\n|\n|[\s\S])|"/g; -MessageFormatParser.prototype.ruleInsideString = function ruleInsideString() { - var match = this.searchRe(this.stringInterestsRe); - if (match == null) { - var position = indexToLineAndColumn(this.text, this.stringStartIndex); - throw $interpolateMinErr('untermstr', - 'The string beginning at line {0}, column {1} is unterminated in text “{2}â€', - position.line, position.column, this.text); - } - var chars = match[0]; - if (match == this.stringQuote) { - this.rule = null; - } -}; - -var PLURAL_OR_SELECT_ARG_TYPE_RE = /\s*(plural|select)\s*,\s*/g; -MessageFormatParser.prototype.rulePluralOrSelect = function rulePluralOrSelect() { - var match = this.searchRe(PLURAL_OR_SELECT_ARG_TYPE_RE); - if (match == null) { - this.errorExpecting(); - } - var argType = match[1]; - switch (argType) { - case "plural": this.rule = this.rulePluralStyle; break; - case "select": this.rule = this.ruleSelectStyle; break; - default: this.errorInParseLogic(); - } -}; - -MessageFormatParser.prototype.rulePluralStyle = function rulePluralStyle() { - this.choices = Object.create(null); - this.ruleChoiceKeyword = this.rulePluralValueOrKeyword; - this.rule = this.rulePluralOffset; -}; - -MessageFormatParser.prototype.ruleSelectStyle = function ruleSelectStyle() { - this.choices = Object.create(null); - this.ruleChoiceKeyword = this.ruleSelectKeyword; - this.rule = this.ruleSelectKeyword; -}; - -var NUMBER_RE = /[0]|(?:[1-9][0-9]*)/g; -var PLURAL_OFFSET_RE = new RegExp("\\s*offset\\s*:\\s*(" + NUMBER_RE.source + ")", "g"); - -MessageFormatParser.prototype.rulePluralOffset = function rulePluralOffset() { - var match = this.matchRe(PLURAL_OFFSET_RE); - this.pluralOffset = (match == null) ? 0 : parseInt(match[1], 10); - this.expressionMinusOffsetFn = subtractOffset(this.expressionFn, this.pluralOffset); - this.rule = this.rulePluralValueOrKeyword; -}; - -MessageFormatParser.prototype.assertChoiceKeyIsNew = function assertChoiceKeyIsNew(choiceKey, index) { - if (this.choices[choiceKey] !== void 0) { - var position = indexToLineAndColumn(this.text, index); - throw $interpolateMinErr('dupvalue', - 'The choice “{0}†is specified more than once. Duplicate key is at line {1}, column {2} in text “{3}â€', - choiceKey, position.line, position.column, this.text); - } -}; - -var SELECT_KEYWORD = /\s*(\w+)/g; -MessageFormatParser.prototype.ruleSelectKeyword = function ruleSelectKeyword() { - var match = this.matchRe(SELECT_KEYWORD); - if (match == null) { - this.parsedFn = new SelectMessage(this.expressionFn, this.choices).parsedFn; - this.rule = null; - return; - } - this.choiceKey = match[1]; - this.assertChoiceKeyIsNew(this.choiceKey, match.index); - this.rule = this.ruleMessageText; -}; - -var EXPLICIT_VALUE_OR_KEYWORD_RE = new RegExp("\\s*(?:(?:=(" + NUMBER_RE.source + "))|(\\w+))", "g"); -MessageFormatParser.prototype.rulePluralValueOrKeyword = function rulePluralValueOrKeyword() { - var match = this.matchRe(EXPLICIT_VALUE_OR_KEYWORD_RE); - if (match == null) { - this.parsedFn = new PluralMessage(this.expressionFn, this.choices, this.pluralOffset, this.pluralCat).parsedFn; - this.rule = null; - return; - } - if (match[1] != null) { - this.choiceKey = parseInt(match[1], 10); - } else { - this.choiceKey = match[2]; - } - this.assertChoiceKeyIsNew(this.choiceKey, match.index); - this.rule = this.ruleMessageText; -}; - -var BRACE_OPEN_RE = /\s*{/g; -var BRACE_CLOSE_RE = /}/g; -MessageFormatParser.prototype.ruleMessageText = function ruleMessageText() { - if (!this.consumeRe(BRACE_OPEN_RE)) { - var position = indexToLineAndColumn(this.text, this.index); - throw $interpolateMinErr('reqopenbrace', - 'The plural choice “{0}†must be followed by a message in braces at line {1}, column {2} in text “{3}â€', - this.choiceKey, position.line, position.column, this.text); - } - this.msgStartIndex = this.index; - this.interpolationParts = new InterpolationParts(this.trustedContext, this.allOrNothing); - this.rule = this.ruleInInterpolationOrMessageText; -}; - -// Note: Since "\" is used as an escape character, don't allow it to be part of the -// startSymbol/endSymbol when I add the feature to allow them to be redefined. -var INTERP_OR_END_MESSAGE_RE = /\\.|{{|}/g; -var INTERP_OR_PLURALVALUE_OR_END_MESSAGE_RE = /\\.|{{|#|}/g; -var ESCAPE_OR_MUSTACHE_BEGIN_RE = /\\.|{{/g; -MessageFormatParser.prototype.advanceInInterpolationOrMessageText = function advanceInInterpolationOrMessageText() { - var currentIndex = this.index, match, re; - if (this.ruleChoiceKeyword == null) { // interpolation - match = this.searchRe(ESCAPE_OR_MUSTACHE_BEGIN_RE); - if (match == null) { // End of interpolation text. Nothing more to process. - this.textPart = this.text.substring(currentIndex); - this.index = this.text.length; - return null; - } - } else { - match = this.searchRe(this.ruleChoiceKeyword == this.rulePluralValueOrKeyword ? - INTERP_OR_PLURALVALUE_OR_END_MESSAGE_RE : INTERP_OR_END_MESSAGE_RE); - if (match == null) { - var position = indexToLineAndColumn(this.text, this.msgStartIndex); - throw $interpolateMinErr('reqendbrace', - 'The plural/select choice “{0}†message starting at line {1}, column {2} does not have an ending closing brace. Text “{3}â€', - this.choiceKey, position.line, position.column, this.text); - } - } - // match is non-null. - var token = match[0]; - this.textPart = this.text.substring(currentIndex, match.index); - return token; -}; - -MessageFormatParser.prototype.ruleInInterpolationOrMessageText = function ruleInInterpolationOrMessageText() { - var currentIndex = this.index; - var token = this.advanceInInterpolationOrMessageText(); - if (token == null) { - // End of interpolation text. Nothing more to process. - this.index = this.text.length; - this.interpolationParts.addText(this.text.substring(currentIndex)); - this.rule = null; - return; - } - if (token[0] == "\\") { - // unescape next character and continue - this.interpolationParts.addText(this.textPart + token[1]); - return; - } - this.interpolationParts.addText(this.textPart); - if (token == "{{") { - this.pushState(); - this.ruleStack.push(this.ruleEndMustacheInInterpolationOrMessage); - this.rule = this.ruleEnteredMustache; - } else if (token == "}") { - this.choices[this.choiceKey] = this.interpolationParts.toParsedFn(/*mustHaveExpression=*/false, this.text); - this.rule = this.ruleChoiceKeyword; - } else if (token == "#") { - this.interpolationParts.addExpressionFn(this.expressionMinusOffsetFn); - } else { - this.errorInParseLogic(); - } -}; - -MessageFormatParser.prototype.ruleInterpolate = function ruleInterpolate() { - this.interpolationParts = new InterpolationParts(this.trustedContext, this.allOrNothing); - this.rule = this.ruleInInterpolation; -}; - -MessageFormatParser.prototype.ruleInInterpolation = function ruleInInterpolation() { - var currentIndex = this.index; - var match = this.searchRe(ESCAPE_OR_MUSTACHE_BEGIN_RE); - if (match == null) { - // End of interpolation text. Nothing more to process. - this.index = this.text.length; - this.interpolationParts.addText(this.text.substring(currentIndex)); - this.parsedFn = this.interpolationParts.toParsedFn(this.mustHaveExpression, this.text); - this.rule = null; - return; - } - var token = match[0]; - if (token[0] == "\\") { - // unescape next character and continue - this.interpolationParts.addText(this.text.substring(currentIndex, match.index) + token[1]); - return; - } - this.interpolationParts.addText(this.text.substring(currentIndex, match.index)); - this.pushState(); - this.ruleStack.push(this.ruleInterpolationEndMustache); - this.rule = this.ruleEnteredMustache; -}; - -MessageFormatParser.prototype.ruleInterpolationEndMustache = function ruleInterpolationEndMustache() { - var expressionFn = this.parsedFn; - this.popState(); - this.interpolationParts.addExpressionFn(expressionFn); - this.rule = this.ruleInInterpolation; -}; - -MessageFormatParser.prototype.ruleEnteredMustache = function ruleEnteredMustache() { - this.parsedFn = null; - this.ruleStack.push(this.ruleEndMustache); - this.rule = this.ruleAngularExpression; -}; - -MessageFormatParser.prototype.ruleEndMustacheInInterpolationOrMessage = function ruleEndMustacheInInterpolationOrMessage() { - var expressionFn = this.parsedFn; - this.popState(); - this.interpolationParts.addExpressionFn(expressionFn); - this.rule = this.ruleInInterpolationOrMessageText; -}; - - - -var INTERP_END_RE = /\s*}}/g; -MessageFormatParser.prototype.ruleEndMustache = function ruleEndMustache() { - var match = this.matchRe(INTERP_END_RE); - if (match == null) { - var position = indexToLineAndColumn(this.text, this.index); - throw $interpolateMinErr('reqendinterp', - 'Expecting end of interpolation symbol, “{0}â€, at line {1}, column {2} in text “{3}â€', - '}}', position.line, position.column, this.text); - } - if (this.parsedFn == null) { - // If we parsed a MessageFormat extension, (e.g. select/plural today, maybe more some other - // day), then the result *has* to be a string and those rules would have already set - // this.parsedFn. If there was no MessageFormat extension, then there is no requirement to - // stringify the result and parsedFn isn't set. We set it here. While we could have set it - // unconditionally when exiting the Angular expression, I intend for us to not just replace - // $interpolate, but also to replace $parse in a future version (so ng-bind can work), and in - // such a case we do not want to unnecessarily stringify something if it's not going to be used - // in a string context. - this.parsedFn = this.$parse(this.expressionFn, this.stringifier); - this.parsedFn['exp'] = this.expressionFn['exp']; // Needed to pretend to be $interpolate for tests copied from interpolateSpec.js - this.parsedFn['expressions'] = this.expressionFn['expressions']; // Require this to call $compile.$$addBindingInfo() which allows Protractor to find elements by binding. - } - this.rule = null; -}; - -MessageFormatParser.prototype.ruleAngularExpression = function ruleAngularExpression() { - this.angularOperatorStack = []; - this.expressionStartIndex = this.index; - this.rule = this.ruleInAngularExpression; -}; - -function getEndOperator(opBegin) { - switch (opBegin) { - case "{": return "}"; - case "[": return "]"; - case "(": return ")"; - default: return null; - } -} - -function getBeginOperator(opEnd) { - switch (opEnd) { - case "}": return "{"; - case "]": return "["; - case ")": return "("; - default: return null; - } -} - -// TODO(chirayu): The interpolation endSymbol must also be accounted for. It -// just so happens that "}" is an operator so it's in the list below. But we -// should support any other type of start/end interpolation symbol. -var INTERESTING_OPERATORS_RE = /[[\]{}()'",]/g; -MessageFormatParser.prototype.ruleInAngularExpression = function ruleInAngularExpression() { - var startIndex = this.index; - var match = this.searchRe(INTERESTING_OPERATORS_RE); - var position; - if (match == null) { - if (this.angularOperatorStack.length === 0) { - // This is the end of the Angular expression so this is actually a - // success. Note that when inside an interpolation, this means we even - // consumed the closing interpolation symbols if they were curlies. This - // is NOT an error at this point but will become an error further up the - // stack when the part that saw the opening curlies is unable to find the - // closing ones. - this.index = this.text.length; - this.expressionFn = this.$parse(this.text.substring(this.expressionStartIndex, this.index)); - // Needed to pretend to be $interpolate for tests copied from interpolateSpec.js - this.expressionFn['exp'] = this.text.substring(this.expressionStartIndex, this.index); - this.expressionFn['expressions'] = this.expressionFn['expressions']; - this.rule = null; - return; - } - var innermostOperator = this.angularOperatorStack[0]; - throw $interpolateMinErr('badexpr', - 'Unexpected end of Angular expression. Expecting operator “{0}†at the end of the text “{1}â€', - this.getEndOperator(innermostOperator), this.text); - } - var operator = match[0]; - if (operator == "'" || operator == '"') { - this.ruleStack.push(this.ruleInAngularExpression); - this.startStringAtMatch(match); - return; - } - if (operator == ",") { - if (this.trustedContext) { - position = indexToLineAndColumn(this.text, this.index); - throw $interpolateMinErr('unsafe', - 'Use of select/plural MessageFormat syntax is currently disallowed in a secure context ({0}). At line {1}, column {2} of text “{3}â€', - this.trustedContext, position.line, position.column, this.text); - } - // only the top level comma has relevance. - if (this.angularOperatorStack.length === 0) { - // todo: does this need to be trimmed? - this.expressionFn = this.$parse(this.text.substring(this.expressionStartIndex, match.index)); - // Needed to pretend to be $interpolate for tests copied from interpolateSpec.js - this.expressionFn['exp'] = this.text.substring(this.expressionStartIndex, match.index); - this.expressionFn['expressions'] = this.expressionFn['expressions']; - this.rule = null; - this.rule = this.rulePluralOrSelect; - } - return; - } - if (getEndOperator(operator) != null) { - this.angularOperatorStack.unshift(operator); - return; - } - var beginOperator = getBeginOperator(operator); - if (beginOperator == null) { - this.errorInParseLogic(); - } - if (this.angularOperatorStack.length > 0) { - if (beginOperator == this.angularOperatorStack[0]) { - this.angularOperatorStack.shift(); - return; - } - position = indexToLineAndColumn(this.text, this.index); - throw $interpolateMinErr('badexpr', - 'Unexpected operator “{0}†at line {1}, column {2} in text. Was expecting “{3}â€. Text: “{4}â€', - operator, position.line, position.column, getEndOperator(this.angularOperatorStack[0]), this.text); - } - // We are trying to pop off the operator stack but there really isn't anything to pop off. - this.index = match.index; - this.expressionFn = this.$parse(this.text.substring(this.expressionStartIndex, this.index)); - // Needed to pretend to be $interpolate for tests copied from interpolateSpec.js - this.expressionFn['exp'] = this.text.substring(this.expressionStartIndex, this.index); - this.expressionFn['expressions'] = this.expressionFn['expressions']; - this.rule = null; -}; - -// NOTE: ADVANCED_OPTIMIZATIONS mode. -// -// This file is compiled with Closure compiler's ADVANCED_OPTIMIZATIONS flag! Be wary of using -// constructs incompatible with that mode. - -/* global $interpolateMinErr: false */ -/* global MessageFormatParser: false */ -/* global stringify: false */ - -/** - * @ngdoc service - * @name $$messageFormat - * - * @description - * Angular internal service to recognize MessageFormat extensions in interpolation expressions. - * For more information, see: - * https://docs.google.com/a/google.com/document/d/1pbtW2yvtmFBikfRrJd8VAsabiFkKezmYZ_PbgdjQOVU/edit - * - * ## Example - * - * - * - *
    - *
    - * {{recipients.length, plural, offset:1 - * =0 {{{sender.name}} gave no gifts (\#=#)} - * =1 {{{sender.name}} gave one gift to {{recipients[0].name}} (\#=#)} - * one {{{sender.name}} gave {{recipients[0].name}} and one other person a gift (\#=#)} - * other {{{sender.name}} gave {{recipients[0].name}} and # other people a gift (\#=#)} - * }} - *
    - *
    - * - * - * function Person(name, gender) { - * this.name = name; - * this.gender = gender; - * } - * - * var alice = new Person("Alice", "female"), - * bob = new Person("Bob", "male"), - * charlie = new Person("Charlie", "male"), - * harry = new Person("Harry Potter", "male"); - * - * angular.module('msgFmtExample', ['ngMessageFormat']) - * .controller('AppController', ['$scope', function($scope) { - * $scope.recipients = [alice, bob, charlie]; - * $scope.sender = harry; - * $scope.decreaseRecipients = function() { - * --$scope.recipients.length; - * }; - * }]); - * - * - * - * describe('MessageFormat plural', function() { - * it('should pluralize initial values', function() { - * var messageElem = element(by.binding('recipients.length')), decreaseRecipientsBtn = element(by.id('decreaseRecipients')); - * expect(messageElem.getText()).toEqual('Harry Potter gave Alice and 2 other people a gift (#=2)'); - * decreaseRecipientsBtn.click(); - * expect(messageElem.getText()).toEqual('Harry Potter gave Alice and one other person a gift (#=1)'); - * decreaseRecipientsBtn.click(); - * expect(messageElem.getText()).toEqual('Harry Potter gave one gift to Alice (#=0)'); - * decreaseRecipientsBtn.click(); - * expect(messageElem.getText()).toEqual('Harry Potter gave no gifts (#=-1)'); - * }); - * }); - * - *
    - */ -var $$MessageFormatFactory = ['$parse', '$locale', '$sce', '$exceptionHandler', function $$messageFormat( - $parse, $locale, $sce, $exceptionHandler) { - - function getStringifier(trustedContext, allOrNothing, text) { - return function stringifier(value) { - try { - value = trustedContext ? $sce['getTrusted'](trustedContext, value) : $sce['valueOf'](value); - return allOrNothing && (value === void 0) ? value : stringify(value); - } catch (err) { - $exceptionHandler($interpolateMinErr['interr'](text, err)); - } - }; - } - - function interpolate(text, mustHaveExpression, trustedContext, allOrNothing) { - var stringifier = getStringifier(trustedContext, allOrNothing, text); - var parser = new MessageFormatParser(text, 0, $parse, $locale['pluralCat'], stringifier, - mustHaveExpression, trustedContext, allOrNothing); - parser.run(parser.ruleInterpolate); - return parser.parsedFn; - } - - return { - 'interpolate': interpolate - }; -}]; - -var $$interpolateDecorator = ['$$messageFormat', '$delegate', function $$interpolateDecorator($$messageFormat, $interpolate) { - if ($interpolate['startSymbol']() != "{{" || $interpolate['endSymbol']() != "}}") { - throw $interpolateMinErr('nochgmustache', 'angular-message-format.js currently does not allow you to use custom start and end symbols for interpolation.'); - } - var interpolate = $$messageFormat['interpolate']; - interpolate['startSymbol'] = $interpolate['startSymbol']; - interpolate['endSymbol'] = $interpolate['endSymbol']; - return interpolate; -}]; - - -/** - * @ngdoc module - * @name ngMessageFormat - * @packageName angular-message-format - * @description - */ -var module = window['angular']['module']('ngMessageFormat', ['ng']); -module['factory']('$$messageFormat', $$MessageFormatFactory); -module['config'](['$provide', function($provide) { - $provide['decorator']('$interpolate', $$interpolateDecorator); -}]); - - -})(window, window.angular); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-message-format.min.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-message-format.min.js deleted file mode 100644 index f85a58769..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-message-format.min.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - AngularJS v1.5.0 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(h){'use strict';function C(a){if(null==a)return"";switch(typeof a){case "string":return a;case "number":return""+a;default:return D(a)}}function f(a,b){for(var d=a.split(/\n/g),k=0;k=c.length)b-=c.length;else return{h:k+1,f:b+1}}}function t(a){function b(){return a}var d=u[a];if(null!=d)return d;b.$$watchDelegate=function(b,d,c){var e=b.$watch(v,function(){m(d)&&d.call(null,a,a,b);e()},c);return e};u[a]=b;b.exp=a;b.expressions=[];return b}function F(a,b){function d(a){return void 0== -a?a:a-b}function c(b){return d(a(b))}if(0===b)return a;var e;c.$$watchDelegate=function(b,c,k){return e=b.$watch(a,function(a,k){m(c)&&c.call(null,d(a),d(k),b)},k)};return c}function l(a,b){var d=this;this.b=a;this.e=b;if(void 0===b.other)throw e("reqother");this.d=function(a){return d.D(a)};this.d.$$watchDelegate=function(a,b,c){return d.P(a,b,c)};this.d.exp=a.exp;this.d.expressions=a.expressions}function n(a,b,d,c){var e=this;this.scope=b;this.oa=a;this.v=d;this.qa=c;this.U=void 0;this.K=v;this.ka= -b.$watch(a.b,function(a){return e.ja(a)},c)}function p(a,b){l.call(this,a,b)}function w(){}function q(a,b,d,c){l.call(this,a,b);this.offset=d;this.M=c}function x(){}function g(a,b){this.u=a;this.B=b;this.i=[];this.g=[];this.J=[];this.s="";this.q=null}function r(a,b,d){this.c=a;this.scope=b;this.W=void 0;this.v=d;var c=this;this.la=b.$watchGroup(a.g,function(a,b){c.Ea(a,b)})}function s(a,b){b.b=a.b;b.C=a.C;b.w=a.w;b.e=a.e;b.k=a.k;b.c=a.c;b.n=a.n;b.F=a.F;b.l=a.l}function y(a){s(a,this)}function c(a, -b,d,c,e,E,f,g){this.text=a;this.index=b||0;this.A=d;this.M=c;this.Da=e;this.pa=!!E;this.u=f;this.B=!!g;this.F=this.c=this.k=this.e=this.w=this.C=this.b=null;this.L=[];this.G=this.j=this.ca=this.O=this.da=this.l=this.n=this.o=this.a=this.d=null}function z(a){switch(a){case "{":return"}";case "[":return"]";case "(":return")";default:return null}}function G(a){switch(a){case "}":return"{";case "]":return"[";case ")":return"(";default:return null}}var e=h.angular.$interpolateMinErr,v=h.angular.noop,m= -h.angular.isFunction,D=h.angular.toJson,u=Object.create(null);l.prototype.T=function(a){return this.e[this.R(a)]};l.prototype.D=function(a){return this.T(this.b(a))(a)};l.prototype.P=function(a,b,d){var c=new n(this,a,b,d);return function(){c.I()}};n.prototype.ja=function(a){var b=this;this.K();a=this.oa.T(a);this.K=this.scope.$watch(a,function(a,c){return b.na(a,c)},this.qa)};n.prototype.na=function(a,b){m(this.v)&&this.v.call(null,a,a===b?a:this.U,this.scope);this.U=a};n.prototype.I=function(){this.ka(); -this.K()};w.prototype=l.prototype;p.prototype=new w;p.prototype.R=function(a){return void 0!==this.e[a]?a:"other"};x.prototype=l.prototype;q.prototype=new x;q.prototype.R=function(a){if(isNaN(a))return"other";if(void 0!==this.e[a])return a;a=this.M(a-this.offset);return void 0!==this.e[a]?a:"other"};g.prototype.S=function(){this.s&&(null==this.q?this.i.push(this.s):(this.i.push(this.q.join("")),this.q=null),this.s="")};g.prototype.p=function(a){a.length&&(this.s?this.q?this.q.push(a):this.q=[this.s, -a]:this.s=a)};g.prototype.H=function(a){this.S();this.J.push(this.i.length);this.g.push(a);this.i.push("")};g.prototype.ma=function(a){for(var b=Array(this.g.length),d=0;d - * - *
    - *
    You did not enter a field
    - *
    - * Your email must be between 5 and 100 characters long - *
    - *
    - * - * ``` - * - * Now whatever key/value entries are present within the provided object (in this case `$error`) then - * the ngMessages directive will render the inner first ngMessage directive (depending if the key values - * match the attribute value present on each ngMessage directive). In other words, if your errors - * object contains the following data: - * - * ```javascript - * - * myField.$error = { minlength : true, required : true }; - * ``` - * - * Then the `required` message will be displayed first. When required is false then the `minlength` message - * will be displayed right after (since these messages are ordered this way in the template HTML code). - * The prioritization of each message is determined by what order they're present in the DOM. - * Therefore, instead of having custom JavaScript code determine the priority of what errors are - * present before others, the presentation of the errors are handled within the template. - * - * By default, ngMessages will only display one error at a time. However, if you wish to display all - * messages then the `ng-messages-multiple` attribute flag can be used on the element containing the - * ngMessages directive to make this happen. - * - * ```html - * - *
    ...
    - * - * - * ... - * ``` - * - * ## Reusing and Overriding Messages - * In addition to prioritization, ngMessages also allows for including messages from a remote or an inline - * template. This allows for generic collection of messages to be reused across multiple parts of an - * application. - * - * ```html - * - * - *
    - *
    - *
    - * ``` - * - * However, including generic messages may not be useful enough to match all input fields, therefore, - * `ngMessages` provides the ability to override messages defined in the remote template by redefining - * them within the directive container. - * - * ```html - * - * - * - *
    - * - * - *
    - * - *
    You did not enter your email address
    - * - * - *
    Your email address is invalid
    - * - * - *
    - *
    - *
    - * ``` - * - * In the example HTML code above the message that is set on required will override the corresponding - * required message defined within the remote template. Therefore, with particular input fields (such - * email addresses, date fields, autocomplete inputs, etc...), specialized error messages can be applied - * while more generic messages can be used to handle other, more general input errors. - * - * ## Dynamic Messaging - * ngMessages also supports using expressions to dynamically change key values. Using arrays and - * repeaters to list messages is also supported. This means that the code below will be able to - * fully adapt itself and display the appropriate message when any of the expression data changes: - * - * ```html - *
    - * - *
    - *
    You did not enter your email address
    - *
    - * - *
    {{ errorMessage.text }}
    - *
    - *
    - *
    - * ``` - * - * The `errorMessage.type` expression can be a string value or it can be an array so - * that multiple errors can be associated with a single error message: - * - * ```html - * - *
    - *
    You did not enter your email address
    - *
    - * Your email must be between 5 and 100 characters long - *
    - *
    - * ``` - * - * Feel free to use other structural directives such as ng-if and ng-switch to further control - * what messages are active and when. Be careful, if you place ng-message on the same element - * as these structural directives, Angular may not be able to determine if a message is active - * or not. Therefore it is best to place the ng-message on a child element of the structural - * directive. - * - * ```html - *
    - *
    - *
    Please enter something
    - *
    - *
    - * ``` - * - * ## Animations - * If the `ngAnimate` module is active within the application then the `ngMessages`, `ngMessage` and - * `ngMessageExp` directives will trigger animations whenever any messages are added and removed from - * the DOM by the `ngMessages` directive. - * - * Whenever the `ngMessages` directive contains one or more visible messages then the `.ng-active` CSS - * class will be added to the element. The `.ng-inactive` CSS class will be applied when there are no - * messages present. Therefore, CSS transitions and keyframes as well as JavaScript animations can - * hook into the animations whenever these classes are added/removed. - * - * Let's say that our HTML code for our messages container looks like so: - * - * ```html - * - * ``` - * - * Then the CSS animation code for the message container looks like so: - * - * ```css - * .my-messages { - * transition:1s linear all; - * } - * .my-messages.ng-active { - * // messages are visible - * } - * .my-messages.ng-inactive { - * // messages are hidden - * } - * ``` - * - * Whenever an inner message is attached (becomes visible) or removed (becomes hidden) then the enter - * and leave animation is triggered for each particular element bound to the `ngMessage` directive. - * - * Therefore, the CSS code for the inner messages looks like so: - * - * ```css - * .some-message { - * transition:1s linear all; - * } - * - * .some-message.ng-enter {} - * .some-message.ng-enter.ng-enter-active {} - * - * .some-message.ng-leave {} - * .some-message.ng-leave.ng-leave-active {} - * ``` - * - * {@link ngAnimate Click here} to learn how to use JavaScript animations or to learn more about ngAnimate. - */ -angular.module('ngMessages', []) - - /** - * @ngdoc directive - * @module ngMessages - * @name ngMessages - * @restrict AE - * - * @description - * `ngMessages` is a directive that is designed to show and hide messages based on the state - * of a key/value object that it listens on. The directive itself complements error message - * reporting with the `ngModel` $error object (which stores a key/value state of validation errors). - * - * `ngMessages` manages the state of internal messages within its container element. The internal - * messages use the `ngMessage` directive and will be inserted/removed from the page depending - * on if they're present within the key/value object. By default, only one message will be displayed - * at a time and this depends on the prioritization of the messages within the template. (This can - * be changed by using the `ng-messages-multiple` or `multiple` attribute on the directive container.) - * - * A remote template can also be used to promote message reusability and messages can also be - * overridden. - * - * {@link module:ngMessages Click here} to learn more about `ngMessages` and `ngMessage`. - * - * @usage - * ```html - * - * - * ... - * ... - * ... - * - * - * - * - * ... - * ... - * ... - * - * ``` - * - * @param {string} ngMessages an angular expression evaluating to a key/value object - * (this is typically the $error object on an ngModel instance). - * @param {string=} ngMessagesMultiple|multiple when set, all messages will be displayed with true - * - * @example - * - * - *
    - * - *
    myForm.myName.$error = {{ myForm.myName.$error | json }}
    - * - *
    - *
    You did not enter a field
    - *
    Your field is too short
    - *
    Your field is too long
    - *
    - *
    - *
    - * - * angular.module('ngMessagesExample', ['ngMessages']); - * - *
    - */ - .directive('ngMessages', ['$animate', function($animate) { - var ACTIVE_CLASS = 'ng-active'; - var INACTIVE_CLASS = 'ng-inactive'; - - return { - require: 'ngMessages', - restrict: 'AE', - controller: ['$element', '$scope', '$attrs', function($element, $scope, $attrs) { - var ctrl = this; - var latestKey = 0; - var nextAttachId = 0; - - this.getAttachId = function getAttachId() { return nextAttachId++; }; - - var messages = this.messages = {}; - var renderLater, cachedCollection; - - this.render = function(collection) { - collection = collection || {}; - - renderLater = false; - cachedCollection = collection; - - // this is true if the attribute is empty or if the attribute value is truthy - var multiple = isAttrTruthy($scope, $attrs.ngMessagesMultiple) || - isAttrTruthy($scope, $attrs.multiple); - - var unmatchedMessages = []; - var matchedKeys = {}; - var messageItem = ctrl.head; - var messageFound = false; - var totalMessages = 0; - - // we use != instead of !== to allow for both undefined and null values - while (messageItem != null) { - totalMessages++; - var messageCtrl = messageItem.message; - - var messageUsed = false; - if (!messageFound) { - forEach(collection, function(value, key) { - if (!messageUsed && truthy(value) && messageCtrl.test(key)) { - // this is to prevent the same error name from showing up twice - if (matchedKeys[key]) return; - matchedKeys[key] = true; - - messageUsed = true; - messageCtrl.attach(); - } - }); - } - - if (messageUsed) { - // unless we want to display multiple messages then we should - // set a flag here to avoid displaying the next message in the list - messageFound = !multiple; - } else { - unmatchedMessages.push(messageCtrl); - } - - messageItem = messageItem.next; - } - - forEach(unmatchedMessages, function(messageCtrl) { - messageCtrl.detach(); - }); - - unmatchedMessages.length !== totalMessages - ? $animate.setClass($element, ACTIVE_CLASS, INACTIVE_CLASS) - : $animate.setClass($element, INACTIVE_CLASS, ACTIVE_CLASS); - }; - - $scope.$watchCollection($attrs.ngMessages || $attrs['for'], ctrl.render); - - this.reRender = function() { - if (!renderLater) { - renderLater = true; - $scope.$evalAsync(function() { - if (renderLater) { - cachedCollection && ctrl.render(cachedCollection); - } - }); - } - }; - - this.register = function(comment, messageCtrl) { - var nextKey = latestKey.toString(); - messages[nextKey] = { - message: messageCtrl - }; - insertMessageNode($element[0], comment, nextKey); - comment.$$ngMessageNode = nextKey; - latestKey++; - - ctrl.reRender(); - }; - - this.deregister = function(comment) { - var key = comment.$$ngMessageNode; - delete comment.$$ngMessageNode; - removeMessageNode($element[0], comment, key); - delete messages[key]; - ctrl.reRender(); - }; - - function findPreviousMessage(parent, comment) { - var prevNode = comment; - var parentLookup = []; - while (prevNode && prevNode !== parent) { - var prevKey = prevNode.$$ngMessageNode; - if (prevKey && prevKey.length) { - return messages[prevKey]; - } - - // dive deeper into the DOM and examine its children for any ngMessage - // comments that may be in an element that appears deeper in the list - if (prevNode.childNodes.length && parentLookup.indexOf(prevNode) == -1) { - parentLookup.push(prevNode); - prevNode = prevNode.childNodes[prevNode.childNodes.length - 1]; - } else { - prevNode = prevNode.previousSibling || prevNode.parentNode; - } - } - } - - function insertMessageNode(parent, comment, key) { - var messageNode = messages[key]; - if (!ctrl.head) { - ctrl.head = messageNode; - } else { - var match = findPreviousMessage(parent, comment); - if (match) { - messageNode.next = match.next; - match.next = messageNode; - } else { - messageNode.next = ctrl.head; - ctrl.head = messageNode; - } - } - } - - function removeMessageNode(parent, comment, key) { - var messageNode = messages[key]; - - var match = findPreviousMessage(parent, comment); - if (match) { - match.next = messageNode.next; - } else { - ctrl.head = messageNode.next; - } - } - }] - }; - - function isAttrTruthy(scope, attr) { - return (isString(attr) && attr.length === 0) || //empty attribute - truthy(scope.$eval(attr)); - } - - function truthy(val) { - return isString(val) ? val.length : !!val; - } - }]) - - /** - * @ngdoc directive - * @name ngMessagesInclude - * @restrict AE - * @scope - * - * @description - * `ngMessagesInclude` is a directive with the purpose to import existing ngMessage template - * code from a remote template and place the downloaded template code into the exact spot - * that the ngMessagesInclude directive is placed within the ngMessages container. This allows - * for a series of pre-defined messages to be reused and also allows for the developer to - * determine what messages are overridden due to the placement of the ngMessagesInclude directive. - * - * @usage - * ```html - * - * - * ... - * - * - * - * - * ... - * - * ``` - * - * {@link module:ngMessages Click here} to learn more about `ngMessages` and `ngMessage`. - * - * @param {string} ngMessagesInclude|src a string value corresponding to the remote template. - */ - .directive('ngMessagesInclude', - ['$templateRequest', '$document', '$compile', function($templateRequest, $document, $compile) { - - return { - restrict: 'AE', - require: '^^ngMessages', // we only require this for validation sake - link: function($scope, element, attrs) { - var src = attrs.ngMessagesInclude || attrs.src; - $templateRequest(src).then(function(html) { - $compile(html)($scope, function(contents) { - element.after(contents); - - // the anchor is placed for debugging purposes - var anchor = jqLite($document[0].createComment(' ngMessagesInclude: ' + src + ' ')); - element.after(anchor); - - // we don't want to pollute the DOM anymore by keeping an empty directive element - element.remove(); - }); - }); - } - }; - }]) - - /** - * @ngdoc directive - * @name ngMessage - * @restrict AE - * @scope - * - * @description - * `ngMessage` is a directive with the purpose to show and hide a particular message. - * For `ngMessage` to operate, a parent `ngMessages` directive on a parent DOM element - * must be situated since it determines which messages are visible based on the state - * of the provided key/value map that `ngMessages` listens on. - * - * More information about using `ngMessage` can be found in the - * {@link module:ngMessages `ngMessages` module documentation}. - * - * @usage - * ```html - * - * - * ... - * ... - * - * - * - * - * ... - * ... - * - * ``` - * - * @param {expression} ngMessage|when a string value corresponding to the message key. - */ - .directive('ngMessage', ngMessageDirectiveFactory()) - - - /** - * @ngdoc directive - * @name ngMessageExp - * @restrict AE - * @priority 1 - * @scope - * - * @description - * `ngMessageExp` is a directive with the purpose to show and hide a particular message. - * For `ngMessageExp` to operate, a parent `ngMessages` directive on a parent DOM element - * must be situated since it determines which messages are visible based on the state - * of the provided key/value map that `ngMessages` listens on. - * - * @usage - * ```html - * - * - * ... - * - * - * - * - * ... - * - * ``` - * - * {@link module:ngMessages Click here} to learn more about `ngMessages` and `ngMessage`. - * - * @param {expression} ngMessageExp|whenExp an expression value corresponding to the message key. - */ - .directive('ngMessageExp', ngMessageDirectiveFactory()); - -function ngMessageDirectiveFactory() { - return ['$animate', function($animate) { - return { - restrict: 'AE', - transclude: 'element', - priority: 1, // must run before ngBind, otherwise the text is set on the comment - terminal: true, - require: '^^ngMessages', - link: function(scope, element, attrs, ngMessagesCtrl, $transclude) { - var commentNode = element[0]; - - var records; - var staticExp = attrs.ngMessage || attrs.when; - var dynamicExp = attrs.ngMessageExp || attrs.whenExp; - var assignRecords = function(items) { - records = items - ? (isArray(items) - ? items - : items.split(/[\s,]+/)) - : null; - ngMessagesCtrl.reRender(); - }; - - if (dynamicExp) { - assignRecords(scope.$eval(dynamicExp)); - scope.$watchCollection(dynamicExp, assignRecords); - } else { - assignRecords(staticExp); - } - - var currentElement, messageCtrl; - ngMessagesCtrl.register(commentNode, messageCtrl = { - test: function(name) { - return contains(records, name); - }, - attach: function() { - if (!currentElement) { - $transclude(scope, function(elm) { - $animate.enter(elm, null, element); - currentElement = elm; - - // Each time we attach this node to a message we get a new id that we can match - // when we are destroying the node later. - var $$attachId = currentElement.$$attachId = ngMessagesCtrl.getAttachId(); - - // in the event that the parent element is destroyed - // by any other structural directive then it's time - // to deregister the message from the controller - currentElement.on('$destroy', function() { - if (currentElement && currentElement.$$attachId === $$attachId) { - ngMessagesCtrl.deregister(commentNode); - messageCtrl.detach(); - } - }); - }); - } - }, - detach: function() { - if (currentElement) { - var elm = currentElement; - currentElement = null; - $animate.leave(elm); - } - } - }); - } - }; - }]; - - function contains(collection, key) { - if (collection) { - return isArray(collection) - ? collection.indexOf(key) >= 0 - : collection.hasOwnProperty(key); - } - } -} - - -})(window, window.angular); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-messages.min.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-messages.min.js deleted file mode 100644 index 19f59cc89..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-messages.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/* - AngularJS v1.5.0 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(A,d,B){'use strict';function l(){return["$animate",function(v){return{restrict:"AE",transclude:"element",priority:1,terminal:!0,require:"^^ngMessages",link:function(n,r,a,b,m){var k=r[0],f,p=a.ngMessage||a.when;a=a.ngMessageExp||a.whenExp;var d=function(a){f=a?w(a)?a:a.split(/[\s,]+/):null;b.reRender()};a?(d(n.$eval(a)),n.$watchCollection(a,d)):d(p);var e,q;b.register(k,q={test:function(a){var g=f;a=g?w(g)?0<=g.indexOf(a):g.hasOwnProperty(a):void 0;return a},attach:function(){e||m(n,function(a){v.enter(a, -null,r);e=a;var g=e.$$attachId=b.getAttachId();e.on("$destroy",function(){e&&e.$$attachId===g&&(b.deregister(k),q.detach())})})},detach:function(){if(e){var a=e;e=null;v.leave(a)}}})}}}]}var w=d.isArray,x=d.forEach,y=d.isString,z=d.element;d.module("ngMessages",[]).directive("ngMessages",["$animate",function(d){function n(a,b){return y(b)&&0===b.length||r(a.$eval(b))}function r(a){return y(a)?a.length:!!a}return{require:"ngMessages",restrict:"AE",controller:["$element","$scope","$attrs",function(a, -b,m){function k(a,b){for(var c=b,f=[];c&&c!==a;){var h=c.$$ngMessageNode;if(h&&h.length)return e[h];c.childNodes.length&&-1==f.indexOf(c)?(f.push(c),c=c.childNodes[c.childNodes.length-1]):c=c.previousSibling||c.parentNode}}var f=this,p=0,l=0;this.getAttachId=function(){return l++};var e=this.messages={},q,s;this.render=function(g){g=g||{};q=!1;s=g;for(var e=n(b,m.ngMessagesMultiple)||n(b,m.multiple),c=[],k={},h=f.head,p=!1,l=0;null!=h;){l++;var t=h.message,u=!1;p||x(g,function(a,c){!u&&r(a)&&t.test(c)&& -!k[c]&&(u=k[c]=!0,t.attach())});u?p=!e:c.push(t);h=h.next}x(c,function(a){a.detach()});c.length!==l?d.setClass(a,"ng-active","ng-inactive"):d.setClass(a,"ng-inactive","ng-active")};b.$watchCollection(m.ngMessages||m["for"],f.render);this.reRender=function(){q||(q=!0,b.$evalAsync(function(){q&&s&&f.render(s)}))};this.register=function(g,b){var c=p.toString();e[c]={message:b};var d=a[0],h=e[c];f.head?(d=k(d,g))?(h.next=d.next,d.next=h):(h.next=f.head,f.head=h):f.head=h;g.$$ngMessageNode=c;p++;f.reRender()}; -this.deregister=function(b){var d=b.$$ngMessageNode;delete b.$$ngMessageNode;var c=e[d];(b=k(a[0],b))?b.next=c.next:f.head=c.next;delete e[d];f.reRender()}}]}}]).directive("ngMessagesInclude",["$templateRequest","$document","$compile",function(d,n,l){return{restrict:"AE",require:"^^ngMessages",link:function(a,b,m){var k=m.ngMessagesInclude||m.src;d(k).then(function(d){l(d)(a,function(a){b.after(a);a=z(n[0].createComment(" ngMessagesInclude: "+k+" "));b.after(a);b.remove()})})}}}]).directive("ngMessage", -l()).directive("ngMessageExp",l())})(window,window.angular); -//# sourceMappingURL=angular-messages.min.js.map diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-messages.min.js.map b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-messages.min.js.map deleted file mode 100644 index 0cb2a943d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-messages.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular-messages.min.js", -"lineCount":11, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CA0lBtCC,QAASA,EAAyB,EAAG,CACnC,MAAO,CAAC,UAAD,CAAa,QAAQ,CAACC,CAAD,CAAW,CACrC,MAAO,CACLC,SAAU,IADL,CAELC,WAAY,SAFP,CAGLC,SAAU,CAHL,CAILC,SAAU,CAAA,CAJL,CAKLC,QAAS,cALJ,CAMLC,KAAMA,QAAQ,CAACC,CAAD,CAAQC,CAAR,CAAiBC,CAAjB,CAAwBC,CAAxB,CAAwCC,CAAxC,CAAqD,CACjE,IAAIC,EAAcJ,CAAA,CAAQ,CAAR,CAAlB,CAEIK,CAFJ,CAGIC,EAAYL,CAAAM,UAAZD,EAA+BL,CAAAO,KAC/BC,EAAAA,CAAaR,CAAAS,aAAbD,EAAmCR,CAAAU,QACvC,KAAIC,EAAgBA,QAAQ,CAACC,CAAD,CAAQ,CAClCR,CAAA,CAAUQ,CAAA,CACHC,CAAA,CAAQD,CAAR,CAAA,CACKA,CADL,CAEKA,CAAAE,MAAA,CAAY,QAAZ,CAHF,CAIJ,IACNb,EAAAc,SAAA,EANkC,CAShCP,EAAJ,EACEG,CAAA,CAAcb,CAAAkB,MAAA,CAAYR,CAAZ,CAAd,CACA,CAAAV,CAAAmB,iBAAA,CAAuBT,CAAvB,CAAmCG,CAAnC,CAFF,EAIEA,CAAA,CAAcN,CAAd,CAnB+D,KAsB7Da,CAtB6D,CAsB7CC,CACpBlB,EAAAmB,SAAA,CAAwBjB,CAAxB,CAAqCgB,CAArC,CAAmD,CACjDE,KAAMA,QAAQ,CAACC,CAAD,CAAO,CACHlB,IAAAA,EAAAA,CAsCtB,EAAA,CADEmB,CAAJ,CACSV,CAAA,CAAQU,CAAR,CAAA,CAC0B,CAD1B,EACDA,CAAAC,QAAA,CAvCyBF,CAuCzB,CADC,CAEDC,CAAAE,eAAA,CAxCyBH,CAwCzB,CAHR,CADiC,IAAA,EApCzB,OAAO,EADY,CAD4B,CAIjDI,OAAQA,QAAQ,EAAG,CACZR,CAAL,EACEhB,CAAA,CAAYJ,CAAZ,CAAmB,QAAQ,CAAC6B,CAAD,CAAM,CAC/BpC,CAAAqC,MAAA,CAAeD,CAAf;AAAoB,IAApB,CAA0B5B,CAA1B,CACAmB,EAAA,CAAiBS,CAIjB,KAAIE,EAAaX,CAAAW,WAAbA,CAAyC5B,CAAA6B,YAAA,EAK7CZ,EAAAa,GAAA,CAAkB,UAAlB,CAA8B,QAAQ,EAAG,CACnCb,CAAJ,EAAsBA,CAAAW,WAAtB,GAAoDA,CAApD,GACE5B,CAAA+B,WAAA,CAA0B7B,CAA1B,CACA,CAAAgB,CAAAc,OAAA,EAFF,CADuC,CAAzC,CAX+B,CAAjC,CAFe,CAJ8B,CA0BjDA,OAAQA,QAAQ,EAAG,CACjB,GAAIf,CAAJ,CAAoB,CAClB,IAAIS,EAAMT,CACVA,EAAA,CAAiB,IACjB3B,EAAA2C,MAAA,CAAeP,CAAf,CAHkB,CADH,CA1B8B,CAAnD,CAvBiE,CAN9D,CAD8B,CAAhC,CAD4B,CAtlBrC,IAAId,EAAUzB,CAAAyB,QAAd,CACIsB,EAAU/C,CAAA+C,QADd,CAEIC,EAAWhD,CAAAgD,SAFf,CAGIC,EAASjD,CAAAW,QA4ObX,EAAAkD,OAAA,CAAe,YAAf,CAA6B,EAA7B,CAAAC,UAAA,CA0Ec,YA1Ed,CA0E4B,CAAC,UAAD,CAAa,QAAQ,CAAChD,CAAD,CAAW,CA0JvDiD,QAASA,EAAY,CAAC1C,CAAD,CAAQ2C,CAAR,CAAc,CAClC,MAAQL,EAAA,CAASK,CAAT,CAAR,EAA0C,CAA1C,GAA0BA,CAAAC,OAA1B,EACOC,CAAA,CAAO7C,CAAAkB,MAAA,CAAYyB,CAAZ,CAAP,CAF2B,CAKnCE,QAASA,EAAM,CAACC,CAAD,CAAM,CACnB,MAAOR,EAAA,CAASQ,CAAT,CAAA,CAAgBA,CAAAF,OAAhB,CAA6B,CAAEE,CAAAA,CADnB,CA3JrB,MAAO,CACLhD,QAAS,YADJ,CAELJ,SAAU,IAFL,CAGLqD,WAAY,CAAC,UAAD,CAAa,QAAb,CAAuB,QAAvB,CAAiC,QAAQ,CAACC,CAAD;AAAWC,CAAX,CAAmBC,CAAnB,CAA2B,CAkG9EC,QAASA,EAAmB,CAACC,CAAD,CAASC,CAAT,CAAkB,CAG5C,IAFA,IAAIC,EAAWD,CAAf,CACIE,EAAe,EACnB,CAAOD,CAAP,EAAmBA,CAAnB,GAAgCF,CAAhC,CAAA,CAAwC,CACtC,IAAII,EAAUF,CAAAG,gBACd,IAAID,CAAJ,EAAeA,CAAAZ,OAAf,CACE,MAAOc,EAAA,CAASF,CAAT,CAKLF,EAAAK,WAAAf,OAAJ,EAAqE,EAArE,EAAkCW,CAAA7B,QAAA,CAAqB4B,CAArB,CAAlC,EACEC,CAAAK,KAAA,CAAkBN,CAAlB,CACA,CAAAA,CAAA,CAAWA,CAAAK,WAAA,CAAoBL,CAAAK,WAAAf,OAApB,CAAiD,CAAjD,CAFb,EAIEU,CAJF,CAIaA,CAAAO,gBAJb,EAIyCP,CAAAQ,WAZH,CAHI,CAjG9C,IAAIC,EAAO,IAAX,CACIC,EAAY,CADhB,CAEIC,EAAe,CAEnB,KAAAjC,YAAA,CAAmBkC,QAAoB,EAAG,CAAE,MAAOD,EAAA,EAAT,CAE1C,KAAIP,EAAW,IAAAA,SAAXA,CAA2B,EAA/B,CACIS,CADJ,CACiBC,CAEjB,KAAAC,OAAA,CAAcC,QAAQ,CAAC7C,CAAD,CAAa,CACjCA,CAAA,CAAaA,CAAb,EAA2B,EAE3B0C,EAAA,CAAc,CAAA,CACdC,EAAA,CAAmB3C,CAanB,KAVA,IAAI8C,EAAW7B,CAAA,CAAaO,CAAb,CAAqBC,CAAAsB,mBAArB,CAAXD,EACW7B,CAAA,CAAaO,CAAb,CAAqBC,CAAAqB,SAArB,CADf,CAGIE,EAAoB,EAHxB,CAIIC,EAAc,EAJlB,CAKIC,EAAcZ,CAAAa,KALlB,CAMIC,EAAe,CAAA,CANnB,CAOIC,EAAgB,CAGpB,CAAsB,IAAtB,EAAOH,CAAP,CAAA,CAA4B,CAC1BG,CAAA,EACA,KAAIzD,EAAcsD,CAAAI,QAAlB,CAEIC,EAAc,CAAA,CACbH,EAAL,EACExC,CAAA,CAAQZ,CAAR,CAAoB,QAAQ,CAACwD,CAAD,CAAQC,CAAR,CAAa,CAClCF,CAAAA,CAAL,EAAoBnC,CAAA,CAAOoC,CAAP,CAApB,EAAqC5D,CAAAE,KAAA,CAAiB2D,CAAjB,CAArC;AAEM,CAAAR,CAAA,CAAYQ,CAAZ,CAFN,GAKEF,CACA,CAHAN,CAAA,CAAYQ,CAAZ,CAGA,CAHmB,CAAA,CAGnB,CAAA7D,CAAAO,OAAA,EANF,CADuC,CAAzC,CAYEoD,EAAJ,CAGEH,CAHF,CAGiB,CAACN,CAHlB,CAKEE,CAAAb,KAAA,CAAuBvC,CAAvB,CAGFsD,EAAA,CAAcA,CAAAQ,KA1BY,CA6B5B9C,CAAA,CAAQoC,CAAR,CAA2B,QAAQ,CAACpD,CAAD,CAAc,CAC/CA,CAAAc,OAAA,EAD+C,CAAjD,CAIAsC,EAAA7B,OAAA,GAA6BkC,CAA7B,CACKrF,CAAA2F,SAAA,CAAkBpC,CAAlB,CAnEQqC,WAmER,CAlEUC,aAkEV,CADL,CAEK7F,CAAA2F,SAAA,CAAkBpC,CAAlB,CAnEUsC,aAmEV,CApEQD,WAoER,CApD4B,CAuDnCpC,EAAA9B,iBAAA,CAAwB+B,CAAAqC,WAAxB,EAA6CrC,CAAA,CAAO,KAAP,CAA7C,CAA4Da,CAAAM,OAA5D,CAEA,KAAApD,SAAA,CAAgBuE,QAAQ,EAAG,CACpBrB,CAAL,GACEA,CACA,CADc,CAAA,CACd,CAAAlB,CAAAwC,WAAA,CAAkB,QAAQ,EAAG,CACvBtB,CAAJ,EACEC,CADF,EACsBL,CAAAM,OAAA,CAAYD,CAAZ,CAFK,CAA7B,CAFF,CADyB,CAW3B,KAAA9C,SAAA,CAAgBoE,QAAQ,CAACrC,CAAD,CAAUhC,CAAV,CAAuB,CAC7C,IAAIsE,EAAU3B,CAAA4B,SAAA,EACdlC,EAAA,CAASiC,CAAT,CAAA,CAAoB,CAClBZ,QAAS1D,CADS,CAGF,KAAA,EAAA2B,CAAA,CAAS,CAAT,CAAA,CAoCd6C,EAAcnC,CAAA,CApCsBiC,CAoCtB,CACb5B,EAAAa,KAAL,CAIE,CADIkB,CACJ,CADY3C,CAAA,CAAoBC,CAApB,CAxCiBC,CAwCjB,CACZ,GACEwC,CAAAV,KACA,CADmBW,CAAAX,KACnB,CAAAW,CAAAX,KAAA,CAAaU,CAFf,GAIEA,CAAAV,KACA,CADmBpB,CAAAa,KACnB,CAAAb,CAAAa,KAAA,CAAYiB,CALd,CAJF,CACE9B,CAAAa,KADF,CACciB,CArCdxC,EAAAI,gBAAA,CAA0BkC,CAC1B3B,EAAA,EAEAD,EAAA9C,SAAA,EAT6C,CAY/C;IAAAiB,WAAA,CAAkB6D,QAAQ,CAAC1C,CAAD,CAAU,CAClC,IAAI6B,EAAM7B,CAAAI,gBACV,QAAOJ,CAAAI,gBA2CP,KAAIoC,EAAcnC,CAAA,CA1CsBwB,CA0CtB,CAGlB,EADIY,CACJ,CADY3C,CAAA,CA5CMH,CAAAI,CAAS,CAATA,CA4CN,CA5CmBC,CA4CnB,CACZ,EACEyC,CAAAX,KADF,CACeU,CAAAV,KADf,CAGEpB,CAAAa,KAHF,CAGciB,CAAAV,KA/Cd,QAAOzB,CAAA,CAASwB,CAAT,CACPnB,EAAA9C,SAAA,EALkC,CA1F0C,CAApE,CAHP,CAJgD,CAAhC,CA1E5B,CAAAwB,UAAA,CA4Qc,mBA5Qd,CA6QK,CAAC,kBAAD,CAAqB,WAArB,CAAkC,UAAlC,CAA8C,QAAQ,CAACuD,CAAD,CAAmBC,CAAnB,CAA8BC,CAA9B,CAAwC,CAE9F,MAAO,CACLxG,SAAU,IADL,CAELI,QAAS,cAFJ,CAGLC,KAAMA,QAAQ,CAACkD,CAAD,CAAShD,CAAT,CAAkBC,CAAlB,CAAyB,CACrC,IAAIiG,EAAMjG,CAAAkG,kBAAND,EAAiCjG,CAAAiG,IACrCH,EAAA,CAAiBG,CAAjB,CAAAE,KAAA,CAA2B,QAAQ,CAACC,CAAD,CAAO,CACxCJ,CAAA,CAASI,CAAT,CAAA,CAAerD,CAAf,CAAuB,QAAQ,CAACsD,CAAD,CAAW,CACxCtG,CAAAuG,MAAA,CAAcD,CAAd,CAGIE,EAAAA,CAASlE,CAAA,CAAO0D,CAAA,CAAU,CAAV,CAAAS,cAAA,CAA2B,sBAA3B,CAAoDP,CAApD,CAA0D,GAA1D,CAAP,CACblG,EAAAuG,MAAA,CAAcC,CAAd,CAGAxG,EAAA0G,OAAA,EARwC,CAA1C,CADwC,CAA1C,CAFqC,CAHlC,CAFuF,CAA9F,CA7QL,CAAAlE,UAAA,CAoUa,WApUb;AAoU0BjD,CAAA,EApU1B,CAAAiD,UAAA,CAqWa,cArWb,CAqW6BjD,CAAA,EArW7B,CAnPsC,CAArC,CAAD,CAyqBGH,MAzqBH,CAyqBWA,MAAAC,QAzqBX;", -"sources":["angular-messages.js"], -"names":["window","angular","undefined","ngMessageDirectiveFactory","$animate","restrict","transclude","priority","terminal","require","link","scope","element","attrs","ngMessagesCtrl","$transclude","commentNode","records","staticExp","ngMessage","when","dynamicExp","ngMessageExp","whenExp","assignRecords","items","isArray","split","reRender","$eval","$watchCollection","currentElement","messageCtrl","register","test","name","collection","indexOf","hasOwnProperty","attach","elm","enter","$$attachId","getAttachId","on","deregister","detach","leave","forEach","isString","jqLite","module","directive","isAttrTruthy","attr","length","truthy","val","controller","$element","$scope","$attrs","findPreviousMessage","parent","comment","prevNode","parentLookup","prevKey","$$ngMessageNode","messages","childNodes","push","previousSibling","parentNode","ctrl","latestKey","nextAttachId","this.getAttachId","renderLater","cachedCollection","render","this.render","multiple","ngMessagesMultiple","unmatchedMessages","matchedKeys","messageItem","head","messageFound","totalMessages","message","messageUsed","value","key","next","setClass","ACTIVE_CLASS","INACTIVE_CLASS","ngMessages","this.reRender","$evalAsync","this.register","nextKey","toString","messageNode","match","this.deregister","$templateRequest","$document","$compile","src","ngMessagesInclude","then","html","contents","after","anchor","createComment","remove"] -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-mocks.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-mocks.js deleted file mode 100644 index 34d360870..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-mocks.js +++ /dev/null @@ -1,2842 +0,0 @@ -/** - * @license AngularJS v1.5.0 - * (c) 2010-2016 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular, undefined) { - -'use strict'; - -/** - * @ngdoc object - * @name angular.mock - * @description - * - * Namespace from 'angular-mocks.js' which contains testing related code. - */ -angular.mock = {}; - -/** - * ! This is a private undocumented service ! - * - * @name $browser - * - * @description - * This service is a mock implementation of {@link ng.$browser}. It provides fake - * implementation for commonly used browser apis that are hard to test, e.g. setTimeout, xhr, - * cookies, etc... - * - * The api of this service is the same as that of the real {@link ng.$browser $browser}, except - * that there are several helper methods available which can be used in tests. - */ -angular.mock.$BrowserProvider = function() { - this.$get = function() { - return new angular.mock.$Browser(); - }; -}; - -angular.mock.$Browser = function() { - var self = this; - - this.isMock = true; - self.$$url = "http://server/"; - self.$$lastUrl = self.$$url; // used by url polling fn - self.pollFns = []; - - // TODO(vojta): remove this temporary api - self.$$completeOutstandingRequest = angular.noop; - self.$$incOutstandingRequestCount = angular.noop; - - - // register url polling fn - - self.onUrlChange = function(listener) { - self.pollFns.push( - function() { - if (self.$$lastUrl !== self.$$url || self.$$state !== self.$$lastState) { - self.$$lastUrl = self.$$url; - self.$$lastState = self.$$state; - listener(self.$$url, self.$$state); - } - } - ); - - return listener; - }; - - self.$$applicationDestroyed = angular.noop; - self.$$checkUrlChange = angular.noop; - - self.deferredFns = []; - self.deferredNextId = 0; - - self.defer = function(fn, delay) { - delay = delay || 0; - self.deferredFns.push({time:(self.defer.now + delay), fn:fn, id: self.deferredNextId}); - self.deferredFns.sort(function(a, b) { return a.time - b.time;}); - return self.deferredNextId++; - }; - - - /** - * @name $browser#defer.now - * - * @description - * Current milliseconds mock time. - */ - self.defer.now = 0; - - - self.defer.cancel = function(deferId) { - var fnIndex; - - angular.forEach(self.deferredFns, function(fn, index) { - if (fn.id === deferId) fnIndex = index; - }); - - if (angular.isDefined(fnIndex)) { - self.deferredFns.splice(fnIndex, 1); - return true; - } - - return false; - }; - - - /** - * @name $browser#defer.flush - * - * @description - * Flushes all pending requests and executes the defer callbacks. - * - * @param {number=} number of milliseconds to flush. See {@link #defer.now} - */ - self.defer.flush = function(delay) { - if (angular.isDefined(delay)) { - self.defer.now += delay; - } else { - if (self.deferredFns.length) { - self.defer.now = self.deferredFns[self.deferredFns.length - 1].time; - } else { - throw new Error('No deferred tasks to be flushed'); - } - } - - while (self.deferredFns.length && self.deferredFns[0].time <= self.defer.now) { - self.deferredFns.shift().fn(); - } - }; - - self.$$baseHref = '/'; - self.baseHref = function() { - return this.$$baseHref; - }; -}; -angular.mock.$Browser.prototype = { - -/** - * @name $browser#poll - * - * @description - * run all fns in pollFns - */ - poll: function poll() { - angular.forEach(this.pollFns, function(pollFn) { - pollFn(); - }); - }, - - url: function(url, replace, state) { - if (angular.isUndefined(state)) { - state = null; - } - if (url) { - this.$$url = url; - // Native pushState serializes & copies the object; simulate it. - this.$$state = angular.copy(state); - return this; - } - - return this.$$url; - }, - - state: function() { - return this.$$state; - }, - - notifyWhenNoOutstandingRequests: function(fn) { - fn(); - } -}; - - -/** - * @ngdoc provider - * @name $exceptionHandlerProvider - * - * @description - * Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors - * passed to the `$exceptionHandler`. - */ - -/** - * @ngdoc service - * @name $exceptionHandler - * - * @description - * Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed - * to it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration - * information. - * - * - * ```js - * describe('$exceptionHandlerProvider', function() { - * - * it('should capture log messages and exceptions', function() { - * - * module(function($exceptionHandlerProvider) { - * $exceptionHandlerProvider.mode('log'); - * }); - * - * inject(function($log, $exceptionHandler, $timeout) { - * $timeout(function() { $log.log(1); }); - * $timeout(function() { $log.log(2); throw 'banana peel'; }); - * $timeout(function() { $log.log(3); }); - * expect($exceptionHandler.errors).toEqual([]); - * expect($log.assertEmpty()); - * $timeout.flush(); - * expect($exceptionHandler.errors).toEqual(['banana peel']); - * expect($log.log.logs).toEqual([[1], [2], [3]]); - * }); - * }); - * }); - * ``` - */ - -angular.mock.$ExceptionHandlerProvider = function() { - var handler; - - /** - * @ngdoc method - * @name $exceptionHandlerProvider#mode - * - * @description - * Sets the logging mode. - * - * @param {string} mode Mode of operation, defaults to `rethrow`. - * - * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` - * mode stores an array of errors in `$exceptionHandler.errors`, to allow later - * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and - * {@link ngMock.$log#reset reset()} - * - `rethrow`: If any errors are passed to the handler in tests, it typically means that there - * is a bug in the application or test, so this mock will make these tests fail. - * For any implementations that expect exceptions to be thrown, the `rethrow` mode - * will also maintain a log of thrown errors. - */ - this.mode = function(mode) { - - switch (mode) { - case 'log': - case 'rethrow': - var errors = []; - handler = function(e) { - if (arguments.length == 1) { - errors.push(e); - } else { - errors.push([].slice.call(arguments, 0)); - } - if (mode === "rethrow") { - throw e; - } - }; - handler.errors = errors; - break; - default: - throw new Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!"); - } - }; - - this.$get = function() { - return handler; - }; - - this.mode('rethrow'); -}; - - -/** - * @ngdoc service - * @name $log - * - * @description - * Mock implementation of {@link ng.$log} that gathers all logged messages in arrays - * (one array per logging level). These arrays are exposed as `logs` property of each of the - * level-specific log function, e.g. for level `error` the array is exposed as `$log.error.logs`. - * - */ -angular.mock.$LogProvider = function() { - var debug = true; - - function concat(array1, array2, index) { - return array1.concat(Array.prototype.slice.call(array2, index)); - } - - this.debugEnabled = function(flag) { - if (angular.isDefined(flag)) { - debug = flag; - return this; - } else { - return debug; - } - }; - - this.$get = function() { - var $log = { - log: function() { $log.log.logs.push(concat([], arguments, 0)); }, - warn: function() { $log.warn.logs.push(concat([], arguments, 0)); }, - info: function() { $log.info.logs.push(concat([], arguments, 0)); }, - error: function() { $log.error.logs.push(concat([], arguments, 0)); }, - debug: function() { - if (debug) { - $log.debug.logs.push(concat([], arguments, 0)); - } - } - }; - - /** - * @ngdoc method - * @name $log#reset - * - * @description - * Reset all of the logging arrays to empty. - */ - $log.reset = function() { - /** - * @ngdoc property - * @name $log#log.logs - * - * @description - * Array of messages logged using {@link ng.$log#log `log()`}. - * - * @example - * ```js - * $log.log('Some Log'); - * var first = $log.log.logs.unshift(); - * ``` - */ - $log.log.logs = []; - /** - * @ngdoc property - * @name $log#info.logs - * - * @description - * Array of messages logged using {@link ng.$log#info `info()`}. - * - * @example - * ```js - * $log.info('Some Info'); - * var first = $log.info.logs.unshift(); - * ``` - */ - $log.info.logs = []; - /** - * @ngdoc property - * @name $log#warn.logs - * - * @description - * Array of messages logged using {@link ng.$log#warn `warn()`}. - * - * @example - * ```js - * $log.warn('Some Warning'); - * var first = $log.warn.logs.unshift(); - * ``` - */ - $log.warn.logs = []; - /** - * @ngdoc property - * @name $log#error.logs - * - * @description - * Array of messages logged using {@link ng.$log#error `error()`}. - * - * @example - * ```js - * $log.error('Some Error'); - * var first = $log.error.logs.unshift(); - * ``` - */ - $log.error.logs = []; - /** - * @ngdoc property - * @name $log#debug.logs - * - * @description - * Array of messages logged using {@link ng.$log#debug `debug()`}. - * - * @example - * ```js - * $log.debug('Some Error'); - * var first = $log.debug.logs.unshift(); - * ``` - */ - $log.debug.logs = []; - }; - - /** - * @ngdoc method - * @name $log#assertEmpty - * - * @description - * Assert that all of the logging methods have no logged messages. If any messages are present, - * an exception is thrown. - */ - $log.assertEmpty = function() { - var errors = []; - angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) { - angular.forEach($log[logLevel].logs, function(log) { - angular.forEach(log, function(logItem) { - errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' + - (logItem.stack || '')); - }); - }); - }); - if (errors.length) { - errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or " + - "an expected log message was not checked and removed:"); - errors.push(''); - throw new Error(errors.join('\n---------\n')); - } - }; - - $log.reset(); - return $log; - }; -}; - - -/** - * @ngdoc service - * @name $interval - * - * @description - * Mock implementation of the $interval service. - * - * Use {@link ngMock.$interval#flush `$interval.flush(millis)`} to - * move forward by `millis` milliseconds and trigger any functions scheduled to run in that - * time. - * - * @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. - * @param {...*=} Pass additional parameters to the executed function. - * @returns {promise} A promise which will be notified on each iteration. - */ -angular.mock.$IntervalProvider = function() { - this.$get = ['$browser', '$rootScope', '$q', '$$q', - function($browser, $rootScope, $q, $$q) { - var repeatFns = [], - nextRepeatId = 0, - now = 0; - - var $interval = function(fn, delay, count, invokeApply) { - var hasParams = arguments.length > 4, - args = hasParams ? Array.prototype.slice.call(arguments, 4) : [], - iteration = 0, - skipApply = (angular.isDefined(invokeApply) && !invokeApply), - deferred = (skipApply ? $$q : $q).defer(), - promise = deferred.promise; - - count = (angular.isDefined(count)) ? count : 0; - promise.then(null, null, (!hasParams) ? fn : function() { - fn.apply(null, args); - }); - - promise.$$intervalId = nextRepeatId; - - function tick() { - deferred.notify(iteration++); - - if (count > 0 && iteration >= count) { - var fnIndex; - deferred.resolve(iteration); - - angular.forEach(repeatFns, function(fn, index) { - if (fn.id === promise.$$intervalId) fnIndex = index; - }); - - if (angular.isDefined(fnIndex)) { - repeatFns.splice(fnIndex, 1); - } - } - - if (skipApply) { - $browser.defer.flush(); - } else { - $rootScope.$apply(); - } - } - - repeatFns.push({ - nextTime:(now + delay), - delay: delay, - fn: tick, - id: nextRepeatId, - deferred: deferred - }); - repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;}); - - nextRepeatId++; - return promise; - }; - /** - * @ngdoc method - * @name $interval#cancel - * - * @description - * Cancels a task associated with the `promise`. - * - * @param {promise} promise A promise from calling the `$interval` function. - * @returns {boolean} Returns `true` if the task was successfully cancelled. - */ - $interval.cancel = function(promise) { - if (!promise) return false; - var fnIndex; - - angular.forEach(repeatFns, function(fn, index) { - if (fn.id === promise.$$intervalId) fnIndex = index; - }); - - if (angular.isDefined(fnIndex)) { - repeatFns[fnIndex].deferred.reject('canceled'); - repeatFns.splice(fnIndex, 1); - return true; - } - - return false; - }; - - /** - * @ngdoc method - * @name $interval#flush - * @description - * - * Runs interval tasks scheduled to be run in the next `millis` milliseconds. - * - * @param {number=} millis maximum timeout amount to flush up until. - * - * @return {number} The amount of time moved forward. - */ - $interval.flush = function(millis) { - now += millis; - while (repeatFns.length && repeatFns[0].nextTime <= now) { - var task = repeatFns[0]; - task.fn(); - task.nextTime += task.delay; - repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;}); - } - return millis; - }; - - return $interval; - }]; -}; - - -/* jshint -W101 */ -/* The R_ISO8061_STR regex is never going to fit into the 100 char limit! - * This directive should go inside the anonymous function but a bug in JSHint means that it would - * not be enacted early enough to prevent the warning. - */ -var R_ISO8061_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/; - -function jsonStringToDate(string) { - var match; - if (match = string.match(R_ISO8061_STR)) { - var date = new Date(0), - tzHour = 0, - tzMin = 0; - if (match[9]) { - tzHour = toInt(match[9] + match[10]); - tzMin = toInt(match[9] + match[11]); - } - date.setUTCFullYear(toInt(match[1]), toInt(match[2]) - 1, toInt(match[3])); - date.setUTCHours(toInt(match[4] || 0) - tzHour, - toInt(match[5] || 0) - tzMin, - toInt(match[6] || 0), - toInt(match[7] || 0)); - return date; - } - return string; -} - -function toInt(str) { - return parseInt(str, 10); -} - -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; -} - - -/** - * @ngdoc type - * @name angular.mock.TzDate - * @description - * - * *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`. - * - * Mock of the Date type which has its timezone specified via constructor arg. - * - * The main purpose is to create Date-like instances with timezone fixed to the specified timezone - * offset, so that we can test code that depends on local timezone settings without dependency on - * the time zone settings of the machine where the code is running. - * - * @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored) - * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC* - * - * @example - * !!!! WARNING !!!!! - * This is not a complete Date object so only methods that were implemented can be called safely. - * To make matters worse, TzDate instances inherit stuff from Date via a prototype. - * - * We do our best to intercept calls to "unimplemented" methods, but since the list of methods is - * incomplete we might be missing some non-standard methods. This can result in errors like: - * "Date.prototype.foo called on incompatible Object". - * - * ```js - * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z'); - * newYearInBratislava.getTimezoneOffset() => -60; - * newYearInBratislava.getFullYear() => 2010; - * newYearInBratislava.getMonth() => 0; - * newYearInBratislava.getDate() => 1; - * newYearInBratislava.getHours() => 0; - * newYearInBratislava.getMinutes() => 0; - * newYearInBratislava.getSeconds() => 0; - * ``` - * - */ -angular.mock.TzDate = function(offset, timestamp) { - var self = new Date(0); - if (angular.isString(timestamp)) { - var tsStr = timestamp; - - self.origDate = jsonStringToDate(timestamp); - - timestamp = self.origDate.getTime(); - if (isNaN(timestamp)) { - throw { - name: "Illegal Argument", - message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string" - }; - } - } else { - self.origDate = new Date(timestamp); - } - - var localOffset = new Date(timestamp).getTimezoneOffset(); - self.offsetDiff = localOffset * 60 * 1000 - offset * 1000 * 60 * 60; - self.date = new Date(timestamp + self.offsetDiff); - - self.getTime = function() { - return self.date.getTime() - self.offsetDiff; - }; - - self.toLocaleDateString = function() { - return self.date.toLocaleDateString(); - }; - - self.getFullYear = function() { - return self.date.getFullYear(); - }; - - self.getMonth = function() { - return self.date.getMonth(); - }; - - self.getDate = function() { - return self.date.getDate(); - }; - - self.getHours = function() { - return self.date.getHours(); - }; - - self.getMinutes = function() { - return self.date.getMinutes(); - }; - - self.getSeconds = function() { - return self.date.getSeconds(); - }; - - self.getMilliseconds = function() { - return self.date.getMilliseconds(); - }; - - self.getTimezoneOffset = function() { - return offset * 60; - }; - - self.getUTCFullYear = function() { - return self.origDate.getUTCFullYear(); - }; - - self.getUTCMonth = function() { - return self.origDate.getUTCMonth(); - }; - - self.getUTCDate = function() { - return self.origDate.getUTCDate(); - }; - - self.getUTCHours = function() { - return self.origDate.getUTCHours(); - }; - - self.getUTCMinutes = function() { - return self.origDate.getUTCMinutes(); - }; - - self.getUTCSeconds = function() { - return self.origDate.getUTCSeconds(); - }; - - self.getUTCMilliseconds = function() { - return self.origDate.getUTCMilliseconds(); - }; - - self.getDay = function() { - return self.date.getDay(); - }; - - // provide this method only on browsers that already have it - if (self.toISOString) { - self.toISOString = function() { - return padNumber(self.origDate.getUTCFullYear(), 4) + '-' + - padNumber(self.origDate.getUTCMonth() + 1, 2) + '-' + - padNumber(self.origDate.getUTCDate(), 2) + 'T' + - padNumber(self.origDate.getUTCHours(), 2) + ':' + - padNumber(self.origDate.getUTCMinutes(), 2) + ':' + - padNumber(self.origDate.getUTCSeconds(), 2) + '.' + - padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z'; - }; - } - - //hide all methods not implemented in this mock that the Date prototype exposes - var unimplementedMethods = ['getUTCDay', - 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', - 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', - 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', - 'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString', - 'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf']; - - angular.forEach(unimplementedMethods, function(methodName) { - self[methodName] = function() { - throw new Error("Method '" + methodName + "' is not implemented in the TzDate mock"); - }; - }); - - return self; -}; - -//make "tzDateInstance instanceof Date" return true -angular.mock.TzDate.prototype = Date.prototype; -/* jshint +W101 */ - - -/** - * @ngdoc service - * @name $animate - * - * @description - * Mock implementation of the {@link ng.$animate `$animate`} service. Exposes two additional methods - * for testing animations. - */ -angular.mock.animate = angular.module('ngAnimateMock', ['ng']) - - .config(['$provide', function($provide) { - - $provide.factory('$$forceReflow', function() { - function reflowFn() { - reflowFn.totalReflows++; - } - reflowFn.totalReflows = 0; - return reflowFn; - }); - - $provide.factory('$$animateAsyncRun', function() { - var queue = []; - var queueFn = function() { - return function(fn) { - queue.push(fn); - }; - }; - queueFn.flush = function() { - if (queue.length === 0) return false; - - for (var i = 0; i < queue.length; i++) { - queue[i](); - } - queue = []; - - return true; - }; - return queueFn; - }); - - $provide.decorator('$$animateJs', ['$delegate', function($delegate) { - var runners = []; - - var animateJsConstructor = function() { - var animator = $delegate.apply($delegate, arguments); - // If no javascript animation is found, animator is undefined - if (animator) { - runners.push(animator); - } - return animator; - }; - - animateJsConstructor.$closeAndFlush = function() { - runners.forEach(function(runner) { - runner.end(); - }); - runners = []; - }; - - return animateJsConstructor; - }]); - - $provide.decorator('$animateCss', ['$delegate', function($delegate) { - var runners = []; - - var animateCssConstructor = function(element, options) { - var animator = $delegate(element, options); - runners.push(animator); - return animator; - }; - - animateCssConstructor.$closeAndFlush = function() { - runners.forEach(function(runner) { - runner.end(); - }); - runners = []; - }; - - return animateCssConstructor; - }]); - - $provide.decorator('$animate', ['$delegate', '$timeout', '$browser', '$$rAF', '$animateCss', '$$animateJs', - '$$forceReflow', '$$animateAsyncRun', '$rootScope', - function($delegate, $timeout, $browser, $$rAF, $animateCss, $$animateJs, - $$forceReflow, $$animateAsyncRun, $rootScope) { - var animate = { - queue: [], - cancel: $delegate.cancel, - on: $delegate.on, - off: $delegate.off, - pin: $delegate.pin, - get reflows() { - return $$forceReflow.totalReflows; - }, - enabled: $delegate.enabled, - /** - * @ngdoc method - * @name $animate#closeAndFlush - * @description - * - * This method will close all pending animations (both {@link ngAnimate#javascript-based-animations Javascript} - * and {@link ngAnimate.$animateCss CSS}) and it will also flush any remaining animation frames and/or callbacks. - */ - closeAndFlush: function() { - // we allow the flush command to swallow the errors - // because depending on whether CSS or JS animations are - // used, there may not be a RAF flush. The primary flush - // at the end of this function must throw an exception - // because it will track if there were pending animations - this.flush(true); - $animateCss.$closeAndFlush(); - $$animateJs.$closeAndFlush(); - this.flush(); - }, - /** - * @ngdoc method - * @name $animate#flush - * @description - * - * This method is used to flush the pending callbacks and animation frames to either start - * an animation or conclude an animation. Note that this will not actually close an - * actively running animation (see {@link ngMock.$animate#closeAndFlush `closeAndFlush()`} for that). - */ - flush: function(hideErrors) { - $rootScope.$digest(); - - var doNextRun, somethingFlushed = false; - do { - doNextRun = false; - - if ($$rAF.queue.length) { - $$rAF.flush(); - doNextRun = somethingFlushed = true; - } - - if ($$animateAsyncRun.flush()) { - doNextRun = somethingFlushed = true; - } - } while (doNextRun); - - if (!somethingFlushed && !hideErrors) { - throw new Error('No pending animations ready to be closed or flushed'); - } - - $rootScope.$digest(); - } - }; - - angular.forEach( - ['animate','enter','leave','move','addClass','removeClass','setClass'], function(method) { - animate[method] = function() { - animate.queue.push({ - event: method, - element: arguments[0], - options: arguments[arguments.length - 1], - args: arguments - }); - return $delegate[method].apply($delegate, arguments); - }; - }); - - return animate; - }]); - - }]); - - -/** - * @ngdoc function - * @name angular.mock.dump - * @description - * - * *NOTE*: this is not an injectable instance, just a globally available function. - * - * Method for serializing common angular objects (scope, elements, etc..) into strings, useful for - * debugging. - * - * This method is also available on window, where it can be used to display objects on debug - * console. - * - * @param {*} object - any object to turn into string. - * @return {string} a serialized string of the argument - */ -angular.mock.dump = function(object) { - return serialize(object); - - function serialize(object) { - var out; - - if (angular.isElement(object)) { - object = angular.element(object); - out = angular.element('
    '); - angular.forEach(object, function(element) { - out.append(angular.element(element).clone()); - }); - out = out.html(); - } else if (angular.isArray(object)) { - out = []; - angular.forEach(object, function(o) { - out.push(serialize(o)); - }); - out = '[ ' + out.join(', ') + ' ]'; - } else if (angular.isObject(object)) { - if (angular.isFunction(object.$eval) && angular.isFunction(object.$apply)) { - out = serializeScope(object); - } else if (object instanceof Error) { - out = object.stack || ('' + object.name + ': ' + object.message); - } else { - // TODO(i): this prevents methods being logged, - // we should have a better way to serialize objects - out = angular.toJson(object, true); - } - } else { - out = String(object); - } - - return out; - } - - function serializeScope(scope, offset) { - offset = offset || ' '; - var log = [offset + 'Scope(' + scope.$id + '): {']; - for (var key in scope) { - if (Object.prototype.hasOwnProperty.call(scope, key) && !key.match(/^(\$|this)/)) { - log.push(' ' + key + ': ' + angular.toJson(scope[key])); - } - } - var child = scope.$$childHead; - while (child) { - log.push(serializeScope(child, offset + ' ')); - child = child.$$nextSibling; - } - log.push('}'); - return log.join('\n' + offset); - } -}; - -/** - * @ngdoc service - * @name $httpBackend - * @description - * Fake HTTP backend implementation suitable for unit testing applications that use the - * {@link ng.$http $http service}. - * - * *Note*: For fake HTTP backend implementation suitable for end-to-end testing or backend-less - * development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}. - * - * During unit testing, we want our unit tests to run quickly and have no external dependencies so - * we don’t want to send [XHR](https://developer.mozilla.org/en/xmlhttprequest) or - * [JSONP](http://en.wikipedia.org/wiki/JSONP) requests to a real server. All we really need is - * to verify whether a certain request has been sent or not, or alternatively just let the - * application make requests, respond with pre-trained responses and assert that the end result is - * what we expect it to be. - * - * This mock implementation can be used to respond with static or dynamic responses via the - * `expect` and `when` apis and their shortcuts (`expectGET`, `whenPOST`, etc). - * - * When an Angular application needs some data from a server, it calls the $http service, which - * sends the request to a real server using $httpBackend service. With dependency injection, it is - * easy to inject $httpBackend mock (which has the same API as $httpBackend) and use it to verify - * the requests and respond with some testing data without sending a request to a real server. - * - * There are two ways to specify what test data should be returned as http responses by the mock - * backend when the code under test makes http requests: - * - * - `$httpBackend.expect` - specifies a request expectation - * - `$httpBackend.when` - specifies a backend definition - * - * - * ## Request Expectations vs Backend Definitions - * - * Request expectations provide a way to make assertions about requests made by the application and - * to define responses for those requests. The test will fail if the expected requests are not made - * or they are made in the wrong order. - * - * Backend definitions allow you to define a fake backend for your application which doesn't assert - * if a particular request was made or not, it just returns a trained response if a request is made. - * The test will pass whether or not the request gets made during testing. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    Request expectationsBackend definitions
    Syntax.expect(...).respond(...).when(...).respond(...)
    Typical usagestrict unit testsloose (black-box) unit testing
    Fulfills multiple requestsNOYES
    Order of requests mattersYESNO
    Request requiredYESNO
    Response requiredoptional (see below)YES
    - * - * In cases where both backend definitions and request expectations are specified during unit - * testing, the request expectations are evaluated first. - * - * If a request expectation has no response specified, the algorithm will search your backend - * definitions for an appropriate response. - * - * If a request didn't match any expectation or if the expectation doesn't have the response - * defined, the backend definitions are evaluated in sequential order to see if any of them match - * the request. The response from the first matched definition is returned. - * - * - * ## Flushing HTTP requests - * - * The $httpBackend used in production always responds to requests asynchronously. If we preserved - * this behavior in unit testing, we'd have to create async unit tests, which are hard to write, - * to follow and to maintain. But neither can the testing mock respond synchronously; that would - * change the execution of the code under test. For this reason, the mock $httpBackend has a - * `flush()` method, which allows the test to explicitly flush pending requests. This preserves - * the async api of the backend, while allowing the test to execute synchronously. - * - * - * ## Unit testing with mock $httpBackend - * The following code shows how to setup and use the mock backend when unit testing a controller. - * First we create the controller under test: - * - ```js - // The module code - angular - .module('MyApp', []) - .controller('MyController', MyController); - - // The controller code - function MyController($scope, $http) { - var authToken; - - $http.get('/auth.py').then(function(response) { - authToken = response.headers('A-Token'); - $scope.user = response.data; - }); - - $scope.saveMessage = function(message) { - var headers = { 'Authorization': authToken }; - $scope.status = 'Saving...'; - - $http.post('/add-msg.py', message, { headers: headers } ).then(function(response) { - $scope.status = ''; - }).catch(function() { - $scope.status = 'Failed...'; - }); - }; - } - ``` - * - * Now we setup the mock backend and create the test specs: - * - ```js - // testing controller - describe('MyController', function() { - var $httpBackend, $rootScope, createController, authRequestHandler; - - // Set up the module - beforeEach(module('MyApp')); - - beforeEach(inject(function($injector) { - // Set up the mock http service responses - $httpBackend = $injector.get('$httpBackend'); - // backend definition common for all tests - authRequestHandler = $httpBackend.when('GET', '/auth.py') - .respond({userId: 'userX'}, {'A-Token': 'xxx'}); - - // Get hold of a scope (i.e. the root scope) - $rootScope = $injector.get('$rootScope'); - // The $controller service is used to create instances of controllers - var $controller = $injector.get('$controller'); - - createController = function() { - return $controller('MyController', {'$scope' : $rootScope }); - }; - })); - - - afterEach(function() { - $httpBackend.verifyNoOutstandingExpectation(); - $httpBackend.verifyNoOutstandingRequest(); - }); - - - it('should fetch authentication token', function() { - $httpBackend.expectGET('/auth.py'); - var controller = createController(); - $httpBackend.flush(); - }); - - - it('should fail authentication', function() { - - // Notice how you can change the response even after it was set - authRequestHandler.respond(401, ''); - - $httpBackend.expectGET('/auth.py'); - var controller = createController(); - $httpBackend.flush(); - expect($rootScope.status).toBe('Failed...'); - }); - - - it('should send msg to server', function() { - var controller = createController(); - $httpBackend.flush(); - - // now you don’t care about the authentication, but - // the controller will still send the request and - // $httpBackend will respond without you having to - // specify the expectation and response for this request - - $httpBackend.expectPOST('/add-msg.py', 'message content').respond(201, ''); - $rootScope.saveMessage('message content'); - expect($rootScope.status).toBe('Saving...'); - $httpBackend.flush(); - expect($rootScope.status).toBe(''); - }); - - - it('should send auth header', function() { - var controller = createController(); - $httpBackend.flush(); - - $httpBackend.expectPOST('/add-msg.py', undefined, function(headers) { - // check if the header was sent, if it wasn't the expectation won't - // match the request and the test will fail - return headers['Authorization'] == 'xxx'; - }).respond(201, ''); - - $rootScope.saveMessage('whatever'); - $httpBackend.flush(); - }); - }); - ``` - * - * ## Dynamic responses - * - * You define a response to a request by chaining a call to `respond()` onto a definition or expectation. - * If you provide a **callback** as the first parameter to `respond(callback)` then you can dynamically generate - * a response based on the properties of the request. - * - * The `callback` function should be of the form `function(method, url, data, headers, params)`. - * - * ### Query parameters - * - * By default, query parameters on request URLs are parsed into the `params` object. So a request URL - * of `/list?q=searchstr&orderby=-name` would set `params` to be `{q: 'searchstr', orderby: '-name'}`. - * - * ### Regex parameter matching - * - * If an expectation or definition uses a **regex** to match the URL, you can provide an array of **keys** via a - * `params` argument. The index of each **key** in the array will match the index of a **group** in the - * **regex**. - * - * The `params` object in the **callback** will now have properties with these keys, which hold the value of the - * corresponding **group** in the **regex**. - * - * This also applies to the `when` and `expect` shortcut methods. - * - * - * ```js - * $httpBackend.expect('GET', /\/user\/(.+)/, undefined, undefined, ['id']) - * .respond(function(method, url, data, headers, params) { - * // for requested url of '/user/1234' params is {id: '1234'} - * }); - * - * $httpBackend.whenPATCH(/\/user\/(.+)\/article\/(.+)/, undefined, undefined, ['user', 'article']) - * .respond(function(method, url, data, headers, params) { - * // for url of '/user/1234/article/567' params is {user: '1234', article: '567'} - * }); - * ``` - * - * ## Matching route requests - * - * For extra convenience, `whenRoute` and `expectRoute` shortcuts are available. These methods offer colon - * delimited matching of the url path, ignoring the query string. This allows declarations - * similar to how application routes are configured with `$routeProvider`. Because these methods convert - * the definition url to regex, declaration order is important. Combined with query parameter parsing, - * the following is possible: - * - ```js - $httpBackend.whenRoute('GET', '/users/:id') - .respond(function(method, url, data, headers, params) { - return [200, MockUserList[Number(params.id)]]; - }); - - $httpBackend.whenRoute('GET', '/users') - .respond(function(method, url, data, headers, params) { - var userList = angular.copy(MockUserList), - defaultSort = 'lastName', - count, pages, isPrevious, isNext; - - // paged api response '/v1/users?page=2' - params.page = Number(params.page) || 1; - - // query for last names '/v1/users?q=Archer' - if (params.q) { - userList = $filter('filter')({lastName: params.q}); - } - - pages = Math.ceil(userList.length / pagingLength); - isPrevious = params.page > 1; - isNext = params.page < pages; - - return [200, { - count: userList.length, - previous: isPrevious, - next: isNext, - // sort field -> '/v1/users?sortBy=firstName' - results: $filter('orderBy')(userList, params.sortBy || defaultSort) - .splice((params.page - 1) * pagingLength, pagingLength) - }]; - }); - ``` - */ -angular.mock.$HttpBackendProvider = function() { - this.$get = ['$rootScope', '$timeout', createHttpBackendMock]; -}; - -/** - * General factory function for $httpBackend mock. - * Returns instance for unit testing (when no arguments specified): - * - passing through is disabled - * - auto flushing is disabled - * - * Returns instance for e2e testing (when `$delegate` and `$browser` specified): - * - passing through (delegating request to real backend) is enabled - * - auto flushing is enabled - * - * @param {Object=} $delegate Real $httpBackend instance (allow passing through if specified) - * @param {Object=} $browser Auto-flushing enabled if specified - * @return {Object} Instance of $httpBackend mock - */ -function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) { - var definitions = [], - expectations = [], - responses = [], - responsesPush = angular.bind(responses, responses.push), - copy = angular.copy; - - function createResponse(status, data, headers, statusText) { - if (angular.isFunction(status)) return status; - - return function() { - return angular.isNumber(status) - ? [status, data, headers, statusText] - : [200, status, data, headers]; - }; - } - - // TODO(vojta): change params to: method, url, data, headers, callback - function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) { - var xhr = new MockXhr(), - expectation = expectations[0], - wasExpected = false; - - function prettyPrint(data) { - return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp) - ? data - : angular.toJson(data); - } - - function wrapResponse(wrapped) { - if (!$browser && timeout) { - timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout); - } - - return handleResponse; - - function handleResponse() { - var response = wrapped.response(method, url, data, headers, wrapped.params(url)); - xhr.$$respHeaders = response[2]; - callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(), - copy(response[3] || '')); - } - - function handleTimeout() { - for (var i = 0, ii = responses.length; i < ii; i++) { - if (responses[i] === handleResponse) { - responses.splice(i, 1); - callback(-1, undefined, ''); - break; - } - } - } - } - - if (expectation && expectation.match(method, url)) { - if (!expectation.matchData(data)) { - throw new Error('Expected ' + expectation + ' with different data\n' + - 'EXPECTED: ' + prettyPrint(expectation.data) + '\nGOT: ' + data); - } - - if (!expectation.matchHeaders(headers)) { - throw new Error('Expected ' + expectation + ' with different headers\n' + - 'EXPECTED: ' + prettyPrint(expectation.headers) + '\nGOT: ' + - prettyPrint(headers)); - } - - expectations.shift(); - - if (expectation.response) { - responses.push(wrapResponse(expectation)); - return; - } - wasExpected = true; - } - - var i = -1, definition; - while ((definition = definitions[++i])) { - if (definition.match(method, url, data, headers || {})) { - if (definition.response) { - // if $browser specified, we do auto flush all requests - ($browser ? $browser.defer : responsesPush)(wrapResponse(definition)); - } else if (definition.passThrough) { - $delegate(method, url, data, callback, headers, timeout, withCredentials); - } else throw new Error('No response defined !'); - return; - } - } - throw wasExpected ? - new Error('No response defined !') : - new Error('Unexpected request: ' + method + ' ' + url + '\n' + - (expectation ? 'Expected ' + expectation : 'No more request expected')); - } - - /** - * @ngdoc method - * @name $httpBackend#when - * @description - * Creates a new backend definition. - * - * @param {string} method HTTP method. - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives - * data string and returns true if the data is as expected. - * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header - * object and returns true if the headers match the current definition. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - * - * - respond – - * `{function([status,] data[, headers, statusText]) - * | function(function(method, url, data, headers, params)}` - * – The respond method takes a set of static data to be returned or a function that can - * return an array containing response status (number), response data (string), response - * headers (Object), and the text for the status (string). The respond method returns the - * `requestHandler` object for possible overrides. - */ - $httpBackend.when = function(method, url, data, headers, keys) { - var definition = new MockHttpExpectation(method, url, data, headers, keys), - chain = { - respond: function(status, data, headers, statusText) { - definition.passThrough = undefined; - definition.response = createResponse(status, data, headers, statusText); - return chain; - } - }; - - if ($browser) { - chain.passThrough = function() { - definition.response = undefined; - definition.passThrough = true; - return chain; - }; - } - - definitions.push(definition); - return chain; - }; - - /** - * @ngdoc method - * @name $httpBackend#whenGET - * @description - * Creates a new backend definition for GET requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#whenHEAD - * @description - * Creates a new backend definition for HEAD requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#whenDELETE - * @description - * Creates a new backend definition for DELETE requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#whenPOST - * @description - * Creates a new backend definition for POST requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives - * data string and returns true if the data is as expected. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#whenPUT - * @description - * Creates a new backend definition for PUT requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives - * data string and returns true if the data is as expected. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#whenJSONP - * @description - * Creates a new backend definition for JSONP requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - createShortMethods('when'); - - /** - * @ngdoc method - * @name $httpBackend#whenRoute - * @description - * Creates a new backend definition that compares only with the requested route. - * - * @param {string} method HTTP method. - * @param {string} url HTTP url string that supports colon param matching. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. See #when for more info. - */ - $httpBackend.whenRoute = function(method, url) { - var pathObj = parseRoute(url); - return $httpBackend.when(method, pathObj.regexp, undefined, undefined, pathObj.keys); - }; - - function parseRoute(url) { - var ret = { - regexp: url - }, - keys = ret.keys = []; - - if (!url || !angular.isString(url)) return ret; - - url = url - .replace(/([().])/g, '\\$1') - .replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option) { - var optional = option === '?' ? option : null; - var star = option === '*' ? option : null; - keys.push({ name: key, optional: !!optional }); - slash = slash || ''; - return '' - + (optional ? '' : slash) - + '(?:' - + (optional ? slash : '') - + (star && '(.+?)' || '([^/]+)') - + (optional || '') - + ')' - + (optional || ''); - }) - .replace(/([\/$\*])/g, '\\$1'); - - ret.regexp = new RegExp('^' + url, 'i'); - return ret; - } - - /** - * @ngdoc method - * @name $httpBackend#expect - * @description - * Creates a new request expectation. - * - * @param {string} method HTTP method. - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header - * object and returns true if the headers match the current expectation. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - * - * - respond – - * `{function([status,] data[, headers, statusText]) - * | function(function(method, url, data, headers, params)}` - * – The respond method takes a set of static data to be returned or a function that can - * return an array containing response status (number), response data (string), response - * headers (Object), and the text for the status (string). The respond method returns the - * `requestHandler` object for possible overrides. - */ - $httpBackend.expect = function(method, url, data, headers, keys) { - var expectation = new MockHttpExpectation(method, url, data, headers, keys), - chain = { - respond: function(status, data, headers, statusText) { - expectation.response = createResponse(status, data, headers, statusText); - return chain; - } - }; - - expectations.push(expectation); - return chain; - }; - - /** - * @ngdoc method - * @name $httpBackend#expectGET - * @description - * Creates a new request expectation for GET requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. See #expect for more info. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectHEAD - * @description - * Creates a new request expectation for HEAD requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectDELETE - * @description - * Creates a new request expectation for DELETE requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectPOST - * @description - * Creates a new request expectation for POST requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectPUT - * @description - * Creates a new request expectation for PUT requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectPATCH - * @description - * Creates a new request expectation for PATCH requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {Object=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - - /** - * @ngdoc method - * @name $httpBackend#expectJSONP - * @description - * Creates a new request expectation for JSONP requests. For more info see `expect()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives an url - * and returns true if the url matches the current definition. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. - */ - createShortMethods('expect'); - - /** - * @ngdoc method - * @name $httpBackend#expectRoute - * @description - * Creates a new request expectation that compares only with the requested route. - * - * @param {string} method HTTP method. - * @param {string} url HTTP url string that supports colon param matching. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. You can save this object for later use and invoke `respond` again in - * order to change how a matched request is handled. See #expect for more info. - */ - $httpBackend.expectRoute = function(method, url) { - var pathObj = parseRoute(url); - return $httpBackend.expect(method, pathObj.regexp, undefined, undefined, pathObj.keys); - }; - - - /** - * @ngdoc method - * @name $httpBackend#flush - * @description - * Flushes all pending requests using the trained responses. - * - * @param {number=} count Number of responses to flush (in the order they arrived). If undefined, - * all pending requests will be flushed. If there are no pending requests when the flush method - * is called an exception is thrown (as this typically a sign of programming error). - */ - $httpBackend.flush = function(count, digest) { - if (digest !== false) $rootScope.$digest(); - if (!responses.length) throw new Error('No pending request to flush !'); - - if (angular.isDefined(count) && count !== null) { - while (count--) { - if (!responses.length) throw new Error('No more pending request to flush !'); - responses.shift()(); - } - } else { - while (responses.length) { - responses.shift()(); - } - } - $httpBackend.verifyNoOutstandingExpectation(digest); - }; - - - /** - * @ngdoc method - * @name $httpBackend#verifyNoOutstandingExpectation - * @description - * Verifies that all of the requests defined via the `expect` api were made. If any of the - * requests were not made, verifyNoOutstandingExpectation throws an exception. - * - * Typically, you would call this method following each test case that asserts requests using an - * "afterEach" clause. - * - * ```js - * afterEach($httpBackend.verifyNoOutstandingExpectation); - * ``` - */ - $httpBackend.verifyNoOutstandingExpectation = function(digest) { - if (digest !== false) $rootScope.$digest(); - if (expectations.length) { - throw new Error('Unsatisfied requests: ' + expectations.join(', ')); - } - }; - - - /** - * @ngdoc method - * @name $httpBackend#verifyNoOutstandingRequest - * @description - * Verifies that there are no outstanding requests that need to be flushed. - * - * Typically, you would call this method following each test case that asserts requests using an - * "afterEach" clause. - * - * ```js - * afterEach($httpBackend.verifyNoOutstandingRequest); - * ``` - */ - $httpBackend.verifyNoOutstandingRequest = function() { - if (responses.length) { - throw new Error('Unflushed requests: ' + responses.length); - } - }; - - - /** - * @ngdoc method - * @name $httpBackend#resetExpectations - * @description - * Resets all request expectations, but preserves all backend definitions. Typically, you would - * call resetExpectations during a multiple-phase test when you want to reuse the same instance of - * $httpBackend mock. - */ - $httpBackend.resetExpectations = function() { - expectations.length = 0; - responses.length = 0; - }; - - return $httpBackend; - - - function createShortMethods(prefix) { - angular.forEach(['GET', 'DELETE', 'JSONP', 'HEAD'], function(method) { - $httpBackend[prefix + method] = function(url, headers, keys) { - return $httpBackend[prefix](method, url, undefined, headers, keys); - }; - }); - - angular.forEach(['PUT', 'POST', 'PATCH'], function(method) { - $httpBackend[prefix + method] = function(url, data, headers, keys) { - return $httpBackend[prefix](method, url, data, headers, keys); - }; - }); - } -} - -function MockHttpExpectation(method, url, data, headers, keys) { - - this.data = data; - this.headers = headers; - - this.match = function(m, u, d, h) { - if (method != m) return false; - if (!this.matchUrl(u)) return false; - if (angular.isDefined(d) && !this.matchData(d)) return false; - if (angular.isDefined(h) && !this.matchHeaders(h)) return false; - return true; - }; - - this.matchUrl = function(u) { - if (!url) return true; - if (angular.isFunction(url.test)) return url.test(u); - if (angular.isFunction(url)) return url(u); - return url == u; - }; - - this.matchHeaders = function(h) { - if (angular.isUndefined(headers)) return true; - if (angular.isFunction(headers)) return headers(h); - return angular.equals(headers, h); - }; - - this.matchData = function(d) { - if (angular.isUndefined(data)) return true; - if (data && angular.isFunction(data.test)) return data.test(d); - if (data && angular.isFunction(data)) return data(d); - if (data && !angular.isString(data)) { - return angular.equals(angular.fromJson(angular.toJson(data)), angular.fromJson(d)); - } - return data == d; - }; - - this.toString = function() { - return method + ' ' + url; - }; - - this.params = function(u) { - return angular.extend(parseQuery(), pathParams()); - - function pathParams() { - var keyObj = {}; - if (!url || !angular.isFunction(url.test) || !keys || keys.length === 0) return keyObj; - - var m = url.exec(u); - if (!m) return keyObj; - for (var i = 1, len = m.length; i < len; ++i) { - var key = keys[i - 1]; - var val = m[i]; - if (key && val) { - keyObj[key.name || key] = val; - } - } - - return keyObj; - } - - function parseQuery() { - var obj = {}, key_value, key, - queryStr = u.indexOf('?') > -1 - ? u.substring(u.indexOf('?') + 1) - : ""; - - angular.forEach(queryStr.split('&'), function(keyValue) { - if (keyValue) { - key_value = keyValue.replace(/\+/g,'%20').split('='); - key = tryDecodeURIComponent(key_value[0]); - if (angular.isDefined(key)) { - var val = angular.isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true; - if (!hasOwnProperty.call(obj, key)) { - obj[key] = val; - } else if (angular.isArray(obj[key])) { - obj[key].push(val); - } else { - obj[key] = [obj[key],val]; - } - } - } - }); - return obj; - } - function tryDecodeURIComponent(value) { - try { - return decodeURIComponent(value); - } catch (e) { - // Ignore any invalid uri component - } - } - }; -} - -function createMockXhr() { - return new MockXhr(); -} - -function MockXhr() { - - // hack for testing $http, $httpBackend - MockXhr.$$lastInstance = this; - - this.open = function(method, url, async) { - this.$$method = method; - this.$$url = url; - this.$$async = async; - this.$$reqHeaders = {}; - this.$$respHeaders = {}; - }; - - this.send = function(data) { - this.$$data = data; - }; - - this.setRequestHeader = function(key, value) { - this.$$reqHeaders[key] = value; - }; - - this.getResponseHeader = function(name) { - // the lookup must be case insensitive, - // that's why we try two quick lookups first and full scan last - var header = this.$$respHeaders[name]; - if (header) return header; - - name = angular.lowercase(name); - header = this.$$respHeaders[name]; - if (header) return header; - - header = undefined; - angular.forEach(this.$$respHeaders, function(headerVal, headerName) { - if (!header && angular.lowercase(headerName) == name) header = headerVal; - }); - return header; - }; - - this.getAllResponseHeaders = function() { - var lines = []; - - angular.forEach(this.$$respHeaders, function(value, key) { - lines.push(key + ': ' + value); - }); - return lines.join('\n'); - }; - - this.abort = angular.noop; -} - - -/** - * @ngdoc service - * @name $timeout - * @description - * - * This service is just a simple decorator for {@link ng.$timeout $timeout} service - * that adds a "flush" and "verifyNoPendingTasks" methods. - */ - -angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $browser) { - - /** - * @ngdoc method - * @name $timeout#flush - * @description - * - * Flushes the queue of pending tasks. - * - * @param {number=} delay maximum timeout amount to flush up until - */ - $delegate.flush = function(delay) { - $browser.defer.flush(delay); - }; - - /** - * @ngdoc method - * @name $timeout#verifyNoPendingTasks - * @description - * - * Verifies that there are no pending tasks that need to be flushed. - */ - $delegate.verifyNoPendingTasks = function() { - if ($browser.deferredFns.length) { - throw new Error('Deferred tasks to flush (' + $browser.deferredFns.length + '): ' + - formatPendingTasksAsString($browser.deferredFns)); - } - }; - - function formatPendingTasksAsString(tasks) { - var result = []; - angular.forEach(tasks, function(task) { - result.push('{id: ' + task.id + ', ' + 'time: ' + task.time + '}'); - }); - - return result.join(', '); - } - - return $delegate; -}]; - -angular.mock.$RAFDecorator = ['$delegate', function($delegate) { - var rafFn = function(fn) { - var index = rafFn.queue.length; - rafFn.queue.push(fn); - return function() { - rafFn.queue.splice(index, 1); - }; - }; - - rafFn.queue = []; - rafFn.supported = $delegate.supported; - - rafFn.flush = function() { - if (rafFn.queue.length === 0) { - throw new Error('No rAF callbacks present'); - } - - var length = rafFn.queue.length; - for (var i = 0; i < length; i++) { - rafFn.queue[i](); - } - - rafFn.queue = rafFn.queue.slice(i); - }; - - return rafFn; -}]; - -/** - * - */ -angular.mock.$RootElementProvider = function() { - this.$get = function() { - return angular.element('
    '); - }; -}; - -/** - * @ngdoc service - * @name $controller - * @description - * A decorator for {@link ng.$controller} with additional `bindings` parameter, useful when testing - * controllers of directives that use {@link $compile#-bindtocontroller- `bindToController`}. - * - * - * ## Example - * - * ```js - * - * // Directive definition ... - * - * myMod.directive('myDirective', { - * controller: 'MyDirectiveController', - * bindToController: { - * name: '@' - * } - * }); - * - * - * // Controller definition ... - * - * myMod.controller('MyDirectiveController', ['$log', function($log) { - * $log.info(this.name); - * })]; - * - * - * // In a test ... - * - * describe('myDirectiveController', function() { - * it('should write the bound name to the log', inject(function($controller, $log) { - * var ctrl = $controller('MyDirectiveController', { /* no locals */ }, { name: 'Clark Kent' }); - * expect(ctrl.name).toEqual('Clark Kent'); - * expect($log.info.logs).toEqual(['Clark Kent']); - * }); - * }); - * - * ``` - * - * @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 - * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global - * `window` object (not recommended) - * - * The string can use the `controller as property` syntax, where the controller instance is published - * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this - * to work correctly. - * - * @param {Object} locals Injection locals for Controller. - * @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used - * to simulate the `bindToController` feature and simplify certain kinds of tests. - * @return {Object} Instance of given controller. - */ -angular.mock.$ControllerDecorator = ['$delegate', function($delegate) { - return function(expression, locals, later, ident) { - if (later && typeof later === 'object') { - var create = $delegate(expression, locals, true, ident); - angular.extend(create.instance, later); - return create(); - } - return $delegate(expression, locals, later, ident); - }; -}]; - -/** - * @ngdoc service - * @name $componentController - * @description - * A service that can be used to create instances of component controllers. - *
    - * Be aware that the controller will be instantiated and attached to the scope as specified in - * the component definition object. That means that you must always provide a `$scope` object - * in the `locals` param. - *
    - * @param {string} componentName the name of the component whose controller we want to instantiate - * @param {Object} locals Injection locals for Controller. - * @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used - * to simulate the `bindToController` feature and simplify certain kinds of tests. - * @param {string=} ident Override the property name to use when attaching the controller to the scope. - * @return {Object} Instance of requested controller. - */ -angular.mock.$ComponentControllerProvider = ['$compileProvider', function($compileProvider) { - return { - $get: ['$controller','$injector', function($controller,$injector) { - return function $componentController(componentName, locals, bindings, ident) { - // get all directives associated to the component name - var directives = $injector.get(componentName + 'Directive'); - // look for those directives that are components - var candidateDirectives = directives.filter(function(directiveInfo) { - // components have controller, controllerAs and restrict:'E' - return directiveInfo.controller && directiveInfo.controllerAs && directiveInfo.restrict === 'E'; - }); - // check if valid directives found - if (candidateDirectives.length === 0) { - throw new Error('No component found'); - } - if (candidateDirectives.length > 1) { - throw new Error('Too many components found'); - } - // get the info of the component - var directiveInfo = candidateDirectives[0]; - return $controller(directiveInfo.controller, locals, bindings, ident || directiveInfo.controllerAs); - }; - }] - }; -}]; - - -/** - * @ngdoc module - * @name ngMock - * @packageName angular-mocks - * @description - * - * # ngMock - * - * The `ngMock` module provides support to inject and mock Angular services into unit tests. - * In addition, ngMock also extends various core ng services such that they can be - * inspected and controlled in a synchronous manner within test code. - * - * - *
    - * - */ -angular.module('ngMock', ['ng']).provider({ - $browser: angular.mock.$BrowserProvider, - $exceptionHandler: angular.mock.$ExceptionHandlerProvider, - $log: angular.mock.$LogProvider, - $interval: angular.mock.$IntervalProvider, - $httpBackend: angular.mock.$HttpBackendProvider, - $rootElement: angular.mock.$RootElementProvider, - $componentController: angular.mock.$ComponentControllerProvider -}).config(['$provide', function($provide) { - $provide.decorator('$timeout', angular.mock.$TimeoutDecorator); - $provide.decorator('$$rAF', angular.mock.$RAFDecorator); - $provide.decorator('$rootScope', angular.mock.$RootScopeDecorator); - $provide.decorator('$controller', angular.mock.$ControllerDecorator); -}]); - -/** - * @ngdoc module - * @name ngMockE2E - * @module ngMockE2E - * @packageName angular-mocks - * @description - * - * The `ngMockE2E` is an angular module which contains mocks suitable for end-to-end testing. - * Currently there is only one mock present in this module - - * the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock. - */ -angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) { - $provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator); -}]); - -/** - * @ngdoc service - * @name $httpBackend - * @module ngMockE2E - * @description - * Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of - * applications that use the {@link ng.$http $http service}. - * - * *Note*: For fake http backend implementation suitable for unit testing please see - * {@link ngMock.$httpBackend unit-testing $httpBackend mock}. - * - * This implementation can be used to respond with static or dynamic responses via the `when` api - * and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the - * real $httpBackend for specific requests (e.g. to interact with certain remote apis or to fetch - * templates from a webserver). - * - * As opposed to unit-testing, in an end-to-end testing scenario or in scenario when an application - * is being developed with the real backend api replaced with a mock, it is often desirable for - * certain category of requests to bypass the mock and issue a real http request (e.g. to fetch - * templates or static files from the webserver). To configure the backend with this behavior - * use the `passThrough` request handler of `when` instead of `respond`. - * - * Additionally, we don't want to manually have to flush mocked out requests like we do during unit - * testing. For this reason the e2e $httpBackend flushes mocked out requests - * automatically, closely simulating the behavior of the XMLHttpRequest object. - * - * To setup the application to run with this http backend, you have to create a module that depends - * on the `ngMockE2E` and your application modules and defines the fake backend: - * - * ```js - * myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']); - * myAppDev.run(function($httpBackend) { - * phones = [{name: 'phone1'}, {name: 'phone2'}]; - * - * // returns the current list of phones - * $httpBackend.whenGET('/phones').respond(phones); - * - * // adds a new phone to the phones array - * $httpBackend.whenPOST('/phones').respond(function(method, url, data) { - * var phone = angular.fromJson(data); - * phones.push(phone); - * return [200, phone, {}]; - * }); - * $httpBackend.whenGET(/^\/templates\//).passThrough(); - * //... - * }); - * ``` - * - * Afterwards, bootstrap your app with this new module. - */ - -/** - * @ngdoc method - * @name $httpBackend#when - * @module ngMockE2E - * @description - * Creates a new backend definition. - * - * @param {string} method HTTP method. - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header - * object and returns true if the headers match the current definition. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - * - * - respond – - * `{function([status,] data[, headers, statusText]) - * | function(function(method, url, data, headers, params)}` - * – The respond method takes a set of static data to be returned or a function that can return - * an array containing response status (number), response data (string), response headers - * (Object), and the text for the status (string). - * - passThrough – `{function()}` – Any request matching a backend definition with - * `passThrough` handler will be passed through to the real backend (an XHR request will be made - * to the server.) - * - Both methods return the `requestHandler` object for possible overrides. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenGET - * @module ngMockE2E - * @description - * Creates a new backend definition for GET requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenHEAD - * @module ngMockE2E - * @description - * Creates a new backend definition for HEAD requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenDELETE - * @module ngMockE2E - * @description - * Creates a new backend definition for DELETE requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenPOST - * @module ngMockE2E - * @description - * Creates a new backend definition for POST requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenPUT - * @module ngMockE2E - * @description - * Creates a new backend definition for PUT requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenPATCH - * @module ngMockE2E - * @description - * Creates a new backend definition for PATCH requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ - -/** - * @ngdoc method - * @name $httpBackend#whenJSONP - * @module ngMockE2E - * @description - * Creates a new backend definition for JSONP requests. For more info see `when()`. - * - * @param {string|RegExp|function(string)} url HTTP url or function that receives a url - * and returns true if the url matches the current definition. - * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on - * {@link ngMock.$httpBackend $httpBackend mock}. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ -/** - * @ngdoc method - * @name $httpBackend#whenRoute - * @module ngMockE2E - * @description - * Creates a new backend definition that compares only with the requested route. - * - * @param {string} method HTTP method. - * @param {string} url HTTP url string that supports colon param matching. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. You can save this object for later use and invoke - * `respond` or `passThrough` again in order to change how a matched request is handled. - */ -angular.mock.e2e = {}; -angular.mock.e2e.$httpBackendDecorator = - ['$rootScope', '$timeout', '$delegate', '$browser', createHttpBackendMock]; - - -/** - * @ngdoc type - * @name $rootScope.Scope - * @module ngMock - * @description - * {@link ng.$rootScope.Scope Scope} type decorated with helper methods useful for testing. These - * methods are automatically available on any {@link ng.$rootScope.Scope Scope} instance when - * `ngMock` module is loaded. - * - * In addition to all the regular `Scope` methods, the following helper methods are available: - */ -angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) { - - var $rootScopePrototype = Object.getPrototypeOf($delegate); - - $rootScopePrototype.$countChildScopes = countChildScopes; - $rootScopePrototype.$countWatchers = countWatchers; - - return $delegate; - - // ------------------------------------------------------------------------------------------ // - - /** - * @ngdoc method - * @name $rootScope.Scope#$countChildScopes - * @module ngMock - * @description - * Counts all the direct and indirect child scopes of the current scope. - * - * The current scope is excluded from the count. The count includes all isolate child scopes. - * - * @returns {number} Total number of child scopes. - */ - function countChildScopes() { - // jshint validthis: true - var count = 0; // exclude the current scope - var pendingChildHeads = [this.$$childHead]; - var currentScope; - - while (pendingChildHeads.length) { - currentScope = pendingChildHeads.shift(); - - while (currentScope) { - count += 1; - pendingChildHeads.push(currentScope.$$childHead); - currentScope = currentScope.$$nextSibling; - } - } - - return count; - } - - - /** - * @ngdoc method - * @name $rootScope.Scope#$countWatchers - * @module ngMock - * @description - * Counts all the watchers of direct and indirect child scopes of the current scope. - * - * The watchers of the current scope are included in the count and so are all the watchers of - * isolate child scopes. - * - * @returns {number} Total number of watchers. - */ - function countWatchers() { - // jshint validthis: true - var count = this.$$watchers ? this.$$watchers.length : 0; // include the current scope - var pendingChildHeads = [this.$$childHead]; - var currentScope; - - while (pendingChildHeads.length) { - currentScope = pendingChildHeads.shift(); - - while (currentScope) { - count += currentScope.$$watchers ? currentScope.$$watchers.length : 0; - pendingChildHeads.push(currentScope.$$childHead); - currentScope = currentScope.$$nextSibling; - } - } - - return count; - } -}]; - - -if (window.jasmine || window.mocha) { - - var currentSpec = null, - annotatedFunctions = [], - isSpecRunning = function() { - return !!currentSpec; - }; - - angular.mock.$$annotate = angular.injector.$$annotate; - angular.injector.$$annotate = function(fn) { - if (typeof fn === 'function' && !fn.$inject) { - annotatedFunctions.push(fn); - } - return angular.mock.$$annotate.apply(this, arguments); - }; - - - (window.beforeEach || window.setup)(function() { - annotatedFunctions = []; - currentSpec = this; - }); - - (window.afterEach || window.teardown)(function() { - var injector = currentSpec.$injector; - - annotatedFunctions.forEach(function(fn) { - delete fn.$inject; - }); - - angular.forEach(currentSpec.$modules, function(module) { - if (module && module.$$hashKey) { - module.$$hashKey = undefined; - } - }); - - currentSpec.$injector = null; - currentSpec.$modules = null; - currentSpec.$providerInjector = null; - currentSpec = null; - - if (injector) { - injector.get('$rootElement').off(); - injector.get('$rootScope').$destroy(); - } - - // clean up jquery's fragment cache - angular.forEach(angular.element.fragments, function(val, key) { - delete angular.element.fragments[key]; - }); - - MockXhr.$$lastInstance = null; - - angular.forEach(angular.callbacks, function(val, key) { - delete angular.callbacks[key]; - }); - angular.callbacks.counter = 0; - }); - - /** - * @ngdoc function - * @name angular.mock.module - * @description - * - * *NOTE*: This function is also published on window for easy access.
    - * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha - * - * This function registers a module configuration code. It collects the configuration information - * which will be used when the injector is created by {@link angular.mock.inject inject}. - * - * See {@link angular.mock.inject inject} for usage example - * - * @param {...(string|Function|Object)} fns any number of modules which are represented as string - * aliases or as anonymous module initialization functions. The modules are used to - * configure the injector. The 'ng' and 'ngMock' modules are automatically loaded. If an - * object literal is passed each key-value pair will be registered on the module via - * {@link auto.$provide $provide}.value, the key being the string name (or token) to associate - * with the value on the injector. - */ - window.module = angular.mock.module = function() { - var moduleFns = Array.prototype.slice.call(arguments, 0); - return isSpecRunning() ? workFn() : workFn; - ///////////////////// - function workFn() { - if (currentSpec.$injector) { - throw new Error('Injector already created, can not register a module!'); - } else { - var fn, modules = currentSpec.$modules || (currentSpec.$modules = []); - angular.forEach(moduleFns, function(module) { - if (angular.isObject(module) && !angular.isArray(module)) { - fn = function($provide) { - angular.forEach(module, function(value, key) { - $provide.value(key, value); - }); - }; - } else { - fn = module; - } - if (currentSpec.$providerInjector) { - currentSpec.$providerInjector.invoke(fn); - } else { - modules.push(fn); - } - }); - } - } - }; - - /** - * @ngdoc function - * @name angular.mock.inject - * @description - * - * *NOTE*: This function is also published on window for easy access.
    - * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha - * - * The inject function wraps a function into an injectable function. The inject() creates new - * instance of {@link auto.$injector $injector} per test, which is then used for - * resolving references. - * - * - * ## Resolving References (Underscore Wrapping) - * Often, we would like to inject a reference once, in a `beforeEach()` block and reuse this - * in multiple `it()` clauses. To be able to do this we must assign the reference to a variable - * that is declared in the scope of the `describe()` block. Since we would, most likely, want - * the variable to have the same name of the reference we have a problem, since the parameter - * to the `inject()` function would hide the outer variable. - * - * To help with this, the injected parameters can, optionally, be enclosed with underscores. - * These are ignored by the injector when the reference name is resolved. - * - * For example, the parameter `_myService_` would be resolved as the reference `myService`. - * Since it is available in the function body as _myService_, we can then assign it to a variable - * defined in an outer scope. - * - * ``` - * // Defined out reference variable outside - * var myService; - * - * // Wrap the parameter in underscores - * beforeEach( inject( function(_myService_){ - * myService = _myService_; - * })); - * - * // Use myService in a series of tests. - * it('makes use of myService', function() { - * myService.doStuff(); - * }); - * - * ``` - * - * See also {@link angular.mock.module angular.mock.module} - * - * ## Example - * Example of what a typical jasmine tests looks like with the inject method. - * ```js - * - * angular.module('myApplicationModule', []) - * .value('mode', 'app') - * .value('version', 'v1.0.1'); - * - * - * describe('MyApp', function() { - * - * // You need to load modules that you want to test, - * // it loads only the "ng" module by default. - * beforeEach(module('myApplicationModule')); - * - * - * // inject() is used to inject arguments of all given functions - * it('should provide a version', inject(function(mode, version) { - * expect(version).toEqual('v1.0.1'); - * expect(mode).toEqual('app'); - * })); - * - * - * // The inject and module method can also be used inside of the it or beforeEach - * it('should override a version and test the new version is injected', function() { - * // module() takes functions or strings (module aliases) - * module(function($provide) { - * $provide.value('version', 'overridden'); // override version here - * }); - * - * inject(function(version) { - * expect(version).toEqual('overridden'); - * }); - * }); - * }); - * - * ``` - * - * @param {...Function} fns any number of functions which will be injected using the injector. - */ - - - - var ErrorAddingDeclarationLocationStack = function(e, errorForStack) { - this.message = e.message; - this.name = e.name; - if (e.line) this.line = e.line; - if (e.sourceId) this.sourceId = e.sourceId; - if (e.stack && errorForStack) - this.stack = e.stack + '\n' + errorForStack.stack; - if (e.stackArray) this.stackArray = e.stackArray; - }; - ErrorAddingDeclarationLocationStack.prototype.toString = Error.prototype.toString; - - window.inject = angular.mock.inject = function() { - var blockFns = Array.prototype.slice.call(arguments, 0); - var errorForStack = new Error('Declaration Location'); - return isSpecRunning() ? workFn.call(currentSpec) : workFn; - ///////////////////// - function workFn() { - var modules = currentSpec.$modules || []; - var strictDi = !!currentSpec.$injectorStrict; - modules.unshift(function($injector) { - currentSpec.$providerInjector = $injector; - }); - modules.unshift('ngMock'); - modules.unshift('ng'); - var injector = currentSpec.$injector; - if (!injector) { - if (strictDi) { - // If strictDi is enabled, annotate the providerInjector blocks - angular.forEach(modules, function(moduleFn) { - if (typeof moduleFn === "function") { - angular.injector.$$annotate(moduleFn); - } - }); - } - injector = currentSpec.$injector = angular.injector(modules, strictDi); - currentSpec.$injectorStrict = strictDi; - } - for (var i = 0, ii = blockFns.length; i < ii; i++) { - if (currentSpec.$injectorStrict) { - // If the injector is strict / strictDi, and the spec wants to inject using automatic - // annotation, then annotate the function here. - injector.annotate(blockFns[i]); - } - try { - /* jshint -W040 *//* Jasmine explicitly provides a `this` object when calling functions */ - injector.invoke(blockFns[i] || angular.noop, this); - /* jshint +W040 */ - } catch (e) { - if (e.stack && errorForStack) { - throw new ErrorAddingDeclarationLocationStack(e, errorForStack); - } - throw e; - } finally { - errorForStack = null; - } - } - } - }; - - - angular.mock.inject.strictDi = function(value) { - value = arguments.length ? !!value : true; - return isSpecRunning() ? workFn() : workFn; - - function workFn() { - if (value !== currentSpec.$injectorStrict) { - if (currentSpec.$injector) { - throw new Error('Injector already created, can not modify strict annotations'); - } else { - currentSpec.$injectorStrict = value; - } - } - } - }; -} - - -})(window, window.angular); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-resource.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-resource.js deleted file mode 100644 index 444be83c4..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-resource.js +++ /dev/null @@ -1,768 +0,0 @@ -/** - * @license AngularJS v1.5.0 - * (c) 2010-2016 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular, undefined) {'use strict'; - -var $resourceMinErr = angular.$$minErr('$resource'); - -// Helper functions and regex to lookup a dotted path on an object -// stopping at undefined/null. The path must be composed of ASCII -// identifiers (just like $parse) -var MEMBER_NAME_REGEX = /^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/; - -function isValidDottedPath(path) { - return (path != null && path !== '' && path !== 'hasOwnProperty' && - MEMBER_NAME_REGEX.test('.' + path)); -} - -function lookupDottedPath(obj, path) { - if (!isValidDottedPath(path)) { - throw $resourceMinErr('badmember', 'Dotted member path "@{0}" is invalid.', path); - } - var keys = path.split('.'); - for (var i = 0, ii = keys.length; i < ii && angular.isDefined(obj); i++) { - var key = keys[i]; - obj = (obj !== null) ? obj[key] : undefined; - } - return obj; -} - -/** - * Create a shallow copy of an object and clear other fields from the destination - */ -function shallowClearAndCopy(src, dst) { - dst = dst || {}; - - angular.forEach(dst, function(value, key) { - delete dst[key]; - }); - - for (var key in src) { - if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) { - dst[key] = src[key]; - } - } - - return dst; -} - -/** - * @ngdoc module - * @name ngResource - * @description - * - * # ngResource - * - * The `ngResource` module provides interaction support with RESTful services - * via the $resource service. - * - * - *
    - * - * See {@link ngResource.$resource `$resource`} for usage. - */ - -/** - * @ngdoc service - * @name $resource - * @requires $http - * @requires ng.$log - * @requires $q - * @requires ng.$timeout - * - * @description - * A factory which creates a resource object that lets you interact with - * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources. - * - * The returned resource object has action methods which provide high-level behaviors without - * the need to interact with the low level {@link ng.$http $http} service. - * - * Requires the {@link ngResource `ngResource`} module to be installed. - * - * By default, trailing slashes will be stripped from the calculated URLs, - * which can pose problems with server backends that do not expect that - * behavior. This can be disabled by configuring the `$resourceProvider` like - * this: - * - * ```js - app.config(['$resourceProvider', function($resourceProvider) { - // Don't strip trailing slashes from calculated URLs - $resourceProvider.defaults.stripTrailingSlashes = false; - }]); - * ``` - * - * @param {string} url A parameterized URL template with parameters prefixed by `:` as in - * `/user/:username`. If you are using a URL with a port number (e.g. - * `http://example.com:8080/api`), it will be respected. - * - * If you are using a url with a suffix, just add the suffix, like this: - * `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')` - * or even `$resource('http://example.com/resource/:resource_id.:format')` - * If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be - * collapsed down to a single `.`. If you need this sequence to appear and not collapse then you - * can escape it with `/\.`. - * - * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in - * `actions` methods. If a parameter value is a function, it will be executed every time - * when a param value needs to be obtained for a request (unless the param was overridden). - * - * Each key value in the parameter object is first bound to url template if present and then any - * excess keys are appended to the url search query after the `?`. - * - * Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in - * URL `/path/greet?salutation=Hello`. - * - * If the parameter value is prefixed with `@` then the value for that parameter will be extracted - * from the corresponding property on the `data` object (provided when calling an action method). - * For example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of - * `someParam` will be `data.someProp`. - * - * @param {Object.=} actions Hash with declaration of custom actions that should extend - * the default set of resource actions. The declaration should be created in the format of {@link - * ng.$http#usage $http.config}: - * - * {action1: {method:?, params:?, isArray:?, headers:?, ...}, - * action2: {method:?, params:?, isArray:?, headers:?, ...}, - * ...} - * - * Where: - * - * - **`action`** – {string} – The name of action. This name becomes the name of the method on - * your resource object. - * - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`, - * `DELETE`, `JSONP`, etc). - * - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of - * the parameter value is a function, it will be executed every time when a param value needs to - * be obtained for a request (unless the param was overridden). - * - **`url`** – {string} – action specific `url` override. The url templating is supported just - * like for the resource-level urls. - * - **`isArray`** – {boolean=} – If true then the returned object for this action is an array, - * see `returns` section. - * - **`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. - * By default, transformRequest will contain one function that checks if the request data is - * an object and serializes to using `angular.toJson`. To prevent this behavior, set - * `transformRequest` to an empty array: `transformRequest: []` - * - **`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. - * By default, transformResponse will contain one function that checks if the response looks - * like a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, - * set `transformResponse` to an empty array: `transformResponse: []` - * - **`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}` – timeout in milliseconds.
    - * **Note:** In contrast to {@link ng.$http#usage $http.config}, {@link ng.$q promises} are - * **not** supported in $resource, because the same value would be used for multiple requests. - * If you are looking for a way to cancel requests, you should use the `cancellable` option. - * - **`cancellable`** – `{boolean}` – if set to true, the request made by a "non-instance" call - * will be cancelled (if not already completed) by calling `$cancelRequest()` on the call's - * return value. Calling `$cancelRequest()` for a non-cancellable or an already - * completed/cancelled request will have no effect.
    - * - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the - * XHR object. See - * [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5) - * for more information. - * - **`responseType`** - `{string}` - see - * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType). - * - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods - - * `response` and `responseError`. Both `response` and `responseError` interceptors get called - * with `http response` object. See {@link ng.$http $http interceptors}. - * - * @param {Object} options Hash with custom settings that should extend the - * default `$resourceProvider` behavior. The supported options are: - * - * - **`stripTrailingSlashes`** – {boolean} – If true then the trailing - * slashes from any calculated URL will be stripped. (Defaults to true.) - * - **`cancellable`** – {boolean} – If true, the request made by a "non-instance" call will be - * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return value. - * This can be overwritten per action. (Defaults to false.) - * - * @returns {Object} A resource "class" object with methods for the default set of resource actions - * optionally extended with custom `actions`. The default set contains these actions: - * ```js - * { 'get': {method:'GET'}, - * 'save': {method:'POST'}, - * 'query': {method:'GET', isArray:true}, - * 'remove': {method:'DELETE'}, - * 'delete': {method:'DELETE'} }; - * ``` - * - * Calling these methods invoke an {@link ng.$http} with the specified http method, - * destination and parameters. When the data is returned from the server then the object is an - * instance of the resource class. The actions `save`, `remove` and `delete` are available on it - * as methods with the `$` prefix. This allows you to easily perform CRUD operations (create, - * read, update, delete) on server-side data like this: - * ```js - * var User = $resource('/user/:userId', {userId:'@id'}); - * var user = User.get({userId:123}, function() { - * user.abc = true; - * user.$save(); - * }); - * ``` - * - * It is important to realize that invoking a $resource object method immediately returns an - * empty reference (object or array depending on `isArray`). Once the data is returned from the - * server the existing reference is populated with the actual data. This is a useful trick since - * usually the resource is assigned to a model which is then rendered by the view. Having an empty - * object results in no rendering, once the data arrives from the server then the object is - * populated with the data and the view automatically re-renders itself showing the new data. This - * means that in most cases one never has to write a callback function for the action methods. - * - * The action methods on the class object or instance object can be invoked with the following - * parameters: - * - * - HTTP GET "class" actions: `Resource.action([parameters], [success], [error])` - * - non-GET "class" actions: `Resource.action([parameters], postData, [success], [error])` - * - non-GET instance actions: `instance.$action([parameters], [success], [error])` - * - * - * Success callback is called with (value, responseHeaders) arguments, where the value is - * the populated resource instance or collection object. The error callback is called - * with (httpResponse) argument. - * - * Class actions return empty instance (with additional properties below). - * Instance actions return promise of the action. - * - * The Resource instances and collections have these additional properties: - * - * - `$promise`: the {@link ng.$q promise} of the original server interaction that created this - * instance or collection. - * - * On success, the promise is resolved with the same resource instance or collection object, - * updated with data from server. This makes it easy to use in - * {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view - * rendering until the resource(s) are loaded. - * - * On failure, the promise is rejected with the {@link ng.$http http response} object, without - * the `resource` property. - * - * If an interceptor object was provided, the promise will instead be resolved with the value - * returned by the interceptor. - * - * - `$resolved`: `true` after first server interaction is completed (either with success or - * rejection), `false` before that. Knowing if the Resource has been resolved is useful in - * data-binding. - * - * The Resource instances and collections have these additional methods: - * - * - `$cancelRequest`: If there is a cancellable, pending request related to the instance or - * collection, calling this method will abort the request. - * - * @example - * - * # Credit card resource - * - * ```js - // Define CreditCard class - var CreditCard = $resource('/user/:userId/card/:cardId', - {userId:123, cardId:'@id'}, { - charge: {method:'POST', params:{charge:true}} - }); - - // We can retrieve a collection from the server - var cards = CreditCard.query(function() { - // GET: /user/123/card - // server returns: [ {id:456, number:'1234', name:'Smith'} ]; - - var card = cards[0]; - // each item is an instance of CreditCard - expect(card instanceof CreditCard).toEqual(true); - card.name = "J. Smith"; - // non GET methods are mapped onto the instances - card.$save(); - // POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'} - // server returns: {id:456, number:'1234', name: 'J. Smith'}; - - // our custom method is mapped as well. - card.$charge({amount:9.99}); - // POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'} - }); - - // we can create an instance as well - var newCard = new CreditCard({number:'0123'}); - newCard.name = "Mike Smith"; - newCard.$save(); - // POST: /user/123/card {number:'0123', name:'Mike Smith'} - // server returns: {id:789, number:'0123', name: 'Mike Smith'}; - expect(newCard.id).toEqual(789); - * ``` - * - * The object returned from this function execution is a resource "class" which has "static" method - * for each action in the definition. - * - * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and - * `headers`. - * - * @example - * - * # User resource - * - * When the data is returned from the server then the object is an instance of the resource type and - * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD - * operations (create, read, update, delete) on server-side data. - - ```js - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}, function(user) { - user.abc = true; - user.$save(); - }); - ``` - * - * It's worth noting that the success callback for `get`, `query` and other methods gets passed - * in the response that came from the server as well as $http header getter function, so one - * could rewrite the above example and get access to http headers as: - * - ```js - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}, function(user, getResponseHeaders){ - user.abc = true; - user.$save(function(user, putResponseHeaders) { - //user => saved user object - //putResponseHeaders => $http header getter - }); - }); - ``` - * - * You can also access the raw `$http` promise via the `$promise` property on the object returned - * - ``` - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}) - .$promise.then(function(user) { - $scope.user = user; - }); - ``` - * - * @example - * - * # Creating a custom 'PUT' request - * - * In this example we create a custom method on our resource to make a PUT request - * ```js - * var app = angular.module('app', ['ngResource', 'ngRoute']); - * - * // Some APIs expect a PUT request in the format URL/object/ID - * // Here we are creating an 'update' method - * app.factory('Notes', ['$resource', function($resource) { - * return $resource('/notes/:id', null, - * { - * 'update': { method:'PUT' } - * }); - * }]); - * - * // In our controller we get the ID from the URL using ngRoute and $routeParams - * // We pass in $routeParams and our Notes factory along with $scope - * app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes', - function($scope, $routeParams, Notes) { - * // First get a note object from the factory - * var note = Notes.get({ id:$routeParams.id }); - * $id = note.id; - * - * // Now call update passing in the ID first then the object you are updating - * Notes.update({ id:$id }, note); - * - * // This will PUT /notes/ID with the note object in the request payload - * }]); - * ``` - * - * @example - * - * # Cancelling requests - * - * If an action's configuration specifies that it is cancellable, you can cancel the request related - * to an instance or collection (as long as it is a result of a "non-instance" call): - * - ```js - // ...defining the `Hotel` resource... - var Hotel = $resource('/api/hotel/:id', {id: '@id'}, { - // Let's make the `query()` method cancellable - query: {method: 'get', isArray: true, cancellable: true} - }); - - // ...somewhere in the PlanVacationController... - ... - this.onDestinationChanged = function onDestinationChanged(destination) { - // We don't care about any pending request for hotels - // in a different destination any more - this.availableHotels.$cancelRequest(); - - // Let's query for hotels in '' - // (calls: /api/hotel?location=) - this.availableHotels = Hotel.query({location: destination}); - }; - ``` - * - */ -angular.module('ngResource', ['ng']). - provider('$resource', function() { - var PROTOCOL_AND_DOMAIN_REGEX = /^https?:\/\/[^\/]*/; - var provider = this; - - this.defaults = { - // Strip slashes by default - stripTrailingSlashes: true, - - // Default actions configuration - actions: { - 'get': {method: 'GET'}, - 'save': {method: 'POST'}, - 'query': {method: 'GET', isArray: true}, - 'remove': {method: 'DELETE'}, - 'delete': {method: 'DELETE'} - } - }; - - this.$get = ['$http', '$log', '$q', '$timeout', function($http, $log, $q, $timeout) { - - var noop = angular.noop, - forEach = angular.forEach, - extend = angular.extend, - copy = angular.copy, - isFunction = angular.isFunction; - - /** - * 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' : '+')); - } - - function Route(template, defaults) { - this.template = template; - this.defaults = extend({}, provider.defaults, defaults); - this.urlParams = {}; - } - - Route.prototype = { - setUrlParams: function(config, params, actionUrl) { - var self = this, - url = actionUrl || self.template, - val, - encodedVal, - protocolAndDomain = ''; - - var urlParams = self.urlParams = {}; - forEach(url.split(/\W/), function(param) { - if (param === 'hasOwnProperty') { - throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name."); - } - if (!(new RegExp("^\\d+$").test(param)) && param && - (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) { - urlParams[param] = { - isQueryParamValue: (new RegExp("\\?.*=:" + param + "(?:\\W|$)")).test(url) - }; - } - }); - url = url.replace(/\\:/g, ':'); - url = url.replace(PROTOCOL_AND_DOMAIN_REGEX, function(match) { - protocolAndDomain = match; - return ''; - }); - - params = params || {}; - forEach(self.urlParams, function(paramInfo, urlParam) { - val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam]; - if (angular.isDefined(val) && val !== null) { - if (paramInfo.isQueryParamValue) { - encodedVal = encodeUriQuery(val, true); - } else { - encodedVal = encodeUriSegment(val); - } - url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) { - return encodedVal + p1; - }); - } else { - url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match, - leadingSlashes, tail) { - if (tail.charAt(0) == '/') { - return tail; - } else { - return leadingSlashes + tail; - } - }); - } - }); - - // strip trailing slashes and set the url (unless this behavior is specifically disabled) - if (self.defaults.stripTrailingSlashes) { - url = url.replace(/\/+$/, '') || '/'; - } - - // then replace collapse `/.` if found in the last URL path segment before the query - // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x` - url = url.replace(/\/\.(?=\w+($|\?))/, '.'); - // replace escaped `/\.` with `/.` - config.url = protocolAndDomain + url.replace(/\/\\\./, '/.'); - - - // set params - delegate param encoding to $http - forEach(params, function(value, key) { - if (!self.urlParams[key]) { - config.params = config.params || {}; - config.params[key] = value; - } - }); - } - }; - - - function resourceFactory(url, paramDefaults, actions, options) { - var route = new Route(url, options); - - actions = extend({}, provider.defaults.actions, actions); - - function extractParams(data, actionParams) { - var ids = {}; - actionParams = extend({}, paramDefaults, actionParams); - forEach(actionParams, function(value, key) { - if (isFunction(value)) { value = value(); } - ids[key] = value && value.charAt && value.charAt(0) == '@' ? - lookupDottedPath(data, value.substr(1)) : value; - }); - return ids; - } - - function defaultResponseInterceptor(response) { - return response.resource; - } - - function Resource(value) { - shallowClearAndCopy(value || {}, this); - } - - Resource.prototype.toJSON = function() { - var data = extend({}, this); - delete data.$promise; - delete data.$resolved; - return data; - }; - - forEach(actions, function(action, name) { - var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method); - var numericTimeout = action.timeout; - var cancellable = angular.isDefined(action.cancellable) ? action.cancellable : - (options && angular.isDefined(options.cancellable)) ? options.cancellable : - provider.defaults.cancellable; - - if (numericTimeout && !angular.isNumber(numericTimeout)) { - $log.debug('ngResource:\n' + - ' Only numeric values are allowed as `timeout`.\n' + - ' Promises are not supported in $resource, because the same value would ' + - 'be used for multiple requests. If you are looking for a way to cancel ' + - 'requests, you should use the `cancellable` option.'); - delete action.timeout; - numericTimeout = null; - } - - Resource[name] = function(a1, a2, a3, a4) { - var params = {}, data, success, error; - - /* jshint -W086 */ /* (purposefully fall through case statements) */ - switch (arguments.length) { - case 4: - error = a4; - success = a3; - //fallthrough - case 3: - case 2: - if (isFunction(a2)) { - if (isFunction(a1)) { - success = a1; - error = a2; - break; - } - - success = a2; - error = a3; - //fallthrough - } else { - params = a1; - data = a2; - success = a3; - break; - } - case 1: - if (isFunction(a1)) success = a1; - else if (hasBody) data = a1; - else params = a1; - break; - case 0: break; - default: - throw $resourceMinErr('badargs', - "Expected up to 4 arguments [params, data, success, error], got {0} arguments", - arguments.length); - } - /* jshint +W086 */ /* (purposefully fall through case statements) */ - - var isInstanceCall = this instanceof Resource; - var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data)); - var httpConfig = {}; - var responseInterceptor = action.interceptor && action.interceptor.response || - defaultResponseInterceptor; - var responseErrorInterceptor = action.interceptor && action.interceptor.responseError || - undefined; - var timeoutDeferred; - var numericTimeoutPromise; - - forEach(action, function(value, key) { - switch (key) { - default: - httpConfig[key] = copy(value); - break; - case 'params': - case 'isArray': - case 'interceptor': - case 'cancellable': - break; - } - }); - - if (!isInstanceCall && cancellable) { - timeoutDeferred = $q.defer(); - httpConfig.timeout = timeoutDeferred.promise; - - if (numericTimeout) { - numericTimeoutPromise = $timeout(timeoutDeferred.resolve, numericTimeout); - } - } - - if (hasBody) httpConfig.data = data; - route.setUrlParams(httpConfig, - extend({}, extractParams(data, action.params || {}), params), - action.url); - - var promise = $http(httpConfig).then(function(response) { - var data = response.data; - - if (data) { - // Need to convert action.isArray to boolean in case it is undefined - // jshint -W018 - if (angular.isArray(data) !== (!!action.isArray)) { - throw $resourceMinErr('badcfg', - 'Error in resource configuration for action `{0}`. Expected response to ' + - 'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object', - angular.isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url); - } - // jshint +W018 - if (action.isArray) { - value.length = 0; - forEach(data, function(item) { - if (typeof item === "object") { - value.push(new Resource(item)); - } else { - // Valid JSON values may be string literals, and these should not be converted - // into objects. These items will not have access to the Resource prototype - // methods, but unfortunately there - value.push(item); - } - }); - } else { - var promise = value.$promise; // Save the promise - shallowClearAndCopy(data, value); - value.$promise = promise; // Restore the promise - } - } - response.resource = value; - - return response; - }, function(response) { - (error || noop)(response); - return $q.reject(response); - }); - - promise.finally(function() { - value.$resolved = true; - if (!isInstanceCall && cancellable) { - value.$cancelRequest = angular.noop; - $timeout.cancel(numericTimeoutPromise); - timeoutDeferred = numericTimeoutPromise = httpConfig.timeout = null; - } - }); - - promise = promise.then( - function(response) { - var value = responseInterceptor(response); - (success || noop)(value, response.headers); - return value; - }, - responseErrorInterceptor); - - if (!isInstanceCall) { - // we are creating instance / collection - // - set the initial promise - // - return the instance / collection - value.$promise = promise; - value.$resolved = false; - if (cancellable) value.$cancelRequest = timeoutDeferred.resolve; - - return value; - } - - // instance call - return promise; - }; - - - Resource.prototype['$' + name] = function(params, success, error) { - if (isFunction(params)) { - error = success; success = params; params = {}; - } - var result = Resource[name].call(this, params, this, success, error); - return result.$promise || result; - }; - }); - - Resource.bind = function(additionalParamDefaults) { - return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions); - }; - - return Resource; - } - - return resourceFactory; - }]; - }); - - -})(window, window.angular); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-resource.min.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-resource.min.js deleted file mode 100644 index 306657dcb..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-resource.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - AngularJS v1.5.0 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(Q,d,G){'use strict';function H(t,g){g=g||{};d.forEach(g,function(d,q){delete g[q]});for(var q in t)!t.hasOwnProperty(q)||"$"===q.charAt(0)&&"$"===q.charAt(1)||(g[q]=t[q]);return g}var z=d.$$minErr("$resource"),N=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;d.module("ngResource",["ng"]).provider("$resource",function(){var t=/^https?:\/\/[^\/]*/,g=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}}; -this.$get=["$http","$log","$q","$timeout",function(q,M,I,J){function A(d,h){return encodeURIComponent(d).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,h?"%20":"+")}function B(d,h){this.template=d;this.defaults=v({},g.defaults,h);this.urlParams={}}function K(e,h,n,k){function c(a,b){var c={};b=v({},h,b);u(b,function(b,h){x(b)&&(b=b());var f;if(b&&b.charAt&&"@"==b.charAt(0)){f=a;var l=b.substr(1);if(null==l||""===l||"hasOwnProperty"===l||!N.test("."+ -l))throw z("badmember",l);for(var l=l.split("."),m=0,k=l.length;m - */ - /* global -ngRouteModule */ -var ngRouteModule = angular.module('ngRoute', ['ng']). - provider('$route', $RouteProvider), - $routeMinErr = angular.$$minErr('ngRoute'); - -/** - * @ngdoc provider - * @name $routeProvider - * - * @description - * - * Used for configuring routes. - * - * ## Example - * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`. - * - * ## Dependencies - * Requires the {@link ngRoute `ngRoute`} module to be installed. - */ -function $RouteProvider() { - function inherit(parent, extra) { - return angular.extend(Object.create(parent), extra); - } - - var routes = {}; - - /** - * @ngdoc method - * @name $routeProvider#when - * - * @param {string} path Route path (matched against `$location.path`). If `$location.path` - * contains redundant trailing slash or is missing one, the route will still match and the - * `$location.path` will be updated to add or drop the trailing slash to exactly match the - * route definition. - * - * * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up - * to the next slash are matched and stored in `$routeParams` under the given `name` - * when the route matches. - * * `path` can contain named groups starting with a colon and ending with a star: - * e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name` - * when the route matches. - * * `path` can contain optional named groups with a question mark: e.g.`:name?`. - * - * For example, routes like `/color/:color/largecode/:largecode*\/edit` will match - * `/color/brown/largecode/code/with/slashes/edit` and extract: - * - * * `color: brown` - * * `largecode: code/with/slashes`. - * - * - * @param {Object} route Mapping information to be assigned to `$route.current` on route - * match. - * - * Object properties: - * - * - `controller` – `{(string|function()=}` – Controller fn that should be associated with - * newly created scope or the name of a {@link angular.Module#controller registered - * controller} if passed as a string. - * - `controllerAs` – `{string=}` – An identifier name for a reference to the controller. - * If present, the controller will be published to scope under the `controllerAs` name. - * - `template` – `{string=|function()=}` – html template as a string or a function that - * returns an html template as a string which should be used by {@link - * ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives. - * This property takes precedence over `templateUrl`. - * - * If `template` is a function, it will be called with the following parameters: - * - * - `{Array.}` - route parameters extracted from the current - * `$location.path()` by applying the current route - * - * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html - * template that should be used by {@link ngRoute.directive:ngView ngView}. - * - * If `templateUrl` is a function, it will be called with the following parameters: - * - * - `{Array.}` - route parameters extracted from the current - * `$location.path()` by applying the current route - * - * - `resolve` - `{Object.=}` - An optional map of dependencies which should - * be injected into the controller. If any of these dependencies are promises, the router - * will wait for them all to be resolved or one to be rejected before the controller is - * instantiated. - * If all the promises are resolved successfully, the values of the resolved promises are - * injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is - * fired. If any of the promises are rejected the - * {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. - * For easier access to the resolved dependencies from the template, the `resolve` map will - * be available on the scope of the route, under `$resolve` (by default) or a custom name - * specified by the `resolveAs` property (see below). This can be particularly useful, when - * working with {@link angular.Module#component components} as route templates.
    - *
    - * **Note:** If your scope already contains a property with this name, it will be hidden - * or overwritten. Make sure, you specify an appropriate name for this property, that - * does not collide with other properties on the scope. - *
    - * The map object is: - * - * - `key` – `{string}`: a name of a dependency to be injected into the controller. - * - `factory` - `{string|function}`: If `string` then it is an alias for a service. - * Otherwise if function, then it is {@link auto.$injector#invoke injected} - * and the return value is treated as the dependency. If the result is a promise, it is - * resolved before its value is injected into the controller. Be aware that - * `ngRoute.$routeParams` will still refer to the previous route within these resolve - * functions. Use `$route.current.params` to access the new route parameters, instead. - * - * - `resolveAs` - `{string=}` - The name under which the `resolve` map will be available on - * the scope of the route. If omitted, defaults to `$resolve`. - * - * - `redirectTo` – `{(string|function())=}` – value to update - * {@link ng.$location $location} path with and trigger route redirection. - * - * If `redirectTo` is a function, it will be called with the following parameters: - * - * - `{Object.}` - route parameters extracted from the current - * `$location.path()` by applying the current route templateUrl. - * - `{string}` - current `$location.path()` - * - `{Object}` - current `$location.search()` - * - * The custom `redirectTo` function is expected to return a string which will be used - * to update `$location.path()` and `$location.search()`. - * - * - `[reloadOnSearch=true]` - `{boolean=}` - reload route when only `$location.search()` - * or `$location.hash()` changes. - * - * If the option is set to `false` and url in the browser changes, then - * `$routeUpdate` event is broadcasted on the root scope. - * - * - `[caseInsensitiveMatch=false]` - `{boolean=}` - match routes without being case sensitive - * - * If the option is set to `true`, then the particular route can be matched without being - * case sensitive - * - * @returns {Object} self - * - * @description - * Adds a new route definition to the `$route` service. - */ - this.when = function(path, route) { - //copy original route object to preserve params inherited from proto chain - var routeCopy = angular.copy(route); - if (angular.isUndefined(routeCopy.reloadOnSearch)) { - routeCopy.reloadOnSearch = true; - } - if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) { - routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch; - } - routes[path] = angular.extend( - routeCopy, - path && pathRegExp(path, routeCopy) - ); - - // create redirection for trailing slashes - if (path) { - var redirectPath = (path[path.length - 1] == '/') - ? path.substr(0, path.length - 1) - : path + '/'; - - routes[redirectPath] = angular.extend( - {redirectTo: path}, - pathRegExp(redirectPath, routeCopy) - ); - } - - return this; - }; - - /** - * @ngdoc property - * @name $routeProvider#caseInsensitiveMatch - * @description - * - * A boolean property indicating if routes defined - * using this provider should be matched using a case insensitive - * algorithm. Defaults to `false`. - */ - this.caseInsensitiveMatch = false; - - /** - * @param path {string} path - * @param opts {Object} options - * @return {?Object} - * - * @description - * Normalizes the given path, returning a regular expression - * and the original path. - * - * Inspired by pathRexp in visionmedia/express/lib/utils.js. - */ - function pathRegExp(path, opts) { - var insensitive = opts.caseInsensitiveMatch, - ret = { - originalPath: path, - regexp: path - }, - keys = ret.keys = []; - - path = path - .replace(/([().])/g, '\\$1') - .replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option) { - var optional = option === '?' ? option : null; - var star = option === '*' ? option : null; - keys.push({ name: key, optional: !!optional }); - slash = slash || ''; - return '' - + (optional ? '' : slash) - + '(?:' - + (optional ? slash : '') - + (star && '(.+?)' || '([^/]+)') - + (optional || '') - + ')' - + (optional || ''); - }) - .replace(/([\/$\*])/g, '\\$1'); - - ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : ''); - return ret; - } - - /** - * @ngdoc method - * @name $routeProvider#otherwise - * - * @description - * Sets route definition that will be used on route change when no other route definition - * is matched. - * - * @param {Object|string} params Mapping information to be assigned to `$route.current`. - * If called with a string, the value maps to `redirectTo`. - * @returns {Object} self - */ - this.otherwise = function(params) { - if (typeof params === 'string') { - params = {redirectTo: params}; - } - this.when(null, params); - return this; - }; - - - this.$get = ['$rootScope', - '$location', - '$routeParams', - '$q', - '$injector', - '$templateRequest', - '$sce', - function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce) { - - /** - * @ngdoc service - * @name $route - * @requires $location - * @requires $routeParams - * - * @property {Object} current Reference to the current route definition. - * The route definition contains: - * - * - `controller`: The controller constructor as defined in the route definition. - * - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for - * controller instantiation. The `locals` contain - * the resolved values of the `resolve` map. Additionally the `locals` also contain: - * - * - `$scope` - The current route scope. - * - `$template` - The current route template HTML. - * - * The `locals` will be assigned to the route scope's `$resolve` property. You can override - * the property name, using `resolveAs` in the route definition. See - * {@link ngRoute.$routeProvider $routeProvider} for more info. - * - * @property {Object} routes Object with all route configuration Objects as its properties. - * - * @description - * `$route` is used for deep-linking URLs to controllers and views (HTML partials). - * It watches `$location.url()` and tries to map the path to an existing route definition. - * - * Requires the {@link ngRoute `ngRoute`} module to be installed. - * - * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API. - * - * The `$route` service is typically used in conjunction with the - * {@link ngRoute.directive:ngView `ngView`} directive and the - * {@link ngRoute.$routeParams `$routeParams`} service. - * - * @example - * This example shows how changing the URL hash causes the `$route` to match a route against the - * URL, and the `ngView` pulls in the partial. - * - * - * - *
    - * Choose: - * Moby | - * Moby: Ch1 | - * Gatsby | - * Gatsby: Ch4 | - * Scarlet Letter
    - * - *
    - * - *
    - * - *
    $location.path() = {{$location.path()}}
    - *
    $route.current.templateUrl = {{$route.current.templateUrl}}
    - *
    $route.current.params = {{$route.current.params}}
    - *
    $route.current.scope.name = {{$route.current.scope.name}}
    - *
    $routeParams = {{$routeParams}}
    - *
    - *
    - * - * - * controller: {{name}}
    - * Book Id: {{params.bookId}}
    - *
    - * - * - * controller: {{name}}
    - * Book Id: {{params.bookId}}
    - * Chapter Id: {{params.chapterId}} - *
    - * - * - * angular.module('ngRouteExample', ['ngRoute']) - * - * .controller('MainController', function($scope, $route, $routeParams, $location) { - * $scope.$route = $route; - * $scope.$location = $location; - * $scope.$routeParams = $routeParams; - * }) - * - * .controller('BookController', function($scope, $routeParams) { - * $scope.name = "BookController"; - * $scope.params = $routeParams; - * }) - * - * .controller('ChapterController', function($scope, $routeParams) { - * $scope.name = "ChapterController"; - * $scope.params = $routeParams; - * }) - * - * .config(function($routeProvider, $locationProvider) { - * $routeProvider - * .when('/Book/:bookId', { - * templateUrl: 'book.html', - * controller: 'BookController', - * resolve: { - * // I will cause a 1 second delay - * delay: function($q, $timeout) { - * var delay = $q.defer(); - * $timeout(delay.resolve, 1000); - * return delay.promise; - * } - * } - * }) - * .when('/Book/:bookId/ch/:chapterId', { - * templateUrl: 'chapter.html', - * controller: 'ChapterController' - * }); - * - * // configure html5 to get links working on jsfiddle - * $locationProvider.html5Mode(true); - * }); - * - * - * - * - * it('should load and compile correct template', function() { - * element(by.linkText('Moby: Ch1')).click(); - * var content = element(by.css('[ng-view]')).getText(); - * expect(content).toMatch(/controller\: ChapterController/); - * expect(content).toMatch(/Book Id\: Moby/); - * expect(content).toMatch(/Chapter Id\: 1/); - * - * element(by.partialLinkText('Scarlet')).click(); - * - * content = element(by.css('[ng-view]')).getText(); - * expect(content).toMatch(/controller\: BookController/); - * expect(content).toMatch(/Book Id\: Scarlet/); - * }); - * - *
    - */ - - /** - * @ngdoc event - * @name $route#$routeChangeStart - * @eventType broadcast on root scope - * @description - * Broadcasted before a route change. At this point the route services starts - * resolving all of the dependencies needed for the route change to occur. - * Typically this involves fetching the view template as well as any dependencies - * defined in `resolve` route property. Once all of the dependencies are resolved - * `$routeChangeSuccess` is fired. - * - * The route change (and the `$location` change that triggered it) can be prevented - * by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} - * for more details about event object. - * - * @param {Object} angularEvent Synthetic event object. - * @param {Route} next Future route information. - * @param {Route} current Current route information. - */ - - /** - * @ngdoc event - * @name $route#$routeChangeSuccess - * @eventType broadcast on root scope - * @description - * Broadcasted after a route change has happened successfully. - * The `resolve` dependencies are now available in the `current.locals` property. - * - * {@link ngRoute.directive:ngView ngView} listens for the directive - * to instantiate the controller and render the view. - * - * @param {Object} angularEvent Synthetic event object. - * @param {Route} current Current route information. - * @param {Route|Undefined} previous Previous route information, or undefined if current is - * first route entered. - */ - - /** - * @ngdoc event - * @name $route#$routeChangeError - * @eventType broadcast on root scope - * @description - * Broadcasted if any of the resolve promises are rejected. - * - * @param {Object} angularEvent Synthetic event object - * @param {Route} current Current route information. - * @param {Route} previous Previous route information. - * @param {Route} rejection Rejection of the promise. Usually the error of the failed promise. - */ - - /** - * @ngdoc event - * @name $route#$routeUpdate - * @eventType broadcast on root scope - * @description - * The `reloadOnSearch` property has been set to false, and we are reusing the same - * instance of the Controller. - * - * @param {Object} angularEvent Synthetic event object - * @param {Route} current Current/previous route information. - */ - - var forceReload = false, - preparedRoute, - preparedRouteIsUpdateOnly, - $route = { - routes: routes, - - /** - * @ngdoc method - * @name $route#reload - * - * @description - * Causes `$route` service to reload the current route even if - * {@link ng.$location $location} hasn't changed. - * - * As a result of that, {@link ngRoute.directive:ngView ngView} - * creates new scope and reinstantiates the controller. - */ - reload: function() { - forceReload = true; - - var fakeLocationEvent = { - defaultPrevented: false, - preventDefault: function fakePreventDefault() { - this.defaultPrevented = true; - forceReload = false; - } - }; - - $rootScope.$evalAsync(function() { - prepareRoute(fakeLocationEvent); - if (!fakeLocationEvent.defaultPrevented) commitRoute(); - }); - }, - - /** - * @ngdoc method - * @name $route#updateParams - * - * @description - * Causes `$route` service to update the current URL, replacing - * current route parameters with those specified in `newParams`. - * Provided property names that match the route's path segment - * definitions will be interpolated into the location's path, while - * remaining properties will be treated as query params. - * - * @param {!Object} newParams mapping of URL parameter names to values - */ - updateParams: function(newParams) { - if (this.current && this.current.$$route) { - newParams = angular.extend({}, this.current.params, newParams); - $location.path(interpolate(this.current.$$route.originalPath, newParams)); - // interpolate modifies newParams, only query params are left - $location.search(newParams); - } else { - throw $routeMinErr('norout', 'Tried updating route when with no current route'); - } - } - }; - - $rootScope.$on('$locationChangeStart', prepareRoute); - $rootScope.$on('$locationChangeSuccess', commitRoute); - - return $route; - - ///////////////////////////////////////////////////// - - /** - * @param on {string} current url - * @param route {Object} route regexp to match the url against - * @return {?Object} - * - * @description - * Check if the route matches the current url. - * - * Inspired by match in - * visionmedia/express/lib/router/router.js. - */ - function switchRouteMatcher(on, route) { - var keys = route.keys, - params = {}; - - if (!route.regexp) return null; - - var m = route.regexp.exec(on); - if (!m) return null; - - for (var i = 1, len = m.length; i < len; ++i) { - var key = keys[i - 1]; - - var val = m[i]; - - if (key && val) { - params[key.name] = val; - } - } - return params; - } - - function prepareRoute($locationEvent) { - var lastRoute = $route.current; - - preparedRoute = parseRoute(); - preparedRouteIsUpdateOnly = preparedRoute && lastRoute && preparedRoute.$$route === lastRoute.$$route - && angular.equals(preparedRoute.pathParams, lastRoute.pathParams) - && !preparedRoute.reloadOnSearch && !forceReload; - - if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) { - if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) { - if ($locationEvent) { - $locationEvent.preventDefault(); - } - } - } - } - - function commitRoute() { - var lastRoute = $route.current; - var nextRoute = preparedRoute; - - if (preparedRouteIsUpdateOnly) { - lastRoute.params = nextRoute.params; - angular.copy(lastRoute.params, $routeParams); - $rootScope.$broadcast('$routeUpdate', lastRoute); - } else if (nextRoute || lastRoute) { - forceReload = false; - $route.current = nextRoute; - if (nextRoute) { - if (nextRoute.redirectTo) { - if (angular.isString(nextRoute.redirectTo)) { - $location.path(interpolate(nextRoute.redirectTo, nextRoute.params)).search(nextRoute.params) - .replace(); - } else { - $location.url(nextRoute.redirectTo(nextRoute.pathParams, $location.path(), $location.search())) - .replace(); - } - } - } - - $q.when(nextRoute). - then(function() { - if (nextRoute) { - var locals = angular.extend({}, nextRoute.resolve), - template, templateUrl; - - angular.forEach(locals, function(value, key) { - locals[key] = angular.isString(value) ? - $injector.get(value) : $injector.invoke(value, null, null, key); - }); - - if (angular.isDefined(template = nextRoute.template)) { - if (angular.isFunction(template)) { - template = template(nextRoute.params); - } - } else if (angular.isDefined(templateUrl = nextRoute.templateUrl)) { - if (angular.isFunction(templateUrl)) { - templateUrl = templateUrl(nextRoute.params); - } - if (angular.isDefined(templateUrl)) { - nextRoute.loadedTemplateUrl = $sce.valueOf(templateUrl); - template = $templateRequest(templateUrl); - } - } - if (angular.isDefined(template)) { - locals['$template'] = template; - } - return $q.all(locals); - } - }). - then(function(locals) { - // after route change - if (nextRoute == $route.current) { - if (nextRoute) { - nextRoute.locals = locals; - angular.copy(nextRoute.params, $routeParams); - } - $rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute); - } - }, function(error) { - if (nextRoute == $route.current) { - $rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error); - } - }); - } - } - - - /** - * @returns {Object} the current active route, by matching it against the URL - */ - function parseRoute() { - // Match a route - var params, match; - angular.forEach(routes, function(route, path) { - if (!match && (params = switchRouteMatcher($location.path(), route))) { - match = inherit(route, { - params: angular.extend({}, $location.search(), params), - pathParams: params}); - match.$$route = route; - } - }); - // No route matched; fallback to "otherwise" route - return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}}); - } - - /** - * @returns {string} interpolation of the redirect path with the parameters - */ - function interpolate(string, params) { - var result = []; - angular.forEach((string || '').split(':'), function(segment, i) { - if (i === 0) { - result.push(segment); - } else { - var segmentMatch = segment.match(/(\w+)(?:[?*])?(.*)/); - var key = segmentMatch[1]; - result.push(params[key]); - result.push(segmentMatch[2] || ''); - delete params[key]; - } - }); - return result.join(''); - } - }]; -} - -ngRouteModule.provider('$routeParams', $RouteParamsProvider); - - -/** - * @ngdoc service - * @name $routeParams - * @requires $route - * - * @description - * The `$routeParams` service allows you to retrieve the current set of route parameters. - * - * Requires the {@link ngRoute `ngRoute`} module to be installed. - * - * The route parameters are a combination of {@link ng.$location `$location`}'s - * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}. - * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched. - * - * In case of parameter name collision, `path` params take precedence over `search` params. - * - * The service guarantees that the identity of the `$routeParams` object will remain unchanged - * (but its properties will likely change) even when a route change occurs. - * - * Note that the `$routeParams` are only updated *after* a route change completes successfully. - * This means that you cannot rely on `$routeParams` being correct in route resolve functions. - * Instead you can use `$route.current.params` to access the new route's parameters. - * - * @example - * ```js - * // Given: - * // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby - * // Route: /Chapter/:chapterId/Section/:sectionId - * // - * // Then - * $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'} - * ``` - */ -function $RouteParamsProvider() { - this.$get = function() { return {}; }; -} - -ngRouteModule.directive('ngView', ngViewFactory); -ngRouteModule.directive('ngView', ngViewFillContentFactory); - - -/** - * @ngdoc directive - * @name ngView - * @restrict ECA - * - * @description - * # Overview - * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by - * including the rendered template of the current route into the main layout (`index.html`) file. - * Every time the current route changes, the included view changes with it according to the - * configuration of the `$route` service. - * - * Requires the {@link ngRoute `ngRoute`} module to be installed. - * - * @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=} onload Expression to evaluate whenever the view updates. - * - * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll - * $anchorScroll} to scroll the viewport after the view is updated. - * - * - If the attribute is not set, disable scrolling. - * - If the attribute is set without value, enable scrolling. - * - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated - * as an expression yields a truthy value. - * @example - - -
    - Choose: - Moby | - Moby: Ch1 | - Gatsby | - Gatsby: Ch4 | - Scarlet Letter
    - -
    -
    -
    -
    - -
    $location.path() = {{main.$location.path()}}
    -
    $route.current.templateUrl = {{main.$route.current.templateUrl}}
    -
    $route.current.params = {{main.$route.current.params}}
    -
    $routeParams = {{main.$routeParams}}
    -
    -
    - - -
    - controller: {{book.name}}
    - Book Id: {{book.params.bookId}}
    -
    -
    - - -
    - controller: {{chapter.name}}
    - Book Id: {{chapter.params.bookId}}
    - Chapter Id: {{chapter.params.chapterId}} -
    -
    - - - .view-animate-container { - position:relative; - height:100px!important; - background:white; - border:1px solid black; - height:40px; - overflow:hidden; - } - - .view-animate { - padding:10px; - } - - .view-animate.ng-enter, .view-animate.ng-leave { - transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; - - display:block; - width:100%; - border-left:1px solid black; - - position:absolute; - top:0; - left:0; - right:0; - bottom:0; - padding:10px; - } - - .view-animate.ng-enter { - left:100%; - } - .view-animate.ng-enter.ng-enter-active { - left:0; - } - .view-animate.ng-leave.ng-leave-active { - left:-100%; - } - - - - angular.module('ngViewExample', ['ngRoute', 'ngAnimate']) - .config(['$routeProvider', '$locationProvider', - function($routeProvider, $locationProvider) { - $routeProvider - .when('/Book/:bookId', { - templateUrl: 'book.html', - controller: 'BookCtrl', - controllerAs: 'book' - }) - .when('/Book/:bookId/ch/:chapterId', { - templateUrl: 'chapter.html', - controller: 'ChapterCtrl', - controllerAs: 'chapter' - }); - - $locationProvider.html5Mode(true); - }]) - .controller('MainCtrl', ['$route', '$routeParams', '$location', - function($route, $routeParams, $location) { - this.$route = $route; - this.$location = $location; - this.$routeParams = $routeParams; - }]) - .controller('BookCtrl', ['$routeParams', function($routeParams) { - this.name = "BookCtrl"; - this.params = $routeParams; - }]) - .controller('ChapterCtrl', ['$routeParams', function($routeParams) { - this.name = "ChapterCtrl"; - this.params = $routeParams; - }]); - - - - - it('should load and compile correct template', function() { - element(by.linkText('Moby: Ch1')).click(); - var content = element(by.css('[ng-view]')).getText(); - expect(content).toMatch(/controller\: ChapterCtrl/); - expect(content).toMatch(/Book Id\: Moby/); - expect(content).toMatch(/Chapter Id\: 1/); - - element(by.partialLinkText('Scarlet')).click(); - - content = element(by.css('[ng-view]')).getText(); - expect(content).toMatch(/controller\: BookCtrl/); - expect(content).toMatch(/Book Id\: Scarlet/); - }); - -
    - */ - - -/** - * @ngdoc event - * @name ngView#$viewContentLoaded - * @eventType emit on the current ngView scope - * @description - * Emitted every time the ngView content is reloaded. - */ -ngViewFactory.$inject = ['$route', '$anchorScroll', '$animate']; -function ngViewFactory($route, $anchorScroll, $animate) { - return { - restrict: 'ECA', - terminal: true, - priority: 400, - transclude: 'element', - link: function(scope, $element, attr, ctrl, $transclude) { - var currentScope, - currentElement, - previousLeaveAnimation, - autoScrollExp = attr.autoscroll, - onloadExp = attr.onload || ''; - - scope.$on('$routeChangeSuccess', update); - update(); - - function cleanupLastView() { - if (previousLeaveAnimation) { - $animate.cancel(previousLeaveAnimation); - previousLeaveAnimation = null; - } - - if (currentScope) { - currentScope.$destroy(); - currentScope = null; - } - if (currentElement) { - previousLeaveAnimation = $animate.leave(currentElement); - previousLeaveAnimation.then(function() { - previousLeaveAnimation = null; - }); - currentElement = null; - } - } - - function update() { - var locals = $route.current && $route.current.locals, - template = locals && locals.$template; - - if (angular.isDefined(template)) { - var newScope = scope.$new(); - var current = $route.current; - - // Note: This will also link all children of ng-view that were contained in the original - // html. If that content contains controllers, ... they could pollute/change the scope. - // However, using ng-view 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) { - $animate.enter(clone, null, currentElement || $element).then(function onNgViewEnter() { - if (angular.isDefined(autoScrollExp) - && (!autoScrollExp || scope.$eval(autoScrollExp))) { - $anchorScroll(); - } - }); - cleanupLastView(); - }); - - currentElement = clone; - currentScope = current.scope = newScope; - currentScope.$emit('$viewContentLoaded'); - currentScope.$eval(onloadExp); - } else { - cleanupLastView(); - } - } - } - }; -} - -// This directive is called during the $transclude call of the first `ngView` 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 ngView -// is called. -ngViewFillContentFactory.$inject = ['$compile', '$controller', '$route']; -function ngViewFillContentFactory($compile, $controller, $route) { - return { - restrict: 'ECA', - priority: -400, - link: function(scope, $element) { - var current = $route.current, - locals = current.locals; - - $element.html(locals.$template); - - var link = $compile($element.contents()); - - if (current.controller) { - locals.$scope = scope; - var controller = $controller(current.controller, locals); - if (current.controllerAs) { - scope[current.controllerAs] = controller; - } - $element.data('$ngControllerController', controller); - $element.children().data('$ngControllerController', controller); - } - scope[current.resolveAs || '$resolve'] = locals; - - link(scope); - } - }; -} - - -})(window, window.angular); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-route.min.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-route.min.js deleted file mode 100644 index 4d0d01878..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-route.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - AngularJS v1.5.0 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(r,d,C){'use strict';function x(s,h,g){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,y){function k(){n&&(g.cancel(n),n=null);l&&(l.$destroy(),l=null);m&&(n=g.leave(m),n.then(function(){n=null}),m=null)}function z(){var b=s.current&&s.current.locals;if(d.isDefined(b&&b.$template)){var b=a.$new(),f=s.current;m=y(b,function(b){g.enter(b,null,m||c).then(function(){!d.isDefined(u)||u&&!a.$eval(u)||h()});k()});l=f.scope=b;l.$emit("$viewContentLoaded"); -l.$eval(v)}else k()}var l,m,n,u=b.autoscroll,v=b.onload||"";a.$on("$routeChangeSuccess",z);z()}}}function A(d,h,g){return{restrict:"ECA",priority:-400,link:function(a,c){var b=g.current,f=b.locals;c.html(f.$template);var y=d(c.contents());if(b.controller){f.$scope=a;var k=h(b.controller,f);b.controllerAs&&(a[b.controllerAs]=k);c.data("$ngControllerController",k);c.children().data("$ngControllerController",k)}a[b.resolveAs||"$resolve"]=f;y(a)}}}r=d.module("ngRoute",["ng"]).provider("$route",function(){function s(a, -c){return d.extend(Object.create(a),c)}function h(a,d){var b=d.caseInsensitiveMatch,f={originalPath:a,regexp:a},g=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(a,d,b,c){a="?"===c?c:null;c="*"===c?c:null;g.push({name:b,optional:!!a});d=d||"";return""+(a?"":d)+"(?:"+(a?d:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=new RegExp("^"+a+"$",b?"i":"");return f}var g={};this.when=function(a,c){var b=d.copy(c);d.isUndefined(b.reloadOnSearch)&& -(b.reloadOnSearch=!0);d.isUndefined(b.caseInsensitiveMatch)&&(b.caseInsensitiveMatch=this.caseInsensitiveMatch);g[a]=d.extend(b,a&&h(a,b));if(a){var f="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";g[f]=d.extend({redirectTo:a},h(f,b))}return this};this.caseInsensitiveMatch=!1;this.otherwise=function(a){"string"===typeof a&&(a={redirectTo:a});this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function(a,c,b,f,h,k,r){function l(b){var e= -t.current;(x=(p=n())&&e&&p.$$route===e.$$route&&d.equals(p.pathParams,e.pathParams)&&!p.reloadOnSearch&&!v)||!e&&!p||a.$broadcast("$routeChangeStart",p,e).defaultPrevented&&b&&b.preventDefault()}function m(){var w=t.current,e=p;if(x)w.params=e.params,d.copy(w.params,b),a.$broadcast("$routeUpdate",w);else if(e||w)v=!1,(t.current=e)&&e.redirectTo&&(d.isString(e.redirectTo)?c.path(u(e.redirectTo,e.params)).search(e.params).replace():c.url(e.redirectTo(e.pathParams,c.path(),c.search())).replace()),f.when(e).then(function(){if(e){var a= -d.extend({},e.resolve),b,c;d.forEach(a,function(b,e){a[e]=d.isString(b)?h.get(b):h.invoke(b,null,null,e)});d.isDefined(b=e.template)?d.isFunction(b)&&(b=b(e.params)):d.isDefined(c=e.templateUrl)&&(d.isFunction(c)&&(c=c(e.params)),d.isDefined(c)&&(e.loadedTemplateUrl=r.valueOf(c),b=k(c)));d.isDefined(b)&&(a.$template=b);return f.all(a)}}).then(function(c){e==t.current&&(e&&(e.locals=c,d.copy(e.params,b)),a.$broadcast("$routeChangeSuccess",e,w))},function(b){e==t.current&&a.$broadcast("$routeChangeError", -e,w,b)})}function n(){var a,b;d.forEach(g,function(f,g){var q;if(q=!b){var h=c.path();q=f.keys;var l={};if(f.regexp)if(h=f.regexp.exec(h)){for(var k=1,n=h.length;k - * - * See {@link ngSanitize.$sanitize `$sanitize`} for usage. - */ - -/** - * @ngdoc service - * @name $sanitize - * @kind function - * - * @description - * Sanitizes an html string by stripping all potentially dangerous tokens. - * - * 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. - * - * The whitelist for URL sanitization of attribute values is configured using the functions - * `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider - * `$compileProvider`}. - * - * The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}. - * - * @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>"); - }); -
    -
    - */ - - -/** - * @ngdoc provider - * @name $sanitizeProvider - * - * @description - * Creates and configures {@link $sanitize} instance. - */ -function $SanitizeProvider() { - var svgEnabled = false; - - this.$get = ['$$sanitizeUri', function($$sanitizeUri) { - if (svgEnabled) { - angular.extend(validElements, svgElements); - } - return function(html) { - var buf = []; - htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) { - return !/^unsafe:/.test($$sanitizeUri(uri, isImage)); - })); - return buf.join(''); - }; - }]; - - - /** - * @ngdoc method - * @name $sanitizeProvider#enableSvg - * @kind function - * - * @description - * Enables a subset of svg to be supported by the sanitizer. - * - *
    - *

    By enabling this setting without taking other precautions, you might expose your - * application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned - * outside of the containing element and be rendered over other elements on the page (e.g. a login - * link). Such behavior can then result in phishing incidents.

    - * - *

    To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg - * tags within the sanitized content:

    - * - *
    - * - *
    
    -   *   .rootOfTheIncludedContent svg {
    -   *     overflow: hidden !important;
    -   *   }
    -   *   
    - *
    - * - * @param {boolean=} regexp New regexp to whitelist urls with. - * @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called - * without an argument or self for chaining otherwise. - */ - this.enableSvg = function(enableSvg) { - if (angular.isDefined(enableSvg)) { - svgEnabled = enableSvg; - return this; - } else { - return svgEnabled; - } - }; -} - -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 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 = toMap("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 = toMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"), - optionalEndTagInlineElements = toMap("rp,rt"), - optionalEndTagElements = angular.extend({}, - optionalEndTagInlineElements, - optionalEndTagBlockElements); - -// Safe Block Elements - HTML5 -var blockElements = angular.extend({}, optionalEndTagBlockElements, toMap("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,section,table,ul")); - -// Inline Elements - HTML5 -var inlineElements = angular.extend({}, optionalEndTagInlineElements, toMap("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")); - -// SVG Elements -// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements -// Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted. -// They can potentially allow for arbitrary javascript to be executed. See #11290 -var svgElements = toMap("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph," + - "hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline," + - "radialGradient,rect,stop,svg,switch,text,title,tspan"); - -// Blocked Elements (will be stripped) -var blockedElements = toMap("script,style"); - -var validElements = angular.extend({}, - voidElements, - blockElements, - inlineElements, - optionalEndTagElements); - -//Attributes that have href and hence need to be sanitized -var uriAttrs = toMap("background,cite,href,longdesc,src,xlink:href"); - -var htmlAttrs = toMap('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,tabindex,target,title,type,' + - 'valign,value,vspace,width'); - -// SVG attributes (without "id" and "name" attributes) -// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes -var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' + - 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' + - 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' + - 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' + - 'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' + - 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' + - 'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' + - 'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' + - 'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' + - 'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' + - 'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' + - 'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' + - 'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' + - 'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' + - 'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true); - -var validAttrs = angular.extend({}, - uriAttrs, - svgAttrs, - htmlAttrs); - -function toMap(str, lowercaseKeys) { - var obj = {}, items = str.split(','), i; - for (i = 0; i < items.length; i++) { - obj[lowercaseKeys ? angular.lowercase(items[i]) : items[i]] = true; - } - return obj; -} - -var inertBodyElement; -(function(window) { - var doc; - if (window.document && window.document.implementation) { - doc = window.document.implementation.createHTMLDocument("inert"); - } else { - throw $sanitizeMinErr('noinert', "Can't create an inert html document"); - } - var docElement = doc.documentElement || doc.getDocumentElement(); - var bodyElements = docElement.getElementsByTagName('body'); - - // usually there should be only one body element in the document, but IE doesn't have any, so we need to create one - if (bodyElements.length === 1) { - inertBodyElement = bodyElements[0]; - } else { - var html = doc.createElement('html'); - inertBodyElement = doc.createElement('body'); - html.appendChild(inertBodyElement); - doc.appendChild(html); - } -})(window); - -/** - * @example - * htmlParser(htmlString, { - * start: function(tag, attrs) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * }); - * - * @param {string} html string - * @param {object} handler - */ -function htmlParser(html, handler) { - if (html === null || html === undefined) { - html = ''; - } else if (typeof html !== 'string') { - html = '' + html; - } - inertBodyElement.innerHTML = html; - - //mXSS protection - var mXSSAttempts = 5; - do { - if (mXSSAttempts === 0) { - throw $sanitizeMinErr('uinput', "Failed to sanitize html because the input is unstable"); - } - mXSSAttempts--; - - // strip custom-namespaced attributes on IE<=11 - if (document.documentMode <= 11) { - stripCustomNsAttrs(inertBodyElement); - } - html = inertBodyElement.innerHTML; //trigger mXSS - inertBodyElement.innerHTML = html; - } while (html !== inertBodyElement.innerHTML); - - var node = inertBodyElement.firstChild; - while (node) { - switch (node.nodeType) { - case 1: // ELEMENT_NODE - handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes)); - break; - case 3: // TEXT NODE - handler.chars(node.textContent); - break; - } - - var nextNode; - if (!(nextNode = node.firstChild)) { - if (node.nodeType == 1) { - handler.end(node.nodeName.toLowerCase()); - } - nextNode = node.nextSibling; - if (!nextNode) { - while (nextNode == null) { - node = node.parentNode; - if (node === inertBodyElement) break; - nextNode = node.nextSibling; - if (node.nodeType == 1) { - handler.end(node.nodeName.toLowerCase()); - } - } - } - } - node = nextNode; - } - - while (node = inertBodyElement.firstChild) { - inertBodyElement.removeChild(node); - } -} - -function attrToMap(attrs) { - var map = {}; - for (var i = 0, ii = attrs.length; i < ii; i++) { - var attr = attrs[i]; - map[attr.name] = attr.value; - } - return map; -} - - -/** - * Escapes all potentially dangerous characters, so that the - * resulting string can be safely inserted into attribute or - * element text. - * @param value - * @returns {string} escaped text - */ -function encodeEntities(value) { - return value. - replace(/&/g, '&'). - replace(SURROGATE_PAIR_REGEXP, function(value) { - var hi = value.charCodeAt(0); - var low = value.charCodeAt(1); - return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';'; - }). - replace(NON_ALPHANUMERIC_REGEXP, function(value) { - return '&#' + value.charCodeAt(0) + ';'; - }). - replace(//g, '>'); -} - -/** - * create an HTML/XML writer which writes to buffer - * @param {Array} buf use buf.join('') to get out sanitized html string - * @returns {object} in the form of { - * start: function(tag, attrs) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * } - */ -function htmlSanitizeWriter(buf, uriValidator) { - var ignoreCurrentElement = false; - var out = angular.bind(buf, buf.push); - return { - start: function(tag, attrs) { - tag = angular.lowercase(tag); - if (!ignoreCurrentElement && blockedElements[tag]) { - ignoreCurrentElement = tag; - } - if (!ignoreCurrentElement && 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('>'); - } - }, - end: function(tag) { - tag = angular.lowercase(tag); - if (!ignoreCurrentElement && validElements[tag] === true && voidElements[tag] !== true) { - out(''); - } - if (tag == ignoreCurrentElement) { - ignoreCurrentElement = false; - } - }, - chars: function(chars) { - if (!ignoreCurrentElement) { - out(encodeEntities(chars)); - } - } - }; -} - - -/** - * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1' attribute to declare - * ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo'). This is undesirable since we don't want - * to allow any of these custom attributes. This method strips them all. - * - * @param node Root element to process - */ -function stripCustomNsAttrs(node) { - if (node.nodeType === Node.ELEMENT_NODE) { - var attrs = node.attributes; - for (var i = 0, l = attrs.length; i < l; i++) { - var attrNode = attrs[i]; - var attrName = attrNode.name.toLowerCase(); - if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) { - node.removeAttributeNode(attrNode); - i--; - l--; - } - } - } - - var nextNode = node.firstChild; - if (nextNode) { - stripCustomNsAttrs(nextNode); - } - - nextNode = node.nextSibling; - if (nextNode) { - stripCustomNsAttrs(nextNode); - } -} - - - -// 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. - * @param {object|function(url)} [attributes] Add custom attributes to the link element. - * - * Can be one of: - * - * - `object`: A map of attributes - * - `function`: Takes the url as a parameter and returns a map of attributes - * - * If the map of attributes contains a value for `target`, it overrides the value of - * the target parameter. - * - * - * @returns {string} Html-linkified and {@link $sanitize sanitized} text. - * - * @usage - - * - * @example - - -
    - Snippet: - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FilterSourceRendered
    linky filter -
    <div ng-bind-html="snippet | linky">
    </div>
    -
    -
    -
    linky target -
    <div ng-bind-html="snippetWithSingleURL | linky:'_blank'">
    </div>
    -
    -
    -
    linky custom attributes -
    <div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}">
    </div>
    -
    -
    -
    no filter
    <div ng-bind="snippet">
    </div>
    - - - angular.module('linkyExample', ['ngSanitize']) - .controller('ExampleController', ['$scope', function($scope) { - $scope.snippet = - 'Pretty text with some links:\n'+ - 'http://angularjs.org/,\n'+ - 'mailto:us@somewhere.org,\n'+ - 'another@somewhere.org,\n'+ - 'and one more: ftp://127.0.0.1/.'; - $scope.snippetWithSingleURL = 'http://angularjs.org/'; - }]); - - - 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("snippetWithSingleURL | linky:'_blank'")).getText()). - toBe('http://angularjs.org/'); - expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank'); - }); - - it('should optionally add custom attributes', function() { - expect(element(by.id('linky-custom-attributes')). - element(by.binding("snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}")).getText()). - toBe('http://angularjs.org/'); - expect(element(by.css('#linky-custom-attributes a')).getAttribute('rel')).toEqual('nofollow'); - }); - - - */ -angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) { - var LINKY_URL_REGEXP = - /((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i, - MAILTO_REGEXP = /^mailto:/i; - - var linkyMinErr = angular.$$minErr('linky'); - var isString = angular.isString; - - return function(text, target, attributes) { - if (text == null || text === '') return text; - if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', 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/www/mailto then assume mailto - if (!match[2] && !match[4]) { - url = (match[3] ? 'http://' : '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) { - var key; - html.push(''); - addText(text); - html.push(''); - } - }; -}]); - - -})(window, window.angular); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-sanitize.min.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-sanitize.min.js deleted file mode 100644 index 135d5a0e8..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-sanitize.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - AngularJS v1.5.0 - (c) 2010-2016 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(A,e,B){'use strict';function C(a){var c=[];v(c,e.noop).chars(a);return c.join("")}function h(a,c){var b={},d=a.split(","),l;for(l=0;l=document.documentMode&&n(g);a=g.innerHTML;g.innerHTML=a}while(a!==g.innerHTML);for(b=g.firstChild;b;){switch(b.nodeType){case 1:c.start(b.nodeName.toLowerCase(),E(b.attributes)); -break;case 3:c.chars(b.textContent)}var d;if(!(d=b.firstChild)&&(1==b.nodeType&&c.end(b.nodeName.toLowerCase()),d=b.nextSibling,!d))for(;null==d;){b=b.parentNode;if(b===g)break;d=b.nextSibling;1==b.nodeType&&c.end(b.nodeName.toLowerCase())}b=d}for(;b=g.firstChild;)g.removeChild(b)}function E(a){for(var c={},b=0,d=a.length;b/g,">")}function v(a,c){var b=!1,d=e.bind(a,a.push);return{start:function(a,f){a=e.lowercase(a);!b&&H[a]&&(b=a);b||!0!==t[a]||(d("<"),d(a),e.forEach(f,function(b,f){var g=e.lowercase(f),h="img"===a&&"src"===g||"background"===g;!0!==I[g]||!0===y[g]&&!c(b,h)||(d(" "),d(f),d('="'),d(x(b)),d('"'))}),d(">"))},end:function(a){a=e.lowercase(a);b||!0!==t[a]||!0===z[a]||(d(""));a== -b&&(b=!1)},chars:function(a){b||d(x(a))}}}function n(a){if(a.nodeType===Node.ELEMENT_NODE)for(var c=a.attributes,b=0,d=c.length;b"\u201d\u2019]/i,b=/^mailto:/i,d=e.$$minErr("linky"),g=e.isString;return function(f,h,m){function k(a){a&&p.push(C(a))}function q(a,b){var c;p.push("');k(b);p.push("")}if(null==f||""===f)return f;if(!g(f))throw d("notstring",f);for(var r=f,p=[],s,n;f=r.match(c);)s=f[0],f[2]||f[4]||(s=(f[3]?"http://":"mailto:")+s),n=f.index,k(r.substr(0,n)),q(s,f[0].replace(b,"")),r=r.substring(n+f[0].length);k(r);return a(p.join(""))}}])})(window,window.angular); -//# sourceMappingURL=angular-sanitize.min.js.map diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-sanitize.min.js.map b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-sanitize.min.js.map deleted file mode 100644 index 7276abd2d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-sanitize.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular-sanitize.min.js", -"lineCount":14, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CAsMtCC,QAASA,EAAY,CAACC,CAAD,CAAQ,CAC3B,IAAIC,EAAM,EACGC,EAAAC,CAAmBF,CAAnBE,CAAwBN,CAAAO,KAAxBD,CACbH,MAAA,CAAaA,CAAb,CACA,OAAOC,EAAAI,KAAA,CAAS,EAAT,CAJoB,CAyF7BC,QAASA,EAAK,CAACC,CAAD,CAAMC,CAAN,CAAqB,CAAA,IAC7BC,EAAM,EADuB,CACnBC,EAAQH,CAAAI,MAAA,CAAU,GAAV,CADW,CACKC,CACtC,KAAKA,CAAL,CAAS,CAAT,CAAYA,CAAZ,CAAgBF,CAAAG,OAAhB,CAA8BD,CAAA,EAA9B,CACEH,CAAA,CAAID,CAAA,CAAgBX,CAAAiB,UAAA,CAAkBJ,CAAA,CAAME,CAAN,CAAlB,CAAhB,CAA8CF,CAAA,CAAME,CAAN,CAAlD,CAAA,CAA8D,CAAA,CAEhE,OAAOH,EAL0B,CA0CnCM,QAASA,EAAU,CAACC,CAAD,CAAOC,CAAP,CAAgB,CACpB,IAAb,GAAID,CAAJ,EAAqBA,CAArB,GAA8BlB,CAA9B,CACEkB,CADF,CACS,EADT,CAE2B,QAF3B,GAEW,MAAOA,EAFlB,GAGEA,CAHF,CAGS,EAHT,CAGcA,CAHd,CAKAE,EAAAC,UAAA,CAA6BH,CAG7B,KAAII,EAAe,CACnB,GAAG,CACD,GAAqB,CAArB,GAAIA,CAAJ,CACE,KAAMC,EAAA,CAAgB,QAAhB,CAAN,CAEFD,CAAA,EAG6B,GAA7B,EAAIE,QAAAC,aAAJ,EACEC,CAAA,CAAmBN,CAAnB,CAEFF,EAAA,CAAOE,CAAAC,UACPD,EAAAC,UAAA,CAA6BH,CAX5B,CAAH,MAYSA,CAZT,GAYkBE,CAAAC,UAZlB,CAeA,KADIM,CACJ,CADWP,CAAAQ,WACX,CAAOD,CAAP,CAAA,CAAa,CACX,OAAQA,CAAAE,SAAR,EACE,KAAK,CAAL,CACEV,CAAAW,MAAA,CAAcH,CAAAI,SAAAC,YAAA,EAAd,CAA2CC,CAAA,CAAUN,CAAAO,WAAV,CAA3C,CACA;KACF,MAAK,CAAL,CACEf,CAAAjB,MAAA,CAAcyB,CAAAQ,YAAd,CALJ,CASA,IAAIC,CACJ,IAAM,EAAAA,CAAA,CAAWT,CAAAC,WAAX,CAAN,GACuB,CAIhBQ,EAJDT,CAAAE,SAICO,EAHHjB,CAAAkB,IAAA,CAAYV,CAAAI,SAAAC,YAAA,EAAZ,CAGGI,CADLA,CACKA,CADMT,CAAAW,YACNF,CAAAA,CAAAA,CALP,EAMI,IAAA,CAAmB,IAAnB,EAAOA,CAAP,CAAA,CAAyB,CACvBT,CAAA,CAAOA,CAAAY,WACP,IAAIZ,CAAJ,GAAaP,CAAb,CAA+B,KAC/BgB,EAAA,CAAWT,CAAAW,YACU,EAArB,EAAIX,CAAAE,SAAJ,EACEV,CAAAkB,IAAA,CAAYV,CAAAI,SAAAC,YAAA,EAAZ,CALqB,CAU7BL,CAAA,CAAOS,CA3BI,CA8Bb,IAAA,CAAOT,CAAP,CAAcP,CAAAQ,WAAd,CAAA,CACER,CAAAoB,YAAA,CAA6Bb,CAA7B,CAxD+B,CA4DnCM,QAASA,EAAS,CAACQ,CAAD,CAAQ,CAExB,IADA,IAAIC,EAAM,EAAV,CACS5B,EAAI,CADb,CACgB6B,EAAKF,CAAA1B,OAArB,CAAmCD,CAAnC,CAAuC6B,CAAvC,CAA2C7B,CAAA,EAA3C,CAAgD,CAC9C,IAAI8B,EAAOH,CAAA,CAAM3B,CAAN,CACX4B,EAAA,CAAIE,CAAAC,KAAJ,CAAA,CAAiBD,CAAAE,MAF6B,CAIhD,MAAOJ,EANiB,CAiB1BK,QAASA,EAAc,CAACD,CAAD,CAAQ,CAC7B,MAAOA,EAAAE,QAAA,CACG,IADH,CACS,OADT,CAAAA,QAAA,CAEGC,CAFH,CAE0B,QAAQ,CAACH,CAAD,CAAQ,CAC7C,IAAII,EAAKJ,CAAAK,WAAA,CAAiB,CAAjB,CACLC,EAAAA,CAAMN,CAAAK,WAAA,CAAiB,CAAjB,CACV,OAAO,IAAP,EAAgC,IAAhC,EAAiBD,CAAjB,CAAsB,KAAtB;CAA0CE,CAA1C,CAAgD,KAAhD,EAA0D,KAA1D,EAAqE,GAHxB,CAF1C,CAAAJ,QAAA,CAOGK,CAPH,CAO4B,QAAQ,CAACP,CAAD,CAAQ,CAC/C,MAAO,IAAP,CAAcA,CAAAK,WAAA,CAAiB,CAAjB,CAAd,CAAoC,GADW,CAP5C,CAAAH,QAAA,CAUG,IAVH,CAUS,MAVT,CAAAA,QAAA,CAWG,IAXH,CAWS,MAXT,CADsB,CAyB/B5C,QAASA,EAAkB,CAACD,CAAD,CAAMmD,CAAN,CAAoB,CAC7C,IAAIC,EAAuB,CAAA,CAA3B,CACIC,EAAMzD,CAAA0D,KAAA,CAAatD,CAAb,CAAkBA,CAAAuD,KAAlB,CACV,OAAO,CACL5B,MAAOA,QAAQ,CAAC6B,CAAD,CAAMlB,CAAN,CAAa,CAC1BkB,CAAA,CAAM5D,CAAAiB,UAAA,CAAkB2C,CAAlB,CACDJ,EAAAA,CAAL,EAA6BK,CAAA,CAAgBD,CAAhB,CAA7B,GACEJ,CADF,CACyBI,CADzB,CAGKJ,EAAL,EAAoD,CAAA,CAApD,GAA6BM,CAAA,CAAcF,CAAd,CAA7B,GACEH,CAAA,CAAI,GAAJ,CAcA,CAbAA,CAAA,CAAIG,CAAJ,CAaA,CAZA5D,CAAA+D,QAAA,CAAgBrB,CAAhB,CAAuB,QAAQ,CAACK,CAAD,CAAQiB,CAAR,CAAa,CAC1C,IAAIC,EAAKjE,CAAAiB,UAAA,CAAkB+C,CAAlB,CAAT,CACIE,EAAmB,KAAnBA,GAAWN,CAAXM,EAAqC,KAArCA,GAA4BD,CAA5BC,EAAyD,YAAzDA,GAAgDD,CAC3B,EAAA,CAAzB,GAAIE,CAAA,CAAWF,CAAX,CAAJ,EACsB,CAAA,CADtB,GACGG,CAAA,CAASH,CAAT,CADH,EAC8B,CAAAV,CAAA,CAAaR,CAAb,CAAoBmB,CAApB,CAD9B,GAEET,CAAA,CAAI,GAAJ,CAIA,CAHAA,CAAA,CAAIO,CAAJ,CAGA,CAFAP,CAAA,CAAI,IAAJ,CAEA,CADAA,CAAA,CAAIT,CAAA,CAAeD,CAAf,CAAJ,CACA,CAAAU,CAAA,CAAI,GAAJ,CANF,CAH0C,CAA5C,CAYA,CAAAA,CAAA,CAAI,GAAJ,CAfF,CAL0B,CADvB,CAwBLnB,IAAKA,QAAQ,CAACsB,CAAD,CAAM,CACjBA,CAAA,CAAM5D,CAAAiB,UAAA,CAAkB2C,CAAlB,CACDJ,EAAL,EAAoD,CAAA,CAApD,GAA6BM,CAAA,CAAcF,CAAd,CAA7B,EAAkF,CAAA,CAAlF,GAA4DS,CAAA,CAAaT,CAAb,CAA5D,GACEH,CAAA,CAAI,IAAJ,CAEA,CADAA,CAAA,CAAIG,CAAJ,CACA,CAAAH,CAAA,CAAI,GAAJ,CAHF,CAKIG,EAAJ;AAAWJ,CAAX,GACEA,CADF,CACyB,CAAA,CADzB,CAPiB,CAxBd,CAmCLrD,MAAOA,QAAQ,CAACA,CAAD,CAAQ,CAChBqD,CAAL,EACEC,CAAA,CAAIT,CAAA,CAAe7C,CAAf,CAAJ,CAFmB,CAnClB,CAHsC,CAsD/CwB,QAASA,EAAkB,CAACC,CAAD,CAAO,CAChC,GAAIA,CAAAE,SAAJ,GAAsBwC,IAAAC,aAAtB,CAEE,IADA,IAAI7B,EAAQd,CAAAO,WAAZ,CACSpB,EAAI,CADb,CACgByD,EAAI9B,CAAA1B,OAApB,CAAkCD,CAAlC,CAAsCyD,CAAtC,CAAyCzD,CAAA,EAAzC,CAA8C,CAC5C,IAAI0D,EAAW/B,CAAA,CAAM3B,CAAN,CAAf,CACI2D,EAAWD,CAAA3B,KAAAb,YAAA,EACf,IAAiB,WAAjB,GAAIyC,CAAJ,EAA6D,CAA7D,GAAgCA,CAAAC,QAAA,CAAiB,MAAjB,CAAhC,CACE/C,CAAAgD,oBAAA,CAAyBH,CAAzB,CAEA,CADA1D,CAAA,EACA,CAAAyD,CAAA,EAN0C,CAYhD,CADInC,CACJ,CADeT,CAAAC,WACf,GACEF,CAAA,CAAmBU,CAAnB,CAIF,EADAA,CACA,CADWT,CAAAW,YACX,GACEZ,CAAA,CAAmBU,CAAnB,CArB8B,CAxdlC,IAAIb,EAAkBxB,CAAA6E,SAAA,CAAiB,WAAjB,CAAtB,CAkMI3B,EAAwB,iCAlM5B,CAoMEI,EAA0B,eApM5B,CA6MIe,EAAe5D,CAAA,CAAM,wBAAN,CA7MnB,CAiNIqE,EAA8BrE,CAAA,CAAM,gDAAN,CAjNlC,CAkNIsE,EAA+BtE,CAAA,CAAM,OAAN,CAlNnC,CAmNIuE,EAAyBhF,CAAAiF,OAAA,CAAe,EAAf,CACeF,CADf,CAEeD,CAFf,CAnN7B,CAwNII,EAAgBlF,CAAAiF,OAAA,CAAe,EAAf;AAAmBH,CAAnB,CAAgDrE,CAAA,CAAM,qKAAN,CAAhD,CAxNpB,CA6NI0E,EAAiBnF,CAAAiF,OAAA,CAAe,EAAf,CAAmBF,CAAnB,CAAiDtE,CAAA,CAAM,2JAAN,CAAjD,CA7NrB,CAqOI2E,EAAc3E,CAAA,CAAM,wNAAN,CArOlB;AA0OIoD,EAAkBpD,CAAA,CAAM,cAAN,CA1OtB,CA4OIqD,EAAgB9D,CAAAiF,OAAA,CAAe,EAAf,CACeZ,CADf,CAEea,CAFf,CAGeC,CAHf,CAIeH,CAJf,CA5OpB,CAmPIZ,EAAW3D,CAAA,CAAM,8CAAN,CAnPf,CAqPI4E,EAAY5E,CAAA,CAAM,kTAAN,CArPhB,CA6PI6E,EAAW7E,CAAA,CAAM,guCAAN;AAcoE,CAAA,CAdpE,CA7Pf,CA6QI0D,EAAanE,CAAAiF,OAAA,CAAe,EAAf,CACeb,CADf,CAEekB,CAFf,CAGeD,CAHf,CA7QjB,CA0RIhE,CACH,UAAQ,CAACtB,CAAD,CAAS,CAEhB,GAAIA,CAAA0B,SAAJ,EAAuB1B,CAAA0B,SAAA8D,eAAvB,CACEC,CAAA,CAAMzF,CAAA0B,SAAA8D,eAAAE,mBAAA,CAAkD,OAAlD,CADR,KAGE,MAAMjE,EAAA,CAAgB,SAAhB,CAAN,CAGF,IAAIkE,EAAeC,CADFH,CAAAI,gBACED,EADqBH,CAAAK,mBAAA,EACrBF,sBAAA,CAAgC,MAAhC,CAGS,EAA5B,GAAID,CAAA1E,OAAJ,CACEK,CADF,CACqBqE,CAAA,CAAa,CAAb,CADrB,EAGMvE,CAGJ,CAHWqE,CAAAM,cAAA,CAAkB,MAAlB,CAGX,CAFAzE,CAEA,CAFmBmE,CAAAM,cAAA,CAAkB,MAAlB,CAEnB,CADA3E,CAAA4E,YAAA,CAAiB1E,CAAjB,CACA,CAAAmE,CAAAO,YAAA,CAAgB5E,CAAhB,CANF,CAXgB,CAAjB,CAAD,CAmBGpB,CAnBH,CAyNAC,EAAAgG,OAAA,CAAe,YAAf,CAA6B,EAA7B,CAAAC,SAAA,CAA0C,WAA1C,CApXAC,QAA0B,EAAG,CAC3B,IAAIC,EAAa,CAAA,CAEjB,KAAAC,KAAA,CAAY,CAAC,eAAD,CAAkB,QAAQ,CAACC,CAAD,CAAgB,CAChDF,CAAJ,EACEnG,CAAAiF,OAAA,CAAenB,CAAf,CAA8BsB,CAA9B,CAEF,OAAO,SAAQ,CAACjE,CAAD,CAAO,CACpB,IAAIf;AAAM,EACVc,EAAA,CAAWC,CAAX,CAAiBd,CAAA,CAAmBD,CAAnB,CAAwB,QAAQ,CAACkG,CAAD,CAAMpC,CAAN,CAAe,CAC9D,MAAO,CAAC,UAAAqC,KAAA,CAAgBF,CAAA,CAAcC,CAAd,CAAmBpC,CAAnB,CAAhB,CADsD,CAA/C,CAAjB,CAGA,OAAO9D,EAAAI,KAAA,CAAS,EAAT,CALa,CAJ8B,CAA1C,CA4CZ,KAAAgG,UAAA,CAAiBC,QAAQ,CAACD,CAAD,CAAY,CACnC,MAAIxG,EAAA0G,UAAA,CAAkBF,CAAlB,CAAJ,EACEL,CACO,CADMK,CACN,CAAA,IAFT,EAISL,CAL0B,CA/CV,CAoX7B,CAmIAnG,EAAAgG,OAAA,CAAe,YAAf,CAAAW,OAAA,CAAoC,OAApC,CAA6C,CAAC,WAAD,CAAc,QAAQ,CAACC,CAAD,CAAY,CAAA,IACzEC,EACE,yFAFuE,CAGzEC,EAAgB,WAHyD,CAKzEC,EAAc/G,CAAA6E,SAAA,CAAiB,OAAjB,CAL2D,CAMzEmC,EAAWhH,CAAAgH,SAEf,OAAO,SAAQ,CAACC,CAAD,CAAOC,CAAP,CAAe/E,CAAf,CAA2B,CAwBxCgF,QAASA,EAAO,CAACF,CAAD,CAAO,CAChBA,CAAL,EAGA9F,CAAAwC,KAAA,CAAUzD,CAAA,CAAa+G,CAAb,CAAV,CAJqB,CAOvBG,QAASA,EAAO,CAACC,CAAD,CAAMJ,CAAN,CAAY,CAC1B,IAAIjD,CACJ7C,EAAAwC,KAAA,CAAU,KAAV,CACI3D,EAAAsH,WAAA,CAAmBnF,CAAnB,CAAJ,GACEA,CADF,CACeA,CAAA,CAAWkF,CAAX,CADf,CAGA,IAAIrH,CAAAuH,SAAA,CAAiBpF,CAAjB,CAAJ,CACE,IAAK6B,CAAL,GAAY7B,EAAZ,CACEhB,CAAAwC,KAAA,CAAUK,CAAV;AAAgB,IAAhB,CAAuB7B,CAAA,CAAW6B,CAAX,CAAvB,CAAyC,IAAzC,CAFJ,KAKE7B,EAAA,CAAa,EAEX,EAAAnC,CAAA0G,UAAA,CAAkBQ,CAAlB,CAAJ,EAAmC,QAAnC,EAA+C/E,EAA/C,EACEhB,CAAAwC,KAAA,CAAU,UAAV,CACUuD,CADV,CAEU,IAFV,CAIF/F,EAAAwC,KAAA,CAAU,QAAV,CACU0D,CAAApE,QAAA,CAAY,IAAZ,CAAkB,QAAlB,CADV,CAEU,IAFV,CAGAkE,EAAA,CAAQF,CAAR,CACA9F,EAAAwC,KAAA,CAAU,MAAV,CAtB0B,CA9B5B,GAAY,IAAZ,EAAIsD,CAAJ,EAA6B,EAA7B,GAAoBA,CAApB,CAAiC,MAAOA,EACxC,IAAK,CAAAD,CAAA,CAASC,CAAT,CAAL,CAAqB,KAAMF,EAAA,CAAY,WAAZ,CAA8DE,CAA9D,CAAN,CAOrB,IAJA,IAAIO,EAAMP,CAAV,CACI9F,EAAO,EADX,CAEIkG,CAFJ,CAGItG,CACJ,CAAQ0G,CAAR,CAAgBD,CAAAC,MAAA,CAAUZ,CAAV,CAAhB,CAAA,CAEEQ,CAQA,CARMI,CAAA,CAAM,CAAN,CAQN,CANKA,CAAA,CAAM,CAAN,CAML,EANkBA,CAAA,CAAM,CAAN,CAMlB,GALEJ,CAKF,EALSI,CAAA,CAAM,CAAN,CAAA,CAAW,SAAX,CAAuB,SAKhC,EAL6CJ,CAK7C,EAHAtG,CAGA,CAHI0G,CAAAC,MAGJ,CAFAP,CAAA,CAAQK,CAAAG,OAAA,CAAW,CAAX,CAAc5G,CAAd,CAAR,CAEA,CADAqG,CAAA,CAAQC,CAAR,CAAaI,CAAA,CAAM,CAAN,CAAAxE,QAAA,CAAiB6D,CAAjB,CAAgC,EAAhC,CAAb,CACA,CAAAU,CAAA,CAAMA,CAAAI,UAAA,CAAc7G,CAAd,CAAkB0G,CAAA,CAAM,CAAN,CAAAzG,OAAlB,CAERmG,EAAA,CAAQK,CAAR,CACA,OAAOZ,EAAA,CAAUzF,CAAAX,KAAA,CAAU,EAAV,CAAV,CAtBiC,CARmC,CAAlC,CAA7C,CApoBsC,CAArC,CAAD,CAusBGT,MAvsBH,CAusBWA,MAAAC,QAvsBX;", -"sources":["angular-sanitize.js"], -"names":["window","angular","undefined","sanitizeText","chars","buf","htmlSanitizeWriter","writer","noop","join","toMap","str","lowercaseKeys","obj","items","split","i","length","lowercase","htmlParser","html","handler","inertBodyElement","innerHTML","mXSSAttempts","$sanitizeMinErr","document","documentMode","stripCustomNsAttrs","node","firstChild","nodeType","start","nodeName","toLowerCase","attrToMap","attributes","textContent","nextNode","end","nextSibling","parentNode","removeChild","attrs","map","ii","attr","name","value","encodeEntities","replace","SURROGATE_PAIR_REGEXP","hi","charCodeAt","low","NON_ALPHANUMERIC_REGEXP","uriValidator","ignoreCurrentElement","out","bind","push","tag","blockedElements","validElements","forEach","key","lkey","isImage","validAttrs","uriAttrs","voidElements","Node","ELEMENT_NODE","l","attrNode","attrName","indexOf","removeAttributeNode","$$minErr","optionalEndTagBlockElements","optionalEndTagInlineElements","optionalEndTagElements","extend","blockElements","inlineElements","svgElements","htmlAttrs","svgAttrs","implementation","doc","createHTMLDocument","bodyElements","getElementsByTagName","documentElement","getDocumentElement","createElement","appendChild","module","provider","$SanitizeProvider","svgEnabled","$get","$$sanitizeUri","uri","test","enableSvg","this.enableSvg","isDefined","filter","$sanitize","LINKY_URL_REGEXP","MAILTO_REGEXP","linkyMinErr","isString","text","target","addText","addLink","url","isFunction","isObject","raw","match","index","substr","substring"] -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-scenario.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-scenario.js deleted file mode 100644 index 20af805fc..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/external/angular-1.5/angular-scenario.js +++ /dev/null @@ -1,41849 +0,0 @@ -/*! - * jQuery JavaScript Library v2.1.1 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-05-01T17:11Z - */ - -(function( global, factory ) {'use strict'; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - // For CommonJS and CommonJS-like environments where a proper window is present, - // execute the factory and get jQuery - // For environments that do not inherently posses a window with a document - // (such as Node.js), expose a jQuery-making factory as module.exports - // This accentuates the need for the creation of a real window - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Can't do this because several apps including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -// - -var arr = []; - -var slice = arr.slice; - -var concat = arr.concat; - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var support = {}; - - - -var - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - - version = "2.1.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android<4.1 - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num != null ? - - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - - // Return all the elements in a clean array - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray, - - isWindow: function( obj ) { - return obj != null && obj === obj.window; - }, - - isNumeric: function( obj ) { - // parseFloat NaNs numeric-cast false positives (null|true|false|"") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; - }, - - isPlainObject: function( obj ) { - // Not plain objects: - // - Any object or value whose internal [[Class]] property is not "[object Object]" - // - DOM nodes - // - window - if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.constructor && - !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { - return false; - } - - // If the function hasn't returned already, we're confident that - // |obj| is a plain object, created by {} or constructed with new Object - return true; - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - // Support: Android < 4.0, iOS < 6 (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - globalEval: function( code ) { - var script, - indirect = eval; - - code = jQuery.trim( code ); - - if ( code ) { - // If the code includes a valid, prologue position - // strict mode pragma, execute code by injecting a - // script tag into the document. - if ( code.indexOf("use strict") === 1 ) { - script = document.createElement("script"); - script.text = code; - document.head.appendChild( script ).parentNode.removeChild( script ); - } else { - // Otherwise, avoid the DOM node creation, insertion - // and removal by using an indirect global eval - indirect( code ); - } - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Support: Android<4.1 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: Date.now, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v1.10.19 - * http://sizzlejs.com/ - * - * Copyright 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-04-18 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + characterEncoding + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== strundefined && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, - doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer - if ( parent.addEventListener ) { - parent.addEventListener( "unload", function() { - setDocument(); - }, false ); - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", function() { - setDocument(); - }); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { - div.innerHTML = "
    "; - - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( div.querySelectorAll("[msallowclip^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - 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; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context !== document && context; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is no seed and only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome<14 -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; - }); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); -}; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - len = this.length, - ret = [], - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -}); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - init = jQuery.fn.init = function( selector, context ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : - // Execute immediately if ready is not present - selector( jQuery ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; - }, - - sibling: function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; - } -}); - -jQuery.fn.extend({ - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter(function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - matched.push( cur ); - break; - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.unique( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return elem.contentDocument || jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.unique( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -}); -var rnotwhite = (/\S+/g); - - - -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( values === progressValues ) { - deferred.notifyWith( contexts, values ); - } else if ( !( --remaining ) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); - - -// The deferred used on DOM ready -var readyList; - -jQuery.fn.ready = function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; -}; - -jQuery.extend({ - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); - } - } -}); - -/** - * The ready event handler and self cleanup method - */ -function completed() { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - jQuery.ready(); -} - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - } else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - } - } - return readyList.promise( obj ); -}; - -// Kick off the DOM ready check even if the user does not -jQuery.ready.promise(); - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - len ? fn( elems[0], key ) : emptyGet; -}; - - -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( owner ) { - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - /* jshint -W018 */ - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - -function Data() { - // Support: Android < 4, - // Old WebKit does not have Object.preventExtensions/freeze method, - // return new empty object instead with no [[set]] accessor - Object.defineProperty( this.cache = {}, 0, { - get: function() { - return {}; - } - }); - - this.expando = jQuery.expando + Math.random(); -} - -Data.uid = 1; -Data.accepts = jQuery.acceptData; - -Data.prototype = { - key: function( owner ) { - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return the key for a frozen object. - if ( !Data.accepts( owner ) ) { - return 0; - } - - var descriptor = {}, - // Check if the owner object already has a cache key - unlock = owner[ this.expando ]; - - // If not, create one - if ( !unlock ) { - unlock = Data.uid++; - - // Secure it in a non-enumerable, non-writable property - try { - descriptor[ this.expando ] = { value: unlock }; - Object.defineProperties( owner, descriptor ); - - // Support: Android < 4 - // Fallback to a less secure definition - } catch ( e ) { - descriptor[ this.expando ] = unlock; - jQuery.extend( owner, descriptor ); - } - } - - // Ensure the cache object - if ( !this.cache[ unlock ] ) { - this.cache[ unlock ] = {}; - } - - return unlock; - }, - set: function( owner, data, value ) { - var prop, - // There may be an unlock assigned to this node, - // if there is no entry for this "owner", create one inline - // and set the unlock as though an owner entry had always existed - unlock = this.key( owner ), - cache = this.cache[ unlock ]; - - // Handle: [ owner, key, value ] args - if ( typeof data === "string" ) { - cache[ data ] = value; - - // Handle: [ owner, { properties } ] args - } else { - // Fresh assignments by object are shallow copied - if ( jQuery.isEmptyObject( cache ) ) { - jQuery.extend( this.cache[ unlock ], data ); - // Otherwise, copy the properties one-by-one to the cache object - } else { - for ( prop in data ) { - cache[ prop ] = data[ prop ]; - } - } - } - return cache; - }, - get: function( owner, key ) { - // Either a valid cache is found, or will be created. - // New caches will be created and the unlock returned, - // allowing direct access to the newly created - // empty data object. A valid owner object must be provided. - var cache = this.cache[ this.key( owner ) ]; - - return key === undefined ? - cache : cache[ key ]; - }, - access: function( owner, key, value ) { - var stored; - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ((key && typeof key === "string") && value === undefined) ) { - - stored = this.get( owner, key ); - - return stored !== undefined ? - stored : this.get( owner, jQuery.camelCase(key) ); - } - - // [*]When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, name, camel, - unlock = this.key( owner ), - cache = this.cache[ unlock ]; - - if ( key === undefined ) { - this.cache[ unlock ] = {}; - - } else { - // Support array or space separated string of keys - if ( jQuery.isArray( key ) ) { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = key.concat( key.map( jQuery.camelCase ) ); - } else { - camel = jQuery.camelCase( key ); - // Try the string as a key before any manipulation - if ( key in cache ) { - name = [ key, camel ]; - } else { - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - name = camel; - name = name in cache ? - [ name ] : ( name.match( rnotwhite ) || [] ); - } - } - - i = name.length; - while ( i-- ) { - delete cache[ name[ i ] ]; - } - } - }, - hasData: function( owner ) { - return !jQuery.isEmptyObject( - this.cache[ owner[ this.expando ] ] || {} - ); - }, - discard: function( owner ) { - if ( owner[ this.expando ] ) { - delete this.cache[ owner[ this.expando ] ]; - } - } -}; -var data_priv = new Data(); - -var data_user = new Data(); - - - -/* - Implementation Summary - - 1. Enforce API surface and semantic compatibility with 1.9.x branch - 2. Improve the module's maintainability by reducing the storage - paths to a single mechanism. - 3. Use the same single mechanism to support "private" and "user" data. - 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) - 5. Avoid exposing implementation details on user objects (eg. expando properties) - 6. Provide a clear path for implementation upgrade to WeakMap in 2014 -*/ -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - data_user.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend({ - hasData: function( elem ) { - return data_user.hasData( elem ) || data_priv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return data_user.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - data_user.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to data_priv methods, these can be deprecated. - _data: function( elem, name, data ) { - return data_priv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - data_priv.remove( elem, name ); - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = data_user.get( elem ); - - if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE11+ - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - data_priv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - data_user.set( this, key ); - }); - } - - return access( this, function( value ) { - var data, - camelKey = jQuery.camelCase( key ); - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - // Attempt to get data from the cache - // with the key as-is - data = data_user.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to get data from the cache - // with the key camelized - data = data_user.get( elem, camelKey ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, camelKey, undefined ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each(function() { - // First, attempt to store a copy or reference of any - // data that might've been store with a camelCased key. - var data = data_user.get( this, camelKey ); - - // For HTML5 data-* attribute interop, we have to - // store property names with dashes in a camelCase form. - // This might not apply to all properties...* - data_user.set( this, camelKey, value ); - - // *... In the case of properties that might _actually_ - // have dashes, we need to also store a copy of that - // unchanged property. - if ( key.indexOf("-") !== -1 && data !== undefined ) { - data_user.set( this, key, value ); - } - }); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each(function() { - data_user.remove( this, key ); - }); - } -}); - - -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = data_priv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray( data ) ) { - queue = data_priv.access( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return data_priv.get( elem, key ) || data_priv.access( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - data_priv.remove( elem, [ type + "queue", key ] ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = data_priv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHidden = function( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); - }; - -var rcheckableType = (/^(?:checkbox|radio)$/i); - - - -(function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // #11217 - WebKit loses check when the name is after the checked attribute - // Support: Windows Web Apps (WWA) - // `name` and `type` need .setAttribute for WWA - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 - // old WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Make sure textarea (and checkbox) defaultValue is properly cloned - // Support: IE9-IE11+ - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; -})(); -var strundefined = typeof undefined; - - - -support.focusinBubbles = "onfocusin" in window; - - -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = data_priv.get( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = data_priv.hasData( elem ) && data_priv.get( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - data_priv.remove( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, j, ret, matched, handleObj, - handlerQueue = [], - args = slice.call( arguments ), - handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, matches, sel, handleObj, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.disabled !== true || event.type !== "click" ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: Cordova 2.5 (WebKit) (#13255) - // All events should have a target; Cordova deviceready doesn't - if ( !event.target ) { - event.target = document; - } - - // Support: Safari 6.0+, Chrome < 28 - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - this.focus(); - return false; - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } -}; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - // Support: Android < 4.0 - src.returnValue === false ? - returnTrue : - returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && e.preventDefault ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && e.stopPropagation ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && e.stopImmediatePropagation ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -// Support: Chrome 15+ -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // 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 && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// Create "bubbling" focus and blur events -// Support: Firefox, Chrome, Safari -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = data_priv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - data_priv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = data_priv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - data_priv.remove( doc, fix ); - - } else { - data_priv.access( doc, fix, attaches ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); - - -var - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rhtml = /<|&#?\w+;/, - rnoInnerhtml = /<(?:script|style|link)/i, - // checked="checked" or checked - rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, - rscriptType = /^$|\/(?:java|ecma)script/i, - rscriptTypeMasked = /^true\/(.*)/, - rcleanScript = /^\s*\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - - // Support: IE 9 - option: [ 1, "" ], - - thead: [ 1, "", "
    " ], - col: [ 2, "", "
    " ], - tr: [ 2, "", "
    " ], - td: [ 3, "", "
    " ], - - _default: [ 0, "", "" ] - }; - -// Support: IE 9 -wrapMap.optgroup = wrapMap.option; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: 1.x compatibility -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - - if ( match ) { - elem.type = match[ 1 ]; - } else { - elem.removeAttribute("type"); - } - - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - data_priv.set( - elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" ) - ); - } -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( data_priv.hasData( src ) ) { - pdataOld = data_priv.access( src ); - pdataCur = data_priv.set( dest, pdataOld ); - events = pdataOld.events; - - if ( events ) { - delete pdataCur.handle; - pdataCur.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( data_user.hasData( src ) ) { - udataOld = data_user.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - data_user.set( dest, udataCur ); - } -} - -function getAll( context, tag ) { - var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) : - context.querySelectorAll ? context.querySelectorAll( tag || "*" ) : - []; - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], ret ) : - ret; -} - -// Support: IE >= 9 -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = jQuery.contains( elem.ownerDocument, elem ); - - // Support: IE >= 9 - // Fix Cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var elem, tmp, tag, wrap, contains, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - // Support: QtWebKit - // jQuery.merge because push.apply(_, arraylike) throws - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: QtWebKit - // jQuery.merge because push.apply(_, arraylike) throws - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Fixes #12346 - // Support: Webkit, IE - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; - }, - - cleanData: function( elems ) { - var data, elem, type, key, - special = jQuery.event.special, - i = 0; - - for ( ; (elem = elems[ i ]) !== undefined; i++ ) { - if ( jQuery.acceptData( elem ) ) { - key = elem[ data_priv.expando ]; - - if ( key && (data = data_priv.cache[ key ]) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - if ( data_priv.cache[ key ] ) { - // Discard any remaining `private` data - delete data_priv.cache[ key ]; - } - } - } - // Discard any remaining `user` data - delete data_user.cache[ elem[ data_user.expando ] ]; - } - } -}); - -jQuery.fn.extend({ - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each(function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - }); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map(function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var arg = arguments[ 0 ]; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; - - jQuery.cleanData( getAll( this ) ); - - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[ 0 ], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - // Support: QtWebKit - // jQuery.merge because push.apply(_, arraylike) throws - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); - } - } - } - } - } - } - - return this; - } -}); - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: QtWebKit - // .get() because push.apply(_, arraylike) throws - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - - -var iframe, - elemdisplay = {}; - -/** - * Retrieve the actual display of a element - * @param {String} name nodeName of the element - * @param {Object} doc Document object - */ -// Called only from within defaultDisplay -function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? - - // Use of this method is a temporary fix (more like optmization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); - - // We don't have any data stored on the element, - // so use "detach" method as fast way to get rid of the element - elem.detach(); - - return display; -} - -/** - * Try to determine the default display value of an element - * @param {String} nodeName - */ -function defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - - // Use the already-created iframe if possible - iframe = (iframe || jQuery( "
    - - - - - - --> - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebook-viz.html b/ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebook-viz.html deleted file mode 100644 index 3c0afd29a..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebook-viz.html +++ /dev/null @@ -1,26 +0,0 @@ - -
    - - -
    - - -
    diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebook.htm b/ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebook.htm deleted file mode 100644 index bfd74ad32..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebook.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebookInputs.html b/ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebookInputs.html deleted file mode 100644 index 0a28b50ed..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/notebook-integration/scripts/view-models/notebookInputs.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - -
    -
    -
    -
    - -
    -
    - - - - - - -
    -
    -
    - -
    - -
    - -
    - -
    -
    - -
    - -
    - - - Remove -
    -
    -
    -
    - - - - -
    - -
    - Submit -
    - - - -
    - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/att_angular_gridster/angular-gridster.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/att_angular_gridster/angular-gridster.js deleted file mode 100644 index 985fa4341..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/att_angular_gridster/angular-gridster.js +++ /dev/null @@ -1,2244 +0,0 @@ -/*global define:true*/ -(function(root, factory) { - - 'use strict'; - - if (typeof define === 'function' && define.amd) { - // AMD - define(['angular'], factory); - } else if (typeof exports === 'object') { - // CommonJS - module.exports = factory(require('angular')); - } else { - // Browser, nothing "exported". Only registered as a module with angular. - factory(root.angular); - } -}(this, function(angular) { - - 'use strict'; - - var ie8 = false; - - var getInternetExplorerVersion = function () - // Returns the version of Internet Explorer >4 or - // undefined(indicating the use of another browser). - { - var isIE10 = (eval("/*@cc_on!@*/false") && document.documentMode === 10); - if (isIE10) { - return 10; - } - var v = 3, - div = document.createElement('div'), - all = div.getElementsByTagName('i'); - do { - div.innerHTML = ''; - } while (all[0]); - return v > 4 ? v : undefined; - }; - - var browserVersion = getInternetExplorerVersion(); - - if (browserVersion && browserVersion < 9) { - ie8 = true; - } - - // This returned angular module 'gridster' is what is exported. - return angular.module('attGridsterLib', []) - - .constant('gridsterConfig', { - columns: 6, // number of columns in the grid - pushing: true, // whether to push other items out of the way - floating: true, // whether to automatically float items up so they stack - swapping: true, // whether or not to have items switch places instead of push down if they are the same size - width: 'auto', // width of the grid. "auto" will expand the grid to its parent container - colWidth: 'auto', // width of grid columns. "auto" will divide the width of the grid evenly among the columns - rowHeight: 'match', // height of grid rows. 'match' will make it the same as the column width, a numeric value will be interpreted as pixels, '/2' is half the column width, '*5' is five times the column width, etc. - margins: [10, 10], // margins in between grid items - outerMargin: false, - isMobile: false, // toggle mobile view - mobileBreakPoint: 100, // width threshold to toggle mobile mode - mobileModeEnabled: true, // whether or not to toggle mobile mode when screen width is less than mobileBreakPoint - minColumns: 1, // minimum amount of columns the grid can scale down to - minRows: 1, // minimum amount of rows to show if the grid is empty - maxRows: 100, // maximum amount of rows in the grid - defaultSizeX: 1, // default width of an item in columns - defaultSizeY: 1, // default height of an item in rows - minSizeX: 1, // minimum column width of an item - maxSizeX: null, // maximum column width of an item - minSizeY: 1, // minumum row height of an item - maxSizeY: null, // maximum row height of an item - saveGridItemCalculatedHeightInMobile: false, // grid item height in mobile display. true- to use the calculated height by sizeY given - resizable: { // options to pass to resizable handler - enabled: false, - handles: ['s', 'e', 'n', 'w', 'se', 'ne', 'sw', 'nw'] - }, - draggable: { // options to pass to draggable handler - enabled: true, - scrollSensitivity: 20, // Distance in pixels from the edge of the viewport after which the viewport should scroll, relative to pointer - scrollSpeed: 15 // Speed at which the window should scroll once the mouse pointer gets within scrollSensitivity distance - } - }) - - .controller('GridsterCtrl', ['gridsterConfig', '$timeout', - function(gridsterConfig, $timeout) { - - var gridster = this; - - /** - * Create options from gridsterConfig constant - */ - angular.extend(this, gridsterConfig); - - this.resizable = angular.extend({}, gridsterConfig.resizable || {}); - this.draggable = angular.extend({}, gridsterConfig.draggable || {}); - - var flag = false; - this.layoutChanged = function() { - if (flag) { - return; - } - flag = true; - $timeout(function() { - flag = false; - if (gridster.loaded) { - gridster.floatItemsUp(); - } - gridster.updateHeight(gridster.movingItem ? gridster.movingItem.sizeY : 0); - }, 30); - }; - - /** - * A positional array of the items in the grid - */ - this.grid = []; - - /** - * Clean up after yourself - */ - this.destroy = function() { - // empty the grid to cut back on the possibility - // of circular references - if (this.grid) { - this.grid = []; - } - this.$element = null; - }; - - /** - * Overrides default options - * - * @param {Object} options The options to override - */ - this.setOptions = function(options) { - if (!options) { - return; - } - - options = angular.extend({}, options); - - // all this to avoid using jQuery... - if (options.draggable) { - angular.extend(this.draggable, options.draggable); - delete(options.draggable); - } - if (options.resizable) { - angular.extend(this.resizable, options.resizable); - delete(options.resizable); - } - - angular.extend(this, options); - - if (!this.margins || this.margins.length !== 2) { - this.margins = [0, 0]; - } else { - for (var x = 0, l = this.margins.length; x < l; ++x) { - this.margins[x] = parseInt(this.margins[x], 10); - if (isNaN(this.margins[x])) { - this.margins[x] = 0; - } - } - } - }; - - /** - * Check if item can occupy a specified position in the grid - * - * @param {Object} item The item in question - * @param {Number} row The row index - * @param {Number} column The column index - * @returns {Boolean} True if if item fits - */ - this.canItemOccupy = function(item, row, column) { - return row > -1 && column > -1 && item.sizeX + column <= this.columns && item.sizeY + row <= this.maxRows; - }; - - /** - * Set the item in the first suitable position - * - * @param {Object} item The item to insert - */ - this.autoSetItemPosition = function(item) { - // walk through each row and column looking for a place it will fit - for (var rowIndex = 0; rowIndex < this.maxRows; ++rowIndex) { - for (var colIndex = 0; colIndex < this.columns; ++colIndex) { - // only insert if position is not already taken and it can fit - var items = this.getItems(rowIndex, colIndex, item.sizeX, item.sizeY, item); - if (items.length === 0 && this.canItemOccupy(item, rowIndex, colIndex)) { - this.putItem(item, rowIndex, colIndex); - return; - } - } - } - throw new Error('Unable to place item!'); - }; - - /** - * Gets items at a specific coordinate - * - * @param {Number} row - * @param {Number} column - * @param {Number} sizeX - * @param {Number} sizeY - * @param {Array} excludeItems An array of items to exclude from selection - * @returns {Array} Items that match the criteria - */ - this.getItems = function(row, column, sizeX, sizeY, excludeItems) { - var items = []; - if (!sizeX || !sizeY) { - sizeX = sizeY = 1; - } - if (excludeItems && !(excludeItems instanceof Array)) { - excludeItems = [excludeItems]; - } - for (var h = 0; h < sizeY; ++h) { - for (var w = 0; w < sizeX; ++w) { - var item = this.getItem(row + h, column + w, excludeItems); - if (item && (!excludeItems || excludeItems.indexOf(item) === -1) && items.indexOf(item) === -1) { - items.push(item); - } - } - } - return items; - }; - - /** - * @param {Array} items - * @returns {Object} An item that represents the bounding box of the items - */ - this.getBoundingBox = function(items) { - - if (items.length === 0) { - return null; - } - if (items.length === 1) { - return { - row: items[0].row, - col: items[0].col, - sizeY: items[0].sizeY, - sizeX: items[0].sizeX - }; - } - - var maxRow = 0; - var maxCol = 0; - var minRow = 9999; - var minCol = 9999; - - for (var i = 0, l = items.length; i < l; ++i) { - var item = items[i]; - minRow = Math.min(item.row, minRow); - minCol = Math.min(item.col, minCol); - maxRow = Math.max(item.row + item.sizeY, maxRow); - maxCol = Math.max(item.col + item.sizeX, maxCol); - } - - return { - row: minRow, - col: minCol, - sizeY: maxRow - minRow, - sizeX: maxCol - minCol - }; - }; - - - /** - * Removes an item from the grid - * - * @param {Object} item - */ - this.removeItem = function(item) { - for (var rowIndex = 0, l = this.grid.length; rowIndex < l; ++rowIndex) { - var columns = this.grid[rowIndex]; - if (!columns) { - continue; - } - var index = columns.indexOf(item); - if (index !== -1) { - columns[index] = null; - break; - } - } - this.layoutChanged(); - }; - - /** - * Returns the item at a specified coordinate - * - * @param {Number} row - * @param {Number} column - * @param {Array} excludeItems Items to exclude from selection - * @returns {Object} The matched item or null - */ - this.getItem = function(row, column, excludeItems) { - if (excludeItems && !(excludeItems instanceof Array)) { - excludeItems = [excludeItems]; - } - var sizeY = 1; - while (row > -1) { - var sizeX = 1, - col = column; - while (col > -1) { - var items = this.grid[row]; - if (items) { - var item = items[col]; - if (item && (!excludeItems || excludeItems.indexOf(item) === -1) && item.sizeX >= sizeX && item.sizeY >= sizeY) { - return item; - } - } - ++sizeX; - --col; - } - --row; - ++sizeY; - } - return null; - }; - - /** - * Insert an array of items into the grid - * - * @param {Array} items An array of items to insert - */ - this.putItems = function(items) { - for (var i = 0, l = items.length; i < l; ++i) { - this.putItem(items[i]); - } - }; - - /** - * Insert a single item into the grid - * - * @param {Object} item The item to insert - * @param {Number} row (Optional) Specifies the items row index - * @param {Number} column (Optional) Specifies the items column index - * @param {Array} ignoreItems - */ - this.putItem = function(item, row, column, ignoreItems) { - // auto place item if no row specified - if (typeof row === 'undefined' || row === null) { - row = item.row; - column = item.col; - if (typeof row === 'undefined' || row === null) { - this.autoSetItemPosition(item); - return; - } - } - - // keep item within allowed bounds - if (!this.canItemOccupy(item, row, column)) { - column = Math.min(this.columns - item.sizeX, Math.max(0, column)); - row = Math.min(this.maxRows - item.sizeY, Math.max(0, row)); - } - - // check if item is already in grid - if (item.oldRow !== null && typeof item.oldRow !== 'undefined') { - var samePosition = item.oldRow === row && item.oldColumn === column; - var inGrid = this.grid[row] && this.grid[row][column] === item; - if (samePosition && inGrid) { - item.row = row; - item.col = column; - return; - } else { - // remove from old position - var oldRow = this.grid[item.oldRow]; - if (oldRow && oldRow[item.oldColumn] === item) { - delete oldRow[item.oldColumn]; - } - } - } - - item.oldRow = item.row = row; - item.oldColumn = item.col = column; - - this.moveOverlappingItems(item, ignoreItems); - - if (!this.grid[row]) { - this.grid[row] = []; - } - this.grid[row][column] = item; - - if (this.movingItem === item) { - this.floatItemUp(item); - } - this.layoutChanged(); - }; - - /** - * Trade row and column if item1 with item2 - * - * @param {Object} item1 - * @param {Object} item2 - */ - this.swapItems = function(item1, item2) { - this.grid[item1.row][item1.col] = item2; - this.grid[item2.row][item2.col] = item1; - - var item1Row = item1.row; - var item1Col = item1.col; - item1.row = item2.row; - item1.col = item2.col; - item2.row = item1Row; - item2.col = item1Col; - }; - - /** - * Prevents items from being overlapped - * - * @param {Object} item The item that should remain - * @param {Array} ignoreItems - */ - this.moveOverlappingItems = function(item, ignoreItems) { - // don't move item, so ignore it - if (!ignoreItems) { - ignoreItems = [item]; - } else if (ignoreItems.indexOf(item) === -1) { - ignoreItems = ignoreItems.slice(0); - ignoreItems.push(item); - } - - // get the items in the space occupied by the item's coordinates - var overlappingItems = this.getItems( - item.row, - item.col, - item.sizeX, - item.sizeY, - ignoreItems - ); - this.moveItemsDown(overlappingItems, item.row + item.sizeY, ignoreItems); - }; - - /** - * Moves an array of items to a specified row - * - * @param {Array} items The items to move - * @param {Number} newRow The target row - * @param {Array} ignoreItems - */ - this.moveItemsDown = function(items, newRow, ignoreItems) { - if (!items || items.length === 0) { - return; - } - items.sort(function(a, b) { - return a.row - b.row; - }); - - ignoreItems = ignoreItems ? ignoreItems.slice(0) : []; - var topRows = {}, - item, i, l; - - // calculate the top rows in each column - for (i = 0, l = items.length; i < l; ++i) { - item = items[i]; - var topRow = topRows[item.col]; - if (typeof topRow === 'undefined' || item.row < topRow) { - topRows[item.col] = item.row; - } - } - - // move each item down from the top row in its column to the row - for (i = 0, l = items.length; i < l; ++i) { - item = items[i]; - var rowsToMove = newRow - topRows[item.col]; - this.moveItemDown(item, item.row + rowsToMove, ignoreItems); - ignoreItems.push(item); - } - }; - - /** - * Moves an item down to a specified row - * - * @param {Object} item The item to move - * @param {Number} newRow The target row - * @param {Array} ignoreItems - */ - this.moveItemDown = function(item, newRow, ignoreItems) { - if (item.row >= newRow) { - return; - } - while (item.row < newRow) { - ++item.row; - this.moveOverlappingItems(item, ignoreItems); - } - this.putItem(item, item.row, item.col, ignoreItems); - }; - - /** - * Moves all items up as much as possible - */ - this.floatItemsUp = function() { - if (this.floating === false) { - return; - } - for (var rowIndex = 0, l = this.grid.length; rowIndex < l; ++rowIndex) { - var columns = this.grid[rowIndex]; - if (!columns) { - continue; - } - for (var colIndex = 0, len = columns.length; colIndex < len; ++colIndex) { - var item = columns[colIndex]; - if (item) { - this.floatItemUp(item); - } - } - } - }; - - /** - * Float an item up to the most suitable row - * - * @param {Object} item The item to move - */ - this.floatItemUp = function(item) { - if (this.floating === false) { - return; - } - var colIndex = item.col, - sizeY = item.sizeY, - sizeX = item.sizeX, - bestRow = null, - bestColumn = null, - rowIndex = item.row - 1; - - while (rowIndex > -1) { - var items = this.getItems(rowIndex, colIndex, sizeX, sizeY, item); - if (items.length !== 0) { - break; - } - bestRow = rowIndex; - bestColumn = colIndex; - --rowIndex; - } - if (bestRow !== null) { - this.putItem(item, bestRow, bestColumn); - } - }; - - /** - * Update gridsters height - * - * @param {Number} plus (Optional) Additional height to add - */ - this.updateHeight = function(plus) { - var maxHeight = this.minRows; - plus = plus || 0; - for (var rowIndex = this.grid.length; rowIndex >= 0; --rowIndex) { - var columns = this.grid[rowIndex]; - if (!columns) { - continue; - } - for (var colIndex = 0, len = columns.length; colIndex < len; ++colIndex) { - if (columns[colIndex]) { - maxHeight = Math.max(maxHeight, rowIndex + plus + columns[colIndex].sizeY); - } - } - } - this.gridHeight = this.maxRows - maxHeight > 0 ? Math.min(this.maxRows, maxHeight) : Math.max(this.maxRows, maxHeight); - }; - - /** - * Returns the number of rows that will fit in given amount of pixels - * - * @param {Number} pixels - * @param {Boolean} ceilOrFloor (Optional) Determines rounding method - */ - this.pixelsToRows = function(pixels, ceilOrFloor) { - if (ceilOrFloor === true) { - return Math.ceil(pixels / this.curRowHeight); - } else if (ceilOrFloor === false) { - return Math.floor(pixels / this.curRowHeight); - } - - return Math.round(pixels / this.curRowHeight); - }; - - /** - * Returns the number of columns that will fit in a given amount of pixels - * - * @param {Number} pixels - * @param {Boolean} ceilOrFloor (Optional) Determines rounding method - * @returns {Number} The number of columns - */ - this.pixelsToColumns = function(pixels, ceilOrFloor) { - if (ceilOrFloor === true) { - return Math.ceil(pixels / this.curColWidth); - } else if (ceilOrFloor === false) { - return Math.floor(pixels / this.curColWidth); - } - - return Math.round(pixels / this.curColWidth); - }; - } - ]) - - .directive('gridsterPreview', function() { - return { - replace: true, - scope: true, - require: '^gridster', - template: '
    ', - link: function(scope, $el, attrs, gridster) { - - /** - * @returns {Object} style object for preview element - */ - scope.previewStyle = function() { - - if (!gridster.movingItem) { - return { - display: 'none' - }; - } - - return { - display: 'block', - height: (gridster.movingItem.sizeY * gridster.curRowHeight - gridster.margins[0]) + 'px', - width: (gridster.movingItem.sizeX * gridster.curColWidth - gridster.margins[1]) + 'px', - top: (gridster.movingItem.row * gridster.curRowHeight + (gridster.outerMargin ? gridster.margins[0] : 0)) + 'px', - left: (gridster.movingItem.col * gridster.curColWidth + (gridster.outerMargin ? gridster.margins[1] : 0)) + 'px' - }; - }; - } - }; - }) - - /** - * The gridster directive - * - * @param {Function} $timeout - * @param {Object} $window - * @param {Object} $rootScope - * @param {Function} gridsterDebounce - */ - .directive('gridster', ['$timeout', '$window', '$rootScope', 'gridsterDebounce', - function($timeout, $window, $rootScope, gridsterDebounce) { - return { - scope: true, - restrict: 'EAC', - controller: 'GridsterCtrl', - controllerAs: 'gridster', - compile: function($tplElem) { - - $tplElem.prepend('
    '); - - return function(scope, $elem, attrs, gridster) { - gridster.loaded = false; - - gridster.$element = $elem; - - scope.gridster = gridster; - - $elem.addClass('gridster'); - - var isVisible = function(ele) { - return ele.style.visibility !== 'hidden' && ele.style.display !== 'none'; - }; - - function refresh(config) { - gridster.setOptions(config); - - if (!isVisible($elem[0])) { - return; - } - - // resolve "auto" & "match" values - if (gridster.width === 'auto') { - gridster.curWidth = $elem[0].offsetWidth || parseInt($elem.css('width'), 10); - } else { - gridster.curWidth = gridster.width; - } - - if (gridster.colWidth === 'auto') { - gridster.curColWidth = (gridster.curWidth + (gridster.outerMargin ? -gridster.margins[1] : gridster.margins[1])) / gridster.columns; - } else { - gridster.curColWidth = gridster.colWidth; - } - - gridster.curRowHeight = gridster.rowHeight; - if (typeof gridster.rowHeight === 'string') { - if (gridster.rowHeight === 'match') { - gridster.curRowHeight = Math.round(gridster.curColWidth); - } else if (gridster.rowHeight.indexOf('*') !== -1) { - gridster.curRowHeight = Math.round(gridster.curColWidth * gridster.rowHeight.replace('*', '').replace(' ', '')); - } else if (gridster.rowHeight.indexOf('/') !== -1) { - gridster.curRowHeight = Math.round(gridster.curColWidth / gridster.rowHeight.replace('/', '').replace(' ', '')); - } - } - - gridster.isMobile = gridster.mobileModeEnabled && gridster.curWidth <= gridster.mobileBreakPoint; - - // loop through all items and reset their CSS - for (var rowIndex = 0, l = gridster.grid.length; rowIndex < l; ++rowIndex) { - var columns = gridster.grid[rowIndex]; - if (!columns) { - continue; - } - - for (var colIndex = 0, len = columns.length; colIndex < len; ++colIndex) { - if (columns[colIndex]) { - var item = columns[colIndex]; - item.setElementPosition(); - item.setElementSizeY(); - item.setElementSizeX(); - } - } - } - - updateHeight(); - } - - var optionsKey = attrs.gridster; - if (optionsKey) { - scope.$parent.$watch(optionsKey, function(newConfig) { - refresh(newConfig); - }, true); - } else { - refresh({}); - } - - scope.$watch(function() { - return gridster.loaded; - }, function() { - if (gridster.loaded) { - $elem.addClass('gridster-loaded'); - } else { - $elem.removeClass('gridster-loaded'); - } - }); - - scope.$watch(function() { - return gridster.isMobile; - }, function() { - if (gridster.isMobile) { - $elem.addClass('gridster-mobile').removeClass('gridster-desktop'); - } else { - $elem.removeClass('gridster-mobile').addClass('gridster-desktop'); - } - $rootScope.$broadcast('gridster-mobile-changed', gridster); - }); - - scope.$watch(function() { - return gridster.draggable; - }, function() { - $rootScope.$broadcast('gridster-draggable-changed', gridster); - }, true); - - scope.$watch(function() { - return gridster.resizable; - }, function() { - $rootScope.$broadcast('gridster-resizable-changed', gridster); - }, true); - - function updateHeight() { - if(gridster.gridHeight){ //need to put this check, otherwise fail in IE8 - $elem.css('height', (gridster.gridHeight * gridster.curRowHeight) + (gridster.outerMargin ? gridster.margins[0] : -gridster.margins[0]) + 'px'); - } - } - - scope.$watch(function() { - return gridster.gridHeight; - }, updateHeight); - - scope.$watch(function() { - return gridster.movingItem; - }, function() { - gridster.updateHeight(gridster.movingItem ? gridster.movingItem.sizeY : 0); - }); - - var prevWidth = $elem[0].offsetWidth || parseInt($elem.css('width'), 10); - - var resize = function() { - var width = $elem[0].offsetWidth || parseInt($elem.css('width'), 10); - - if (!width || width === prevWidth || gridster.movingItem) { - return; - } - prevWidth = width; - - if (gridster.loaded) { - $elem.removeClass('gridster-loaded'); - } - - refresh(); - - if (gridster.loaded) { - $elem.addClass('gridster-loaded'); - } - - $rootScope.$broadcast('gridster-resized', [width, $elem[0].offsetHeight], gridster); - }; - - // track element width changes any way we can - var onResize = gridsterDebounce(function onResize() { - resize(); - $timeout(function() { - scope.$apply(); - }); - }, 100); - - scope.$watch(function() { - return isVisible($elem[0]); - }, onResize); - - // see https://github.com/sdecima/javascript-detect-element-resize - if (typeof window.addResizeListener === 'function') { - window.addResizeListener($elem[0], onResize); - } else { - scope.$watch(function() { - return $elem[0].offsetWidth || parseInt($elem.css('width'), 10); - }, resize); - } - var $win = angular.element($window); - $win.on('resize', onResize); - - // be sure to cleanup - scope.$on('$destroy', function() { - gridster.destroy(); - $win.off('resize', onResize); - if (typeof window.removeResizeListener === 'function') { - window.removeResizeListener($elem[0], onResize); - } - }); - - // allow a little time to place items before floating up - $timeout(function() { - scope.$watch('gridster.floating', function() { - gridster.floatItemsUp(); - }); - gridster.loaded = true; - }, 100); - }; - } - }; - } - ]) - - .controller('GridsterItemCtrl', function() { - this.$element = null; - this.gridster = null; - this.row = null; - this.col = null; - this.sizeX = null; - this.sizeY = null; - this.minSizeX = 0; - this.minSizeY = 0; - this.maxSizeX = null; - this.maxSizeY = null; - - this.init = function($element, gridster) { - this.$element = $element; - this.gridster = gridster; - this.sizeX = gridster.defaultSizeX; - this.sizeY = gridster.defaultSizeY; - }; - - this.destroy = function() { - // set these to null to avoid the possibility of circular references - this.gridster = null; - this.$element = null; - }; - - /** - * Returns the items most important attributes - */ - this.toJSON = function() { - return { - row: this.row, - col: this.col, - sizeY: this.sizeY, - sizeX: this.sizeX - }; - }; - - this.isMoving = function() { - return this.gridster.movingItem === this; - }; - - /** - * Set the items position - * - * @param {Number} row - * @param {Number} column - */ - this.setPosition = function(row, column) { - this.gridster.putItem(this, row, column); - - if (!this.isMoving()) { - this.setElementPosition(); - } - }; - - /** - * Sets a specified size property - * - * @param {String} key Can be either "x" or "y" - * @param {Number} value The size amount - * @param {Boolean} preventMove - */ - this.setSize = function(key, value, preventMove) { - key = key.toUpperCase(); - var camelCase = 'size' + key, - titleCase = 'Size' + key; - if (value === '') { - return; - } - value = parseInt(value, 10); - if (isNaN(value) || value === 0) { - value = this.gridster['default' + titleCase]; - } - var max = key === 'X' ? this.gridster.columns : this.gridster.maxRows; - if (this['max' + titleCase]) { - max = Math.min(this['max' + titleCase], max); - } - if (this.gridster['max' + titleCase]) { - max = Math.min(this.gridster['max' + titleCase], max); - } - if (key === 'X' && this.cols) { - max -= this.cols; - } else if (key === 'Y' && this.rows) { - max -= this.rows; - } - - var min = 0; - if (this['min' + titleCase]) { - min = Math.max(this['min' + titleCase], min); - } - if (this.gridster['min' + titleCase]) { - min = Math.max(this.gridster['min' + titleCase], min); - } - - value = Math.max(Math.min(value, max), min); - - var changed = (this[camelCase] !== value || (this['old' + titleCase] && this['old' + titleCase] !== value)); - this['old' + titleCase] = this[camelCase] = value; - - if (!this.isMoving()) { - this['setElement' + titleCase](); - } - if (!preventMove && changed) { - this.gridster.moveOverlappingItems(this); - this.gridster.layoutChanged(); - } - - return changed; - }; - - /** - * Sets the items sizeY property - * - * @param {Number} rows - * @param {Boolean} preventMove - */ - this.setSizeY = function(rows, preventMove) { - return this.setSize('Y', rows, preventMove); - }; - - /** - * Sets the items sizeX property - * - * @param {Number} columns - * @param {Boolean} preventMove - */ - this.setSizeX = function(columns, preventMove) { - return this.setSize('X', columns, preventMove); - }; - - /** - * Sets an elements position on the page - */ - this.setElementPosition = function() { - if (this.gridster.isMobile) { - this.$element.css({ - marginLeft: this.gridster.margins[0] + 'px', - marginRight: this.gridster.margins[0] + 'px', - marginTop: this.gridster.margins[1] + 'px', - marginBottom: this.gridster.margins[1] + 'px', - top: '', - left: '' - }); - } else { - this.$element.css({ - margin: 0, - top: (this.row * this.gridster.curRowHeight + (this.gridster.outerMargin ? this.gridster.margins[0] : 0)) + 'px', - left: (this.col * this.gridster.curColWidth + (this.gridster.outerMargin ? this.gridster.margins[1] : 0)) + 'px' - }); - } - }; - - /** - * Sets an elements height - */ - this.setElementSizeY = function() { - if (this.gridster.isMobile && !this.gridster.saveGridItemCalculatedHeightInMobile) { - this.$element.css('height', ''); - } else { - var computedHeight = (this.sizeY * this.gridster.curRowHeight - this.gridster.margins[0]) + 'px'; - //this.$element.css('height', computedHeight); - this.$element.attr('style', this.$element.attr('style') + '; ' + 'height: '+computedHeight+' !important;'); - } - }; - - /** - * Sets an elements width - */ - this.setElementSizeX = function() { - if (this.gridster.isMobile) { - this.$element.css('width', ''); - } else { - this.$element.css('width', (this.sizeX * this.gridster.curColWidth - this.gridster.margins[1]) + 'px'); - } - }; - - /** - * Gets an element's width - */ - this.getElementSizeX = function() { - return (this.sizeX * this.gridster.curColWidth - this.gridster.margins[1]); - }; - - /** - * Gets an element's height - */ - this.getElementSizeY = function() { - return (this.sizeY * this.gridster.curRowHeight - this.gridster.margins[0]); - }; - - }) - - .factory('GridsterTouch', [function() { - return function GridsterTouch(target, startEvent, moveEvent, endEvent) { - var lastXYById = {}; - - // Opera doesn't have Object.keys so we use this wrapper - var numberOfKeys = function(theObject) { - if (Object.keys) { - return Object.keys(theObject).length; - } - - var n = 0, - key; - for (key in theObject) { - ++n; - } - - return n; - }; - - // this calculates the delta needed to convert pageX/Y to offsetX/Y because offsetX/Y don't exist in the TouchEvent object or in Firefox's MouseEvent object - var computeDocumentToElementDelta = function(theElement) { - var elementLeft = 0; - var elementTop = 0; - var oldIEUserAgent = navigator.userAgent.match(/\bMSIE\b/); - - for (var offsetElement = theElement; offsetElement != null; offsetElement = offsetElement.offsetParent) { - // the following is a major hack for versions of IE less than 8 to avoid an apparent problem on the IEBlog with double-counting the offsets - // this may not be a general solution to IE7's problem with offsetLeft/offsetParent - if (oldIEUserAgent && - (!document.documentMode || document.documentMode < 8) && - offsetElement.currentStyle.position === 'relative' && offsetElement.offsetParent && offsetElement.offsetParent.currentStyle.position === 'relative' && offsetElement.offsetLeft === offsetElement.offsetParent.offsetLeft) { - // add only the top - elementTop += offsetElement.offsetTop; - } else { - elementLeft += offsetElement.offsetLeft; - elementTop += offsetElement.offsetTop; - } - } - - return { - x: elementLeft, - y: elementTop - }; - }; - - // cache the delta from the document to our event target (reinitialized each mousedown/MSPointerDown/touchstart) - var documentToTargetDelta = computeDocumentToElementDelta(target); - - // common event handler for the mouse/pointer/touch models and their down/start, move, up/end, and cancel events - var doEvent = function(theEvtObj) { - - if (theEvtObj.type === 'mousemove' && numberOfKeys(lastXYById) === 0) { - return; - } - - var prevent = true; - - var pointerList = theEvtObj.changedTouches ? theEvtObj.changedTouches : [theEvtObj]; - - for (var i = 0; i < pointerList.length; ++i) { - var pointerObj = pointerList[i]; - var pointerId = (typeof pointerObj.identifier !== 'undefined') ? pointerObj.identifier : (typeof pointerObj.pointerId !== 'undefined') ? pointerObj.pointerId : 1; - - // use the pageX/Y coordinates to compute target-relative coordinates when we have them (in ie < 9, we need to do a little work to put them there) - if (typeof pointerObj.pageX === 'undefined') { - - // initialize assuming our source element is our target - if(!ie8){ - pointerObj.pageX = pointerObj.offsetX + documentToTargetDelta.x; - pointerObj.pageY = pointerObj.offsetY + documentToTargetDelta.y; - } - else{ - pointerObj.pageX = pointerObj.clientX; - pointerObj.pageY = pointerObj.clientY; - } - - if (pointerObj.srcElement.offsetParent === target && document.documentMode && document.documentMode === 8 && pointerObj.type === 'mousedown') { - // source element is a child piece of VML, we're in IE8, and we've not called setCapture yet - add the origin of the source element - pointerObj.pageX += pointerObj.srcElement.offsetLeft; - pointerObj.pageY += pointerObj.srcElement.offsetTop; - } else if (pointerObj.srcElement !== target && !document.documentMode || document.documentMode < 8) { - // source element isn't the target (most likely it's a child piece of VML) and we're in a version of IE before IE8 - - // the offsetX/Y values are unpredictable so use the clientX/Y values and adjust by the scroll offsets of its parents - // to get the document-relative coordinates (the same as pageX/Y) - var sx = -2, - sy = -2; // adjust for old IE's 2-pixel border - for (var scrollElement = pointerObj.srcElement; scrollElement !== null; scrollElement = scrollElement.parentNode) { - sx += scrollElement.scrollLeft ? scrollElement.scrollLeft : 0; - sy += scrollElement.scrollTop ? scrollElement.scrollTop : 0; - } - - pointerObj.pageX = pointerObj.clientX + sx; - pointerObj.pageY = pointerObj.clientY + sy; - } - } - - - var pageX = pointerObj.pageX; - var pageY = pointerObj.pageY; - - if (theEvtObj.type.match(/(start|down)$/i)) { - // clause for processing MSPointerDown, touchstart, and mousedown - - // refresh the document-to-target delta on start in case the target has moved relative to document - documentToTargetDelta = computeDocumentToElementDelta(target); - - // protect against failing to get an up or end on this pointerId - if (lastXYById[pointerId]) { - if (endEvent) { - endEvent({ - target: theEvtObj.target, - which: theEvtObj.which, - pointerId: pointerId, - pageX: pageX, - pageY: pageY - }); - } - - delete lastXYById[pointerId]; - } - - if (startEvent) { - if (prevent) { - prevent = startEvent({ - target: theEvtObj.target, - which: theEvtObj.which, - pointerId: pointerId, - pageX: pageX, - pageY: pageY - }); - } - } - - // init last page positions for this pointer - lastXYById[pointerId] = { - x: pageX, - y: pageY - }; - - // IE pointer model - if (target.msSetPointerCapture) { - target.msSetPointerCapture(pointerId); - } else if (theEvtObj.type === 'mousedown' && numberOfKeys(lastXYById) === 1) { - if (useSetReleaseCapture) { - target.setCapture(true); - } else { - document.addEventListener('mousemove', doEvent, false); - document.addEventListener('mouseup', doEvent, false); - } - } - } else if (theEvtObj.type.match(/move$/i)) { - // clause handles mousemove, MSPointerMove, and touchmove - - if (lastXYById[pointerId] && !(lastXYById[pointerId].x === pageX && lastXYById[pointerId].y === pageY)) { - // only extend if the pointer is down and it's not the same as the last point - - if (moveEvent && prevent) { - prevent = moveEvent({ - target: theEvtObj.target, - which: theEvtObj.which, - pointerId: pointerId, - pageX: pageX, - pageY: pageY - }); - } - - // update last page positions for this pointer - lastXYById[pointerId].x = pageX; - lastXYById[pointerId].y = pageY; - } - } else if (lastXYById[pointerId] && theEvtObj.type.match(/(up|end|cancel)$/i)) { - // clause handles up/end/cancel - - if (endEvent && prevent) { - prevent = endEvent({ - target: theEvtObj.target, - which: theEvtObj.which, - pointerId: pointerId, - pageX: pageX, - pageY: pageY - }); - } - - // delete last page positions for this pointer - delete lastXYById[pointerId]; - - // in the Microsoft pointer model, release the capture for this pointer - // in the mouse model, release the capture or remove document-level event handlers if there are no down points - // nothing is required for the iOS touch model because capture is implied on touchstart - if (target.msReleasePointerCapture) { - target.msReleasePointerCapture(pointerId); - } else if (theEvtObj.type === 'mouseup' && numberOfKeys(lastXYById) === 0) { - if (useSetReleaseCapture) { - target.releaseCapture(); - } else { - document.removeEventListener('mousemove', doEvent, false); - document.removeEventListener('mouseup', doEvent, false); - } - } - } - } - - if (prevent) { - if (theEvtObj.preventDefault) { - theEvtObj.preventDefault(); - } - - if (theEvtObj.preventManipulation) { - theEvtObj.preventManipulation(); - } - - if (theEvtObj.preventMouseEvent) { - theEvtObj.preventMouseEvent(); - } - } - }; - - var useSetReleaseCapture = false; - // saving the settings for contentZooming and touchaction before activation - var contentZooming, msTouchAction; - - this.enable = function() { - - if (window.navigator.msPointerEnabled) { - // Microsoft pointer model - target.addEventListener('MSPointerDown', doEvent, false); - target.addEventListener('MSPointerMove', doEvent, false); - target.addEventListener('MSPointerUp', doEvent, false); - target.addEventListener('MSPointerCancel', doEvent, false); - - // css way to prevent panning in our target area - if (typeof target.style.msContentZooming !== 'undefined') { - contentZooming = target.style.msContentZooming; - target.style.msContentZooming = 'none'; - } - - // new in Windows Consumer Preview: css way to prevent all built-in touch actions on our target - // without this, you cannot touch draw on the element because IE will intercept the touch events - if (typeof target.style.msTouchAction !== 'undefined') { - msTouchAction = target.style.msTouchAction; - target.style.msTouchAction = 'none'; - } - } else if (target.addEventListener) { - // iOS touch model - target.addEventListener('touchstart', doEvent, false); - target.addEventListener('touchmove', doEvent, false); - target.addEventListener('touchend', doEvent, false); - target.addEventListener('touchcancel', doEvent, false); - - // mouse model - target.addEventListener('mousedown', doEvent, false); - - // mouse model with capture - // rejecting gecko because, unlike ie, firefox does not send events to target when the mouse is outside target - if (target.setCapture && !window.navigator.userAgent.match(/\bGecko\b/)) { - useSetReleaseCapture = true; - - target.addEventListener('mousemove', doEvent, false); - target.addEventListener('mouseup', doEvent, false); - } - } else if (target.attachEvent && target.setCapture) { - // legacy IE mode - mouse with capture - useSetReleaseCapture = true; - target.attachEvent('onmousedown', function() { - doEvent(window.event); - window.event.returnValue = false; - return false; - }); - target.attachEvent('onmousemove', function() { - doEvent(window.event); - window.event.returnValue = false; - return false; - }); - target.attachEvent('onmouseup', function() { - doEvent(window.event); - window.event.returnValue = false; - return false; - }); - } - }; - - this.disable = function() { - if (window.navigator.msPointerEnabled) { - // Microsoft pointer model - target.removeEventListener('MSPointerDown', doEvent, false); - target.removeEventListener('MSPointerMove', doEvent, false); - target.removeEventListener('MSPointerUp', doEvent, false); - target.removeEventListener('MSPointerCancel', doEvent, false); - - // reset zooming to saved value - if (contentZooming) { - target.style.msContentZooming = contentZooming; - } - - // reset touch action setting - if (msTouchAction) { - target.style.msTouchAction = msTouchAction; - } - } else if (target.removeEventListener) { - // iOS touch model - target.removeEventListener('touchstart', doEvent, false); - target.removeEventListener('touchmove', doEvent, false); - target.removeEventListener('touchend', doEvent, false); - target.removeEventListener('touchcancel', doEvent, false); - - // mouse model - target.removeEventListener('mousedown', doEvent, false); - - // mouse model with capture - // rejecting gecko because, unlike ie, firefox does not send events to target when the mouse is outside target - if (target.setCapture && !window.navigator.userAgent.match(/\bGecko\b/)) { - useSetReleaseCapture = true; - - target.removeEventListener('mousemove', doEvent, false); - target.removeEventListener('mouseup', doEvent, false); - } - } else if (target.detachEvent && target.setCapture) { - // legacy IE mode - mouse with capture - useSetReleaseCapture = true; - target.detachEvent('onmousedown'); - target.detachEvent('onmousemove'); - target.detachEvent('onmouseup'); - } - }; - - return this; - }; - }]) - - .factory('GridsterDraggable', ['$document', '$timeout', '$window', 'GridsterTouch', - function($document, $timeout, $window, GridsterTouch) { - function GridsterDraggable($el, scope, gridster, item, itemOptions) { - - var elmX, elmY, elmW, elmH, - - mouseX = 0, - mouseY = 0, - lastMouseX = 0, - lastMouseY = 0, - mOffX = 0, - mOffY = 0, - - minTop = 0, - maxTop = 9999, - minLeft = 0, - realdocument = $document[0]; - - var originalCol, originalRow; - var inputTags = ['select', 'input', 'textarea', 'button']; - - var gridsterItemDragElement = $el[0].querySelector('[gridster-item-drag]'); - //console.log(gridsterItemDragElement); - var isDraggableAreaDefined = gridsterItemDragElement?true:false; - //console.log(isDraggableAreaDefined); - - function mouseDown(e) { - - if(ie8){ - e.target = window.event.srcElement; - e.which = window.event.button; - } - - if(isDraggableAreaDefined && (!gridsterItemDragElement.contains(e.target))){ - return false; - } - - if (inputTags.indexOf(e.target.nodeName.toLowerCase()) !== -1) { - return false; - } - - var $target = angular.element(e.target); - - // exit, if a resize handle was hit - if ($target.hasClass('gridster-item-resizable-handler')) { - return false; - } - - // exit, if the target has it's own click event - if ($target.attr('onclick') || $target.attr('ng-click')) { - return false; - } - - // only works if you have jQuery - if ($target.closest && $target.closest('.gridster-no-drag').length) { - return false; - } - - switch (e.which) { - case 1: - // left mouse button - break; - case 2: - case 3: - // right or middle mouse button - return; - } - - lastMouseX = e.pageX; - lastMouseY = e.pageY; - - elmX = parseInt($el.css('left'), 10); - elmY = parseInt($el.css('top'), 10); - elmW = $el[0].offsetWidth; - elmH = $el[0].offsetHeight; - - originalCol = item.col; - originalRow = item.row; - - dragStart(e); - - return true; - } - - function mouseMove(e) { - if (!$el.hasClass('gridster-item-moving') || $el.hasClass('gridster-item-resizing')) { - return false; - } - - var maxLeft = gridster.curWidth - 1; - - // Get the current mouse position. - mouseX = e.pageX; - mouseY = e.pageY; - - // Get the deltas - var diffX = mouseX - lastMouseX + mOffX; - var diffY = mouseY - lastMouseY + mOffY; - mOffX = mOffY = 0; - - // Update last processed mouse positions. - lastMouseX = mouseX; - lastMouseY = mouseY; - - var dX = diffX, - dY = diffY; - if (elmX + dX < minLeft) { - diffX = minLeft - elmX; - mOffX = dX - diffX; - } else if (elmX + elmW + dX > maxLeft) { - diffX = maxLeft - elmX - elmW; - mOffX = dX - diffX; - } - - if (elmY + dY < minTop) { - diffY = minTop - elmY; - mOffY = dY - diffY; - } else if (elmY + elmH + dY > maxTop) { - diffY = maxTop - elmY - elmH; - mOffY = dY - diffY; - } - elmX += diffX; - elmY += diffY; - - // set new position - $el.css({ - 'top': elmY + 'px', - 'left': elmX + 'px' - }); - - drag(e); - - return true; - } - - function mouseUp(e) { - if (!$el.hasClass('gridster-item-moving') || $el.hasClass('gridster-item-resizing')) { - return false; - } - - mOffX = mOffY = 0; - - dragStop(e); - - return true; - } - - function dragStart(event) { - $el.addClass('gridster-item-moving'); - gridster.movingItem = item; - - gridster.updateHeight(item.sizeY); - scope.$apply(function() { - if (gridster.draggable && gridster.draggable.start) { - gridster.draggable.start(event, $el, itemOptions); - } - }); - } - - function drag(event) { - var oldRow = item.row, - oldCol = item.col, - hasCallback = gridster.draggable && gridster.draggable.drag, - scrollSensitivity = gridster.draggable.scrollSensitivity, - scrollSpeed = gridster.draggable.scrollSpeed; - - var row = gridster.pixelsToRows(elmY); - var col = gridster.pixelsToColumns(elmX); - - var itemsInTheWay = gridster.getItems(row, col, item.sizeX, item.sizeY, item); - var hasItemsInTheWay = itemsInTheWay.length !== 0; - - if (gridster.swapping === true && hasItemsInTheWay) { - var boundingBoxItem = gridster.getBoundingBox(itemsInTheWay), - sameSize = boundingBoxItem.sizeX === item.sizeX && boundingBoxItem.sizeY === item.sizeY, - sameRow = boundingBoxItem.row === oldRow, - sameCol = boundingBoxItem.col === oldCol, - samePosition = boundingBoxItem.row === row && boundingBoxItem.col === col, - inline = sameRow || sameCol; - - if (sameSize && itemsInTheWay.length === 1) { - if (samePosition) { - gridster.swapItems(item, itemsInTheWay[0]); - } else if (inline) { - return; - } - } else if (boundingBoxItem.sizeX <= item.sizeX && boundingBoxItem.sizeY <= item.sizeY && inline) { - var emptyRow = item.row <= row ? item.row : row + item.sizeY, - emptyCol = item.col <= col ? item.col : col + item.sizeX, - rowOffset = emptyRow - boundingBoxItem.row, - colOffset = emptyCol - boundingBoxItem.col; - - for (var i = 0, l = itemsInTheWay.length; i < l; ++i) { - var itemInTheWay = itemsInTheWay[i]; - - var itemsInFreeSpace = gridster.getItems( - itemInTheWay.row + rowOffset, - itemInTheWay.col + colOffset, - itemInTheWay.sizeX, - itemInTheWay.sizeY, - item - ); - - if (itemsInFreeSpace.length === 0) { - gridster.putItem(itemInTheWay, itemInTheWay.row + rowOffset, itemInTheWay.col + colOffset); - } - } - } - } - - if (gridster.pushing !== false || !hasItemsInTheWay) { - item.row = row; - item.col = col; - } - - if(($window.navigator.appName === 'Microsoft Internet Explorer' && !ie8) || $window.navigator.userAgent.indexOf("Firefox")!==-1){ - if (event.pageY - realdocument.documentElement.scrollTop < scrollSensitivity) { - realdocument.documentElement.scrollTop = realdocument.documentElement.scrollTop - scrollSpeed; - } else if ($window.innerHeight - (event.pageY - realdocument.documentElement.scrollTop) < scrollSensitivity) { - realdocument.documentElement.scrollTop = realdocument.documentElement.scrollTop + scrollSpeed; - } - } - else{ - if (event.pageY - realdocument.body.scrollTop < scrollSensitivity) { - realdocument.body.scrollTop = realdocument.body.scrollTop - scrollSpeed; - } else if ($window.innerHeight - (event.pageY - realdocument.body.scrollTop) < scrollSensitivity) { - realdocument.body.scrollTop = realdocument.body.scrollTop + scrollSpeed; - } - } - - - - if (event.pageX - realdocument.body.scrollLeft < scrollSensitivity) { - realdocument.body.scrollLeft = realdocument.body.scrollLeft - scrollSpeed; - } else if ($window.innerWidth - (event.pageX - realdocument.body.scrollLeft) < scrollSensitivity) { - realdocument.body.scrollLeft = realdocument.body.scrollLeft + scrollSpeed; - } - - if (hasCallback || oldRow !== item.row || oldCol !== item.col) { - scope.$apply(function() { - if (hasCallback) { - gridster.draggable.drag(event, $el, itemOptions); - } - }); - } - } - - function dragStop(event) { - $el.removeClass('gridster-item-moving'); - var row = gridster.pixelsToRows(elmY); - var col = gridster.pixelsToColumns(elmX); - if (gridster.pushing !== false || gridster.getItems(row, col, item.sizeX, item.sizeY, item).length === 0) { - item.row = row; - item.col = col; - } - gridster.movingItem = null; - item.setPosition(item.row, item.col); - - scope.$apply(function() { - if (gridster.draggable && gridster.draggable.stop) { - gridster.draggable.stop(event, $el, itemOptions); - } - }); - } - - var enabled = null; - var $dragHandles = null; - var unifiedInputs = []; - - this.enable = function() { - if (enabled === true) { - return; - } - - // disable and timeout required for some template rendering - $timeout(function() { - // disable any existing draghandles - for (var u = 0, ul = unifiedInputs.length; u < ul; ++u) { - unifiedInputs[u].disable(); - } - unifiedInputs = []; - - if (gridster.draggable && gridster.draggable.handle) { - $dragHandles = angular.element($el[0].querySelectorAll(gridster.draggable.handle)); - if ($dragHandles.length === 0) { - // fall back to element if handle not found... - $dragHandles = $el; - } - } else { - $dragHandles = $el; - } - - for (var h = 0, hl = $dragHandles.length; h < hl; ++h) { - unifiedInputs[h] = new GridsterTouch($dragHandles[h], mouseDown, mouseMove, mouseUp); - unifiedInputs[h].enable(); - } - - enabled = true; - }); - }; - - this.disable = function() { - if (enabled === false) { - return; - } - - // timeout to avoid race contition with the enable timeout - $timeout(function() { - - for (var u = 0, ul = unifiedInputs.length; u < ul; ++u) { - unifiedInputs[u].disable(); - } - - unifiedInputs = []; - enabled = false; - }); - }; - - this.toggle = function(enabled) { - if (enabled) { - this.enable(); - } else { - this.disable(); - } - }; - - this.destroy = function() { - this.disable(); - }; - } - - return GridsterDraggable; - } - ]) - - .factory('GridsterResizable', ['GridsterTouch', function(GridsterTouch) { - function GridsterResizable($el, scope, gridster, item, itemOptions) { - - function ResizeHandle(handleClass) { - - var hClass = handleClass; - - var elmX, elmY, elmW, elmH, - - mouseX = 0, - mouseY = 0, - lastMouseX = 0, - lastMouseY = 0, - mOffX = 0, - mOffY = 0, - - minTop = 0, - maxTop = 9999, - minLeft = 0; - - var getMinHeight = function() { - return (item.minSizeY ? item.minSizeY : 1) * gridster.curRowHeight - gridster.margins[0]; - }; - var getMinWidth = function() { - return (item.minSizeX ? item.minSizeX : 1) * gridster.curColWidth - gridster.margins[1]; - }; - - var originalWidth, originalHeight; - var savedDraggable; - - function mouseDown(e) { - switch (e.which) { - case 1: - // left mouse button - break; - case 2: - case 3: - // right or middle mouse button - return; - } - - // save the draggable setting to restore after resize - savedDraggable = gridster.draggable.enabled; - if (savedDraggable) { - gridster.draggable.enabled = false; - scope.$broadcast('gridster-draggable-changed', gridster); - } - - // Get the current mouse position. - lastMouseX = e.pageX; - lastMouseY = e.pageY; - - // Record current widget dimensions - elmX = parseInt($el.css('left'), 10); - elmY = parseInt($el.css('top'), 10); - elmW = $el[0].offsetWidth; - elmH = $el[0].offsetHeight; - - originalWidth = item.sizeX; - originalHeight = item.sizeY; - - resizeStart(e); - - return true; - } - - function resizeStart(e) { - $el.addClass('gridster-item-moving'); - $el.addClass('gridster-item-resizing'); - - gridster.movingItem = item; - - item.setElementSizeX(); - item.setElementSizeY(); - item.setElementPosition(); - gridster.updateHeight(1); - - scope.$apply(function() { - // callback - if (gridster.resizable && gridster.resizable.start) { - gridster.resizable.start(e, $el, itemOptions); // options is the item model - } - }); - } - - function mouseMove(e) { - var maxLeft = gridster.curWidth - 1; - - // Get the current mouse position. - mouseX = e.pageX; - mouseY = e.pageY; - - // Get the deltas - var diffX = mouseX - lastMouseX + mOffX; - var diffY = mouseY - lastMouseY + mOffY; - mOffX = mOffY = 0; - - // Update last processed mouse positions. - lastMouseX = mouseX; - lastMouseY = mouseY; - - var dY = diffY, - dX = diffX; - - if (hClass.indexOf('n') >= 0) { - if (elmH - dY < getMinHeight()) { - diffY = elmH - getMinHeight(); - mOffY = dY - diffY; - } else if (elmY + dY < minTop) { - diffY = minTop - elmY; - mOffY = dY - diffY; - } - elmY += diffY; - elmH -= diffY; - } - if (hClass.indexOf('s') >= 0) { - if (elmH + dY < getMinHeight()) { - diffY = getMinHeight() - elmH; - mOffY = dY - diffY; - } else if (elmY + elmH + dY > maxTop) { - diffY = maxTop - elmY - elmH; - mOffY = dY - diffY; - } - elmH += diffY; - } - if (hClass.indexOf('w') >= 0) { - if (elmW - dX < getMinWidth()) { - diffX = elmW - getMinWidth(); - mOffX = dX - diffX; - } else if (elmX + dX < minLeft) { - diffX = minLeft - elmX; - mOffX = dX - diffX; - } - elmX += diffX; - elmW -= diffX; - } - if (hClass.indexOf('e') >= 0) { - if (elmW + dX < getMinWidth()) { - diffX = getMinWidth() - elmW; - mOffX = dX - diffX; - } else if (elmX + elmW + dX > maxLeft) { - diffX = maxLeft - elmX - elmW; - mOffX = dX - diffX; - } - elmW += diffX; - } - - // set new position - $el.css({ - 'top': elmY + 'px', - 'left': elmX + 'px', - 'width': elmW + 'px', - 'height': elmH + 'px' - }); - - resize(e); - - return true; - } - - function mouseUp(e) { - // restore draggable setting to its original state - if (gridster.draggable.enabled !== savedDraggable) { - gridster.draggable.enabled = savedDraggable; - scope.$broadcast('gridster-draggable-changed', gridster); - } - - mOffX = mOffY = 0; - - resizeStop(e); - - return true; - } - - function resize(e) { - var oldRow = item.row, - oldCol = item.col, - oldSizeX = item.sizeX, - oldSizeY = item.sizeY, - hasCallback = gridster.resizable && gridster.resizable.resize; - - var col = item.col; - // only change column if grabbing left edge - if (['w', 'nw', 'sw'].indexOf(handleClass) !== -1) { - col = gridster.pixelsToColumns(elmX, false); - } - - var row = item.row; - // only change row if grabbing top edge - if (['n', 'ne', 'nw'].indexOf(handleClass) !== -1) { - row = gridster.pixelsToRows(elmY, false); - } - - var sizeX = item.sizeX; - // only change row if grabbing left or right edge - if (['n', 's'].indexOf(handleClass) === -1) { - sizeX = gridster.pixelsToColumns(elmW, true); - } - - var sizeY = item.sizeY; - // only change row if grabbing top or bottom edge - if (['e', 'w'].indexOf(handleClass) === -1) { - sizeY = gridster.pixelsToRows(elmH, true); - } - - if (gridster.pushing !== false || gridster.getItems(row, col, sizeX, sizeY, item).length === 0) { - item.row = row; - item.col = col; - item.sizeX = sizeX; - item.sizeY = sizeY; - } - var isChanged = item.row !== oldRow || item.col !== oldCol || item.sizeX !== oldSizeX || item.sizeY !== oldSizeY; - - if (hasCallback || isChanged) { - scope.$apply(function() { - if (hasCallback) { - gridster.resizable.resize(e, $el, itemOptions); // options is the item model - } - }); - } - } - - function resizeStop(e) { - $el.removeClass('gridster-item-moving'); - $el.removeClass('gridster-item-resizing'); - - gridster.movingItem = null; - - item.setPosition(item.row, item.col); - item.setSizeY(item.sizeY); - item.setSizeX(item.sizeX); - - scope.$apply(function() { - if (gridster.resizable && gridster.resizable.stop) { - gridster.resizable.stop(e, $el, itemOptions); // options is the item model - } - }); - } - - var $dragHandle = null; - var unifiedInput; - - this.enable = function() { - if (!$dragHandle) { - $dragHandle = angular.element('
    '); - $el.append($dragHandle); - } - - unifiedInput = new GridsterTouch($dragHandle[0], mouseDown, mouseMove, mouseUp); - unifiedInput.enable(); - }; - - this.disable = function() { - if ($dragHandle) { - $dragHandle.remove(); - $dragHandle = null; - } - - unifiedInput.disable(); - unifiedInput = undefined; - }; - - this.destroy = function() { - this.disable(); - }; - } - - var handles = []; - var handlesOpts = gridster.resizable.handles; - if (typeof handlesOpts === 'string') { - handlesOpts = gridster.resizable.handles.split(','); - } - var enabled = false; - - for (var c = 0, l = handlesOpts.length; c < l; c++) { - handles.push(new ResizeHandle(handlesOpts[c])); - } - - this.enable = function() { - if (enabled) { - return; - } - for (var c = 0, l = handles.length; c < l; c++) { - handles[c].enable(); - } - enabled = true; - }; - - this.disable = function() { - if (!enabled) { - return; - } - for (var c = 0, l = handles.length; c < l; c++) { - handles[c].disable(); - } - enabled = false; - }; - - this.toggle = function(enabled) { - if (enabled) { - this.enable(); - } else { - this.disable(); - } - }; - - this.destroy = function() { - for (var c = 0, l = handles.length; c < l; c++) { - handles[c].destroy(); - } - }; - } - return GridsterResizable; - }]) - - .factory('gridsterDebounce', function() { - return function gridsterDebounce(func, wait, immediate) { - var timeout; - return function() { - var context = this, - args = arguments; - var later = function() { - timeout = null; - if (!immediate) { - func.apply(context, args); - } - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) { - func.apply(context, args); - } - }; - }; - }) - - /** - * GridsterItem directive - * @param $parse - * @param GridsterDraggable - * @param GridsterResizable - * @param gridsterDebounce - */ - .directive('gridsterItem', ['$parse', 'GridsterDraggable', 'GridsterResizable', 'gridsterDebounce', - function($parse, GridsterDraggable, GridsterResizable, gridsterDebounce) { - return { - scope: true, - restrict: 'EA', - controller: 'GridsterItemCtrl', - controllerAs: 'gridsterItem', - require: ['^gridster', 'gridsterItem'], - link: function(scope, $el, attrs, controllers) { - var optionsKey = attrs.gridsterItem, - options; - - var gridster = controllers[0], - item = controllers[1]; - - scope.gridster = gridster; - - - // bind the item's position properties - // options can be an object specified by gridster-item="object" - // or the options can be the element html attributes object - if (optionsKey) { - var $optionsGetter = $parse(optionsKey); - options = $optionsGetter(scope) || {}; - if (!options && $optionsGetter.assign) { - options = { - row: item.row, - col: item.col, - sizeX: item.sizeX, - sizeY: item.sizeY, - minSizeX: 0, - minSizeY: 0, - maxSizeX: null, - maxSizeY: null - }; - $optionsGetter.assign(scope, options); - } - } else { - options = attrs; - } - - item.init($el, gridster); - - $el.addClass('gridster-item'); - - var aspects = ['minSizeX', 'maxSizeX', 'minSizeY', 'maxSizeY', 'sizeX', 'sizeY', 'row', 'col'], - $getters = {}; - - var expressions = []; - var aspectFn = function(aspect) { - var expression; - if (typeof options[aspect] === 'string') { - // watch the expression in the scope - expression = options[aspect]; - } else if (typeof options[aspect.toLowerCase()] === 'string') { - // watch the expression in the scope - expression = options[aspect.toLowerCase()]; - } else if (optionsKey) { - // watch the expression on the options object in the scope - expression = optionsKey + '.' + aspect; - } else { - return; - } - expressions.push('"' + aspect + '":' + expression); - $getters[aspect] = $parse(expression); - - // initial set - var val = $getters[aspect](scope); - if (typeof val === 'number') { - item[aspect] = val; - } - }; - - for (var i = 0, l = aspects.length; i < l; ++i) { - aspectFn(aspects[i]); - } - - var watchExpressions = '{' + expressions.join(',') + '}'; - - // when the value changes externally, update the internal item object - scope.$watchCollection(watchExpressions, function(newVals, oldVals) { - for (var aspect in newVals) { - var newVal = newVals[aspect]; - var oldVal = oldVals[aspect]; - if (oldVal === newVal) { - continue; - } - newVal = parseInt(newVal, 10); - if (!isNaN(newVal)) { - item[aspect] = newVal; - } - } - }); - - function positionChanged() { - // call setPosition so the element and gridster controller are updated - item.setPosition(item.row, item.col); - - // when internal item position changes, update externally bound values - if ($getters.row && $getters.row.assign) { - $getters.row.assign(scope, item.row); - } - if ($getters.col && $getters.col.assign) { - $getters.col.assign(scope, item.col); - } - } - scope.$watch(function() { - return item.row + ',' + item.col; - }, positionChanged); - - function sizeChanged() { - var changedX = item.setSizeX(item.sizeX, true); - if (changedX && $getters.sizeX && $getters.sizeX.assign) { - $getters.sizeX.assign(scope, item.sizeX); - } - var changedY = item.setSizeY(item.sizeY, true); - if (changedY && $getters.sizeY && $getters.sizeY.assign) { - $getters.sizeY.assign(scope, item.sizeY); - } - - if (changedX || changedY) { - item.gridster.moveOverlappingItems(item); - gridster.layoutChanged(); - scope.$broadcast('gridster-item-resized', item); - } - } - - scope.$watch(function() { - return item.sizeY + ',' + item.sizeX + ',' + item.minSizeX + ',' + item.maxSizeX + ',' + item.minSizeY + ',' + item.maxSizeY; - }, sizeChanged); - - var draggable = new GridsterDraggable($el, scope, gridster, item, options); - var resizable = new GridsterResizable($el, scope, gridster, item, options); - - var updateResizable = function() { - resizable.toggle(!gridster.isMobile && gridster.resizable && gridster.resizable.enabled); - }; - updateResizable(); - - var updateDraggable = function() { - draggable.toggle(!gridster.isMobile && gridster.draggable && gridster.draggable.enabled); - }; - updateDraggable(); - - scope.$on('gridster-draggable-changed', updateDraggable); - scope.$on('gridster-resizable-changed', updateResizable); - scope.$on('gridster-resized', updateResizable); - scope.$on('gridster-mobile-changed', function() { - updateResizable(); - updateDraggable(); - }); - - function whichTransitionEvent() { - var el = document.createElement('div'); - var transitions = { - 'transition': 'transitionend', - 'OTransition': 'oTransitionEnd', - 'MozTransition': 'transitionend', - 'WebkitTransition': 'webkitTransitionEnd' - }; - for (var t in transitions) { - if (el.style[t] !== undefined) { - return transitions[t]; - } - } - } - - var debouncedTransitionEndPublisher = gridsterDebounce(function() { - scope.$apply(function() { - scope.$broadcast('gridster-item-transition-end', item); - }); - }, 50); - - if(whichTransitionEvent()){ //check for IE8, as it evaluates to null - $el.on(whichTransitionEvent(), debouncedTransitionEndPublisher); - } - - scope.$broadcast('gridster-item-initialized', item); - - return scope.$on('$destroy', function() { - try { - resizable.destroy(); - draggable.destroy(); - } catch (e) {} - - try { - gridster.removeItem(item); - } catch (e) {} - - try { - item.destroy(); - } catch (e) {} - }); - } - }; - } - ]) - - .directive('gridsterNoDrag', function() { - return { - restrict: 'A', - link: function(scope, $element) { - $element.addClass('gridster-no-drag'); - } - }; - }) - - ; - -})); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/att_angular_gridster/ui-gridster-tpls.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/att_angular_gridster/ui-gridster-tpls.js deleted file mode 100644 index 3ca3db7d8..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/att_angular_gridster/ui-gridster-tpls.js +++ /dev/null @@ -1,168 +0,0 @@ -/** -* FileName ui-gridster -* Version 0.0.1 -* Build number ad58c6f4f8f8fd7f04ac457f95d76f09 -* Date 08/17/2015 -*/ - - -(function(angular, window){ -angular.module("att.gridster", ["att.gridster.tpls", "att.gridster.utilities","att.gridster.gridster"]); -angular.module("att.gridster.tpls", ["template/gridster/gridster.html","template/gridster/gridsterItem.html","template/gridster/gridsterItemBody.html","template/gridster/gridsterItemFooter.html","template/gridster/gridsterItemHeader.html"]); -angular.module('att.gridster.utilities', []) - .factory('$extendObj', [function() { - var _extendDeep = function(dst) { - angular.forEach(arguments, function(obj) { - if (obj !== dst) { - angular.forEach(obj, function(value, key) { - if (dst[key] && dst[key].constructor && dst[key].constructor === Object) { - _extendDeep(dst[key], value); - } else { - dst[key] = value; - } - }); - } - }); - return dst; - }; - return { - extendDeep: _extendDeep - }; - }]); - -angular.module('att.gridster.gridster', ['attGridsterLib', 'att.gridster.utilities']) - .config(['$compileProvider', function($compileProvider) { - $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|javascript):/); - }]) - .constant('attGridsterConfig', - { - columns: 3, - margins: [10, 10], - outerMargin: true, - pushing: true, - floating: true, - swapping: true, - draggable: { - enabled: true - } - }) - .directive('attGridster', ['attGridsterConfig', '$extendObj', function(attGridsterConfig, $extendObj) { - return { - restrict: 'EA', - scope: { - attGridsterOptions: '=?' - }, - templateUrl: 'template/gridster/gridster.html', - replace: false, - transclude: true, - controller: [function() {}], - link: function(scope) { - if (angular.isDefined(scope.attGridsterOptions)) { - attGridsterConfig = $extendObj.extendDeep(attGridsterConfig, scope.attGridsterOptions); - } - scope.attGridsterConfig = attGridsterConfig; - } - }; - }]) - .directive('attGridsterItem', ['$timeout', function($timeout) { - return { - restrict: 'EA', - require: ['^attGridster'], - scope: { - attGridsterItem: '=' - }, - templateUrl: 'template/gridster/gridsterItem.html', - replace: false, - transclude: true, - controller: [function() {}] - }; - }]) - .directive('attGridsterItemHeader', [function() { - return { - restrict: 'EA', - require: ['^attGridsterItem'], - scope: { - headerText: '@', - subHeaderText: '@?' - }, - templateUrl: 'template/gridster/gridsterItemHeader.html', - replace: true, - transclude: true, - link: function(scope, element) { - if (angular.isDefined(scope.subHeaderText) && scope.subHeaderText) { - angular.element(element[0].querySelector('span.gridster-item-sub-header-content')).attr("tabindex", "0"); - angular.element(element[0].querySelector('span.gridster-item-sub-header-content')).attr("aria-label", scope.subHeaderText); - } - } - }; - }]) - .directive('attGridsterItemBody', [function() { - return { - restrict: 'EA', - require: ['^attGridsterItem'], - scope: {}, - templateUrl: 'template/gridster/gridsterItemBody.html', - replace: true, - transclude: true - }; - }]) - .directive('attGridsterItemFooter', ['$location', function($location) { - return { - restrict: 'EA', - require: ['^attGridsterItem'], - scope: { - attGridsterItemFooterLink: '@?' - }, - templateUrl: 'template/gridster/gridsterItemFooter.html', - replace: true, - transclude: true, - controller: ['$scope', function($scope) { - $scope.clickOnFooterLink = function(evt) { - evt.preventDefault(); - evt.stopPropagation(); - if ($scope.attGridsterItemFooterLink) { - $location.url($scope.attGridsterItemFooterLink); - } - }; - }], - link: function(scope, element) { - if (angular.isDefined(scope.attGridsterItemFooterLink) && scope.attGridsterItemFooterLink) { - element.attr("role", "link"); - } - } - }; - }]); -angular.module("template/gridster/gridster.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("template/gridster/gridster.html", - "
    "); -}]); - -angular.module("template/gridster/gridsterItem.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("template/gridster/gridsterItem.html", - "
    "); -}]); - -angular.module("template/gridster/gridsterItemBody.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("template/gridster/gridsterItemBody.html", - "
    "); -}]); - -angular.module("template/gridster/gridsterItemFooter.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("template/gridster/gridsterItemFooter.html", - "
    \n" + - " \n" + - "
    "); -}]); - -angular.module("template/gridster/gridsterItemHeader.html", []).run(["$templateCache", function($templateCache) { - $templateCache.put("template/gridster/gridsterItemHeader.html", - "
    \n" + - " \"||\"\n" + - " {{headerText}}\n" + - " {{subHeaderText}}\n" + - "
    \n" + - "
    "); -}]); - -return {} -})(angular, window); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/adminController.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/adminController.js deleted file mode 100644 index a99be9fea..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/adminController.js +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.config(function($routeProvider) { - $routeProvider - - - .when('/role_function_list', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/role_function_list.html', - controller: 'roleFunctionListController' - }) - - .when('/admin_menu_edit', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/admin_menu_edit.html', - controller: 'AdminMenuEditController' - }) - .when('/role/:roleId', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/role.html', - controller: 'roleController' - }) - .when('/jcs_admin', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/jcs_admin.html', - controller: 'cacheAdminController' - }) - .when('/broadcast_list', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/broadcast_list.html', - controller: 'broadcastListController' - }) - .when('/broadcast/:messageLocationId/:messageLocation/:messageId', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/broadcast.html', - controller: 'broadcastController' - }) - .when('/broadcast/:messageLocationId/:messageLocation', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/broadcast.html', - controller: 'broadcastController' - }) - .when('/collaborate_list', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/collaborate_list.html', - controller: 'collaborateListController' - }) - .when('/usage_list', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/usage_list.html', - controller: 'usageListController' - }) - .otherwise({ - templateUrl: 'app/fusion/scripts/view-models/profile-page/role_list.html', - controller : "roleListController" - }); -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/admin_menu_edit.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/admin_menu_edit.js deleted file mode 100644 index 54d58a45a..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/admin_menu_edit.js +++ /dev/null @@ -1,230 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('AdminMenuEditController', function ($scope, AdminService, modalService, $modal, $route){ - $( "#dialog" ).hide(); - -/* AdminService.getRoleFunctionList().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.availableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions); - - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - });*/ - $scope.init = function () { - $scope.numberOfRecordstoShow=20; - AdminService.getFnMenuItems().then(function(data){ - var j = data; - $scope.data =JSON.parse(j.data); - $scope.fnMenuItems =($scope.data.fnMenuItems); - - },function(error){ - console.log("failed"); - //reloadPageOnce(); - }); - } - $scope.init(); - $scope.mapActiveStatus = function(status){ - if(status) - status = "Y"; - else - status = "N"; - return status; - - }; - - - $scope.addNewFnMenuItemModalPopup = function(availableFnMenuItem) { - $scope.editFnMenuItem = null; - var modalInstance = $modal.open({ - templateUrl: 'fn_menu_add_popup.html', - controller: 'fn_menu_popupController', - resolve: { - message: function () { - var message = { - availableFnMenuItem: $scope.editFnMenuItem - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.availableFnMenuItems=response.availableFnMenuItems; - $route.reload(); - }); - }; - - $scope.removeMenuItem = function(fnMenuItem) { - modalService.popupConfirmWin("Confirm","You are about to delete the menu item "+fnMenuItem.label+". Do you want to continue?", - function(){ - var uuu = "admin_fn_menu/removeMenuItem.htm"; - var postData={fnMenuItem: fnMenuItem}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.fnMenuItem=data.fnMenuItem;}); - $route.reload(); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - - }; - - $scope.editRoleFunction = null; - var dialog = null; - $scope.editRoleFunctionPopup = function(availableRoleFunction) { - $scope.editRoleFunction = availableRoleFunction; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.editMenuItemModalPopup = function(availableFnMenuItem) { - $scope.editFnMenuItem = availableFnMenuItem; - var modalInstance = $modal.open({ - templateUrl: 'fn_menu_add_popup.html', - controller: 'fn_menu_popupController', - resolve: { - message: function () { - var message = { - availableFnMenuItem: $scope.editFnMenuItem - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - $scope.availableFnMenuItems=response.availableFnMenuItems; - $route.reload(); - }); - }; - - $scope.editRoleFunctionModalPopup = function(availableRoleFunction) { - $scope.editRoleFunction = availableRoleFunction; - var modalInstance = $modal.open({ - templateUrl: 'edit_role_function_popup.html', - controller: 'rolefunctionpopupController', - resolve: { - message: function () { - var message = { - availableRoleFunction: $scope.editRoleFunction - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.availableRoleFunctions=response.availableRoleFunctions; - }); - }; - - $scope.addNewRoleFunctionModalPopup = function(availableRoleFunction) { - $scope.editRoleFunction = null; - var modalInstance = $modal.open({ - templateUrl: 'edit_role_function_popup.html', - controller: 'rolefunctionpopupController', - resolve: { - message: function () { - var message = { - availableRoleFunction: $scope.editRoleFunction - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.availableRoleFunctions=response.availableRoleFunctions; - }); - }; - - $scope.addNewRoleFunctionPopup = function() { - $scope.editRoleFunction = null; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.saveRoleFunction = function(availableRoleFunction) { - var uuu = "role_function_list/saveRoleFunction.htm"; - var postData={availableRoleFunction: availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.availableRoleFunctions=[];$scope.$apply(); - $scope.availableRoleFunctions=data.availableRoleFunctions;}); - //alert("Update Successful.") ; - console.log($scope.availableRoleFunctions); - - $scope.editRoleFunction = null; - $( "#dialog" ).dialog("close"); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }; - - - $scope.removeRole = function(availableRoleFunction) { - modalService.popupConfirmWin("Confirm","You are about to delete the role function "+availableRoleFunction.name+". Do you want to continue?", - function(){ - var uuu = "role_function_list/removeRoleFunction.htm"; - var postData={availableRoleFunction: availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.availableRoleFunctions=data.availableRoleFunctions;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - - }; - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/ase-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/ase-controller.js deleted file mode 100644 index 45fc31ac8..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/ase-controller.js +++ /dev/null @@ -1,22 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('aseCtrl', function ($scope){ -/* do nothing yet*/ -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/broadcast-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/broadcast-controller.js deleted file mode 100644 index 77ee22f5f..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/broadcast-controller.js +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('broadcastController', function ($scope, modalService, $modal,AdminService,$routeParams){ - //$scope.broadcastMessage=${broadcastMessage}; - //$scope.broadcastSites=${broadcastSites}; - //console.log($scope.broadcastMessage); - $scope.broadcastMessage=[]; - $scope.broadcastSites=[]; - AdminService.getBroadcast($routeParams.messageLocationId, $routeParams.messageLocation, $routeParams.messageId).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.broadcastMessage=JSON.parse($scope.data.broadcastMessage); - $scope.broadcastSites=JSON.parse($scope.data.broadcastSites); - console.log($scope.broadcastMessage); - console.log($scope.broadcastMessage.id); - console.log($scope.broadcastSites); - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.save = function() { - var uuu = "broadcast/save"; - var postData={broadcastMessage: $scope.broadcastMessage}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - window.location.href = "admin#/broadcast_list"; - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }; - - $scope.close = function() { - window.location.href = "admin#/broadcast_list"; -}; - -}); - -$(function() { - $( "#startDatepicker" ).datepicker(); - $( "#endDatepicker" ).datepicker(); - - $( "#startDatepicker" ).change(function() { - var tempStartDate = moment($( "#startDatepicker" ).val()).format('YYYY-MM-DD hh:mm:ss.S'); - $( "#startDateHidden" ).val(tempStartDate.toString()); - //alert( $( "#startDateHidden" ).val() ); - }); - $( "#endDatepicker" ).change(function() { - var tempEndDate = moment($( "#endDatepicker" ).val()).format('YYYY-MM-DD hh:mm:ss.S'); - $( "#endDateHidden" ).val(tempEndDate.toString()); - //alert( $( "#endDateHidden" ).val() ); - }); -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/broadcast-list-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/broadcast-list-controller.js deleted file mode 100644 index cb10a29b4..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/broadcast-list-controller.js +++ /dev/null @@ -1,120 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('broadcastListController', function ($scope, modalService, $modal,AdminService){ - //$scope.broadcastMessage=${broadcastMessage}; - //$scope.broadcastSites=${broadcastSites}; - //console.log($scope.broadcastMessage); - var messagesMap = {}; - AdminService.getBroadcastList().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.messagesList=(($scope.data.messagesList===null) ? [""]:$scope.data.messagesList); - $scope.messageLocations=(($scope.data.messageLocations===null) ? [""]:$scope.data.messageLocations); - console.log("messages: "+$scope.messagesList); - console.log("location: "+$scope.messageLocations); - $.each($scope.messageLocations, function(i, a){ - //var result = []; - angular.forEach($scope.messagesList, function(value, key) { - if (key+'' === a.value+'') { - //var objsJSON = JSON.parse(value); - - $.each(value, function(i, a){ - var startDateLong = a.startDate; - var tempStartDate = new Date(startDateLong); - tempStartDate = moment(tempStartDate).format('DD MMM YYYY hh:mmA zz');//03 Jun 2013 04:15PM EDT - a.displayStartDate=tempStartDate.toString(); - - var endDateLong = a.endDate; - var tempEndDate = new Date(endDateLong); - tempEndDate = moment(tempEndDate).format('DD MMM YYYY hh:mmA zz');//03 Jun 2013 04:15PM EDT - a.displayEndDate=tempEndDate.toString(); - }); - a.messages = value; - } - }); - console.log(a.messages); - }); - - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - - $scope.editMessage = function(location) { - - editMessage(location.value, location.label); - }; - - $scope.toggleActive = function(broadcastMessage) { - - //alert('deleted'+role.name); - var uuu = "broadcast_list/toggleActive"; - var postData={broadcastMessage:broadcastMessage}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - //window.location.reload(); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while toggling: "+ data.responseText); - - } - }); - - - }; - - $scope.remove = function(broadcastMessage) { - - //alert('deleted'+role.name); - var uuu = "broadcast_list/remove"; - var postData={broadcastMessage:broadcastMessage}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - window.location.reload(); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - - }; - -}); - -function editMessage(messageLocationId, messageLocation, messageId) { - window.location='admin#/broadcast/'+messageLocationId + '/' + messageLocation + ((messageId != null) ? '/' + messageId : ''); -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/collaborate-list-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/collaborate-list-controller.js deleted file mode 100644 index 5b0b93421..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/collaborate-list-controller.js +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller("collaborateListController", function ($scope,$http,modalService, $modal,AdminService) { - // Table Data - AdminService.getCollaborateList().then(function(data){ - - var j = data; - $scope.tableData = JSON.parse(j.data); - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.viewPerPage = 20; - $scope.scrollViewsPerPage = 2; - $scope.currentPage = 1; - $scope.totalPage; - $scope.searchCategory = ""; - $scope.searchString = ""; - /* modalService.showSuccess('','Modal Sample') ; */ - for(x in $scope.tableData){ - if($scope.tableData[x].active_yn=='Y') - $scope.tableData[x].active_yn=true; - else - $scope.tableData[x].active_yn=false; - } - $scope.openCollaboration = function(chatId){ - openInNewTab('collaboration?chat_id=' + chatId); - } - - $scope.toggleProfileActive = function(profileId) { - modalService.popupConfirmWin("Confirm","You are about to change user's active status. Do you want to continue?", - function(){ - $http.get("profile/toggleProfileActive?profile_id="+profileId).success(function(){}); - - }) - }; - -}); - -function openInNewTab(url) { - var win = window.open(url, '_blank'); - win.focus(); -}; diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/fn_menu_add_popup_controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/fn_menu_add_popup_controller.js deleted file mode 100644 index e0179946f..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/fn_menu_add_popup_controller.js +++ /dev/null @@ -1,281 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -var fn_menu_popupController = function ($scope, $modalInstance, message, $http){ /// examine the LeftMenuService - if(message.availableFnMenuItem==null) - $scope.label='Add New Menu Item' - - else{ - $scope.label='Edit Menu Item' - //$scope.disableParentId=true; - } - - $scope.getParentData = function(){ - var uuu = "admin_fn_menu/get_parent_list" - $.ajax({ - type : 'GET', - url : uuu, - dataType: 'json', // data type expected from server - contentType: 'application/json', - //data: JSON.stringify(postData), // data type sent to server - success : function(data){ - $scope.$apply(function(){ - //$scope.availableRoleFunctions=[];$scope.$apply(); - $scope.parentListSelectData=data; // data from server - menuItems = $scope.parentListSelectData; - var heirarchicalMenuItems = []; - var children = []; - for ( var i=0; i b[prop]) { - return 1; - } else if (a[prop] < b[prop]) { - return -1; - } - return 0; - } - - }; - - $scope.getParentLabel = function(parentId, parentListSelectData){ - var element; - element = parentListSelectData[0]; - for (var i=0; i=0) - $scope.importProfileList.splice(index, 1); - } - }; - - $scope.prepareProfileSelection = function() { - if($scope.importProfileList) - $.each($scope.importProfileList, function(i, profile){ - $scope.preparePostSearchBean(profile); - }); - ; - } - - $scope.preparePostSearchBean = function(profile) { - //console.log('Importing: '+profile.orgUserId); - //console.log('ngexistinguser:'+$scope.ngexistingUsers[profile.orgUserId]) - if($scope.postSearchBean.selected==null){ - $scope.postSearchBean.selected=[]; - $scope.postSearchBean.postOrgUserId=[]; - $scope.postSearchBean.postHrid=[]; - $scope.postSearchBean.postFirstName=[]; - $scope.postSearchBean.postLastName=[]; - $scope.postSearchBean.postOrgCode=[]; - $scope.postSearchBean.postPhone=[]; - $scope.postSearchBean.postEmail=[]; - $scope.postSearchBean.postAddress1=[]; - $scope.postSearchBean.postAddress2=[]; - $scope.postSearchBean.postCity=[]; - $scope.postSearchBean.postState=[]; - $scope.postSearchBean.postZipCode=[]; - $scope.postSearchBean.postLocationClli=[]; - $scope.postSearchBean.postBusinessCountryCode=[]; - $scope.postSearchBean.postBusinessCountryName=[]; - $scope.postSearchBean.postDepartment=[]; - $scope.postSearchBean.postDepartmentName=[]; - $scope.postSearchBean.postBusinessUnit=[]; - $scope.postSearchBean.postBusinessUnitName=[]; - $scope.postSearchBean.postJobTitle=[]; - $scope.postSearchBean.postOrgManagerUserId=[]; - $scope.postSearchBean.postCommandChain=[]; - $scope.postSearchBean.postCompanyCode=[]; - $scope.postSearchBean.postCompany=[]; - $scope.postSearchBean.postCostCenter=[]; - $scope.postSearchBean.postSiloStatus=[]; - $scope.postSearchBean.postFinancialLocCode=[]; - } - - $scope.postSearchBean.selected.push(profile.orgUserId); - $scope.postSearchBean.postOrgUserId.push(profile.orgUserId); - $scope.postSearchBean.postHrid.push(profile.hrid); - $scope.postSearchBean.postFirstName.push(profile.firstName); - $scope.postSearchBean.postLastName.push(profile.lastName); - $scope.postSearchBean.postOrgCode.push(profile.orgCode); - $scope.postSearchBean.postPhone.push(profile.phone); - $scope.postSearchBean.postEmail.push(profile.email); - $scope.postSearchBean.postAddress1.push(profile.address1); - $scope.postSearchBean.postAddress2.push(profile.address2); - $scope.postSearchBean.postCity.push(profile.city); - $scope.postSearchBean.postState.push(profile.state); - if(profile.zipCodeSuffix==null) - $scope.postSearchBean.postZipCode.push(profile.zipCode); - else - $scope.postSearchBean.postZipCode.push(profile.zipCode+'-'+profile.zipCodeSuffix); - $scope.postSearchBean.postLocationClli.push(profile.locationClli); - $scope.postSearchBean.postBusinessCountryCode.push(profile.businessCountryCode); - $scope.postSearchBean.postBusinessCountryName.push(profile.businessCountryName); - $scope.postSearchBean.postDepartment.push(profile.department); - $scope.postSearchBean.postDepartmentName.push(profile.departmentName); - $scope.postSearchBean.postBusinessUnit.push(profile.businessUnit); - $scope.postSearchBean.postBusinessUnitName.push(profile.businessUnitName); - $scope.postSearchBean.postJobTitle.push(profile.jobTitle); - $scope.postSearchBean.postOrgManagerUserId.push(profile.orgManagerUserId); - $scope.postSearchBean.postCommandChain.push(profile.commandChain); - $scope.postSearchBean.postCompanyCode.push(profile.companyCode); - $scope.postSearchBean.postCompany.push(profile.company); - $scope.postSearchBean.postCostCenter.push(profile.costCenter); - $scope.postSearchBean.postSiloStatus.push(profile.siloStatus); - $scope.postSearchBean.postFinancialLocCode.push(profile.financialLocCode); - }; - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profile-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profile-controller.js deleted file mode 100644 index aa0066b07..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profile-controller.js +++ /dev/null @@ -1,286 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('profileController', function ($scope,$http,ProfileService,$routeParams,modalService){ - $scope.tableData=[]; - $scope.profile=[]; - $scope.ociavailableRoles=[]; - $scope.ociTimeZones; - $scope.ociCountries; - var stateList=[]; - $scope.availableRoles = []; - $scope.timeZones = []; - $scope.selectedTimeZone = null; - $scope.countries = []; - $scope.selectedCountry = null; - - ProfileService.getProfileDetail($routeParams.profileId).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.profile =JSON.parse($scope.data.profile); - $scope.ociavailableRoles =JSON.parse($scope.data.availableRoles); - $scope.ociTimeZones=JSON.parse($scope.data.timeZones); - $scope.ociCountries=JSON.parse($scope.data.countries); - stateList=JSON.parse($scope.data.stateList); - $scope.orgUserId=$scope.profile.orgUserId; - $scope.orgManagerUserId=$scope.profile.orgManagerUserId; - - - if($scope.ociavailableRoles) - $.each($scope.ociavailableRoles, function(i, a){ - var availableRole = a; - availableRole.selected = false; - $.each($scope.profile.roles, function(j, b){ - if(a.id === b.id) { - availableRole.selected = true; - } - }); - $scope.availableRoles.push(availableRole); - }); - ; - - /*$scope.ociTimeZones = ${model.timeZones};*/ - - if($scope.ociTimeZones){ - $.each($scope.ociTimeZones, function(i, a){ - var timeZone = {"index":i, "value":a.value, "title":a.label}; - $scope.timeZones.push(timeZone); - if($scope.profile.timeZoneId !== null && a.value === $scope.profile.timeZoneId.toString()){ - $scope.selectedTimeZone = timeZone; - } - }); - }; - - /*$scope.ociCountries = ${model.countries};*/ - - //alert($scope.ociCountries[0].label); - if($scope.ociCountries) - $.each($scope.ociCountries, function(i, a){ - var country = {"index":i, "value":a.value, "title":a.label}; - $scope.countries.push(country); - if(a.value === $scope.profile.country){ - $scope.selectedCountry = country; - } - }); - ; - - /*var stateList=${model.stateList};*/ - //alert(stateList[0].label); - stateList = stateList== null? []: stateList; - var selectedState= $scope.profile.state ? $scope.profile.state:""; - $scope.stateList = initDropdownWithLookUp(stateList,selectedState ); - - //$scope.resetMenu(); - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - /*$scope.profile=${model.profile};*/ - $scope.orgUserId=$scope.profile.orgUserId; - $scope.orgManagerUserId=$scope.profile.orgManagerUserId; - - $scope.viewPerPage = 2; - $scope.currentPage = 1; - $scope.totalPage; - $scope.searchCategory = ""; - $scope.searchString = ""; - - $( "#dialog" ).hide(); - - /*$scope.ociavailableRoles=${model.availableRoles};*/ - //modalService.showFailure('Error','') ; - - - $scope.saveProfile = function() { - var uuu = "profile/saveProfile?profile_id=" + $routeParams.profileId; - var postData={profile: $scope.profile, - selectedCountry:$scope.selectedCountry!=null?$scope.selectedCountry.value:"", - selectedState:$scope.stateList.selected!=null?$scope.stateList.selected.value:"", - selectedTimeZone:$scope.selectedTimeZone!=null?$scope.selectedTimeZone.value:"" - }; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - modalService.showSuccess("Success","Update Successful."); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }; - - $scope.addNewRolePopup = function(role) { - $( "#dialog" ).dialog({ - modal: true, - width: 500, - height:600 - }); - $(".ui-dialog").css("z-index",2001); - $(".ui-dialog-titlebar").hide(); - }; - - $scope.toggleRole = function(selected,availableRole) { - $scope.profileTemp=$scope.profile; - $scope.profile={}; - //alert('toggleRole: '+selected); - if(!selected) { - //remove role - var uuu = "profile/removeRole?profile_id=" + $routeParams.profileId; - modalService.popupConfirmWinWithCancel("Confirm","You are about to remove the role "+availableRole.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - var postData={role:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.profile=data;}); - }, - error : function(data){ - $scope.$apply(function(){$scope.profile=$scope.profileTemp;}); - modalService.showFailure("Fail","Error while saving."); - } - }); - }, - function(){ - availableRole.selected=!availableRole.selected; - }); - - - } else { - //add role - var uuu = "profile/addNewRole?profile_id=" + $routeParams.profileId; - modalService.popupConfirmWinWithCancel("Confirm","You are about to add the role "+availableRole.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - var postData={role:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.profile=data;}); - }, - error : function(data){ - $scope.$apply(function(){$scope.profile=$scope.profileTemp;}); - modalService.showFailure("Fail","Error while saving."); - } - }); - - },function(){ - availableRole.selected=!availableRole.selected; - }) - - } - - - }; - - $scope.removeRole = function(role) { - - - modalService.popupConfirmWin("Confirm","You are about to remove the role "+role.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - $scope.profileTemp=$scope.profile; - $scope.profile={}; - var uuu = "profile/removeRole?profile_id=" + $routeParams.profileId; - var postData={role:role}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.profile=data; - $.each($scope.availableRoles, function(k, c){ - if(c.id === role.id) { - c.selected = false; - } - }); - }); - - }, - error : function(data){ - $scope.$apply(function(){$scope.profile=$scope.profileTemp;}); - modalService.showFailure("Fail","Error while saving."); - } - }); - - }) - - - }; - - function initDropdownWithLookUp(arr,selectedValue){ - var dropdownArray=[]; - var selected = null; - if(arr){ - for(var i = 0,l = arr.length; i < l; i++) { - var option = { - "index" : i , - "value" : arr[i].value, - "title" : arr[i].label - }; - dropdownArray.push(option); - if(arr[i].value === selectedValue){ - selected = option; - } - } - } - var dropDown={}; - dropDown.options = dropdownArray; - dropDown.selected = selected; - return dropDown; - }; - - $scope.doRolePopup = function() { - var modalInstance = $modal.open({ - templateUrl: 'roles_popup.html', - controller: 'rolepopupController', - resolve: { - message: function () { - var message ={ - availableRoles: $scope.availableRoles - }; - return message; - } - } - }); - modalInstance.result.then(function (opts) { - if(opts!=null){ - $scope.profile=opts.profile; - } - }); - } - - $scope.close = function(){ - $('#dialog').dialog('close'); - } - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profile-search-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profile-search-controller.js deleted file mode 100644 index 6da82dcc6..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profile-search-controller.js +++ /dev/null @@ -1,80 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('profileSearchCtrl', function($scope, $http,ProfileService,modalService){ - - $scope.showInput = true; - $scope.totalPages1 = 5; - $scope.viewPerPage1 = 8; - $scope.currentPage1 = 1; - - $scope.$watch('viewPerPage1', function(val) { - ProfileService.getProfilePagination($scope.currentPage1, val).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.tableData =JSON.parse($scope.data.profileList); - $scope.totalPages1 =JSON.parse($scope.data.totalPage); - for(x in $scope.tableData){ - if($scope.tableData[x].active_yn=='Y') - $scope.tableData[x].active_yn=true; - else - $scope.tableData[x].active_yn=false; - } - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - }); - - $scope.customHandler = function(num) { - $scope.currentPage1 = num; - ProfileService.getProfilePagination($scope.currentPage1,$scope.viewPerPage1).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.tableData =JSON.parse($scope.data.profileList); - $scope.totalPages1 =JSON.parse($scope.data.totalPage); - for(x in $scope.tableData){ - if($scope.tableData[x].active_yn=='Y') - $scope.tableData[x].active_yn=true; - else - $scope.tableData[x].active_yn=false; - } - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - }; - - $scope.editRow = function(profileId){ - window.location = 'userProfile#/profile/' + profileId; - }; - - $scope.toggleProfileActive = function(rowData) { - modalService.popupConfirmWinWithCancel("Confirm","You are about to change user's active status. Do you want to continue?", - function(){ - $http.get("profile/toggleProfileActive?profile_id="+rowData.id).success(function(){}); - }, - function(){ - rowData.active=!rowData.active; - }) - }; - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profileController.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profileController.js deleted file mode 100644 index 4b30e40ea..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/profileController.js +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.config(function($routeProvider) { - $routeProvider - .when('/profile/:profileId', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/profile_detail.html', - controller: 'profileController' - }) - .when('/post_search', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/post_search.html', - controller: 'postSearchCtrl' - }) - .when('/self_profile', { - templateUrl: 'app/fusion/scripts/view-models/profile-page/self_profile.html', - controller: 'selfProfileController' - }) - .otherwise({ - templateUrl: 'app/fusion/scripts/view-models/profile-page/profile_search.html', - controller : "profileSearchCtrl" - }); -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-controller.js deleted file mode 100644 index 50913af8e..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-controller.js +++ /dev/null @@ -1,226 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('roleController', function ($scope, modalService, $modal, AdminService,$routeParams){ - //$scope.role=${role}; - //console.log($scope.role.roleFunctions); - - $( "#dialogRoleFunction" ).hide(); - $( "#dialogChildRole" ).hide(); - - //$scope.ociavailableRoleFunctions=${availableRoleFunctions}; - - AdminService.getRole($routeParams.roleId).then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - - $scope.role =JSON.parse($scope.data.role); - console.log($scope.role); - - $scope.ociavailableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions); - console.log($scope.ociavailableRoleFunctions); - $scope.availableRoleFunctions=[]; - - if($scope.ociavailableRoleFunctions) - $.each($scope.ociavailableRoleFunctions, function(i, a){ - var availableRoleFunction = a; - availableRoleFunction.selected = false; - $.each($scope.role.roleFunctions, function(j, b){ - if(a.code === b.code) { - availableRoleFunction.selected = true; - } - }); - $scope.availableRoleFunctions.push(availableRoleFunction); - }); - - - $scope.ociavailableRoles=JSON.parse($scope.data.availableRoles); - console.log($scope.ociavailableRoles); - console.log("testing roles if exist"); - $scope.availableRoles=[]; - - if($scope.ociavailableRoles) - $.each($scope.ociavailableRoles, function(i, a){ - var availableRole = a; - availableRole.selected = false; - if($scope.role.childRoles){ - $.each($scope.role.childRoles, function(j, b){ - if(a.id === b.id) { - availableRole.selected = true; - } - }); - }; - $scope.availableRoles.push(availableRole); - }); - - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.saveRole = function() { - var exists = false; - for(x in $scope.availableRoles){ - console.log($scope.availableRoles[x].name); - if($scope.availableRoles[x].name==$scope.role.name){ - modalService.showFailure("Warning", "Role already exists."); - exists = true; - //$modalInstance.close({availableRoleFunctions:message.availableRoleFunctions}); - } - } - if(!exists){ - var uuu = "role/saveRole.htm?role_id="+$routeParams.roleId; - var postData={role: $scope.role, childRoles: $scope.role.childRoles, roleFunctions : $scope.role.roleFunctions}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - modalService.showSuccess("Success","Update Successful."); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while saving."); - } - }); - } - - }; - - $scope.addNewRoleFunctionModalPopup = function() { - var modalInstance = $modal.open({ - templateUrl: 'role_functions_popup.html', - controller: 'rolepopupController', - backdrop: 'static', - resolve: { - roleId: function () { - return $routeParams.roleId; - }, - role: function () { - return $scope.role; - }, - availableRoles: function () { - return $scope.ociavailableRoles; - }, - availableRoleFunctions: function () { - return $scope.ociavailableRoleFunctions; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.role=response.role; - }); - }; - - $scope.addNewChildRoleModalPopup = function() { - var modalInstance = $modal.open({ - templateUrl: 'child_roles_popup.html', - controller: 'rolepopupController', - backdrop: 'static', - resolve: { - roleId: function () { - return $routeParams.roleId; - }, - role: function () { - return $scope.role; - }, - availableRoles: function () { - return $scope.ociavailableRoles; - }, - availableRoleFunctions: function () { - return $scope.ociavailableRoleFunctions; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.role=response.role; - }); - }; - - - - $scope.removeRoleFunction = function(roleFunction) { - modalService.popupConfirmWin("Confirm","You are about to remove the role function "+roleFunction.name+" from the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var uuu = "role/removeRoleFunction.htm?role_id=" + $routeParams.roleId; - var postData={roleFunction:roleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.role=data.role; - $.each($scope.availableRoleFunctions, function(k, c){ - if(c.code === roleFunction.code) { - c.selected = false; - } - }); - }); - - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }) - - }; - - $scope.removeChildRole = function(childRole) { - modalService.popupConfirmWin("Confirm","You are about to remove the child role "+childRole.name+" from the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var uuu = "role/removeChildRole.htm?role_id=" + $routeParams.roleId; - var postData={childRole:childRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.role=data.role; - $.each($scope.availableRoles, function(k, c){ - if(c.id === childRole.id) { - c.selected = false; - } - }); - }); - - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }) - - }; - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-function-list-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-function-list-controller.js deleted file mode 100644 index eedac3e06..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-function-list-controller.js +++ /dev/null @@ -1,157 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('roleFunctionListController', function ($scope, AdminService, modalService, $modal){ - $( "#dialog" ).hide(); - - AdminService.getRoleFunctionList().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.availableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions); - - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.editRoleFunction = null; - var dialog = null; - $scope.editRoleFunctionPopup = function(availableRoleFunction) { - $scope.editRoleFunction = availableRoleFunction; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.editRoleFunctionModalPopup = function(availableRoleFunction) { - $scope.editRoleFunction = availableRoleFunction; - $scope.availableRoleFunctionsTemp=$scope.availableRoleFunctions; - $scope.availableRoleFunctions={}; - var modalInstance = $modal.open({ - templateUrl: 'edit_role_function_popup.html', - controller: 'rolefunctionpopupController', - resolve: { - message: function () { - var message = { - availableRoleFunction: $scope.editRoleFunction, - availableRoleFunctions: $scope.availableRoleFunctionsTemp - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - if(response!=null) - $scope.availableRoleFunctions=response.availableRoleFunctions; - else - $scope.availableRoleFunctions=$scope.availableRoleFunctionsTemp; - }); - }; - - $scope.addNewRoleFunctionModalPopup = function(availableRoleFunction) { - $scope.editRoleFunction = null; - $scope.availableRoleFunctionsTemp=$scope.availableRoleFunctions; - $scope.availableRoleFunctions={}; - var modalInstance = $modal.open({ - templateUrl: 'edit_role_function_popup.html', - controller: 'rolefunctionpopupController', - resolve: { - message: function () { - var message = { - availableRoleFunction: $scope.editRoleFunction, - availableRoleFunctions: $scope.availableRoleFunctionsTemp - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - if(response!=null) - $scope.availableRoleFunctions=response.availableRoleFunctions; - else - $scope.availableRoleFunctions=$scope.availableRoleFunctionsTemp; - }); - }; - - $scope.addNewRoleFunctionPopup = function() { - $scope.editRoleFunction = null; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.saveRoleFunction = function(availableRoleFunction) { - var uuu = "role_function_list/saveRoleFunction.htm"; - var postData={availableRoleFunction: availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.availableRoleFunctions=[];$scope.$apply(); - $scope.availableRoleFunctions=data.availableRoleFunctions;}); - //alert("Update Successful.") ; - console.log($scope.availableRoleFunctions); - - $scope.editRoleFunction = null; - $( "#dialog" ).dialog("close"); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }; - - - $scope.removeRole = function(availableRoleFunction) { - modalService.popupConfirmWin("Confirm","You are about to delete the role function "+availableRoleFunction.name+". Do you want to continue?", - function(){ - $scope.availableRoleFunctionsTemp=$scope.availableRoleFunctions; - $scope.availableRoleFunctions={}; - var uuu = "role_function_list/removeRoleFunction.htm"; - var postData={availableRoleFunction: availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.availableRoleFunctions=data.availableRoleFunctions;}); - }, - error : function(data){ - console.log(data); - $scope.$apply(function(){$scope.availableRoleFunctions=$scope.availableRoleFunctionsTemp;}); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - - }; - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-list-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-list-controller.js deleted file mode 100644 index a16d61ef2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/role-list-controller.js +++ /dev/null @@ -1,102 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('roleListController', function ($scope,AdminService,modalService){ - - AdminService.getRoles().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.availableRoles =JSON.parse($scope.data.availableRoles); - - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - //console.log($scope.availableRoles); - $scope.toggleRole = function(selected,availableRole) { - //alert('toggleRole: '+selected); - var toggleType = null; - if(selected) { - toggleType = "activate"; - } else { - toggleType = "inactivate"; - } - - modalService.popupConfirmWinWithCancel("Confirm","You are about to "+toggleType+" the test role "+availableRole.name+". Do you want to continue?", - function(){ - var uuu = "role_list/toggleRole"; - - var postData={role:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - console.log(data); - $scope.$apply(function(){$scope.availableRoles=data.availableRoles;}); - console.log($scope.availableRoles); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while saving."); - } - }); - - }, - function(){ - availableRole.active=!availableRole.active; - }) - - - }; - - $scope.removeRole = function(role) { - - modalService.popupConfirmWin("Confirm","You are about to delete the role "+role.name+". Do you want to continue?", - function(){ - var uuu = "role_list/removeRole"; - var postData={role:role}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.availableRoles=data.availableRoles;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - - - }; - - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/rolefunctionpopupController.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/rolefunctionpopupController.js deleted file mode 100644 index 14aea22c0..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/rolefunctionpopupController.js +++ /dev/null @@ -1,84 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -var rolefunctionpopupController = function ($scope, modalService, $modalInstance, message, $http,AdminService){ - if(message.availableRoleFunction==null) { - $scope.label='Add Role Function'; - var tempText = ""; - } - else{ - $scope.label='Edit Role Function' - $scope.disableCd=true; - var tempText = new String(message.availableRoleFunction.name); - $scope.editRoleFunction = message.availableRoleFunction; - } - - $scope.tempText = tempText; - - $scope.saveRoleFunction = function(availableRoleFunction) { - var uuu = "role_function_list/saveRoleFunction.htm"; - var postData={availableRoleFunction: availableRoleFunction}; - - if(availableRoleFunction==null){ - modalService.showFailure("Warning", "Please enter valid role function details."); - } - var exists = false; - for(x in message.availableRoleFunctions){ - console.log(message.availableRoleFunctions[x].name); - if(message.availableRoleFunctions[x].name==availableRoleFunction.name){ - modalService.showFailure("Warning", "Role Function already exists."); - exists = true; - availableRoleFunction.name = $scope.tempText; - } - } - - if(!exists && availableRoleFunction.name.trim() != '' && availableRoleFunction.code.trim() != ''){ - $http.post(uuu, JSON.stringify(postData)).then(function(res){ - console.log("data"); -// console.log(res.data); -// $scope.availableRoleFunctionsTemp = res.data.availableRoleFunctions; - AdminService.getRoleFunctionList().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.availableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions); - - //$scope.resetMenu(); - $modalInstance.close(); - },function(error){ - console.log("failed"); - reloadPageOnce(); - $modalInstance.close(); - }); - - - }); - - - - - } - }; - - - - $scope.close = function() { - $modalInstance.close(); - }; -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/rolepopupmodelController.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/rolepopupmodelController.js deleted file mode 100644 index f8ecfaddb..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/rolepopupmodelController.js +++ /dev/null @@ -1,205 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -var rolepopupController = function ($scope, $modalInstance, role, roleId, availableRoles, availableRoleFunctions,AdminService,modalService){ - - $scope.role = role; - console.log($scope.role); - if($scope.role.childRoles==null){ - $scope.role.childRoles=[]; - } - - $scope.ociavailableRoles=availableRoles; - console.log($scope.ociavailableRoles); - - $scope.availableRoles=[]; - if($scope.ociavailableRoles) - $.each($scope.ociavailableRoles, function(i, a){ - var availableRole = a; - availableRole.selected = false; - if($scope.role.childRoles){ - $.each($scope.role.childRoles, function(j, b){ - if(a.id === b.id) { - availableRole.selected = true; - } - }); - }; - $scope.availableRoles.push(availableRole); - }); - - $scope.ociavailableRoleFunctions = availableRoleFunctions; - console.log($scope.ociavailableRoleFunctions); - $scope.availableRoleFunctions = []; - if($scope.ociavailableRoleFunctions) - $.each($scope.ociavailableRoleFunctions, function(i, a){ - var availableRoleFunction = a; - availableRoleFunction.selected = false; - $.each($scope.role.roleFunctions, function(j, b){ - if(a.code === b.code) { - availableRoleFunction.selected = true; - } - }); - $scope.availableRoleFunctions.push(availableRoleFunction); - }); - //$scope.resetMenu(); - - $scope.toggleRoleFunction = function(selected,availableRoleFunction) { - //alert('toggleRole: '+selected); - - if(!selected) { - //remove role function - if(role.id==null){ - var index = $scope.role.roleFunctions.indexOf(availableRoleFunction); - if(index>=0) - $scope.role.roleFunctions.splice(index, 1); - return; - } - var uuu = "role/removeRoleFunction.htm?role_id=" + roleId; - modalService.popupConfirmWinWithCancel("Confirm","You are about to remove the role function "+availableRoleFunction.name+" from the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var postData={roleFunction:availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.role=data.role;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }, - function(){ - availableRoleFunction.selected=!availableRoleFunction.selected; - }) - - } else { - //add role function - if(role.id==null){ - $scope.role.roleFunctions.push(availableRoleFunction); - return; - } - var uuu = "role/addRoleFunction.htm?role_id=" + roleId; - - modalService.popupConfirmWinWithCancel("Confirm","You are about to add the role function "+availableRoleFunction.name+" to the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var postData={roleFunction:availableRoleFunction}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.role=data.role;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }, - function(){ - availableRoleFunction.selected=!availableRoleFunction.selected; - }) - } - - - }; - - $scope.toggleChildRole = function(selected,availableRole) { - //alert('toggleRole: '+selected); - - if(!selected) { - //remove role - if(role.id==null){ - var index = $scope.role.childRoles.indexOf(availableRole); - if(index>=0) - $scope.role.childRoles.splice(index, 1); - return; - } - var uuu = "role/removeChildRole.htm?role_id=" + roleId; - - modalService.popupConfirmWinWithCancel("Confirm","You are about to remove the child role "+availableRole.name+" from the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var postData={childRole:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - console.log('role',data.role); - $scope.$apply(function(){$scope.role=data.role;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }, - function(){ - availableRole.selected=true; - }) - - } else { - //add role - if(role.id==null){ - $scope.role.childRoles.push(availableRole); - return; - } - var uuu = "role/addChildRole.htm?role_id=" + roleId; - - modalService.popupConfirmWinWithCancel("Confirm","You are about to add the child role "+availableRole.name+" to the role for "+$scope.role.name+". Do you want to continue?", - function(){ - var postData={childRole:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.role=data.role;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }, - function(){ - availableRole.selected=false; - }) - } - - - }; - - $scope.close = function() { - console.log('role', $scope.role); - $modalInstance.close({role:$scope.role}); - }; - -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/self-profile-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/self-profile-controller.js deleted file mode 100644 index b82dae306..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/self-profile-controller.js +++ /dev/null @@ -1,284 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('selfProfileController', function ($scope,$http,ProfileService,$routeParams,modalService){ - $scope.tableData=[]; - $scope.profile=[]; - $scope.ociavailableRoles=[]; - $scope.ociTimeZones; - $scope.ociCountries; - var stateList=[]; - $scope.availableRoles = []; - $scope.timeZones = []; - $scope.selectedTimeZone = null; - $scope.countries = []; - $scope.selectedCountry = null; - $scope.isUserSystemAdmin = false; - - ProfileService.getSelfProfileDetail().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.profile =JSON.parse($scope.data.profile); - $scope.profileId = $scope.profile.id; - $scope.ociavailableRoles =JSON.parse($scope.data.availableRoles); - $scope.ociTimeZones=JSON.parse($scope.data.timeZones); - $scope.ociCountries=JSON.parse($scope.data.countries); - stateList=JSON.parse($scope.data.stateList); - $scope.orgUserId=$scope.profile.orgUserId; - $scope.orgManagerUserId=$scope.profile.orgManagerUserId; - - if($scope.ociavailableRoles) - $.each($scope.ociavailableRoles, function(i, a){ - var availableRole = a; - availableRole.selected = false; - $.each($scope.profile.roles, function(j, b){ - if(a.id === b.id) { - availableRole.selected = true; - if(a.id === 1){ - $scope.isUserSystemAdmin = true; - } - } - }); - $scope.availableRoles.push(availableRole); - }); - ; - - /*$scope.ociTimeZones = ${model.timeZones};*/ - - if($scope.ociTimeZones){ - $.each($scope.ociTimeZones, function(i, a){ - var timeZone = {"index":i, "value":a.value, "title":a.label}; - $scope.timeZones.push(timeZone); - if($scope.profile.timeZoneId !== null && a.value === $scope.profile.timeZoneId.toString()){ - $scope.selectedTimeZone = timeZone; - } - }); - }; - - /*$scope.ociCountries = ${model.countries};*/ - - //alert($scope.ociCountries[0].label); - if($scope.ociCountries) - $.each($scope.ociCountries, function(i, a){ - var country = {"index":i, "value":a.value, "title":a.label}; - $scope.countries.push(country); - if(a.value === $scope.profile.country){ - $scope.selectedCountry = country; - } - }); - ; - - /*var stateList=${model.stateList};*/ - //alert(stateList[0].label); - stateList = stateList== null? []: stateList; - var selectedState= $scope.profile.state ? $scope.profile.state:""; - $scope.stateList = initDropdownWithLookUp(stateList,selectedState ); - - //$scope.resetMenu(); - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - /*$scope.profile=${model.profile};*/ - $scope.orgUserId=$scope.profile.orgUserId; - $scope.orgManagerUserId=$scope.profile.orgManagerUserId; - - $scope.viewPerPage = 2; - $scope.currentPage = 1; - $scope.totalPage; - $scope.searchCategory = ""; - $scope.searchString = ""; - - $( "#dialog" ).hide(); - - /*$scope.ociavailableRoles=${model.availableRoles};*/ - //modalService.showFailure('Error','') ; - - - $scope.saveProfile = function() { - var uuu = "profile/saveProfile?profile_id=" + $scope.profileId;; - var postData={profile: $scope.profile, - selectedCountry:$scope.selectedCountry!=null?$scope.selectedCountry.value:"", - selectedState:$scope.stateList.selected!=null?$scope.stateList.selected.value:"", - selectedTimeZone:$scope.selectedTimeZone!=null?$scope.selectedTimeZone.value:"" - }; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - modalService.showSuccess("Success","Update Successful."); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }; - - $scope.addNewRolePopup = function(role) { - $( "#dialog" ).dialog({ - modal: true, - width: 500, - height:600 - }); - - $(".ui-dialog").css("z-index",10002); - $(".ui-dialog-titlebar").hide(); - }; - - $scope.toggleRole = function(selected,availableRole) { - //alert('toggleRole: '+selected); - if(!selected) { - //remove role - var uuu = "profile/removeRole?profile_id=" + $scope.profileId;; - modalService.popupConfirmWinWithCancel("Confirm","You are about to remove the role "+availableRole.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - var postData={role:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.profile=data;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - }, - function(){ - availableRole.selected=!availableRole.selected; - }); - - - } else { - //add role - var uuu = "profile/addNewRole?profile_id=" + $scope.profileId;; - modalService.popupConfirmWinWithCancel("Confirm","You are about to add the role "+availableRole.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - var postData={role:availableRole}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.profile=data;}); - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - },function(){ - availableRole.selected=!availableRole.selected; - }) - - } - - - }; - - $scope.removeRole = function(role) { - - - modalService.popupConfirmWin("Confirm","You are about to remove the role "+role.name+" from the profile for "+$scope.profile.firstName+" "+$scope.profile.lastName+". Do you want to continue?", - function(){ - var uuu = "profile/removeRole?profile_id=" + $scope.profileId;; - var postData={role:role}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.profile=data; - $.each($scope.availableRoles, function(k, c){ - if(c.id === role.id) { - c.selected = false; - } - }); - }); - - }, - error : function(data){ - modalService.showFailure("Fail","Error while saving."); - } - }); - - }) - - - }; - - function initDropdownWithLookUp(arr,selectedValue){ - var dropdownArray=[]; - var selected = null; - if(arr){ - for(var i = 0,l = arr.length; i < l; i++) { - var option = { - "index" : i , - "value" : arr[i].value, - "title" : arr[i].label - }; - dropdownArray.push(option); - if(arr[i].value === selectedValue){ - selected = option; - } - } - } - var dropDown={}; - dropDown.options = dropdownArray; - dropDown.selected = selected; - return dropDown; - }; - - $scope.doRolePopup = function() { - var modalInstance = $modal.open({ - templateUrl: 'roles_popup.html', - controller: 'rolepopupController', - resolve: { - message: function () { - var message ={ - availableRoles: $scope.availableRoles - }; - return message; - } - } - }); - modalInstance.result.then(function (opts) { - if(opts!=null){ - $scope.profile=opts.profile; - } - }); - } - - $scope.close = function(){ - $('#dialog').dialog('close'); - } - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/usage-list-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/usage-list-controller.js deleted file mode 100644 index b495b9340..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/usage-list-controller.js +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('usageListController', function ($scope,$interval,$http,$modal,modalService,AdminService){ - - AdminService.getUsageList().then(function(data){ - - var j = data; - $scope.data = JSON.parse(j.data); - $scope.users =$scope.data; - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.removeSession = function(sessionId) { - modalService.popupConfirmWin("Confirm","You are about to expel this user from the application. All of their unsaved data will be lost. Do you want to continue?", - function(){ - $http.get("usage_list/removeSession?deleteSessionId="+sessionId).success(function(response){$scope.users=response;}); - }) - - } -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowApp.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowApp.js deleted file mode 100644 index 0a5c80196..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowApp.js +++ /dev/null @@ -1,24 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -angular.module('att.abs.helper', []); -angular.module('quantum', []); - -var app=angular.module("workflowApp", ["att.abs", "att.abs.helper","modalServices", - "att.gridster","checklist-model","ngRoute", "ui.bootstrap"]); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowController.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowController.js deleted file mode 100644 index 169a88680..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowController.js +++ /dev/null @@ -1,509 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('workflowsController', function($scope, $http, $uibModal, $log, modalService, $modal) { - - $scope.viewPerPage = 5; - $scope.scrollViewsPerPage = 20; - $scope.currentPage = 2; - $scope.totalPage; - $scope.searchCategory = ""; - $scope.searchString = ""; - $scope.radio = { - value: "" - }; - - - $scope.showModal = false; - $scope.toggleModal = function(){ - $scope.showModal = !$scope.showModal; - }; - - $scope.workflow = {}; - $scope.workflow.active = "true"; - - $scope.updateAllWorkflowStatus = function() { - angular.forEach($scope.workflows,function(value){ - $scope.checkWorkflowStatus(value); - }) - } - - $scope.fetchWorkflowsList = function() { - $http.get('workflows/list').then(function(workflowList){ - console.log('Got new list from server = ' + workflowList.data); - $scope.workflows = workflowList.data; - $scope.updateAllWorkflowStatus(); - }); - }; - - $scope.addNewWorkflow = function(newWorkflow) { - $http.post('workflows/addWorkflow/', JSON.stringify(newWorkflow)).success(function() { - $scope.fetchWorkflowsList(); - }); - - $scope.workflow.name = ''; - - }; - - $scope.updateWorkflow = function (workflowToEdit) { - //workflowToEdit.active='true'; - var modalInstance = $uibModal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-new.html', - //size : modalSize, - controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { - $scope.workflow = workflowToEdit; - $scope.ok = function() { - console.log('Updating existing workflow ... ' + JSON.stringify($scope.workflow)); - $http.post('workflows/editWorkflow/', JSON.stringify($scope.workflow)).then(function(returnedWorkflow){ - console.log('Returned Workflow = ' + JSON.stringify(returnedWorkflow)); - $uibModalInstance.close($scope.workflow); - }); - }; - - $scope.cancel = function() { - $uibModalInstance.dismiss(); - }; - }], - //End of inner controller - resolve: { - workflow: function() { - console.log('Passing ' + JSON.stringify($scope.workflow)); - return $scope.workflow; - } - } - }); - - modalInstance.result.then(function (editedWorkFlow) { - //Need to convert to proper date - later - delete editedWorkFlow.created; - delete editedWorkFlow.updated; - - delete editedWorkFlow.createdBy; - delete editedWorkFlow.modifiedBy; - - console.log('selected Item ' + JSON.stringify(editedWorkFlow)); - $scope.$emit('workflowAdded', editedWorkFlow); - - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - }; - - $scope.reset = function(){ - console.log("Resetting ...."); - }; - - $scope.update = function(){ - console.log("updating ...."); - }; - - $scope.createWorkflow = function (modalSize) { - - var modalInstance = $uibModal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-new.html', - size : modalSize, - controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { - $scope.workflow = {}; - $scope.workflow.active = 'true'; - $scope.ok = function() { - console.log('Saving new workflow ... ' + JSON.stringify($scope.workflow)); - $http.post('workflows/addWorkflow/', JSON.stringify($scope.workflow)).then(function(returnedWorkflow){ - console.log('Returned Workflow = ' + JSON.stringify(returnedWorkflow)); - $uibModalInstance.close($scope.workflow); - }); - }; -/* console.log(size);*/ - $scope.cancel = function() { - $uibModalInstance.dismiss(); - }; - }], - //End of inner controller - resolve: { - workflow: function() { - console.log('Passing ' + JSON.stringify($scope.workflow)); - return $scope.workflow; - } - } - }); - - modalInstance.result.then(function (newWorkflow) { - console.log('selected Item ' + JSON.stringify(newWorkflow)); - $scope.$emit('workflowAdded', newWorkflow); - - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - };//End of createWorkflow function - - - $scope.removeWorkflow = function(workflowToRemove){ - var modalInstance = $uibModal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-remove.html', - controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { - $scope.workflowToRemove = workflowToRemove; - $scope.ok = function() { - console.log('Removing workflow ... ' + JSON.stringify($scope.workflowToRemove) + ' on client request.'); - $http.post('workflows/removeWorkflow/', JSON.stringify($scope.workflowToRemove.id)).then(function(){ - console.log('Workflow successfully removed !!!'); - $uibModalInstance.close(); - }); - }; - - $scope.cancel = function() { - $uibModalInstance.dismiss(); - }; - }] - }); - - modalInstance.result.then(function () { - $scope.$emit('workflowRemoved'); - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - - }; - - - - $scope.scheduleWorkflow = function(workflowToSchedule){ - var modalInstance = $uibModal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-schedule.html', - size:'lg', - - controller: ['$scope', '$uibModalInstance', '$http','dateFilter', function ($scope, $uibModalInstance, $http,dateFilter) { - - $scope.workflowToSchedule = workflowToSchedule; - $scope.dt = new Date(); - $scope.dt2 = new Date(); - $scope.dateformat = 'MM/dd/yyyy', - $scope.datetimeformat = "hh:mm a"; - - $scope.recurrenceOptions =[{ - index:0, value:'One-Time', title:'One-Time' - },{ - index:1, value: 'Hourly',title:'Hourly' - },{ - index:2, value: 'Daily',title:'Daily' - },{ - index:3, value: 'Weekly',title:'Weekly' - }] - $scope.selectRecurrenceOpt = $scope.recurrenceOptions[0]; - - $scope.hours = []; - for (var i=0; i<24; i++){ - var newObj={} - newObj.index = i; - newObj.value = ""+i; - newObj.title = ""+i; - $scope.hours.push(newObj); - } - - $scope.minutes = []; - for (var i=0; i<60; i++){ - var newObj={} - newObj.index = i; - newObj.value = ""+i; - newObj.title = ""+i; - $scope.minutes.push(newObj); - } - - $scope.AMPMOptions =[ - { - index:0, value:'AM', title:'AM' - },{ - index:1, value: 'PM',title:'PM' - }] - - $scope.selectFirstHour =$scope.hours[0]; - $scope.selectFirstMinute =$scope.minutes[0]; - - $scope.selectLastHour =$scope.hours[0]; - $scope.selectLastMinute =$scope.minutes[0]; - - $scope.selectStartAMPMOption=$scope.AMPMOptions[0]; - $scope.selectLastAMPMOption=$scope.AMPMOptions[0]; - - var GenerateCronExpression = function(trigger_dt, RecurrenceOpt) { - var CRON_sec = trigger_dt.getSeconds(); - var CRON_min = trigger_dt.getMinutes(); - var CRON_hr = trigger_dt.getHours(); - var CRON_date= trigger_dt.getDate(); - var CRON_month = trigger_dt.toLocaleString('en-US', {month: 'short'}).toUpperCase(); - var CRON_day = trigger_dt.toLocaleString('en-US', {weekday: 'short'}).toUpperCase(); - var CRON_year = trigger_dt.getFullYear(); - if (RecurrenceOpt ==="One-Time") { - CRON_day = '?' - } else { - if (RecurrenceOpt ==="Hourly") { - CRON_hr = '*'; - CRON_date = '*' - CRON_month = '*' - CRON_day = '?' - CRON_year = '*' - } else if (RecurrenceOpt ==="Daily") { - CRON_date = '*' - CRON_month = '*' - CRON_day = '?' - CRON_year = '*' - } else if (RecurrenceOpt ==="Weekly") { - CRON_date = '*' - CRON_month = '*' - CRON_year = '*' - } - } - - var CRON_Expression = [CRON_sec, CRON_min, CRON_hr, CRON_date, CRON_month, CRON_day, CRON_year]; - return CRON_Expression.join(" "); - } - - $scope.ok = function() { - - // DateTime for the start time: it should be noted that the start time - // for a CRON job should be prior to the trigger time. - $scope.trigger_dt = new Date( $scope.dt.getFullYear() + - "-" + ("0"+($scope.dt.getMonth()+1)).slice(-2) + - "-" +("0"+ $scope.dt.getDate()).slice(-2) + - " " + ("0" + $scope.selectFirstHour.value).slice(-2) + - ":" +("0" + $scope.selectFirstMinute.value).slice(-2) + - ":00.0"); - - $scope.startDateTime_CRON = GenerateCronExpression($scope.trigger_dt, $scope.selectRecurrenceOpt.value) - - //roll back the the start date time by 30 seconds (start time should be 30 seconds prior to trigger time) - dt_st = new Date($scope.trigger_dt - 30*1000) - - startDateTime = dt_st.getFullYear() + - "-" + ("0"+(dt_st.getMonth()+1)).slice(-2) + - "-" +("0"+ dt_st.getDate()).slice(-2) + - " " + ("0" + dt_st.getHours()).slice(-2) + - ":" +("0" + dt_st.getMinutes()).slice(-2) + - ":" + ("0" + dt_st.getSeconds()).slice(-2) +".0"; - $scope.startDateTime = startDateTime; - - $scope.endDateTime = $scope.dt2.getFullYear() + - "-" + ("0"+($scope.dt2.getMonth()+1)).slice(-2) + - "-" +("0"+ $scope.dt2.getDate()).slice(-2) + - " " + ("0"+ $scope.selectLastHour.value).slice(-2) + - ":" +("0" + $scope.selectLastMinute.value).slice(-2) + - ":00.0" - - $scope.WorkflowScheduleObject = {}; - $scope.WorkflowScheduleObject['startDateTime_CRON'] = $scope.startDateTime_CRON; - $scope.WorkflowScheduleObject['startDateTime'] = $scope.startDateTime; - $scope.WorkflowScheduleObject['endDateTime'] = $scope.endDateTime; - $scope.WorkflowScheduleObject['workflowKey'] = $scope.workflowToSchedule.workflowKey; - $scope.WorkflowScheduleObject['recurrence'] = $scope.selectRecurrenceOpt.value; - $scope.WorkflowScheduleObject['workflow_arguments'] = "test"; - $scope.WorkflowScheduleObject['workflow_server_url'] = $scope.workflowToSchedule.runLink; - - - TimeFromNowToStart = new Date($scope.startDateTime)-new Date() - TimeStartToEnd = new Date($scope.endDateTime)-new Date($scope.startDateTime) - - if (TimeFromNowToStart<=0) { - console.log("invalid start time input") - alert("Please ensure the scheduled start date time is later than current time.") - return; - } - if (TimeStartToEnd<=0) { - console.log("invalid end time input") - alert("Please ensure the schduled end date time is later than the start time.") - return; - } - // if successful then save and close - $scope.saveCronJob($scope.WorkflowScheduleObject); - $uibModalInstance.close(); - - }; - - $scope.saveCronJob = function(cronJobData){ - - console.log('saving cron job data: ' + cronJobData); - var uuu = "workflows/saveCronJob.htm"; - var postData={cronJobDataObj: cronJobData}; - $.ajax({ - type : 'POST', - url : uuu, - //dataType: 'json', // data type expected from server - contentType: 'application/json', - data: JSON.stringify(postData), // data type sent to server - success : function(data){ - $scope.$apply(function(){ - //$scope.availableRoleFunctions=[];$scope.$apply(); - // new // $scope.availableFnMenuItems=data.availableFnMenuItems; - } - ); - //alert("Update Successful.") ; - //$scope.editRoleFunction = null; - // new /// $modalInstance.close({availableFnMenuItems:$scope.availableRoleFunctions}); - }, - error : function(data){ - alert("Error while saving."); - } - }); - - }; - - $scope.cancel = function() { - console.log("cancel triggered") - $uibModalInstance.dismiss(); - }; - }] - }); - - modalInstance.result.then(function () { - $scope.$emit('workflowRemoved'); - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - - }; - - - - - - - - - $scope.previewWorkflow = function(workflowToPreview,modalSize){ - var modalInstance = $uibModal.open({ - animation: $scope.animationsEnabled, - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-preview.html', - size:modalSize, - controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { - $scope.workflowToPreview = workflowToPreview; - console.log('previewWorkFlow invoked'); - console.log($scope.workflowToPreview); - - $scope.cancel = function() { - $uibModalInstance.dismiss(); - }; - }] - }); - - modalInstance.result.then(function () { - $scope.$emit('workflowRemoved'); - }, function () { - $log.info('Modal dismissed at: ' + new Date()); - }); - - }; - - - /* change work flow status based on the boolean variable "suspendBool" which corresponds whether - * we would like to suspend or activate a workflow specified by key. */ - $scope.changeWorkflowStatus = function(workflowToChangeStatus,suspendBool){ - if (workflowToChangeStatus!==null) { - var statusUrl= workflowToChangeStatus.runLink+"/engine-rest/process-definition/key/"+workflowToChangeStatus.workflowKey - var suspendedUrl= statusUrl+"/suspended" - var xmlHttp = new XMLHttpRequest(); - xmlHttp.open('PUT', suspendedUrl, false); - xmlHttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); - xmlHttp.onload = function() { - if (suspendBool) { - console.log("process definition is now suspended"); - workflowToChangeStatus.active="false" - } else { - console.log("process definition is now activated"); - workflowToChangeStatus.active="true" - } - }; - xmlHttp.send(JSON.stringify({ - "suspended" : suspendBool, - "includeProcessInstances" : true, - "executionDate" : "2013-11-21T10:49:45" - })); - } - - }; - - $scope.activateWorkflow = function(workflowToActivate){ - $scope.changeWorkflowStatus(workflowToActivate,false) - - }; - - $scope.suspendWorkflow = function(workflowToActivate){ - $scope.changeWorkflowStatus(workflowToActivate,true) - }; - - $scope.checkWorkflowStatus = function(workflow) { - if (workflow!==null) { - var statusUrl= workflow.runLink+"/engine-rest/process-definition/key/"+workflow.workflowKey - var xmlHttp3 = new XMLHttpRequest(); - xmlHttp3.open('GET', statusUrl, true); - xmlHttp3.withCredentials = true; - xmlHttp3.send(); - xmlHttp3.onreadystatechange = function() { - if (xmlHttp3.readyState == 4 && xmlHttp3.status == 200) { - // do something with the response in the variable data - var temp = JSON.parse(xmlHttp3.responseText) - if (temp.suspended == false){ - console.log("Activated") - workflow.active="true" - } else { - console.log("Suspended") - workflow.active="false" - } - } - } - } - }; - - $scope.StartWorkflowInstance = function(workflowToStart){ - if (workflowToStart!==null) { - var statusUrl= workflowToStart.runLink+"/engine-rest/process-definition/key/"+workflowToStart.workflowKey - var suspendedUrl= statusUrl+"/submit-form" - var xmlHttp = new XMLHttpRequest(); - xmlHttp.open('POST', suspendedUrl, false); - xmlHttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); - xmlHttp.onload = function() { - }; - xmlHttp.send(JSON.stringify({ - "variables": { - "customerId": {"value":"asdasda","type":"String"}, - "amount":{"value":"100","type":"String"} - } - })); - } - - }; - - - $scope.$on('workflowAdded', function(event, newWorkflow) { - console.log("New Workflow to be added in list scope " + JSON.stringify(newWorkflow)); - //$scope.workflows.push(newWorkflow); - $scope.fetchWorkflowsList(); - console.log('newly added workflow = ' + JSON.stringify(newWorkflow)); - }); - - $scope.$on('workflowRemoved', function(event) { - $scope.fetchWorkflowsList(); - }); - - $scope.fetchWorkflowsList(); - - - -}); - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowRouting.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowRouting.js deleted file mode 100644 index 81fe4e283..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/controllers/workflows/workflowRouting.js +++ /dev/null @@ -1,26 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.config(function($routeProvider) { - $routeProvider - .when('/all', { - templateUrl: 'app/fusion/scripts/view-models/workflows/workflow-listing.html', - controller: 'workflowsController' - }) -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/footer.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/footer.js deleted file mode 100644 index a2dab75c2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/footer.js +++ /dev/null @@ -1,30 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.directive('qFooter', function () { - return { - restrict: 'A', //This menas that it will be used as an attribute and NOT as an element. I don't like creating custom HTML elements - replace: false, - templateUrl: "app/fusion/scripts/view-models/footer.html", - controller: ['$scope', '$filter', function ($scope, $filter) { - // Your behaviour goes here :) - }] - } -}); - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/header.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/header.js deleted file mode 100644 index bc90d2005..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/header.js +++ /dev/null @@ -1,504 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.directive('qHeader', function () { - return { - restrict: 'A', //This menas that it will be used as an attribute and NOT as an element. I don't like creating custom HTML elements - replace: false, - templateUrl: "app/fusion/scripts/view-models/header.html", - controller: ['$scope', '$filter','$http','$timeout', '$log','UserInfoService', '$window', '$cookies', function ($scope, $filter, $http, $timeout, $log,UserInfoService, $window, $cookies) { - - /*Define fields*/ - $scope.userName; - $scope.userFirstName; - $scope.redirectUrl; - $scope.contactUsUrl; - $scope.getAccessUrl; - $scope.childData=[]; - $scope.parentData=[]; - $scope.menuItems = []; - $scope.loadMenufail=false; - $scope.megaMenuDataObject=[]; - $scope.activeClickSubMenu = { - x: '' - }; - $scope.activeClickMenu = { - x: '' - }; - $scope.favoritesMenuItems = []; - $scope.favoriteItemsCount = 0; - $scope.showFavorites = false; - $scope.emptyFavorites = false; - $scope.favoritesWindow = false; - - /*Menu Structure*/ - var menuStructureConvert = function(menuItems) { - console.log(menuItems); - $scope.megaMenuDataObjectTemp = - [ - { - text: "ECOMP", - children: menuItems - }, - { - text: "Help", - children: [ - { - text:"Contact Us", - url:$scope.contactUsUrl - }, - { - text:"Get Access", - url:$scope.getAccessUrl - }] - } - ]; - return $scope.megaMenuDataObjectTemp; - }; - - /***************functions**************/ - /*Put user info into fields*/ - $scope.inputUserInfo = function(userInfo){ - if (typeof(userInfo) != "undefined" && userInfo!=null && userInfo!=''){ - if(typeof(userInfo.USER_FIRST_NAME) != "undefined" && userInfo.USER_FIRST_NAME!=null){ - $scope.userFirstName = userInfo.USER_FIRST_NAME; - } - } - } - /*getting user info from session*/ - $scope.getUserNameFromSession = function(){ - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (res) { - $scope.contactUsUrl=res.contactUsLink; - $scope.userName = res.userName; - $scope.userFirstName = res.firstName; - $scope.redirectUrl = res.portalUrl; - $scope.getAccessUrl = res.getAccessUrl; - }); - } - $scope.getTopMenuStaticInfo=function() { - var promise = UserInfoService.getFunctionalMenuStaticDetailShareContext(); - promise.then( - function(res) { - if(res==null || res==''){ - $log.info('failed getting static User information'); - $scope.getUserNameFromSession(); - }else{ - $log.info('Received static User information'); - - var resData = res; - console.log(resData); - $scope.inputUserInfo(resData); - $scope.userName = $scope.firstName+ ' '+ $scope.lastName; - } - }, - function(err) { - $log.info('failed getting static User information'); - } - ); - } - - $scope.returnToPortal=function(){ - window.location.href = $scope.redirectUrl; - } - - var unflatten = function( array, parent, tree ){ - tree = typeof tree !== 'undefined' ? tree : []; - parent = typeof parent !== 'undefined' ? parent : { menuId: null }; - var children = _.filter( array, function(child){ return child.parentMenuId == parent.menuId; }); - if( !_.isEmpty( children ) ){ - if( parent.menuId === null ){ - tree = children; - }else{ - parent['children'] = children - } - _.each( children, function( child ){ unflatten( array, child ) } ); - } - return tree; - } - - $scope.getMenu=function() { - $scope.getTopMenuStaticInfo(); - $http({ - method: "GET", - url: 'get_functional_menu', -// TIMEOUT USED FOR LOCAL TESTING ONLY -// timeout: 100 - }).success(function (response) { - - if (response == '101: Timeout') { - $log.debug('Timeout attempting to get_functional_menu'); - $scope.megaMenuDataObject = menuStructureConvert(""); -// $scope.createErrorMenu(); - //$scope.loadMenufail=true; - } else { - if(typeof response != 'undefined' && response.length!=0 && typeof response[0] != 'undefined' && typeof response[0].error!="undefined"){ - $log.debug('Timeout attempting to get_functional_menu'); - $scope.menuItems = unflatten( response); - $scope.megaMenuDataObject = menuStructureConvert($scope.menuItems); -// $scope.createErrorMenu(); - //$scope.loadMenufail=true; - }else{ - $scope.loadMenufail=false; - $scope.contactUsURL = response.contactUsLink; - $log.debug('functional_menu',response); - $scope.megaMenuDataObject = menuStructureConvert(""); - } - } - }).error(function (response){ - $scope.megaMenuDataObject = menuStructureConvert(""); -// $scope.createErrorMenu(); - //$scope.loadMenufail=true; - $log.debug('REST API failed get_functional_menu...'); - }); - - } - - $scope.adjustHeader=function() { - $scope.showHeader = ($cookies.show_app_header == undefined ? true : $cookies.show_app_header); - - if($scope.showHeader == true) { - $scope.drawer_margin_top = 70; - $scope.drawer_custom_top = 54; - $scope.toggle_drawer_top = 55; - } - else { - - $scope.drawer_margin_top = 60; - $scope.drawer_custom_top = 0; - $scope.toggle_drawer_top = 10; - } - - } - - $scope.getMenu(); - $scope.adjustHeader(); - -/* **************************************************************************/ -/* Logic for the favorite menus is here */ - - $scope.loadFavorites = function () { - $log.debug('loadFavorites has happened.'); - if ($scope.favoritesMenuItems == '') { - $scope.generateFavoriteItems(); - $log.debug('loadFavorites is calling generateFavoriteItems()'); - } else { - $log.debug('loadFavorites is NOT calling generateFavoriteItems()'); - } - } - - $scope.goToUrl = function (item) { - $log.info("goToUrl called") - $log.info(item); - - var url = item.url; - var restrictedApp = item.restrictedApp; - $log.debug('Restricted app status is: ' + restrictedApp); - if (!url) { - $log.info('No url found for this application, doing nothing..'); - return; - } - if (restrictedApp) { - $window.open(url, '_blank'); - } else { - $window.open(url, '_self'); - } - - } - - $scope.submenuLevelAction = function(index, column) { - if ($scope.favoritesMenuItems == '') { - $scope.generateFavoriteItems(); - $log.debug('submenuLevelAction is calling generateFavoriteItems()'); - } - $log.debug('item hovered/clicked: ' + index + '; column = ' + column); - if (column == 2) { // 2 is Design - $scope.favoritesWindow = false; - $scope.showFavorites = false; - $scope.emptyFavorites = false; - } - if (index=='Favorites' && $scope.favoriteItemsCount != 0) { - $log.debug('Showing Favorites window'); - $scope.favoritesWindow = true; - $scope.showFavorites = true; - $scope.emptyFavorites = false; - } - if (index=='Favorites' && $scope.favoriteItemsCount == 0) { - $log.debug('Hiding Favorites window in favor of No Favorites Window'); - $scope.favoritesWindow = true; - $scope.showFavorites = false; - $scope.emptyFavorites = true; - } - if (column > 2) { - $scope.favoritesWindow = false; - $scope.showFavorites = false; - $scope.emptyFavorites = false; - } - }; - - $scope.hideFavoritesWindow = function() { - $log.debug('$scope.hideFavoritesWindow has been called'); - $scope.showFavorites = false; - $scope.emptyFavorites = false; - } - - $scope.isUrlFavorite = function (menuId) { -// $log.debug('array objects in menu favorites = ' + $scope.favoriteItemsCount + '; menuId=' + menuId); - var jsonMenu = JSON.stringify($scope.favoritesMenuItems); - var isMenuFavorite = jsonMenu.indexOf('menuId\":' + menuId); - if (isMenuFavorite==-1) { - return false; - } else { - return true; - } - - } - - $scope.generateFavoriteItems = function() { - $http({ - method: "GET", - url: 'get_favorites', -// TIMEOUT USED FOR LOCAL TESTING ONLY -// timeout: 100 - }).success(function (response) { - if (response == '101: Timeout') { - $log.error('Timeout attempting to get_favorites_menu'); - } else { - if(typeof response != 'undefined' && response.length!=0 && typeof response[0] != 'undefined' && typeof response[0].error!="undefined"){ - $log.error('REST API failed get_favorites' + response); - }else{ - $log.debug('get_favorites = ' + JSON.stringify(response)); - $scope.favoritesMenuItems = response; - $scope.favoriteItemsCount = Object.keys($scope.favoritesMenuItems).length; - $log.info('number of favorite menus: ' + $scope.favoriteItemsCount); - } - } - }).error(function (response){ - $log.error('REST API failed get_favorites' + response); -//createFavoriteErrorMenu() USED FOR LOCAL TESTING ONLY -// $scope.createFavoriteErrorMenu(); - }); - } - - $scope.createFavoriteErrorMenu=function() { - $scope.favoritesMenuItems = []; - $scope.favoriteItemsCount = Object.keys($scope.favoritesMenuItems).length; - $log.info('number of favorite menus: ' + $scope.favoriteItemsCount); - } - - /* end of Favorite Menu code */ - /* **************************************************************************/ - - - /* **************************************************************************/ - // THIS IS USED FOR LOCAL TESTING ONLY - /* **************************************************************************/ - $scope.createErrorMenu=function() { - $log.debug('Creating fake menu now...'); -// $scope.loadMenufail=true; - $scope.menuItems = [ - { - "menuId": 1, - "column": 2, - "text": "Design", - "parentMenuId": null, - "url": "" - }, - { - "menuId": 2, - "column": 3, - "text": "Infrastructure Ordering", - "parentMenuId": null, - "url": "" - }, - { - "menuId": 3, - "column": 4, - "text": "Service Creation", - "parentMenuId": null, - "url": "" - }, - { - "menuId": 4, - "column": 5, - "text": "Service Mgmt", - "parentMenuId": null, - "url": "" - }, - { - "menuId": 90, - "column": 1, - "text": "Google", - "parentMenuId": 1, - "url": "" - }, - { - "menuId": 91, - "column": 1, - "text": "Mike Little's Coffee Cup", - "parentMenuId": 2, - "url": "" - }, - { - "menuId": 92, - "column": 2, - "text": "Andy and his Astrophotgraphy", - "parentMenuId": 3, - "url": "" - }, - { - "menuId": 93, - "column": 1, - "text": "JSONLint", - "parentMenuId": 4, - "url": "" - }, - { - "menuId": 94, - "column": 2, - "text": "HROneStop", - "parentMenuId": 4, - "url": "" - }, - { - "menuId": 95, - "column": 2, - "text": "4th Level App4a R16", - "parentMenuId": 4, - "url": "" - }, - { - "menuId": 96, - "column": 3, - "text": "3rd Level App1c R200", - "parentMenuId": 4, - "url": "" - }, - { - "menuId": 97, - "column": 1, - "text": "3rd Level App4b R16", - "parentMenuId": 5, - "url": "" - }, - { - "menuId": 98, - "column": 2, - "text": "3rd Level App2b R16", - "parentMenuId": 5, - "url": "" - }, - { - "menuId": 99, - "column": 1, - "text": "Favorites", - "parentMenuId": null, - "url": "" - } - ]; - $scope.menuItems = unflatten( $scope.menuItems ); - //remove this - $scope.megaMenuDataObject = menuStructureConvert($scope.menuItems); - } - }] - } -}); - -app.filter("ellipsis", function(){ - return function(text, length){ - if (text) { - var ellipsis = text.length > length ? "..." : ""; - return text.slice(0, length) + ellipsis; - }; - return text; - } -}); - -function reloadPageOnce() { - if( window.localStorage ) - { - if( !localStorage.getItem('firstLoad') ) - { - localStorage['firstLoad'] = true; - window.location.reload(); - } - else - localStorage.removeItem('firstLoad'); - } -} -app.controller('loginSnippetCtrl', function ($scope,$http, $log,UserInfoService){ - /*Define fields*/ - $scope.userProfile={ - firstName:'', - lastName:'', - fullName:'', - email:'', - userid:'' - } - /*Put user info into fields*/ - $scope.inputUserInfo = function(userInfo){ - if (typeof(userInfo) != "undefined" && userInfo!=null && userInfo!=''){ - if (typeof(userInfo.USER_FIRST_NAME) != "undefined" && userInfo.USER_FIRST_NAME!=null && userInfo.USER_FIRST_NAME!='') - $scope.userProfile.firstName = userInfo.USER_FIRST_NAME; - if (typeof(userInfo.USER_LAST_NAME) != "undefined" && userInfo.USER_LAST_NAME!=null && userInfo.USER_LAST_NAME!='') - $scope.userProfile.lastName = userInfo.USER_LAST_NAME; - if (typeof(userInfo.USER_EMAIL) != "undefined" && userInfo.USER_EMAIL!=null && userInfo.USER_EMAIL!='') - $scope.userProfile.email = userInfo.USER_EMAIL; - if (typeof(userInfo.USER_ORGUSERID) != "undefined" && userInfo.USER_ORGUSERID!=null && userInfo.USER_ORGUSERID!='') - $scope.userProfile.userid = userInfo.USER_ORGUSERID; - } - } - /*getting user info from session*/ - $scope.getUserNameFromSession = function(){ - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - $scope.userProfile.fullName = response.userName; - $scope.userProfile.userid = response.userid; - $scope.userProfile.email = response.email; - }); - } - /*getting user info from shared context*/ - $scope.getUserName=function() { - var promise = UserInfoService.getFunctionalMenuStaticDetailShareContext(); - promise.then( - function(res) { - if(res==null || res==''){ - $log.info('Getting User information from session'); - $scope.getUserNameFromSession(); - - }else{ - $log.info('Received User information from shared context',res); - var resData = res; - console.log(resData); - $scope.inputUserInfo(resData); - $scope.userProfile.fullName = $scope.userProfile.firstName+ ' '+ $scope.userProfile.lastName; - } - }, - function(err) { - console.log('error'); - } - ); - }; - /*call the get user info function*/ - try{ - $scope.getUserName(); - }catch(err){ - $log.info('Error while getting User information',err); - } -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/leftMenu.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/leftMenu.js deleted file mode 100644 index 737cb8012..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/directives/leftMenu.js +++ /dev/null @@ -1,203 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ - -app.directive('qMenu', function () { - return { - restrict: 'A', //This menas that it will be used as an attribute and NOT as an element. I don't like creating custom HTML elements - replace: false, - templateUrl: "app/fusion/scripts/view-models/left_menu.html", - controller: ['$scope', '$filter','$http','$timeout','$cookies','LeftMenuService', function ($scope, $filter, $http,$timeout,$cookies,LeftMenuService) { - - $scope.leftChildData=[]; - $scope.leftParentData=[]; - $scope.leftMenuItems = []; - $scope.app_name = ""; - $scope.app_name_full; - LeftMenuService.getLeftMenu().then(function(response){ - var j = response; - try{ - if(j && j !== "null" && j!== "undefined"){ - $scope.leftParentData = JSON.parse(j.data); - $scope.leftChildData = JSON.parse(j.data2); - }else{ - throw "Get Left Menu respsone is not an object/is empty"; - } - try{ - var leftChildItemList = $scope.leftChildData; - var pageUrl = window.location.href.split('/')[window.location.href.split('/').length-1]; - var leftParentList =$scope.leftParentData; - for (var i = 0; i < leftParentList.length; i++) { - $scope.item = { - parentLabel : leftParentList[i].label, - parentAction : leftParentList[i].action, - parentImageSrc : leftParentList[i].imageSrc, - open:pageUrl==leftParentList[i].action?true:false, - childItemList : leftChildItemList[i] - } - $scope.leftMenuItems.push($scope.item); - }; - }catch(err){ - console.log("error happened while trying to set left menu structure"+err); - } - }catch (e) { - console.log("error happened while trying to get left menu items"+e); - reloadPageOnce(); - return; - } - },function(error){ - console.log("error happened while calling getLeftMenu"+error); - }); - - LeftMenuService.getAppName().then(function(response){ - var j = response; - try{ - if(j && j !== "null" && j!== "undefined"){ - console.log("app name is " + $scope.app_name); - $scope.app_name_full = j.data; - var processed_app_name = j.data; - var n = processed_app_name.length; - if (n > 15) { - n = 15; - } - $scope.app_name = processed_app_name.substr(0, n); - }else{ - throw "Get app_name respsone is not an object/is empty"; - } - }catch (e) { - console.log("error happened while trying to get app name "+e); - return; - } - },function(error){ - console.log("error happened while calling getAppName "+error); - }); - - $scope.adjustHeader=function() { - $scope.showHeader = ($cookies.show_app_header == undefined ? true : $cookies.show_app_header); - - if($scope.showHeader == true) { - $scope.drawer_margin_top = 50; - $scope.drawer_custom_top = 20; - $scope.toggle_drawer_top = 55; - } - else { - - $scope.drawer_margin_top = 0; - $scope.drawer_custom_top = 0; - $scope.toggle_drawer_top = 0; - } - - - }; - - $scope.adjustHLeftMenu = function (type){ - $scope.showHeader = ($cookies.show_app_header == undefined ? true : $cookies.show_app_header); - - if($scope.showHeader == true) { - $scope.drawer_margin_top = 60; - $scope.drawer_custom_top = 54; - $scope.toggle_drawer_top = 55; - } - else { - - $scope.drawer_margin_top = 50; - $scope.drawer_custom_top = 0; - $scope.toggle_drawer_top = 10; - } - if(type=='burgerIcon'){ - return { "top": $scope.toggle_drawer_top+"px"}; - }else if(type=='leftMenu'){ - return { "margin-top": $scope.drawer_margin_top+"px"}; - }else - return; - } - $scope.adjustHeader(); - $scope.drawerOpen = true; - - $scope.toggleDrawer = function() { - $scope.drawerOpen = !($scope.drawerOpen); - if ($scope.drawerOpen) { - // setCookie('drawerOpen','open',30); - $scope.arrowShow = true; - - - if (document.getElementById('fnMenueContent')!=null) - document.getElementById('fnMenueContent').style.marginLeft = "0px"; - - if (document.getElementById('rightContentAdmin')!=null) - document.getElementById('rightContentAdmin').style.marginLeft = "210px"; - - else if (document.getElementById('rightContentProfile')!=null) - document.getElementById('rightContentProfile').style.marginLeft = "210px"; - - - - } else { - - $scope.arrowShow = false; - - if (document.getElementById('fnMenueContent')!=null) - document.getElementById('fnMenueContent').style.marginLeft = "-150px"; - - if (document.getElementById('rightContentAdmin')!=null) { - document.getElementById('rightContentAdmin').style.marginLeft = "50px"; - - } - - else if (document.getElementById('rightContentProfile')!=null) - document.getElementById('rightContentProfile').style.marginLeft = "50px"; - - - - - } - }; - - $timeout(function() { - detectScrollEvent(); - }, 800); - }] - } - -}); -$(window).scroll(function() { - if ($('.att-drawer').is(':visible')) { - detectScrollEvent(); - } - -}); - -function detectScrollEvent() { - try{ - var footerOff = $('#footerContainer').offset().top; - var headOff = $('#headerContainer').offset().top; - var winHeight = $(window).height(); - if ((footerOff - headOff) <= winHeight) { - $('.att-drawer').css({ - "height" : footerOff - headOff - 55 - }); - } else { - $('.att-drawer').css({ - "height" : "94vh" - }); - } - }catch(err){ - console.log(err) - } -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/jquery.resize.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/jquery.resize.js deleted file mode 100644 index 1ebd6c95b..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/jquery.resize.js +++ /dev/null @@ -1,139 +0,0 @@ -/*! - * jquery.resize.js 0.0.1 - https://github.com/yckart/jquery.resize.js - * Resize-event for DOM-Nodes - * - * @see http://workingdraft.de/113/ - * @see http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/ - * - * Copyright (c) 2013 Yannick Albert (http://yckart.com) - * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php). - * 2013/04/01 - */ - -(function(factory) { - if(typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['jquery'], factory); - } else if(typeof exports === 'object') { - // Node/CommonJS style for Browserify - module.exports = factory; - } else { - // Browser globals - factory(jQuery); - } -}(function($) { - - function addFlowListener(element, type, fn) { - var flow = type == 'over'; - element.addEventListener('OverflowEvent' in window ? 'overflowchanged' : type + 'flow', function(e) { - if(e.type == (type + 'flow') || ((e.orient == 0 && e.horizontalOverflow == flow) || (e.orient == 1 && e.verticalOverflow == flow) || (e.orient == 2 && e.horizontalOverflow == flow && e.verticalOverflow == flow))) { - e.flow = type; - return fn.call(this, e); - } - }, false); - }; - - function fireEvent(element, type, data, options) { - var options = options || {}, - event = document.createEvent('Event'); - event.initEvent(type, 'bubbles' in options ? options.bubbles : true, 'cancelable' in options ? options.cancelable : true); - for(var z in data) event[z] = data[z]; - element.dispatchEvent(event); - }; - - $.event.special.resize = { - setup: function() { - var element = this; - var resize = 'onresize' in element; - if(!resize && !element._resizeSensor) { - var sensor = element._resizeSensor = document.createElement('div'); - sensor.className = 'resize-sensor'; - sensor.innerHTML = '
    '; - - var x = 0, - y = 0, - first = sensor.firstElementChild.firstChild, - last = sensor.lastElementChild.firstChild, - matchFlow = function(event) { - var change = false, - width = element.offsetWidth; - if(x != width) { - first.style.width = width - 1 + 'px'; - last.style.width = width + 1 + 'px'; - change = true; - x = width; - } - var height = element.offsetHeight; - if(y != height) { - first.style.height = height - 1 + 'px'; - last.style.height = height + 1 + 'px'; - change = true; - y = height; - } - if(change && event.currentTarget != element) fireEvent(element, 'resize'); - }; - - if(getComputedStyle(element).position == 'static') { - element.style.position = 'relative'; - element._resizeSensor._resetPosition = true; - } - addFlowListener(sensor, 'over', matchFlow); - addFlowListener(sensor, 'under', matchFlow); - addFlowListener(sensor.firstElementChild, 'over', matchFlow); - addFlowListener(sensor.lastElementChild, 'under', matchFlow); - element.appendChild(sensor); - matchFlow({}); - } - var events = element._flowEvents || (element._flowEvents = []); - if(events.indexOf(handler) == -1) events.push(handler); - if(!resize) element.addEventListener('resize', handler, false); - element.onresize = function(e) { - events.forEach(function(fn) { - fn.call(element, e); - }); - }; - }, - - teardown: function() { - var element = this; - var index = element._flowEvents.indexOf(handler); - if(index > -1) element._flowEvents.splice(index, 1); - if(!element._flowEvents.length) { - var sensor = element._resizeSensor; - if(sensor) { - element.removeChild(sensor); - if(sensor._resetPosition) element.style.position = 'static'; - delete element._resizeSensor; - } - if('onresize' in element) element.onresize = null; - delete element._flowEvents; - } - element.removeEventListener('resize', handler); - } - }; - - $.fn.extend({ - resize: function(fn) { - return fn ? this.bind("resize", fn) : this.trigger("resize"); - }, - - unresize: function(fn) { - return this.unbind("resize", fn); - } - }); - - - function handler(event) { - var orgEvent = event || window.event, - args = [].slice.call(arguments, 1); - - event = $.event.fix(orgEvent); - event.type = "resize"; - - // Add event to the front of the arguments - args.unshift(event); - - return($.event.dispatch || $.event.handle).apply(this, args); - } - -})); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/debug.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/debug.js deleted file mode 100644 index eff36a250..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/debug.js +++ /dev/null @@ -1,329 +0,0 @@ -/** - * debugData - * - * Pass me a data structure {} and I'll output all the key/value pairs - recursively - * - * @example var HTML = debugData( oElem.style, "Element.style", { keys: "top,left,width,height", recurse: true, sort: true, display: true, returnHTML: true }); - * - * @param Object o_Data A JSON-style data structure - * @param String s_Title Title for dialog (optional) - * @param Hash options Pass additional options in a hash - */ -function debugData (o_Data, s_Title, options) { - options = options || {}; - var - str=(s_Title||s_Title==='' ? s_Title : 'DATA') - , dType=$.type(o_Data) - // maintain backward compatibility with OLD 'recurseData' param - , recurse=($.type(options)==='boolean' ? options : options.recurse !==false) - , keys=(options.keys?','+options.keys+',':false) - , display=options.display !==false - , html=options.returnHTML !==false - , sort=!!options.sort - , prefix=options.indent ? ' ' : '' - , D=[], i=0 // Array to hold data, i=counter - , hasSubKeys = false - , k, t, skip, x, type // loop vars - ; - if (dType!=='object' && dType!=='array') { - if (options.display) alert( (s_Title || 'debugData') +': '+ o_Data ); - return o_Data; - } - if (dType==='object' && $.isPlainObject(o_Data)) - dType='hash'; - - if (o_Data.jquery) { - str=s_Title+'jQuery Collection ('+ o_Data.length +')\n context="'+ o_Data.context +'"'; - } - else if (o_Data.nodeName) { - str=s_Title+o_Data.tagName; - var id = o_Data.id, cls=o_Data.className, src=o_Data.src, hrf=o_Data.href; - if (id) str+='\n id="'+ id+'"'; - if (cls) str+='\n class="'+ cls+'"'; - if (src) str+='\n src="'+ src+'"'; - if (hrf) str+='\n href="'+ hrf+'"'; - } - else { - parse(o_Data,prefix,dType); // recursive parsing - if (sort && !hasSubKeys) D.sort(); // sort by keyName - but NOT if has subKeys! - if (str) str += '\n***'+ '****************************'.substr(0,str.length) +'\n'; - str += D.join('\n'); // add line-breaks - } - - if (display) alert(str); // display data - if (html) str=str.replace(/\n/g, '
    ').replace(/ /g, '  '); // format as HTML - return str; - - function parse ( data, prefix, parentType ) { - var first = true; - try { - $.each( data, function (key, val) { - skip = (keys && keys.indexOf(','+key+',') === -1); - type = $.type(val); - if (type==='object' && $.isPlainObject(val)) - type = 'hash'; - k = prefix + (first ? ' ' : ', '); - first = false; - - if (parentType!=='array') // no key-names for array items - k += key+': '; // NOT an array - - if (type==="date" || type==="regexp") { - val = val.toString(); - type = "string"; - } - if (type==="string") { // STRING - if (!skip) D[i++] = k +'"'+ val +'"'; - } - // NULL, UNDEFINED, NUMBER or BOOLEAN - else if (/^(null|undefined|number|boolean)/.test(type)) { - if (!skip) D[i++] = k + val; - } - else if (type==="function") { // FUNCTION - if (!skip) D[i++] = k +'function()'; - } - else if (type==="array") { // ARRAY - if (!skip) { - D[i++] = k +'['; - parse( val, prefix+' ',type); // RECURSE - D[i++] = prefix +' ]'; - } - } - else if (val.jquery) { // JQUERY OBJECT - if (!skip) D[i++] = k +'jQuery ('+ val.length +') context="'+ val.context +'"'; - } - else if (val.nodeName) { // DOM ELEMENT - var id = val.id, cls=val.className, src=val.src, hrf=val.href; - if (skip) D[i++] = k +' '+ - id ? 'id="'+ id+'"' : - src ? 'src="'+ src+'"' : - hrf ? 'href="'+ hrf+'"' : - cls ? 'class="'+cls+'"' : - ''; - } - else if (type==="hash") { // JSON - if (!recurse || $.isEmptyObject(val)) { // show an empty hash - if (!skip) D[i++] = k +'{ }'; - } - else { // recurse into JSON hash - indent output - D[i++] = k +'{'; - parse( val, prefix+' ',type); // RECURSE - D[i++] = prefix +' }'; - } - } - else { // OBJECT - if (!skip) D[i++] = k +'OBJECT'; // NOT a hash - } - }); - } catch (e) {} - } -}; - -function debugStackTrace (s_Title, options) { - var - callstack = [] - , isCallstackPopulated = false - ; - try { - i.dont.exist += 0; // doesn't exist- that's the point - } catch(e) { - if (e.stack) { // Firefox - var lines = e.stack.split('\n'); - for (var i=0, len=lines.length; i') - .html( content.replace(/\n/g, '
    ').replace(/ /g, '  ') ) // format as HTML - .css( options.css ) - ; -}; diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/jquery-latest.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/jquery-latest.js deleted file mode 100644 index 1c998babc..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/jquery-latest.js +++ /dev/null @@ -1,9555 +0,0 @@ -/*! - * jQuery JavaScript Library v1.9.0 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2013-1-14 - */ -(function( window, undefined ) { -"use strict"; -var - // A central reference to the root jQuery(document) - rootjQuery, - - // The deferred used on DOM ready - readyList, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - location = window.location, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // [[Class]] -> type pairs - class2type = {}, - - // List of deleted data cache ids, so we can reuse them - core_deletedIds = [], - - core_version = "1.9.0", - - // Save a reference to some core methods - core_concat = core_deletedIds.concat, - core_push = core_deletedIds.push, - core_slice = core_deletedIds.slice, - core_indexOf = core_deletedIds.indexOf, - core_toString = class2type.toString, - core_hasOwn = class2type.hasOwnProperty, - core_trim = core_version.trim, - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Used for matching numbers - core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, - - // Used for splitting on whitespace - core_rnotwhite = /\S+/g, - - // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, - rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }, - - // The ready event handler and self cleanup method - DOMContentLoaded = function() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - } else if ( document.readyState === "complete" ) { - // we're here because readyState === "complete" in oldIE - // which is good enough for us to call the dom ready! - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: core_version, - - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return core_slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; - }, - - slice: function() { - return this.pushStack( core_slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: core_push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger("ready").off("ready"); - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - return !isNaN( parseFloat(obj) ) && isFinite( obj ); - }, - - type: function( obj ) { - if ( obj == null ) { - return String( obj ); - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ core_toString.call(obj) ] || "object" : - typeof obj; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !core_hasOwn.call(obj, "constructor") && - !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || core_hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw new Error( msg ); - }, - - // data: string of html - // context (optional): If specified, the fragment will be created in this context, defaults to document - // keepScripts (optional): If true, will include scripts passed in the html string - parseHTML: function( data, context, keepScripts ) { - if ( !data || typeof data !== "string" ) { - return null; - } - if ( typeof context === "boolean" ) { - keepScripts = context; - context = false; - } - context = context || document; - - var parsed = rsingleTag.exec( data ), - scripts = !keepScripts && []; - - // Single tag - if ( parsed ) { - return [ context.createElement( parsed[1] ) ]; - } - - parsed = jQuery.buildFragment( [ data ], context, scripts ); - if ( scripts ) { - jQuery( scripts ).remove(); - } - return jQuery.merge( [], parsed.childNodes ); - }, - - parseJSON: function( data ) { - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - if ( data === null ) { - return data; - } - - if ( typeof data === "string" ) { - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - if ( data ) { - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - } - } - } - - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - var xml, tmp; - if ( !data || typeof data !== "string" ) { - return null; - } - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Use native String.trim function wherever possible - trim: core_trim && !core_trim.call("\uFEFF\xA0") ? - function( text ) { - return text == null ? - "" : - core_trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - core_push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( core_indexOf ) { - return core_indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var l = second.length, - i = first.length, - j = 0; - - if ( typeof l === "number" ) { - for ( ; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var retVal, - ret = [], - i = 0, - length = elems.length; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return core_concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = core_slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - // Multifunctional method to get and set values of a collection - // The value/s can optionally be executed if it's a function - access: function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; - }, - - now: function() { - return ( new Date() ).getTime(); - } -}); - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || type !== "function" && - ( length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj ); -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Control if a given callback is in the list - has: function( fn ) { - return jQuery.inArray( fn, list ) > -1; - }, - // Remove all callbacks from the list - empty: function() { - list = []; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( list && ( !fired || stack ) ) { - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var action = tuple[ 0 ], - fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = core_slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; - if( values === progressValues ) { - deferred.notifyWith( contexts, values ); - } else if ( !( --remaining ) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); -jQuery.support = (function() { - - var support, all, a, select, opt, input, fragment, eventName, isSupported, i, - div = document.createElement("div"); - - // Setup - div.setAttribute( "className", "t" ); - div.innerHTML = "
    a"; - - // Support tests won't run in some limited or non-browser environments - all = div.getElementsByTagName("*"); - a = div.getElementsByTagName("a")[ 0 ]; - if ( !all || !a || !all.length ) { - return {}; - } - - // First batch of tests - select = document.createElement("select"); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName("input")[ 0 ]; - - a.style.cssText = "top:1px;float:left;opacity:.5"; - support = { - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: div.firstChild.nodeType === 3, - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: a.getAttribute("href") === "/a", - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.5/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) - checkOn: !!input.value, - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Tests for enctype support on a form (#6743) - enctype: !!document.createElement("form").enctype, - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", - - // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode - boxModel: document.compatMode === "CSS1Compat", - - // Will be defined later - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true, - boxSizingReliable: true, - pixelPosition: false - }; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Support: IE<9 - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - // Check if we can trust getAttribute("value") - input = document.createElement("input"); - input.setAttribute( "value", "" ); - support.input = input.getAttribute( "value" ) === ""; - - // Check if an input maintains its value after becoming a radio - input.value = "t"; - input.setAttribute( "type", "radio" ); - support.radioValue = input.value === "t"; - - // #11217 - WebKit loses check when the name is after the checked attribute - input.setAttribute( "checked", "t" ); - input.setAttribute( "name", "t" ); - - fragment = document.createDocumentFragment(); - fragment.appendChild( input ); - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php - for ( i in { submit: true, change: true, focusin: true }) { - div.setAttribute( eventName = "on" + i, "t" ); - - support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; - } - - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - // Run tests that need a body at doc ready - jQuery(function() { - var container, marginDiv, tds, - divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - container = document.createElement("div"); - container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; - - body.appendChild( container ).appendChild( div ); - - // Support: IE8 - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - div.innerHTML = "
    t
    "; - tds = div.getElementsByTagName("td"); - tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Support: IE8 - // Check if empty table cells still have offsetWidth/Height - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - // Check box-sizing and margin behavior - div.innerHTML = ""; - div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; - support.boxSizing = ( div.offsetWidth === 4 ); - support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); - - // Use window.getComputedStyle because jsdom on node.js will break without it. - if ( window.getComputedStyle ) { - support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; - support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. (#3333) - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - marginDiv = div.appendChild( document.createElement("div") ); - marginDiv.style.cssText = div.style.cssText = divReset; - marginDiv.style.marginRight = marginDiv.style.width = "0"; - div.style.width = "1px"; - - support.reliableMarginRight = - !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); - } - - if ( typeof div.style.zoom !== "undefined" ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.innerHTML = ""; - div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); - - // Support: IE6 - // Check if elements with layout shrink-wrap their children - div.style.display = "block"; - div.innerHTML = "
    "; - div.firstChild.style.width = "5px"; - support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); - - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - body.style.zoom = 1; - } - - body.removeChild( container ); - - // Null elements to avoid leaks in IE - container = div = tds = marginDiv = null; - }); - - // Null elements to avoid leaks in IE - all = select = fragment = opt = a = input = null; - - return support; -})(); - -var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, - rmultiDash = /([A-Z])/g; - -function internalData( elem, name, data, pvt /* Internal Use Only */ ){ - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, ret, - internalKey = jQuery.expando, - getByName = typeof name === "string", - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // Avoids exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( getByName ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt /* For internal use only */ ){ - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, l, - - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - for ( i = 0, l = name.length; i < l; i++ ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - } else if ( jQuery.support.deleteExpando || cache != cache.window ) { - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data, false ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name, false ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; - - // nodes accept data unless otherwise specified; rejection can be conditional - return !noData || noData !== true && elem.getAttribute("classid") === noData; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var attrs, name, - elem = this[0], - i = 0, - data = null; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - attrs = elem.attributes; - for ( ; i < attrs.length; i++ ) { - name = attrs[i].name; - - if ( !name.indexOf( "data-" ) ) { - name = jQuery.camelCase( name.substring(5) ); - - dataAttr( elem, name, data[ name ] ); - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return jQuery.access( this, function( value ) { - - if ( value === undefined ) { - // Try to fetch any internally stored data first - return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; - } - - this.each(function() { - jQuery.data( this, key, value ); - }); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - hooks.cur = fn; - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var nodeHook, boolHook, - rclass = /[\t\r\n]/g, - rreturn = /\r/g, - rfocusable = /^(?:input|select|textarea|button|object)$/i, - rclickable = /^(?:a|area)$/i, - rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, - ruseDefault = /^(?:checked|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - getSetInput = jQuery.support.input; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classes, elem, cur, clazz, j, - i = 0, - len = this.length, - proceed = typeof value === "string" && value; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call( this, j, this.className ) ); - }); - } - - if ( proceed ) { - // The disjunction here is for better compressibility (see removeClass) - classes = ( value || "" ).match( core_rnotwhite ) || []; - - for ( ; i < len; i++ ) { - elem = this[ i ]; - cur = elem.nodeType === 1 && ( elem.className ? - ( " " + elem.className + " " ).replace( rclass, " " ) : - " " - ); - - if ( cur ) { - j = 0; - while ( (clazz = classes[j++]) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - elem.className = jQuery.trim( cur ); - - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, clazz, j, - i = 0, - len = this.length, - proceed = arguments.length === 0 || typeof value === "string" && value; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call( this, j, this.className ) ); - }); - } - if ( proceed ) { - classes = ( value || "" ).match( core_rnotwhite ) || []; - - for ( ; i < len; i++ ) { - elem = this[ i ]; - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( elem.className ? - ( " " + elem.className + " " ).replace( rclass, " " ) : - "" - ); - - if ( cur ) { - j = 0; - while ( (clazz = classes[j++]) ) { - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - elem.className = value ? jQuery.trim( cur ) : ""; - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.match( core_rnotwhite ) || []; - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space separated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - // Toggle whole class name - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // If the element has a class name or if we're passed "false", - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var hooks, ret, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var val, - self = jQuery(this); - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, option, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one" || index < 0, - values = one ? null : [], - max = one ? index + 1 : options.length, - i = index < 0 ? - max : - one ? index : 0; - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // oldIE doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - // Don't return options that are disabled or in a disabled optgroup - ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && - ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attr: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( notxml ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - - } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, value + "" ); - return value; - } - - } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - // In IE9+, Flash objects don't have .getAttribute (#12945) - // Support: IE9+ - if ( typeof elem.getAttribute !== "undefined" ) { - ret = elem.getAttribute( name ); - } - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var name, propName, - i = 0, - attrNames = value && value.match( core_rnotwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( (name = attrNames[i++]) ) { - propName = jQuery.propFix[ name ] || name; - - // Boolean attributes get special treatment (#10870) - if ( rboolean.test( name ) ) { - // Set corresponding property to false for boolean attributes - // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8 - if ( !getSetAttribute && ruseDefault.test( name ) ) { - elem[ jQuery.camelCase( "default-" + name ) ] = - elem[ propName ] = false; - } else { - elem[ propName ] = false; - } - - // See #9699 for explanation of this approach (setting first, then removal) - } else { - jQuery.attr( elem, name, "" ); - } - - elem.removeAttribute( getSetAttribute ? name : propName ); - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to default in case type is set after value during creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return ( elem[ name ] = value ); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabindex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - } - } -}); - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - var - // Use .prop to determine if this attribute is understood as boolean - prop = jQuery.prop( elem, name ), - - // Fetch it accordingly - attr = typeof prop === "boolean" && elem.getAttribute( name ), - detail = typeof prop === "boolean" ? - - getSetInput && getSetAttribute ? - attr != null : - // oldIE fabricates an empty string for missing boolean attributes - // and conflates checked/selected into attroperties - ruseDefault.test( name ) ? - elem[ jQuery.camelCase( "default-" + name ) ] : - !!attr : - - // fetch an attribute node for properties not recognized as boolean - elem.getAttributeNode( name ); - - return detail && detail.value !== false ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { - // IE<8 needs the *property* name - elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); - - // Use defaultChecked and defaultSelected for oldIE - } else { - elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; - } - - return name; - } -}; - -// fix oldIE value attroperty -if ( !getSetInput || !getSetAttribute ) { - jQuery.attrHooks.value = { - get: function( elem, name ) { - var ret = elem.getAttributeNode( name ); - return jQuery.nodeName( elem, "input" ) ? - - // Ignore the value *property* by using defaultValue - elem.defaultValue : - - ret && ret.specified ? ret.value : undefined; - }, - set: function( elem, value, name ) { - if ( jQuery.nodeName( elem, "input" ) ) { - // Does not return so that setAttribute is also used - elem.defaultValue = value; - } else { - // Use nodeHook if defined (#1954); otherwise setAttribute is fine - return nodeHook && nodeHook.set( elem, value, name ); - } - } - }; -} - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret = elem.getAttributeNode( name ); - return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ? - ret.value : - undefined; - }, - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - elem.setAttributeNode( - (ret = elem.ownerDocument.createAttribute( name )) - ); - } - - ret.value = value += ""; - - // Break association with cloned elements by also using setAttribute (#9646) - return name === "value" || value === elem.getAttribute( name ) ? - value : - undefined; - } - }; - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - get: nodeHook.get, - set: function( elem, value, name ) { - nodeHook.set( elem, value === "" ? false : value, name ); - } - }; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); -} - - -// Some attributes require a special call on IE -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret == null ? undefined : ret; - } - }); - }); - - // href/src property should get the full normalized URL (#10299/#12915) - jQuery.each([ "href", "src" ], function( i, name ) { - jQuery.propHooks[ name ] = { - get: function( elem ) { - return elem.getAttribute( name, 4 ); - } - }; - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Note: IE uppercases css property names, but if we were to .toLowerCase() - // .cssText, that would destroy case senstitivity in URL's, like in "background" - return elem.style.cssText || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = value + "" ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }); -} - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }); -}); -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - // Don't attach events to noData or text/comment nodes (but allow plain objects) - elemData = elem.nodeType !== 3 && elem.nodeType !== 8 && jQuery._data( elem ); - - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = ( types || "" ).match( core_rnotwhite ) || [""]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( core_rnotwhite ) || [""]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, - eventPath = [ elem || document ], - type = event.type || event, - namespaces = event.namespace ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - event.isTrigger = true; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { - event.preventDefault(); - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, j, ret, matched, handleObj, - handlerQueue = [], - args = core_slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, matches, sel, handleObj, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - for ( ; cur != this; cur = cur.parentNode || this ) { - - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.disabled !== true || event.type !== "click" ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, - originalEvent = event, - fixHook = jQuery.event.fixHooks[ event.type ] || {}, - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - } - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== document.activeElement && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === document.activeElement && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - - beforeunload: { - postDispatch: function( event ) { - - // Even when returnValue equals to undefined Firefox will still show alert - if ( event.result !== undefined ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === "undefined" ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // 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 && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; - - if ( rkeyEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; - } - - if ( rmouseEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; - } -}); -/*! - * Sizzle CSS Selector Engine - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license - * http://sizzlejs.com/ - */ -(function( window, undefined ) { - -var i, - cachedruns, - Expr, - getText, - isXML, - compile, - hasDuplicate, - outermostContext, - - // Local document vars - setDocument, - document, - docElem, - documentIsXML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - sortOrder, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - support = {}, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Array methods - arr = [], - pop = arr.pop, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors - operators = "([*^$|!~]?=)", - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + - "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", - - // Prefer arguments quoted, - // then not containing pseudos/brackets, - // then attribute selectors/non-parenthetical expressions, - // then anything else - // These preferences are here to reduce the number of selectors - // needing tokenize in the PSEUDO preFilter - pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rsibling = /[\x20\t\r\n\f]*[+~]/, - - rnative = /\{\s*\[native code\]\s*\}/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rescape = /'|\\/g, - rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, - funescape = function( _, escaped ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - return high !== high ? - escaped : - // BMP codepoint - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Use a stripped-down slice if we can't use a native one -try { - slice.call( docElem.childNodes, 0 )[0].nodeType; -} catch ( e ) { - slice = function( i ) { - var elem, - results = []; - for ( ; (elem = this[i]); i++ ) { - results.push( elem ); - } - return results; - }; -} - -/** - * For feature detection - * @param {Function} fn The function to test for native support - */ -function isNative( fn ) { - return rnative.test( fn + "" ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var cache, - keys = []; - - return (cache = function( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key += " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key ] = value); - }); -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return fn( div ); - } catch (e) { - return false; - } finally { - // release memory in IE - div = null; - } -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( !documentIsXML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) { - push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); - return results; - } - } - - // QSA path - if ( support.qsa && !rbuggyQSA.test(selector) ) { - old = true; - nid = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && context.parentNode || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, slice.call( newContext.querySelectorAll( - newSelector - ), 0 ) ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Detect xml - * @param {Element|Object} elem An element or a document - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var doc = node ? node.ownerDocument || node : preferredDoc; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsXML = isXML( doc ); - - // Check if getElementsByTagName("*") returns only elements - support.tagNameNoComments = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if attributes should be retrieved by attribute nodes - support.attributes = assert(function( div ) { - div.innerHTML = ""; - var type = typeof div.lastChild.getAttribute("multiple"); - // IE8 returns a string for some attributes even when not present - return type !== "boolean" && type !== "string"; - }); - - // Check if getElementsByClassName can be trusted - support.getByClassName = assert(function( div ) { - // Opera can't find a second classname (in 9.6) - div.innerHTML = ""; - if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { - return false; - } - - // Safari 3.2 caches class attributes and doesn't catch changes - div.lastChild.className = "e"; - return div.getElementsByClassName("e").length === 2; - }); - - // Check if getElementById returns elements by name - // Check if getElementsByName privileges form controls or returns elements by ID - support.getByName = assert(function( div ) { - // Inject content - div.id = expando + 0; - div.innerHTML = "
    "; - docElem.insertBefore( div, docElem.firstChild ); - - // Test - var pass = doc.getElementsByName && - // buggy browsers will return fewer than the correct 2 - doc.getElementsByName( expando ).length === 2 + - // buggy browsers will return more than the correct 0 - doc.getElementsByName( expando + 0 ).length; - support.getIdNotName = !doc.getElementById( expando ); - - // Cleanup - docElem.removeChild( div ); - - return pass; - }); - - // IE6/7 return modified attributes - Expr.attrHandle = assert(function( div ) { - div.innerHTML = ""; - return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && - div.firstChild.getAttribute("href") === "#"; - }) ? - {} : - { - "href": function( elem ) { - return elem.getAttribute( "href", 2 ); - }, - "type": function( elem ) { - return elem.getAttribute("type"); - } - }; - - // ID find and filter - if ( support.getIdNotName ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && !documentIsXML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && !documentIsXML ) { - var m = context.getElementById( id ); - - return m ? - m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? - [m] : - undefined : - []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.tagNameNoComments ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - for ( ; (elem = results[i]); i++ ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Name - Expr.find["NAME"] = support.getByName && function( tag, context ) { - if ( typeof context.getElementsByName !== strundefined ) { - return context.getElementsByName( name ); - } - }; - - // Class - Expr.find["CLASS"] = support.getByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) { - return context.getElementsByClassName( className ); - } - }; - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21), - // no need to also add to buggyMatches since matches checks buggyQSA - // A support test would require too much code (would include document ready) - rbuggyQSA = [ ":focus" ]; - - if ( (support.qsa = isNative(doc.querySelectorAll)) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explictly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // IE8 - Some boolean attributes are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - - // Opera 10-12/IE8 - ^= $= *= and empty values - // Should not select anything - div.innerHTML = ""; - if ( div.querySelectorAll("[i^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || - docElem.mozMatchesSelector || - docElem.webkitMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = new RegExp( rbuggyMatches.join("|") ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? - function( a, b ) { - 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; - }; - - // Document order sorting - sortOrder = docElem.compareDocumentPosition ? - function( a, b ) { - var compare; - - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) { - if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) { - if ( a === doc || contains( preferredDoc, a ) ) { - return -1; - } - if ( b === doc || contains( preferredDoc, b ) ) { - return 1; - } - return 0; - } - return compare & 4 ? -1 : 1; - } - - return a.compareDocumentPosition ? -1 : 1; - } : - function( a, b ) { - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return ( ~b.sourceIndex || MAX_NEGATIVE ) - ( contains( preferredDoc, a ) && ~a.sourceIndex || MAX_NEGATIVE ); - - // Parentless nodes are either documents or disconnected - } else if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - // Always assume the presence of duplicates if sort doesn't - // pass them to our comparison function (as in Google Chrome). - hasDuplicate = false; - [0, 0].sort( sortOrder ); - support.detectDuplicates = hasDuplicate; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - // rbuggyQSA always contains :focus, so no need for an existence check - if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [elem] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - var val; - - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - if ( !documentIsXML ) { - name = name.toLowerCase(); - } - if ( (val = Expr.attrHandle[ name ]) ) { - return val( elem ); - } - if ( documentIsXML || support.attributes ) { - return elem.getAttribute( name ); - } - return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? - name : - val && val.specified ? val.value : null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -// Document sorting and removing duplicates -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - i = 1, - j = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( ; (elem = results[i]); i++ ) { - if ( elem === results[ i - 1 ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - return results; -}; - -function siblingCheck( a, b ) { - var cur = a && b && a.nextSibling; - - for ( ; cur; cur = cur.nextSibling ) { - if ( cur === b ) { - return -1; - } - } - - return a ? 1 : -1; -} - -// Returns a function to use in pseudos for input types -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -// Returns a function to use in pseudos for buttons -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -// Returns a function to use in pseudos for positionals -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - for ( ; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (see #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[5] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[4] ) { - match[2] = match[4]; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeName ) { - if ( nodeName === "*" ) { - return function() { return true; }; - } - - nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.substr( result.length - check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifider - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsXML ? - elem.getAttribute("xml:lang") || elem.getAttribute("lang") : - elem.lang) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), - // not comment, processing instructions, or others - // Thanks to Diego Perini for the nodeName shortcut - // Greater than "@" means alpha characters (specifically not starting with "#" or "?") - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -function tokenize( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( tokens = [] ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push( { - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -} - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && combinator.dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var data, cache, outerCache, - dirkey = dirruns + " " + doneName; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { - if ( (data = cache[1]) === true || data === cachedruns ) { - return data === true; - } - } else { - cache = outerCache[ dir ] = [ dirkey ]; - cache[1] = matcher( elem, context, xml ) || cachedruns; - if ( cache[1] === true ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - // A counter to specify which element is currently being matched - var matcherCachedRuns = 0, - bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, expandContext ) { - var elem, j, matcher, - setMatched = [], - matchedCount = 0, - i = "0", - unmatched = seed && [], - outermost = expandContext != null, - contextBackup = outermostContext, - // We must always have either seed elements or context - elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), - // Nested matchers should use non-integer dirruns - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E); - - if ( outermost ) { - outermostContext = context !== document && context; - cachedruns = matcherCachedRuns; - } - - // Add elements passing elementMatchers directly to results - for ( ; (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - for ( j = 0; (matcher = elementMatchers[j]); j++ ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - cachedruns = ++matcherCachedRuns; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - // `i` starts as a string, so matchedCount would equal "00" if there are no elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - for ( j = 0; (matcher = setMatchers[j]); j++ ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !group ) { - group = tokenize( selector ); - } - i = group.length; - while ( i-- ) { - cached = matcherFromTokens( group[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - } - return cached; -}; - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function select( selector, context, results, seed ) { - var i, tokens, token, type, find, - match = tokenize( selector ); - - if ( !seed ) { - // Try to minimize operations if there is only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - context.nodeType === 9 && !documentIsXML && - Expr.relative[ tokens[1].type ] ) { - - context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; - if ( !context ) { - return results; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - for ( i = matchExpr["needsContext"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && context.parentNode || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, slice.call( seed, 0 ) ); - return results; - } - - break; - } - } - } - } - } - - // Compile and execute a filtering function - // Provide `match` to avoid retokenization if we modified the selector above - compile( selector, match )( - seed, - context, - documentIsXML, - results, - rsibling.test( selector ) - ); - return results; -} - -// Deprecated -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Easy API for creating new setFilters -function setFilters() {} -Expr.filters = setFilters.prototype = Expr.pseudos; -Expr.setFilters = new setFilters(); - -// Initialize with the default document -setDocument(); - -// Override sizzle attribute retrieval -Sizzle.attr = jQuery.attr; -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})( window ); -var runtil = /Until$/, - rparentsprev = /^(?:parents|prev(?:Until|All))/, - isSimple = /^.[^:#\[\.,]*$/, - rneedsContext = jQuery.expr.match.needsContext, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var i, ret, self; - - if ( typeof selector !== "string" ) { - self = this; - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < self.length; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - ret = []; - for ( i = 0; i < this.length; i++ ) { - jQuery.find( selector, this[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( jQuery.unique( ret ) ); - ret.selector = ( this.selector ? this.selector + " " : "" ) + selector; - return ret; - }, - - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false) ); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true) ); - }, - - is: function( selector ) { - return !!selector && ( - typeof selector === "string" ? - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - rneedsContext.test( selector ) ? - jQuery( selector, this.context ).index( this[0] ) >= 0 : - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - ret = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - cur = this[i]; - - while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - } - cur = cur.parentNode; - } - } - - return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( jQuery.unique(all) ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -jQuery.fn.andSelf = jQuery.fn.addBack; - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( this.length > 1 && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem ) { - return ( elem === qualifier ) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; - }); -} -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
    ", "
    " ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
    " ], - tr: [ 2, "", "
    " ], - col: [ 2, "", "
    " ], - td: [ 3, "", "
    " ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
    ", "
    " ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -jQuery.fn.extend({ - text: function( value ) { - return jQuery.access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - wrapAll: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapAll( html.call(this, i) ); - }); - } - - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); - - if ( this[0].parentNode ) { - wrap.insertBefore( this[0] ); - } - - wrap.map(function() { - var elem = this; - - while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { - elem = elem.firstChild; - } - - return elem; - }).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapInner( html.call(this, i) ); - }); - } - - return this.each(function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - }); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each(function(i) { - jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); - }); - }, - - unwrap: function() { - return this.parent().each(function() { - if ( !jQuery.nodeName( this, "body" ) ) { - jQuery( this ).replaceWith( this.childNodes ); - } - }).end(); - }, - - append: function() { - return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.insertBefore( elem, this.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, false, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, false, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - // keepData is for internal use only--do not document - remove: function( selector, keepData ) { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) { - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function () { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return jQuery.access( this, function( value ) { - var elem = this[0] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function( value ) { - var isFunc = jQuery.isFunction( value ); - - // Make sure that the elements are removed from the DOM before they are inserted - // this can help fix replacing a parent with child elements - if ( !isFunc && typeof value !== "string" ) { - value = jQuery( value ).not( this ).detach(); - } - - return this.domManip( [ value ], true, function( elem ) { - var next = this.nextSibling, - parent = this.parentNode; - - if ( parent && this.nodeType === 1 || this.nodeType === 11 ) { - - jQuery( this ).remove(); - - if ( next ) { - next.parentNode.insertBefore( elem, next ); - } else { - parent.appendChild( elem ); - } - } - }); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, table, callback ) { - - // Flatten any nested arrays - args = core_concat.apply( [], args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, table ? self.html() : undefined ); - } - self.domManip( args, table, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - table = table && jQuery.nodeName( first, "tr" ); - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( - table && jQuery.nodeName( this[i], "table" ) ? - findOrAppend( this[i], "tbody" ) : - this[i], - node, - i - ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Hope ajax is available... - jQuery.ajax({ - url: node.src, - type: "GET", - dataType: "script", - async: false, - global: false, - "throws": true - }); - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -function findOrAppend( elem, tag ) { - return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - var attr = elem.getAttributeNode("type"); - elem.type = ( attr && attr.specified ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, data, e; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - core_push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== "undefined" ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( manipulation_rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, srcElements, node, i, clone, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var contains, elem, tag, tmp, wrap, tbody, j, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !jQuery.support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
    " && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !jQuery.support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var data, id, elem, type, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = jQuery.support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== "undefined" ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - core_deletedIds.push( id ); - } - } - } - } - } -}); -var curCSS, getStyles, iframe, - ralpha = /alpha\([^)]*\)/i, - ropacity = /opacity\s*=\s*([^)]*)/, - rposition = /^(top|right|bottom|left)$/, - // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" - // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rmargin = /^margin/, - rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), - rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), - rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), - elemdisplay = { BODY: "block" }, - - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: 0, - fontWeight: 400 - }, - - cssExpand = [ "Top", "Right", "Bottom", "Left" ], - cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; - -// return a css property mapped to a potentially vendor prefixed property -function vendorPropName( style, name ) { - - // shortcut for names that are not vendor prefixed - if ( name in style ) { - return name; - } - - // check for vendor prefixed names - var capName = name.charAt(0).toUpperCase() + name.slice(1), - origName = name, - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in style ) { - return name; - } - } - - return origName; -} - -function isHidden( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); -} - -function showHide( elements, show ) { - var elem, - values = [], - index = 0, - length = elements.length; - - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - values[ index ] = jQuery._data( elem, "olddisplay" ); - if ( show ) { - // Reset the inline display of this element to learn if it is - // being hidden by cascaded rules or not - if ( !values[ index ] && elem.style.display === "none" ) { - elem.style.display = ""; - } - - // Set elements which have been overridden with display: none - // in a stylesheet to whatever the default browser style is - // for such an element - if ( elem.style.display === "" && isHidden( elem ) ) { - values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); - } - } else if ( !values[ index ] && !isHidden( elem ) ) { - jQuery._data( elem, "olddisplay", jQuery.css( elem, "display" ) ); - } - } - - // Set the display of most of the elements in a second loop - // to avoid the constant reflow - for ( index = 0; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - if ( !show || elem.style.display === "none" || elem.style.display === "" ) { - elem.style.display = show ? values[ index ] || "" : "none"; - } - } - - return elements; -} - -jQuery.fn.extend({ - css: function( name, value ) { - return jQuery.access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( jQuery.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - }, - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - var bool = typeof state === "boolean"; - - return this.each(function() { - if ( bool ? state : isHidden( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - }); - } -}); - -jQuery.extend({ - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Exclude the following css properties to add px - cssNumber: { - "columnCount": true, - "fillOpacity": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - // normalize float css property - "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - style = elem.style; - - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // convert relative number strings (+= or -=) to relative numbers. #7345 - if ( type === "string" && (ret = rrelNum.exec( value )) ) { - value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); - // Fixes bug #9237 - type = "number"; - } - - // Make sure that NaN and null values aren't set. See: #7116 - if ( value == null || type === "number" && isNaN( value ) ) { - return; - } - - // If a number was passed in, add 'px' to the (except for certain CSS properties) - if ( type === "number" && !jQuery.cssNumber[ origName ] ) { - value += "px"; - } - - // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, - // but it would mean to define eight (for every problematic property) identical functions - if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { - - // Wrapped to prevent IE from throwing errors when 'invalid' values are provided - // Fixes bug #5509 - try { - style[ name ] = value; - } catch(e) {} - } - - } else { - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = jQuery.camelCase( name ); - - // Make sure that we're working with the right name - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - //convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Return, converting to number if forced or a qualifier was provided and val looks numeric - if ( extra ) { - num = parseFloat( val ); - return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; - } - return val; - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations - swap: function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; - } -}); - -// NOTE: we've included the "window" in window.getComputedStyle -// because jsdom on node.js will break without it. -if ( window.getComputedStyle ) { - getStyles = function( elem ) { - return window.getComputedStyle( elem, null ); - }; - - curCSS = function( elem, name, _computed ) { - var width, minWidth, maxWidth, - computed = _computed || getStyles( elem ), - - // getPropertyValue is only needed for .css('filter') in IE9, see #12537 - ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, - style = elem.style; - - if ( computed ) { - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right - // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels - // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values - if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret; - }; -} else if ( document.documentElement.currentStyle ) { - getStyles = function( elem ) { - return elem.currentStyle; - }; - - curCSS = function( elem, name, _computed ) { - var left, rs, rsLeft, - computed = _computed || getStyles( elem ), - ret = computed ? computed[ name ] : undefined, - style = elem.style; - - // Avoid setting ret to empty string here - // so we don't default to auto - if ( ret == null && style && style[ name ] ) { - ret = style[ name ]; - } - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - // but not position css attributes, as those are proportional to the parent element instead - // and we can't measure the parent instead because it might trigger a "stacking dolls" problem - if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { - - // Remember the original values - left = style.left; - rs = elem.runtimeStyle; - rsLeft = rs && rs.left; - - // Put in the new values to get a computed value out - if ( rsLeft ) { - rs.left = elem.currentStyle.left; - } - style.left = name === "fontSize" ? "1em" : ret; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - if ( rsLeft ) { - rs.left = rsLeft; - } - } - - return ret === "" ? "auto" : ret; - }; -} - -function setPositiveNumber( elem, value, subtract ) { - var matches = rnumsplit.exec( value ); - return matches ? - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { - var i = extra === ( isBorderBox ? "border" : "content" ) ? - // If we already have the right measurement, avoid augmentation - 4 : - // Otherwise initialize for horizontal or vertical properties - name === "width" ? 1 : 0, - - val = 0; - - for ( ; i < 4; i += 2 ) { - // both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); - } - - if ( isBorderBox ) { - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // at this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } else { - // at this point, extra isn't content, so add padding - val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // at this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with offset property, which is equivalent to the border-box value - var valueIsBorderBox = true, - val = name === "width" ? elem.offsetWidth : elem.offsetHeight, - styles = getStyles( elem ), - isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // some non-html elements return undefined for offsetWidth, so check for null/undefined - // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 - // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 - if ( val <= 0 || val == null ) { - // Fall back to computed then uncomputed css if necessary - val = curCSS( elem, name, styles ); - if ( val < 0 || val == null ) { - val = elem.style[ name ]; - } - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test(val) ) { - return val; - } - - // we need the check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - } - - // use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles - ) - ) + "px"; -} - -// Try to determine the default display value of an element -function css_defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - // Use the already-created iframe if possible - iframe = ( iframe || - jQuery("' : ''); - inst._keyEvent = false; - return html; - }, - - /* Generate the month and year header. */ - _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, - secondary, monthNames, monthNamesShort) { - var changeMonth = this._get(inst, 'changeMonth'); - var changeYear = this._get(inst, 'changeYear'); - var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); - var html = '
    '; - var monthHtml = ''; - // month selection - if (secondary || !changeMonth) - monthHtml += '' + monthNames[drawMonth] + ''; - else { - var inMinYear = (minDate && minDate.getFullYear() == drawYear); - var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); - monthHtml += ''; - } - if (!showMonthAfterYear) - html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); - // year selection - if ( !inst.yearshtml ) { - inst.yearshtml = ''; - if (secondary || !changeYear) - html += '' + drawYear + ''; - else { - // determine range of years to display - var years = this._get(inst, 'yearRange').split(':'); - var thisYear = new Date().getFullYear(); - var determineYear = function(value) { - var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : - (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : - parseInt(value, 10))); - return (isNaN(year) ? thisYear : year); - }; - var year = determineYear(years[0]); - var endYear = Math.max(year, determineYear(years[1] || '')); - year = (minDate ? Math.max(year, minDate.getFullYear()) : year); - endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); - inst.yearshtml += ''; - - html += inst.yearshtml; - inst.yearshtml = null; - } - } - html += this._get(inst, 'yearSuffix'); - if (showMonthAfterYear) - html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; - html += '
    '; // Close datepicker_header - return html; - }, - - /* Adjust one of the date sub-fields. */ - _adjustInstDate: function(inst, offset, period) { - var year = inst.drawYear + (period == 'Y' ? offset : 0); - var month = inst.drawMonth + (period == 'M' ? offset : 0); - var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + - (period == 'D' ? offset : 0); - var date = this._restrictMinMax(inst, - this._daylightSavingAdjust(new Date(year, month, day))); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - if (period == 'M' || period == 'Y') - this._notifyChange(inst); - }, - - /* Ensure a date is within any min/max bounds. */ - _restrictMinMax: function(inst, date) { - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - var newDate = (minDate && date < minDate ? minDate : date); - newDate = (maxDate && newDate > maxDate ? maxDate : newDate); - return newDate; - }, - - /* Notify change of month/year. */ - _notifyChange: function(inst) { - var onChange = this._get(inst, 'onChangeMonthYear'); - if (onChange) - onChange.apply((inst.input ? inst.input[0] : null), - [inst.selectedYear, inst.selectedMonth + 1, inst]); - }, - - /* Determine the number of months to show. */ - _getNumberOfMonths: function(inst) { - var numMonths = this._get(inst, 'numberOfMonths'); - return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); - }, - - /* Determine the current maximum date - ensure no time components are set. */ - _getMinMaxDate: function(inst, minMax) { - return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); - }, - - /* Find the number of days in a given month. */ - _getDaysInMonth: function(year, month) { - return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); - }, - - /* Find the day of the week of the first of a month. */ - _getFirstDayOfMonth: function(year, month) { - return new Date(year, month, 1).getDay(); - }, - - /* Determines if we should allow a "next/prev" month display change. */ - _canAdjustMonth: function(inst, offset, curYear, curMonth) { - var numMonths = this._getNumberOfMonths(inst); - var date = this._daylightSavingAdjust(new Date(curYear, - curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); - if (offset < 0) - date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); - return this._isInRange(inst, date); - }, - - /* Is the given date in the accepted range? */ - _isInRange: function(inst, date) { - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - return ((!minDate || date.getTime() >= minDate.getTime()) && - (!maxDate || date.getTime() <= maxDate.getTime())); - }, - - /* Provide the configuration settings for formatting/parsing. */ - _getFormatConfig: function(inst) { - var shortYearCutoff = this._get(inst, 'shortYearCutoff'); - shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : - new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); - return {shortYearCutoff: shortYearCutoff, - dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), - monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; - }, - - /* Format the given date for display. */ - _formatDate: function(inst, day, month, year) { - if (!day) { - inst.currentDay = inst.selectedDay; - inst.currentMonth = inst.selectedMonth; - inst.currentYear = inst.selectedYear; - } - var date = (day ? (typeof day == 'object' ? day : - this._daylightSavingAdjust(new Date(year, month, day))) : - this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); - } -}); - -/* - * Bind hover events for datepicker elements. - * Done via delegate so the binding only occurs once in the lifetime of the parent div. - * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. - */ -function bindHover(dpDiv) { - var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; - return dpDiv.delegate(selector, 'mouseout', function() { - $(this).removeClass('ui-state-hover'); - if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); - if (this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); - }) - .delegate(selector, 'mouseover', function(){ - if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { - $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); - $(this).addClass('ui-state-hover'); - if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); - if (this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); - } - }); -} - -/* jQuery extend now ignores nulls! */ -function extendRemove(target, props) { - $.extend(target, props); - for (var name in props) - if (props[name] == null || props[name] == undefined) - target[name] = props[name]; - return target; -}; - -/* Invoke the datepicker functionality. - @param options string - a command, optionally followed by additional parameters or - Object - settings for attaching new datepicker functionality - @return jQuery object */ -$.fn.datepicker = function(options){ - - /* Verify an empty collection wasn't passed - Fixes #6976 */ - if ( !this.length ) { - return this; - } - - /* Initialise the date picker. */ - if (!$.datepicker.initialized) { - $(document).mousedown($.datepicker._checkExternalClick). - find(document.body).append($.datepicker.dpDiv); - $.datepicker.initialized = true; - } - - var otherArgs = Array.prototype.slice.call(arguments, 1); - if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - return this.each(function() { - typeof options == 'string' ? - $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this].concat(otherArgs)) : - $.datepicker._attachDatepicker(this, options); - }); -}; - -$.datepicker = new Datepicker(); // singleton instance -$.datepicker.initialized = false; -$.datepicker.uuid = new Date().getTime(); -$.datepicker.version = "1.9.2"; - -// Workaround for #4055 -// Add another global to avoid noConflict issues with inline event handlers -window['DP_jQuery_' + dpuuid] = $; - -})(jQuery); -(function( $, undefined ) { - -var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ", - sizeRelatedOptions = { - buttons: true, - height: true, - maxHeight: true, - maxWidth: true, - minHeight: true, - minWidth: true, - width: true - }, - resizableRelatedOptions = { - maxHeight: true, - maxWidth: true, - minHeight: true, - minWidth: true - }; - -$.widget("ui.dialog", { - version: "1.9.2", - options: { - autoOpen: true, - buttons: {}, - closeOnEscape: true, - closeText: "close", - dialogClass: "", - draggable: true, - hide: null, - height: "auto", - maxHeight: false, - maxWidth: false, - minHeight: 150, - minWidth: 150, - modal: false, - position: { - my: "center", - at: "center", - of: window, - collision: "fit", - // ensure that the titlebar is never outside the document - using: function( pos ) { - var topOffset = $( this ).css( pos ).offset().top; - if ( topOffset < 0 ) { - $( this ).css( "top", pos.top - topOffset ); - } - } - }, - resizable: true, - show: null, - stack: true, - title: "", - width: 300, - zIndex: 1000 - }, - - _create: function() { - this.originalTitle = this.element.attr( "title" ); - // #5742 - .attr() might return a DOMElement - if ( typeof this.originalTitle !== "string" ) { - this.originalTitle = ""; - } - this.oldPosition = { - parent: this.element.parent(), - index: this.element.parent().children().index( this.element ) - }; - this.options.title = this.options.title || this.originalTitle; - var that = this, - options = this.options, - - title = options.title || " ", - uiDialog, - uiDialogTitlebar, - uiDialogTitlebarClose, - uiDialogTitle, - uiDialogButtonPane; - - uiDialog = ( this.uiDialog = $( "
    " ) ) - .addClass( uiDialogClasses + options.dialogClass ) - .css({ - display: "none", - outline: 0, // TODO: move to stylesheet - zIndex: options.zIndex - }) - // setting tabIndex makes the div focusable - .attr( "tabIndex", -1) - .keydown(function( event ) { - if ( options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && - event.keyCode === $.ui.keyCode.ESCAPE ) { - that.close( event ); - event.preventDefault(); - } - }) - .mousedown(function( event ) { - that.moveToTop( false, event ); - }) - .appendTo( "body" ); - - this.element - .show() - .removeAttr( "title" ) - .addClass( "ui-dialog-content ui-widget-content" ) - .appendTo( uiDialog ); - - uiDialogTitlebar = ( this.uiDialogTitlebar = $( "
    " ) ) - .addClass( "ui-dialog-titlebar ui-widget-header " + - "ui-corner-all ui-helper-clearfix" ) - .bind( "mousedown", function() { - // Dialog isn't getting focus when dragging (#8063) - uiDialog.focus(); - }) - .prependTo( uiDialog ); - - uiDialogTitlebarClose = $( "" ) - .addClass( "ui-dialog-titlebar-close ui-corner-all" ) - .attr( "role", "button" ) - .click(function( event ) { - event.preventDefault(); - that.close( event ); - }) - .appendTo( uiDialogTitlebar ); - - ( this.uiDialogTitlebarCloseText = $( "" ) ) - .addClass( "ui-icon ui-icon-closethick" ) - .text( options.closeText ) - .appendTo( uiDialogTitlebarClose ); - - uiDialogTitle = $( "" ) - .uniqueId() - .addClass( "ui-dialog-title" ) - .html( title ) - .prependTo( uiDialogTitlebar ); - - uiDialogButtonPane = ( this.uiDialogButtonPane = $( "
    " ) ) - .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ); - - ( this.uiButtonSet = $( "
    " ) ) - .addClass( "ui-dialog-buttonset" ) - .appendTo( uiDialogButtonPane ); - - uiDialog.attr({ - role: "dialog", - "aria-labelledby": uiDialogTitle.attr( "id" ) - }); - - uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection(); - this._hoverable( uiDialogTitlebarClose ); - this._focusable( uiDialogTitlebarClose ); - - if ( options.draggable && $.fn.draggable ) { - this._makeDraggable(); - } - if ( options.resizable && $.fn.resizable ) { - this._makeResizable(); - } - - this._createButtons( options.buttons ); - this._isOpen = false; - - if ( $.fn.bgiframe ) { - uiDialog.bgiframe(); - } - - // prevent tabbing out of modal dialogs - this._on( uiDialog, { keydown: function( event ) { - if ( !options.modal || event.keyCode !== $.ui.keyCode.TAB ) { - return; - } - - var tabbables = $( ":tabbable", uiDialog ), - first = tabbables.filter( ":first" ), - last = tabbables.filter( ":last" ); - - if ( event.target === last[0] && !event.shiftKey ) { - first.focus( 1 ); - return false; - } else if ( event.target === first[0] && event.shiftKey ) { - last.focus( 1 ); - return false; - } - }}); - }, - - _init: function() { - if ( this.options.autoOpen ) { - this.open(); - } - }, - - _destroy: function() { - var next, - oldPosition = this.oldPosition; - - if ( this.overlay ) { - this.overlay.destroy(); - } - this.uiDialog.hide(); - this.element - .removeClass( "ui-dialog-content ui-widget-content" ) - .hide() - .appendTo( "body" ); - this.uiDialog.remove(); - - if ( this.originalTitle ) { - this.element.attr( "title", this.originalTitle ); - } - - next = oldPosition.parent.children().eq( oldPosition.index ); - // Don't try to place the dialog next to itself (#8613) - if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { - next.before( this.element ); - } else { - oldPosition.parent.append( this.element ); - } - }, - - widget: function() { - return this.uiDialog; - }, - - close: function( event ) { - var that = this, - maxZ, thisZ; - - if ( !this._isOpen ) { - return; - } - - if ( false === this._trigger( "beforeClose", event ) ) { - return; - } - - this._isOpen = false; - - if ( this.overlay ) { - this.overlay.destroy(); - } - - if ( this.options.hide ) { - this._hide( this.uiDialog, this.options.hide, function() { - that._trigger( "close", event ); - }); - } else { - this.uiDialog.hide(); - this._trigger( "close", event ); - } - - $.ui.dialog.overlay.resize(); - - // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) - if ( this.options.modal ) { - maxZ = 0; - $( ".ui-dialog" ).each(function() { - if ( this !== that.uiDialog[0] ) { - thisZ = $( this ).css( "z-index" ); - if ( !isNaN( thisZ ) ) { - maxZ = Math.max( maxZ, thisZ ); - } - } - }); - $.ui.dialog.maxZ = maxZ; - } - - return this; - }, - - isOpen: function() { - return this._isOpen; - }, - - // the force parameter allows us to move modal dialogs to their correct - // position on open - moveToTop: function( force, event ) { - var options = this.options, - saveScroll; - - if ( ( options.modal && !force ) || - ( !options.stack && !options.modal ) ) { - return this._trigger( "focus", event ); - } - - if ( options.zIndex > $.ui.dialog.maxZ ) { - $.ui.dialog.maxZ = options.zIndex; - } - if ( this.overlay ) { - $.ui.dialog.maxZ += 1; - $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ; - this.overlay.$el.css( "z-index", $.ui.dialog.overlay.maxZ ); - } - - // Save and then restore scroll - // Opera 9.5+ resets when parent z-index is changed. - // http://bugs.jqueryui.com/ticket/3193 - saveScroll = { - scrollTop: this.element.scrollTop(), - scrollLeft: this.element.scrollLeft() - }; - $.ui.dialog.maxZ += 1; - this.uiDialog.css( "z-index", $.ui.dialog.maxZ ); - this.element.attr( saveScroll ); - this._trigger( "focus", event ); - - return this; - }, - - open: function() { - if ( this._isOpen ) { - return; - } - - var hasFocus, - options = this.options, - uiDialog = this.uiDialog; - - this._size(); - this._position( options.position ); - uiDialog.show( options.show ); - this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null; - this.moveToTop( true ); - - // set focus to the first tabbable element in the content area or the first button - // if there are no tabbable elements, set focus on the dialog itself - hasFocus = this.element.find( ":tabbable" ); - if ( !hasFocus.length ) { - hasFocus = this.uiDialogButtonPane.find( ":tabbable" ); - if ( !hasFocus.length ) { - hasFocus = uiDialog; - } - } - hasFocus.eq( 0 ).focus(); - - this._isOpen = true; - this._trigger( "open" ); - - return this; - }, - - _createButtons: function( buttons ) { - var that = this, - hasButtons = false; - - // if we already have a button pane, remove it - this.uiDialogButtonPane.remove(); - this.uiButtonSet.empty(); - - if ( typeof buttons === "object" && buttons !== null ) { - $.each( buttons, function() { - return !(hasButtons = true); - }); - } - if ( hasButtons ) { - $.each( buttons, function( name, props ) { - var button, click; - props = $.isFunction( props ) ? - { click: props, text: name } : - props; - // Default to a non-submitting button - props = $.extend( { type: "button" }, props ); - // Change the context for the click callback to be the main element - click = props.click; - props.click = function() { - click.apply( that.element[0], arguments ); - }; - button = $( "", props ) - .appendTo( that.uiButtonSet ); - if ( $.fn.button ) { - button.button(); - } - }); - this.uiDialog.addClass( "ui-dialog-buttons" ); - this.uiDialogButtonPane.appendTo( this.uiDialog ); - } else { - this.uiDialog.removeClass( "ui-dialog-buttons" ); - } - }, - - _makeDraggable: function() { - var that = this, - options = this.options; - - function filteredUi( ui ) { - return { - position: ui.position, - offset: ui.offset - }; - } - - this.uiDialog.draggable({ - cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", - handle: ".ui-dialog-titlebar", - containment: "document", - start: function( event, ui ) { - $( this ) - .addClass( "ui-dialog-dragging" ); - that._trigger( "dragStart", event, filteredUi( ui ) ); - }, - drag: function( event, ui ) { - that._trigger( "drag", event, filteredUi( ui ) ); - }, - stop: function( event, ui ) { - options.position = [ - ui.position.left - that.document.scrollLeft(), - ui.position.top - that.document.scrollTop() - ]; - $( this ) - .removeClass( "ui-dialog-dragging" ); - that._trigger( "dragStop", event, filteredUi( ui ) ); - $.ui.dialog.overlay.resize(); - } - }); - }, - - _makeResizable: function( handles ) { - handles = (handles === undefined ? this.options.resizable : handles); - var that = this, - options = this.options, - // .ui-resizable has position: relative defined in the stylesheet - // but dialogs have to use absolute or fixed positioning - position = this.uiDialog.css( "position" ), - resizeHandles = typeof handles === 'string' ? - handles : - "n,e,s,w,se,sw,ne,nw"; - - function filteredUi( ui ) { - return { - originalPosition: ui.originalPosition, - originalSize: ui.originalSize, - position: ui.position, - size: ui.size - }; - } - - this.uiDialog.resizable({ - cancel: ".ui-dialog-content", - containment: "document", - alsoResize: this.element, - maxWidth: options.maxWidth, - maxHeight: options.maxHeight, - minWidth: options.minWidth, - minHeight: this._minHeight(), - handles: resizeHandles, - start: function( event, ui ) { - $( this ).addClass( "ui-dialog-resizing" ); - that._trigger( "resizeStart", event, filteredUi( ui ) ); - }, - resize: function( event, ui ) { - that._trigger( "resize", event, filteredUi( ui ) ); - }, - stop: function( event, ui ) { - $( this ).removeClass( "ui-dialog-resizing" ); - options.height = $( this ).height(); - options.width = $( this ).width(); - that._trigger( "resizeStop", event, filteredUi( ui ) ); - $.ui.dialog.overlay.resize(); - } - }) - .css( "position", position ) - .find( ".ui-resizable-se" ) - .addClass( "ui-icon ui-icon-grip-diagonal-se" ); - }, - - _minHeight: function() { - var options = this.options; - - if ( options.height === "auto" ) { - return options.minHeight; - } else { - return Math.min( options.minHeight, options.height ); - } - }, - - _position: function( position ) { - var myAt = [], - offset = [ 0, 0 ], - isVisible; - - if ( position ) { - // deep extending converts arrays to objects in jQuery <= 1.3.2 :-( - // if (typeof position == 'string' || $.isArray(position)) { - // myAt = $.isArray(position) ? position : position.split(' '); - - if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) { - myAt = position.split ? position.split( " " ) : [ position[ 0 ], position[ 1 ] ]; - if ( myAt.length === 1 ) { - myAt[ 1 ] = myAt[ 0 ]; - } - - $.each( [ "left", "top" ], function( i, offsetPosition ) { - if ( +myAt[ i ] === myAt[ i ] ) { - offset[ i ] = myAt[ i ]; - myAt[ i ] = offsetPosition; - } - }); - - position = { - my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " + - myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]), - at: myAt.join( " " ) - }; - } - - position = $.extend( {}, $.ui.dialog.prototype.options.position, position ); - } else { - position = $.ui.dialog.prototype.options.position; - } - - // need to show the dialog to get the actual offset in the position plugin - isVisible = this.uiDialog.is( ":visible" ); - if ( !isVisible ) { - this.uiDialog.show(); - } - this.uiDialog.position( position ); - if ( !isVisible ) { - this.uiDialog.hide(); - } - }, - - _setOptions: function( options ) { - var that = this, - resizableOptions = {}, - resize = false; - - $.each( options, function( key, value ) { - that._setOption( key, value ); - - if ( key in sizeRelatedOptions ) { - resize = true; - } - if ( key in resizableRelatedOptions ) { - resizableOptions[ key ] = value; - } - }); - - if ( resize ) { - this._size(); - } - if ( this.uiDialog.is( ":data(resizable)" ) ) { - this.uiDialog.resizable( "option", resizableOptions ); - } - }, - - _setOption: function( key, value ) { - var isDraggable, isResizable, - uiDialog = this.uiDialog; - - switch ( key ) { - case "buttons": - this._createButtons( value ); - break; - case "closeText": - // ensure that we always pass a string - this.uiDialogTitlebarCloseText.text( "" + value ); - break; - case "dialogClass": - uiDialog - .removeClass( this.options.dialogClass ) - .addClass( uiDialogClasses + value ); - break; - case "disabled": - if ( value ) { - uiDialog.addClass( "ui-dialog-disabled" ); - } else { - uiDialog.removeClass( "ui-dialog-disabled" ); - } - break; - case "draggable": - isDraggable = uiDialog.is( ":data(draggable)" ); - if ( isDraggable && !value ) { - uiDialog.draggable( "destroy" ); - } - - if ( !isDraggable && value ) { - this._makeDraggable(); - } - break; - case "position": - this._position( value ); - break; - case "resizable": - // currently resizable, becoming non-resizable - isResizable = uiDialog.is( ":data(resizable)" ); - if ( isResizable && !value ) { - uiDialog.resizable( "destroy" ); - } - - // currently resizable, changing handles - if ( isResizable && typeof value === "string" ) { - uiDialog.resizable( "option", "handles", value ); - } - - // currently non-resizable, becoming resizable - if ( !isResizable && value !== false ) { - this._makeResizable( value ); - } - break; - case "title": - // convert whatever was passed in o a string, for html() to not throw up - $( ".ui-dialog-title", this.uiDialogTitlebar ) - .html( "" + ( value || " " ) ); - break; - } - - this._super( key, value ); - }, - - _size: function() { - /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content - * divs will both have width and height set, so we need to reset them - */ - var nonContentHeight, minContentHeight, autoHeight, - options = this.options, - isVisible = this.uiDialog.is( ":visible" ); - - // reset content sizing - this.element.show().css({ - width: "auto", - minHeight: 0, - height: 0 - }); - - if ( options.minWidth > options.width ) { - options.width = options.minWidth; - } - - // reset wrapper sizing - // determine the height of all the non-content elements - nonContentHeight = this.uiDialog.css({ - height: "auto", - width: options.width - }) - .outerHeight(); - minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); - - if ( options.height === "auto" ) { - // only needed for IE6 support - if ( $.support.minHeight ) { - this.element.css({ - minHeight: minContentHeight, - height: "auto" - }); - } else { - this.uiDialog.show(); - autoHeight = this.element.css( "height", "auto" ).height(); - if ( !isVisible ) { - this.uiDialog.hide(); - } - this.element.height( Math.max( autoHeight, minContentHeight ) ); - } - } else { - this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); - } - - if (this.uiDialog.is( ":data(resizable)" ) ) { - this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); - } - } -}); - -$.extend($.ui.dialog, { - uuid: 0, - maxZ: 0, - - getTitleId: function($el) { - var id = $el.attr( "id" ); - if ( !id ) { - this.uuid += 1; - id = this.uuid; - } - return "ui-dialog-title-" + id; - }, - - overlay: function( dialog ) { - this.$el = $.ui.dialog.overlay.create( dialog ); - } -}); - -$.extend( $.ui.dialog.overlay, { - instances: [], - // reuse old instances due to IE memory leak with alpha transparency (see #5185) - oldInstances: [], - maxZ: 0, - events: $.map( - "focus,mousedown,mouseup,keydown,keypress,click".split( "," ), - function( event ) { - return event + ".dialog-overlay"; - } - ).join( " " ), - create: function( dialog ) { - if ( this.instances.length === 0 ) { - // prevent use of anchors and inputs - // we use a setTimeout in case the overlay is created from an - // event that we're going to be cancelling (see #2804) - setTimeout(function() { - // handle $(el).dialog().dialog('close') (see #4065) - if ( $.ui.dialog.overlay.instances.length ) { - $( document ).bind( $.ui.dialog.overlay.events, function( event ) { - // stop events if the z-index of the target is < the z-index of the overlay - // we cannot return true when we don't want to cancel the event (#3523) - if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) { - return false; - } - }); - } - }, 1 ); - - // handle window resize - $( window ).bind( "resize.dialog-overlay", $.ui.dialog.overlay.resize ); - } - - var $el = ( this.oldInstances.pop() || $( "
    " ).addClass( "ui-widget-overlay" ) ); - - // allow closing by pressing the escape key - $( document ).bind( "keydown.dialog-overlay", function( event ) { - var instances = $.ui.dialog.overlay.instances; - // only react to the event if we're the top overlay - if ( instances.length !== 0 && instances[ instances.length - 1 ] === $el && - dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && - event.keyCode === $.ui.keyCode.ESCAPE ) { - - dialog.close( event ); - event.preventDefault(); - } - }); - - $el.appendTo( document.body ).css({ - width: this.width(), - height: this.height() - }); - - if ( $.fn.bgiframe ) { - $el.bgiframe(); - } - - this.instances.push( $el ); - return $el; - }, - - destroy: function( $el ) { - var indexOf = $.inArray( $el, this.instances ), - maxZ = 0; - - if ( indexOf !== -1 ) { - this.oldInstances.push( this.instances.splice( indexOf, 1 )[ 0 ] ); - } - - if ( this.instances.length === 0 ) { - $( [ document, window ] ).unbind( ".dialog-overlay" ); - } - - $el.height( 0 ).width( 0 ).remove(); - - // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) - $.each( this.instances, function() { - maxZ = Math.max( maxZ, this.css( "z-index" ) ); - }); - this.maxZ = maxZ; - }, - - height: function() { - var scrollHeight, - offsetHeight; - // handle IE - if ( $.ui.ie ) { - scrollHeight = Math.max( - document.documentElement.scrollHeight, - document.body.scrollHeight - ); - offsetHeight = Math.max( - document.documentElement.offsetHeight, - document.body.offsetHeight - ); - - if ( scrollHeight < offsetHeight ) { - return $( window ).height() + "px"; - } else { - return scrollHeight + "px"; - } - // handle "good" browsers - } else { - return $( document ).height() + "px"; - } - }, - - width: function() { - var scrollWidth, - offsetWidth; - // handle IE - if ( $.ui.ie ) { - scrollWidth = Math.max( - document.documentElement.scrollWidth, - document.body.scrollWidth - ); - offsetWidth = Math.max( - document.documentElement.offsetWidth, - document.body.offsetWidth - ); - - if ( scrollWidth < offsetWidth ) { - return $( window ).width() + "px"; - } else { - return scrollWidth + "px"; - } - // handle "good" browsers - } else { - return $( document ).width() + "px"; - } - }, - - resize: function() { - /* If the dialog is draggable and the user drags it past the - * right edge of the window, the document becomes wider so we - * need to stretch the overlay. If the user then drags the - * dialog back to the left, the document will become narrower, - * so we need to shrink the overlay to the appropriate size. - * This is handled by shrinking the overlay before setting it - * to the full document size. - */ - var $overlays = $( [] ); - $.each( $.ui.dialog.overlay.instances, function() { - $overlays = $overlays.add( this ); - }); - - $overlays.css({ - width: 0, - height: 0 - }).css({ - width: $.ui.dialog.overlay.width(), - height: $.ui.dialog.overlay.height() - }); - } -}); - -$.extend( $.ui.dialog.overlay.prototype, { - destroy: function() { - $.ui.dialog.overlay.destroy( this.$el ); - } -}); - -}( jQuery ) ); -(function( $, undefined ) { - -$.widget("ui.draggable", $.ui.mouse, { - version: "1.9.2", - widgetEventPrefix: "drag", - options: { - addClasses: true, - appendTo: "parent", - axis: false, - connectToSortable: false, - containment: false, - cursor: "auto", - cursorAt: false, - grid: false, - handle: false, - helper: "original", - iframeFix: false, - opacity: false, - refreshPositions: false, - revert: false, - revertDuration: 500, - scope: "default", - scroll: true, - scrollSensitivity: 20, - scrollSpeed: 20, - snap: false, - snapMode: "both", - snapTolerance: 20, - stack: false, - zIndex: false - }, - _create: function() { - - if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) - this.element[0].style.position = 'relative'; - - (this.options.addClasses && this.element.addClass("ui-draggable")); - (this.options.disabled && this.element.addClass("ui-draggable-disabled")); - - this._mouseInit(); - - }, - - _destroy: function() { - this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); - this._mouseDestroy(); - }, - - _mouseCapture: function(event) { - - var o = this.options; - - // among others, prevent a drag on a resizable-handle - if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) - return false; - - //Quit if we're not on a valid handle - this.handle = this._getHandle(event); - if (!this.handle) - return false; - - $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { - $('
    ') - .css({ - width: this.offsetWidth+"px", height: this.offsetHeight+"px", - position: "absolute", opacity: "0.001", zIndex: 1000 - }) - .css($(this).offset()) - .appendTo("body"); - }); - - return true; - - }, - - _mouseStart: function(event) { - - var o = this.options; - - //Create and append the visible helper - this.helper = this._createHelper(event); - - this.helper.addClass("ui-draggable-dragging"); - - //Cache the helper size - this._cacheHelperProportions(); - - //If ddmanager is used for droppables, set the global draggable - if($.ui.ddmanager) - $.ui.ddmanager.current = this; - - /* - * - Position generation - - * This block generates everything position related - it's the core of draggables. - */ - - //Cache the margins of the original element - this._cacheMargins(); - - //Store the helper's css position - this.cssPosition = this.helper.css("position"); - this.scrollParent = this.helper.scrollParent(); - - //The element's absolute position on the page minus margins - this.offset = this.positionAbs = this.element.offset(); - this.offset = { - top: this.offset.top - this.margins.top, - left: this.offset.left - this.margins.left - }; - - $.extend(this.offset, { - click: { //Where the click happened, relative to the element - left: event.pageX - this.offset.left, - top: event.pageY - this.offset.top - }, - parent: this._getParentOffset(), - relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper - }); - - //Generate the original position - this.originalPosition = this.position = this._generatePosition(event); - this.originalPageX = event.pageX; - this.originalPageY = event.pageY; - - //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied - (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); - - //Set a containment if given in the options - if(o.containment) - this._setContainment(); - - //Trigger event + callbacks - if(this._trigger("start", event) === false) { - this._clear(); - return false; - } - - //Recache the helper size - this._cacheHelperProportions(); - - //Prepare the droppable offsets - if ($.ui.ddmanager && !o.dropBehaviour) - $.ui.ddmanager.prepareOffsets(this, event); - - - this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position - - //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) - if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event); - - return true; - }, - - _mouseDrag: function(event, noPropagation) { - - //Compute the helpers position - this.position = this._generatePosition(event); - this.positionAbs = this._convertPositionTo("absolute"); - - //Call plugins and callbacks and use the resulting position if something is returned - if (!noPropagation) { - var ui = this._uiHash(); - if(this._trigger('drag', event, ui) === false) { - this._mouseUp({}); - return false; - } - this.position = ui.position; - } - - if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; - if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; - if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); - - return false; - }, - - _mouseStop: function(event) { - - //If we are using droppables, inform the manager about the drop - var dropped = false; - if ($.ui.ddmanager && !this.options.dropBehaviour) - dropped = $.ui.ddmanager.drop(this, event); - - //if a drop comes from outside (a sortable) - if(this.dropped) { - dropped = this.dropped; - this.dropped = false; - } - - //if the original element is no longer in the DOM don't bother to continue (see #8269) - var element = this.element[0], elementInDom = false; - while ( element && (element = element.parentNode) ) { - if (element == document ) { - elementInDom = true; - } - } - if ( !elementInDom && this.options.helper === "original" ) - return false; - - if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { - var that = this; - $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { - if(that._trigger("stop", event) !== false) { - that._clear(); - } - }); - } else { - if(this._trigger("stop", event) !== false) { - this._clear(); - } - } - - return false; - }, - - _mouseUp: function(event) { - //Remove frame helpers - $("div.ui-draggable-iframeFix").each(function() { - this.parentNode.removeChild(this); - }); - - //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) - if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event); - - return $.ui.mouse.prototype._mouseUp.call(this, event); - }, - - cancel: function() { - - if(this.helper.is(".ui-draggable-dragging")) { - this._mouseUp({}); - } else { - this._clear(); - } - - return this; - - }, - - _getHandle: function(event) { - - var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; - $(this.options.handle, this.element) - .find("*") - .andSelf() - .each(function() { - if(this == event.target) handle = true; - }); - - return handle; - - }, - - _createHelper: function(event) { - - var o = this.options; - var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element); - - if(!helper.parents('body').length) - helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); - - if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) - helper.css("position", "absolute"); - - return helper; - - }, - - _adjustOffsetFromHelper: function(obj) { - if (typeof obj == 'string') { - obj = obj.split(' '); - } - if ($.isArray(obj)) { - obj = {left: +obj[0], top: +obj[1] || 0}; - } - if ('left' in obj) { - this.offset.click.left = obj.left + this.margins.left; - } - if ('right' in obj) { - this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; - } - if ('top' in obj) { - this.offset.click.top = obj.top + this.margins.top; - } - if ('bottom' in obj) { - this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; - } - }, - - _getParentOffset: function() { - - //Get the offsetParent and cache its position - this.offsetParent = this.helper.offsetParent(); - var po = this.offsetParent.offset(); - - // This is a special case where we need to modify a offset calculated on start, since the following happened: - // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent - // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that - // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag - if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) { - po.left += this.scrollParent.scrollLeft(); - po.top += this.scrollParent.scrollTop(); - } - - if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information - || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix - po = { top: 0, left: 0 }; - - return { - top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), - left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) - }; - - }, - - _getRelativeOffset: function() { - - if(this.cssPosition == "relative") { - var p = this.element.position(); - return { - top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), - left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() - }; - } else { - return { top: 0, left: 0 }; - } - - }, - - _cacheMargins: function() { - this.margins = { - left: (parseInt(this.element.css("marginLeft"),10) || 0), - top: (parseInt(this.element.css("marginTop"),10) || 0), - right: (parseInt(this.element.css("marginRight"),10) || 0), - bottom: (parseInt(this.element.css("marginBottom"),10) || 0) - }; - }, - - _cacheHelperProportions: function() { - this.helperProportions = { - width: this.helper.outerWidth(), - height: this.helper.outerHeight() - }; - }, - - _setContainment: function() { - - var o = this.options; - if(o.containment == 'parent') o.containment = this.helper[0].parentNode; - if(o.containment == 'document' || o.containment == 'window') this.containment = [ - o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, - o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, - (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, - (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top - ]; - - if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { - var c = $(o.containment); - var ce = c[0]; if(!ce) return; - var co = c.offset(); - var over = ($(ce).css("overflow") != 'hidden'); - - this.containment = [ - (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0), - (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0), - (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, - (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom - ]; - this.relative_container = c; - - } else if(o.containment.constructor == Array) { - this.containment = o.containment; - } - - }, - - _convertPositionTo: function(d, pos) { - - if(!pos) pos = this.position; - var mod = d == "absolute" ? 1 : -1; - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); - - return { - top: ( - pos.top // The absolute mouse position - + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent - + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) - - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) - ), - left: ( - pos.left // The absolute mouse position - + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent - + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) - - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) - ) - }; - - }, - - _generatePosition: function(event) { - - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); - var pageX = event.pageX; - var pageY = event.pageY; - - /* - * - Position constraining - - * Constrain the position to a mix of grid, containment. - */ - - if(this.originalPosition) { //If we are not dragging yet, we won't check for options - var containment; - if(this.containment) { - if (this.relative_container){ - var co = this.relative_container.offset(); - containment = [ this.containment[0] + co.left, - this.containment[1] + co.top, - this.containment[2] + co.left, - this.containment[3] + co.top ]; - } - else { - containment = this.containment; - } - - if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left; - if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top; - if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left; - if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top; - } - - if(o.grid) { - //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950) - var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; - pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; - - var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; - pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; - } - - } - - return { - top: ( - pageY // The absolute mouse position - - this.offset.click.top // Click offset (relative to the element) - - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent - - this.offset.parent.top // The offsetParent's offset without borders (offset + border) - + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) - ), - left: ( - pageX // The absolute mouse position - - this.offset.click.left // Click offset (relative to the element) - - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent - - this.offset.parent.left // The offsetParent's offset without borders (offset + border) - + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) - ) - }; - - }, - - _clear: function() { - this.helper.removeClass("ui-draggable-dragging"); - if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); - //if($.ui.ddmanager) $.ui.ddmanager.current = null; - this.helper = null; - this.cancelHelperRemoval = false; - }, - - // From now on bulk stuff - mainly helpers - - _trigger: function(type, event, ui) { - ui = ui || this._uiHash(); - $.ui.plugin.call(this, type, [event, ui]); - if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins - return $.Widget.prototype._trigger.call(this, type, event, ui); - }, - - plugins: {}, - - _uiHash: function(event) { - return { - helper: this.helper, - position: this.position, - originalPosition: this.originalPosition, - offset: this.positionAbs - }; - } - -}); - -$.ui.plugin.add("draggable", "connectToSortable", { - start: function(event, ui) { - - var inst = $(this).data("draggable"), o = inst.options, - uiSortable = $.extend({}, ui, { item: inst.element }); - inst.sortables = []; - $(o.connectToSortable).each(function() { - var sortable = $.data(this, 'sortable'); - if (sortable && !sortable.options.disabled) { - inst.sortables.push({ - instance: sortable, - shouldRevert: sortable.options.revert - }); - sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page). - sortable._trigger("activate", event, uiSortable); - } - }); - - }, - stop: function(event, ui) { - - //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper - var inst = $(this).data("draggable"), - uiSortable = $.extend({}, ui, { item: inst.element }); - - $.each(inst.sortables, function() { - if(this.instance.isOver) { - - this.instance.isOver = 0; - - inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance - this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) - - //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' - if(this.shouldRevert) this.instance.options.revert = true; - - //Trigger the stop of the sortable - this.instance._mouseStop(event); - - this.instance.options.helper = this.instance.options._helper; - - //If the helper has been the original item, restore properties in the sortable - if(inst.options.helper == 'original') - this.instance.currentItem.css({ top: 'auto', left: 'auto' }); - - } else { - this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance - this.instance._trigger("deactivate", event, uiSortable); - } - - }); - - }, - drag: function(event, ui) { - - var inst = $(this).data("draggable"), that = this; - - var checkPos = function(o) { - var dyClick = this.offset.click.top, dxClick = this.offset.click.left; - var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; - var itemHeight = o.height, itemWidth = o.width; - var itemTop = o.top, itemLeft = o.left; - - return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); - }; - - $.each(inst.sortables, function(i) { - - var innermostIntersecting = false; - var thisSortable = this; - //Copy over some variables to allow calling the sortable's native _intersectsWith - this.instance.positionAbs = inst.positionAbs; - this.instance.helperProportions = inst.helperProportions; - this.instance.offset.click = inst.offset.click; - - if(this.instance._intersectsWith(this.instance.containerCache)) { - innermostIntersecting = true; - $.each(inst.sortables, function () { - this.instance.positionAbs = inst.positionAbs; - this.instance.helperProportions = inst.helperProportions; - this.instance.offset.click = inst.offset.click; - if (this != thisSortable - && this.instance._intersectsWith(this.instance.containerCache) - && $.ui.contains(thisSortable.instance.element[0], this.instance.element[0])) - innermostIntersecting = false; - return innermostIntersecting; - }); - } - - - if(innermostIntersecting) { - //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once - if(!this.instance.isOver) { - - this.instance.isOver = 1; - //Now we fake the start of dragging for the sortable instance, - //by cloning the list group item, appending it to the sortable and using it as inst.currentItem - //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) - this.instance.currentItem = $(that).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); - this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it - this.instance.options.helper = function() { return ui.helper[0]; }; - - event.target = this.instance.currentItem[0]; - this.instance._mouseCapture(event, true); - this.instance._mouseStart(event, true, true); - - //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes - this.instance.offset.click.top = inst.offset.click.top; - this.instance.offset.click.left = inst.offset.click.left; - this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; - this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; - - inst._trigger("toSortable", event); - inst.dropped = this.instance.element; //draggable revert needs that - //hack so receive/update callbacks work (mostly) - inst.currentItem = inst.element; - this.instance.fromOutside = inst; - - } - - //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable - if(this.instance.currentItem) this.instance._mouseDrag(event); - - } else { - - //If it doesn't intersect with the sortable, and it intersected before, - //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval - if(this.instance.isOver) { - - this.instance.isOver = 0; - this.instance.cancelHelperRemoval = true; - - //Prevent reverting on this forced stop - this.instance.options.revert = false; - - // The out event needs to be triggered independently - this.instance._trigger('out', event, this.instance._uiHash(this.instance)); - - this.instance._mouseStop(event, true); - this.instance.options.helper = this.instance.options._helper; - - //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size - this.instance.currentItem.remove(); - if(this.instance.placeholder) this.instance.placeholder.remove(); - - inst._trigger("fromSortable", event); - inst.dropped = false; //draggable revert needs that - } - - }; - - }); - - } -}); - -$.ui.plugin.add("draggable", "cursor", { - start: function(event, ui) { - var t = $('body'), o = $(this).data('draggable').options; - if (t.css("cursor")) o._cursor = t.css("cursor"); - t.css("cursor", o.cursor); - }, - stop: function(event, ui) { - var o = $(this).data('draggable').options; - if (o._cursor) $('body').css("cursor", o._cursor); - } -}); - -$.ui.plugin.add("draggable", "opacity", { - start: function(event, ui) { - var t = $(ui.helper), o = $(this).data('draggable').options; - if(t.css("opacity")) o._opacity = t.css("opacity"); - t.css('opacity', o.opacity); - }, - stop: function(event, ui) { - var o = $(this).data('draggable').options; - if(o._opacity) $(ui.helper).css('opacity', o._opacity); - } -}); - -$.ui.plugin.add("draggable", "scroll", { - start: function(event, ui) { - var i = $(this).data("draggable"); - if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); - }, - drag: function(event, ui) { - - var i = $(this).data("draggable"), o = i.options, scrolled = false; - - if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { - - if(!o.axis || o.axis != 'x') { - if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) - i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; - else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) - i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; - } - - if(!o.axis || o.axis != 'y') { - if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) - i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; - else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) - i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; - } - - } else { - - if(!o.axis || o.axis != 'x') { - if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) - scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); - else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) - scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); - } - - if(!o.axis || o.axis != 'y') { - if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) - scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); - else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) - scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); - } - - } - - if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) - $.ui.ddmanager.prepareOffsets(i, event); - - } -}); - -$.ui.plugin.add("draggable", "snap", { - start: function(event, ui) { - - var i = $(this).data("draggable"), o = i.options; - i.snapElements = []; - - $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { - var $t = $(this); var $o = $t.offset(); - if(this != i.element[0]) i.snapElements.push({ - item: this, - width: $t.outerWidth(), height: $t.outerHeight(), - top: $o.top, left: $o.left - }); - }); - - }, - drag: function(event, ui) { - - var inst = $(this).data("draggable"), o = inst.options; - var d = o.snapTolerance; - - var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, - y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; - - for (var i = inst.snapElements.length - 1; i >= 0; i--){ - - var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, - t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; - - //Yes, I know, this is insane ;) - if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { - if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); - inst.snapElements[i].snapping = false; - continue; - } - - if(o.snapMode != 'inner') { - var ts = Math.abs(t - y2) <= d; - var bs = Math.abs(b - y1) <= d; - var ls = Math.abs(l - x2) <= d; - var rs = Math.abs(r - x1) <= d; - if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; - if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; - if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; - if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; - } - - var first = (ts || bs || ls || rs); - - if(o.snapMode != 'outer') { - var ts = Math.abs(t - y1) <= d; - var bs = Math.abs(b - y2) <= d; - var ls = Math.abs(l - x1) <= d; - var rs = Math.abs(r - x2) <= d; - if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; - if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; - if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; - if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; - } - - if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) - (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); - inst.snapElements[i].snapping = (ts || bs || ls || rs || first); - - }; - - } -}); - -$.ui.plugin.add("draggable", "stack", { - start: function(event, ui) { - - var o = $(this).data("draggable").options; - - var group = $.makeArray($(o.stack)).sort(function(a,b) { - return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); - }); - if (!group.length) { return; } - - var min = parseInt(group[0].style.zIndex) || 0; - $(group).each(function(i) { - this.style.zIndex = min + i; - }); - - this[0].style.zIndex = min + group.length; - - } -}); - -$.ui.plugin.add("draggable", "zIndex", { - start: function(event, ui) { - var t = $(ui.helper), o = $(this).data("draggable").options; - if(t.css("zIndex")) o._zIndex = t.css("zIndex"); - t.css('zIndex', o.zIndex); - }, - stop: function(event, ui) { - var o = $(this).data("draggable").options; - if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); - } -}); - -})(jQuery); -(function( $, undefined ) { - -$.widget("ui.droppable", { - version: "1.9.2", - widgetEventPrefix: "drop", - options: { - accept: '*', - activeClass: false, - addClasses: true, - greedy: false, - hoverClass: false, - scope: 'default', - tolerance: 'intersect' - }, - _create: function() { - - var o = this.options, accept = o.accept; - this.isover = 0; this.isout = 1; - - this.accept = $.isFunction(accept) ? accept : function(d) { - return d.is(accept); - }; - - //Store the droppable's proportions - this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; - - // Add the reference and positions to the manager - $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; - $.ui.ddmanager.droppables[o.scope].push(this); - - (o.addClasses && this.element.addClass("ui-droppable")); - - }, - - _destroy: function() { - var drop = $.ui.ddmanager.droppables[this.options.scope]; - for ( var i = 0; i < drop.length; i++ ) - if ( drop[i] == this ) - drop.splice(i, 1); - - this.element.removeClass("ui-droppable ui-droppable-disabled"); - }, - - _setOption: function(key, value) { - - if(key == 'accept') { - this.accept = $.isFunction(value) ? value : function(d) { - return d.is(value); - }; - } - $.Widget.prototype._setOption.apply(this, arguments); - }, - - _activate: function(event) { - var draggable = $.ui.ddmanager.current; - if(this.options.activeClass) this.element.addClass(this.options.activeClass); - (draggable && this._trigger('activate', event, this.ui(draggable))); - }, - - _deactivate: function(event) { - var draggable = $.ui.ddmanager.current; - if(this.options.activeClass) this.element.removeClass(this.options.activeClass); - (draggable && this._trigger('deactivate', event, this.ui(draggable))); - }, - - _over: function(event) { - - var draggable = $.ui.ddmanager.current; - if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element - - if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { - if(this.options.hoverClass) this.element.addClass(this.options.hoverClass); - this._trigger('over', event, this.ui(draggable)); - } - - }, - - _out: function(event) { - - var draggable = $.ui.ddmanager.current; - if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element - - if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { - if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); - this._trigger('out', event, this.ui(draggable)); - } - - }, - - _drop: function(event,custom) { - - var draggable = custom || $.ui.ddmanager.current; - if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element - - var childrenIntersection = false; - this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() { - var inst = $.data(this, 'droppable'); - if( - inst.options.greedy - && !inst.options.disabled - && inst.options.scope == draggable.options.scope - && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) - && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance) - ) { childrenIntersection = true; return false; } - }); - if(childrenIntersection) return false; - - if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { - if(this.options.activeClass) this.element.removeClass(this.options.activeClass); - if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); - this._trigger('drop', event, this.ui(draggable)); - return this.element; - } - - return false; - - }, - - ui: function(c) { - return { - draggable: (c.currentItem || c.element), - helper: c.helper, - position: c.position, - offset: c.positionAbs - }; - } - -}); - -$.ui.intersect = function(draggable, droppable, toleranceMode) { - - if (!droppable.offset) return false; - - var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, - y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height; - var l = droppable.offset.left, r = l + droppable.proportions.width, - t = droppable.offset.top, b = t + droppable.proportions.height; - - switch (toleranceMode) { - case 'fit': - return (l <= x1 && x2 <= r - && t <= y1 && y2 <= b); - break; - case 'intersect': - return (l < x1 + (draggable.helperProportions.width / 2) // Right Half - && x2 - (draggable.helperProportions.width / 2) < r // Left Half - && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half - && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half - break; - case 'pointer': - var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left), - draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top), - isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width); - return isOver; - break; - case 'touch': - return ( - (y1 >= t && y1 <= b) || // Top edge touching - (y2 >= t && y2 <= b) || // Bottom edge touching - (y1 < t && y2 > b) // Surrounded vertically - ) && ( - (x1 >= l && x1 <= r) || // Left edge touching - (x2 >= l && x2 <= r) || // Right edge touching - (x1 < l && x2 > r) // Surrounded horizontally - ); - break; - default: - return false; - break; - } - -}; - -/* - This manager tracks offsets of draggables and droppables -*/ -$.ui.ddmanager = { - current: null, - droppables: { 'default': [] }, - prepareOffsets: function(t, event) { - - var m = $.ui.ddmanager.droppables[t.options.scope] || []; - var type = event ? event.type : null; // workaround for #2317 - var list = (t.currentItem || t.element).find(":data(droppable)").andSelf(); - - droppablesLoop: for (var i = 0; i < m.length; i++) { - - if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted - for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item - m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue - - if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables - - m[i].offset = m[i].element.offset(); - m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight }; - - } - - }, - drop: function(draggable, event) { - - var dropped = false; - $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { - - if(!this.options) return; - if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) - dropped = this._drop.call(this, event) || dropped; - - if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { - this.isout = 1; this.isover = 0; - this._deactivate.call(this, event); - } - - }); - return dropped; - - }, - dragStart: function( draggable, event ) { - //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) - draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() { - if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); - }); - }, - drag: function(draggable, event) { - - //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. - if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event); - - //Run through all droppables and check their positions based on specific tolerance options - $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { - - if(this.options.disabled || this.greedyChild || !this.visible) return; - var intersects = $.ui.intersect(draggable, this, this.options.tolerance); - - var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null); - if(!c) return; - - var parentInstance; - if (this.options.greedy) { - // find droppable parents with same scope - var scope = this.options.scope; - var parent = this.element.parents(':data(droppable)').filter(function () { - return $.data(this, 'droppable').options.scope === scope; - }); - - if (parent.length) { - parentInstance = $.data(parent[0], 'droppable'); - parentInstance.greedyChild = (c == 'isover' ? 1 : 0); - } - } - - // we just moved into a greedy child - if (parentInstance && c == 'isover') { - parentInstance['isover'] = 0; - parentInstance['isout'] = 1; - parentInstance._out.call(parentInstance, event); - } - - this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0; - this[c == "isover" ? "_over" : "_out"].call(this, event); - - // we just moved out of a greedy child - if (parentInstance && c == 'isout') { - parentInstance['isout'] = 0; - parentInstance['isover'] = 1; - parentInstance._over.call(parentInstance, event); - } - }); - - }, - dragStop: function( draggable, event ) { - draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" ); - //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) - if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); - } -}; - -})(jQuery); -;(jQuery.effects || (function($, undefined) { - -var backCompat = $.uiBackCompat !== false, - // prefix used for storing data on .data() - dataSpace = "ui-effects-"; - -$.effects = { - effect: {} -}; - -/*! - * jQuery Color Animations v2.0.0 - * http://jquery.com/ - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * Date: Mon Aug 13 13:41:02 2012 -0500 - */ -(function( jQuery, undefined ) { - - var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "), - - // plusequals test for += 100 -= 100 - rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, - // a set of RE's that can match strings and generate color tuples. - stringParsers = [{ - re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, - parse: function( execResult ) { - return [ - execResult[ 1 ], - execResult[ 2 ], - execResult[ 3 ], - execResult[ 4 ] - ]; - } - }, { - re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, - parse: function( execResult ) { - return [ - execResult[ 1 ] * 2.55, - execResult[ 2 ] * 2.55, - execResult[ 3 ] * 2.55, - execResult[ 4 ] - ]; - } - }, { - // this regex ignores A-F because it's compared against an already lowercased string - re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, - parse: function( execResult ) { - return [ - parseInt( execResult[ 1 ], 16 ), - parseInt( execResult[ 2 ], 16 ), - parseInt( execResult[ 3 ], 16 ) - ]; - } - }, { - // this regex ignores A-F because it's compared against an already lowercased string - re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, - parse: function( execResult ) { - return [ - parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), - parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), - parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) - ]; - } - }, { - re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, - space: "hsla", - parse: function( execResult ) { - return [ - execResult[ 1 ], - execResult[ 2 ] / 100, - execResult[ 3 ] / 100, - execResult[ 4 ] - ]; - } - }], - - // jQuery.Color( ) - color = jQuery.Color = function( color, green, blue, alpha ) { - return new jQuery.Color.fn.parse( color, green, blue, alpha ); - }, - spaces = { - rgba: { - props: { - red: { - idx: 0, - type: "byte" - }, - green: { - idx: 1, - type: "byte" - }, - blue: { - idx: 2, - type: "byte" - } - } - }, - - hsla: { - props: { - hue: { - idx: 0, - type: "degrees" - }, - saturation: { - idx: 1, - type: "percent" - }, - lightness: { - idx: 2, - type: "percent" - } - } - } - }, - propTypes = { - "byte": { - floor: true, - max: 255 - }, - "percent": { - max: 1 - }, - "degrees": { - mod: 360, - floor: true - } - }, - support = color.support = {}, - - // element for support tests - supportElem = jQuery( "

    " )[ 0 ], - - // colors = jQuery.Color.names - colors, - - // local aliases of functions called often - each = jQuery.each; - -// determine rgba support immediately -supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; -support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; - -// define cache name and alpha properties -// for rgba and hsla spaces -each( spaces, function( spaceName, space ) { - space.cache = "_" + spaceName; - space.props.alpha = { - idx: 3, - type: "percent", - def: 1 - }; -}); - -function clamp( value, prop, allowEmpty ) { - var type = propTypes[ prop.type ] || {}; - - if ( value == null ) { - return (allowEmpty || !prop.def) ? null : prop.def; - } - - // ~~ is an short way of doing floor for positive numbers - value = type.floor ? ~~value : parseFloat( value ); - - // IE will pass in empty strings as value for alpha, - // which will hit this case - if ( isNaN( value ) ) { - return prop.def; - } - - if ( type.mod ) { - // we add mod before modding to make sure that negatives values - // get converted properly: -10 -> 350 - return (value + type.mod) % type.mod; - } - - // for now all property types without mod have min and max - return 0 > value ? 0 : type.max < value ? type.max : value; -} - -function stringParse( string ) { - var inst = color(), - rgba = inst._rgba = []; - - string = string.toLowerCase(); - - each( stringParsers, function( i, parser ) { - var parsed, - match = parser.re.exec( string ), - values = match && parser.parse( match ), - spaceName = parser.space || "rgba"; - - if ( values ) { - parsed = inst[ spaceName ]( values ); - - // if this was an rgba parse the assignment might happen twice - // oh well.... - inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; - rgba = inst._rgba = parsed._rgba; - - // exit each( stringParsers ) here because we matched - return false; - } - }); - - // Found a stringParser that handled it - if ( rgba.length ) { - - // if this came from a parsed string, force "transparent" when alpha is 0 - // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) - if ( rgba.join() === "0,0,0,0" ) { - jQuery.extend( rgba, colors.transparent ); - } - return inst; - } - - // named colors - return colors[ string ]; -} - -color.fn = jQuery.extend( color.prototype, { - parse: function( red, green, blue, alpha ) { - if ( red === undefined ) { - this._rgba = [ null, null, null, null ]; - return this; - } - if ( red.jquery || red.nodeType ) { - red = jQuery( red ).css( green ); - green = undefined; - } - - var inst = this, - type = jQuery.type( red ), - rgba = this._rgba = []; - - // more than 1 argument specified - assume ( red, green, blue, alpha ) - if ( green !== undefined ) { - red = [ red, green, blue, alpha ]; - type = "array"; - } - - if ( type === "string" ) { - return this.parse( stringParse( red ) || colors._default ); - } - - if ( type === "array" ) { - each( spaces.rgba.props, function( key, prop ) { - rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); - }); - return this; - } - - if ( type === "object" ) { - if ( red instanceof color ) { - each( spaces, function( spaceName, space ) { - if ( red[ space.cache ] ) { - inst[ space.cache ] = red[ space.cache ].slice(); - } - }); - } else { - each( spaces, function( spaceName, space ) { - var cache = space.cache; - each( space.props, function( key, prop ) { - - // if the cache doesn't exist, and we know how to convert - if ( !inst[ cache ] && space.to ) { - - // if the value was null, we don't need to copy it - // if the key was alpha, we don't need to copy it either - if ( key === "alpha" || red[ key ] == null ) { - return; - } - inst[ cache ] = space.to( inst._rgba ); - } - - // this is the only case where we allow nulls for ALL properties. - // call clamp with alwaysAllowEmpty - inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); - }); - - // everything defined but alpha? - if ( inst[ cache ] && $.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { - // use the default of 1 - inst[ cache ][ 3 ] = 1; - if ( space.from ) { - inst._rgba = space.from( inst[ cache ] ); - } - } - }); - } - return this; - } - }, - is: function( compare ) { - var is = color( compare ), - same = true, - inst = this; - - each( spaces, function( _, space ) { - var localCache, - isCache = is[ space.cache ]; - if (isCache) { - localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; - each( space.props, function( _, prop ) { - if ( isCache[ prop.idx ] != null ) { - same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); - return same; - } - }); - } - return same; - }); - return same; - }, - _space: function() { - var used = [], - inst = this; - each( spaces, function( spaceName, space ) { - if ( inst[ space.cache ] ) { - used.push( spaceName ); - } - }); - return used.pop(); - }, - transition: function( other, distance ) { - var end = color( other ), - spaceName = end._space(), - space = spaces[ spaceName ], - startColor = this.alpha() === 0 ? color( "transparent" ) : this, - start = startColor[ space.cache ] || space.to( startColor._rgba ), - result = start.slice(); - - end = end[ space.cache ]; - each( space.props, function( key, prop ) { - var index = prop.idx, - startValue = start[ index ], - endValue = end[ index ], - type = propTypes[ prop.type ] || {}; - - // if null, don't override start value - if ( endValue === null ) { - return; - } - // if null - use end - if ( startValue === null ) { - result[ index ] = endValue; - } else { - if ( type.mod ) { - if ( endValue - startValue > type.mod / 2 ) { - startValue += type.mod; - } else if ( startValue - endValue > type.mod / 2 ) { - startValue -= type.mod; - } - } - result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); - } - }); - return this[ spaceName ]( result ); - }, - blend: function( opaque ) { - // if we are already opaque - return ourself - if ( this._rgba[ 3 ] === 1 ) { - return this; - } - - var rgb = this._rgba.slice(), - a = rgb.pop(), - blend = color( opaque )._rgba; - - return color( jQuery.map( rgb, function( v, i ) { - return ( 1 - a ) * blend[ i ] + a * v; - })); - }, - toRgbaString: function() { - var prefix = "rgba(", - rgba = jQuery.map( this._rgba, function( v, i ) { - return v == null ? ( i > 2 ? 1 : 0 ) : v; - }); - - if ( rgba[ 3 ] === 1 ) { - rgba.pop(); - prefix = "rgb("; - } - - return prefix + rgba.join() + ")"; - }, - toHslaString: function() { - var prefix = "hsla(", - hsla = jQuery.map( this.hsla(), function( v, i ) { - if ( v == null ) { - v = i > 2 ? 1 : 0; - } - - // catch 1 and 2 - if ( i && i < 3 ) { - v = Math.round( v * 100 ) + "%"; - } - return v; - }); - - if ( hsla[ 3 ] === 1 ) { - hsla.pop(); - prefix = "hsl("; - } - return prefix + hsla.join() + ")"; - }, - toHexString: function( includeAlpha ) { - var rgba = this._rgba.slice(), - alpha = rgba.pop(); - - if ( includeAlpha ) { - rgba.push( ~~( alpha * 255 ) ); - } - - return "#" + jQuery.map( rgba, function( v ) { - - // default to 0 when nulls exist - v = ( v || 0 ).toString( 16 ); - return v.length === 1 ? "0" + v : v; - }).join(""); - }, - toString: function() { - return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); - } -}); -color.fn.parse.prototype = color.fn; - -// hsla conversions adapted from: -// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 - -function hue2rgb( p, q, h ) { - h = ( h + 1 ) % 1; - if ( h * 6 < 1 ) { - return p + (q - p) * h * 6; - } - if ( h * 2 < 1) { - return q; - } - if ( h * 3 < 2 ) { - return p + (q - p) * ((2/3) - h) * 6; - } - return p; -} - -spaces.hsla.to = function ( rgba ) { - if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { - return [ null, null, null, rgba[ 3 ] ]; - } - var r = rgba[ 0 ] / 255, - g = rgba[ 1 ] / 255, - b = rgba[ 2 ] / 255, - a = rgba[ 3 ], - max = Math.max( r, g, b ), - min = Math.min( r, g, b ), - diff = max - min, - add = max + min, - l = add * 0.5, - h, s; - - if ( min === max ) { - h = 0; - } else if ( r === max ) { - h = ( 60 * ( g - b ) / diff ) + 360; - } else if ( g === max ) { - h = ( 60 * ( b - r ) / diff ) + 120; - } else { - h = ( 60 * ( r - g ) / diff ) + 240; - } - - if ( l === 0 || l === 1 ) { - s = l; - } else if ( l <= 0.5 ) { - s = diff / add; - } else { - s = diff / ( 2 - add ); - } - return [ Math.round(h) % 360, s, l, a == null ? 1 : a ]; -}; - -spaces.hsla.from = function ( hsla ) { - if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { - return [ null, null, null, hsla[ 3 ] ]; - } - var h = hsla[ 0 ] / 360, - s = hsla[ 1 ], - l = hsla[ 2 ], - a = hsla[ 3 ], - q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, - p = 2 * l - q; - - return [ - Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), - Math.round( hue2rgb( p, q, h ) * 255 ), - Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), - a - ]; -}; - - -each( spaces, function( spaceName, space ) { - var props = space.props, - cache = space.cache, - to = space.to, - from = space.from; - - // makes rgba() and hsla() - color.fn[ spaceName ] = function( value ) { - - // generate a cache for this space if it doesn't exist - if ( to && !this[ cache ] ) { - this[ cache ] = to( this._rgba ); - } - if ( value === undefined ) { - return this[ cache ].slice(); - } - - var ret, - type = jQuery.type( value ), - arr = ( type === "array" || type === "object" ) ? value : arguments, - local = this[ cache ].slice(); - - each( props, function( key, prop ) { - var val = arr[ type === "object" ? key : prop.idx ]; - if ( val == null ) { - val = local[ prop.idx ]; - } - local[ prop.idx ] = clamp( val, prop ); - }); - - if ( from ) { - ret = color( from( local ) ); - ret[ cache ] = local; - return ret; - } else { - return color( local ); - } - }; - - // makes red() green() blue() alpha() hue() saturation() lightness() - each( props, function( key, prop ) { - // alpha is included in more than one space - if ( color.fn[ key ] ) { - return; - } - color.fn[ key ] = function( value ) { - var vtype = jQuery.type( value ), - fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ), - local = this[ fn ](), - cur = local[ prop.idx ], - match; - - if ( vtype === "undefined" ) { - return cur; - } - - if ( vtype === "function" ) { - value = value.call( this, cur ); - vtype = jQuery.type( value ); - } - if ( value == null && prop.empty ) { - return this; - } - if ( vtype === "string" ) { - match = rplusequals.exec( value ); - if ( match ) { - value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); - } - } - local[ prop.idx ] = value; - return this[ fn ]( local ); - }; - }); -}); - -// add .fx.step functions -each( stepHooks, function( i, hook ) { - jQuery.cssHooks[ hook ] = { - set: function( elem, value ) { - var parsed, curElem, - backgroundColor = ""; - - if ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) { - value = color( parsed || value ); - if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { - curElem = hook === "backgroundColor" ? elem.parentNode : elem; - while ( - (backgroundColor === "" || backgroundColor === "transparent") && - curElem && curElem.style - ) { - try { - backgroundColor = jQuery.css( curElem, "backgroundColor" ); - curElem = curElem.parentNode; - } catch ( e ) { - } - } - - value = value.blend( backgroundColor && backgroundColor !== "transparent" ? - backgroundColor : - "_default" ); - } - - value = value.toRgbaString(); - } - try { - elem.style[ hook ] = value; - } catch( error ) { - // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' - } - } - }; - jQuery.fx.step[ hook ] = function( fx ) { - if ( !fx.colorInit ) { - fx.start = color( fx.elem, hook ); - fx.end = color( fx.end ); - fx.colorInit = true; - } - jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); - }; -}); - -jQuery.cssHooks.borderColor = { - expand: function( value ) { - var expanded = {}; - - each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) { - expanded[ "border" + part + "Color" ] = value; - }); - return expanded; - } -}; - -// Basic color names only. -// Usage of any of the other color names requires adding yourself or including -// jquery.color.svg-names.js. -colors = jQuery.Color.names = { - // 4.1. Basic color keywords - aqua: "#00ffff", - black: "#000000", - blue: "#0000ff", - fuchsia: "#ff00ff", - gray: "#808080", - green: "#008000", - lime: "#00ff00", - maroon: "#800000", - navy: "#000080", - olive: "#808000", - purple: "#800080", - red: "#ff0000", - silver: "#c0c0c0", - teal: "#008080", - white: "#ffffff", - yellow: "#ffff00", - - // 4.2.3. "transparent" color keyword - transparent: [ null, null, null, 0 ], - - _default: "#ffffff" -}; - -})( jQuery ); - - - -/******************************************************************************/ -/****************************** CLASS ANIMATIONS ******************************/ -/******************************************************************************/ -(function() { - -var classAnimationActions = [ "add", "remove", "toggle" ], - shorthandStyles = { - border: 1, - borderBottom: 1, - borderColor: 1, - borderLeft: 1, - borderRight: 1, - borderTop: 1, - borderWidth: 1, - margin: 1, - padding: 1 - }; - -$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) { - $.fx.step[ prop ] = function( fx ) { - if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { - jQuery.style( fx.elem, prop, fx.end ); - fx.setAttr = true; - } - }; -}); - -function getElementStyles() { - var style = this.ownerDocument.defaultView ? - this.ownerDocument.defaultView.getComputedStyle( this, null ) : - this.currentStyle, - newStyle = {}, - key, - len; - - // webkit enumerates style porperties - if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { - len = style.length; - while ( len-- ) { - key = style[ len ]; - if ( typeof style[ key ] === "string" ) { - newStyle[ $.camelCase( key ) ] = style[ key ]; - } - } - } else { - for ( key in style ) { - if ( typeof style[ key ] === "string" ) { - newStyle[ key ] = style[ key ]; - } - } - } - - return newStyle; -} - - -function styleDifference( oldStyle, newStyle ) { - var diff = {}, - name, value; - - for ( name in newStyle ) { - value = newStyle[ name ]; - if ( oldStyle[ name ] !== value ) { - if ( !shorthandStyles[ name ] ) { - if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) { - diff[ name ] = value; - } - } - } - } - - return diff; -} - -$.effects.animateClass = function( value, duration, easing, callback ) { - var o = $.speed( duration, easing, callback ); - - return this.queue( function() { - var animated = $( this ), - baseClass = animated.attr( "class" ) || "", - applyClassChange, - allAnimations = o.children ? animated.find( "*" ).andSelf() : animated; - - // map the animated objects to store the original styles. - allAnimations = allAnimations.map(function() { - var el = $( this ); - return { - el: el, - start: getElementStyles.call( this ) - }; - }); - - // apply class change - applyClassChange = function() { - $.each( classAnimationActions, function(i, action) { - if ( value[ action ] ) { - animated[ action + "Class" ]( value[ action ] ); - } - }); - }; - applyClassChange(); - - // map all animated objects again - calculate new styles and diff - allAnimations = allAnimations.map(function() { - this.end = getElementStyles.call( this.el[ 0 ] ); - this.diff = styleDifference( this.start, this.end ); - return this; - }); - - // apply original class - animated.attr( "class", baseClass ); - - // map all animated objects again - this time collecting a promise - allAnimations = allAnimations.map(function() { - var styleInfo = this, - dfd = $.Deferred(), - opts = jQuery.extend({}, o, { - queue: false, - complete: function() { - dfd.resolve( styleInfo ); - } - }); - - this.el.animate( this.diff, opts ); - return dfd.promise(); - }); - - // once all animations have completed: - $.when.apply( $, allAnimations.get() ).done(function() { - - // set the final class - applyClassChange(); - - // for each animated element, - // clear all css properties that were animated - $.each( arguments, function() { - var el = this.el; - $.each( this.diff, function(key) { - el.css( key, '' ); - }); - }); - - // this is guarnteed to be there if you use jQuery.speed() - // it also handles dequeuing the next anim... - o.complete.call( animated[ 0 ] ); - }); - }); -}; - -$.fn.extend({ - _addClass: $.fn.addClass, - addClass: function( classNames, speed, easing, callback ) { - return speed ? - $.effects.animateClass.call( this, - { add: classNames }, speed, easing, callback ) : - this._addClass( classNames ); - }, - - _removeClass: $.fn.removeClass, - removeClass: function( classNames, speed, easing, callback ) { - return speed ? - $.effects.animateClass.call( this, - { remove: classNames }, speed, easing, callback ) : - this._removeClass( classNames ); - }, - - _toggleClass: $.fn.toggleClass, - toggleClass: function( classNames, force, speed, easing, callback ) { - if ( typeof force === "boolean" || force === undefined ) { - if ( !speed ) { - // without speed parameter - return this._toggleClass( classNames, force ); - } else { - return $.effects.animateClass.call( this, - (force ? { add: classNames } : { remove: classNames }), - speed, easing, callback ); - } - } else { - // without force parameter - return $.effects.animateClass.call( this, - { toggle: classNames }, force, speed, easing ); - } - }, - - switchClass: function( remove, add, speed, easing, callback) { - return $.effects.animateClass.call( this, { - add: add, - remove: remove - }, speed, easing, callback ); - } -}); - -})(); - -/******************************************************************************/ -/*********************************** EFFECTS **********************************/ -/******************************************************************************/ - -(function() { - -$.extend( $.effects, { - version: "1.9.2", - - // Saves a set of properties in a data storage - save: function( element, set ) { - for( var i=0; i < set.length; i++ ) { - if ( set[ i ] !== null ) { - element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); - } - } - }, - - // Restores a set of previously saved properties from a data storage - restore: function( element, set ) { - var val, i; - for( i=0; i < set.length; i++ ) { - if ( set[ i ] !== null ) { - val = element.data( dataSpace + set[ i ] ); - // support: jQuery 1.6.2 - // http://bugs.jquery.com/ticket/9917 - // jQuery 1.6.2 incorrectly returns undefined for any falsy value. - // We can't differentiate between "" and 0 here, so we just assume - // empty string since it's likely to be a more common value... - if ( val === undefined ) { - val = ""; - } - element.css( set[ i ], val ); - } - } - }, - - setMode: function( el, mode ) { - if (mode === "toggle") { - mode = el.is( ":hidden" ) ? "show" : "hide"; - } - return mode; - }, - - // Translates a [top,left] array into a baseline value - // this should be a little more flexible in the future to handle a string & hash - getBaseline: function( origin, original ) { - var y, x; - switch ( origin[ 0 ] ) { - case "top": y = 0; break; - case "middle": y = 0.5; break; - case "bottom": y = 1; break; - default: y = origin[ 0 ] / original.height; - } - switch ( origin[ 1 ] ) { - case "left": x = 0; break; - case "center": x = 0.5; break; - case "right": x = 1; break; - default: x = origin[ 1 ] / original.width; - } - return { - x: x, - y: y - }; - }, - - // Wraps the element around a wrapper that copies position properties - createWrapper: function( element ) { - - // if the element is already wrapped, return it - if ( element.parent().is( ".ui-effects-wrapper" )) { - return element.parent(); - } - - // wrap the element - var props = { - width: element.outerWidth(true), - height: element.outerHeight(true), - "float": element.css( "float" ) - }, - wrapper = $( "

    " ) - .addClass( "ui-effects-wrapper" ) - .css({ - fontSize: "100%", - background: "transparent", - border: "none", - margin: 0, - padding: 0 - }), - // Store the size in case width/height are defined in % - Fixes #5245 - size = { - width: element.width(), - height: element.height() - }, - active = document.activeElement; - - // support: Firefox - // Firefox incorrectly exposes anonymous content - // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 - try { - active.id; - } catch( e ) { - active = document.body; - } - - element.wrap( wrapper ); - - // Fixes #7595 - Elements lose focus when wrapped. - if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { - $( active ).focus(); - } - - wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element - - // transfer positioning properties to the wrapper - if ( element.css( "position" ) === "static" ) { - wrapper.css({ position: "relative" }); - element.css({ position: "relative" }); - } else { - $.extend( props, { - position: element.css( "position" ), - zIndex: element.css( "z-index" ) - }); - $.each([ "top", "left", "bottom", "right" ], function(i, pos) { - props[ pos ] = element.css( pos ); - if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { - props[ pos ] = "auto"; - } - }); - element.css({ - position: "relative", - top: 0, - left: 0, - right: "auto", - bottom: "auto" - }); - } - element.css(size); - - return wrapper.css( props ).show(); - }, - - removeWrapper: function( element ) { - var active = document.activeElement; - - if ( element.parent().is( ".ui-effects-wrapper" ) ) { - element.parent().replaceWith( element ); - - // Fixes #7595 - Elements lose focus when wrapped. - if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { - $( active ).focus(); - } - } - - - return element; - }, - - setTransition: function( element, list, factor, value ) { - value = value || {}; - $.each( list, function( i, x ) { - var unit = element.cssUnit( x ); - if ( unit[ 0 ] > 0 ) { - value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; - } - }); - return value; - } -}); - -// return an effect options object for the given parameters: -function _normalizeArguments( effect, options, speed, callback ) { - - // allow passing all options as the first parameter - if ( $.isPlainObject( effect ) ) { - options = effect; - effect = effect.effect; - } - - // convert to an object - effect = { effect: effect }; - - // catch (effect, null, ...) - if ( options == null ) { - options = {}; - } - - // catch (effect, callback) - if ( $.isFunction( options ) ) { - callback = options; - speed = null; - options = {}; - } - - // catch (effect, speed, ?) - if ( typeof options === "number" || $.fx.speeds[ options ] ) { - callback = speed; - speed = options; - options = {}; - } - - // catch (effect, options, callback) - if ( $.isFunction( speed ) ) { - callback = speed; - speed = null; - } - - // add options to effect - if ( options ) { - $.extend( effect, options ); - } - - speed = speed || options.duration; - effect.duration = $.fx.off ? 0 : - typeof speed === "number" ? speed : - speed in $.fx.speeds ? $.fx.speeds[ speed ] : - $.fx.speeds._default; - - effect.complete = callback || options.complete; - - return effect; -} - -function standardSpeed( speed ) { - // valid standard speeds - if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { - return true; - } - - // invalid strings - treat as "normal" speed - if ( typeof speed === "string" && !$.effects.effect[ speed ] ) { - // TODO: remove in 2.0 (#7115) - if ( backCompat && $.effects[ speed ] ) { - return false; - } - return true; - } - - return false; -} - -$.fn.extend({ - effect: function( /* effect, options, speed, callback */ ) { - var args = _normalizeArguments.apply( this, arguments ), - mode = args.mode, - queue = args.queue, - effectMethod = $.effects.effect[ args.effect ], - - // DEPRECATED: remove in 2.0 (#7115) - oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ]; - - if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) { - // delegate to the original method (e.g., .show()) if possible - if ( mode ) { - return this[ mode ]( args.duration, args.complete ); - } else { - return this.each( function() { - if ( args.complete ) { - args.complete.call( this ); - } - }); - } - } - - function run( next ) { - var elem = $( this ), - complete = args.complete, - mode = args.mode; - - function done() { - if ( $.isFunction( complete ) ) { - complete.call( elem[0] ); - } - if ( $.isFunction( next ) ) { - next(); - } - } - - // if the element is hiddden and mode is hide, - // or element is visible and mode is show - if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { - done(); - } else { - effectMethod.call( elem[0], args, done ); - } - } - - // TODO: remove this check in 2.0, effectMethod will always be true - if ( effectMethod ) { - return queue === false ? this.each( run ) : this.queue( queue || "fx", run ); - } else { - // DEPRECATED: remove in 2.0 (#7115) - return oldEffectMethod.call(this, { - options: args, - duration: args.duration, - callback: args.complete, - mode: args.mode - }); - } - }, - - _show: $.fn.show, - show: function( speed ) { - if ( standardSpeed( speed ) ) { - return this._show.apply( this, arguments ); - } else { - var args = _normalizeArguments.apply( this, arguments ); - args.mode = "show"; - return this.effect.call( this, args ); - } - }, - - _hide: $.fn.hide, - hide: function( speed ) { - if ( standardSpeed( speed ) ) { - return this._hide.apply( this, arguments ); - } else { - var args = _normalizeArguments.apply( this, arguments ); - args.mode = "hide"; - return this.effect.call( this, args ); - } - }, - - // jQuery core overloads toggle and creates _toggle - __toggle: $.fn.toggle, - toggle: function( speed ) { - if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) { - return this.__toggle.apply( this, arguments ); - } else { - var args = _normalizeArguments.apply( this, arguments ); - args.mode = "toggle"; - return this.effect.call( this, args ); - } - }, - - // helper functions - cssUnit: function(key) { - var style = this.css( key ), - val = []; - - $.each( [ "em", "px", "%", "pt" ], function( i, unit ) { - if ( style.indexOf( unit ) > 0 ) { - val = [ parseFloat( style ), unit ]; - } - }); - return val; - } -}); - -})(); - -/******************************************************************************/ -/*********************************** EASING ***********************************/ -/******************************************************************************/ - -(function() { - -// based on easing equations from Robert Penner (http://www.robertpenner.com/easing) - -var baseEasings = {}; - -$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { - baseEasings[ name ] = function( p ) { - return Math.pow( p, i + 2 ); - }; -}); - -$.extend( baseEasings, { - Sine: function ( p ) { - return 1 - Math.cos( p * Math.PI / 2 ); - }, - Circ: function ( p ) { - return 1 - Math.sqrt( 1 - p * p ); - }, - Elastic: function( p ) { - return p === 0 || p === 1 ? p : - -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 ); - }, - Back: function( p ) { - return p * p * ( 3 * p - 2 ); - }, - Bounce: function ( p ) { - var pow2, - bounce = 4; - - while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} - return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); - } -}); - -$.each( baseEasings, function( name, easeIn ) { - $.easing[ "easeIn" + name ] = easeIn; - $.easing[ "easeOut" + name ] = function( p ) { - return 1 - easeIn( 1 - p ); - }; - $.easing[ "easeInOut" + name ] = function( p ) { - return p < 0.5 ? - easeIn( p * 2 ) / 2 : - 1 - easeIn( p * -2 + 2 ) / 2; - }; -}); - -})(); - -})(jQuery)); -(function( $, undefined ) { - -var rvertical = /up|down|vertical/, - rpositivemotion = /up|left|vertical|horizontal/; - -$.effects.effect.blind = function( o, done ) { - // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "hide" ), - direction = o.direction || "up", - vertical = rvertical.test( direction ), - ref = vertical ? "height" : "width", - ref2 = vertical ? "top" : "left", - motion = rpositivemotion.test( direction ), - animation = {}, - show = mode === "show", - wrapper, distance, margin; - - // if already wrapped, the wrapper's properties are my property. #6245 - if ( el.parent().is( ".ui-effects-wrapper" ) ) { - $.effects.save( el.parent(), props ); - } else { - $.effects.save( el, props ); - } - el.show(); - wrapper = $.effects.createWrapper( el ).css({ - overflow: "hidden" - }); - - distance = wrapper[ ref ](); - margin = parseFloat( wrapper.css( ref2 ) ) || 0; - - animation[ ref ] = show ? distance : 0; - if ( !motion ) { - el - .css( vertical ? "bottom" : "right", 0 ) - .css( vertical ? "top" : "left", "auto" ) - .css({ position: "absolute" }); - - animation[ ref2 ] = show ? margin : distance + margin; - } - - // start at 0 if we are showing - if ( show ) { - wrapper.css( ref, 0 ); - if ( ! motion ) { - wrapper.css( ref2, margin + distance ); - } - } - - // Animate - wrapper.animate( animation, { - duration: o.duration, - easing: o.easing, - queue: false, - complete: function() { - if ( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - } - }); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.bounce = function( o, done ) { - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - - // defaults: - mode = $.effects.setMode( el, o.mode || "effect" ), - hide = mode === "hide", - show = mode === "show", - direction = o.direction || "up", - distance = o.distance, - times = o.times || 5, - - // number of internal animations - anims = times * 2 + ( show || hide ? 1 : 0 ), - speed = o.duration / anims, - easing = o.easing, - - // utility: - ref = ( direction === "up" || direction === "down" ) ? "top" : "left", - motion = ( direction === "up" || direction === "left" ), - i, - upAnim, - downAnim, - - // we will need to re-assemble the queue to stack our animations in place - queue = el.queue(), - queuelen = queue.length; - - // Avoid touching opacity to prevent clearType and PNG issues in IE - if ( show || hide ) { - props.push( "opacity" ); - } - - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); // Create Wrapper - - // default distance for the BIGGEST bounce is the outer Distance / 3 - if ( !distance ) { - distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; - } - - if ( show ) { - downAnim = { opacity: 1 }; - downAnim[ ref ] = 0; - - // if we are showing, force opacity 0 and set the initial position - // then do the "first" animation - el.css( "opacity", 0 ) - .css( ref, motion ? -distance * 2 : distance * 2 ) - .animate( downAnim, speed, easing ); - } - - // start at the smallest distance if we are hiding - if ( hide ) { - distance = distance / Math.pow( 2, times - 1 ); - } - - downAnim = {}; - downAnim[ ref ] = 0; - // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here - for ( i = 0; i < times; i++ ) { - upAnim = {}; - upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; - - el.animate( upAnim, speed, easing ) - .animate( downAnim, speed, easing ); - - distance = hide ? distance * 2 : distance / 2; - } - - // Last Bounce when Hiding - if ( hide ) { - upAnim = { opacity: 0 }; - upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; - - el.animate( upAnim, speed, easing ); - } - - el.queue(function() { - if ( hide ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - }); - - // inject all the animations we just queued to be first in line (after "inprogress") - if ( queuelen > 1) { - queue.splice.apply( queue, - [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); - } - el.dequeue(); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.clip = function( o, done ) { - // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "hide" ), - show = mode === "show", - direction = o.direction || "vertical", - vert = direction === "vertical", - size = vert ? "height" : "width", - position = vert ? "top" : "left", - animation = {}, - wrapper, animate, distance; - - // Save & Show - $.effects.save( el, props ); - el.show(); - - // Create Wrapper - wrapper = $.effects.createWrapper( el ).css({ - overflow: "hidden" - }); - animate = ( el[0].tagName === "IMG" ) ? wrapper : el; - distance = animate[ size ](); - - // Shift - if ( show ) { - animate.css( size, 0 ); - animate.css( position, distance / 2 ); - } - - // Create Animation Object: - animation[ size ] = show ? distance : 0; - animation[ position ] = show ? 0 : distance / 2; - - // Animate - animate.animate( animation, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( !show ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - } - }); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.drop = function( o, done ) { - - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "hide" ), - show = mode === "show", - direction = o.direction || "left", - ref = ( direction === "up" || direction === "down" ) ? "top" : "left", - motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg", - animation = { - opacity: show ? 1 : 0 - }, - distance; - - // Adjust - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); - - distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2; - - if ( show ) { - el - .css( "opacity", 0 ) - .css( ref, motion === "pos" ? -distance : distance ); - } - - // Animation - animation[ ref ] = ( show ? - ( motion === "pos" ? "+=" : "-=" ) : - ( motion === "pos" ? "-=" : "+=" ) ) + - distance; - - // Animate - el.animate( animation, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - } - }); -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.explode = function( o, done ) { - - var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3, - cells = rows, - el = $( this ), - mode = $.effects.setMode( el, o.mode || "hide" ), - show = mode === "show", - - // show and then visibility:hidden the element before calculating offset - offset = el.show().css( "visibility", "hidden" ).offset(), - - // width and height of a piece - width = Math.ceil( el.outerWidth() / cells ), - height = Math.ceil( el.outerHeight() / rows ), - pieces = [], - - // loop - i, j, left, top, mx, my; - - // children animate complete: - function childComplete() { - pieces.push( this ); - if ( pieces.length === rows * cells ) { - animComplete(); - } - } - - // clone the element for each row and cell. - for( i = 0; i < rows ; i++ ) { // ===> - top = offset.top + i * height; - my = i - ( rows - 1 ) / 2 ; - - for( j = 0; j < cells ; j++ ) { // ||| - left = offset.left + j * width; - mx = j - ( cells - 1 ) / 2 ; - - // Create a clone of the now hidden main element that will be absolute positioned - // within a wrapper div off the -left and -top equal to size of our pieces - el - .clone() - .appendTo( "body" ) - .wrap( "
    " ) - .css({ - position: "absolute", - visibility: "visible", - left: -j * width, - top: -i * height - }) - - // select the wrapper - make it overflow: hidden and absolute positioned based on - // where the original was located +left and +top equal to the size of pieces - .parent() - .addClass( "ui-effects-explode" ) - .css({ - position: "absolute", - overflow: "hidden", - width: width, - height: height, - left: left + ( show ? mx * width : 0 ), - top: top + ( show ? my * height : 0 ), - opacity: show ? 0 : 1 - }).animate({ - left: left + ( show ? 0 : mx * width ), - top: top + ( show ? 0 : my * height ), - opacity: show ? 1 : 0 - }, o.duration || 500, o.easing, childComplete ); - } - } - - function animComplete() { - el.css({ - visibility: "visible" - }); - $( pieces ).remove(); - if ( !show ) { - el.hide(); - } - done(); - } -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.fade = function( o, done ) { - var el = $( this ), - mode = $.effects.setMode( el, o.mode || "toggle" ); - - el.animate({ - opacity: mode - }, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: done - }); -}; - -})( jQuery ); -(function( $, undefined ) { - -$.effects.effect.fold = function( o, done ) { - - // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "hide" ), - show = mode === "show", - hide = mode === "hide", - size = o.size || 15, - percent = /([0-9]+)%/.exec( size ), - horizFirst = !!o.horizFirst, - widthFirst = show !== horizFirst, - ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ], - duration = o.duration / 2, - wrapper, distance, - animation1 = {}, - animation2 = {}; - - $.effects.save( el, props ); - el.show(); - - // Create Wrapper - wrapper = $.effects.createWrapper( el ).css({ - overflow: "hidden" - }); - distance = widthFirst ? - [ wrapper.width(), wrapper.height() ] : - [ wrapper.height(), wrapper.width() ]; - - if ( percent ) { - size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ]; - } - if ( show ) { - wrapper.css( horizFirst ? { - height: 0, - width: size - } : { - height: size, - width: 0 - }); - } - - // Animation - animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size; - animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0; - - // Animate - wrapper - .animate( animation1, duration, o.easing ) - .animate( animation2, duration, o.easing, function() { - if ( hide ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - }); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.highlight = function( o, done ) { - var elem = $( this ), - props = [ "backgroundImage", "backgroundColor", "opacity" ], - mode = $.effects.setMode( elem, o.mode || "show" ), - animation = { - backgroundColor: elem.css( "backgroundColor" ) - }; - - if (mode === "hide") { - animation.opacity = 0; - } - - $.effects.save( elem, props ); - - elem - .show() - .css({ - backgroundImage: "none", - backgroundColor: o.color || "#ffff99" - }) - .animate( animation, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( mode === "hide" ) { - elem.hide(); - } - $.effects.restore( elem, props ); - done(); - } - }); -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.pulsate = function( o, done ) { - var elem = $( this ), - mode = $.effects.setMode( elem, o.mode || "show" ), - show = mode === "show", - hide = mode === "hide", - showhide = ( show || mode === "hide" ), - - // showing or hiding leaves of the "last" animation - anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ), - duration = o.duration / anims, - animateTo = 0, - queue = elem.queue(), - queuelen = queue.length, - i; - - if ( show || !elem.is(":visible")) { - elem.css( "opacity", 0 ).show(); - animateTo = 1; - } - - // anims - 1 opacity "toggles" - for ( i = 1; i < anims; i++ ) { - elem.animate({ - opacity: animateTo - }, duration, o.easing ); - animateTo = 1 - animateTo; - } - - elem.animate({ - opacity: animateTo - }, duration, o.easing); - - elem.queue(function() { - if ( hide ) { - elem.hide(); - } - done(); - }); - - // We just queued up "anims" animations, we need to put them next in the queue - if ( queuelen > 1 ) { - queue.splice.apply( queue, - [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); - } - elem.dequeue(); -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.puff = function( o, done ) { - var elem = $( this ), - mode = $.effects.setMode( elem, o.mode || "hide" ), - hide = mode === "hide", - percent = parseInt( o.percent, 10 ) || 150, - factor = percent / 100, - original = { - height: elem.height(), - width: elem.width(), - outerHeight: elem.outerHeight(), - outerWidth: elem.outerWidth() - }; - - $.extend( o, { - effect: "scale", - queue: false, - fade: true, - mode: mode, - complete: done, - percent: hide ? percent : 100, - from: hide ? - original : - { - height: original.height * factor, - width: original.width * factor, - outerHeight: original.outerHeight * factor, - outerWidth: original.outerWidth * factor - } - }); - - elem.effect( o ); -}; - -$.effects.effect.scale = function( o, done ) { - - // Create element - var el = $( this ), - options = $.extend( true, {}, o ), - mode = $.effects.setMode( el, o.mode || "effect" ), - percent = parseInt( o.percent, 10 ) || - ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ), - direction = o.direction || "both", - origin = o.origin, - original = { - height: el.height(), - width: el.width(), - outerHeight: el.outerHeight(), - outerWidth: el.outerWidth() - }, - factor = { - y: direction !== "horizontal" ? (percent / 100) : 1, - x: direction !== "vertical" ? (percent / 100) : 1 - }; - - // We are going to pass this effect to the size effect: - options.effect = "size"; - options.queue = false; - options.complete = done; - - // Set default origin and restore for show/hide - if ( mode !== "effect" ) { - options.origin = origin || ["middle","center"]; - options.restore = true; - } - - options.from = o.from || ( mode === "show" ? { - height: 0, - width: 0, - outerHeight: 0, - outerWidth: 0 - } : original ); - options.to = { - height: original.height * factor.y, - width: original.width * factor.x, - outerHeight: original.outerHeight * factor.y, - outerWidth: original.outerWidth * factor.x - }; - - // Fade option to support puff - if ( options.fade ) { - if ( mode === "show" ) { - options.from.opacity = 0; - options.to.opacity = 1; - } - if ( mode === "hide" ) { - options.from.opacity = 1; - options.to.opacity = 0; - } - } - - // Animate - el.effect( options ); - -}; - -$.effects.effect.size = function( o, done ) { - - // Create element - var original, baseline, factor, - el = $( this ), - props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ], - - // Always restore - props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ], - - // Copy for children - props2 = [ "width", "height", "overflow" ], - cProps = [ "fontSize" ], - vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ], - hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ], - - // Set options - mode = $.effects.setMode( el, o.mode || "effect" ), - restore = o.restore || mode !== "effect", - scale = o.scale || "both", - origin = o.origin || [ "middle", "center" ], - position = el.css( "position" ), - props = restore ? props0 : props1, - zero = { - height: 0, - width: 0, - outerHeight: 0, - outerWidth: 0 - }; - - if ( mode === "show" ) { - el.show(); - } - original = { - height: el.height(), - width: el.width(), - outerHeight: el.outerHeight(), - outerWidth: el.outerWidth() - }; - - if ( o.mode === "toggle" && mode === "show" ) { - el.from = o.to || zero; - el.to = o.from || original; - } else { - el.from = o.from || ( mode === "show" ? zero : original ); - el.to = o.to || ( mode === "hide" ? zero : original ); - } - - // Set scaling factor - factor = { - from: { - y: el.from.height / original.height, - x: el.from.width / original.width - }, - to: { - y: el.to.height / original.height, - x: el.to.width / original.width - } - }; - - // Scale the css box - if ( scale === "box" || scale === "both" ) { - - // Vertical props scaling - if ( factor.from.y !== factor.to.y ) { - props = props.concat( vProps ); - el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from ); - el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to ); - } - - // Horizontal props scaling - if ( factor.from.x !== factor.to.x ) { - props = props.concat( hProps ); - el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from ); - el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to ); - } - } - - // Scale the content - if ( scale === "content" || scale === "both" ) { - - // Vertical props scaling - if ( factor.from.y !== factor.to.y ) { - props = props.concat( cProps ).concat( props2 ); - el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from ); - el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to ); - } - } - - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); - el.css( "overflow", "hidden" ).css( el.from ); - - // Adjust - if (origin) { // Calculate baseline shifts - baseline = $.effects.getBaseline( origin, original ); - el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y; - el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x; - el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y; - el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x; - } - el.css( el.from ); // set top & left - - // Animate - if ( scale === "content" || scale === "both" ) { // Scale the children - - // Add margins/font-size - vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps); - hProps = hProps.concat([ "marginLeft", "marginRight" ]); - props2 = props0.concat(vProps).concat(hProps); - - el.find( "*[width]" ).each( function(){ - var child = $( this ), - c_original = { - height: child.height(), - width: child.width(), - outerHeight: child.outerHeight(), - outerWidth: child.outerWidth() - }; - if (restore) { - $.effects.save(child, props2); - } - - child.from = { - height: c_original.height * factor.from.y, - width: c_original.width * factor.from.x, - outerHeight: c_original.outerHeight * factor.from.y, - outerWidth: c_original.outerWidth * factor.from.x - }; - child.to = { - height: c_original.height * factor.to.y, - width: c_original.width * factor.to.x, - outerHeight: c_original.height * factor.to.y, - outerWidth: c_original.width * factor.to.x - }; - - // Vertical props scaling - if ( factor.from.y !== factor.to.y ) { - child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from ); - child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to ); - } - - // Horizontal props scaling - if ( factor.from.x !== factor.to.x ) { - child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from ); - child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to ); - } - - // Animate children - child.css( child.from ); - child.animate( child.to, o.duration, o.easing, function() { - - // Restore children - if ( restore ) { - $.effects.restore( child, props2 ); - } - }); - }); - } - - // Animate - el.animate( el.to, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( el.to.opacity === 0 ) { - el.css( "opacity", el.from.opacity ); - } - if( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - if ( !restore ) { - - // we need to calculate our new positioning based on the scaling - if ( position === "static" ) { - el.css({ - position: "relative", - top: el.to.top, - left: el.to.left - }); - } else { - $.each([ "top", "left" ], function( idx, pos ) { - el.css( pos, function( _, str ) { - var val = parseInt( str, 10 ), - toRef = idx ? el.to.left : el.to.top; - - // if original was "auto", recalculate the new value from wrapper - if ( str === "auto" ) { - return toRef + "px"; - } - - return val + toRef + "px"; - }); - }); - } - } - - $.effects.removeWrapper( el ); - done(); - } - }); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.shake = function( o, done ) { - - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "effect" ), - direction = o.direction || "left", - distance = o.distance || 20, - times = o.times || 3, - anims = times * 2 + 1, - speed = Math.round(o.duration/anims), - ref = (direction === "up" || direction === "down") ? "top" : "left", - positiveMotion = (direction === "up" || direction === "left"), - animation = {}, - animation1 = {}, - animation2 = {}, - i, - - // we will need to re-assemble the queue to stack our animations in place - queue = el.queue(), - queuelen = queue.length; - - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); - - // Animation - animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance; - animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2; - animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2; - - // Animate - el.animate( animation, speed, o.easing ); - - // Shakes - for ( i = 1; i < times; i++ ) { - el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing ); - } - el - .animate( animation1, speed, o.easing ) - .animate( animation, speed / 2, o.easing ) - .queue(function() { - if ( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - }); - - // inject all the animations we just queued to be first in line (after "inprogress") - if ( queuelen > 1) { - queue.splice.apply( queue, - [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); - } - el.dequeue(); - -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.slide = function( o, done ) { - - // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "width", "height" ], - mode = $.effects.setMode( el, o.mode || "show" ), - show = mode === "show", - direction = o.direction || "left", - ref = (direction === "up" || direction === "down") ? "top" : "left", - positiveMotion = (direction === "up" || direction === "left"), - distance, - animation = {}; - - // Adjust - $.effects.save( el, props ); - el.show(); - distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ); - - $.effects.createWrapper( el ).css({ - overflow: "hidden" - }); - - if ( show ) { - el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance ); - } - - // Animation - animation[ ref ] = ( show ? - ( positiveMotion ? "+=" : "-=") : - ( positiveMotion ? "-=" : "+=")) + - distance; - - // Animate - el.animate( animation, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - if ( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - } - }); -}; - -})(jQuery); -(function( $, undefined ) { - -$.effects.effect.transfer = function( o, done ) { - var elem = $( this ), - target = $( o.to ), - targetFixed = target.css( "position" ) === "fixed", - body = $("body"), - fixTop = targetFixed ? body.scrollTop() : 0, - fixLeft = targetFixed ? body.scrollLeft() : 0, - endPosition = target.offset(), - animation = { - top: endPosition.top - fixTop , - left: endPosition.left - fixLeft , - height: target.innerHeight(), - width: target.innerWidth() - }, - startPosition = elem.offset(), - transfer = $( '
    ' ) - .appendTo( document.body ) - .addClass( o.className ) - .css({ - top: startPosition.top - fixTop , - left: startPosition.left - fixLeft , - height: elem.innerHeight(), - width: elem.innerWidth(), - position: targetFixed ? "fixed" : "absolute" - }) - .animate( animation, o.duration, o.easing, function() { - transfer.remove(); - done(); - }); -}; - -})(jQuery); -(function( $, undefined ) { - -var mouseHandled = false; - -$.widget( "ui.menu", { - version: "1.9.2", - defaultElement: "
      ", - delay: 300, - options: { - icons: { - submenu: "ui-icon-carat-1-e" - }, - menus: "ul", - position: { - my: "left top", - at: "right top" - }, - role: "menu", - - // callbacks - blur: null, - focus: null, - select: null - }, - - _create: function() { - this.activeMenu = this.element; - this.element - .uniqueId() - .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) - .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length ) - .attr({ - role: this.options.role, - tabIndex: 0 - }) - // need to catch all clicks on disabled menu - // not possible through _on - .bind( "click" + this.eventNamespace, $.proxy(function( event ) { - if ( this.options.disabled ) { - event.preventDefault(); - } - }, this )); - - if ( this.options.disabled ) { - this.element - .addClass( "ui-state-disabled" ) - .attr( "aria-disabled", "true" ); - } - - this._on({ - // Prevent focus from sticking to links inside menu after clicking - // them (focus should always stay on UL during navigation). - "mousedown .ui-menu-item > a": function( event ) { - event.preventDefault(); - }, - "click .ui-state-disabled > a": function( event ) { - event.preventDefault(); - }, - "click .ui-menu-item:has(a)": function( event ) { - var target = $( event.target ).closest( ".ui-menu-item" ); - if ( !mouseHandled && target.not( ".ui-state-disabled" ).length ) { - mouseHandled = true; - - this.select( event ); - // Open submenu on click - if ( target.has( ".ui-menu" ).length ) { - this.expand( event ); - } else if ( !this.element.is( ":focus" ) ) { - // Redirect focus to the menu - this.element.trigger( "focus", [ true ] ); - - // If the active item is on the top level, let it stay active. - // Otherwise, blur the active item since it is no longer visible. - if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { - clearTimeout( this.timer ); - } - } - } - }, - "mouseenter .ui-menu-item": function( event ) { - var target = $( event.currentTarget ); - // Remove ui-state-active class from siblings of the newly focused menu item - // to avoid a jump caused by adjacent elements both having a class with a border - target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" ); - this.focus( event, target ); - }, - mouseleave: "collapseAll", - "mouseleave .ui-menu": "collapseAll", - focus: function( event, keepActiveItem ) { - // If there's already an active item, keep it active - // If not, activate the first item - var item = this.active || this.element.children( ".ui-menu-item" ).eq( 0 ); - - if ( !keepActiveItem ) { - this.focus( event, item ); - } - }, - blur: function( event ) { - this._delay(function() { - if ( !$.contains( this.element[0], this.document[0].activeElement ) ) { - this.collapseAll( event ); - } - }); - }, - keydown: "_keydown" - }); - - this.refresh(); - - // Clicks outside of a menu collapse any open menus - this._on( this.document, { - click: function( event ) { - if ( !$( event.target ).closest( ".ui-menu" ).length ) { - this.collapseAll( event ); - } - - // Reset the mouseHandled flag - mouseHandled = false; - } - }); - }, - - _destroy: function() { - // Destroy (sub)menus - this.element - .removeAttr( "aria-activedescendant" ) - .find( ".ui-menu" ).andSelf() - .removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" ) - .removeAttr( "role" ) - .removeAttr( "tabIndex" ) - .removeAttr( "aria-labelledby" ) - .removeAttr( "aria-expanded" ) - .removeAttr( "aria-hidden" ) - .removeAttr( "aria-disabled" ) - .removeUniqueId() - .show(); - - // Destroy menu items - this.element.find( ".ui-menu-item" ) - .removeClass( "ui-menu-item" ) - .removeAttr( "role" ) - .removeAttr( "aria-disabled" ) - .children( "a" ) - .removeUniqueId() - .removeClass( "ui-corner-all ui-state-hover" ) - .removeAttr( "tabIndex" ) - .removeAttr( "role" ) - .removeAttr( "aria-haspopup" ) - .children().each( function() { - var elem = $( this ); - if ( elem.data( "ui-menu-submenu-carat" ) ) { - elem.remove(); - } - }); - - // Destroy menu dividers - this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" ); - }, - - _keydown: function( event ) { - var match, prev, character, skip, regex, - preventDefault = true; - - function escape( value ) { - return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); - } - - switch ( event.keyCode ) { - case $.ui.keyCode.PAGE_UP: - this.previousPage( event ); - break; - case $.ui.keyCode.PAGE_DOWN: - this.nextPage( event ); - break; - case $.ui.keyCode.HOME: - this._move( "first", "first", event ); - break; - case $.ui.keyCode.END: - this._move( "last", "last", event ); - break; - case $.ui.keyCode.UP: - this.previous( event ); - break; - case $.ui.keyCode.DOWN: - this.next( event ); - break; - case $.ui.keyCode.LEFT: - this.collapse( event ); - break; - case $.ui.keyCode.RIGHT: - if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { - this.expand( event ); - } - break; - case $.ui.keyCode.ENTER: - case $.ui.keyCode.SPACE: - this._activate( event ); - break; - case $.ui.keyCode.ESCAPE: - this.collapse( event ); - break; - default: - preventDefault = false; - prev = this.previousFilter || ""; - character = String.fromCharCode( event.keyCode ); - skip = false; - - clearTimeout( this.filterTimer ); - - if ( character === prev ) { - skip = true; - } else { - character = prev + character; - } - - regex = new RegExp( "^" + escape( character ), "i" ); - match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { - return regex.test( $( this ).children( "a" ).text() ); - }); - match = skip && match.index( this.active.next() ) !== -1 ? - this.active.nextAll( ".ui-menu-item" ) : - match; - - // If no matches on the current filter, reset to the last character pressed - // to move down the menu to the first item that starts with that character - if ( !match.length ) { - character = String.fromCharCode( event.keyCode ); - regex = new RegExp( "^" + escape( character ), "i" ); - match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { - return regex.test( $( this ).children( "a" ).text() ); - }); - } - - if ( match.length ) { - this.focus( event, match ); - if ( match.length > 1 ) { - this.previousFilter = character; - this.filterTimer = this._delay(function() { - delete this.previousFilter; - }, 1000 ); - } else { - delete this.previousFilter; - } - } else { - delete this.previousFilter; - } - } - - if ( preventDefault ) { - event.preventDefault(); - } - }, - - _activate: function( event ) { - if ( !this.active.is( ".ui-state-disabled" ) ) { - if ( this.active.children( "a[aria-haspopup='true']" ).length ) { - this.expand( event ); - } else { - this.select( event ); - } - } - }, - - refresh: function() { - var menus, - icon = this.options.icons.submenu, - submenus = this.element.find( this.options.menus ); - - // Initialize nested menus - submenus.filter( ":not(.ui-menu)" ) - .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) - .hide() - .attr({ - role: this.options.role, - "aria-hidden": "true", - "aria-expanded": "false" - }) - .each(function() { - var menu = $( this ), - item = menu.prev( "a" ), - submenuCarat = $( "" ) - .addClass( "ui-menu-icon ui-icon " + icon ) - .data( "ui-menu-submenu-carat", true ); - - item - .attr( "aria-haspopup", "true" ) - .prepend( submenuCarat ); - menu.attr( "aria-labelledby", item.attr( "id" ) ); - }); - - menus = submenus.add( this.element ); - - // Don't refresh list items that are already adapted - menus.children( ":not(.ui-menu-item):has(a)" ) - .addClass( "ui-menu-item" ) - .attr( "role", "presentation" ) - .children( "a" ) - .uniqueId() - .addClass( "ui-corner-all" ) - .attr({ - tabIndex: -1, - role: this._itemRole() - }); - - // Initialize unlinked menu-items containing spaces and/or dashes only as dividers - menus.children( ":not(.ui-menu-item)" ).each(function() { - var item = $( this ); - // hyphen, em dash, en dash - if ( !/[^\-—–\s]/.test( item.text() ) ) { - item.addClass( "ui-widget-content ui-menu-divider" ); - } - }); - - // Add aria-disabled attribute to any disabled menu item - menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); - - // If the active item has been removed, blur the menu - if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { - this.blur(); - } - }, - - _itemRole: function() { - return { - menu: "menuitem", - listbox: "option" - }[ this.options.role ]; - }, - - focus: function( event, item ) { - var nested, focused; - this.blur( event, event && event.type === "focus" ); - - this._scrollIntoView( item ); - - this.active = item.first(); - focused = this.active.children( "a" ).addClass( "ui-state-focus" ); - // Only update aria-activedescendant if there's a role - // otherwise we assume focus is managed elsewhere - if ( this.options.role ) { - this.element.attr( "aria-activedescendant", focused.attr( "id" ) ); - } - - // Highlight active parent menu item, if any - this.active - .parent() - .closest( ".ui-menu-item" ) - .children( "a:first" ) - .addClass( "ui-state-active" ); - - if ( event && event.type === "keydown" ) { - this._close(); - } else { - this.timer = this._delay(function() { - this._close(); - }, this.delay ); - } - - nested = item.children( ".ui-menu" ); - if ( nested.length && ( /^mouse/.test( event.type ) ) ) { - this._startOpening(nested); - } - this.activeMenu = item.parent(); - - this._trigger( "focus", event, { item: item } ); - }, - - _scrollIntoView: function( item ) { - var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; - if ( this._hasScroll() ) { - borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0; - paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0; - offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; - scroll = this.activeMenu.scrollTop(); - elementHeight = this.activeMenu.height(); - itemHeight = item.height(); - - if ( offset < 0 ) { - this.activeMenu.scrollTop( scroll + offset ); - } else if ( offset + itemHeight > elementHeight ) { - this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight ); - } - } - }, - - blur: function( event, fromFocus ) { - if ( !fromFocus ) { - clearTimeout( this.timer ); - } - - if ( !this.active ) { - return; - } - - this.active.children( "a" ).removeClass( "ui-state-focus" ); - this.active = null; - - this._trigger( "blur", event, { item: this.active } ); - }, - - _startOpening: function( submenu ) { - clearTimeout( this.timer ); - - // Don't open if already open fixes a Firefox bug that caused a .5 pixel - // shift in the submenu position when mousing over the carat icon - if ( submenu.attr( "aria-hidden" ) !== "true" ) { - return; - } - - this.timer = this._delay(function() { - this._close(); - this._open( submenu ); - }, this.delay ); - }, - - _open: function( submenu ) { - var position = $.extend({ - of: this.active - }, this.options.position ); - - clearTimeout( this.timer ); - this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) ) - .hide() - .attr( "aria-hidden", "true" ); - - submenu - .show() - .removeAttr( "aria-hidden" ) - .attr( "aria-expanded", "true" ) - .position( position ); - }, - - collapseAll: function( event, all ) { - clearTimeout( this.timer ); - this.timer = this._delay(function() { - // If we were passed an event, look for the submenu that contains the event - var currentMenu = all ? this.element : - $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); - - // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway - if ( !currentMenu.length ) { - currentMenu = this.element; - } - - this._close( currentMenu ); - - this.blur( event ); - this.activeMenu = currentMenu; - }, this.delay ); - }, - - // With no arguments, closes the currently active menu - if nothing is active - // it closes all menus. If passed an argument, it will search for menus BELOW - _close: function( startMenu ) { - if ( !startMenu ) { - startMenu = this.active ? this.active.parent() : this.element; - } - - startMenu - .find( ".ui-menu" ) - .hide() - .attr( "aria-hidden", "true" ) - .attr( "aria-expanded", "false" ) - .end() - .find( "a.ui-state-active" ) - .removeClass( "ui-state-active" ); - }, - - collapse: function( event ) { - var newItem = this.active && - this.active.parent().closest( ".ui-menu-item", this.element ); - if ( newItem && newItem.length ) { - this._close(); - this.focus( event, newItem ); - } - }, - - expand: function( event ) { - var newItem = this.active && - this.active - .children( ".ui-menu " ) - .children( ".ui-menu-item" ) - .first(); - - if ( newItem && newItem.length ) { - this._open( newItem.parent() ); - - // Delay so Firefox will not hide activedescendant change in expanding submenu from AT - this._delay(function() { - this.focus( event, newItem ); - }); - } - }, - - next: function( event ) { - this._move( "next", "first", event ); - }, - - previous: function( event ) { - this._move( "prev", "last", event ); - }, - - isFirstItem: function() { - return this.active && !this.active.prevAll( ".ui-menu-item" ).length; - }, - - isLastItem: function() { - return this.active && !this.active.nextAll( ".ui-menu-item" ).length; - }, - - _move: function( direction, filter, event ) { - var next; - if ( this.active ) { - if ( direction === "first" || direction === "last" ) { - next = this.active - [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ) - .eq( -1 ); - } else { - next = this.active - [ direction + "All" ]( ".ui-menu-item" ) - .eq( 0 ); - } - } - if ( !next || !next.length || !this.active ) { - next = this.activeMenu.children( ".ui-menu-item" )[ filter ](); - } - - this.focus( event, next ); - }, - - nextPage: function( event ) { - var item, base, height; - - if ( !this.active ) { - this.next( event ); - return; - } - if ( this.isLastItem() ) { - return; - } - if ( this._hasScroll() ) { - base = this.active.offset().top; - height = this.element.height(); - this.active.nextAll( ".ui-menu-item" ).each(function() { - item = $( this ); - return item.offset().top - base - height < 0; - }); - - this.focus( event, item ); - } else { - this.focus( event, this.activeMenu.children( ".ui-menu-item" ) - [ !this.active ? "first" : "last" ]() ); - } - }, - - previousPage: function( event ) { - var item, base, height; - if ( !this.active ) { - this.next( event ); - return; - } - if ( this.isFirstItem() ) { - return; - } - if ( this._hasScroll() ) { - base = this.active.offset().top; - height = this.element.height(); - this.active.prevAll( ".ui-menu-item" ).each(function() { - item = $( this ); - return item.offset().top - base + height > 0; - }); - - this.focus( event, item ); - } else { - this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() ); - } - }, - - _hasScroll: function() { - return this.element.outerHeight() < this.element.prop( "scrollHeight" ); - }, - - select: function( event ) { - // TODO: It should never be possible to not have an active item at this - // point, but the tests don't trigger mouseenter before click. - this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); - var ui = { item: this.active }; - if ( !this.active.has( ".ui-menu" ).length ) { - this.collapseAll( event, true ); - } - this._trigger( "select", event, ui ); - } -}); - -}( jQuery )); -(function( $, undefined ) { - -$.widget( "ui.progressbar", { - version: "1.9.2", - options: { - value: 0, - max: 100 - }, - - min: 0, - - _create: function() { - this.element - .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) - .attr({ - role: "progressbar", - "aria-valuemin": this.min, - "aria-valuemax": this.options.max, - "aria-valuenow": this._value() - }); - - this.valueDiv = $( "
      " ) - .appendTo( this.element ); - - this.oldValue = this._value(); - this._refreshValue(); - }, - - _destroy: function() { - this.element - .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) - .removeAttr( "role" ) - .removeAttr( "aria-valuemin" ) - .removeAttr( "aria-valuemax" ) - .removeAttr( "aria-valuenow" ); - - this.valueDiv.remove(); - }, - - value: function( newValue ) { - if ( newValue === undefined ) { - return this._value(); - } - - this._setOption( "value", newValue ); - return this; - }, - - _setOption: function( key, value ) { - if ( key === "value" ) { - this.options.value = value; - this._refreshValue(); - if ( this._value() === this.options.max ) { - this._trigger( "complete" ); - } - } - - this._super( key, value ); - }, - - _value: function() { - var val = this.options.value; - // normalize invalid value - if ( typeof val !== "number" ) { - val = 0; - } - return Math.min( this.options.max, Math.max( this.min, val ) ); - }, - - _percentage: function() { - return 100 * this._value() / this.options.max; - }, - - _refreshValue: function() { - var value = this.value(), - percentage = this._percentage(); - - if ( this.oldValue !== value ) { - this.oldValue = value; - this._trigger( "change" ); - } - - this.valueDiv - .toggle( value > this.min ) - .toggleClass( "ui-corner-right", value === this.options.max ) - .width( percentage.toFixed(0) + "%" ); - this.element.attr( "aria-valuenow", value ); - } -}); - -})( jQuery ); -(function( $, undefined ) { - -$.widget("ui.resizable", $.ui.mouse, { - version: "1.9.2", - widgetEventPrefix: "resize", - options: { - alsoResize: false, - animate: false, - animateDuration: "slow", - animateEasing: "swing", - aspectRatio: false, - autoHide: false, - containment: false, - ghost: false, - grid: false, - handles: "e,s,se", - helper: false, - maxHeight: null, - maxWidth: null, - minHeight: 10, - minWidth: 10, - zIndex: 1000 - }, - _create: function() { - - var that = this, o = this.options; - this.element.addClass("ui-resizable"); - - $.extend(this, { - _aspectRatio: !!(o.aspectRatio), - aspectRatio: o.aspectRatio, - originalElement: this.element, - _proportionallyResizeElements: [], - _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null - }); - - //Wrap the element if it cannot hold child nodes - if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { - - //Create a wrapper element and set the wrapper to the new current internal element - this.element.wrap( - $('
      ').css({ - position: this.element.css('position'), - width: this.element.outerWidth(), - height: this.element.outerHeight(), - top: this.element.css('top'), - left: this.element.css('left') - }) - ); - - //Overwrite the original this.element - this.element = this.element.parent().data( - "resizable", this.element.data('resizable') - ); - - this.elementIsWrapper = true; - - //Move margins to the wrapper - this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); - this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); - - //Prevent Safari textarea resize - this.originalResizeStyle = this.originalElement.css('resize'); - this.originalElement.css('resize', 'none'); - - //Push the actual element to our proportionallyResize internal array - this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); - - // avoid IE jump (hard set the margin) - this.originalElement.css({ margin: this.originalElement.css('margin') }); - - // fix handlers offset - this._proportionallyResize(); - - } - - this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); - if(this.handles.constructor == String) { - - if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; - var n = this.handles.split(","); this.handles = {}; - - for(var i = 0; i < n.length; i++) { - - var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; - var axis = $('
      '); - - // Apply zIndex to all handles - see #7960 - axis.css({ zIndex: o.zIndex }); - - //TODO : What's going on here? - if ('se' == handle) { - axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); - }; - - //Insert into internal handles object and append to element - this.handles[handle] = '.ui-resizable-'+handle; - this.element.append(axis); - } - - } - - this._renderAxis = function(target) { - - target = target || this.element; - - for(var i in this.handles) { - - if(this.handles[i].constructor == String) - this.handles[i] = $(this.handles[i], this.element).show(); - - //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) - if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { - - var axis = $(this.handles[i], this.element), padWrapper = 0; - - //Checking the correct pad and border - padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); - - //The padding type i have to apply... - var padPos = [ 'padding', - /ne|nw|n/.test(i) ? 'Top' : - /se|sw|s/.test(i) ? 'Bottom' : - /^e$/.test(i) ? 'Right' : 'Left' ].join(""); - - target.css(padPos, padWrapper); - - this._proportionallyResize(); - - } - - //TODO: What's that good for? There's not anything to be executed left - if(!$(this.handles[i]).length) - continue; - - } - }; - - //TODO: make renderAxis a prototype function - this._renderAxis(this.element); - - this._handles = $('.ui-resizable-handle', this.element) - .disableSelection(); - - //Matching axis name - this._handles.mouseover(function() { - if (!that.resizing) { - if (this.className) - var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); - //Axis, default = se - that.axis = axis && axis[1] ? axis[1] : 'se'; - } - }); - - //If we want to auto hide the elements - if (o.autoHide) { - this._handles.hide(); - $(this.element) - .addClass("ui-resizable-autohide") - .mouseenter(function() { - if (o.disabled) return; - $(this).removeClass("ui-resizable-autohide"); - that._handles.show(); - }) - .mouseleave(function(){ - if (o.disabled) return; - if (!that.resizing) { - $(this).addClass("ui-resizable-autohide"); - that._handles.hide(); - } - }); - } - - //Initialize the mouse interaction - this._mouseInit(); - - }, - - _destroy: function() { - - this._mouseDestroy(); - - var _destroy = function(exp) { - $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") - .removeData("resizable").removeData("ui-resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); - }; - - //TODO: Unwrap at same DOM position - if (this.elementIsWrapper) { - _destroy(this.element); - var wrapper = this.element; - this.originalElement.css({ - position: wrapper.css('position'), - width: wrapper.outerWidth(), - height: wrapper.outerHeight(), - top: wrapper.css('top'), - left: wrapper.css('left') - }).insertAfter( wrapper ); - wrapper.remove(); - } - - this.originalElement.css('resize', this.originalResizeStyle); - _destroy(this.originalElement); - - return this; - }, - - _mouseCapture: function(event) { - var handle = false; - for (var i in this.handles) { - if ($(this.handles[i])[0] == event.target) { - handle = true; - } - } - - return !this.options.disabled && handle; - }, - - _mouseStart: function(event) { - - var o = this.options, iniPos = this.element.position(), el = this.element; - - this.resizing = true; - this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; - - // bugfix for http://dev.jquery.com/ticket/1749 - if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { - el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); - } - - this._renderProxy(); - - var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); - - if (o.containment) { - curleft += $(o.containment).scrollLeft() || 0; - curtop += $(o.containment).scrollTop() || 0; - } - - //Store needed variables - this.offset = this.helper.offset(); - this.position = { left: curleft, top: curtop }; - this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; - this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; - this.originalPosition = { left: curleft, top: curtop }; - this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; - this.originalMousePosition = { left: event.pageX, top: event.pageY }; - - //Aspect Ratio - this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); - - var cursor = $('.ui-resizable-' + this.axis).css('cursor'); - $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); - - el.addClass("ui-resizable-resizing"); - this._propagate("start", event); - return true; - }, - - _mouseDrag: function(event) { - - //Increase performance, avoid regex - var el = this.helper, o = this.options, props = {}, - that = this, smp = this.originalMousePosition, a = this.axis; - - var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; - var trigger = this._change[a]; - if (!trigger) return false; - - // Calculate the attrs that will be change - var data = trigger.apply(this, [event, dx, dy]); - - // Put this in the mouseDrag handler since the user can start pressing shift while resizing - this._updateVirtualBoundaries(event.shiftKey); - if (this._aspectRatio || event.shiftKey) - data = this._updateRatio(data, event); - - data = this._respectSize(data, event); - - // plugins callbacks need to be called first - this._propagate("resize", event); - - el.css({ - top: this.position.top + "px", left: this.position.left + "px", - width: this.size.width + "px", height: this.size.height + "px" - }); - - if (!this._helper && this._proportionallyResizeElements.length) - this._proportionallyResize(); - - this._updateCache(data); - - // calling the user callback at the end - this._trigger('resize', event, this.ui()); - - return false; - }, - - _mouseStop: function(event) { - - this.resizing = false; - var o = this.options, that = this; - - if(this._helper) { - var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), - soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height, - soffsetw = ista ? 0 : that.sizeDiff.width; - - var s = { width: (that.helper.width() - soffsetw), height: (that.helper.height() - soffseth) }, - left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null, - top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null; - - if (!o.animate) - this.element.css($.extend(s, { top: top, left: left })); - - that.helper.height(that.size.height); - that.helper.width(that.size.width); - - if (this._helper && !o.animate) this._proportionallyResize(); - } - - $('body').css('cursor', 'auto'); - - this.element.removeClass("ui-resizable-resizing"); - - this._propagate("stop", event); - - if (this._helper) this.helper.remove(); - return false; - - }, - - _updateVirtualBoundaries: function(forceAspectRatio) { - var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b; - - b = { - minWidth: isNumber(o.minWidth) ? o.minWidth : 0, - maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity, - minHeight: isNumber(o.minHeight) ? o.minHeight : 0, - maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity - }; - - if(this._aspectRatio || forceAspectRatio) { - // We want to create an enclosing box whose aspect ration is the requested one - // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension - pMinWidth = b.minHeight * this.aspectRatio; - pMinHeight = b.minWidth / this.aspectRatio; - pMaxWidth = b.maxHeight * this.aspectRatio; - pMaxHeight = b.maxWidth / this.aspectRatio; - - if(pMinWidth > b.minWidth) b.minWidth = pMinWidth; - if(pMinHeight > b.minHeight) b.minHeight = pMinHeight; - if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth; - if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight; - } - this._vBoundaries = b; - }, - - _updateCache: function(data) { - var o = this.options; - this.offset = this.helper.offset(); - if (isNumber(data.left)) this.position.left = data.left; - if (isNumber(data.top)) this.position.top = data.top; - if (isNumber(data.height)) this.size.height = data.height; - if (isNumber(data.width)) this.size.width = data.width; - }, - - _updateRatio: function(data, event) { - - var o = this.options, cpos = this.position, csize = this.size, a = this.axis; - - if (isNumber(data.height)) data.width = (data.height * this.aspectRatio); - else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio); - - if (a == 'sw') { - data.left = cpos.left + (csize.width - data.width); - data.top = null; - } - if (a == 'nw') { - data.top = cpos.top + (csize.height - data.height); - data.left = cpos.left + (csize.width - data.width); - } - - return data; - }, - - _respectSize: function(data, event) { - - var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, - ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), - isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); - - if (isminw) data.width = o.minWidth; - if (isminh) data.height = o.minHeight; - if (ismaxw) data.width = o.maxWidth; - if (ismaxh) data.height = o.maxHeight; - - var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; - var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); - - if (isminw && cw) data.left = dw - o.minWidth; - if (ismaxw && cw) data.left = dw - o.maxWidth; - if (isminh && ch) data.top = dh - o.minHeight; - if (ismaxh && ch) data.top = dh - o.maxHeight; - - // fixing jump error on top/left - bug #2330 - var isNotwh = !data.width && !data.height; - if (isNotwh && !data.left && data.top) data.top = null; - else if (isNotwh && !data.top && data.left) data.left = null; - - return data; - }, - - _proportionallyResize: function() { - - var o = this.options; - if (!this._proportionallyResizeElements.length) return; - var element = this.helper || this.element; - - for (var i=0; i < this._proportionallyResizeElements.length; i++) { - - var prel = this._proportionallyResizeElements[i]; - - if (!this.borderDif) { - var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], - p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; - - this.borderDif = $.map(b, function(v, i) { - var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; - return border + padding; - }); - } - - prel.css({ - height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, - width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 - }); - - }; - - }, - - _renderProxy: function() { - - var el = this.element, o = this.options; - this.elementOffset = el.offset(); - - if(this._helper) { - - this.helper = this.helper || $('
      '); - - // fix ie6 offset TODO: This seems broken - var ie6offset = ($.ui.ie6 ? 1 : 0), - pxyoffset = ( $.ui.ie6 ? 2 : -1 ); - - this.helper.addClass(this._helper).css({ - width: this.element.outerWidth() + pxyoffset, - height: this.element.outerHeight() + pxyoffset, - position: 'absolute', - left: this.elementOffset.left - ie6offset +'px', - top: this.elementOffset.top - ie6offset +'px', - zIndex: ++o.zIndex //TODO: Don't modify option - }); - - this.helper - .appendTo("body") - .disableSelection(); - - } else { - this.helper = this.element; - } - - }, - - _change: { - e: function(event, dx, dy) { - return { width: this.originalSize.width + dx }; - }, - w: function(event, dx, dy) { - var o = this.options, cs = this.originalSize, sp = this.originalPosition; - return { left: sp.left + dx, width: cs.width - dx }; - }, - n: function(event, dx, dy) { - var o = this.options, cs = this.originalSize, sp = this.originalPosition; - return { top: sp.top + dy, height: cs.height - dy }; - }, - s: function(event, dx, dy) { - return { height: this.originalSize.height + dy }; - }, - se: function(event, dx, dy) { - return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); - }, - sw: function(event, dx, dy) { - return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); - }, - ne: function(event, dx, dy) { - return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); - }, - nw: function(event, dx, dy) { - return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); - } - }, - - _propagate: function(n, event) { - $.ui.plugin.call(this, n, [event, this.ui()]); - (n != "resize" && this._trigger(n, event, this.ui())); - }, - - plugins: {}, - - ui: function() { - return { - originalElement: this.originalElement, - element: this.element, - helper: this.helper, - position: this.position, - size: this.size, - originalSize: this.originalSize, - originalPosition: this.originalPosition - }; - } - -}); - -/* - * Resizable Extensions - */ - -$.ui.plugin.add("resizable", "alsoResize", { - - start: function (event, ui) { - var that = $(this).data("resizable"), o = that.options; - - var _store = function (exp) { - $(exp).each(function() { - var el = $(this); - el.data("resizable-alsoresize", { - width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), - left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10) - }); - }); - }; - - if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { - if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } - else { $.each(o.alsoResize, function (exp) { _store(exp); }); } - }else{ - _store(o.alsoResize); - } - }, - - resize: function (event, ui) { - var that = $(this).data("resizable"), o = that.options, os = that.originalSize, op = that.originalPosition; - - var delta = { - height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0, - top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0 - }, - - _alsoResize = function (exp, c) { - $(exp).each(function() { - var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, - css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; - - $.each(css, function (i, prop) { - var sum = (start[prop]||0) + (delta[prop]||0); - if (sum && sum >= 0) - style[prop] = sum || null; - }); - - el.css(style); - }); - }; - - if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { - $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); - }else{ - _alsoResize(o.alsoResize); - } - }, - - stop: function (event, ui) { - $(this).removeData("resizable-alsoresize"); - } -}); - -$.ui.plugin.add("resizable", "animate", { - - stop: function(event, ui) { - var that = $(this).data("resizable"), o = that.options; - - var pr = that._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), - soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height, - soffsetw = ista ? 0 : that.sizeDiff.width; - - var style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) }, - left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null, - top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null; - - that.element.animate( - $.extend(style, top && left ? { top: top, left: left } : {}), { - duration: o.animateDuration, - easing: o.animateEasing, - step: function() { - - var data = { - width: parseInt(that.element.css('width'), 10), - height: parseInt(that.element.css('height'), 10), - top: parseInt(that.element.css('top'), 10), - left: parseInt(that.element.css('left'), 10) - }; - - if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); - - // propagating resize, and updating values for each animation step - that._updateCache(data); - that._propagate("resize", event); - - } - } - ); - } - -}); - -$.ui.plugin.add("resizable", "containment", { - - start: function(event, ui) { - var that = $(this).data("resizable"), o = that.options, el = that.element; - var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; - if (!ce) return; - - that.containerElement = $(ce); - - if (/document/.test(oc) || oc == document) { - that.containerOffset = { left: 0, top: 0 }; - that.containerPosition = { left: 0, top: 0 }; - - that.parentData = { - element: $(document), left: 0, top: 0, - width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight - }; - } - - // i'm a node, so compute top, left, right, bottom - else { - var element = $(ce), p = []; - $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); - - that.containerOffset = element.offset(); - that.containerPosition = element.position(); - that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; - - var co = that.containerOffset, ch = that.containerSize.height, cw = that.containerSize.width, - width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); - - that.parentData = { - element: ce, left: co.left, top: co.top, width: width, height: height - }; - } - }, - - resize: function(event, ui) { - var that = $(this).data("resizable"), o = that.options, - ps = that.containerSize, co = that.containerOffset, cs = that.size, cp = that.position, - pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement; - - if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; - - if (cp.left < (that._helper ? co.left : 0)) { - that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left)); - if (pRatio) that.size.height = that.size.width / that.aspectRatio; - that.position.left = o.helper ? co.left : 0; - } - - if (cp.top < (that._helper ? co.top : 0)) { - that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top); - if (pRatio) that.size.width = that.size.height * that.aspectRatio; - that.position.top = that._helper ? co.top : 0; - } - - that.offset.left = that.parentData.left+that.position.left; - that.offset.top = that.parentData.top+that.position.top; - - var woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width ), - hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height ); - - var isParent = that.containerElement.get(0) == that.element.parent().get(0), - isOffsetRelative = /relative|absolute/.test(that.containerElement.css('position')); - - if(isParent && isOffsetRelative) woset -= that.parentData.left; - - if (woset + that.size.width >= that.parentData.width) { - that.size.width = that.parentData.width - woset; - if (pRatio) that.size.height = that.size.width / that.aspectRatio; - } - - if (hoset + that.size.height >= that.parentData.height) { - that.size.height = that.parentData.height - hoset; - if (pRatio) that.size.width = that.size.height * that.aspectRatio; - } - }, - - stop: function(event, ui){ - var that = $(this).data("resizable"), o = that.options, cp = that.position, - co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement; - - var helper = $(that.helper), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height; - - if (that._helper && !o.animate && (/relative/).test(ce.css('position'))) - $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); - - if (that._helper && !o.animate && (/static/).test(ce.css('position'))) - $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); - - } -}); - -$.ui.plugin.add("resizable", "ghost", { - - start: function(event, ui) { - - var that = $(this).data("resizable"), o = that.options, cs = that.size; - - that.ghost = that.originalElement.clone(); - that.ghost - .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) - .addClass('ui-resizable-ghost') - .addClass(typeof o.ghost == 'string' ? o.ghost : ''); - - that.ghost.appendTo(that.helper); - - }, - - resize: function(event, ui){ - var that = $(this).data("resizable"), o = that.options; - if (that.ghost) that.ghost.css({ position: 'relative', height: that.size.height, width: that.size.width }); - }, - - stop: function(event, ui){ - var that = $(this).data("resizable"), o = that.options; - if (that.ghost && that.helper) that.helper.get(0).removeChild(that.ghost.get(0)); - } - -}); - -$.ui.plugin.add("resizable", "grid", { - - resize: function(event, ui) { - var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, ratio = o._aspectRatio || event.shiftKey; - o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; - var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); - - if (/^(se|s|e)$/.test(a)) { - that.size.width = os.width + ox; - that.size.height = os.height + oy; - } - else if (/^(ne)$/.test(a)) { - that.size.width = os.width + ox; - that.size.height = os.height + oy; - that.position.top = op.top - oy; - } - else if (/^(sw)$/.test(a)) { - that.size.width = os.width + ox; - that.size.height = os.height + oy; - that.position.left = op.left - ox; - } - else { - that.size.width = os.width + ox; - that.size.height = os.height + oy; - that.position.top = op.top - oy; - that.position.left = op.left - ox; - } - } - -}); - -var num = function(v) { - return parseInt(v, 10) || 0; -}; - -var isNumber = function(value) { - return !isNaN(parseInt(value, 10)); -}; - -})(jQuery); -(function( $, undefined ) { - -$.widget("ui.selectable", $.ui.mouse, { - version: "1.9.2", - options: { - appendTo: 'body', - autoRefresh: true, - distance: 0, - filter: '*', - tolerance: 'touch' - }, - _create: function() { - var that = this; - - this.element.addClass("ui-selectable"); - - this.dragged = false; - - // cache selectee children based on filter - var selectees; - this.refresh = function() { - selectees = $(that.options.filter, that.element[0]); - selectees.addClass("ui-selectee"); - selectees.each(function() { - var $this = $(this); - var pos = $this.offset(); - $.data(this, "selectable-item", { - element: this, - $element: $this, - left: pos.left, - top: pos.top, - right: pos.left + $this.outerWidth(), - bottom: pos.top + $this.outerHeight(), - startselected: false, - selected: $this.hasClass('ui-selected'), - selecting: $this.hasClass('ui-selecting'), - unselecting: $this.hasClass('ui-unselecting') - }); - }); - }; - this.refresh(); - - this.selectees = selectees.addClass("ui-selectee"); - - this._mouseInit(); - - this.helper = $("
      "); - }, - - _destroy: function() { - this.selectees - .removeClass("ui-selectee") - .removeData("selectable-item"); - this.element - .removeClass("ui-selectable ui-selectable-disabled"); - this._mouseDestroy(); - }, - - _mouseStart: function(event) { - var that = this; - - this.opos = [event.pageX, event.pageY]; - - if (this.options.disabled) - return; - - var options = this.options; - - this.selectees = $(options.filter, this.element[0]); - - this._trigger("start", event); - - $(options.appendTo).append(this.helper); - // position helper (lasso) - this.helper.css({ - "left": event.clientX, - "top": event.clientY, - "width": 0, - "height": 0 - }); - - if (options.autoRefresh) { - this.refresh(); - } - - this.selectees.filter('.ui-selected').each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.startselected = true; - if (!event.metaKey && !event.ctrlKey) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - // selectable UNSELECTING callback - that._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - }); - - $(event.target).parents().andSelf().each(function() { - var selectee = $.data(this, "selectable-item"); - if (selectee) { - var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); - selectee.$element - .removeClass(doSelect ? "ui-unselecting" : "ui-selected") - .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); - selectee.unselecting = !doSelect; - selectee.selecting = doSelect; - selectee.selected = doSelect; - // selectable (UN)SELECTING callback - if (doSelect) { - that._trigger("selecting", event, { - selecting: selectee.element - }); - } else { - that._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - return false; - } - }); - - }, - - _mouseDrag: function(event) { - var that = this; - this.dragged = true; - - if (this.options.disabled) - return; - - var options = this.options; - - var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; - if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } - if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } - this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); - - this.selectees.each(function() { - var selectee = $.data(this, "selectable-item"); - //prevent helper from being selected if appendTo: selectable - if (!selectee || selectee.element == that.element[0]) - return; - var hit = false; - if (options.tolerance == 'touch') { - hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); - } else if (options.tolerance == 'fit') { - hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); - } - - if (hit) { - // SELECT - if (selectee.selected) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - } - if (selectee.unselecting) { - selectee.$element.removeClass('ui-unselecting'); - selectee.unselecting = false; - } - if (!selectee.selecting) { - selectee.$element.addClass('ui-selecting'); - selectee.selecting = true; - // selectable SELECTING callback - that._trigger("selecting", event, { - selecting: selectee.element - }); - } - } else { - // UNSELECT - if (selectee.selecting) { - if ((event.metaKey || event.ctrlKey) && selectee.startselected) { - selectee.$element.removeClass('ui-selecting'); - selectee.selecting = false; - selectee.$element.addClass('ui-selected'); - selectee.selected = true; - } else { - selectee.$element.removeClass('ui-selecting'); - selectee.selecting = false; - if (selectee.startselected) { - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - } - // selectable UNSELECTING callback - that._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - } - if (selectee.selected) { - if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { - selectee.$element.removeClass('ui-selected'); - selectee.selected = false; - - selectee.$element.addClass('ui-unselecting'); - selectee.unselecting = true; - // selectable UNSELECTING callback - that._trigger("unselecting", event, { - unselecting: selectee.element - }); - } - } - } - }); - - return false; - }, - - _mouseStop: function(event) { - var that = this; - - this.dragged = false; - - var options = this.options; - - $('.ui-unselecting', this.element[0]).each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.$element.removeClass('ui-unselecting'); - selectee.unselecting = false; - selectee.startselected = false; - that._trigger("unselected", event, { - unselected: selectee.element - }); - }); - $('.ui-selecting', this.element[0]).each(function() { - var selectee = $.data(this, "selectable-item"); - selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); - selectee.selecting = false; - selectee.selected = true; - selectee.startselected = true; - that._trigger("selected", event, { - selected: selectee.element - }); - }); - this._trigger("stop", event); - - this.helper.remove(); - - return false; - } - -}); - -})(jQuery); -(function( $, undefined ) { - -// number of pages in a slider -// (how many times can you page up/down to go through the whole range) -var numPages = 5; - -$.widget( "ui.slider", $.ui.mouse, { - version: "1.9.2", - widgetEventPrefix: "slide", - - options: { - animate: false, - distance: 0, - max: 100, - min: 0, - orientation: "horizontal", - range: false, - step: 1, - value: 0, - values: null - }, - - _create: function() { - var i, handleCount, - o = this.options, - existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), - handle = "", - handles = []; - - this._keySliding = false; - this._mouseSliding = false; - this._animateOff = true; - this._handleIndex = null; - this._detectOrientation(); - this._mouseInit(); - - this.element - .addClass( "ui-slider" + - " ui-slider-" + this.orientation + - " ui-widget" + - " ui-widget-content" + - " ui-corner-all" + - ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) ); - - this.range = $([]); - - if ( o.range ) { - if ( o.range === true ) { - if ( !o.values ) { - o.values = [ this._valueMin(), this._valueMin() ]; - } - if ( o.values.length && o.values.length !== 2 ) { - o.values = [ o.values[0], o.values[0] ]; - } - } - - this.range = $( "
      " ) - .appendTo( this.element ) - .addClass( "ui-slider-range" + - // note: this isn't the most fittingly semantic framework class for this element, - // but worked best visually with a variety of themes - " ui-widget-header" + - ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); - } - - handleCount = ( o.values && o.values.length ) || 1; - - for ( i = existingHandles.length; i < handleCount; i++ ) { - handles.push( handle ); - } - - this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) ); - - this.handle = this.handles.eq( 0 ); - - this.handles.add( this.range ).filter( "a" ) - .click(function( event ) { - event.preventDefault(); - }) - .mouseenter(function() { - if ( !o.disabled ) { - $( this ).addClass( "ui-state-hover" ); - } - }) - .mouseleave(function() { - $( this ).removeClass( "ui-state-hover" ); - }) - .focus(function() { - if ( !o.disabled ) { - $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" ); - $( this ).addClass( "ui-state-focus" ); - } else { - $( this ).blur(); - } - }) - .blur(function() { - $( this ).removeClass( "ui-state-focus" ); - }); - - this.handles.each(function( i ) { - $( this ).data( "ui-slider-handle-index", i ); - }); - - this._on( this.handles, { - keydown: function( event ) { - var allowed, curVal, newVal, step, - index = $( event.target ).data( "ui-slider-handle-index" ); - - switch ( event.keyCode ) { - case $.ui.keyCode.HOME: - case $.ui.keyCode.END: - case $.ui.keyCode.PAGE_UP: - case $.ui.keyCode.PAGE_DOWN: - case $.ui.keyCode.UP: - case $.ui.keyCode.RIGHT: - case $.ui.keyCode.DOWN: - case $.ui.keyCode.LEFT: - event.preventDefault(); - if ( !this._keySliding ) { - this._keySliding = true; - $( event.target ).addClass( "ui-state-active" ); - allowed = this._start( event, index ); - if ( allowed === false ) { - return; - } - } - break; - } - - step = this.options.step; - if ( this.options.values && this.options.values.length ) { - curVal = newVal = this.values( index ); - } else { - curVal = newVal = this.value(); - } - - switch ( event.keyCode ) { - case $.ui.keyCode.HOME: - newVal = this._valueMin(); - break; - case $.ui.keyCode.END: - newVal = this._valueMax(); - break; - case $.ui.keyCode.PAGE_UP: - newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) ); - break; - case $.ui.keyCode.PAGE_DOWN: - newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) ); - break; - case $.ui.keyCode.UP: - case $.ui.keyCode.RIGHT: - if ( curVal === this._valueMax() ) { - return; - } - newVal = this._trimAlignValue( curVal + step ); - break; - case $.ui.keyCode.DOWN: - case $.ui.keyCode.LEFT: - if ( curVal === this._valueMin() ) { - return; - } - newVal = this._trimAlignValue( curVal - step ); - break; - } - - this._slide( event, index, newVal ); - }, - keyup: function( event ) { - var index = $( event.target ).data( "ui-slider-handle-index" ); - - if ( this._keySliding ) { - this._keySliding = false; - this._stop( event, index ); - this._change( event, index ); - $( event.target ).removeClass( "ui-state-active" ); - } - } - }); - - this._refreshValue(); - - this._animateOff = false; - }, - - _destroy: function() { - this.handles.remove(); - this.range.remove(); - - this.element - .removeClass( "ui-slider" + - " ui-slider-horizontal" + - " ui-slider-vertical" + - " ui-slider-disabled" + - " ui-widget" + - " ui-widget-content" + - " ui-corner-all" ); - - this._mouseDestroy(); - }, - - _mouseCapture: function( event ) { - var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle, - that = this, - o = this.options; - - if ( o.disabled ) { - return false; - } - - this.elementSize = { - width: this.element.outerWidth(), - height: this.element.outerHeight() - }; - this.elementOffset = this.element.offset(); - - position = { x: event.pageX, y: event.pageY }; - normValue = this._normValueFromMouse( position ); - distance = this._valueMax() - this._valueMin() + 1; - this.handles.each(function( i ) { - var thisDistance = Math.abs( normValue - that.values(i) ); - if ( distance > thisDistance ) { - distance = thisDistance; - closestHandle = $( this ); - index = i; - } - }); - - // workaround for bug #3736 (if both handles of a range are at 0, - // the first is always used as the one with least distance, - // and moving it is obviously prevented by preventing negative ranges) - if( o.range === true && this.values(1) === o.min ) { - index += 1; - closestHandle = $( this.handles[index] ); - } - - allowed = this._start( event, index ); - if ( allowed === false ) { - return false; - } - this._mouseSliding = true; - - this._handleIndex = index; - - closestHandle - .addClass( "ui-state-active" ) - .focus(); - - offset = closestHandle.offset(); - mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" ); - this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { - left: event.pageX - offset.left - ( closestHandle.width() / 2 ), - top: event.pageY - offset.top - - ( closestHandle.height() / 2 ) - - ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - - ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + - ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) - }; - - if ( !this.handles.hasClass( "ui-state-hover" ) ) { - this._slide( event, index, normValue ); - } - this._animateOff = true; - return true; - }, - - _mouseStart: function() { - return true; - }, - - _mouseDrag: function( event ) { - var position = { x: event.pageX, y: event.pageY }, - normValue = this._normValueFromMouse( position ); - - this._slide( event, this._handleIndex, normValue ); - - return false; - }, - - _mouseStop: function( event ) { - this.handles.removeClass( "ui-state-active" ); - this._mouseSliding = false; - - this._stop( event, this._handleIndex ); - this._change( event, this._handleIndex ); - - this._handleIndex = null; - this._clickOffset = null; - this._animateOff = false; - - return false; - }, - - _detectOrientation: function() { - this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; - }, - - _normValueFromMouse: function( position ) { - var pixelTotal, - pixelMouse, - percentMouse, - valueTotal, - valueMouse; - - if ( this.orientation === "horizontal" ) { - pixelTotal = this.elementSize.width; - pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); - } else { - pixelTotal = this.elementSize.height; - pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); - } - - percentMouse = ( pixelMouse / pixelTotal ); - if ( percentMouse > 1 ) { - percentMouse = 1; - } - if ( percentMouse < 0 ) { - percentMouse = 0; - } - if ( this.orientation === "vertical" ) { - percentMouse = 1 - percentMouse; - } - - valueTotal = this._valueMax() - this._valueMin(); - valueMouse = this._valueMin() + percentMouse * valueTotal; - - return this._trimAlignValue( valueMouse ); - }, - - _start: function( event, index ) { - var uiHash = { - handle: this.handles[ index ], - value: this.value() - }; - if ( this.options.values && this.options.values.length ) { - uiHash.value = this.values( index ); - uiHash.values = this.values(); - } - return this._trigger( "start", event, uiHash ); - }, - - _slide: function( event, index, newVal ) { - var otherVal, - newValues, - allowed; - - if ( this.options.values && this.options.values.length ) { - otherVal = this.values( index ? 0 : 1 ); - - if ( ( this.options.values.length === 2 && this.options.range === true ) && - ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) - ) { - newVal = otherVal; - } - - if ( newVal !== this.values( index ) ) { - newValues = this.values(); - newValues[ index ] = newVal; - // A slide can be canceled by returning false from the slide callback - allowed = this._trigger( "slide", event, { - handle: this.handles[ index ], - value: newVal, - values: newValues - } ); - otherVal = this.values( index ? 0 : 1 ); - if ( allowed !== false ) { - this.values( index, newVal, true ); - } - } - } else { - if ( newVal !== this.value() ) { - // A slide can be canceled by returning false from the slide callback - allowed = this._trigger( "slide", event, { - handle: this.handles[ index ], - value: newVal - } ); - if ( allowed !== false ) { - this.value( newVal ); - } - } - } - }, - - _stop: function( event, index ) { - var uiHash = { - handle: this.handles[ index ], - value: this.value() - }; - if ( this.options.values && this.options.values.length ) { - uiHash.value = this.values( index ); - uiHash.values = this.values(); - } - - this._trigger( "stop", event, uiHash ); - }, - - _change: function( event, index ) { - if ( !this._keySliding && !this._mouseSliding ) { - var uiHash = { - handle: this.handles[ index ], - value: this.value() - }; - if ( this.options.values && this.options.values.length ) { - uiHash.value = this.values( index ); - uiHash.values = this.values(); - } - - this._trigger( "change", event, uiHash ); - } - }, - - value: function( newValue ) { - if ( arguments.length ) { - this.options.value = this._trimAlignValue( newValue ); - this._refreshValue(); - this._change( null, 0 ); - return; - } - - return this._value(); - }, - - values: function( index, newValue ) { - var vals, - newValues, - i; - - if ( arguments.length > 1 ) { - this.options.values[ index ] = this._trimAlignValue( newValue ); - this._refreshValue(); - this._change( null, index ); - return; - } - - if ( arguments.length ) { - if ( $.isArray( arguments[ 0 ] ) ) { - vals = this.options.values; - newValues = arguments[ 0 ]; - for ( i = 0; i < vals.length; i += 1 ) { - vals[ i ] = this._trimAlignValue( newValues[ i ] ); - this._change( null, i ); - } - this._refreshValue(); - } else { - if ( this.options.values && this.options.values.length ) { - return this._values( index ); - } else { - return this.value(); - } - } - } else { - return this._values(); - } - }, - - _setOption: function( key, value ) { - var i, - valsLength = 0; - - if ( $.isArray( this.options.values ) ) { - valsLength = this.options.values.length; - } - - $.Widget.prototype._setOption.apply( this, arguments ); - - switch ( key ) { - case "disabled": - if ( value ) { - this.handles.filter( ".ui-state-focus" ).blur(); - this.handles.removeClass( "ui-state-hover" ); - this.handles.prop( "disabled", true ); - this.element.addClass( "ui-disabled" ); - } else { - this.handles.prop( "disabled", false ); - this.element.removeClass( "ui-disabled" ); - } - break; - case "orientation": - this._detectOrientation(); - this.element - .removeClass( "ui-slider-horizontal ui-slider-vertical" ) - .addClass( "ui-slider-" + this.orientation ); - this._refreshValue(); - break; - case "value": - this._animateOff = true; - this._refreshValue(); - this._change( null, 0 ); - this._animateOff = false; - break; - case "values": - this._animateOff = true; - this._refreshValue(); - for ( i = 0; i < valsLength; i += 1 ) { - this._change( null, i ); - } - this._animateOff = false; - break; - case "min": - case "max": - this._animateOff = true; - this._refreshValue(); - this._animateOff = false; - break; - } - }, - - //internal value getter - // _value() returns value trimmed by min and max, aligned by step - _value: function() { - var val = this.options.value; - val = this._trimAlignValue( val ); - - return val; - }, - - //internal values getter - // _values() returns array of values trimmed by min and max, aligned by step - // _values( index ) returns single value trimmed by min and max, aligned by step - _values: function( index ) { - var val, - vals, - i; - - if ( arguments.length ) { - val = this.options.values[ index ]; - val = this._trimAlignValue( val ); - - return val; - } else { - // .slice() creates a copy of the array - // this copy gets trimmed by min and max and then returned - vals = this.options.values.slice(); - for ( i = 0; i < vals.length; i+= 1) { - vals[ i ] = this._trimAlignValue( vals[ i ] ); - } - - return vals; - } - }, - - // returns the step-aligned value that val is closest to, between (inclusive) min and max - _trimAlignValue: function( val ) { - if ( val <= this._valueMin() ) { - return this._valueMin(); - } - if ( val >= this._valueMax() ) { - return this._valueMax(); - } - var step = ( this.options.step > 0 ) ? this.options.step : 1, - valModStep = (val - this._valueMin()) % step, - alignValue = val - valModStep; - - if ( Math.abs(valModStep) * 2 >= step ) { - alignValue += ( valModStep > 0 ) ? step : ( -step ); - } - - // Since JavaScript has problems with large floats, round - // the final value to 5 digits after the decimal point (see #4124) - return parseFloat( alignValue.toFixed(5) ); - }, - - _valueMin: function() { - return this.options.min; - }, - - _valueMax: function() { - return this.options.max; - }, - - _refreshValue: function() { - var lastValPercent, valPercent, value, valueMin, valueMax, - oRange = this.options.range, - o = this.options, - that = this, - animate = ( !this._animateOff ) ? o.animate : false, - _set = {}; - - if ( this.options.values && this.options.values.length ) { - this.handles.each(function( i ) { - valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100; - _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; - $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); - if ( that.options.range === true ) { - if ( that.orientation === "horizontal" ) { - if ( i === 0 ) { - that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); - } - if ( i === 1 ) { - that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - } else { - if ( i === 0 ) { - that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); - } - if ( i === 1 ) { - that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - } - } - lastValPercent = valPercent; - }); - } else { - value = this.value(); - valueMin = this._valueMin(); - valueMax = this._valueMax(); - valPercent = ( valueMax !== valueMin ) ? - ( value - valueMin ) / ( valueMax - valueMin ) * 100 : - 0; - _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; - this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); - - if ( oRange === "min" && this.orientation === "horizontal" ) { - this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); - } - if ( oRange === "max" && this.orientation === "horizontal" ) { - this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - if ( oRange === "min" && this.orientation === "vertical" ) { - this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); - } - if ( oRange === "max" && this.orientation === "vertical" ) { - this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); - } - } - } - -}); - -}(jQuery)); -(function( $, undefined ) { - -$.widget("ui.sortable", $.ui.mouse, { - version: "1.9.2", - widgetEventPrefix: "sort", - ready: false, - options: { - appendTo: "parent", - axis: false, - connectWith: false, - containment: false, - cursor: 'auto', - cursorAt: false, - dropOnEmpty: true, - forcePlaceholderSize: false, - forceHelperSize: false, - grid: false, - handle: false, - helper: "original", - items: '> *', - opacity: false, - placeholder: false, - revert: false, - scroll: true, - scrollSensitivity: 20, - scrollSpeed: 20, - scope: "default", - tolerance: "intersect", - zIndex: 1000 - }, - _create: function() { - - var o = this.options; - this.containerCache = {}; - this.element.addClass("ui-sortable"); - - //Get the items - this.refresh(); - - //Let's determine if the items are being displayed horizontally - this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false; - - //Let's determine the parent's offset - this.offset = this.element.offset(); - - //Initialize mouse events for interaction - this._mouseInit(); - - //We're ready to go - this.ready = true - - }, - - _destroy: function() { - this.element - .removeClass("ui-sortable ui-sortable-disabled"); - this._mouseDestroy(); - - for ( var i = this.items.length - 1; i >= 0; i-- ) - this.items[i].item.removeData(this.widgetName + "-item"); - - return this; - }, - - _setOption: function(key, value){ - if ( key === "disabled" ) { - this.options[ key ] = value; - - this.widget().toggleClass( "ui-sortable-disabled", !!value ); - } else { - // Don't call widget base _setOption for disable as it adds ui-state-disabled class - $.Widget.prototype._setOption.apply(this, arguments); - } - }, - - _mouseCapture: function(event, overrideHandle) { - var that = this; - - if (this.reverting) { - return false; - } - - if(this.options.disabled || this.options.type == 'static') return false; - - //We have to refresh the items data once first - this._refreshItems(event); - - //Find out if the clicked node (or one of its parents) is a actual item in this.items - var currentItem = null, nodes = $(event.target).parents().each(function() { - if($.data(this, that.widgetName + '-item') == that) { - currentItem = $(this); - return false; - } - }); - if($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target); - - if(!currentItem) return false; - if(this.options.handle && !overrideHandle) { - var validHandle = false; - - $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; }); - if(!validHandle) return false; - } - - this.currentItem = currentItem; - this._removeCurrentsFromItems(); - return true; - - }, - - _mouseStart: function(event, overrideHandle, noActivation) { - - var o = this.options; - this.currentContainer = this; - - //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture - this.refreshPositions(); - - //Create and append the visible helper - this.helper = this._createHelper(event); - - //Cache the helper size - this._cacheHelperProportions(); - - /* - * - Position generation - - * This block generates everything position related - it's the core of draggables. - */ - - //Cache the margins of the original element - this._cacheMargins(); - - //Get the next scrolling parent - this.scrollParent = this.helper.scrollParent(); - - //The element's absolute position on the page minus margins - this.offset = this.currentItem.offset(); - this.offset = { - top: this.offset.top - this.margins.top, - left: this.offset.left - this.margins.left - }; - - $.extend(this.offset, { - click: { //Where the click happened, relative to the element - left: event.pageX - this.offset.left, - top: event.pageY - this.offset.top - }, - parent: this._getParentOffset(), - relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper - }); - - // Only after we got the offset, we can change the helper's position to absolute - // TODO: Still need to figure out a way to make relative sorting possible - this.helper.css("position", "absolute"); - this.cssPosition = this.helper.css("position"); - - //Generate the original position - this.originalPosition = this._generatePosition(event); - this.originalPageX = event.pageX; - this.originalPageY = event.pageY; - - //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied - (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); - - //Cache the former DOM position - this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; - - //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way - if(this.helper[0] != this.currentItem[0]) { - this.currentItem.hide(); - } - - //Create the placeholder - this._createPlaceholder(); - - //Set a containment if given in the options - if(o.containment) - this._setContainment(); - - if(o.cursor) { // cursor option - if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); - $('body').css("cursor", o.cursor); - } - - if(o.opacity) { // opacity option - if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); - this.helper.css("opacity", o.opacity); - } - - if(o.zIndex) { // zIndex option - if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); - this.helper.css("zIndex", o.zIndex); - } - - //Prepare scrolling - if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') - this.overflowOffset = this.scrollParent.offset(); - - //Call callbacks - this._trigger("start", event, this._uiHash()); - - //Recache the helper size - if(!this._preserveHelperProportions) - this._cacheHelperProportions(); - - - //Post 'activate' events to possible containers - if(!noActivation) { - for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, this._uiHash(this)); } - } - - //Prepare possible droppables - if($.ui.ddmanager) - $.ui.ddmanager.current = this; - - if ($.ui.ddmanager && !o.dropBehaviour) - $.ui.ddmanager.prepareOffsets(this, event); - - this.dragging = true; - - this.helper.addClass("ui-sortable-helper"); - this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position - return true; - - }, - - _mouseDrag: function(event) { - - //Compute the helpers position - this.position = this._generatePosition(event); - this.positionAbs = this._convertPositionTo("absolute"); - - if (!this.lastPositionAbs) { - this.lastPositionAbs = this.positionAbs; - } - - //Do scrolling - if(this.options.scroll) { - var o = this.options, scrolled = false; - if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { - - if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) - this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; - else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) - this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; - - if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) - this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; - else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) - this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; - - } else { - - if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) - scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); - else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) - scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); - - if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) - scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); - else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) - scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); - - } - - if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) - $.ui.ddmanager.prepareOffsets(this, event); - } - - //Regenerate the absolute position used for position checks - this.positionAbs = this._convertPositionTo("absolute"); - - //Set the helper position - if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; - if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; - - //Rearrange - for (var i = this.items.length - 1; i >= 0; i--) { - - //Cache variables and intersection, continue if no intersection - var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); - if (!intersection) continue; - - // Only put the placeholder inside the current Container, skip all - // items form other containers. This works because when moving - // an item from one container to another the - // currentContainer is switched before the placeholder is moved. - // - // Without this moving items in "sub-sortables" can cause the placeholder to jitter - // beetween the outer and inner container. - if (item.instance !== this.currentContainer) continue; - - if (itemElement != this.currentItem[0] //cannot intersect with itself - && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before - && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked - && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true) - //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container - ) { - - this.direction = intersection == 1 ? "down" : "up"; - - if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { - this._rearrange(event, item); - } else { - break; - } - - this._trigger("change", event, this._uiHash()); - break; - } - } - - //Post events to containers - this._contactContainers(event); - - //Interconnect with droppables - if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); - - //Call callbacks - this._trigger('sort', event, this._uiHash()); - - this.lastPositionAbs = this.positionAbs; - return false; - - }, - - _mouseStop: function(event, noPropagation) { - - if(!event) return; - - //If we are using droppables, inform the manager about the drop - if ($.ui.ddmanager && !this.options.dropBehaviour) - $.ui.ddmanager.drop(this, event); - - if(this.options.revert) { - var that = this; - var cur = this.placeholder.offset(); - - this.reverting = true; - - $(this.helper).animate({ - left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), - top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) - }, parseInt(this.options.revert, 10) || 500, function() { - that._clear(event); - }); - } else { - this._clear(event, noPropagation); - } - - return false; - - }, - - cancel: function() { - - if(this.dragging) { - - this._mouseUp({ target: null }); - - if(this.options.helper == "original") - this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); - else - this.currentItem.show(); - - //Post deactivating events to containers - for (var i = this.containers.length - 1; i >= 0; i--){ - this.containers[i]._trigger("deactivate", null, this._uiHash(this)); - if(this.containers[i].containerCache.over) { - this.containers[i]._trigger("out", null, this._uiHash(this)); - this.containers[i].containerCache.over = 0; - } - } - - } - - if (this.placeholder) { - //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! - if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); - if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); - - $.extend(this, { - helper: null, - dragging: false, - reverting: false, - _noFinalSort: null - }); - - if(this.domPosition.prev) { - $(this.domPosition.prev).after(this.currentItem); - } else { - $(this.domPosition.parent).prepend(this.currentItem); - } - } - - return this; - - }, - - serialize: function(o) { - - var items = this._getItemsAsjQuery(o && o.connected); - var str = []; o = o || {}; - - $(items).each(function() { - var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); - if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); - }); - - if(!str.length && o.key) { - str.push(o.key + '='); - } - - return str.join('&'); - - }, - - toArray: function(o) { - - var items = this._getItemsAsjQuery(o && o.connected); - var ret = []; o = o || {}; - - items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); }); - return ret; - - }, - - /* Be careful with the following core functions */ - _intersectsWith: function(item) { - - var x1 = this.positionAbs.left, - x2 = x1 + this.helperProportions.width, - y1 = this.positionAbs.top, - y2 = y1 + this.helperProportions.height; - - var l = item.left, - r = l + item.width, - t = item.top, - b = t + item.height; - - var dyClick = this.offset.click.top, - dxClick = this.offset.click.left; - - var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; - - if( this.options.tolerance == "pointer" - || this.options.forcePointerForContainers - || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) - ) { - return isOverElement; - } else { - - return (l < x1 + (this.helperProportions.width / 2) // Right Half - && x2 - (this.helperProportions.width / 2) < r // Left Half - && t < y1 + (this.helperProportions.height / 2) // Bottom Half - && y2 - (this.helperProportions.height / 2) < b ); // Top Half - - } - }, - - _intersectsWithPointer: function(item) { - - var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), - isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), - isOverElement = isOverElementHeight && isOverElementWidth, - verticalDirection = this._getDragVerticalDirection(), - horizontalDirection = this._getDragHorizontalDirection(); - - if (!isOverElement) - return false; - - return this.floating ? - ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 ) - : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) ); - - }, - - _intersectsWithSides: function(item) { - - var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), - isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), - verticalDirection = this._getDragVerticalDirection(), - horizontalDirection = this._getDragHorizontalDirection(); - - if (this.floating && horizontalDirection) { - return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf)); - } else { - return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf)); - } - - }, - - _getDragVerticalDirection: function() { - var delta = this.positionAbs.top - this.lastPositionAbs.top; - return delta != 0 && (delta > 0 ? "down" : "up"); - }, - - _getDragHorizontalDirection: function() { - var delta = this.positionAbs.left - this.lastPositionAbs.left; - return delta != 0 && (delta > 0 ? "right" : "left"); - }, - - refresh: function(event) { - this._refreshItems(event); - this.refreshPositions(); - return this; - }, - - _connectWith: function() { - var options = this.options; - return options.connectWith.constructor == String - ? [options.connectWith] - : options.connectWith; - }, - - _getItemsAsjQuery: function(connected) { - - var items = []; - var queries = []; - var connectWith = this._connectWith(); - - if(connectWith && connected) { - for (var i = connectWith.length - 1; i >= 0; i--){ - var cur = $(connectWith[i]); - for (var j = cur.length - 1; j >= 0; j--){ - var inst = $.data(cur[j], this.widgetName); - if(inst && inst != this && !inst.options.disabled) { - queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); - } - }; - }; - } - - queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); - - for (var i = queries.length - 1; i >= 0; i--){ - queries[i][0].each(function() { - items.push(this); - }); - }; - - return $(items); - - }, - - _removeCurrentsFromItems: function() { - - var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); - - this.items = $.grep(this.items, function (item) { - for (var j=0; j < list.length; j++) { - if(list[j] == item.item[0]) - return false; - }; - return true; - }); - - }, - - _refreshItems: function(event) { - - this.items = []; - this.containers = [this]; - var items = this.items; - var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; - var connectWith = this._connectWith(); - - if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down - for (var i = connectWith.length - 1; i >= 0; i--){ - var cur = $(connectWith[i]); - for (var j = cur.length - 1; j >= 0; j--){ - var inst = $.data(cur[j], this.widgetName); - if(inst && inst != this && !inst.options.disabled) { - queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); - this.containers.push(inst); - } - }; - }; - } - - for (var i = queries.length - 1; i >= 0; i--) { - var targetData = queries[i][1]; - var _queries = queries[i][0]; - - for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { - var item = $(_queries[j]); - - item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager) - - items.push({ - item: item, - instance: targetData, - width: 0, height: 0, - left: 0, top: 0 - }); - }; - }; - - }, - - refreshPositions: function(fast) { - - //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change - if(this.offsetParent && this.helper) { - this.offset.parent = this._getParentOffset(); - } - - for (var i = this.items.length - 1; i >= 0; i--){ - var item = this.items[i]; - - //We ignore calculating positions of all connected containers when we're not over them - if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0]) - continue; - - var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; - - if (!fast) { - item.width = t.outerWidth(); - item.height = t.outerHeight(); - } - - var p = t.offset(); - item.left = p.left; - item.top = p.top; - }; - - if(this.options.custom && this.options.custom.refreshContainers) { - this.options.custom.refreshContainers.call(this); - } else { - for (var i = this.containers.length - 1; i >= 0; i--){ - var p = this.containers[i].element.offset(); - this.containers[i].containerCache.left = p.left; - this.containers[i].containerCache.top = p.top; - this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); - this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); - }; - } - - return this; - }, - - _createPlaceholder: function(that) { - that = that || this; - var o = that.options; - - if(!o.placeholder || o.placeholder.constructor == String) { - var className = o.placeholder; - o.placeholder = { - element: function() { - - var el = $(document.createElement(that.currentItem[0].nodeName)) - .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder") - .removeClass("ui-sortable-helper")[0]; - - if(!className) - el.style.visibility = "hidden"; - - return el; - }, - update: function(container, p) { - - // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that - // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified - if(className && !o.forcePlaceholderSize) return; - - //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item - if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); }; - if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); }; - } - }; - } - - //Create the placeholder - that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); - - //Append it after the actual current item - that.currentItem.after(that.placeholder); - - //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) - o.placeholder.update(that, that.placeholder); - - }, - - _contactContainers: function(event) { - - // get innermost container that intersects with item - var innermostContainer = null, innermostIndex = null; - - - for (var i = this.containers.length - 1; i >= 0; i--){ - - // never consider a container that's located within the item itself - if($.contains(this.currentItem[0], this.containers[i].element[0])) - continue; - - if(this._intersectsWith(this.containers[i].containerCache)) { - - // if we've already found a container and it's more "inner" than this, then continue - if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) - continue; - - innermostContainer = this.containers[i]; - innermostIndex = i; - - } else { - // container doesn't intersect. trigger "out" event if necessary - if(this.containers[i].containerCache.over) { - this.containers[i]._trigger("out", event, this._uiHash(this)); - this.containers[i].containerCache.over = 0; - } - } - - } - - // if no intersecting containers found, return - if(!innermostContainer) return; - - // move the item into the container if it's not there already - if(this.containers.length === 1) { - this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); - this.containers[innermostIndex].containerCache.over = 1; - } else { - - //When entering a new container, we will find the item with the least distance and append our item near it - var dist = 10000; var itemWithLeastDistance = null; - var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top'; - var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height'; - var base = this.positionAbs[posProperty] + this.offset.click[posProperty]; - for (var j = this.items.length - 1; j >= 0; j--) { - if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; - if(this.items[j].item[0] == this.currentItem[0]) continue; - var cur = this.items[j].item.offset()[posProperty]; - var nearBottom = false; - if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){ - nearBottom = true; - cur += this.items[j][sizeProperty]; - } - - if(Math.abs(cur - base) < dist) { - dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; - this.direction = nearBottom ? "up": "down"; - } - } - - if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled - return; - - this.currentContainer = this.containers[innermostIndex]; - itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); - this._trigger("change", event, this._uiHash()); - this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); - - //Update the placeholder - this.options.placeholder.update(this.currentContainer, this.placeholder); - - this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); - this.containers[innermostIndex].containerCache.over = 1; - } - - - }, - - _createHelper: function(event) { - - var o = this.options; - var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem); - - if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already - $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); - - if(helper[0] == this.currentItem[0]) - this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; - - if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); - if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); - - return helper; - - }, - - _adjustOffsetFromHelper: function(obj) { - if (typeof obj == 'string') { - obj = obj.split(' '); - } - if ($.isArray(obj)) { - obj = {left: +obj[0], top: +obj[1] || 0}; - } - if ('left' in obj) { - this.offset.click.left = obj.left + this.margins.left; - } - if ('right' in obj) { - this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; - } - if ('top' in obj) { - this.offset.click.top = obj.top + this.margins.top; - } - if ('bottom' in obj) { - this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; - } - }, - - _getParentOffset: function() { - - - //Get the offsetParent and cache its position - this.offsetParent = this.helper.offsetParent(); - var po = this.offsetParent.offset(); - - // This is a special case where we need to modify a offset calculated on start, since the following happened: - // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent - // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that - // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag - if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) { - po.left += this.scrollParent.scrollLeft(); - po.top += this.scrollParent.scrollTop(); - } - - if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information - || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix - po = { top: 0, left: 0 }; - - return { - top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), - left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) - }; - - }, - - _getRelativeOffset: function() { - - if(this.cssPosition == "relative") { - var p = this.currentItem.position(); - return { - top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), - left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() - }; - } else { - return { top: 0, left: 0 }; - } - - }, - - _cacheMargins: function() { - this.margins = { - left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), - top: (parseInt(this.currentItem.css("marginTop"),10) || 0) - }; - }, - - _cacheHelperProportions: function() { - this.helperProportions = { - width: this.helper.outerWidth(), - height: this.helper.outerHeight() - }; - }, - - _setContainment: function() { - - var o = this.options; - if(o.containment == 'parent') o.containment = this.helper[0].parentNode; - if(o.containment == 'document' || o.containment == 'window') this.containment = [ - 0 - this.offset.relative.left - this.offset.parent.left, - 0 - this.offset.relative.top - this.offset.parent.top, - $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, - ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top - ]; - - if(!(/^(document|window|parent)$/).test(o.containment)) { - var ce = $(o.containment)[0]; - var co = $(o.containment).offset(); - var over = ($(ce).css("overflow") != 'hidden'); - - this.containment = [ - co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, - co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, - co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, - co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - ]; - } - - }, - - _convertPositionTo: function(d, pos) { - - if(!pos) pos = this.position; - var mod = d == "absolute" ? 1 : -1; - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); - - return { - top: ( - pos.top // The absolute mouse position - + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent - + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) - - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) - ), - left: ( - pos.left // The absolute mouse position - + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent - + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) - - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) - ) - }; - - }, - - _generatePosition: function(event) { - - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); - - // This is another very weird special case that only happens for relative elements: - // 1. If the css position is relative - // 2. and the scroll parent is the document or similar to the offset parent - // we have to refresh the relative offset during the scroll so there are no jumps - if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { - this.offset.relative = this._getRelativeOffset(); - } - - var pageX = event.pageX; - var pageY = event.pageY; - - /* - * - Position constraining - - * Constrain the position to a mix of grid, containment. - */ - - if(this.originalPosition) { //If we are not dragging yet, we won't check for options - - if(this.containment) { - if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; - if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; - if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; - if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; - } - - if(o.grid) { - var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; - pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; - - var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; - pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; - } - - } - - return { - top: ( - pageY // The absolute mouse position - - this.offset.click.top // Click offset (relative to the element) - - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent - - this.offset.parent.top // The offsetParent's offset without borders (offset + border) - + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) - ), - left: ( - pageX // The absolute mouse position - - this.offset.click.left // Click offset (relative to the element) - - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent - - this.offset.parent.left // The offsetParent's offset without borders (offset + border) - + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) - ) - }; - - }, - - _rearrange: function(event, i, a, hardRefresh) { - - a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); - - //Various things done here to improve the performance: - // 1. we create a setTimeout, that calls refreshPositions - // 2. on the instance, we have a counter variable, that get's higher after every append - // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same - // 4. this lets only the last addition to the timeout stack through - this.counter = this.counter ? ++this.counter : 1; - var counter = this.counter; - - this._delay(function() { - if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove - }); - - }, - - _clear: function(event, noPropagation) { - - this.reverting = false; - // We delay all events that have to be triggered to after the point where the placeholder has been removed and - // everything else normalized again - var delayedTriggers = []; - - // We first have to update the dom position of the actual currentItem - // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) - if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem); - this._noFinalSort = null; - - if(this.helper[0] == this.currentItem[0]) { - for(var i in this._storedCSS) { - if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = ''; - } - this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); - } else { - this.currentItem.show(); - } - - if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); - if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed - - // Check if the items Container has Changed and trigger appropriate - // events. - if (this !== this.currentContainer) { - if(!noPropagation) { - delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); - delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); - delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); - } - } - - - //Post events to containers - for (var i = this.containers.length - 1; i >= 0; i--){ - if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); - if(this.containers[i].containerCache.over) { - delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); - this.containers[i].containerCache.over = 0; - } - } - - //Do what was originally in plugins - if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor - if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity - if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index - - this.dragging = false; - if(this.cancelHelperRemoval) { - if(!noPropagation) { - this._trigger("beforeStop", event, this._uiHash()); - for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events - this._trigger("stop", event, this._uiHash()); - } - - this.fromOutside = false; - return false; - } - - if(!noPropagation) this._trigger("beforeStop", event, this._uiHash()); - - //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! - this.placeholder[0].parentNode.removeChild(this.placeholder[0]); - - if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; - - if(!noPropagation) { - for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events - this._trigger("stop", event, this._uiHash()); - } - - this.fromOutside = false; - return true; - - }, - - _trigger: function() { - if ($.Widget.prototype._trigger.apply(this, arguments) === false) { - this.cancel(); - } - }, - - _uiHash: function(_inst) { - var inst = _inst || this; - return { - helper: inst.helper, - placeholder: inst.placeholder || $([]), - position: inst.position, - originalPosition: inst.originalPosition, - offset: inst.positionAbs, - item: inst.currentItem, - sender: _inst ? _inst.element : null - }; - } - -}); - -})(jQuery); -(function( $ ) { - -function modifier( fn ) { - return function() { - var previous = this.element.val(); - fn.apply( this, arguments ); - this._refresh(); - if ( previous !== this.element.val() ) { - this._trigger( "change" ); - } - }; -} - -$.widget( "ui.spinner", { - version: "1.9.2", - defaultElement: "", - widgetEventPrefix: "spin", - options: { - culture: null, - icons: { - down: "ui-icon-triangle-1-s", - up: "ui-icon-triangle-1-n" - }, - incremental: true, - max: null, - min: null, - numberFormat: null, - page: 10, - step: 1, - - change: null, - spin: null, - start: null, - stop: null - }, - - _create: function() { - // handle string values that need to be parsed - this._setOption( "max", this.options.max ); - this._setOption( "min", this.options.min ); - this._setOption( "step", this.options.step ); - - // format the value, but don't constrain - this._value( this.element.val(), true ); - - this._draw(); - this._on( this._events ); - this._refresh(); - - // turning off autocomplete prevents the browser from remembering the - // value when navigating through history, so we re-enable autocomplete - // if the page is unloaded before the widget is destroyed. #7790 - this._on( this.window, { - beforeunload: function() { - this.element.removeAttr( "autocomplete" ); - } - }); - }, - - _getCreateOptions: function() { - var options = {}, - element = this.element; - - $.each( [ "min", "max", "step" ], function( i, option ) { - var value = element.attr( option ); - if ( value !== undefined && value.length ) { - options[ option ] = value; - } - }); - - return options; - }, - - _events: { - keydown: function( event ) { - if ( this._start( event ) && this._keydown( event ) ) { - event.preventDefault(); - } - }, - keyup: "_stop", - focus: function() { - this.previous = this.element.val(); - }, - blur: function( event ) { - if ( this.cancelBlur ) { - delete this.cancelBlur; - return; - } - - this._refresh(); - if ( this.previous !== this.element.val() ) { - this._trigger( "change", event ); - } - }, - mousewheel: function( event, delta ) { - if ( !delta ) { - return; - } - if ( !this.spinning && !this._start( event ) ) { - return false; - } - - this._spin( (delta > 0 ? 1 : -1) * this.options.step, event ); - clearTimeout( this.mousewheelTimer ); - this.mousewheelTimer = this._delay(function() { - if ( this.spinning ) { - this._stop( event ); - } - }, 100 ); - event.preventDefault(); - }, - "mousedown .ui-spinner-button": function( event ) { - var previous; - - // We never want the buttons to have focus; whenever the user is - // interacting with the spinner, the focus should be on the input. - // If the input is focused then this.previous is properly set from - // when the input first received focus. If the input is not focused - // then we need to set this.previous based on the value before spinning. - previous = this.element[0] === this.document[0].activeElement ? - this.previous : this.element.val(); - function checkFocus() { - var isActive = this.element[0] === this.document[0].activeElement; - if ( !isActive ) { - this.element.focus(); - this.previous = previous; - // support: IE - // IE sets focus asynchronously, so we need to check if focus - // moved off of the input because the user clicked on the button. - this._delay(function() { - this.previous = previous; - }); - } - } - - // ensure focus is on (or stays on) the text field - event.preventDefault(); - checkFocus.call( this ); - - // support: IE - // IE doesn't prevent moving focus even with event.preventDefault() - // so we set a flag to know when we should ignore the blur event - // and check (again) if focus moved off of the input. - this.cancelBlur = true; - this._delay(function() { - delete this.cancelBlur; - checkFocus.call( this ); - }); - - if ( this._start( event ) === false ) { - return; - } - - this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event ); - }, - "mouseup .ui-spinner-button": "_stop", - "mouseenter .ui-spinner-button": function( event ) { - // button will add ui-state-active if mouse was down while mouseleave and kept down - if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) { - return; - } - - if ( this._start( event ) === false ) { - return false; - } - this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event ); - }, - // TODO: do we really want to consider this a stop? - // shouldn't we just stop the repeater and wait until mouseup before - // we trigger the stop event? - "mouseleave .ui-spinner-button": "_stop" - }, - - _draw: function() { - var uiSpinner = this.uiSpinner = this.element - .addClass( "ui-spinner-input" ) - .attr( "autocomplete", "off" ) - .wrap( this._uiSpinnerHtml() ) - .parent() - // add buttons - .append( this._buttonHtml() ); - - this.element.attr( "role", "spinbutton" ); - - // button bindings - this.buttons = uiSpinner.find( ".ui-spinner-button" ) - .attr( "tabIndex", -1 ) - .button() - .removeClass( "ui-corner-all" ); - - // IE 6 doesn't understand height: 50% for the buttons - // unless the wrapper has an explicit height - if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) && - uiSpinner.height() > 0 ) { - uiSpinner.height( uiSpinner.height() ); - } - - // disable spinner if element was already disabled - if ( this.options.disabled ) { - this.disable(); - } - }, - - _keydown: function( event ) { - var options = this.options, - keyCode = $.ui.keyCode; - - switch ( event.keyCode ) { - case keyCode.UP: - this._repeat( null, 1, event ); - return true; - case keyCode.DOWN: - this._repeat( null, -1, event ); - return true; - case keyCode.PAGE_UP: - this._repeat( null, options.page, event ); - return true; - case keyCode.PAGE_DOWN: - this._repeat( null, -options.page, event ); - return true; - } - - return false; - }, - - _uiSpinnerHtml: function() { - return ""; - }, - - _buttonHtml: function() { - return "" + - "" + - "" + - "" + - "" + - "" + - ""; - }, - - _start: function( event ) { - if ( !this.spinning && this._trigger( "start", event ) === false ) { - return false; - } - - if ( !this.counter ) { - this.counter = 1; - } - this.spinning = true; - return true; - }, - - _repeat: function( i, steps, event ) { - i = i || 500; - - clearTimeout( this.timer ); - this.timer = this._delay(function() { - this._repeat( 40, steps, event ); - }, i ); - - this._spin( steps * this.options.step, event ); - }, - - _spin: function( step, event ) { - var value = this.value() || 0; - - if ( !this.counter ) { - this.counter = 1; - } - - value = this._adjustValue( value + step * this._increment( this.counter ) ); - - if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) { - this._value( value ); - this.counter++; - } - }, - - _increment: function( i ) { - var incremental = this.options.incremental; - - if ( incremental ) { - return $.isFunction( incremental ) ? - incremental( i ) : - Math.floor( i*i*i/50000 - i*i/500 + 17*i/200 + 1 ); - } - - return 1; - }, - - _precision: function() { - var precision = this._precisionOf( this.options.step ); - if ( this.options.min !== null ) { - precision = Math.max( precision, this._precisionOf( this.options.min ) ); - } - return precision; - }, - - _precisionOf: function( num ) { - var str = num.toString(), - decimal = str.indexOf( "." ); - return decimal === -1 ? 0 : str.length - decimal - 1; - }, - - _adjustValue: function( value ) { - var base, aboveMin, - options = this.options; - - // make sure we're at a valid step - // - find out where we are relative to the base (min or 0) - base = options.min !== null ? options.min : 0; - aboveMin = value - base; - // - round to the nearest step - aboveMin = Math.round(aboveMin / options.step) * options.step; - // - rounding is based on 0, so adjust back to our base - value = base + aboveMin; - - // fix precision from bad JS floating point math - value = parseFloat( value.toFixed( this._precision() ) ); - - // clamp the value - if ( options.max !== null && value > options.max) { - return options.max; - } - if ( options.min !== null && value < options.min ) { - return options.min; - } - - return value; - }, - - _stop: function( event ) { - if ( !this.spinning ) { - return; - } - - clearTimeout( this.timer ); - clearTimeout( this.mousewheelTimer ); - this.counter = 0; - this.spinning = false; - this._trigger( "stop", event ); - }, - - _setOption: function( key, value ) { - if ( key === "culture" || key === "numberFormat" ) { - var prevValue = this._parse( this.element.val() ); - this.options[ key ] = value; - this.element.val( this._format( prevValue ) ); - return; - } - - if ( key === "max" || key === "min" || key === "step" ) { - if ( typeof value === "string" ) { - value = this._parse( value ); - } - } - - this._super( key, value ); - - if ( key === "disabled" ) { - if ( value ) { - this.element.prop( "disabled", true ); - this.buttons.button( "disable" ); - } else { - this.element.prop( "disabled", false ); - this.buttons.button( "enable" ); - } - } - }, - - _setOptions: modifier(function( options ) { - this._super( options ); - this._value( this.element.val() ); - }), - - _parse: function( val ) { - if ( typeof val === "string" && val !== "" ) { - val = window.Globalize && this.options.numberFormat ? - Globalize.parseFloat( val, 10, this.options.culture ) : +val; - } - return val === "" || isNaN( val ) ? null : val; - }, - - _format: function( value ) { - if ( value === "" ) { - return ""; - } - return window.Globalize && this.options.numberFormat ? - Globalize.format( value, this.options.numberFormat, this.options.culture ) : - value; - }, - - _refresh: function() { - this.element.attr({ - "aria-valuemin": this.options.min, - "aria-valuemax": this.options.max, - // TODO: what should we do with values that can't be parsed? - "aria-valuenow": this._parse( this.element.val() ) - }); - }, - - // update the value without triggering change - _value: function( value, allowAny ) { - var parsed; - if ( value !== "" ) { - parsed = this._parse( value ); - if ( parsed !== null ) { - if ( !allowAny ) { - parsed = this._adjustValue( parsed ); - } - value = this._format( parsed ); - } - } - this.element.val( value ); - this._refresh(); - }, - - _destroy: function() { - this.element - .removeClass( "ui-spinner-input" ) - .prop( "disabled", false ) - .removeAttr( "autocomplete" ) - .removeAttr( "role" ) - .removeAttr( "aria-valuemin" ) - .removeAttr( "aria-valuemax" ) - .removeAttr( "aria-valuenow" ); - this.uiSpinner.replaceWith( this.element ); - }, - - stepUp: modifier(function( steps ) { - this._stepUp( steps ); - }), - _stepUp: function( steps ) { - this._spin( (steps || 1) * this.options.step ); - }, - - stepDown: modifier(function( steps ) { - this._stepDown( steps ); - }), - _stepDown: function( steps ) { - this._spin( (steps || 1) * -this.options.step ); - }, - - pageUp: modifier(function( pages ) { - this._stepUp( (pages || 1) * this.options.page ); - }), - - pageDown: modifier(function( pages ) { - this._stepDown( (pages || 1) * this.options.page ); - }), - - value: function( newVal ) { - if ( !arguments.length ) { - return this._parse( this.element.val() ); - } - modifier( this._value ).call( this, newVal ); - }, - - widget: function() { - return this.uiSpinner; - } -}); - -}( jQuery ) ); -(function( $, undefined ) { - -var tabId = 0, - rhash = /#.*$/; - -function getNextTabId() { - return ++tabId; -} - -function isLocal( anchor ) { - return anchor.hash.length > 1 && - anchor.href.replace( rhash, "" ) === - location.href.replace( rhash, "" ) - // support: Safari 5.1 - // Safari 5.1 doesn't encode spaces in window.location - // but it does encode spaces from anchors (#8777) - .replace( /\s/g, "%20" ); -} - -$.widget( "ui.tabs", { - version: "1.9.2", - delay: 300, - options: { - active: null, - collapsible: false, - event: "click", - heightStyle: "content", - hide: null, - show: null, - - // callbacks - activate: null, - beforeActivate: null, - beforeLoad: null, - load: null - }, - - _create: function() { - var that = this, - options = this.options, - active = options.active, - locationHash = location.hash.substring( 1 ); - - this.running = false; - - this.element - .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" ) - .toggleClass( "ui-tabs-collapsible", options.collapsible ) - // Prevent users from focusing disabled tabs via click - .delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) { - if ( $( this ).is( ".ui-state-disabled" ) ) { - event.preventDefault(); - } - }) - // support: IE <9 - // Preventing the default action in mousedown doesn't prevent IE - // from focusing the element, so if the anchor gets focused, blur. - // We don't have to worry about focusing the previously focused - // element since clicking on a non-focusable element should focus - // the body anyway. - .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() { - if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { - this.blur(); - } - }); - - this._processTabs(); - - if ( active === null ) { - // check the fragment identifier in the URL - if ( locationHash ) { - this.tabs.each(function( i, tab ) { - if ( $( tab ).attr( "aria-controls" ) === locationHash ) { - active = i; - return false; - } - }); - } - - // check for a tab marked active via a class - if ( active === null ) { - active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); - } - - // no active tab, set to false - if ( active === null || active === -1 ) { - active = this.tabs.length ? 0 : false; - } - } - - // handle numbers: negative, out of range - if ( active !== false ) { - active = this.tabs.index( this.tabs.eq( active ) ); - if ( active === -1 ) { - active = options.collapsible ? false : 0; - } - } - options.active = active; - - // don't allow collapsible: false and active: false - if ( !options.collapsible && options.active === false && this.anchors.length ) { - options.active = 0; - } - - // Take disabling tabs via class attribute from HTML - // into account and update option properly. - if ( $.isArray( options.disabled ) ) { - options.disabled = $.unique( options.disabled.concat( - $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { - return that.tabs.index( li ); - }) - ) ).sort(); - } - - // check for length avoids error when initializing empty list - if ( this.options.active !== false && this.anchors.length ) { - this.active = this._findActive( this.options.active ); - } else { - this.active = $(); - } - - this._refresh(); - - if ( this.active.length ) { - this.load( options.active ); - } - }, - - _getCreateEventData: function() { - return { - tab: this.active, - panel: !this.active.length ? $() : this._getPanelForTab( this.active ) - }; - }, - - _tabKeydown: function( event ) { - var focusedTab = $( this.document[0].activeElement ).closest( "li" ), - selectedIndex = this.tabs.index( focusedTab ), - goingForward = true; - - if ( this._handlePageNav( event ) ) { - return; - } - - switch ( event.keyCode ) { - case $.ui.keyCode.RIGHT: - case $.ui.keyCode.DOWN: - selectedIndex++; - break; - case $.ui.keyCode.UP: - case $.ui.keyCode.LEFT: - goingForward = false; - selectedIndex--; - break; - case $.ui.keyCode.END: - selectedIndex = this.anchors.length - 1; - break; - case $.ui.keyCode.HOME: - selectedIndex = 0; - break; - case $.ui.keyCode.SPACE: - // Activate only, no collapsing - event.preventDefault(); - clearTimeout( this.activating ); - this._activate( selectedIndex ); - return; - case $.ui.keyCode.ENTER: - // Toggle (cancel delayed activation, allow collapsing) - event.preventDefault(); - clearTimeout( this.activating ); - // Determine if we should collapse or activate - this._activate( selectedIndex === this.options.active ? false : selectedIndex ); - return; - default: - return; - } - - // Focus the appropriate tab, based on which key was pressed - event.preventDefault(); - clearTimeout( this.activating ); - selectedIndex = this._focusNextTab( selectedIndex, goingForward ); - - // Navigating with control key will prevent automatic activation - if ( !event.ctrlKey ) { - // Update aria-selected immediately so that AT think the tab is already selected. - // Otherwise AT may confuse the user by stating that they need to activate the tab, - // but the tab will already be activated by the time the announcement finishes. - focusedTab.attr( "aria-selected", "false" ); - this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" ); - - this.activating = this._delay(function() { - this.option( "active", selectedIndex ); - }, this.delay ); - } - }, - - _panelKeydown: function( event ) { - if ( this._handlePageNav( event ) ) { - return; - } - - // Ctrl+up moves focus to the current tab - if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) { - event.preventDefault(); - this.active.focus(); - } - }, - - // Alt+page up/down moves focus to the previous/next tab (and activates) - _handlePageNav: function( event ) { - if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) { - this._activate( this._focusNextTab( this.options.active - 1, false ) ); - return true; - } - if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) { - this._activate( this._focusNextTab( this.options.active + 1, true ) ); - return true; - } - }, - - _findNextTab: function( index, goingForward ) { - var lastTabIndex = this.tabs.length - 1; - - function constrain() { - if ( index > lastTabIndex ) { - index = 0; - } - if ( index < 0 ) { - index = lastTabIndex; - } - return index; - } - - while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) { - index = goingForward ? index + 1 : index - 1; - } - - return index; - }, - - _focusNextTab: function( index, goingForward ) { - index = this._findNextTab( index, goingForward ); - this.tabs.eq( index ).focus(); - return index; - }, - - _setOption: function( key, value ) { - if ( key === "active" ) { - // _activate() will handle invalid values and update this.options - this._activate( value ); - return; - } - - if ( key === "disabled" ) { - // don't use the widget factory's disabled handling - this._setupDisabled( value ); - return; - } - - this._super( key, value); - - if ( key === "collapsible" ) { - this.element.toggleClass( "ui-tabs-collapsible", value ); - // Setting collapsible: false while collapsed; open first panel - if ( !value && this.options.active === false ) { - this._activate( 0 ); - } - } - - if ( key === "event" ) { - this._setupEvents( value ); - } - - if ( key === "heightStyle" ) { - this._setupHeightStyle( value ); - } - }, - - _tabId: function( tab ) { - return tab.attr( "aria-controls" ) || "ui-tabs-" + getNextTabId(); - }, - - _sanitizeSelector: function( hash ) { - return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : ""; - }, - - refresh: function() { - var options = this.options, - lis = this.tablist.children( ":has(a[href])" ); - - // get disabled tabs from class attribute from HTML - // this will get converted to a boolean if needed in _refresh() - options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) { - return lis.index( tab ); - }); - - this._processTabs(); - - // was collapsed or no tabs - if ( options.active === false || !this.anchors.length ) { - options.active = false; - this.active = $(); - // was active, but active tab is gone - } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) { - // all remaining tabs are disabled - if ( this.tabs.length === options.disabled.length ) { - options.active = false; - this.active = $(); - // activate previous tab - } else { - this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) ); - } - // was active, active tab still exists - } else { - // make sure active index is correct - options.active = this.tabs.index( this.active ); - } - - this._refresh(); - }, - - _refresh: function() { - this._setupDisabled( this.options.disabled ); - this._setupEvents( this.options.event ); - this._setupHeightStyle( this.options.heightStyle ); - - this.tabs.not( this.active ).attr({ - "aria-selected": "false", - tabIndex: -1 - }); - this.panels.not( this._getPanelForTab( this.active ) ) - .hide() - .attr({ - "aria-expanded": "false", - "aria-hidden": "true" - }); - - // Make sure one tab is in the tab order - if ( !this.active.length ) { - this.tabs.eq( 0 ).attr( "tabIndex", 0 ); - } else { - this.active - .addClass( "ui-tabs-active ui-state-active" ) - .attr({ - "aria-selected": "true", - tabIndex: 0 - }); - this._getPanelForTab( this.active ) - .show() - .attr({ - "aria-expanded": "true", - "aria-hidden": "false" - }); - } - }, - - _processTabs: function() { - var that = this; - - this.tablist = this._getList() - .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) - .attr( "role", "tablist" ); - - this.tabs = this.tablist.find( "> li:has(a[href])" ) - .addClass( "ui-state-default ui-corner-top" ) - .attr({ - role: "tab", - tabIndex: -1 - }); - - this.anchors = this.tabs.map(function() { - return $( "a", this )[ 0 ]; - }) - .addClass( "ui-tabs-anchor" ) - .attr({ - role: "presentation", - tabIndex: -1 - }); - - this.panels = $(); - - this.anchors.each(function( i, anchor ) { - var selector, panel, panelId, - anchorId = $( anchor ).uniqueId().attr( "id" ), - tab = $( anchor ).closest( "li" ), - originalAriaControls = tab.attr( "aria-controls" ); - - // inline tab - if ( isLocal( anchor ) ) { - selector = anchor.hash; - panel = that.element.find( that._sanitizeSelector( selector ) ); - // remote tab - } else { - panelId = that._tabId( tab ); - selector = "#" + panelId; - panel = that.element.find( selector ); - if ( !panel.length ) { - panel = that._createPanel( panelId ); - panel.insertAfter( that.panels[ i - 1 ] || that.tablist ); - } - panel.attr( "aria-live", "polite" ); - } - - if ( panel.length) { - that.panels = that.panels.add( panel ); - } - if ( originalAriaControls ) { - tab.data( "ui-tabs-aria-controls", originalAriaControls ); - } - tab.attr({ - "aria-controls": selector.substring( 1 ), - "aria-labelledby": anchorId - }); - panel.attr( "aria-labelledby", anchorId ); - }); - - this.panels - .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) - .attr( "role", "tabpanel" ); - }, - - // allow overriding how to find the list for rare usage scenarios (#7715) - _getList: function() { - return this.element.find( "ol,ul" ).eq( 0 ); - }, - - _createPanel: function( id ) { - return $( "
      " ) - .attr( "id", id ) - .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) - .data( "ui-tabs-destroy", true ); - }, - - _setupDisabled: function( disabled ) { - if ( $.isArray( disabled ) ) { - if ( !disabled.length ) { - disabled = false; - } else if ( disabled.length === this.anchors.length ) { - disabled = true; - } - } - - // disable tabs - for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) { - if ( disabled === true || $.inArray( i, disabled ) !== -1 ) { - $( li ) - .addClass( "ui-state-disabled" ) - .attr( "aria-disabled", "true" ); - } else { - $( li ) - .removeClass( "ui-state-disabled" ) - .removeAttr( "aria-disabled" ); - } - } - - this.options.disabled = disabled; - }, - - _setupEvents: function( event ) { - var events = { - click: function( event ) { - event.preventDefault(); - } - }; - if ( event ) { - $.each( event.split(" "), function( index, eventName ) { - events[ eventName ] = "_eventHandler"; - }); - } - - this._off( this.anchors.add( this.tabs ).add( this.panels ) ); - this._on( this.anchors, events ); - this._on( this.tabs, { keydown: "_tabKeydown" } ); - this._on( this.panels, { keydown: "_panelKeydown" } ); - - this._focusable( this.tabs ); - this._hoverable( this.tabs ); - }, - - _setupHeightStyle: function( heightStyle ) { - var maxHeight, overflow, - parent = this.element.parent(); - - if ( heightStyle === "fill" ) { - // IE 6 treats height like minHeight, so we need to turn off overflow - // in order to get a reliable height - // we use the minHeight support test because we assume that only - // browsers that don't support minHeight will treat height as minHeight - if ( !$.support.minHeight ) { - overflow = parent.css( "overflow" ); - parent.css( "overflow", "hidden"); - } - maxHeight = parent.height(); - this.element.siblings( ":visible" ).each(function() { - var elem = $( this ), - position = elem.css( "position" ); - - if ( position === "absolute" || position === "fixed" ) { - return; - } - maxHeight -= elem.outerHeight( true ); - }); - if ( overflow ) { - parent.css( "overflow", overflow ); - } - - this.element.children().not( this.panels ).each(function() { - maxHeight -= $( this ).outerHeight( true ); - }); - - this.panels.each(function() { - $( this ).height( Math.max( 0, maxHeight - - $( this ).innerHeight() + $( this ).height() ) ); - }) - .css( "overflow", "auto" ); - } else if ( heightStyle === "auto" ) { - maxHeight = 0; - this.panels.each(function() { - maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); - }).height( maxHeight ); - } - }, - - _eventHandler: function( event ) { - var options = this.options, - active = this.active, - anchor = $( event.currentTarget ), - tab = anchor.closest( "li" ), - clickedIsActive = tab[ 0 ] === active[ 0 ], - collapsing = clickedIsActive && options.collapsible, - toShow = collapsing ? $() : this._getPanelForTab( tab ), - toHide = !active.length ? $() : this._getPanelForTab( active ), - eventData = { - oldTab: active, - oldPanel: toHide, - newTab: collapsing ? $() : tab, - newPanel: toShow - }; - - event.preventDefault(); - - if ( tab.hasClass( "ui-state-disabled" ) || - // tab is already loading - tab.hasClass( "ui-tabs-loading" ) || - // can't switch durning an animation - this.running || - // click on active header, but not collapsible - ( clickedIsActive && !options.collapsible ) || - // allow canceling activation - ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { - return; - } - - options.active = collapsing ? false : this.tabs.index( tab ); - - this.active = clickedIsActive ? $() : tab; - if ( this.xhr ) { - this.xhr.abort(); - } - - if ( !toHide.length && !toShow.length ) { - $.error( "jQuery UI Tabs: Mismatching fragment identifier." ); - } - - if ( toShow.length ) { - this.load( this.tabs.index( tab ), event ); - } - this._toggle( event, eventData ); - }, - - // handles show/hide for selecting tabs - _toggle: function( event, eventData ) { - var that = this, - toShow = eventData.newPanel, - toHide = eventData.oldPanel; - - this.running = true; - - function complete() { - that.running = false; - that._trigger( "activate", event, eventData ); - } - - function show() { - eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); - - if ( toShow.length && that.options.show ) { - that._show( toShow, that.options.show, complete ); - } else { - toShow.show(); - complete(); - } - } - - // start out by hiding, then showing, then completing - if ( toHide.length && this.options.hide ) { - this._hide( toHide, this.options.hide, function() { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - show(); - }); - } else { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - toHide.hide(); - show(); - } - - toHide.attr({ - "aria-expanded": "false", - "aria-hidden": "true" - }); - eventData.oldTab.attr( "aria-selected", "false" ); - // If we're switching tabs, remove the old tab from the tab order. - // If we're opening from collapsed state, remove the previous tab from the tab order. - // If we're collapsing, then keep the collapsing tab in the tab order. - if ( toShow.length && toHide.length ) { - eventData.oldTab.attr( "tabIndex", -1 ); - } else if ( toShow.length ) { - this.tabs.filter(function() { - return $( this ).attr( "tabIndex" ) === 0; - }) - .attr( "tabIndex", -1 ); - } - - toShow.attr({ - "aria-expanded": "true", - "aria-hidden": "false" - }); - eventData.newTab.attr({ - "aria-selected": "true", - tabIndex: 0 - }); - }, - - _activate: function( index ) { - var anchor, - active = this._findActive( index ); - - // trying to activate the already active panel - if ( active[ 0 ] === this.active[ 0 ] ) { - return; - } - - // trying to collapse, simulate a click on the current active header - if ( !active.length ) { - active = this.active; - } - - anchor = active.find( ".ui-tabs-anchor" )[ 0 ]; - this._eventHandler({ - target: anchor, - currentTarget: anchor, - preventDefault: $.noop - }); - }, - - _findActive: function( index ) { - return index === false ? $() : this.tabs.eq( index ); - }, - - _getIndex: function( index ) { - // meta-function to give users option to provide a href string instead of a numerical index. - if ( typeof index === "string" ) { - index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) ); - } - - return index; - }, - - _destroy: function() { - if ( this.xhr ) { - this.xhr.abort(); - } - - this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" ); - - this.tablist - .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) - .removeAttr( "role" ); - - this.anchors - .removeClass( "ui-tabs-anchor" ) - .removeAttr( "role" ) - .removeAttr( "tabIndex" ) - .removeData( "href.tabs" ) - .removeData( "load.tabs" ) - .removeUniqueId(); - - this.tabs.add( this.panels ).each(function() { - if ( $.data( this, "ui-tabs-destroy" ) ) { - $( this ).remove(); - } else { - $( this ) - .removeClass( "ui-state-default ui-state-active ui-state-disabled " + - "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" ) - .removeAttr( "tabIndex" ) - .removeAttr( "aria-live" ) - .removeAttr( "aria-busy" ) - .removeAttr( "aria-selected" ) - .removeAttr( "aria-labelledby" ) - .removeAttr( "aria-hidden" ) - .removeAttr( "aria-expanded" ) - .removeAttr( "role" ); - } - }); - - this.tabs.each(function() { - var li = $( this ), - prev = li.data( "ui-tabs-aria-controls" ); - if ( prev ) { - li.attr( "aria-controls", prev ); - } else { - li.removeAttr( "aria-controls" ); - } - }); - - this.panels.show(); - - if ( this.options.heightStyle !== "content" ) { - this.panels.css( "height", "" ); - } - }, - - enable: function( index ) { - var disabled = this.options.disabled; - if ( disabled === false ) { - return; - } - - if ( index === undefined ) { - disabled = false; - } else { - index = this._getIndex( index ); - if ( $.isArray( disabled ) ) { - disabled = $.map( disabled, function( num ) { - return num !== index ? num : null; - }); - } else { - disabled = $.map( this.tabs, function( li, num ) { - return num !== index ? num : null; - }); - } - } - this._setupDisabled( disabled ); - }, - - disable: function( index ) { - var disabled = this.options.disabled; - if ( disabled === true ) { - return; - } - - if ( index === undefined ) { - disabled = true; - } else { - index = this._getIndex( index ); - if ( $.inArray( index, disabled ) !== -1 ) { - return; - } - if ( $.isArray( disabled ) ) { - disabled = $.merge( [ index ], disabled ).sort(); - } else { - disabled = [ index ]; - } - } - this._setupDisabled( disabled ); - }, - - load: function( index, event ) { - index = this._getIndex( index ); - var that = this, - tab = this.tabs.eq( index ), - anchor = tab.find( ".ui-tabs-anchor" ), - panel = this._getPanelForTab( tab ), - eventData = { - tab: tab, - panel: panel - }; - - // not remote - if ( isLocal( anchor[ 0 ] ) ) { - return; - } - - this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); - - // support: jQuery <1.8 - // jQuery <1.8 returns false if the request is canceled in beforeSend, - // but as of 1.8, $.ajax() always returns a jqXHR object. - if ( this.xhr && this.xhr.statusText !== "canceled" ) { - tab.addClass( "ui-tabs-loading" ); - panel.attr( "aria-busy", "true" ); - - this.xhr - .success(function( response ) { - // support: jQuery <1.8 - // http://bugs.jquery.com/ticket/11778 - setTimeout(function() { - panel.html( response ); - that._trigger( "load", event, eventData ); - }, 1 ); - }) - .complete(function( jqXHR, status ) { - // support: jQuery <1.8 - // http://bugs.jquery.com/ticket/11778 - setTimeout(function() { - if ( status === "abort" ) { - that.panels.stop( false, true ); - } - - tab.removeClass( "ui-tabs-loading" ); - panel.removeAttr( "aria-busy" ); - - if ( jqXHR === that.xhr ) { - delete that.xhr; - } - }, 1 ); - }); - } - }, - - // TODO: Remove this function in 1.10 when ajaxOptions is removed - _ajaxSettings: function( anchor, event, eventData ) { - var that = this; - return { - url: anchor.attr( "href" ), - beforeSend: function( jqXHR, settings ) { - return that._trigger( "beforeLoad", event, - $.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) ); - } - }; - }, - - _getPanelForTab: function( tab ) { - var id = $( tab ).attr( "aria-controls" ); - return this.element.find( this._sanitizeSelector( "#" + id ) ); - } -}); - -// DEPRECATED -if ( $.uiBackCompat !== false ) { - - // helper method for a lot of the back compat extensions - $.ui.tabs.prototype._ui = function( tab, panel ) { - return { - tab: tab, - panel: panel, - index: this.anchors.index( tab ) - }; - }; - - // url method - $.widget( "ui.tabs", $.ui.tabs, { - url: function( index, url ) { - this.anchors.eq( index ).attr( "href", url ); - } - }); - - // TODO: Remove _ajaxSettings() method when removing this extension - // ajaxOptions and cache options - $.widget( "ui.tabs", $.ui.tabs, { - options: { - ajaxOptions: null, - cache: false - }, - - _create: function() { - this._super(); - - var that = this; - - this._on({ tabsbeforeload: function( event, ui ) { - // tab is already cached - if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) { - event.preventDefault(); - return; - } - - ui.jqXHR.success(function() { - if ( that.options.cache ) { - $.data( ui.tab[ 0 ], "cache.tabs", true ); - } - }); - }}); - }, - - _ajaxSettings: function( anchor, event, ui ) { - var ajaxOptions = this.options.ajaxOptions; - return $.extend( {}, ajaxOptions, { - error: function( xhr, status ) { - try { - // Passing index avoid a race condition when this method is - // called after the user has selected another tab. - // Pass the anchor that initiated this request allows - // loadError to manipulate the tab content panel via $(a.hash) - ajaxOptions.error( - xhr, status, ui.tab.closest( "li" ).index(), ui.tab[ 0 ] ); - } - catch ( error ) {} - } - }, this._superApply( arguments ) ); - }, - - _setOption: function( key, value ) { - // reset cache if switching from cached to not cached - if ( key === "cache" && value === false ) { - this.anchors.removeData( "cache.tabs" ); - } - this._super( key, value ); - }, - - _destroy: function() { - this.anchors.removeData( "cache.tabs" ); - this._super(); - }, - - url: function( index ){ - this.anchors.eq( index ).removeData( "cache.tabs" ); - this._superApply( arguments ); - } - }); - - // abort method - $.widget( "ui.tabs", $.ui.tabs, { - abort: function() { - if ( this.xhr ) { - this.xhr.abort(); - } - } - }); - - // spinner - $.widget( "ui.tabs", $.ui.tabs, { - options: { - spinner: "Loading…" - }, - _create: function() { - this._super(); - this._on({ - tabsbeforeload: function( event, ui ) { - // Don't react to nested tabs or tabs that don't use a spinner - if ( event.target !== this.element[ 0 ] || - !this.options.spinner ) { - return; - } - - var span = ui.tab.find( "span" ), - html = span.html(); - span.html( this.options.spinner ); - ui.jqXHR.complete(function() { - span.html( html ); - }); - } - }); - } - }); - - // enable/disable events - $.widget( "ui.tabs", $.ui.tabs, { - options: { - enable: null, - disable: null - }, - - enable: function( index ) { - var options = this.options, - trigger; - - if ( index && options.disabled === true || - ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) !== -1 ) ) { - trigger = true; - } - - this._superApply( arguments ); - - if ( trigger ) { - this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); - } - }, - - disable: function( index ) { - var options = this.options, - trigger; - - if ( index && options.disabled === false || - ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) === -1 ) ) { - trigger = true; - } - - this._superApply( arguments ); - - if ( trigger ) { - this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); - } - } - }); - - // add/remove methods and events - $.widget( "ui.tabs", $.ui.tabs, { - options: { - add: null, - remove: null, - tabTemplate: "
    • #{label}
    • " - }, - - add: function( url, label, index ) { - if ( index === undefined ) { - index = this.anchors.length; - } - - var doInsertAfter, panel, - options = this.options, - li = $( options.tabTemplate - .replace( /#\{href\}/g, url ) - .replace( /#\{label\}/g, label ) ), - id = !url.indexOf( "#" ) ? - url.replace( "#", "" ) : - this._tabId( li ); - - li.addClass( "ui-state-default ui-corner-top" ).data( "ui-tabs-destroy", true ); - li.attr( "aria-controls", id ); - - doInsertAfter = index >= this.tabs.length; - - // try to find an existing element before creating a new one - panel = this.element.find( "#" + id ); - if ( !panel.length ) { - panel = this._createPanel( id ); - if ( doInsertAfter ) { - if ( index > 0 ) { - panel.insertAfter( this.panels.eq( -1 ) ); - } else { - panel.appendTo( this.element ); - } - } else { - panel.insertBefore( this.panels[ index ] ); - } - } - panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ).hide(); - - if ( doInsertAfter ) { - li.appendTo( this.tablist ); - } else { - li.insertBefore( this.tabs[ index ] ); - } - - options.disabled = $.map( options.disabled, function( n ) { - return n >= index ? ++n : n; - }); - - this.refresh(); - if ( this.tabs.length === 1 && options.active === false ) { - this.option( "active", 0 ); - } - - this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); - return this; - }, - - remove: function( index ) { - index = this._getIndex( index ); - var options = this.options, - tab = this.tabs.eq( index ).remove(), - panel = this._getPanelForTab( tab ).remove(); - - // If selected tab was removed focus tab to the right or - // in case the last tab was removed the tab to the left. - // We check for more than 2 tabs, because if there are only 2, - // then when we remove this tab, there will only be one tab left - // so we don't need to detect which tab to activate. - if ( tab.hasClass( "ui-tabs-active" ) && this.anchors.length > 2 ) { - this._activate( index + ( index + 1 < this.anchors.length ? 1 : -1 ) ); - } - - options.disabled = $.map( - $.grep( options.disabled, function( n ) { - return n !== index; - }), - function( n ) { - return n >= index ? --n : n; - }); - - this.refresh(); - - this._trigger( "remove", null, this._ui( tab.find( "a" )[ 0 ], panel[ 0 ] ) ); - return this; - } - }); - - // length method - $.widget( "ui.tabs", $.ui.tabs, { - length: function() { - return this.anchors.length; - } - }); - - // panel ids (idPrefix option + title attribute) - $.widget( "ui.tabs", $.ui.tabs, { - options: { - idPrefix: "ui-tabs-" - }, - - _tabId: function( tab ) { - var a = tab.is( "li" ) ? tab.find( "a[href]" ) : tab; - a = a[0]; - return $( a ).closest( "li" ).attr( "aria-controls" ) || - a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF\-]/g, "" ) || - this.options.idPrefix + getNextTabId(); - } - }); - - // _createPanel method - $.widget( "ui.tabs", $.ui.tabs, { - options: { - panelTemplate: "
      " - }, - - _createPanel: function( id ) { - return $( this.options.panelTemplate ) - .attr( "id", id ) - .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) - .data( "ui-tabs-destroy", true ); - } - }); - - // selected option - $.widget( "ui.tabs", $.ui.tabs, { - _create: function() { - var options = this.options; - if ( options.active === null && options.selected !== undefined ) { - options.active = options.selected === -1 ? false : options.selected; - } - this._super(); - options.selected = options.active; - if ( options.selected === false ) { - options.selected = -1; - } - }, - - _setOption: function( key, value ) { - if ( key !== "selected" ) { - return this._super( key, value ); - } - - var options = this.options; - this._super( "active", value === -1 ? false : value ); - options.selected = options.active; - if ( options.selected === false ) { - options.selected = -1; - } - }, - - _eventHandler: function() { - this._superApply( arguments ); - this.options.selected = this.options.active; - if ( this.options.selected === false ) { - this.options.selected = -1; - } - } - }); - - // show and select event - $.widget( "ui.tabs", $.ui.tabs, { - options: { - show: null, - select: null - }, - _create: function() { - this._super(); - if ( this.options.active !== false ) { - this._trigger( "show", null, this._ui( - this.active.find( ".ui-tabs-anchor" )[ 0 ], - this._getPanelForTab( this.active )[ 0 ] ) ); - } - }, - _trigger: function( type, event, data ) { - var tab, panel, - ret = this._superApply( arguments ); - - if ( !ret ) { - return false; - } - - if ( type === "beforeActivate" ) { - tab = data.newTab.length ? data.newTab : data.oldTab; - panel = data.newPanel.length ? data.newPanel : data.oldPanel; - ret = this._super( "select", event, { - tab: tab.find( ".ui-tabs-anchor" )[ 0], - panel: panel[ 0 ], - index: tab.closest( "li" ).index() - }); - } else if ( type === "activate" && data.newTab.length ) { - ret = this._super( "show", event, { - tab: data.newTab.find( ".ui-tabs-anchor" )[ 0 ], - panel: data.newPanel[ 0 ], - index: data.newTab.closest( "li" ).index() - }); - } - return ret; - } - }); - - // select method - $.widget( "ui.tabs", $.ui.tabs, { - select: function( index ) { - index = this._getIndex( index ); - if ( index === -1 ) { - if ( this.options.collapsible && this.options.selected !== -1 ) { - index = this.options.selected; - } else { - return; - } - } - this.anchors.eq( index ).trigger( this.options.event + this.eventNamespace ); - } - }); - - // cookie option - (function() { - - var listId = 0; - - $.widget( "ui.tabs", $.ui.tabs, { - options: { - cookie: null // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } - }, - _create: function() { - var options = this.options, - active; - if ( options.active == null && options.cookie ) { - active = parseInt( this._cookie(), 10 ); - if ( active === -1 ) { - active = false; - } - options.active = active; - } - this._super(); - }, - _cookie: function( active ) { - var cookie = [ this.cookie || - ( this.cookie = this.options.cookie.name || "ui-tabs-" + (++listId) ) ]; - if ( arguments.length ) { - cookie.push( active === false ? -1 : active ); - cookie.push( this.options.cookie ); - } - return $.cookie.apply( null, cookie ); - }, - _refresh: function() { - this._super(); - if ( this.options.cookie ) { - this._cookie( this.options.active, this.options.cookie ); - } - }, - _eventHandler: function() { - this._superApply( arguments ); - if ( this.options.cookie ) { - this._cookie( this.options.active, this.options.cookie ); - } - }, - _destroy: function() { - this._super(); - if ( this.options.cookie ) { - this._cookie( null, this.options.cookie ); - } - } - }); - - })(); - - // load event - $.widget( "ui.tabs", $.ui.tabs, { - _trigger: function( type, event, data ) { - var _data = $.extend( {}, data ); - if ( type === "load" ) { - _data.panel = _data.panel[ 0 ]; - _data.tab = _data.tab.find( ".ui-tabs-anchor" )[ 0 ]; - } - return this._super( type, event, _data ); - } - }); - - // fx option - // The new animation options (show, hide) conflict with the old show callback. - // The old fx option wins over show/hide anyway (always favor back-compat). - // If a user wants to use the new animation API, they must give up the old API. - $.widget( "ui.tabs", $.ui.tabs, { - options: { - fx: null // e.g. { height: "toggle", opacity: "toggle", duration: 200 } - }, - - _getFx: function() { - var hide, show, - fx = this.options.fx; - - if ( fx ) { - if ( $.isArray( fx ) ) { - hide = fx[ 0 ]; - show = fx[ 1 ]; - } else { - hide = show = fx; - } - } - - return fx ? { show: show, hide: hide } : null; - }, - - _toggle: function( event, eventData ) { - var that = this, - toShow = eventData.newPanel, - toHide = eventData.oldPanel, - fx = this._getFx(); - - if ( !fx ) { - return this._super( event, eventData ); - } - - that.running = true; - - function complete() { - that.running = false; - that._trigger( "activate", event, eventData ); - } - - function show() { - eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); - - if ( toShow.length && fx.show ) { - toShow - .animate( fx.show, fx.show.duration, function() { - complete(); - }); - } else { - toShow.show(); - complete(); - } - } - - // start out by hiding, then showing, then completing - if ( toHide.length && fx.hide ) { - toHide.animate( fx.hide, fx.hide.duration, function() { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - show(); - }); - } else { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - toHide.hide(); - show(); - } - } - }); -} - -})( jQuery ); -(function( $ ) { - -var increments = 0; - -function addDescribedBy( elem, id ) { - var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ); - describedby.push( id ); - elem - .data( "ui-tooltip-id", id ) - .attr( "aria-describedby", $.trim( describedby.join( " " ) ) ); -} - -function removeDescribedBy( elem ) { - var id = elem.data( "ui-tooltip-id" ), - describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ), - index = $.inArray( id, describedby ); - if ( index !== -1 ) { - describedby.splice( index, 1 ); - } - - elem.removeData( "ui-tooltip-id" ); - describedby = $.trim( describedby.join( " " ) ); - if ( describedby ) { - elem.attr( "aria-describedby", describedby ); - } else { - elem.removeAttr( "aria-describedby" ); - } -} - -$.widget( "ui.tooltip", { - version: "1.9.2", - options: { - content: function() { - return $( this ).attr( "title" ); - }, - hide: true, - // Disabled elements have inconsistent behavior across browsers (#8661) - items: "[title]:not([disabled])", - position: { - my: "left top+15", - at: "left bottom", - collision: "flipfit flip" - }, - show: true, - tooltipClass: null, - track: false, - - // callbacks - close: null, - open: null - }, - - _create: function() { - this._on({ - mouseover: "open", - focusin: "open" - }); - - // IDs of generated tooltips, needed for destroy - this.tooltips = {}; - // IDs of parent tooltips where we removed the title attribute - this.parents = {}; - - if ( this.options.disabled ) { - this._disable(); - } - }, - - _setOption: function( key, value ) { - var that = this; - - if ( key === "disabled" ) { - this[ value ? "_disable" : "_enable" ](); - this.options[ key ] = value; - // disable element style changes - return; - } - - this._super( key, value ); - - if ( key === "content" ) { - $.each( this.tooltips, function( id, element ) { - that._updateContent( element ); - }); - } - }, - - _disable: function() { - var that = this; - - // close open tooltips - $.each( this.tooltips, function( id, element ) { - var event = $.Event( "blur" ); - event.target = event.currentTarget = element[0]; - that.close( event, true ); - }); - - // remove title attributes to prevent native tooltips - this.element.find( this.options.items ).andSelf().each(function() { - var element = $( this ); - if ( element.is( "[title]" ) ) { - element - .data( "ui-tooltip-title", element.attr( "title" ) ) - .attr( "title", "" ); - } - }); - }, - - _enable: function() { - // restore title attributes - this.element.find( this.options.items ).andSelf().each(function() { - var element = $( this ); - if ( element.data( "ui-tooltip-title" ) ) { - element.attr( "title", element.data( "ui-tooltip-title" ) ); - } - }); - }, - - open: function( event ) { - var that = this, - target = $( event ? event.target : this.element ) - // we need closest here due to mouseover bubbling, - // but always pointing at the same event target - .closest( this.options.items ); - - // No element to show a tooltip for or the tooltip is already open - if ( !target.length || target.data( "ui-tooltip-id" ) ) { - return; - } - - if ( target.attr( "title" ) ) { - target.data( "ui-tooltip-title", target.attr( "title" ) ); - } - - target.data( "ui-tooltip-open", true ); - - // kill parent tooltips, custom or native, for hover - if ( event && event.type === "mouseover" ) { - target.parents().each(function() { - var parent = $( this ), - blurEvent; - if ( parent.data( "ui-tooltip-open" ) ) { - blurEvent = $.Event( "blur" ); - blurEvent.target = blurEvent.currentTarget = this; - that.close( blurEvent, true ); - } - if ( parent.attr( "title" ) ) { - parent.uniqueId(); - that.parents[ this.id ] = { - element: this, - title: parent.attr( "title" ) - }; - parent.attr( "title", "" ); - } - }); - } - - this._updateContent( target, event ); - }, - - _updateContent: function( target, event ) { - var content, - contentOption = this.options.content, - that = this, - eventType = event ? event.type : null; - - if ( typeof contentOption === "string" ) { - return this._open( event, target, contentOption ); - } - - content = contentOption.call( target[0], function( response ) { - // ignore async response if tooltip was closed already - if ( !target.data( "ui-tooltip-open" ) ) { - return; - } - // IE may instantly serve a cached response for ajax requests - // delay this call to _open so the other call to _open runs first - that._delay(function() { - // jQuery creates a special event for focusin when it doesn't - // exist natively. To improve performance, the native event - // object is reused and the type is changed. Therefore, we can't - // rely on the type being correct after the event finished - // bubbling, so we set it back to the previous value. (#8740) - if ( event ) { - event.type = eventType; - } - this._open( event, target, response ); - }); - }); - if ( content ) { - this._open( event, target, content ); - } - }, - - _open: function( event, target, content ) { - var tooltip, events, delayedShow, - positionOption = $.extend( {}, this.options.position ); - - if ( !content ) { - return; - } - - // Content can be updated multiple times. If the tooltip already - // exists, then just update the content and bail. - tooltip = this._find( target ); - if ( tooltip.length ) { - tooltip.find( ".ui-tooltip-content" ).html( content ); - return; - } - - // if we have a title, clear it to prevent the native tooltip - // we have to check first to avoid defining a title if none exists - // (we don't want to cause an element to start matching [title]) - // - // We use removeAttr only for key events, to allow IE to export the correct - // accessible attributes. For mouse events, set to empty string to avoid - // native tooltip showing up (happens only when removing inside mouseover). - if ( target.is( "[title]" ) ) { - if ( event && event.type === "mouseover" ) { - target.attr( "title", "" ); - } else { - target.removeAttr( "title" ); - } - } - - tooltip = this._tooltip( target ); - addDescribedBy( target, tooltip.attr( "id" ) ); - tooltip.find( ".ui-tooltip-content" ).html( content ); - - function position( event ) { - positionOption.of = event; - if ( tooltip.is( ":hidden" ) ) { - return; - } - tooltip.position( positionOption ); - } - if ( this.options.track && event && /^mouse/.test( event.type ) ) { - this._on( this.document, { - mousemove: position - }); - // trigger once to override element-relative positioning - position( event ); - } else { - tooltip.position( $.extend({ - of: target - }, this.options.position ) ); - } - - tooltip.hide(); - - this._show( tooltip, this.options.show ); - // Handle tracking tooltips that are shown with a delay (#8644). As soon - // as the tooltip is visible, position the tooltip using the most recent - // event. - if ( this.options.show && this.options.show.delay ) { - delayedShow = setInterval(function() { - if ( tooltip.is( ":visible" ) ) { - position( positionOption.of ); - clearInterval( delayedShow ); - } - }, $.fx.interval ); - } - - this._trigger( "open", event, { tooltip: tooltip } ); - - events = { - keyup: function( event ) { - if ( event.keyCode === $.ui.keyCode.ESCAPE ) { - var fakeEvent = $.Event(event); - fakeEvent.currentTarget = target[0]; - this.close( fakeEvent, true ); - } - }, - remove: function() { - this._removeTooltip( tooltip ); - } - }; - if ( !event || event.type === "mouseover" ) { - events.mouseleave = "close"; - } - if ( !event || event.type === "focusin" ) { - events.focusout = "close"; - } - this._on( true, target, events ); - }, - - close: function( event ) { - var that = this, - target = $( event ? event.currentTarget : this.element ), - tooltip = this._find( target ); - - // disabling closes the tooltip, so we need to track when we're closing - // to avoid an infinite loop in case the tooltip becomes disabled on close - if ( this.closing ) { - return; - } - - // only set title if we had one before (see comment in _open()) - if ( target.data( "ui-tooltip-title" ) ) { - target.attr( "title", target.data( "ui-tooltip-title" ) ); - } - - removeDescribedBy( target ); - - tooltip.stop( true ); - this._hide( tooltip, this.options.hide, function() { - that._removeTooltip( $( this ) ); - }); - - target.removeData( "ui-tooltip-open" ); - this._off( target, "mouseleave focusout keyup" ); - // Remove 'remove' binding only on delegated targets - if ( target[0] !== this.element[0] ) { - this._off( target, "remove" ); - } - this._off( this.document, "mousemove" ); - - if ( event && event.type === "mouseleave" ) { - $.each( this.parents, function( id, parent ) { - $( parent.element ).attr( "title", parent.title ); - delete that.parents[ id ]; - }); - } - - this.closing = true; - this._trigger( "close", event, { tooltip: tooltip } ); - this.closing = false; - }, - - _tooltip: function( element ) { - var id = "ui-tooltip-" + increments++, - tooltip = $( "
      " ) - .attr({ - id: id, - role: "tooltip" - }) - .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " + - ( this.options.tooltipClass || "" ) ); - $( "
      " ) - .addClass( "ui-tooltip-content" ) - .appendTo( tooltip ); - tooltip.appendTo( this.document[0].body ); - if ( $.fn.bgiframe ) { - tooltip.bgiframe(); - } - this.tooltips[ id ] = element; - return tooltip; - }, - - _find: function( target ) { - var id = target.data( "ui-tooltip-id" ); - return id ? $( "#" + id ) : $(); - }, - - _removeTooltip: function( tooltip ) { - tooltip.remove(); - delete this.tooltips[ tooltip.attr( "id" ) ]; - }, - - _destroy: function() { - var that = this; - - // close open tooltips - $.each( this.tooltips, function( id, element ) { - // Delegate to close method to handle common cleanup - var event = $.Event( "blur" ); - event.target = event.currentTarget = element[0]; - that.close( event, true ); - - // Remove immediately; destroying an open tooltip doesn't use the - // hide animation - $( "#" + id ).remove(); - - // Restore the title - if ( element.data( "ui-tooltip-title" ) ) { - element.attr( "title", element.data( "ui-tooltip-title" ) ); - element.removeData( "ui-tooltip-title" ); - } - }); - } -}); - -}( jQuery ) ); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/jquery.layout-latest.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/jquery.layout-latest.js deleted file mode 100644 index 434724d9c..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/layout/jquery.layout-latest.js +++ /dev/null @@ -1,6086 +0,0 @@ -/** - * @preserve - * jquery.layout 1.4.3 - * $Date: 2015/03/13 22:37:04 $ - * $Rev: 1.0403 $ - * - * Copyright (c) 2014 Kevin Dalman (http://jquery-dev.com) - * Based on work by Fabrizio Balliano (http://www.fabrizioballiano.net) - * - * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) - * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. - * - * SEE: http://layout.jquery-dev.com/LICENSE.txt - * - * Changelog: http://layout.jquery-dev.com/changelog.cfm - * - * Docs: http://layout.jquery-dev.com/documentation.html - * Tips: http://layout.jquery-dev.com/tips.html - * Help: http://groups.google.com/group/jquery-ui-layout - */ - -/* JavaDoc Info: http://code.google.com/closure/compiler/docs/js-for-compiler.html - * {!Object} non-nullable type (never NULL) - * {?string} nullable type (sometimes NULL) - default for {Object} - * {number=} optional parameter - * {*} ALL types - */ -/* TODO for jQ 2.0 - * change .andSelf() to .addBack() - * check $.fn.disableSelection - this is in jQuery UI 1.9.x - */ - -// NOTE: For best readability, view with a fixed-width font and tabs equal to 4-chars - -;(function ($) { - -// alias Math methods - used a lot! -var min = Math.min -, max = Math.max -, round = Math.floor - -, isStr = function (v) { return $.type(v) === "string"; } - - /** - * @param {!Object} Instance - * @param {Array.} a_fn - */ -, runPluginCallbacks = function (Instance, a_fn) { - if ($.isArray(a_fn)) - for (var i=0, c=a_fn.length; i
      ').appendTo("body") - , d = { width: $c.outerWidth - $c[0].clientWidth, height: 100 - $c[0].clientHeight }; - $c.remove(); - window.scrollbarWidth = d.width; - window.scrollbarHeight = d.height; - return dim.match(/^(width|height)$/) ? d[dim] : d; - } - - -, disableTextSelection: function () { - var $d = $(document) - , s = 'textSelectionDisabled' - , x = 'textSelectionInitialized' - ; - if ($.fn.disableSelection) { - if (!$d.data(x)) // document hasn't been initialized yet - $d.on('mouseup', $.layout.enableTextSelection ).data(x, true); - if (!$d.data(s)) - $d.disableSelection().data(s, true); - } - } -, enableTextSelection: function () { - var $d = $(document) - , s = 'textSelectionDisabled'; - if ($.fn.enableSelection && $d.data(s)) - $d.enableSelection().data(s, false); - } - - - /** - * Returns hash container 'display' and 'visibility' - * - * @see $.swap() - swaps CSS, runs callback, resets CSS - * @param {!Object} $E jQuery element - * @param {boolean=} [force=false] Run even if display != none - * @return {!Object} Returns current style props, if applicable - */ -, showInvisibly: function ($E, force) { - if ($E && $E.length && (force || $E.css("display") === "none")) { // only if not *already hidden* - var s = $E[0].style - // save ONLY the 'style' props because that is what we must restore - , CSS = { display: s.display || '', visibility: s.visibility || '' }; - // show element 'invisibly' so can be measured - $E.css({ display: "block", visibility: "hidden" }); - return CSS; - } - return {}; - } - - /** - * Returns data for setting size of an element (container or a pane). - * - * @see _create(), onWindowResize() for container, plus others for pane - * @return JSON Returns a hash of all dimensions: top, bottom, left, right, outerWidth, innerHeight, etc - */ -, getElementDimensions: function ($E, inset) { - var - // dimensions hash - start with current data IF passed - d = { css: {}, inset: {} } - , x = d.css // CSS hash - , i = { bottom: 0 } // TEMP insets (bottom = complier hack) - , N = $.layout.cssNum - , R = Math.round - , off = $E.offset() - , b, p, ei // TEMP border, padding - ; - d.offsetLeft = off.left; - d.offsetTop = off.top; - - if (!inset) inset = {}; // simplify logic below - - $.each("Left,Right,Top,Bottom".split(","), function (idx, e) { // e = edge - b = x["border" + e] = $.layout.borderWidth($E, e); - p = x["padding"+ e] = $.layout.cssNum($E, "padding"+e); - ei = e.toLowerCase(); - d.inset[ei] = inset[ei] >= 0 ? inset[ei] : p; // any missing insetX value = paddingX - i[ei] = d.inset[ei] + b; // total offset of content from outer side - }); - - x.width = R($E.width()); - x.height = R($E.height()); - x.top = N($E,"top",true); - x.bottom = N($E,"bottom",true); - x.left = N($E,"left",true); - x.right = N($E,"right",true); - - d.outerWidth = R($E.outerWidth()); - d.outerHeight = R($E.outerHeight()); - // calc the TRUE inner-dimensions, even in quirks-mode! - d.innerWidth = max(0, d.outerWidth - i.left - i.right); - d.innerHeight = max(0, d.outerHeight - i.top - i.bottom); - // layoutWidth/Height is used in calcs for manual resizing - // layoutW/H only differs from innerW/H when in quirks-mode - then is like outerW/H - d.layoutWidth = R($E.innerWidth()); - d.layoutHeight = R($E.innerHeight()); - - //if ($E.prop('tagName') === 'BODY') { debugData( d, $E.prop('tagName') ); } // DEBUG - - //d.visible = $E.is(":visible");// && x.width > 0 && x.height > 0; - - return d; - } - -, getElementStyles: function ($E, list) { - var - CSS = {} - , style = $E[0].style - , props = list.split(",") - , sides = "Top,Bottom,Left,Right".split(",") - , attrs = "Color,Style,Width".split(",") - , p, s, a, i, j, k - ; - for (i=0; i < props.length; i++) { - p = props[i]; - if (p.match(/(border|padding|margin)$/)) - for (j=0; j < 4; j++) { - s = sides[j]; - if (p === "border") - for (k=0; k < 3; k++) { - a = attrs[k]; - CSS[p+s+a] = style[p+s+a]; - } - else - CSS[p+s] = style[p+s]; - } - else - CSS[p] = style[p]; - }; - return CSS - } - - /** - * Return the innerWidth for the current browser/doctype - * - * @see initPanes(), sizeMidPanes(), initHandles(), sizeHandles() - * @param {Array.} $E Must pass a jQuery object - first element is processed - * @param {number=} outerWidth (optional) Can pass a width, allowing calculations BEFORE element is resized - * @return {number} Returns the innerWidth of the elem by subtracting padding and borders - */ -, cssWidth: function ($E, outerWidth) { - // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed - if (outerWidth <= 0) return 0; - - var lb = $.layout.browser - , bs = !lb.boxModel ? "border-box" : lb.boxSizing ? $E.css("boxSizing") : "content-box" - , b = $.layout.borderWidth - , n = $.layout.cssNum - , W = outerWidth - ; - // strip border and/or padding from outerWidth to get CSS Width - if (bs !== "border-box") - W -= (b($E, "Left") + b($E, "Right")); - if (bs === "content-box") - W -= (n($E, "paddingLeft") + n($E, "paddingRight")); - return max(0,W); - } - - /** - * Return the innerHeight for the current browser/doctype - * - * @see initPanes(), sizeMidPanes(), initHandles(), sizeHandles() - * @param {Array.} $E Must pass a jQuery object - first element is processed - * @param {number=} outerHeight (optional) Can pass a width, allowing calculations BEFORE element is resized - * @return {number} Returns the innerHeight of the elem by subtracting padding and borders - */ -, cssHeight: function ($E, outerHeight) { - // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed - if (outerHeight <= 0) return 0; - - var lb = $.layout.browser - , bs = !lb.boxModel ? "border-box" : lb.boxSizing ? $E.css("boxSizing") : "content-box" - , b = $.layout.borderWidth - , n = $.layout.cssNum - , H = outerHeight - ; - // strip border and/or padding from outerHeight to get CSS Height - if (bs !== "border-box") - H -= (b($E, "Top") + b($E, "Bottom")); - if (bs === "content-box") - H -= (n($E, "paddingTop") + n($E, "paddingBottom")); - return max(0,H); - } - - /** - * Returns the 'current CSS numeric value' for a CSS property - 0 if property does not exist - * - * @see Called by many methods - * @param {Array.} $E Must pass a jQuery object - first element is processed - * @param {string} prop The name of the CSS property, eg: top, width, etc. - * @param {boolean=} [allowAuto=false] true = return 'auto' if that is value; false = return 0 - * @return {(string|number)} Usually used to get an integer value for position (top, left) or size (height, width) - */ -, cssNum: function ($E, prop, allowAuto) { - if (!$E.jquery) $E = $($E); - var CSS = $.layout.showInvisibly($E) - , p = $.css($E[0], prop, true) - , v = allowAuto && p=="auto" ? p : Math.round(parseFloat(p) || 0); - $E.css( CSS ); // RESET - return v; - } - -, borderWidth: function (el, side) { - if (el.jquery) el = el[0]; - var b = "border"+ side.substr(0,1).toUpperCase() + side.substr(1); // left => Left - return $.css(el, b+"Style", true) === "none" ? 0 : Math.round(parseFloat($.css(el, b+"Width", true)) || 0); - } - - /** - * Mouse-tracking utility - FUTURE REFERENCE - * - * init: if (!window.mouse) { - * window.mouse = { x: 0, y: 0 }; - * $(document).mousemove( $.layout.trackMouse ); - * } - * - * @param {Object} evt - * -, trackMouse: function (evt) { - window.mouse = { x: evt.clientX, y: evt.clientY }; - } - */ - - /** - * SUBROUTINE for preventPrematureSlideClose option - * - * @param {Object} evt - * @param {Object=} el - */ -, isMouseOverElem: function (evt, el) { - var - $E = $(el || this) - , d = $E.offset() - , T = d.top - , L = d.left - , R = L + $E.outerWidth() - , B = T + $E.outerHeight() - , x = evt.pageX // evt.clientX ? - , y = evt.pageY // evt.clientY ? - ; - // if X & Y are < 0, probably means is over an open SELECT - return ($.layout.browser.msie && x < 0 && y < 0) || ((x >= L && x <= R) && (y >= T && y <= B)); - } - - /** - * Message/Logging Utility - * - * @example $.layout.msg("My message"); // log text - * @example $.layout.msg("My message", true); // alert text - * @example $.layout.msg({ foo: "bar" }, "Title"); // log hash-data, with custom title - * @example $.layout.msg({ foo: "bar" }, true, "Title", { sort: false }); -OR- - * @example $.layout.msg({ foo: "bar" }, "Title", { sort: false, display: true }); // alert hash-data - * - * @param {(Object|string)} info String message OR Hash/Array - * @param {(Boolean|string|Object)=} [popup=false] True means alert-box - can be skipped - * @param {(Object|string)=} [debugTitle=""] Title for Hash data - can be skipped - * @param {Object=} [debugOpts] Extra options for debug output - */ -, msg: function (info, popup, debugTitle, debugOpts) { - if ($.isPlainObject(info) && window.debugData) { - if (typeof popup === "string") { - debugOpts = debugTitle; - debugTitle = popup; - } - else if (typeof debugTitle === "object") { - debugOpts = debugTitle; - debugTitle = null; - } - var t = debugTitle || "log( )" - , o = $.extend({ sort: false, returnHTML: false, display: false }, debugOpts); - if (popup === true || o.display) - debugData( info, t, o ); - else if (window.console) - console.log(debugData( info, t, o )); - } - else if (popup) - alert(info); - else if (window.console) - console.log(info); - else { - var id = "#layoutLogger" - , $l = $(id); - if (!$l.length) - $l = createLog(); - $l.children("ul").append('
    • '+ info.replace(/\/g,">") +'
    • '); - } - - function createLog () { - var pos = $.support.fixedPosition ? 'fixed' : 'absolute' - , $e = $('
      ' - + '
      ' - + 'XLayout console.log
      ' - + '
        ' - + '
        ' - ).appendTo("body"); - $e.css('left', $(window).width() - $e.outerWidth() - 5) - if ($.ui.draggable) $e.draggable({ handle: ':first-child' }); - return $e; - }; - } - -}; - - -/* - * $.layout.browser REPLACES removed $.browser, with extra data - * Parsing code here adapted from jQuery 1.8 $.browse - */ -(function(){ - var u = navigator.userAgent.toLowerCase() - , m = /(chrome)[ \/]([\w.]+)/.exec( u ) - || /(webkit)[ \/]([\w.]+)/.exec( u ) - || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( u ) - || /(msie) ([\w.]+)/.exec( u ) - || u.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( u ) - || [] - , b = m[1] || "" - , v = m[2] || 0 - , ie = b === "msie" - , cm = document.compatMode - , $s = $.support - , bs = $s.boxSizing !== undefined ? $s.boxSizing : $s.boxSizingReliable - , bm = !ie || !cm || cm === "CSS1Compat" || $s.boxModel || false - , lb = $.layout.browser = { - version: v - , safari: b === "webkit" // webkit (NOT chrome) = safari - , webkit: b === "chrome" // chrome = webkit - , msie: ie - , isIE6: ie && v == 6 - // ONLY IE reverts to old box-model - Note that compatMode was deprecated as of IE8 - , boxModel: bm - , boxSizing: !!(typeof bs === "function" ? bs() : bs) - }; - ; - if (b) lb[b] = true; // set CURRENT browser - /* OLD versions of jQuery only set $.support.boxModel after page is loaded - * so if this is IE, use support.boxModel to test for quirks-mode (ONLY IE changes boxModel) */ - if (!bm && !cm) $(function(){ lb.boxModel = $s.boxModel; }); -})(); - - -// DEFAULT OPTIONS -$.layout.defaults = { -/* - * LAYOUT & LAYOUT-CONTAINER OPTIONS - * - none of these options are applicable to individual panes - */ - name: "" // Not required, but useful for buttons and used for the state-cookie -, containerClass: "ui-layout-container" // layout-container element -, inset: null // custom container-inset values (override padding) -, scrollToBookmarkOnLoad: true // after creating a layout, scroll to bookmark in URL (.../page.htm#myBookmark) -, resizeWithWindow: true // bind thisLayout.resizeAll() to the window.resize event -, resizeWithWindowDelay: 200 // delay calling resizeAll because makes window resizing very jerky -, resizeWithWindowMaxDelay: 0 // 0 = none - force resize every XX ms while window is being resized -, maskPanesEarly: false // true = create pane-masks on resizer.mouseDown instead of waiting for resizer.dragstart -, onresizeall_start: null // CALLBACK when resizeAll() STARTS - NOT pane-specific -, onresizeall_end: null // CALLBACK when resizeAll() ENDS - NOT pane-specific -, onload_start: null // CALLBACK when Layout inits - after options initialized, but before elements -, onload_end: null // CALLBACK when Layout inits - after EVERYTHING has been initialized -, onunload_start: null // CALLBACK when Layout is destroyed OR onWindowUnload -, onunload_end: null // CALLBACK when Layout is destroyed OR onWindowUnload -, initPanes: true // false = DO NOT initialize the panes onLoad - will init later -, showErrorMessages: true // enables fatal error messages to warn developers of common errors -, showDebugMessages: false // display console-and-alert debug msgs - IF this Layout version _has_ debugging code! -// Changing this zIndex value will cause other zIndex values to automatically change -, zIndex: null // the PANE zIndex - resizers and masks will be +1 -// DO NOT CHANGE the zIndex values below unless you clearly understand their relationships -, zIndexes: { // set _default_ z-index values here... - pane_normal: 0 // normal z-index for panes - , content_mask: 1 // applied to overlays used to mask content INSIDE panes during resizing - , resizer_normal: 2 // normal z-index for resizer-bars - , pane_sliding: 100 // applied to *BOTH* the pane and its resizer when a pane is 'slid open' - , pane_animate: 1000 // applied to the pane when being animated - not applied to the resizer - , resizer_drag: 10000 // applied to the CLONED resizer-bar when being 'dragged' - } -, errors: { - pane: "pane" // description of "layout pane element" - used only in error messages - , selector: "selector" // description of "jQuery-selector" - used only in error messages - , addButtonError: "Error Adding Button\nInvalid " - , containerMissing: "UI Layout Initialization Error\nThe specified layout-container does not exist." - , centerPaneMissing: "UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element." - , noContainerHeight: "UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!" - , callbackError: "UI Layout Callback Error\nThe EVENT callback is not a valid function." - } -/* - * PANE DEFAULT SETTINGS - * - settings under the 'panes' key become the default settings for *all panes* - * - ALL pane-options can also be set specifically for each panes, which will override these 'default values' - */ -, panes: { // default options for 'all panes' - will be overridden by 'per-pane settings' - applyDemoStyles: false // NOTE: renamed from applyDefaultStyles for clarity - , closable: true // pane can open & close - , resizable: true // when open, pane can be resized - , slidable: true // when closed, pane can 'slide open' over other panes - closes on mouse-out - , initClosed: false // true = init pane as 'closed' - , initHidden: false // true = init pane as 'hidden' - no resizer-bar/spacing - // SELECTORS - //, paneSelector: "" // MUST be pane-specific - jQuery selector for pane - , contentSelector: ".ui-layout-content" // INNER div/element to auto-size so only it scrolls, not the entire pane! - , contentIgnoreSelector: ".ui-layout-ignore" // element(s) to 'ignore' when measuring 'content' - , findNestedContent: false // true = $P.find(contentSelector), false = $P.children(contentSelector) - // GENERIC ROOT-CLASSES - for auto-generated classNames - , paneClass: "ui-layout-pane" // Layout Pane - , resizerClass: "ui-layout-resizer" // Resizer Bar - , togglerClass: "ui-layout-toggler" // Toggler Button - , buttonClass: "ui-layout-button" // CUSTOM Buttons - eg: '[ui-layout-button]-toggle/-open/-close/-pin' - // ELEMENT SIZE & SPACING - //, size: 100 // MUST be pane-specific -initial size of pane - , minSize: 0 // when manually resizing a pane - , maxSize: 0 // ditto, 0 = no limit - , spacing_open: 6 // space between pane and adjacent panes - when pane is 'open' - , spacing_closed: 6 // ditto - when pane is 'closed' - , togglerLength_open: 50 // Length = WIDTH of toggler button on north/south sides - HEIGHT on east/west sides - , togglerLength_closed: 50 // 100% OR -1 means 'full height/width of resizer bar' - 0 means 'hidden' - , togglerAlign_open: "center" // top/left, bottom/right, center, OR... - , togglerAlign_closed: "center" // 1 => nn = offset from top/left, -1 => -nn == offset from bottom/right - , togglerContent_open: "" // text or HTML to put INSIDE the toggler - , togglerContent_closed: "" // ditto - // RESIZING OPTIONS - , resizerDblClickToggle: true // - , autoResize: true // IF size is 'auto' or a percentage, then recalc 'pixel size' whenever the layout resizes - , autoReopen: true // IF a pane was auto-closed due to noRoom, reopen it when there is room? False = leave it closed - , resizerDragOpacity: 1 // option for ui.draggable - //, resizerCursor: "" // MUST be pane-specific - cursor when over resizer-bar - , maskContents: false // true = add DIV-mask over-or-inside this pane so can 'drag' over IFRAMES - , maskObjects: false // true = add IFRAME-mask over-or-inside this pane to cover objects/applets - content-mask will overlay this mask - , maskZindex: null // will override zIndexes.content_mask if specified - not applicable to iframe-panes - , resizingGrid: false // grid size that the resizers will snap-to during resizing, eg: [20,20] - , livePaneResizing: false // true = LIVE Resizing as resizer is dragged - , liveContentResizing: false // true = re-measure header/footer heights as resizer is dragged - , liveResizingTolerance: 1 // how many px change before pane resizes, to control performance - // SLIDING OPTIONS - , sliderCursor: "pointer" // cursor when resizer-bar will trigger 'sliding' - , slideTrigger_open: "click" // click, dblclick, mouseenter - , slideTrigger_close: "mouseleave"// click, mouseleave - , slideDelay_open: 300 // applies only for mouseenter event - 0 = instant open - , slideDelay_close: 300 // applies only for mouseleave event (300ms is the minimum!) - , hideTogglerOnSlide: false // when pane is slid-open, should the toggler show? - , preventQuickSlideClose: $.layout.browser.webkit // Chrome triggers slideClosed as it is opening - , preventPrematureSlideClose: false // handle incorrect mouseleave trigger, like when over a SELECT-list in IE - // PANE-SPECIFIC TIPS & MESSAGES - , tips: { - Open: "Open" // eg: "Open Pane" - , Close: "Close" - , Resize: "Resize" - , Slide: "Slide Open" - , Pin: "Pin" - , Unpin: "Un-Pin" - , noRoomToOpen: "Not enough room to show this panel." // alert if user tries to open a pane that cannot - , minSizeWarning: "Panel has reached its minimum size" // displays in browser statusbar - , maxSizeWarning: "Panel has reached its maximum size" // ditto - } - // HOT-KEYS & MISC - , showOverflowOnHover: false // will bind allowOverflow() utility to pane.onMouseOver - , enableCursorHotkey: true // enabled 'cursor' hotkeys - //, customHotkey: "" // MUST be pane-specific - EITHER a charCode OR a character - , customHotkeyModifier: "SHIFT" // either 'SHIFT', 'CTRL' or 'CTRL+SHIFT' - NOT 'ALT' - // PANE ANIMATION - // NOTE: fxSss_open, fxSss_close & fxSss_size options (eg: fxName_open) are auto-generated if not passed - , fxName: "slide" // ('none' or blank), slide, drop, scale -- only relevant to 'open' & 'close', NOT 'size' - , fxSpeed: null // slow, normal, fast, 200, nnn - if passed, will OVERRIDE fxSettings.duration - , fxSettings: {} // can be passed, eg: { easing: "easeOutBounce", duration: 1500 } - , fxOpacityFix: true // tries to fix opacity in IE to restore anti-aliasing after animation - , animatePaneSizing: false // true = animate resizing after dragging resizer-bar OR sizePane() is called - /* NOTE: Action-specific FX options are auto-generated from the options above if not specifically set: - fxName_open: "slide" // 'Open' pane animation - fnName_close: "slide" // 'Close' pane animation - fxName_size: "slide" // 'Size' pane animation - when animatePaneSizing = true - fxSpeed_open: null - fxSpeed_close: null - fxSpeed_size: null - fxSettings_open: {} - fxSettings_close: {} - fxSettings_size: {} - */ - // CHILD/NESTED LAYOUTS - , children: null // Layout-options for nested/child layout - even {} is valid as options - , containerSelector: '' // if child is NOT 'directly nested', a selector to find it/them (can have more than one child layout!) - , initChildren: true // true = child layout will be created as soon as _this_ layout completes initialization - , destroyChildren: true // true = destroy child-layout if this pane is destroyed - , resizeChildren: true // true = trigger child-layout.resizeAll() when this pane is resized - // EVENT TRIGGERING - , triggerEventsOnLoad: false // true = trigger onopen OR onclose callbacks when layout initializes - , triggerEventsDuringLiveResize: true // true = trigger onresize callback REPEATEDLY if livePaneResizing==true - // PANE CALLBACKS - , onshow_start: null // CALLBACK when pane STARTS to Show - BEFORE onopen/onhide_start - , onshow_end: null // CALLBACK when pane ENDS being Shown - AFTER onopen/onhide_end - , onhide_start: null // CALLBACK when pane STARTS to Close - BEFORE onclose_start - , onhide_end: null // CALLBACK when pane ENDS being Closed - AFTER onclose_end - , onopen_start: null // CALLBACK when pane STARTS to Open - , onopen_end: null // CALLBACK when pane ENDS being Opened - , onclose_start: null // CALLBACK when pane STARTS to Close - , onclose_end: null // CALLBACK when pane ENDS being Closed - , onresize_start: null // CALLBACK when pane STARTS being Resized ***FOR ANY REASON*** - , onresize_end: null // CALLBACK when pane ENDS being Resized ***FOR ANY REASON*** - , onsizecontent_start: null // CALLBACK when sizing of content-element STARTS - , onsizecontent_end: null // CALLBACK when sizing of content-element ENDS - , onswap_start: null // CALLBACK when pane STARTS to Swap - , onswap_end: null // CALLBACK when pane ENDS being Swapped - , ondrag_start: null // CALLBACK when pane STARTS being ***MANUALLY*** Resized - , ondrag_end: null // CALLBACK when pane ENDS being ***MANUALLY*** Resized - } -/* - * PANE-SPECIFIC SETTINGS - * - options listed below MUST be specified per-pane - they CANNOT be set under 'panes' - * - all options under the 'panes' key can also be set specifically for any pane - * - most options under the 'panes' key apply only to 'border-panes' - NOT the the center-pane - */ -, north: { - paneSelector: ".ui-layout-north" - , size: "auto" // eg: "auto", "30%", .30, 200 - , resizerCursor: "n-resize" // custom = url(myCursor.cur) - , customHotkey: "" // EITHER a charCode (43) OR a character ("o") - } -, south: { - paneSelector: ".ui-layout-south" - , size: "50%"//"auto" - , resizerCursor: "s-resize" - , customHotkey: "" - , initClosed: true - } -, east: { - paneSelector: ".ui-layout-east" - , size: "5%"//200 - , resizerCursor: "e-resize" - , customHotkey: "" - } -, west: { - paneSelector: ".ui-layout-west" - , size: "70%" //200 - , resizerCursor: "w-resize" - , customHotkey: "" - , initClosed: true - } -, center: { - paneSelector: ".ui-layout-center" - , size: "30%"//"auto" - , minWidth: 0 - , minHeight: 0 - } -}; - -$.layout.optionsMap = { - // layout/global options - NOT pane-options - layout: ("name,instanceKey,stateManagement,effects,inset,zIndexes,errors," - + "zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly," - + "outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay," - + "onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end").split(",") -// borderPanes: [ ALL options that are NOT specified as 'layout' ] - // default.panes options that apply to the center-pane (most options apply _only_ to border-panes) -, center: ("paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad," - + "showOverflowOnHover,maskContents,maskObjects,liveContentResizing," - + "containerSelector,children,initChildren,resizeChildren,destroyChildren," - + "onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end").split(",") - // options that MUST be specifically set 'per-pane' - CANNOT set in the panes (defaults) key -, noDefault: ("paneSelector,resizerCursor,customHotkey").split(",") -}; - -/** - * Processes options passed in converts flat-format data into subkey (JSON) format - * In flat-format, subkeys are _currently_ separated with 2 underscores, like north__optName - * Plugins may also call this method so they can transform their own data - * - * @param {!Object} hash Data/options passed by user - may be a single level or nested levels - * @param {boolean=} [addKeys=false] Should the primary layout.options keys be added if they do not exist? - * @return {Object} Returns hash of minWidth & minHeight - */ -$.layout.transformData = function (hash, addKeys) { - var json = addKeys ? { panes: {}, center: {} } : {} // init return object - , branch, optKey, keys, key, val, i, c; - - if (typeof hash !== "object") return json; // no options passed - - // convert all 'flat-keys' to 'sub-key' format - for (optKey in hash) { - branch = json; - val = hash[ optKey ]; - keys = optKey.split("__"); // eg: west__size or north__fxSettings__duration - c = keys.length - 1; - // convert underscore-delimited to subkeys - for (i=0; i <= c; i++) { - key = keys[i]; - if (i === c) { // last key = value - if ($.isPlainObject( val )) - branch[key] = $.layout.transformData( val ); // RECURSE - else - branch[key] = val; - } - else { - if (!branch[key]) - branch[key] = {}; // create the subkey - // recurse to sub-key for next loop - if not done - branch = branch[key]; - } - } - } - return json; -}; - -// INTERNAL CONFIG DATA - DO NOT CHANGE THIS! -$.layout.backwardCompatibility = { - // data used by renameOldOptions() - map: { - // OLD Option Name: NEW Option Name - applyDefaultStyles: "applyDemoStyles" - // CHILD/NESTED LAYOUTS - , childOptions: "children" - , initChildLayout: "initChildren" - , destroyChildLayout: "destroyChildren" - , resizeChildLayout: "resizeChildren" - , resizeNestedLayout: "resizeChildren" - // MISC Options - , resizeWhileDragging: "livePaneResizing" - , resizeContentWhileDragging: "liveContentResizing" - , triggerEventsWhileDragging: "triggerEventsDuringLiveResize" - , maskIframesOnResize: "maskContents" - // STATE MANAGEMENT - , useStateCookie: "stateManagement.enabled" - , "cookie.autoLoad": "stateManagement.autoLoad" - , "cookie.autoSave": "stateManagement.autoSave" - , "cookie.keys": "stateManagement.stateKeys" - , "cookie.name": "stateManagement.cookie.name" - , "cookie.domain": "stateManagement.cookie.domain" - , "cookie.path": "stateManagement.cookie.path" - , "cookie.expires": "stateManagement.cookie.expires" - , "cookie.secure": "stateManagement.cookie.secure" - // OLD Language options - , noRoomToOpenTip: "tips.noRoomToOpen" - , togglerTip_open: "tips.Close" // open = Close - , togglerTip_closed: "tips.Open" // closed = Open - , resizerTip: "tips.Resize" - , sliderTip: "tips.Slide" - } - -/** -* @param {Object} opts -*/ -, renameOptions: function (opts) { - var map = $.layout.backwardCompatibility.map - , oldData, newData, value - ; - for (var itemPath in map) { - oldData = getBranch( itemPath ); - value = oldData.branch[ oldData.key ]; - if (value !== undefined) { - newData = getBranch( map[itemPath], true ); - newData.branch[ newData.key ] = value; - delete oldData.branch[ oldData.key ]; - } - } - - /** - * @param {string} path - * @param {boolean=} [create=false] Create path if does not exist - */ - function getBranch (path, create) { - var a = path.split(".") // split keys into array - , c = a.length - 1 - , D = { branch: opts, key: a[c] } // init branch at top & set key (last item) - , i = 0, k, undef; - for (; i 0) { - if (autoHide && $E.data('autoHidden') && $E.innerHeight() > 0) { - $E.show().data('autoHidden', false); - if (!browser.mozilla) // FireFox refreshes iframes - IE does not - // make hidden, then visible to 'refresh' display after animation - $E.css(_c.hidden).css(_c.visible); - } - } - else if (autoHide && !$E.data('autoHidden')) - $E.hide().data('autoHidden', true); - } - - /** - * @param {(string|!Object)} el - * @param {number=} outerHeight - * @param {boolean=} [autoHide=false] - */ -, setOuterHeight = function (el, outerHeight, autoHide) { - var $E = el, h; - if (isStr(el)) $E = $Ps[el]; // west - else if (!el.jquery) $E = $(el); - h = cssH($E, outerHeight); - $E.css({ height: h, visibility: "visible" }); // may have been 'hidden' by sizeContent - if (h > 0 && $E.innerWidth() > 0) { - if (autoHide && $E.data('autoHidden')) { - $E.show().data('autoHidden', false); - if (!browser.mozilla) // FireFox refreshes iframes - IE does not - $E.css(_c.hidden).css(_c.visible); - } - } - else if (autoHide && !$E.data('autoHidden')) - $E.hide().data('autoHidden', true); - } - - - /** - * Converts any 'size' params to a pixel/integer size, if not already - * If 'auto' or a decimal/percentage is passed as 'size', a pixel-size is calculated - * - /** - * @param {string} pane - * @param {(string|number)=} size - * @param {string=} [dir] - * @return {number} - */ -, _parseSize = function (pane, size, dir) { - if (!dir) dir = _c[pane].dir; - - if (isStr(size) && size.match(/%/)) - size = (size === '100%') ? -1 : parseInt(size, 10) / 100; // convert % to decimal - - if (size === 0) - return 0; - else if (size >= 1) - return parseInt(size, 10); - - var o = options, avail = 0; - if (dir=="horz") // north or south or center.minHeight - avail = sC.innerHeight - ($Ps.north ? o.north.spacing_open : 0) - ($Ps.south ? o.south.spacing_open : 0); - else if (dir=="vert") // east or west or center.minWidth - avail = sC.innerWidth - ($Ps.west ? o.west.spacing_open : 0) - ($Ps.east ? o.east.spacing_open : 0); - - if (size === -1) // -1 == 100% - return avail; - else if (size > 0) // percentage, eg: .25 - return round(avail * size); - else if (pane=="center") - return 0; - else { // size < 0 || size=='auto' || size==Missing || size==Invalid - // auto-size the pane - var dim = (dir === "horz" ? "height" : "width") - , $P = $Ps[pane] - , $C = dim === 'height' ? $Cs[pane] : false - , vis = $.layout.showInvisibly($P) // show pane invisibly if hidden - , szP = $P.css(dim) // SAVE current pane size - , szC = $C ? $C.css(dim) : 0 // SAVE current content size - ; - $P.css(dim, "auto"); - if ($C) $C.css(dim, "auto"); - size = (dim === "height") ? $P.outerHeight() : $P.outerWidth(); // MEASURE - $P.css(dim, szP).css(vis); // RESET size & visibility - if ($C) $C.css(dim, szC); - return size; - } - } - - /** - * Calculates current 'size' (outer-width or outer-height) of a border-pane - optionally with 'pane-spacing' added - * - * @param {(string|!Object)} pane - * @param {boolean=} [inclSpace=false] - * @return {number} Returns EITHER Width for east/west panes OR Height for north/south panes - */ -, getPaneSize = function (pane, inclSpace) { - var - $P = $Ps[pane] - , o = options[pane] - , s = state[pane] - , oSp = (inclSpace ? o.spacing_open : 0) - , cSp = (inclSpace ? o.spacing_closed : 0) - ; - if (!$P || s.isHidden) - return 0; - else if (s.isClosed || (s.isSliding && inclSpace)) - return cSp; - else if (_c[pane].dir === "horz") - return $P.outerHeight() + oSp; - else // dir === "vert" - return $P.outerWidth() + oSp; - } - - /** - * Calculate min/max pane dimensions and limits for resizing - * - * @param {string} pane - * @param {boolean=} [slide=false] - */ -, setSizeLimits = function (pane, slide) { - if (!isInitialized()) return; - var - o = options[pane] - , s = state[pane] - , c = _c[pane] - , dir = c.dir - , type = c.sizeType.toLowerCase() - , isSliding = (slide != undefined ? slide : s.isSliding) // only open() passes 'slide' param - , $P = $Ps[pane] - , paneSpacing = o.spacing_open - // measure the pane on the *opposite side* from this pane - , altPane = _c.oppositeEdge[pane] - , altS = state[altPane] - , $altP = $Ps[altPane] - , altPaneSize = (!$altP || altS.isVisible===false || altS.isSliding ? 0 : (dir=="horz" ? $altP.outerHeight() : $altP.outerWidth())) - , altPaneSpacing = ((!$altP || altS.isHidden ? 0 : options[altPane][ altS.isClosed !== false ? "spacing_closed" : "spacing_open" ]) || 0) - // limitSize prevents this pane from 'overlapping' opposite pane - , containerSize = (dir=="horz" ? sC.innerHeight : sC.innerWidth) - , minCenterDims = cssMinDims("center") - , minCenterSize = dir=="horz" ? max(options.center.minHeight, minCenterDims.minHeight) : max(options.center.minWidth, minCenterDims.minWidth) - // if pane is 'sliding', then ignore center and alt-pane sizes - because 'overlays' them - , limitSize = (containerSize - paneSpacing - (isSliding ? 0 : (_parseSize("center", minCenterSize, dir) + altPaneSize + altPaneSpacing))) - , minSize = s.minSize = max( _parseSize(pane, o.minSize), cssMinDims(pane).minSize ) - , maxSize = s.maxSize = min( (o.maxSize ? _parseSize(pane, o.maxSize) : 100000), limitSize ) - , r = s.resizerPosition = {} // used to set resizing limits - , top = sC.inset.top - , left = sC.inset.left - , W = sC.innerWidth - , H = sC.innerHeight - , rW = o.spacing_open // subtract resizer-width to get top/left position for south/east - ; - switch (pane) { - case "north": r.min = top + minSize; - r.max = top + maxSize; - break; - case "west": r.min = left + minSize; - r.max = left + maxSize; - break; - case "south": r.min = top + H - maxSize - rW; - r.max = top + H - minSize - rW; - break; - case "east": r.min = left + W - maxSize - rW; - r.max = left + W - minSize - rW; - break; - }; - } - - /** - * Returns data for setting the size/position of center pane. Also used to set Height for east/west panes - * - * @return JSON Returns a hash of all dimensions: top, bottom, left, right, (outer) width and (outer) height - */ -, calcNewCenterPaneDims = function () { - var d = { - top: getPaneSize("north", true) // true = include 'spacing' value for pane - , bottom: getPaneSize("south", true) - , left: getPaneSize("west", true) - , right: getPaneSize("east", true) - , width: 0 - , height: 0 - }; - - // NOTE: sC = state.container - // calc center-pane outer dimensions - d.width = sC.innerWidth - d.left - d.right; // outerWidth - d.height = sC.innerHeight - d.bottom - d.top; // outerHeight - // add the 'container border/padding' to get final positions relative to the container - d.top += sC.inset.top; - d.bottom += sC.inset.bottom; - d.left += sC.inset.left; - d.right += sC.inset.right; - - return d; - } - - - /** - * @param {!Object} el - * @param {boolean=} [allStates=false] - */ -, getHoverClasses = function (el, allStates) { - var - $El = $(el) - , type = $El.data("layoutRole") - , pane = $El.data("layoutEdge") - , o = options[pane] - , root = o[type +"Class"] - , _pane = "-"+ pane // eg: "-west" - , _open = "-open" - , _closed = "-closed" - , _slide = "-sliding" - , _hover = "-hover " // NOTE the trailing space - , _state = $El.hasClass(root+_closed) ? _closed : _open - , _alt = _state === _closed ? _open : _closed - , classes = (root+_hover) + (root+_pane+_hover) + (root+_state+_hover) + (root+_pane+_state+_hover) - ; - if (allStates) // when 'removing' classes, also remove alternate-state classes - classes += (root+_alt+_hover) + (root+_pane+_alt+_hover); - - if (type=="resizer" && $El.hasClass(root+_slide)) - classes += (root+_slide+_hover) + (root+_pane+_slide+_hover); - - return $.trim(classes); - } -, addHover = function (evt, el) { - var $E = $(el || this); - if (evt && $E.data("layoutRole") === "toggler") - evt.stopPropagation(); // prevent triggering 'slide' on Resizer-bar - $E.addClass( getHoverClasses($E) ); - } -, removeHover = function (evt, el) { - var $E = $(el || this); - $E.removeClass( getHoverClasses($E, true) ); - } - -, onResizerEnter = function (evt) { // ALSO called by toggler.mouseenter - var pane = $(this).data("layoutEdge") - , s = state[pane] - , $d = $(document) - ; - // ignore closed-panes and mouse moving back & forth over resizer! - // also ignore if ANY pane is currently resizing - if ( s.isResizing || state.paneResizing ) return; - - if (options.maskPanesEarly) - showMasks( pane, { resizing: true }); - } -, onResizerLeave = function (evt, el) { - var e = el || this // el is only passed when called by the timer - , pane = $(e).data("layoutEdge") - , name = pane +"ResizerLeave" - , $d = $(document) - ; - timer.clear(pane+"_openSlider"); // cancel slideOpen timer, if set - timer.clear(name); // cancel enableSelection timer - may re/set below - // this method calls itself on a timer because it needs to allow - // enough time for dragging to kick-in and set the isResizing flag - // dragging has a 100ms delay set, so this delay must be >100 - if (!el) // 1st call - mouseleave event - timer.set(name, function(){ onResizerLeave(evt, e); }, 200); - // if user is resizing, dragStop will reset everything, so skip it here - else if (options.maskPanesEarly && !state.paneResizing) // 2nd call - by timer - hideMasks(); - } - -/* - * ########################### - * INITIALIZATION METHODS - * ########################### - */ - - /** - * Initialize the layout - called automatically whenever an instance of layout is created - * - * @see none - triggered onInit - * @return mixed true = fully initialized | false = panes not initialized (yet) | 'cancel' = abort - */ -, _create = function () { - // initialize config/options - initOptions(); - var o = options - , s = state; - - // TEMP state so isInitialized returns true during init process - s.creatingLayout = true; - - // init plugins for this layout, if there are any (eg: stateManagement) - runPluginCallbacks( Instance, $.layout.onCreate ); - - // options & state have been initialized, so now run beforeLoad callback - // onload will CANCEL layout creation if it returns false - if (false === _runCallbacks("onload_start")) - return 'cancel'; - - // initialize the container element - _initContainer(); - - // bind hotkey function - keyDown - if required - initHotkeys(); - - // bind window.onunload - $(window).bind("unload."+ sID, unload); - - // init plugins for this layout, if there are any (eg: customButtons) - runPluginCallbacks( Instance, $.layout.onLoad ); - - // if layout elements are hidden, then layout WILL NOT complete initialization! - // initLayoutElements will set initialized=true and run the onload callback IF successful - if (o.initPanes) _initLayoutElements(); - - delete s.creatingLayout; - - return state.initialized; - } - - /** - * Initialize the layout IF not already - * - * @see All methods in Instance run this test - * @return boolean true = layoutElements have been initialized | false = panes are not initialized (yet) - */ -, isInitialized = function () { - if (state.initialized || state.creatingLayout) return true; // already initialized - else return _initLayoutElements(); // try to init panes NOW - } - - /** - * Initialize the layout - called automatically whenever an instance of layout is created - * - * @see _create() & isInitialized - * @param {boolean=} [retry=false] // indicates this is a 2nd try - * @return An object pointer to the instance created - */ -, _initLayoutElements = function (retry) { - // initialize config/options - var o = options; - // CANNOT init panes inside a hidden container! - if (!$N.is(":visible")) { - // handle Chrome bug where popup window 'has no height' - // if layout is BODY element, try again in 50ms - // SEE: http://layout.jquery-dev.com/samples/test_popup_window.html - if ( !retry && browser.webkit && $N[0].tagName === "BODY" ) - setTimeout(function(){ _initLayoutElements(true); }, 50); - return false; - } - - // a center pane is required, so make sure it exists - if (!getPane("center").length) { - return _log( o.errors.centerPaneMissing ); - } - - // TEMP state so isInitialized returns true during init process - state.creatingLayout = true; - - // update Container dims - $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT include insetX values - - // initialize all layout elements - initPanes(); // size & position panes - calls initHandles() - which calls initResizable() - - if (o.scrollToBookmarkOnLoad) { - var l = self.location; - if (l.hash) l.replace( l.hash ); // scrollTo Bookmark - } - - // check to see if this layout 'nested' inside a pane - if (Instance.hasParentLayout) - o.resizeWithWindow = false; - // bind resizeAll() for 'this layout instance' to window.resize event - else if (o.resizeWithWindow) - $(window).bind("resize."+ sID, windowResize); - - delete state.creatingLayout; - state.initialized = true; - - // init plugins for this layout, if there are any - runPluginCallbacks( Instance, $.layout.onReady ); - - // now run the onload callback, if exists - _runCallbacks("onload_end"); - - return true; // elements initialized successfully - } - - /** - * Initialize nested layouts for a specific pane - can optionally pass layout-options - * - * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west - * @param {Object=} [opts] Layout-options - if passed, will OVERRRIDE options[pane].children - * @return An object pointer to the layout instance created - or null - */ -, createChildren = function (evt_or_pane, opts) { - var pane = evtPane.call(this, evt_or_pane) - , $P = $Ps[pane] - ; - if (!$P) return; - var $C = $Cs[pane] - , s = state[pane] - , o = options[pane] - , sm = options.stateManagement || {} - , cos = opts ? (o.children = opts) : o.children - ; - if ( $.isPlainObject( cos ) ) - cos = [ cos ]; // convert a hash to a 1-elem array - else if (!cos || !$.isArray( cos )) - return; - - $.each( cos, function (idx, co) { - if ( !$.isPlainObject( co ) ) return; - - // determine which element is supposed to be the 'child container' - // if pane has a 'containerSelector' OR a 'content-div', use those instead of the pane - var $containers = co.containerSelector ? $P.find( co.containerSelector ) : ($C || $P); - - $containers.each(function(){ - var $cont = $(this) - , child = $cont.data("layout") // see if a child-layout ALREADY exists on this element - ; - // if no layout exists, but children are set, try to create the layout now - if (!child) { - // TODO: see about moving this to the stateManagement plugin, as a method - // set a unique child-instance key for this layout, if not already set - setInstanceKey({ container: $cont, options: co }, s ); - // If THIS layout has a hash in stateManagement.autoLoad, - // then see if it also contains state-data for this child-layout - // If so, copy the stateData to child.options.stateManagement.autoLoad - if ( sm.includeChildren && state.stateData[pane] ) { - // THIS layout's state was cached when its state was loaded - var paneChildren = state.stateData[pane].children || {} - , childState = paneChildren[ co.instanceKey ] - , co_sm = co.stateManagement || (co.stateManagement = { autoLoad: true }) - ; - // COPY the stateData into the autoLoad key - if ( co_sm.autoLoad === true && childState ) { - co_sm.autoSave = false; // disable autoSave because saving handled by parent-layout - co_sm.includeChildren = true; // cascade option - FOR NOW - co_sm.autoLoad = $.extend(true, {}, childState); // COPY the state-hash - } - } - - // create the layout - child = $cont.layout( co ); - - // if successful, update data - if (child) { - // add the child and update all layout-pointers - // MAY have already been done by child-layout calling parent.refreshChildren() - refreshChildren( pane, child ); - } - } - }); - }); - } - -, setInstanceKey = function (child, parentPaneState) { - // create a named key for use in state and instance branches - var $c = child.container - , o = child.options - , sm = o.stateManagement - , key = o.instanceKey || $c.data("layoutInstanceKey") - ; - if (!key) key = (sm && sm.cookie ? sm.cookie.name : '') || o.name; // look for a name/key - if (!key) key = "layout"+ (++parentPaneState.childIdx); // if no name/key found, generate one - else key = key.replace(/[^\w-]/gi, '_').replace(/_{2,}/g, '_'); // ensure is valid as a hash key - o.instanceKey = key; - $c.data("layoutInstanceKey", key); // useful if layout is destroyed and then recreated - return key; - } - - /** - * @param {string} pane The pane being opened, ie: north, south, east, or west - * @param {Object=} newChild New child-layout Instance to add to this pane - */ -, refreshChildren = function (pane, newChild) { - var $P = $Ps[pane] - , pC = children[pane] - , s = state[pane] - , o - ; - // check for destroy()ed layouts and update the child pointers & arrays - if ($.isPlainObject( pC )) { - $.each( pC, function (key, child) { - if (child.destroyed) delete pC[key] - }); - // if no more children, remove the children hash - if ($.isEmptyObject( pC )) - pC = children[pane] = null; // clear children hash - } - - // see if there is a directly-nested layout inside this pane - // if there is, then there can be only ONE child-layout, so check that... - if (!newChild && !pC) { - newChild = $P.data("layout"); - } - - // if a newChild instance was passed, add it to children[pane] - if (newChild) { - // update child.state - newChild.hasParentLayout = true; // set parent-flag in child - // instanceKey is a key-name used in both state and children - o = newChild.options; - // set a unique child-instance key for this layout, if not already set - setInstanceKey( newChild, s ); - // add pointer to pane.children hash - if (!pC) pC = children[pane] = {}; // create an empty children hash - pC[ o.instanceKey ] = newChild.container.data("layout"); // add childLayout instance - } - - // ALWAYS refresh the pane.children alias, even if null - Instance[pane].children = children[pane]; - - // if newChild was NOT passed - see if there is a child layout NOW - if (!newChild) { - createChildren(pane); // MAY create a child and re-call this method - } - } - -, windowResize = function () { - var o = options - , delay = Number(o.resizeWithWindowDelay); - if (delay < 10) delay = 100; // MUST have a delay! - // resizing uses a delay-loop because the resize event fires repeatly - except in FF, but delay anyway - timer.clear("winResize"); // if already running - timer.set("winResize", function(){ - timer.clear("winResize"); - timer.clear("winResizeRepeater"); - var dims = elDims( $N, o.inset ); - // only trigger resizeAll() if container has changed size - if (dims.innerWidth !== sC.innerWidth || dims.innerHeight !== sC.innerHeight) - resizeAll(); - }, delay); - // ALSO set fixed-delay timer, if not already running - if (!timer.data["winResizeRepeater"]) setWindowResizeRepeater(); - } - -, setWindowResizeRepeater = function () { - var delay = Number(options.resizeWithWindowMaxDelay); - if (delay > 0) - timer.set("winResizeRepeater", function(){ setWindowResizeRepeater(); resizeAll(); }, delay); - } - -, unload = function () { - var o = options; - - _runCallbacks("onunload_start"); - - // trigger plugin callabacks for this layout (eg: stateManagement) - runPluginCallbacks( Instance, $.layout.onUnload ); - - _runCallbacks("onunload_end"); - } - - /** - * Validate and initialize container CSS and events - * - * @see _create() - */ -, _initContainer = function () { - var - N = $N[0] - , $H = $("html") - , tag = sC.tagName = N.tagName - , id = sC.id = N.id - , cls = sC.className = N.className - , o = options - , name = o.name - , props = "position,margin,padding,border" - , css = "layoutCSS" - , CSS = {} - , hid = "hidden" // used A LOT! - // see if this container is a 'pane' inside an outer-layout - , parent = $N.data("parentLayout") // parent-layout Instance - , pane = $N.data("layoutEdge") // pane-name in parent-layout - , isChild = parent && pane - , num = $.layout.cssNum - , $parent, n - ; - // sC = state.container - sC.selector = $N.selector.split(".slice")[0]; - sC.ref = (o.name ? o.name +' layout / ' : '') + tag + (id ? "#"+id : cls ? '.['+cls+']' : ''); // used in messages - sC.isBody = (tag === "BODY"); - - // try to find a parent-layout - if (!isChild && !sC.isBody) { - $parent = $N.closest("."+ $.layout.defaults.panes.paneClass); - parent = $parent.data("parentLayout"); - pane = $parent.data("layoutEdge"); - isChild = parent && pane; - } - - $N .data({ - layout: Instance - , layoutContainer: sID // FLAG to indicate this is a layout-container - contains unique internal ID - }) - .addClass(o.containerClass) - ; - var layoutMethods = { - destroy: '' - , initPanes: '' - , resizeAll: 'resizeAll' - , resize: 'resizeAll' - }; - // loop hash and bind all methods - include layoutID namespacing - for (name in layoutMethods) { - $N.bind("layout"+ name.toLowerCase() +"."+ sID, Instance[ layoutMethods[name] || name ]); - } - - // if this container is another layout's 'pane', then set child/parent pointers - if (isChild) { - // update parent flag - Instance.hasParentLayout = true; - // set pointers to THIS child-layout (Instance) in parent-layout - parent.refreshChildren( pane, Instance ); - } - - // SAVE original container CSS for use in destroy() - if (!$N.data(css)) { - // handle props like overflow different for BODY & HTML - has 'system default' values - if (sC.isBody) { - // SAVE CSS - $N.data(css, $.extend( styles($N, props), { - height: $N.css("height") - , overflow: $N.css("overflow") - , overflowX: $N.css("overflowX") - , overflowY: $N.css("overflowY") - })); - // ALSO SAVE CSS - $H.data(css, $.extend( styles($H, 'padding'), { - height: "auto" // FF would return a fixed px-size! - , overflow: $H.css("overflow") - , overflowX: $H.css("overflowX") - , overflowY: $H.css("overflowY") - })); - } - else // handle props normally for non-body elements - $N.data(css, styles($N, props+",top,bottom,left,right,width,height,overflow,overflowX,overflowY") ); - } - - try { - // common container CSS - CSS = { - overflow: hid - , overflowX: hid - , overflowY: hid - }; - $N.css( CSS ); - - if (o.inset && !$.isPlainObject(o.inset)) { - // can specify a single number for equal outset all-around - n = parseInt(o.inset, 10) || 0 - o.inset = { - top: n - , bottom: n - , left: n - , right: n - }; - } - - // format html & body if this is a full page layout - if (sC.isBody) { - // if HTML has padding, use this as an outer-spacing around BODY - if (!o.outset) { - // use padding from parent-elem (HTML) as outset - o.outset = { - top: num($H, "paddingTop") - , bottom: num($H, "paddingBottom") - , left: num($H, "paddingLeft") - , right: num($H, "paddingRight") - }; - } - else if (!$.isPlainObject(o.outset)) { - // can specify a single number for equal outset all-around - n = parseInt(o.outset, 10) || 0 - o.outset = { - top: n - , bottom: n - , left: n - , right: n - }; - } - // HTML - $H.css( CSS ).css({ - height: "100%" - , border: "none" // no border or padding allowed when using height = 100% - , padding: 0 // ditto - , margin: 0 - }); - // BODY - if (browser.isIE6) { - // IE6 CANNOT use the trick of setting absolute positioning on all 4 sides - must have 'height' - $N.css({ - width: "100%" - , height: "100%" - , border: "none" // no border or padding allowed when using height = 100% - , padding: 0 // ditto - , margin: 0 - , position: "relative" - }); - // convert body padding to an inset option - the border cannot be measured in IE6! - if (!o.inset) o.inset = elDims( $N ).inset; - } - else { // use absolute positioning for BODY to allow borders & padding without overflow - $N.css({ - width: "auto" - , height: "auto" - , margin: 0 - , position: "absolute" // allows for border and padding on BODY - }); - // apply edge-positioning created above - $N.css( o.outset ); - } - // set current layout-container dimensions - $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT include insetX values - } - else { - // container MUST have 'position' - var p = $N.css("position"); - if (!p || !p.match(/(fixed|absolute|relative)/)) - $N.css("position","relative"); - - // set current layout-container dimensions - if ( $N.is(":visible") ) { - $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT change insetX (padding) values - if (sC.innerHeight < 1) // container has no 'height' - warn developer - _log( o.errors.noContainerHeight.replace(/CONTAINER/, sC.ref) ); - } - } - - // if container has min-width/height, then enable scrollbar(s) - if ( num($N, "minWidth") ) $N.parent().css("overflowX","auto"); - if ( num($N, "minHeight") ) $N.parent().css("overflowY","auto"); - - } catch (ex) {} - } - - /** - * Bind layout hotkeys - if options enabled - * - * @see _create() and addPane() - * @param {string=} [panes=""] The edge(s) to process - */ -, initHotkeys = function (panes) { - panes = panes ? panes.split(",") : _c.borderPanes; - // bind keyDown to capture hotkeys, if option enabled for ANY pane - $.each(panes, function (i, pane) { - var o = options[pane]; - if (o.enableCursorHotkey || o.customHotkey) { - $(document).bind("keydown."+ sID, keyDown); // only need to bind this ONCE - return false; // BREAK - binding was done - } - }); - } - - /** - * Build final OPTIONS data - * - * @see _create() - */ -, initOptions = function () { - var data, d, pane, key, val, i, c, o; - - // reprocess user's layout-options to have correct options sub-key structure - opts = $.layout.transformData( opts, true ); // panes = default subkey - - // auto-rename old options for backward compatibility - opts = $.layout.backwardCompatibility.renameAllOptions( opts ); - - // if user-options has 'panes' key (pane-defaults), clean it... - if (!$.isEmptyObject(opts.panes)) { - // REMOVE any pane-defaults that MUST be set per-pane - data = $.layout.optionsMap.noDefault; - for (i=0, c=data.length; i 0) { - z.pane_normal = zo; - z.content_mask = max(zo+1, z.content_mask); // MIN = +1 - z.resizer_normal = max(zo+2, z.resizer_normal); // MIN = +2 - } - - // DELETE 'panes' key now that we are done - values were copied to EACH pane - delete options.panes; - - - function createFxOptions ( pane ) { - var o = options[pane] - , d = options.panes; - // ensure fxSettings key to avoid errors - if (!o.fxSettings) o.fxSettings = {}; - if (!d.fxSettings) d.fxSettings = {}; - - $.each(["_open","_close","_size"], function (i,n) { - var - sName = "fxName"+ n - , sSpeed = "fxSpeed"+ n - , sSettings = "fxSettings"+ n - // recalculate fxName according to specificity rules - , fxName = o[sName] = - o[sName] // options.west.fxName_open - || d[sName] // options.panes.fxName_open - || o.fxName // options.west.fxName - || d.fxName // options.panes.fxName - || "none" // MEANS $.layout.defaults.panes.fxName == "" || false || null || 0 - , fxExists = $.effects && ($.effects[fxName] || ($.effects.effect && $.effects.effect[fxName])) - ; - // validate fxName to ensure is valid effect - MUST have effect-config data in options.effects - if (fxName === "none" || !options.effects[fxName] || !fxExists) - fxName = o[sName] = "none"; // effect not loaded OR unrecognized fxName - - // set vars for effects subkeys to simplify logic - var fx = options.effects[fxName] || {} // effects.slide - , fx_all = fx.all || null // effects.slide.all - , fx_pane = fx[pane] || null // effects.slide.west - ; - // create fxSpeed[_open|_close|_size] - o[sSpeed] = - o[sSpeed] // options.west.fxSpeed_open - || d[sSpeed] // options.west.fxSpeed_open - || o.fxSpeed // options.west.fxSpeed - || d.fxSpeed // options.panes.fxSpeed - || null // DEFAULT - let fxSetting.duration control speed - ; - // create fxSettings[_open|_close|_size] - o[sSettings] = $.extend( - true - , {} - , fx_all // effects.slide.all - , fx_pane // effects.slide.west - , d.fxSettings // options.panes.fxSettings - , o.fxSettings // options.west.fxSettings - , d[sSettings] // options.panes.fxSettings_open - , o[sSettings] // options.west.fxSettings_open - ); - }); - - // DONE creating action-specific-settings for this pane, - // so DELETE generic options - are no longer meaningful - delete o.fxName; - delete o.fxSpeed; - delete o.fxSettings; - } - } - - /** - * Initialize module objects, styling, size and position for all panes - * - * @see _initElements() - * @param {string} pane The pane to process - */ -, getPane = function (pane) { - var sel = options[pane].paneSelector - if (sel.substr(0,1)==="#") // ID selector - // NOTE: elements selected 'by ID' DO NOT have to be 'children' - return $N.find(sel).eq(0); - else { // class or other selector - var $P = $N.children(sel).eq(0); - // look for the pane nested inside a 'form' element - return $P.length ? $P : $N.children("form:first").children(sel).eq(0); - } - } - - /** - * @param {Object=} evt - */ -, initPanes = function (evt) { - // stopPropagation if called by trigger("layoutinitpanes") - use evtPane utility - evtPane(evt); - - // NOTE: do north & south FIRST so we can measure their height - do center LAST - $.each(_c.allPanes, function (idx, pane) { - addPane( pane, true ); - }); - - // init the pane-handles NOW in case we have to hide or close the pane below - initHandles(); - - // now that all panes have been initialized and initially-sized, - // make sure there is really enough space available for each pane - $.each(_c.borderPanes, function (i, pane) { - if ($Ps[pane] && state[pane].isVisible) { // pane is OPEN - setSizeLimits(pane); - makePaneFit(pane); // pane may be Closed, Hidden or Resized by makePaneFit() - } - }); - // size center-pane AGAIN in case we 'closed' a border-pane in loop above - sizeMidPanes("center"); - - // Chrome/Webkit sometimes fires callbacks BEFORE it completes resizing! - // Before RC30.3, there was a 10ms delay here, but that caused layout - // to load asynchrously, which is BAD, so try skipping delay for now - - // process pane contents and callbacks, and init/resize child-layout if exists - $.each(_c.allPanes, function (idx, pane) { - afterInitPane(pane); - }); - } - - /** - * Add a pane to the layout - subroutine of initPanes() - * - * @see initPanes() - * @param {string} pane The pane to process - * @param {boolean=} [force=false] Size content after init - */ -, addPane = function (pane, force) { - if ( !force && !isInitialized() ) return; - var - o = options[pane] - , s = state[pane] - , c = _c[pane] - , dir = c.dir - , fx = s.fx - , spacing = o.spacing_open || 0 - , isCenter = (pane === "center") - , CSS = {} - , $P = $Ps[pane] - , size, minSize, maxSize, child - ; - // if pane-pointer already exists, remove the old one first - if ($P) - removePane( pane, false, true, false ); - else - $Cs[pane] = false; // init - - $P = $Ps[pane] = getPane(pane); - if (!$P.length) { - $Ps[pane] = false; // logic - return; - } - - // SAVE original Pane CSS - if (!$P.data("layoutCSS")) { - var props = "position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"; - $P.data("layoutCSS", styles($P, props)); - } - - // create alias for pane data in Instance - initHandles will add more - Instance[pane] = { - name: pane - , pane: $Ps[pane] - , content: $Cs[pane] - , options: options[pane] - , state: state[pane] - , children: children[pane] - }; - - // add classes, attributes & events - $P .data({ - parentLayout: Instance // pointer to Layout Instance - , layoutPane: Instance[pane] // NEW pointer to pane-alias-object - , layoutEdge: pane - , layoutRole: "pane" - }) - .css(c.cssReq).css("zIndex", options.zIndexes.pane_normal) - .css(o.applyDemoStyles ? c.cssDemo : {}) // demo styles - .addClass( o.paneClass +" "+ o.paneClass+"-"+pane ) // default = "ui-layout-pane ui-layout-pane-west" - may be a dupe of 'paneSelector' - .bind("mouseenter."+ sID, addHover ) - .bind("mouseleave."+ sID, removeHover ) - ; - var paneMethods = { - hide: '' - , show: '' - , toggle: '' - , close: '' - , open: '' - , slideOpen: '' - , slideClose: '' - , slideToggle: '' - , size: 'sizePane' - , sizePane: 'sizePane' - , sizeContent: '' - , sizeHandles: '' - , enableClosable: '' - , disableClosable: '' - , enableSlideable: '' - , disableSlideable: '' - , enableResizable: '' - , disableResizable: '' - , swapPanes: 'swapPanes' - , swap: 'swapPanes' - , move: 'swapPanes' - , removePane: 'removePane' - , remove: 'removePane' - , createChildren: '' - , resizeChildren: '' - , resizeAll: 'resizeAll' - , resizeLayout: 'resizeAll' - } - , name; - // loop hash and bind all methods - include layoutID namespacing - for (name in paneMethods) { - $P.bind("layoutpane"+ name.toLowerCase() +"."+ sID, Instance[ paneMethods[name] || name ]); - } - - // see if this pane has a 'scrolling-content element' - initContent(pane, false); // false = do NOT sizeContent() - called later - - if (!isCenter) { - // call _parseSize AFTER applying pane classes & styles - but before making visible (if hidden) - // if o.size is auto or not valid, then MEASURE the pane and use that as its 'size' - size = s.size = _parseSize(pane, o.size); - minSize = _parseSize(pane,o.minSize) || 1; - maxSize = _parseSize(pane,o.maxSize) || 100000; - if (size > 0) size = max(min(size, maxSize), minSize); - s.autoResize = o.autoResize; // used with percentage sizes - - // state for border-panes - s.isClosed = false; // true = pane is closed - s.isSliding = false; // true = pane is currently open by 'sliding' over adjacent panes - s.isResizing= false; // true = pane is in process of being resized - s.isHidden = false; // true = pane is hidden - no spacing, resizer or toggler is visible! - - // array for 'pin buttons' whose classNames are auto-updated on pane-open/-close - if (!s.pins) s.pins = []; - } - // states common to ALL panes - s.tagName = $P[0].tagName; - s.edge = pane; // useful if pane is (or about to be) 'swapped' - easy find out where it is (or is going) - s.noRoom = false; // true = pane 'automatically' hidden due to insufficient room - will unhide automatically - s.isVisible = true; // false = pane is invisible - closed OR hidden - simplify logic - - // init pane positioning - setPanePosition( pane ); - - // if pane is not visible, - if (dir === "horz") // north or south pane - CSS.height = cssH($P, size); - else if (dir === "vert") // east or west pane - CSS.width = cssW($P, size); - //else if (isCenter) {} - - $P.css(CSS); // apply size -- top, bottom & height will be set by sizeMidPanes - if (dir != "horz") sizeMidPanes(pane, true); // true = skipCallback - - // if manually adding a pane AFTER layout initialization, then... - if (state.initialized) { - initHandles( pane ); - initHotkeys( pane ); - } - - // close or hide the pane if specified in settings - if (o.initClosed && o.closable && !o.initHidden) - close(pane, true, true); // true, true = force, noAnimation - else if (o.initHidden || o.initClosed) - hide(pane); // will be completely invisible - no resizer or spacing - else if (!s.noRoom) - // make the pane visible - in case was initially hidden - $P.css("display","block"); - // ELSE setAsOpen() - called later by initHandles() - - // RESET visibility now - pane will appear IF display:block - $P.css("visibility","visible"); - - // check option for auto-handling of pop-ups & drop-downs - if (o.showOverflowOnHover) - $P.hover( allowOverflow, resetOverflow ); - - // if manually adding a pane AFTER layout initialization, then... - if (state.initialized) { - afterInitPane( pane ); - } - } - -, afterInitPane = function (pane) { - var $P = $Ps[pane] - , s = state[pane] - , o = options[pane] - ; - if (!$P) return; - - // see if there is a directly-nested layout inside this pane - if ($P.data("layout")) - refreshChildren( pane, $P.data("layout") ); - - // process pane contents and callbacks, and init/resize child-layout if exists - if (s.isVisible) { // pane is OPEN - if (state.initialized) // this pane was added AFTER layout was created - resizeAll(); // will also sizeContent - else - sizeContent(pane); - - if (o.triggerEventsOnLoad) - _runCallbacks("onresize_end", pane); - else // automatic if onresize called, otherwise call it specifically - // resize child - IF inner-layout already exists (created before this layout) - resizeChildren(pane, true); // a previously existing childLayout - } - - // init childLayouts - even if pane is not visible - if (o.initChildren && o.children) - createChildren(pane); - } - - /** - * @param {string=} panes The pane(s) to process - */ -, setPanePosition = function (panes) { - panes = panes ? panes.split(",") : _c.borderPanes; - - // create toggler DIVs for each pane, and set object pointers for them, eg: $R.north = north toggler DIV - $.each(panes, function (i, pane) { - var $P = $Ps[pane] - , $R = $Rs[pane] - , o = options[pane] - , s = state[pane] - , side = _c[pane].side - , CSS = {} - ; - if (!$P) return; // pane does not exist - skip - - // set css-position to account for container borders & padding - switch (pane) { - case "north": CSS.top = sC.inset.top; - CSS.left = sC.inset.left; - CSS.right = sC.inset.right; - break; - case "south": CSS.bottom = sC.inset.bottom; - CSS.left = sC.inset.left; - CSS.right = sC.inset.right; - break; - case "west": CSS.left = sC.inset.left; // top, bottom & height set by sizeMidPanes() - break; - case "east": CSS.right = sC.inset.right; // ditto - break; - case "center": // top, left, width & height set by sizeMidPanes() - } - // apply position - $P.css(CSS); - - // update resizer position - if ($R && s.isClosed) - $R.css(side, sC.inset[side]); - else if ($R && !s.isHidden) - $R.css(side, sC.inset[side] + getPaneSize(pane)); - }); - } - - /** - * Initialize module objects, styling, size and position for all resize bars and toggler buttons - * - * @see _create() - * @param {string=} [panes=""] The edge(s) to process - */ -, initHandles = function (panes) { - panes = panes ? panes.split(",") : _c.borderPanes; - - // create toggler DIVs for each pane, and set object pointers for them, eg: $R.north = north toggler DIV - $.each(panes, function (i, pane) { - var $P = $Ps[pane]; - $Rs[pane] = false; // INIT - $Ts[pane] = false; - if (!$P) return; // pane does not exist - skip - - var o = options[pane] - , s = state[pane] - , c = _c[pane] - , paneId = o.paneSelector.substr(0,1) === "#" ? o.paneSelector.substr(1) : "" - , rClass = o.resizerClass - , tClass = o.togglerClass - , spacing = (s.isVisible ? o.spacing_open : o.spacing_closed) - , _pane = "-"+ pane // used for classNames - , _state = (s.isVisible ? "-open" : "-closed") // used for classNames - , I = Instance[pane] - // INIT RESIZER BAR - , $R = I.resizer = $Rs[pane] = $("
        ") - // INIT TOGGLER BUTTON - , $T = I.toggler = (o.closable ? $Ts[pane] = $("
        ") : false) - ; - - //if (s.isVisible && o.resizable) ... handled by initResizable - if (!s.isVisible && o.slidable) - $R.attr("title", o.tips.Slide).css("cursor", o.sliderCursor); - - $R // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "paneLeft-resizer" - .attr("id", paneId ? paneId +"-resizer" : "" ) - .data({ - parentLayout: Instance - , layoutPane: Instance[pane] // NEW pointer to pane-alias-object - , layoutEdge: pane - , layoutRole: "resizer" - }) - .css(_c.resizers.cssReq).css("zIndex", options.zIndexes.resizer_normal) - .css(o.applyDemoStyles ? _c.resizers.cssDemo : {}) // add demo styles - .addClass(rClass +" "+ rClass+_pane) - .hover(addHover, removeHover) // ALWAYS add hover-classes, even if resizing is not enabled - handle with CSS instead - .hover(onResizerEnter, onResizerLeave) // ALWAYS NEED resizer.mouseleave to balance toggler.mouseenter - .mousedown($.layout.disableTextSelection) // prevent text-selection OUTSIDE resizer - .mouseup($.layout.enableTextSelection) // not really necessary, but just in case - .appendTo($N) // append DIV to container - ; - if ($.fn.disableSelection) - $R.disableSelection(); // prevent text-selection INSIDE resizer - if (o.resizerDblClickToggle) - $R.bind("dblclick."+ sID, toggle ); - - if ($T) { - $T // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "#paneLeft-toggler" - .attr("id", paneId ? paneId +"-toggler" : "" ) - .data({ - parentLayout: Instance - , layoutPane: Instance[pane] // NEW pointer to pane-alias-object - , layoutEdge: pane - , layoutRole: "toggler" - }) - .css(_c.togglers.cssReq) // add base/required styles - .css(o.applyDemoStyles ? _c.togglers.cssDemo : {}) // add demo styles - .addClass(tClass +" "+ tClass+_pane) - .hover(addHover, removeHover) // ALWAYS add hover-classes, even if toggling is not enabled - handle with CSS instead - .bind("mouseenter", onResizerEnter) // NEED toggler.mouseenter because mouseenter MAY NOT fire on resizer - .appendTo($R) // append SPAN to resizer DIV - ; - // ADD INNER-SPANS TO TOGGLER - if (o.togglerContent_open) // ui-layout-open - $(""+ o.togglerContent_open +"") - .data({ - layoutEdge: pane - , layoutRole: "togglerContent" - }) - .data("layoutRole", "togglerContent") - .data("layoutEdge", pane) - .addClass("content content-open") - .css("display","none") - .appendTo( $T ) - //.hover( addHover, removeHover ) // use ui-layout-toggler-west-hover .content-open instead! - ; - if (o.togglerContent_closed) // ui-layout-closed - $(""+ o.togglerContent_closed +"") - .data({ - layoutEdge: pane - , layoutRole: "togglerContent" - }) - .addClass("content content-closed") - .css("display","none") - .appendTo( $T ) - //.hover( addHover, removeHover ) // use ui-layout-toggler-west-hover .content-closed instead! - ; - // ADD TOGGLER.click/.hover - enableClosable(pane); - } - - // add Draggable events - initResizable(pane); - - // ADD CLASSNAMES & SLIDE-BINDINGS - eg: class="resizer resizer-west resizer-open" - if (s.isVisible) - setAsOpen(pane); // onOpen will be called, but NOT onResize - else { - setAsClosed(pane); // onClose will be called - bindStartSlidingEvents(pane, true); // will enable events IF option is set - } - - }); - - // SET ALL HANDLE DIMENSIONS - sizeHandles(); - } - - - /** - * Initialize scrolling ui-layout-content div - if exists - * - * @see initPane() - or externally after an Ajax injection - * @param {string} pane The pane to process - * @param {boolean=} [resize=true] Size content after init - */ -, initContent = function (pane, resize) { - if (!isInitialized()) return; - var - o = options[pane] - , sel = o.contentSelector - , I = Instance[pane] - , $P = $Ps[pane] - , $C - ; - if (sel) $C = I.content = $Cs[pane] = (o.findNestedContent) - ? $P.find(sel).eq(0) // match 1-element only - : $P.children(sel).eq(0) - ; - if ($C && $C.length) { - $C.data("layoutRole", "content"); - // SAVE original Content CSS - if (!$C.data("layoutCSS")) - $C.data("layoutCSS", styles($C, "height")); - $C.css( _c.content.cssReq ); - if (o.applyDemoStyles) { - $C.css( _c.content.cssDemo ); // add padding & overflow: auto to content-div - $P.css( _c.content.cssDemoPane ); // REMOVE padding/scrolling from pane - } - // ensure no vertical scrollbar on pane - will mess up measurements - if ($P.css("overflowX").match(/(scroll|auto)/)) { - $P.css("overflow", "hidden"); - } - state[pane].content = {}; // init content state - if (resize !== false) sizeContent(pane); - // sizeContent() is called AFTER init of all elements - } - else - I.content = $Cs[pane] = false; - } - - - /** - * Add resize-bars to all panes that specify it in options - * -dependancy: $.fn.resizable - will skip if not found - * - * @see _create() - * @param {string=} [panes=""] The edge(s) to process - */ -, initResizable = function (panes) { - var draggingAvailable = $.layout.plugins.draggable - , side // set in start() - ; - panes = panes ? panes.split(",") : _c.borderPanes; - - $.each(panes, function (idx, pane) { - var o = options[pane]; - if (!draggingAvailable || !$Ps[pane] || !o.resizable) { - o.resizable = false; - return true; // skip to next - } - - var s = state[pane] - , z = options.zIndexes - , c = _c[pane] - , side = c.dir=="horz" ? "top" : "left" - , $P = $Ps[pane] - , $R = $Rs[pane] - , base = o.resizerClass - , lastPos = 0 // used when live-resizing - , r, live // set in start because may change - // 'drag' classes are applied to the ORIGINAL resizer-bar while dragging is in process - , resizerClass = base+"-drag" // resizer-drag - , resizerPaneClass = base+"-"+pane+"-drag" // resizer-north-drag - // 'helper' class is applied to the CLONED resizer-bar while it is being dragged - , helperClass = base+"-dragging" // resizer-dragging - , helperPaneClass = base+"-"+pane+"-dragging" // resizer-north-dragging - , helperLimitClass = base+"-dragging-limit" // resizer-drag - , helperPaneLimitClass = base+"-"+pane+"-dragging-limit" // resizer-north-drag - , helperClassesSet = false // logic var - ; - - if (!s.isClosed) - $R.attr("title", o.tips.Resize) - .css("cursor", o.resizerCursor); // n-resize, s-resize, etc - - $R.draggable({ - containment: $N[0] // limit resizing to layout container - , axis: (c.dir=="horz" ? "y" : "x") // limit resizing to horz or vert axis - , delay: 0 - , distance: 1 - , grid: o.resizingGrid - // basic format for helper - style it using class: .ui-draggable-dragging - , helper: "clone" - , opacity: o.resizerDragOpacity - , addClasses: false // avoid ui-state-disabled class when disabled - //, iframeFix: o.draggableIframeFix // TODO: consider using when bug is fixed - , zIndex: z.resizer_drag - - , start: function (e, ui) { - // REFRESH options & state pointers in case we used swapPanes - o = options[pane]; - s = state[pane]; - // re-read options - live = o.livePaneResizing; - - // ondrag_start callback - will CANCEL hide if returns false - // TODO: dragging CANNOT be cancelled like this, so see if there is a way? - if (false === _runCallbacks("ondrag_start", pane)) return false; - - s.isResizing = true; // prevent pane from closing while resizing - state.paneResizing = pane; // easy to see if ANY pane is resizing - timer.clear(pane+"_closeSlider"); // just in case already triggered - - // SET RESIZER LIMITS - used in drag() - setSizeLimits(pane); // update pane/resizer state - r = s.resizerPosition; - lastPos = ui.position[ side ] - - $R.addClass( resizerClass +" "+ resizerPaneClass ); // add drag classes - helperClassesSet = false; // reset logic var - see drag() - - // MASK PANES CONTAINING IFRAMES, APPLETS OR OTHER TROUBLESOME ELEMENTS - showMasks( pane, { resizing: true }); - } - - , drag: function (e, ui) { - if (!helperClassesSet) { // can only add classes after clone has been added to the DOM - //$(".ui-draggable-dragging") - ui.helper - .addClass( helperClass +" "+ helperPaneClass ) // add helper classes - .css({ right: "auto", bottom: "auto" }) // fix dir="rtl" issue - .children().css("visibility","hidden") // hide toggler inside dragged resizer-bar - ; - helperClassesSet = true; - // draggable bug!? RE-SET zIndex to prevent E/W resize-bar showing through N/S pane! - if (s.isSliding) $Ps[pane].css("zIndex", z.pane_sliding); - } - // CONTAIN RESIZER-BAR TO RESIZING LIMITS - var limit = 0; - if (ui.position[side] < r.min) { - ui.position[side] = r.min; - limit = -1; - } - else if (ui.position[side] > r.max) { - ui.position[side] = r.max; - limit = 1; - } - // ADD/REMOVE dragging-limit CLASS - if (limit) { - ui.helper.addClass( helperLimitClass +" "+ helperPaneLimitClass ); // at dragging-limit - window.defaultStatus = (limit>0 && pane.match(/(north|west)/)) || (limit<0 && pane.match(/(south|east)/)) ? o.tips.maxSizeWarning : o.tips.minSizeWarning; - } - else { - ui.helper.removeClass( helperLimitClass +" "+ helperPaneLimitClass ); // not at dragging-limit - window.defaultStatus = ""; - } - // DYNAMICALLY RESIZE PANES IF OPTION ENABLED - // won't trigger unless resizer has actually moved! - if (live && Math.abs(ui.position[side] - lastPos) >= o.liveResizingTolerance) { - lastPos = ui.position[side]; - resizePanes(e, ui, pane) - } - } - - , stop: function (e, ui) { - $('body').enableSelection(); // RE-ENABLE TEXT SELECTION - window.defaultStatus = ""; // clear 'resizing limit' message from statusbar - $R.removeClass( resizerClass +" "+ resizerPaneClass ); // remove drag classes from Resizer - s.isResizing = false; - state.paneResizing = false; // easy to see if ANY pane is resizing - resizePanes(e, ui, pane, true); // true = resizingDone - } - - }); - }); - - /** - * resizePanes - * - * Sub-routine called from stop() - and drag() if livePaneResizing - * - * @param {!Object} evt - * @param {!Object} ui - * @param {string} pane - * @param {boolean=} [resizingDone=false] - */ - var resizePanes = function (evt, ui, pane, resizingDone) { - var dragPos = ui.position - , c = _c[pane] - , o = options[pane] - , s = state[pane] - , resizerPos - ; - switch (pane) { - case "north": resizerPos = dragPos.top; break; - case "west": resizerPos = dragPos.left; break; - case "south": resizerPos = sC.layoutHeight - dragPos.top - o.spacing_open; break; - case "east": resizerPos = sC.layoutWidth - dragPos.left - o.spacing_open; break; - }; - // remove container margin from resizer position to get the pane size - var newSize = resizerPos - sC.inset[c.side]; - - // Disable OR Resize Mask(s) created in drag.start - if (!resizingDone) { - // ensure we meet liveResizingTolerance criteria - if (Math.abs(newSize - s.size) < o.liveResizingTolerance) - return; // SKIP resize this time - // resize the pane - manualSizePane(pane, newSize, false, true); // true = noAnimation - sizeMasks(); // resize all visible masks - } - else { // resizingDone - // ondrag_end callback - if (false !== _runCallbacks("ondrag_end", pane)) - manualSizePane(pane, newSize, false, true); // true = noAnimation - hideMasks(true); // true = force hiding all masks even if one is 'sliding' - if (s.isSliding) // RE-SHOW 'object-masks' so objects won't show through sliding pane - showMasks( pane, { resizing: true }); - } - }; - } - - /** - * sizeMask - * - * Needed to overlay a DIV over an IFRAME-pane because mask CANNOT be *inside* the pane - * Called when mask created, and during livePaneResizing - */ -, sizeMask = function () { - var $M = $(this) - , pane = $M.data("layoutMask") // eg: "west" - , s = state[pane] - ; - // only masks over an IFRAME-pane need manual resizing - if (s.tagName == "IFRAME" && s.isVisible) // no need to mask closed/hidden panes - $M.css({ - top: s.offsetTop - , left: s.offsetLeft - , width: s.outerWidth - , height: s.outerHeight - }); - /* ALT Method... - var $P = $Ps[pane]; - $M.css( $P.position() ).css({ width: $P[0].offsetWidth, height: $P[0].offsetHeight }); - */ - } -, sizeMasks = function () { - $Ms.each( sizeMask ); // resize all 'visible' masks - } - - /** - * @param {string} pane The pane being resized, animated or isSliding - * @param {Object=} [args] (optional) Options: which masks to apply, and to which panes - */ -, showMasks = function (pane, args) { - var c = _c[pane] - , panes = ["center"] - , z = options.zIndexes - , a = $.extend({ - objectsOnly: false - , animation: false - , resizing: true - , sliding: state[pane].isSliding - }, args ) - , o, s - ; - if (a.resizing) - panes.push( pane ); - if (a.sliding) - panes.push( _c.oppositeEdge[pane] ); // ADD the oppositeEdge-pane - - if (c.dir === "horz") { - panes.push("west"); - panes.push("east"); - } - - $.each(panes, function(i,p){ - s = state[p]; - o = options[p]; - if (s.isVisible && ( o.maskObjects || (!a.objectsOnly && o.maskContents) )) { - getMasks(p).each(function(){ - sizeMask.call(this); - this.style.zIndex = s.isSliding ? z.pane_sliding+1 : z.pane_normal+1 - this.style.display = "block"; - }); - } - }); - } - - /** - * @param {boolean=} force Hide masks even if a pane is sliding - */ -, hideMasks = function (force) { - // ensure no pane is resizing - could be a timing issue - if (force || !state.paneResizing) { - $Ms.hide(); // hide ALL masks - } - // if ANY pane is sliding, then DO NOT remove masks from panes with maskObjects enabled - else if (!force && !$.isEmptyObject( state.panesSliding )) { - var i = $Ms.length - 1 - , p, $M; - for (; i >= 0; i--) { - $M = $Ms.eq(i); - p = $M.data("layoutMask"); - if (!options[p].maskObjects) { - $M.hide(); - } - } - } - } - - /** - * @param {string} pane - */ -, getMasks = function (pane) { - var $Masks = $([]) - , $M, i = 0, c = $Ms.length - ; - for (; i CSS - if (sC.tagName === "BODY" && ($N = $("html")).data(css)) // RESET CSS - $N.css( $N.data(css) ).removeData(css); - - // trigger plugins for this layout, if there are any - runPluginCallbacks( Instance, $.layout.onDestroy ); - - // trigger state-management and onunload callback - unload(); - - // clear the Instance of everything except for container & options (so could recreate) - // RE-CREATE: myLayout = myLayout.container.layout( myLayout.options ); - for (var n in Instance) - if (!n.match(/^(container|options)$/)) delete Instance[ n ]; - // add a 'destroyed' flag to make it easy to check - Instance.destroyed = true; - - // if this is a child layout, CLEAR the child-pointer in the parent - /* for now the pointer REMAINS, but with only container, options and destroyed keys - if (parentPane) { - var layout = parentPane.pane.data("parentLayout") - , key = layout.options.instanceKey || 'error'; - // THIS SYNTAX MAY BE WRONG! - parentPane.children[key] = layout.children[ parentPane.name ].children[key] = null; - } - */ - - return Instance; // for coding convenience - } - - /** - * Remove a pane from the layout - subroutine of destroy() - * - * @see destroy() - * @param {(string|Object)} evt_or_pane The pane to process - * @param {boolean=} [remove=false] Remove the DOM element? - * @param {boolean=} [skipResize=false] Skip calling resizeAll()? - * @param {boolean=} [destroyChild=true] Destroy Child-layouts? If not passed, obeys options setting - */ -, removePane = function (evt_or_pane, remove, skipResize, destroyChild) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $P = $Ps[pane] - , $C = $Cs[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - ; - // NOTE: elements can still exist even after remove() - // so check for missing data(), which is cleared by removed() - if ($P && $.isEmptyObject( $P.data() )) $P = false; - if ($C && $.isEmptyObject( $C.data() )) $C = false; - if ($R && $.isEmptyObject( $R.data() )) $R = false; - if ($T && $.isEmptyObject( $T.data() )) $T = false; - - if ($P) $P.stop(true, true); - - var o = options[pane] - , s = state[pane] - , d = "layout" - , css = "layoutCSS" - , pC = children[pane] - , hasChildren = $.isPlainObject( pC ) && !$.isEmptyObject( pC ) - , destroy = destroyChild !== undefined ? destroyChild : o.destroyChildren - ; - // FIRST destroy the child-layout(s) - if (hasChildren && destroy) { - $.each( pC, function (key, child) { - if (!child.destroyed) - child.destroy(true);// tell child-layout to destroy ALL its child-layouts too - if (child.destroyed) // destroy was successful - delete pC[key]; - }); - // if no more children, remove the children hash - if ($.isEmptyObject( pC )) { - pC = children[pane] = null; // clear children hash - hasChildren = false; - } - } - - // Note: can't 'remove' a pane element with non-destroyed children - if ($P && remove && !hasChildren) - $P.remove(); // remove the pane-element and everything inside it - else if ($P && $P[0]) { - // create list of ALL pane-classes that need to be removed - var root = o.paneClass // default="ui-layout-pane" - , pRoot = root +"-"+ pane // eg: "ui-layout-pane-west" - , _open = "-open" - , _sliding= "-sliding" - , _closed = "-closed" - , classes = [ root, root+_open, root+_closed, root+_sliding, // generic classes - pRoot, pRoot+_open, pRoot+_closed, pRoot+_sliding ] // pane-specific classes - ; - $.merge(classes, getHoverClasses($P, true)); // ADD hover-classes - // remove all Layout classes from pane-element - $P .removeClass( classes.join(" ") ) // remove ALL pane-classes - .removeData("parentLayout") - .removeData("layoutPane") - .removeData("layoutRole") - .removeData("layoutEdge") - .removeData("autoHidden") // in case set - .unbind("."+ sID) // remove ALL Layout events - // TODO: remove these extra unbind commands when jQuery is fixed - //.unbind("mouseenter"+ sID) - //.unbind("mouseleave"+ sID) - ; - // do NOT reset CSS if this pane/content is STILL the container of a nested layout! - // the nested layout will reset its 'container' CSS when/if it is destroyed - if (hasChildren && $C) { - // a content-div may not have a specific width, so give it one to contain the Layout - $C.width( $C.width() ); - $.each( pC, function (key, child) { - child.resizeAll(); // resize the Layout - }); - } - else if ($C) - $C.css( $C.data(css) ).removeData(css).removeData("layoutRole"); - // remove pane AFTER content in case there was a nested layout - if (!$P.data(d)) - $P.css( $P.data(css) ).removeData(css); - } - - // REMOVE pane resizer and toggler elements - if ($T) $T.remove(); - if ($R) $R.remove(); - - // CLEAR all pointers and state data - Instance[pane] = $Ps[pane] = $Cs[pane] = $Rs[pane] = $Ts[pane] = false; - s = { removed: true }; - - if (!skipResize) - resizeAll(); - } - - -/* - * ########################### - * ACTION METHODS - * ########################### - */ - - /** - * @param {string} pane - */ -, _hidePane = function (pane) { - var $P = $Ps[pane] - , o = options[pane] - , s = $P[0].style - ; - if (o.useOffscreenClose) { - if (!$P.data(_c.offscreenReset)) - $P.data(_c.offscreenReset, { left: s.left, right: s.right }); - $P.css( _c.offscreenCSS ); - } - else - $P.hide().removeData(_c.offscreenReset); - } - - /** - * @param {string} pane - */ -, _showPane = function (pane) { - var $P = $Ps[pane] - , o = options[pane] - , off = _c.offscreenCSS - , old = $P.data(_c.offscreenReset) - , s = $P[0].style - ; - $P .show() // ALWAYS show, just in case - .removeData(_c.offscreenReset); - if (o.useOffscreenClose && old) { - if (s.left == off.left) - s.left = old.left; - if (s.right == off.right) - s.right = old.right; - } - } - - - /** - * Completely 'hides' a pane, including its spacing - as if it does not exist - * The pane is not actually 'removed' from the source, so can use 'show' to un-hide it - * - * @param {(string|Object)} evt_or_pane The pane being hidden, ie: north, south, east, or west - * @param {boolean=} [noAnimation=false] - */ -, hide = function (evt_or_pane, noAnimation) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , o = options[pane] - , s = state[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - ; - if (pane === "center" || !$P || s.isHidden) return; // pane does not exist OR is already hidden - - // onhide_start callback - will CANCEL hide if returns false - if (state.initialized && false === _runCallbacks("onhide_start", pane)) return; - - s.isSliding = false; // just in case - delete state.panesSliding[pane]; - - // now hide the elements - if ($R) $R.hide(); // hide resizer-bar - if (!state.initialized || s.isClosed) { - s.isClosed = true; // to trigger open-animation on show() - s.isHidden = true; - s.isVisible = false; - if (!state.initialized) - _hidePane(pane); // no animation when loading page - sizeMidPanes(_c[pane].dir === "horz" ? "" : "center"); - if (state.initialized || o.triggerEventsOnLoad) - _runCallbacks("onhide_end", pane); - } - else { - s.isHiding = true; // used by onclose - close(pane, false, noAnimation); // adjust all panes to fit - } - } - - /** - * Show a hidden pane - show as 'closed' by default unless openPane = true - * - * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west - * @param {boolean=} [openPane=false] - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [noAlert=false] - */ -, show = function (evt_or_pane, openPane, noAnimation, noAlert) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , o = options[pane] - , s = state[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - ; - if (pane === "center" || !$P || !s.isHidden) return; // pane does not exist OR is not hidden - - // onshow_start callback - will CANCEL show if returns false - if (false === _runCallbacks("onshow_start", pane)) return; - - s.isShowing = true; // used by onopen/onclose - //s.isHidden = false; - will be set by open/close - if not cancelled - s.isSliding = false; // just in case - delete state.panesSliding[pane]; - - // now show the elements - //if ($R) $R.show(); - will be shown by open/close - if (openPane === false) - close(pane, true); // true = force - else - open(pane, false, noAnimation, noAlert); // adjust all panes to fit - } - - - /** - * Toggles a pane open/closed by calling either open or close - * - * @param {(string|Object)} evt_or_pane The pane being toggled, ie: north, south, east, or west - * @param {boolean=} [slide=false] - */ -, toggle = function (evt_or_pane, slide) { - if (!isInitialized()) return; - var evt = evtObj(evt_or_pane) - , pane = evtPane.call(this, evt_or_pane) - , s = state[pane] - ; - if (evt) // called from to $R.dblclick OR triggerPaneEvent - evt.stopImmediatePropagation(); - if (s.isHidden) - show(pane); // will call 'open' after unhiding it - else if (s.isClosed) - open(pane, !!slide); - else - close(pane); - } - - - /** - * Utility method used during init or other auto-processes - * - * @param {string} pane The pane being closed - * @param {boolean=} [setHandles=false] - */ -, _closePane = function (pane, setHandles) { - var - $P = $Ps[pane] - , s = state[pane] - ; - _hidePane(pane); - s.isClosed = true; - s.isVisible = false; - if (setHandles) setAsClosed(pane); - } - - /** - * Close the specified pane (animation optional), and resize all other panes as needed - * - * @param {(string|Object)} evt_or_pane The pane being closed, ie: north, south, east, or west - * @param {boolean=} [force=false] - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [skipCallback=false] - */ -, close = function (evt_or_pane, force, noAnimation, skipCallback) { - var pane = evtPane.call(this, evt_or_pane); - if (pane === "center") return; // validate - // if pane has been initialized, but NOT the complete layout, close pane instantly - if (!state.initialized && $Ps[pane]) { - _closePane(pane, true); // INIT pane as closed - return; - } - if (!isInitialized()) return; - - var - $P = $Ps[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - , o = options[pane] - , s = state[pane] - , c = _c[pane] - , doFX, isShowing, isHiding, wasSliding; - - // QUEUE in case another action/animation is in progress - $N.queue(function( queueNext ){ - - if ( !$P - || (!o.closable && !s.isShowing && !s.isHiding) // invalid request // (!o.resizable && !o.closable) ??? - || (!force && s.isClosed && !s.isShowing) // already closed - ) return queueNext(); - - // onclose_start callback - will CANCEL hide if returns false - // SKIP if just 'showing' a hidden pane as 'closed' - var abort = !s.isShowing && false === _runCallbacks("onclose_start", pane); - - // transfer logic vars to temp vars - isShowing = s.isShowing; - isHiding = s.isHiding; - wasSliding = s.isSliding; - // now clear the logic vars (REQUIRED before aborting) - delete s.isShowing; - delete s.isHiding; - - if (abort) return queueNext(); - - doFX = !noAnimation && !s.isClosed && (o.fxName_close != "none"); - s.isMoving = true; - s.isClosed = true; - s.isVisible = false; - // update isHidden BEFORE sizing panes - if (isHiding) s.isHidden = true; - else if (isShowing) s.isHidden = false; - - if (s.isSliding) // pane is being closed, so UNBIND trigger events - bindStopSlidingEvents(pane, false); // will set isSliding=false - else // resize panes adjacent to this one - sizeMidPanes(_c[pane].dir === "horz" ? "" : "center", false); // false = NOT skipCallback - - // if this pane has a resizer bar, move it NOW - before animation - setAsClosed(pane); - - // CLOSE THE PANE - if (doFX) { // animate the close - lockPaneForFX(pane, true); // need to set left/top so animation will work - $P.hide( o.fxName_close, o.fxSettings_close, o.fxSpeed_close, function () { - lockPaneForFX(pane, false); // undo - if (s.isClosed) close_2(); - queueNext(); - }); - } - else { // hide the pane without animation - _hidePane(pane); - close_2(); - queueNext(); - }; - }); - - // SUBROUTINE - function close_2 () { - s.isMoving = false; - bindStartSlidingEvents(pane, true); // will enable if o.slidable = true - - // if opposite-pane was autoClosed, see if it can be autoOpened now - var altPane = _c.oppositeEdge[pane]; - if (state[ altPane ].noRoom) { - setSizeLimits( altPane ); - makePaneFit( altPane ); - } - - if (!skipCallback && (state.initialized || o.triggerEventsOnLoad)) { - // onclose callback - UNLESS just 'showing' a hidden pane as 'closed' - if (!isShowing) _runCallbacks("onclose_end", pane); - // onhide OR onshow callback - if (isShowing) _runCallbacks("onshow_end", pane); - if (isHiding) _runCallbacks("onhide_end", pane); - } - } - } - - /** - * @param {string} pane The pane just closed, ie: north, south, east, or west - */ -, setAsClosed = function (pane) { - if (!$Rs[pane]) return; // handles not initialized yet! - var - $P = $Ps[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - , o = options[pane] - , s = state[pane] - , side = _c[pane].side - , rClass = o.resizerClass - , tClass = o.togglerClass - , _pane = "-"+ pane // used for classNames - , _open = "-open" - , _sliding= "-sliding" - , _closed = "-closed" - ; - $R - .css(side, sC.inset[side]) // move the resizer - .removeClass( rClass+_open +" "+ rClass+_pane+_open ) - .removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) - .addClass( rClass+_closed +" "+ rClass+_pane+_closed ) - ; - // handle already-hidden panes in case called by swap() or a similar method - if (s.isHidden) $R.hide(); // hide resizer-bar - - // DISABLE 'resizing' when closed - do this BEFORE bindStartSlidingEvents? - if (o.resizable && $.layout.plugins.draggable) - $R - .draggable("disable") - .removeClass("ui-state-disabled") // do NOT apply disabled styling - not suitable here - .css("cursor", "default") - .attr("title","") - ; - - // if pane has a toggler button, adjust that too - if ($T) { - $T - .removeClass( tClass+_open +" "+ tClass+_pane+_open ) - .addClass( tClass+_closed +" "+ tClass+_pane+_closed ) - .attr("title", o.tips.Open) // may be blank - ; - // toggler-content - if exists - $T.children(".content-open").hide(); - $T.children(".content-closed").css("display","block"); - } - - // sync any 'pin buttons' - syncPinBtns(pane, false); - - if (state.initialized) { - // resize 'length' and position togglers for adjacent panes - sizeHandles(); - } - } - - /** - * Open the specified pane (animation optional), and resize all other panes as needed - * - * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west - * @param {boolean=} [slide=false] - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [noAlert=false] - */ -, open = function (evt_or_pane, slide, noAnimation, noAlert) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $P = $Ps[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - , o = options[pane] - , s = state[pane] - , c = _c[pane] - , doFX, isShowing - ; - if (pane === "center") return; // validate - // QUEUE in case another action/animation is in progress - $N.queue(function( queueNext ){ - - if ( !$P - || (!o.resizable && !o.closable && !s.isShowing) // invalid request - || (s.isVisible && !s.isSliding) // already open - ) return queueNext(); - - // pane can ALSO be unhidden by just calling show(), so handle this scenario - if (s.isHidden && !s.isShowing) { - queueNext(); // call before show() because it needs the queue free - show(pane, true); - return; - } - - if (s.autoResize && s.size != o.size) // resize pane to original size set in options - sizePane(pane, o.size, true, true, true); // true=skipCallback/noAnimation/forceResize - else - // make sure there is enough space available to open the pane - setSizeLimits(pane, slide); - - // onopen_start callback - will CANCEL open if returns false - var cbReturn = _runCallbacks("onopen_start", pane); - - if (cbReturn === "abort") - return queueNext(); - - // update pane-state again in case options were changed in onopen_start - if (cbReturn !== "NC") // NC = "No Callback" - setSizeLimits(pane, slide); - - if (s.minSize > s.maxSize) { // INSUFFICIENT ROOM FOR PANE TO OPEN! - syncPinBtns(pane, false); // make sure pin-buttons are reset - if (!noAlert && o.tips.noRoomToOpen) - alert(o.tips.noRoomToOpen); - return queueNext(); // ABORT - } - - if (slide) // START Sliding - will set isSliding=true - bindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane - else if (s.isSliding) // PIN PANE (stop sliding) - open pane 'normally' instead - bindStopSlidingEvents(pane, false); // UNBIND trigger events - will set isSliding=false - else if (o.slidable) - bindStartSlidingEvents(pane, false); // UNBIND trigger events - - s.noRoom = false; // will be reset by makePaneFit if 'noRoom' - makePaneFit(pane); - - // transfer logic var to temp var - isShowing = s.isShowing; - // now clear the logic var - delete s.isShowing; - - doFX = !noAnimation && s.isClosed && (o.fxName_open != "none"); - s.isMoving = true; - s.isVisible = true; - s.isClosed = false; - // update isHidden BEFORE sizing panes - WHY??? Old? - if (isShowing) s.isHidden = false; - - if (doFX) { // ANIMATE - // mask adjacent panes with objects - lockPaneForFX(pane, true); // need to set left/top so animation will work - $P.show( o.fxName_open, o.fxSettings_open, o.fxSpeed_open, function() { - lockPaneForFX(pane, false); // undo - if (s.isVisible) open_2(); // continue - queueNext(); - }); - } - else { // no animation - _showPane(pane);// just show pane and... - open_2(); // continue - queueNext(); - }; - }); - - // SUBROUTINE - function open_2 () { - s.isMoving = false; - - // cure iframe display issues - _fixIframe(pane); - - // NOTE: if isSliding, then other panes are NOT 'resized' - if (!s.isSliding) { // resize all panes adjacent to this one - sizeMidPanes(_c[pane].dir=="vert" ? "center" : "", false); // false = NOT skipCallback - } - - // set classes, position handles and execute callbacks... - setAsOpen(pane); - }; - - } - - /** - * @param {string} pane The pane just opened, ie: north, south, east, or west - * @param {boolean=} [skipCallback=false] - */ -, setAsOpen = function (pane, skipCallback) { - var - $P = $Ps[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - , o = options[pane] - , s = state[pane] - , side = _c[pane].side - , rClass = o.resizerClass - , tClass = o.togglerClass - , _pane = "-"+ pane // used for classNames - , _open = "-open" - , _closed = "-closed" - , _sliding= "-sliding" - ; - $R - .css(side, sC.inset[side] + getPaneSize(pane)) // move the resizer - .removeClass( rClass+_closed +" "+ rClass+_pane+_closed ) - .addClass( rClass+_open +" "+ rClass+_pane+_open ) - ; - if (s.isSliding) - $R.addClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) - else // in case 'was sliding' - $R.removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) - - removeHover( 0, $R ); // remove hover classes - if (o.resizable && $.layout.plugins.draggable) - $R .draggable("enable") - .css("cursor", o.resizerCursor) - .attr("title", o.tips.Resize); - else if (!s.isSliding) - $R.css("cursor", "default"); // n-resize, s-resize, etc - - // if pane also has a toggler button, adjust that too - if ($T) { - $T .removeClass( tClass+_closed +" "+ tClass+_pane+_closed ) - .addClass( tClass+_open +" "+ tClass+_pane+_open ) - .attr("title", o.tips.Close); // may be blank - removeHover( 0, $T ); // remove hover classes - // toggler-content - if exists - $T.children(".content-closed").hide(); - $T.children(".content-open").css("display","block"); - } - - // sync any 'pin buttons' - syncPinBtns(pane, !s.isSliding); - - // update pane-state dimensions - BEFORE resizing content - $.extend(s, elDims($P)); - - if (state.initialized) { - // resize resizer & toggler sizes for all panes - sizeHandles(); - // resize content every time pane opens - to be sure - sizeContent(pane, true); // true = remeasure headers/footers, even if 'pane.isMoving' - } - - if (!skipCallback && (state.initialized || o.triggerEventsOnLoad) && $P.is(":visible")) { - // onopen callback - _runCallbacks("onopen_end", pane); - // onshow callback - TODO: should this be here? - if (s.isShowing) _runCallbacks("onshow_end", pane); - - // ALSO call onresize because layout-size *may* have changed while pane was closed - if (state.initialized) - _runCallbacks("onresize_end", pane); - } - - // TODO: Somehow sizePane("north") is being called after this point??? - } - - - /** - * slideOpen / slideClose / slideToggle - * - * Pass-though methods for sliding - */ -, slideOpen = function (evt_or_pane) { - if (!isInitialized()) return; - var evt = evtObj(evt_or_pane) - , pane = evtPane.call(this, evt_or_pane) - , s = state[pane] - , delay = options[pane].slideDelay_open - ; - if (pane === "center") return; // validate - // prevent event from triggering on NEW resizer binding created below - if (evt) evt.stopImmediatePropagation(); - - if (s.isClosed && evt && evt.type === "mouseenter" && delay > 0) - // trigger = mouseenter - use a delay - timer.set(pane+"_openSlider", open_NOW, delay); - else - open_NOW(); // will unbind events if is already open - - /** - * SUBROUTINE for timed open - */ - function open_NOW () { - if (!s.isClosed) // skip if no longer closed! - bindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane - else if (!s.isMoving) - open(pane, true); // true = slide - open() will handle binding - }; - } - -, slideClose = function (evt_or_pane) { - if (!isInitialized()) return; - var evt = evtObj(evt_or_pane) - , pane = evtPane.call(this, evt_or_pane) - , o = options[pane] - , s = state[pane] - , delay = s.isMoving ? 1000 : 300 // MINIMUM delay - option may override - ; - if (pane === "center") return; // validate - if (s.isClosed || s.isResizing) - return; // skip if already closed OR in process of resizing - else if (o.slideTrigger_close === "click") - close_NOW(); // close immediately onClick - else if (o.preventQuickSlideClose && s.isMoving) - return; // handle Chrome quick-close on slide-open - else if (o.preventPrematureSlideClose && evt && $.layout.isMouseOverElem(evt, $Ps[pane])) - return; // handle incorrect mouseleave trigger, like when over a SELECT-list in IE - else if (evt) // trigger = mouseleave - use a delay - // 1 sec delay if 'opening', else .3 sec - timer.set(pane+"_closeSlider", close_NOW, max(o.slideDelay_close, delay)); - else // called programically - close_NOW(); - - /** - * SUBROUTINE for timed close - */ - function close_NOW () { - if (s.isClosed) // skip 'close' if already closed! - bindStopSlidingEvents(pane, false); // UNBIND trigger events - TODO: is this needed here? - else if (!s.isMoving) - close(pane); // close will handle unbinding - }; - } - - /** - * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west - */ -, slideToggle = function (evt_or_pane) { - var pane = evtPane.call(this, evt_or_pane); - toggle(pane, true); - } - - - /** - * Must set left/top on East/South panes so animation will work properly - * - * @param {string} pane The pane to lock, 'east' or 'south' - any other is ignored! - * @param {boolean} doLock true = set left/top, false = remove - */ -, lockPaneForFX = function (pane, doLock) { - var $P = $Ps[pane] - , s = state[pane] - , o = options[pane] - , z = options.zIndexes - ; - if (doLock) { - showMasks( pane, { animation: true, objectsOnly: true }); - $P.css({ zIndex: z.pane_animate }); // overlay all elements during animation - if (pane=="south") - $P.css({ top: sC.inset.top + sC.innerHeight - $P.outerHeight() }); - else if (pane=="east") - $P.css({ left: sC.inset.left + sC.innerWidth - $P.outerWidth() }); - } - else { // animation DONE - RESET CSS - hideMasks(); - $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) }); - if (pane=="south") - $P.css({ top: "auto" }); - // if pane is positioned 'off-screen', then DO NOT screw with it! - else if (pane=="east" && !$P.css("left").match(/\-99999/)) - $P.css({ left: "auto" }); - // fix anti-aliasing in IE - only needed for animations that change opacity - if (browser.msie && o.fxOpacityFix && o.fxName_open != "slide" && $P.css("filter") && $P.css("opacity") == 1) - $P[0].style.removeAttribute('filter'); - } - } - - - /** - * Toggle sliding functionality of a specific pane on/off by adding removing 'slide open' trigger - * - * @see open(), close() - * @param {string} pane The pane to enable/disable, 'north', 'south', etc. - * @param {boolean} enable Enable or Disable sliding? - */ -, bindStartSlidingEvents = function (pane, enable) { - var o = options[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - , evtName = o.slideTrigger_open.toLowerCase() - ; - if (!$R || (enable && !o.slidable)) return; - - // make sure we have a valid event - if (evtName.match(/mouseover/)) - evtName = o.slideTrigger_open = "mouseenter"; - else if (!evtName.match(/(click|dblclick|mouseenter)/)) - evtName = o.slideTrigger_open = "click"; - - // must remove double-click-toggle when using dblclick-slide - if (o.resizerDblClickToggle && evtName.match(/click/)) { - $R[enable ? "unbind" : "bind"]('dblclick.'+ sID, toggle) - } - - $R - // add or remove event - [enable ? "bind" : "unbind"](evtName +'.'+ sID, slideOpen) - // set the appropriate cursor & title/tip - .css("cursor", enable ? o.sliderCursor : "default") - .attr("title", enable ? o.tips.Slide : "") - ; - } - - /** - * Add or remove 'mouseleave' events to 'slide close' when pane is 'sliding' open or closed - * Also increases zIndex when pane is sliding open - * See bindStartSlidingEvents for code to control 'slide open' - * - * @see slideOpen(), slideClose() - * @param {string} pane The pane to process, 'north', 'south', etc. - * @param {boolean} enable Enable or Disable events? - */ -, bindStopSlidingEvents = function (pane, enable) { - var o = options[pane] - , s = state[pane] - , c = _c[pane] - , z = options.zIndexes - , evtName = o.slideTrigger_close.toLowerCase() - , action = (enable ? "bind" : "unbind") - , $P = $Ps[pane] - , $R = $Rs[pane] - ; - timer.clear(pane+"_closeSlider"); // just in case - - if (enable) { - s.isSliding = true; - state.panesSliding[pane] = true; - // remove 'slideOpen' event from resizer - // ALSO will raise the zIndex of the pane & resizer - bindStartSlidingEvents(pane, false); - } - else { - s.isSliding = false; - delete state.panesSliding[pane]; - } - - // RE/SET zIndex - increases when pane is sliding-open, resets to normal when not - $P.css("zIndex", enable ? z.pane_sliding : z.pane_normal); - $R.css("zIndex", enable ? z.pane_sliding+2 : z.resizer_normal); // NOTE: mask = pane_sliding+1 - - // make sure we have a valid event - if (!evtName.match(/(click|mouseleave)/)) - evtName = o.slideTrigger_close = "mouseleave"; // also catches 'mouseout' - - // add/remove slide triggers - $R[action](evtName, slideClose); // base event on resize - // need extra events for mouseleave - if (evtName === "mouseleave") { - // also close on pane.mouseleave - $P[action]("mouseleave."+ sID, slideClose); - // cancel timer when mouse moves between 'pane' and 'resizer' - $R[action]("mouseenter."+ sID, cancelMouseOut); - $P[action]("mouseenter."+ sID, cancelMouseOut); - } - - if (!enable) - timer.clear(pane+"_closeSlider"); - else if (evtName === "click" && !o.resizable) { - // IF pane is not resizable (which already has a cursor and tip) - // then set the a cursor & title/tip on resizer when sliding - $R.css("cursor", enable ? o.sliderCursor : "default"); - $R.attr("title", enable ? o.tips.Close : ""); // use Toggler-tip, eg: "Close Pane" - } - - // SUBROUTINE for mouseleave timer clearing - function cancelMouseOut (evt) { - timer.clear(pane+"_closeSlider"); - evt.stopPropagation(); - } - } - - - /** - * Hides/closes a pane if there is insufficient room - reverses this when there is room again - * MUST have already called setSizeLimits() before calling this method - * - * @param {string} pane The pane being resized - * @param {boolean=} [isOpening=false] Called from onOpen? - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [force=false] - */ -, makePaneFit = function (pane, isOpening, skipCallback, force) { - var o = options[pane] - , s = state[pane] - , c = _c[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - , isSidePane = c.dir==="vert" - , hasRoom = false - ; - // special handling for center & east/west panes - if (pane === "center" || (isSidePane && s.noVerticalRoom)) { - // see if there is enough room to display the pane - // ERROR: hasRoom = s.minHeight <= s.maxHeight && (isSidePane || s.minWidth <= s.maxWidth); - hasRoom = (s.maxHeight >= 0); - if (hasRoom && s.noRoom) { // previously hidden due to noRoom, so show now - _showPane(pane); - if ($R) $R.show(); - s.isVisible = true; - s.noRoom = false; - if (isSidePane) s.noVerticalRoom = false; - _fixIframe(pane); - } - else if (!hasRoom && !s.noRoom) { // not currently hidden, so hide now - _hidePane(pane); - if ($R) $R.hide(); - s.isVisible = false; - s.noRoom = true; - } - } - - // see if there is enough room to fit the border-pane - if (pane === "center") { - // ignore center in this block - } - else if (s.minSize <= s.maxSize) { // pane CAN fit - hasRoom = true; - if (s.size > s.maxSize) // pane is too big - shrink it - sizePane(pane, s.maxSize, skipCallback, true, force); // true = noAnimation - else if (s.size < s.minSize) // pane is too small - enlarge it - sizePane(pane, s.minSize, skipCallback, true, force); // true = noAnimation - // need s.isVisible because new pseudoClose method keeps pane visible, but off-screen - else if ($R && s.isVisible && $P.is(":visible")) { - // make sure resizer-bar is positioned correctly - // handles situation where nested layout was 'hidden' when initialized - var pos = s.size + sC.inset[c.side]; - if ($.layout.cssNum( $R, c.side ) != pos) $R.css( c.side, pos ); - } - - // if was previously hidden due to noRoom, then RESET because NOW there is room - if (s.noRoom) { - // s.noRoom state will be set by open or show - if (s.wasOpen && o.closable) { - if (o.autoReopen) - open(pane, false, true, true); // true = noAnimation, true = noAlert - else // leave the pane closed, so just update state - s.noRoom = false; - } - else - show(pane, s.wasOpen, true, true); // true = noAnimation, true = noAlert - } - } - else { // !hasRoom - pane CANNOT fit - if (!s.noRoom) { // pane not set as noRoom yet, so hide or close it now... - s.noRoom = true; // update state - s.wasOpen = !s.isClosed && !s.isSliding; - if (s.isClosed){} // SKIP - else if (o.closable) // 'close' if possible - close(pane, true, true); // true = force, true = noAnimation - else // 'hide' pane if cannot just be closed - hide(pane, true); // true = noAnimation - } - } - } - - - /** - * manualSizePane is an exposed flow-through method allowing extra code when pane is 'manually resized' - * - * @param {(string|Object)} evt_or_pane The pane being resized - * @param {number} size The *desired* new size for this pane - will be validated - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [force=false] Force resizing even if does not seem necessary - */ -, manualSizePane = function (evt_or_pane, size, skipCallback, noAnimation, force) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , o = options[pane] - , s = state[pane] - // if resizing callbacks have been delayed and resizing is now DONE, force resizing to complete... - , forceResize = force || (o.livePaneResizing && !s.isResizing) - ; - if (pane === "center") return; // validate - // ANY call to manualSizePane disables autoResize - ie, percentage sizing - s.autoResize = false; - // flow-through... - sizePane(pane, size, skipCallback, noAnimation, forceResize); // will animate resize if option enabled - } - - /** - * sizePane is called only by internal methods whenever a pane needs to be resized - * - * @param {(string|Object)} evt_or_pane The pane being resized - * @param {number} size The *desired* new size for this pane - will be validated - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [force=false] Force resizing even if does not seem necessary - */ -, sizePane = function (evt_or_pane, size, skipCallback, noAnimation, force) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) // probably NEVER called from event? - , o = options[pane] - , s = state[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - , side = _c[pane].side - , dimName = _c[pane].sizeType.toLowerCase() - , skipResizeWhileDragging = s.isResizing && !o.triggerEventsDuringLiveResize - , doFX = noAnimation !== true && o.animatePaneSizing - , oldSize, newSize - ; - if (pane === "center") return; // validate - // QUEUE in case another action/animation is in progress - $N.queue(function( queueNext ){ - // calculate 'current' min/max sizes - setSizeLimits(pane); // update pane-state - oldSize = s.size; - size = _parseSize(pane, size); // handle percentages & auto - size = max(size, _parseSize(pane, o.minSize)); - size = min(size, s.maxSize); - if (size < s.minSize) { // not enough room for pane! - queueNext(); // call before makePaneFit() because it needs the queue free - makePaneFit(pane, false, skipCallback); // will hide or close pane - return; - } - - // IF newSize is same as oldSize, then nothing to do - abort - if (!force && size === oldSize) - return queueNext(); - - s.newSize = size; - - // onresize_start callback CANNOT cancel resizing because this would break the layout! - if (!skipCallback && state.initialized && s.isVisible) - _runCallbacks("onresize_start", pane); - - // resize the pane, and make sure its visible - newSize = cssSize(pane, size); - - if (doFX && $P.is(":visible")) { // ANIMATE - var fx = $.layout.effects.size[pane] || $.layout.effects.size.all - , easing = o.fxSettings_size.easing || fx.easing - , z = options.zIndexes - , props = {}; - props[ dimName ] = newSize +'px'; - s.isMoving = true; - // overlay all elements during animation - $P.css({ zIndex: z.pane_animate }) - .show().animate( props, o.fxSpeed_size, easing, function(){ - // reset zIndex after animation - $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) }); - s.isMoving = false; - delete s.newSize; - sizePane_2(); // continue - queueNext(); - }); - } - else { // no animation - $P.css( dimName, newSize ); // resize pane - delete s.newSize; - // if pane is visible, then - if ($P.is(":visible")) - sizePane_2(); // continue - else { - // pane is NOT VISIBLE, so just update state data... - // when pane is *next opened*, it will have the new size - s.size = size; // update state.size - //$.extend(s, elDims($P)); // update state dimensions - CANNOT do this when not visible! } - } - queueNext(); - }; - - }); - - // SUBROUTINE - function sizePane_2 () { - /* Panes are sometimes not sized precisely in some browsers!? - * This code will resize the pane up to 3 times to nudge the pane to the correct size - */ - var actual = dimName==='width' ? $P.outerWidth() : $P.outerHeight() - , tries = [{ - pane: pane - , count: 1 - , target: size - , actual: actual - , correct: (size === actual) - , attempt: size - , cssSize: newSize - }] - , lastTry = tries[0] - , thisTry = {} - , msg = 'Inaccurate size after resizing the '+ pane +'-pane.' - ; - while ( !lastTry.correct ) { - thisTry = { pane: pane, count: lastTry.count+1, target: size }; - - if (lastTry.actual > size) - thisTry.attempt = max(0, lastTry.attempt - (lastTry.actual - size)); - else // lastTry.actual < size - thisTry.attempt = max(0, lastTry.attempt + (size - lastTry.actual)); - - thisTry.cssSize = cssSize(pane, thisTry.attempt); - $P.css( dimName, thisTry.cssSize ); - - thisTry.actual = dimName=='width' ? $P.outerWidth() : $P.outerHeight(); - thisTry.correct = (size === thisTry.actual); - - // log attempts and alert the user of this *non-fatal error* (if showDebugMessages) - if ( tries.length === 1) { - _log(msg, false, true); - _log(lastTry, false, true); - } - _log(thisTry, false, true); - // after 4 tries, is as close as its gonna get! - if (tries.length > 3) break; - - tries.push( thisTry ); - lastTry = tries[ tries.length - 1 ]; - } - // END TESTING CODE - - // update pane-state dimensions - s.size = size; - $.extend(s, elDims($P)); - - if (s.isVisible && $P.is(":visible")) { - // reposition the resizer-bar - if ($R) $R.css( side, size + sC.inset[side] ); - // resize the content-div - sizeContent(pane); - } - - if (!skipCallback && !skipResizeWhileDragging && state.initialized && s.isVisible) - _runCallbacks("onresize_end", pane); - - // resize all the adjacent panes, and adjust their toggler buttons - // when skipCallback passed, it means the controlling method will handle 'other panes' - if (!skipCallback) { - // also no callback if live-resize is in progress and NOT triggerEventsDuringLiveResize - if (!s.isSliding) sizeMidPanes(_c[pane].dir=="horz" ? "" : "center", skipResizeWhileDragging, force); - sizeHandles(); - } - - // if opposite-pane was autoClosed, see if it can be autoOpened now - var altPane = _c.oppositeEdge[pane]; - if (size < oldSize && state[ altPane ].noRoom) { - setSizeLimits( altPane ); - makePaneFit( altPane, false, skipCallback ); - } - - // DEBUG - ALERT user/developer so they know there was a sizing problem - if (tries.length > 1) - _log(msg +'\nSee the Error Console for details.', true, true); - } - } - - /** - * @see initPanes(), sizePane(), resizeAll(), open(), close(), hide() - * @param {(Array.|string)} panes The pane(s) being resized, comma-delmited string - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [force=false] - */ -, sizeMidPanes = function (panes, skipCallback, force) { - panes = (panes ? panes : "east,west,center").split(","); - - $.each(panes, function (i, pane) { - if (!$Ps[pane]) return; // NO PANE - skip - var - o = options[pane] - , s = state[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - , isCenter= (pane=="center") - , hasRoom = true - , CSS = {} - // if pane is not visible, show it invisibly NOW rather than for *each call* in this script - , visCSS = $.layout.showInvisibly($P) - - , newCenter = calcNewCenterPaneDims() - ; - - // update pane-state dimensions - $.extend(s, elDims($P)); - - if (pane === "center") { - if (!force && s.isVisible && newCenter.width === s.outerWidth && newCenter.height === s.outerHeight) { - $P.css(visCSS); - return true; // SKIP - pane already the correct size - } - // set state for makePaneFit() logic - $.extend(s, cssMinDims(pane), { - maxWidth: newCenter.width - , maxHeight: newCenter.height - }); - CSS = newCenter; - s.newWidth = CSS.width; - s.newHeight = CSS.height; - // convert OUTER width/height to CSS width/height - CSS.width = cssW($P, CSS.width); - // NEW - allow pane to extend 'below' visible area rather than hide it - CSS.height = cssH($P, CSS.height); - hasRoom = CSS.width >= 0 && CSS.height >= 0; // height >= 0 = ALWAYS TRUE NOW - - // during layout init, try to shrink east/west panes to make room for center - if (!state.initialized && o.minWidth > newCenter.width) { - var - reqPx = o.minWidth - s.outerWidth - , minE = options.east.minSize || 0 - , minW = options.west.minSize || 0 - , sizeE = state.east.size - , sizeW = state.west.size - , newE = sizeE - , newW = sizeW - ; - if (reqPx > 0 && state.east.isVisible && sizeE > minE) { - newE = max( sizeE-minE, sizeE-reqPx ); - reqPx -= sizeE-newE; - } - if (reqPx > 0 && state.west.isVisible && sizeW > minW) { - newW = max( sizeW-minW, sizeW-reqPx ); - reqPx -= sizeW-newW; - } - // IF we found enough extra space, then resize the border panes as calculated - if (reqPx === 0) { - if (sizeE && sizeE != minE) - sizePane('east', newE, true, true, force); // true = skipCallback/noAnimation - initPanes will handle when done - if (sizeW && sizeW != minW) - sizePane('west', newW, true, true, force); // true = skipCallback/noAnimation - // now start over! - sizeMidPanes('center', skipCallback, force); - $P.css(visCSS); - return; // abort this loop - } - } - } - else { // for east and west, set only the height, which is same as center height - // set state.min/maxWidth/Height for makePaneFit() logic - if (s.isVisible && !s.noVerticalRoom) - $.extend(s, elDims($P), cssMinDims(pane)) - if (!force && !s.noVerticalRoom && newCenter.height === s.outerHeight) { - $P.css(visCSS); - return true; // SKIP - pane already the correct size - } - // east/west have same top, bottom & height as center - CSS.top = newCenter.top; - CSS.bottom = newCenter.bottom; - s.newSize = newCenter.height - // NEW - allow pane to extend 'below' visible area rather than hide it - CSS.height = cssH($P, newCenter.height); - s.maxHeight = CSS.height; - hasRoom = (s.maxHeight >= 0); // ALWAYS TRUE NOW - if (!hasRoom) s.noVerticalRoom = true; // makePaneFit() logic - } - - if (hasRoom) { - // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized - if (!skipCallback && state.initialized) - _runCallbacks("onresize_start", pane); - - $P.css(CSS); // apply the CSS to pane - if (pane !== "center") - sizeHandles(pane); // also update resizer length - if (s.noRoom && !s.isClosed && !s.isHidden) - makePaneFit(pane); // will re-open/show auto-closed/hidden pane - if (s.isVisible) { - $.extend(s, elDims($P)); // update pane dimensions - if (state.initialized) sizeContent(pane); // also resize the contents, if exists - } - } - else if (!s.noRoom && s.isVisible) // no room for pane - makePaneFit(pane); // will hide or close pane - - // reset visibility, if necessary - $P.css(visCSS); - - delete s.newSize; - delete s.newWidth; - delete s.newHeight; - - if (!s.isVisible) - return true; // DONE - next pane - - /* - * Extra CSS for IE6 or IE7 in Quirks-mode - add 'width' to NORTH/SOUTH panes - * Normally these panes have only 'left' & 'right' positions so pane auto-sizes - * ALSO required when pane is an IFRAME because will NOT default to 'full width' - * TODO: Can I use width:100% for a north/south iframe? - * TODO: Sounds like a job for $P.outerWidth( sC.innerWidth ) SETTER METHOD - */ - if (pane === "center") { // finished processing midPanes - var fix = browser.isIE6 || !browser.boxModel; - if ($Ps.north && (fix || state.north.tagName=="IFRAME")) - $Ps.north.css("width", cssW($Ps.north, sC.innerWidth)); - if ($Ps.south && (fix || state.south.tagName=="IFRAME")) - $Ps.south.css("width", cssW($Ps.south, sC.innerWidth)); - } - - // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized - if (!skipCallback && state.initialized) - _runCallbacks("onresize_end", pane); - }); - } - - - /** - * @see window.onresize(), callbacks or custom code - * @param {(Object|boolean)=} evt_or_refresh If 'true', then also reset pane-positioning - */ -, resizeAll = function (evt_or_refresh) { - var oldW = sC.innerWidth - , oldH = sC.innerHeight - ; - // stopPropagation if called by trigger("layoutdestroy") - use evtPane utility - evtPane(evt_or_refresh); - - // cannot size layout when 'container' is hidden or collapsed - if (!$N.is(":visible")) return; - - if (!state.initialized) { - _initLayoutElements(); - return; // no need to resize since we just initialized! - } - - if (evt_or_refresh === true && $.isPlainObject(options.outset)) { - // update container CSS in case outset option has changed - $N.css( options.outset ); - } - // UPDATE container dimensions - $.extend(sC, elDims( $N, options.inset )); - if (!sC.outerHeight) return; - - // if 'true' passed, refresh pane & handle positioning too - if (evt_or_refresh === true) { - setPanePosition(); - } - - // onresizeall_start will CANCEL resizing if returns false - // state.container has already been set, so user can access this info for calcuations - if (false === _runCallbacks("onresizeall_start")) return false; - - var // see if container is now 'smaller' than before - shrunkH = (sC.innerHeight < oldH) - , shrunkW = (sC.innerWidth < oldW) - , $P, o, s - ; - // NOTE special order for sizing: S-N-E-W - $.each(["south","north","east","west"], function (i, pane) { - if (!$Ps[pane]) return; // no pane - SKIP - o = options[pane]; - s = state[pane]; - if (s.autoResize && s.size != o.size) // resize pane to original size set in options - sizePane(pane, o.size, true, true, true); // true=skipCallback/noAnimation/forceResize - else { - setSizeLimits(pane); - makePaneFit(pane, false, true, true); // true=skipCallback/forceResize - } - }); - - sizeMidPanes("", true, true); // true=skipCallback/forceResize - sizeHandles(); // reposition the toggler elements - - // trigger all individual pane callbacks AFTER layout has finished resizing - $.each(_c.allPanes, function (i, pane) { - $P = $Ps[pane]; - if (!$P) return; // SKIP - if (state[pane].isVisible) // undefined for non-existent panes - _runCallbacks("onresize_end", pane); // callback - if exists - }); - - _runCallbacks("onresizeall_end"); - //_triggerLayoutEvent(pane, 'resizeall'); - } - - /** - * Whenever a pane resizes or opens that has a nested layout, trigger resizeAll - * - * @param {(string|Object)} evt_or_pane The pane just resized or opened - */ -, resizeChildren = function (evt_or_pane, skipRefresh) { - var pane = evtPane.call(this, evt_or_pane); - - if (!options[pane].resizeChildren) return; - - // ensure the pane-children are up-to-date - if (!skipRefresh) refreshChildren( pane ); - var pC = children[pane]; - if ($.isPlainObject( pC )) { - // resize one or more children - $.each( pC, function (key, child) { - if (!child.destroyed) child.resizeAll(); - }); - } - } - - /** - * IF pane has a content-div, then resize all elements inside pane to fit pane-height - * - * @param {(string|Object)} evt_or_panes The pane(s) being resized - * @param {boolean=} [remeasure=false] Should the content (header/footer) be remeasured? - */ -, sizeContent = function (evt_or_panes, remeasure) { - if (!isInitialized()) return; - - var panes = evtPane.call(this, evt_or_panes); - panes = panes ? panes.split(",") : _c.allPanes; - - $.each(panes, function (idx, pane) { - var - $P = $Ps[pane] - , $C = $Cs[pane] - , o = options[pane] - , s = state[pane] - , m = s.content // m = measurements - ; - if (!$P || !$C || !$P.is(":visible")) return true; // NOT VISIBLE - skip - - // if content-element was REMOVED, update OR remove the pointer - if (!$C.length) { - initContent(pane, false); // false = do NOT sizeContent() - already there! - if (!$C) return; // no replacement element found - pointer have been removed - } - - // onsizecontent_start will CANCEL resizing if returns false - if (false === _runCallbacks("onsizecontent_start", pane)) return; - - // skip re-measuring offsets if live-resizing - if ((!s.isMoving && !s.isResizing) || o.liveContentResizing || remeasure || m.top == undefined) { - _measure(); - // if any footers are below pane-bottom, they may not measure correctly, - // so allow pane overflow and re-measure - if (m.hiddenFooters > 0 && $P.css("overflow") === "hidden") { - $P.css("overflow", "visible"); - _measure(); // remeasure while overflowing - $P.css("overflow", "hidden"); - } - } - // NOTE: spaceAbove/Below *includes* the pane paddingTop/Bottom, but not pane.borders - var newH = s.innerHeight - (m.spaceAbove - s.css.paddingTop) - (m.spaceBelow - s.css.paddingBottom); - - if (!$C.is(":visible") || m.height != newH) { - // size the Content element to fit new pane-size - will autoHide if not enough room - setOuterHeight($C, newH, true); // true=autoHide - m.height = newH; // save new height - }; - - if (state.initialized) - _runCallbacks("onsizecontent_end", pane); - - function _below ($E) { - return max(s.css.paddingBottom, (parseInt($E.css("marginBottom"), 10) || 0)); - }; - - function _measure () { - var - ignore = options[pane].contentIgnoreSelector - , $Fs = $C.nextAll().not(".ui-layout-mask").not(ignore || ":lt(0)") // not :lt(0) = ALL - , $Fs_vis = $Fs.filter(':visible') - , $F = $Fs_vis.filter(':last') - ; - m = { - top: $C[0].offsetTop - , height: $C.outerHeight() - , numFooters: $Fs.length - , hiddenFooters: $Fs.length - $Fs_vis.length - , spaceBelow: 0 // correct if no content footer ($E) - } - m.spaceAbove = m.top; // just for state - not used in calc - m.bottom = m.top + m.height; - if ($F.length) - //spaceBelow = (LastFooter.top + LastFooter.height) [footerBottom] - Content.bottom + max(LastFooter.marginBottom, pane.paddingBotom) - m.spaceBelow = ($F[0].offsetTop + $F.outerHeight()) - m.bottom + _below($F); - else // no footer - check marginBottom on Content element itself - m.spaceBelow = _below($C); - }; - }); - } - - - /** - * Called every time a pane is opened, closed, or resized to slide the togglers to 'center' and adjust their length if necessary - * - * @see initHandles(), open(), close(), resizeAll() - * @param {(string|Object)=} evt_or_panes The pane(s) being resized - */ -, sizeHandles = function (evt_or_panes) { - var panes = evtPane.call(this, evt_or_panes) - panes = panes ? panes.split(",") : _c.borderPanes; - - $.each(panes, function (i, pane) { - var - o = options[pane] - , s = state[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - , $TC - ; - if (!$P || !$R) return; - - var - dir = _c[pane].dir - , _state = (s.isClosed ? "_closed" : "_open") - , spacing = o["spacing"+ _state] - , togAlign = o["togglerAlign"+ _state] - , togLen = o["togglerLength"+ _state] - , paneLen - , left - , offset - , CSS = {} - ; - - if (spacing === 0) { - $R.hide(); - return; - } - else if (!s.noRoom && !s.isHidden) // skip if resizer was hidden for any reason - $R.show(); // in case was previously hidden - - // Resizer Bar is ALWAYS same width/height of pane it is attached to - if (dir === "horz") { // north/south - //paneLen = $P.outerWidth(); // s.outerWidth || - paneLen = sC.innerWidth; // handle offscreen-panes - s.resizerLength = paneLen; - left = $.layout.cssNum($P, "left") - $R.css({ - width: cssW($R, paneLen) // account for borders & padding - , height: cssH($R, spacing) // ditto - , left: left > -9999 ? left : sC.inset.left // handle offscreen-panes - }); - } - else { // east/west - paneLen = $P.outerHeight(); // s.outerHeight || - s.resizerLength = paneLen; - $R.css({ - height: cssH($R, paneLen) // account for borders & padding - , width: cssW($R, spacing) // ditto - , top: sC.inset.top + getPaneSize("north", true) // TODO: what if no North pane? - //, top: $.layout.cssNum($Ps["center"], "top") - }); - } - - // remove hover classes - removeHover( o, $R ); - - if ($T) { - if (togLen === 0 || (s.isSliding && o.hideTogglerOnSlide)) { - $T.hide(); // always HIDE the toggler when 'sliding' - return; - } - else - $T.show(); // in case was previously hidden - - if (!(togLen > 0) || togLen === "100%" || togLen > paneLen) { - togLen = paneLen; - offset = 0; - } - else { // calculate 'offset' based on options.PANE.togglerAlign_open/closed - if (isStr(togAlign)) { - switch (togAlign) { - case "top": - case "left": offset = 0; - break; - case "bottom": - case "right": offset = paneLen - togLen; - break; - case "middle": - case "center": - default: offset = round((paneLen - togLen) / 2); // 'default' catches typos - } - } - else { // togAlign = number - var x = parseInt(togAlign, 10); // - if (togAlign >= 0) offset = x; - else offset = paneLen - togLen + x; // NOTE: x is negative! - } - } - - if (dir === "horz") { // north/south - var width = cssW($T, togLen); - $T.css({ - width: width // account for borders & padding - , height: cssH($T, spacing) // ditto - , left: offset // TODO: VERIFY that toggler positions correctly for ALL values - , top: 0 - }); - // CENTER the toggler content SPAN - $T.children(".content").each(function(){ - $TC = $(this); - $TC.css("marginLeft", round((width-$TC.outerWidth())/2)); // could be negative - }); - } - else { // east/west - var height = cssH($T, togLen); - $T.css({ - height: height // account for borders & padding - , width: cssW($T, spacing) // ditto - , top: offset // POSITION the toggler - , left: 0 - }); - // CENTER the toggler content SPAN - $T.children(".content").each(function(){ - $TC = $(this); - $TC.css("marginTop", round((height-$TC.outerHeight())/2)); // could be negative - }); - } - - // remove ALL hover classes - removeHover( 0, $T ); - } - - // DONE measuring and sizing this resizer/toggler, so can be 'hidden' now - if (!state.initialized && (o.initHidden || s.isHidden)) { - $R.hide(); - if ($T) $T.hide(); - } - }); - } - - - /** - * @param {(string|Object)} evt_or_pane - */ -, enableClosable = function (evt_or_pane) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $T = $Ts[pane] - , o = options[pane] - ; - if (!$T) return; - o.closable = true; - $T .bind("click."+ sID, function(evt){ evt.stopPropagation(); toggle(pane); }) - .css("visibility", "visible") - .css("cursor", "pointer") - .attr("title", state[pane].isClosed ? o.tips.Open : o.tips.Close) // may be blank - .show(); - } - /** - * @param {(string|Object)} evt_or_pane - * @param {boolean=} [hide=false] - */ -, disableClosable = function (evt_or_pane, hide) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $T = $Ts[pane] - ; - if (!$T) return; - options[pane].closable = false; - // is closable is disable, then pane MUST be open! - if (state[pane].isClosed) open(pane, false, true); - $T .unbind("."+ sID) - .css("visibility", hide ? "hidden" : "visible") // instead of hide(), which creates logic issues - .css("cursor", "default") - .attr("title", ""); - } - - - /** - * @param {(string|Object)} evt_or_pane - */ -, enableSlidable = function (evt_or_pane) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $R = $Rs[pane] - ; - if (!$R || !$R.data('draggable')) return; - options[pane].slidable = true; - if (state[pane].isClosed) - bindStartSlidingEvents(pane, true); - } - /** - * @param {(string|Object)} evt_or_pane - */ -, disableSlidable = function (evt_or_pane) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $R = $Rs[pane] - ; - if (!$R) return; - options[pane].slidable = false; - if (state[pane].isSliding) - close(pane, false, true); - else { - bindStartSlidingEvents(pane, false); - $R .css("cursor", "default") - .attr("title", ""); - removeHover(null, $R[0]); // in case currently hovered - } - } - - - /** - * @param {(string|Object)} evt_or_pane - */ -, enableResizable = function (evt_or_pane) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $R = $Rs[pane] - , o = options[pane] - ; - if (!$R || !$R.data('draggable')) return; - o.resizable = true; - $R.draggable("enable"); - if (!state[pane].isClosed) - $R .css("cursor", o.resizerCursor) - .attr("title", o.tips.Resize); - } - /** - * @param {(string|Object)} evt_or_pane - */ -, disableResizable = function (evt_or_pane) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $R = $Rs[pane] - ; - if (!$R || !$R.data('draggable')) return; - options[pane].resizable = false; - $R .draggable("disable") - .css("cursor", "default") - .attr("title", ""); - removeHover(null, $R[0]); // in case currently hovered - } - - - /** - * Move a pane from source-side (eg, west) to target-side (eg, east) - * If pane exists on target-side, move that to source-side, ie, 'swap' the panes - * - * @param {(string|Object)} evt_or_pane1 The pane/edge being swapped - * @param {string} pane2 ditto - */ -, swapPanes = function (evt_or_pane1, pane2) { - if (!isInitialized()) return; - var pane1 = evtPane.call(this, evt_or_pane1); - // change state.edge NOW so callbacks can know where pane is headed... - state[pane1].edge = pane2; - state[pane2].edge = pane1; - // run these even if NOT state.initialized - if (false === _runCallbacks("onswap_start", pane1) - || false === _runCallbacks("onswap_start", pane2) - ) { - state[pane1].edge = pane1; // reset - state[pane2].edge = pane2; - return; - } - - var - oPane1 = copy( pane1 ) - , oPane2 = copy( pane2 ) - , sizes = {} - ; - sizes[pane1] = oPane1 ? oPane1.state.size : 0; - sizes[pane2] = oPane2 ? oPane2.state.size : 0; - - // clear pointers & state - $Ps[pane1] = false; - $Ps[pane2] = false; - state[pane1] = {}; - state[pane2] = {}; - - // ALWAYS remove the resizer & toggler elements - if ($Ts[pane1]) $Ts[pane1].remove(); - if ($Ts[pane2]) $Ts[pane2].remove(); - if ($Rs[pane1]) $Rs[pane1].remove(); - if ($Rs[pane2]) $Rs[pane2].remove(); - $Rs[pane1] = $Rs[pane2] = $Ts[pane1] = $Ts[pane2] = false; - - // transfer element pointers and data to NEW Layout keys - move( oPane1, pane2 ); - move( oPane2, pane1 ); - - // cleanup objects - oPane1 = oPane2 = sizes = null; - - // make panes 'visible' again - if ($Ps[pane1]) $Ps[pane1].css(_c.visible); - if ($Ps[pane2]) $Ps[pane2].css(_c.visible); - - // fix any size discrepancies caused by swap - resizeAll(); - - // run these even if NOT state.initialized - _runCallbacks("onswap_end", pane1); - _runCallbacks("onswap_end", pane2); - - return; - - function copy (n) { // n = pane - var - $P = $Ps[n] - , $C = $Cs[n] - ; - return !$P ? false : { - pane: n - , P: $P ? $P[0] : false - , C: $C ? $C[0] : false - , state: $.extend(true, {}, state[n]) - , options: $.extend(true, {}, options[n]) - } - }; - - function move (oPane, pane) { - if (!oPane) return; - var - P = oPane.P - , C = oPane.C - , oldPane = oPane.pane - , c = _c[pane] - // save pane-options that should be retained - , s = $.extend(true, {}, state[pane]) - , o = options[pane] - // RETAIN side-specific FX Settings - more below - , fx = { resizerCursor: o.resizerCursor } - , re, size, pos - ; - $.each("fxName,fxSpeed,fxSettings".split(","), function (i, k) { - fx[k +"_open"] = o[k +"_open"]; - fx[k +"_close"] = o[k +"_close"]; - fx[k +"_size"] = o[k +"_size"]; - }); - - // update object pointers and attributes - $Ps[pane] = $(P) - .data({ - layoutPane: Instance[pane] // NEW pointer to pane-alias-object - , layoutEdge: pane - }) - .css(_c.hidden) - .css(c.cssReq) - ; - $Cs[pane] = C ? $(C) : false; - - // set options and state - options[pane] = $.extend(true, {}, oPane.options, fx); - state[pane] = $.extend(true, {}, oPane.state); - - // change classNames on the pane, eg: ui-layout-pane-east ==> ui-layout-pane-west - re = new RegExp(o.paneClass +"-"+ oldPane, "g"); - P.className = P.className.replace(re, o.paneClass +"-"+ pane); - - // ALWAYS regenerate the resizer & toggler elements - initHandles(pane); // create the required resizer & toggler - - // if moving to different orientation, then keep 'target' pane size - if (c.dir != _c[oldPane].dir) { - size = sizes[pane] || 0; - setSizeLimits(pane); // update pane-state - size = max(size, state[pane].minSize); - // use manualSizePane to disable autoResize - not useful after panes are swapped - manualSizePane(pane, size, true, true); // true/true = skipCallback/noAnimation - } - else // move the resizer here - $Rs[pane].css(c.side, sC.inset[c.side] + (state[pane].isVisible ? getPaneSize(pane) : 0)); - - - // ADD CLASSNAMES & SLIDE-BINDINGS - if (oPane.state.isVisible && !s.isVisible) - setAsOpen(pane, true); // true = skipCallback - else { - setAsClosed(pane); - bindStartSlidingEvents(pane, true); // will enable events IF option is set - } - - // DESTROY the object - oPane = null; - }; - } - - - /** - * INTERNAL method to sync pin-buttons when pane is opened or closed - * Unpinned means the pane is 'sliding' - ie, over-top of the adjacent panes - * - * @see open(), setAsOpen(), setAsClosed() - * @param {string} pane These are the params returned to callbacks by layout() - * @param {boolean} doPin True means set the pin 'down', False means 'up' - */ -, syncPinBtns = function (pane, doPin) { - if ($.layout.plugins.buttons) - $.each(state[pane].pins, function (i, selector) { - $.layout.buttons.setPinState(Instance, $(selector), pane, doPin); - }); - } - -; // END var DECLARATIONS - - /** - * Capture keys when enableCursorHotkey - toggle pane if hotkey pressed - * - * @see document.keydown() - */ - function keyDown (evt) { - if (!evt) return true; - var code = evt.keyCode; - if (code < 33) return true; // ignore special keys: ENTER, TAB, etc - - var - PANE = { - 38: "north" // Up Cursor - $.ui.keyCode.UP - , 40: "south" // Down Cursor - $.ui.keyCode.DOWN - , 37: "west" // Left Cursor - $.ui.keyCode.LEFT - , 39: "east" // Right Cursor - $.ui.keyCode.RIGHT - } - , ALT = evt.altKey // no worky! - , SHIFT = evt.shiftKey - , CTRL = evt.ctrlKey - , CURSOR = (CTRL && code >= 37 && code <= 40) - , o, k, m, pane - ; - - if (CURSOR && options[PANE[code]].enableCursorHotkey) // valid cursor-hotkey - pane = PANE[code]; - else if (CTRL || SHIFT) // check to see if this matches a custom-hotkey - $.each(_c.borderPanes, function (i, p) { // loop each pane to check its hotkey - o = options[p]; - k = o.customHotkey; - m = o.customHotkeyModifier; // if missing or invalid, treated as "CTRL+SHIFT" - if ((SHIFT && m=="SHIFT") || (CTRL && m=="CTRL") || (CTRL && SHIFT)) { // Modifier matches - if (k && code === (isNaN(k) || k <= 9 ? k.toUpperCase().charCodeAt(0) : k)) { // Key matches - pane = p; - return false; // BREAK - } - } - }); - - // validate pane - if (!pane || !$Ps[pane] || !options[pane].closable || state[pane].isHidden) - return true; - - toggle(pane); - - evt.stopPropagation(); - evt.returnValue = false; // CANCEL key - return false; - }; - - -/* - * ###################################### - * UTILITY METHODS - * called externally or by initButtons - * ###################################### - */ - - /** - * Change/reset a pane overflow setting & zIndex to allow popups/drop-downs to work - * - * @param {Object=} [el] (optional) Can also be 'bound' to a click, mouseOver, or other event - */ - function allowOverflow (el) { - if (!isInitialized()) return; - if (this && this.tagName) el = this; // BOUND to element - var $P; - if (isStr(el)) - $P = $Ps[el]; - else if ($(el).data("layoutRole")) - $P = $(el); - else - $(el).parents().each(function(){ - if ($(this).data("layoutRole")) { - $P = $(this); - return false; // BREAK - } - }); - if (!$P || !$P.length) return; // INVALID - - var - pane = $P.data("layoutEdge") - , s = state[pane] - ; - - // if pane is already raised, then reset it before doing it again! - // this would happen if allowOverflow is attached to BOTH the pane and an element - if (s.cssSaved) - resetOverflow(pane); // reset previous CSS before continuing - - // if pane is raised by sliding or resizing, or its closed, then abort - if (s.isSliding || s.isResizing || s.isClosed) { - s.cssSaved = false; - return; - } - - var - newCSS = { zIndex: (options.zIndexes.resizer_normal + 1) } - , curCSS = {} - , of = $P.css("overflow") - , ofX = $P.css("overflowX") - , ofY = $P.css("overflowY") - ; - // determine which, if any, overflow settings need to be changed - if (of != "visible") { - curCSS.overflow = of; - newCSS.overflow = "visible"; - } - if (ofX && !ofX.match(/(visible|auto)/)) { - curCSS.overflowX = ofX; - newCSS.overflowX = "visible"; - } - if (ofY && !ofY.match(/(visible|auto)/)) { - curCSS.overflowY = ofX; - newCSS.overflowY = "visible"; - } - - // save the current overflow settings - even if blank! - s.cssSaved = curCSS; - - // apply new CSS to raise zIndex and, if necessary, make overflow 'visible' - $P.css( newCSS ); - - // make sure the zIndex of all other panes is normal - $.each(_c.allPanes, function(i, p) { - if (p != pane) resetOverflow(p); - }); - - }; - /** - * @param {Object=} [el] (optional) Can also be 'bound' to a click, mouseOver, or other event - */ - function resetOverflow (el) { - if (!isInitialized()) return; - if (this && this.tagName) el = this; // BOUND to element - var $P; - if (isStr(el)) - $P = $Ps[el]; - else if ($(el).data("layoutRole")) - $P = $(el); - else - $(el).parents().each(function(){ - if ($(this).data("layoutRole")) { - $P = $(this); - return false; // BREAK - } - }); - if (!$P || !$P.length) return; // INVALID - - var - pane = $P.data("layoutEdge") - , s = state[pane] - , CSS = s.cssSaved || {} - ; - // reset the zIndex - if (!s.isSliding && !s.isResizing) - $P.css("zIndex", options.zIndexes.pane_normal); - - // reset Overflow - if necessary - $P.css( CSS ); - - // clear var - s.cssSaved = false; - }; - -/* - * ##################### - * CREATE/RETURN LAYOUT - * ##################### - */ - - // validate that container exists - var $N = $(this).eq(0); // FIRST matching Container element - if (!$N.length) { - return _log( options.errors.containerMissing ); - }; - - // Users retrieve Instance of a layout with: $N.layout() OR $N.data("layout") - // return the Instance-pointer if layout has already been initialized - if ($N.data("layoutContainer") && $N.data("layout")) - return $N.data("layout"); // cached pointer - - // init global vars - var - $Ps = {} // Panes x5 - set in initPanes() - , $Cs = {} // Content x5 - set in initPanes() - , $Rs = {} // Resizers x4 - set in initHandles() - , $Ts = {} // Togglers x4 - set in initHandles() - , $Ms = $([]) // Masks - up to 2 masks per pane (IFRAME + DIV) - // aliases for code brevity - , sC = state.container // alias for easy access to 'container dimensions' - , sID = state.id // alias for unique layout ID/namespace - eg: "layout435" - ; - - // create Instance object to expose data & option Properties, and primary action Methods - var Instance = { - // layout data - options: options // property - options hash - , state: state // property - dimensions hash - // object pointers - , container: $N // property - object pointers for layout container - , panes: $Ps // property - object pointers for ALL Panes: panes.north, panes.center - , contents: $Cs // property - object pointers for ALL Content: contents.north, contents.center - , resizers: $Rs // property - object pointers for ALL Resizers, eg: resizers.north - , togglers: $Ts // property - object pointers for ALL Togglers, eg: togglers.north - // border-pane open/close - , hide: hide // method - ditto - , show: show // method - ditto - , toggle: toggle // method - pass a 'pane' ("north", "west", etc) - , open: open // method - ditto - , close: close // method - ditto - , slideOpen: slideOpen // method - ditto - , slideClose: slideClose // method - ditto - , slideToggle: slideToggle // method - ditto - // pane actions - , setSizeLimits: setSizeLimits // method - pass a 'pane' - update state min/max data - , _sizePane: sizePane // method -intended for user by plugins only! - , sizePane: manualSizePane // method - pass a 'pane' AND an 'outer-size' in pixels or percent, or 'auto' - , sizeContent: sizeContent // method - pass a 'pane' - , swapPanes: swapPanes // method - pass TWO 'panes' - will swap them - , showMasks: showMasks // method - pass a 'pane' OR list of panes - default = all panes with mask option set - , hideMasks: hideMasks // method - ditto' - // pane element methods - , initContent: initContent // method - ditto - , addPane: addPane // method - pass a 'pane' - , removePane: removePane // method - pass a 'pane' to remove from layout, add 'true' to delete the pane-elem - , createChildren: createChildren // method - pass a 'pane' and (optional) layout-options (OVERRIDES options[pane].children - , refreshChildren: refreshChildren // method - pass a 'pane' and a layout-instance - // special pane option setting - , enableClosable: enableClosable // method - pass a 'pane' - , disableClosable: disableClosable // method - ditto - , enableSlidable: enableSlidable // method - ditto - , disableSlidable: disableSlidable // method - ditto - , enableResizable: enableResizable // method - ditto - , disableResizable: disableResizable// method - ditto - // utility methods for panes - , allowOverflow: allowOverflow // utility - pass calling element (this) - , resetOverflow: resetOverflow // utility - ditto - // layout control - , destroy: destroy // method - no parameters - , initPanes: isInitialized // method - no parameters - , resizeAll: resizeAll // method - no parameters - // callback triggering - , runCallbacks: _runCallbacks // method - pass evtName & pane (if a pane-event), eg: trigger("onopen", "west") - // alias collections of options, state and children - created in addPane and extended elsewhere - , hasParentLayout: false // set by initContainer() - , children: children // pointers to child-layouts, eg: Instance.children.west.layoutName - , north: false // alias group: { name: pane, pane: $Ps[pane], options: options[pane], state: state[pane], children: children[pane] } - , south: false // ditto - , west: false // ditto - , east: false // ditto - , center: false // ditto - }; - - // create the border layout NOW - if (_create() === 'cancel') // onload_start callback returned false to CANCEL layout creation - return null; - else // true OR false -- if layout-elements did NOT init (hidden or do not exist), can auto-init later - return Instance; // return the Instance object - -} - - -})( jQuery ); - - - - -/** - * jquery.layout.state 1.2 - * $Date: 2015/03/13 22:37:04 $ - * - * Copyright (c) 2014 - * Kevin Dalman (http://allpro.net) - * - * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) - * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. - * - * @requires: UI Layout 1.4.0 or higher - * @requires: $.ui.cookie (above) - * - * @see: http://groups.google.com/group/jquery-ui-layout - */ -;(function ($) { - -if (!$.layout) return; - - -/** - * UI COOKIE UTILITY - * - * A $.cookie OR $.ui.cookie namespace *should be standard*, but until then... - * This creates $.ui.cookie so Layout does not need the cookie.jquery.js plugin - * NOTE: This utility is REQUIRED by the layout.state plugin - * - * Cookie methods in Layout are created as part of State Management - */ -if (!$.ui) $.ui = {}; -$.ui.cookie = { - - // cookieEnabled is not in DOM specs, but DOES works in all browsers,including IE6 - acceptsCookies: !!navigator.cookieEnabled - -, read: function (name) { - var - c = document.cookie - , cs = c ? c.split(';') : [] - , pair, data, i - ; - for (i=0; pair=cs[i]; i++) { - data = $.trim(pair).split('='); // name=value => [ name, value ] - if (data[0] == name) // found the layout cookie - return decodeURIComponent(data[1]); - } - return null; - } - -, write: function (name, val, cookieOpts) { - var params = "" - , date = "" - , clear = false - , o = cookieOpts || {} - , x = o.expires || null - , t = $.type(x) - ; - if (t === "date") - date = x; - else if (t === "string" && x > 0) { - x = parseInt(x,10); - t = "number"; - } - if (t === "number") { - date = new Date(); - if (x > 0) - date.setDate(date.getDate() + x); - else { - date.setFullYear(1970); - clear = true; - } - } - if (date) params += ";expires="+ date.toUTCString(); - if (o.path) params += ";path="+ o.path; - if (o.domain) params += ";domain="+ o.domain; - if (o.secure) params += ";secure"; - document.cookie = name +"="+ (clear ? "" : encodeURIComponent( val )) + params; // write or clear cookie - } - -, clear: function (name) { - $.ui.cookie.write(name, "", {expires: -1}); - } - -}; -// if cookie.jquery.js is not loaded, create an alias to replicate it -// this may be useful to other plugins or code dependent on that plugin -if (!$.cookie) $.cookie = function (k, v, o) { - var C = $.ui.cookie; - if (v === null) - C.clear(k); - else if (v === undefined) - return C.read(k); - else - C.write(k, v, o); -}; - - - -/** - * State-management options stored in options.stateManagement, which includes a .cookie hash - * Default options saves ALL KEYS for ALL PANES, ie: pane.size, pane.isClosed, pane.isHidden - * - * // STATE/COOKIE OPTIONS - * @example $(el).layout({ - stateManagement: { - enabled: true - , stateKeys: "east.size,west.size,east.isClosed,west.isClosed" - , cookie: { name: "appLayout", path: "/" } - } - }) - * @example $(el).layout({ stateManagement__enabled: true }) // enable auto-state-management using cookies - * @example $(el).layout({ stateManagement__cookie: { name: "appLayout", path: "/" } }) - * @example $(el).layout({ stateManagement__cookie__name: "appLayout", stateManagement__cookie__path: "/" }) - * - * // STATE/COOKIE METHODS - * @example myLayout.saveCookie( "west.isClosed,north.size,south.isHidden", {expires: 7} ); - * @example myLayout.loadCookie(); - * @example myLayout.deleteCookie(); - * @example var JSON = myLayout.readState(); // CURRENT Layout State - * @example var JSON = myLayout.readCookie(); // SAVED Layout State (from cookie) - * @example var JSON = myLayout.state.stateData; // LAST LOADED Layout State (cookie saved in layout.state hash) - * - * CUSTOM STATE-MANAGEMENT (eg, saved in a database) - * @example var JSON = myLayout.readState( "west.isClosed,north.size,south.isHidden" ); - * @example myLayout.loadState( JSON ); - */ - -// tell Layout that the state plugin is available -$.layout.plugins.stateManagement = true; - -// Add State-Management options to layout.defaults -$.layout.defaults.stateManagement = { - enabled: false // true = enable state-management, even if not using cookies -, autoSave: true // Save a state-cookie when page exits? -, autoLoad: true // Load the state-cookie when Layout inits? -, animateLoad: true // animate panes when loading state into an active layout -, includeChildren: true // recurse into child layouts to include their state as well - // List state-data to save - must be pane-specific -, stateKeys: "north.size,south.size,east.size,west.size,"+ - "north.isClosed,south.isClosed,east.isClosed,west.isClosed,"+ - "north.isHidden,south.isHidden,east.isHidden,west.isHidden" -, cookie: { - name: "" // If not specified, will use Layout.name, else just "Layout" - , domain: "" // blank = current domain - , path: "" // blank = current page, "/" = entire website - , expires: "" // 'days' to keep cookie - leave blank for 'session cookie' - , secure: false - } -}; - -// Set stateManagement as a 'layout-option', NOT a 'pane-option' -$.layout.optionsMap.layout.push("stateManagement"); -// Update config so layout does not move options into the pane-default branch (panes) -$.layout.config.optionRootKeys.push("stateManagement"); - -/* - * State Management methods - */ -$.layout.state = { - - /** - * Get the current layout state and save it to a cookie - * - * myLayout.saveCookie( keys, cookieOpts ) - * - * @param {Object} inst - * @param {(string|Array)=} keys - * @param {Object=} cookieOpts - */ - saveCookie: function (inst, keys, cookieOpts) { - var o = inst.options - , sm = o.stateManagement - , oC = $.extend(true, {}, sm.cookie, cookieOpts || null) - , data = inst.state.stateData = inst.readState( keys || sm.stateKeys ) // read current panes-state - ; - $.ui.cookie.write( oC.name || o.name || "Layout", $.layout.state.encodeJSON(data), oC ); - return $.extend(true, {}, data); // return COPY of state.stateData data - } - - /** - * Remove the state cookie - * - * @param {Object} inst - */ -, deleteCookie: function (inst) { - var o = inst.options; - $.ui.cookie.clear( o.stateManagement.cookie.name || o.name || "Layout" ); - } - - /** - * Read & return data from the cookie - as JSON - * - * @param {Object} inst - */ -, readCookie: function (inst) { - var o = inst.options; - var c = $.ui.cookie.read( o.stateManagement.cookie.name || o.name || "Layout" ); - // convert cookie string back to a hash and return it - return c ? $.layout.state.decodeJSON(c) : {}; - } - - /** - * Get data from the cookie and USE IT to loadState - * - * @param {Object} inst - */ -, loadCookie: function (inst) { - var c = $.layout.state.readCookie(inst); // READ the cookie - if (c && !$.isEmptyObject( c )) { - inst.state.stateData = $.extend(true, {}, c); // SET state.stateData - inst.loadState(c); // LOAD the retrieved state - } - return c; - } - - /** - * Update layout options from the cookie, if one exists - * - * @param {Object} inst - * @param {Object=} stateData - * @param {boolean=} animate - */ -, loadState: function (inst, data, opts) { - if (!$.isPlainObject( data ) || $.isEmptyObject( data )) return; - - // normalize data & cache in the state object - data = inst.state.stateData = $.layout.transformData( data ); // panes = default subkey - - // add missing/default state-restore options - var smo = inst.options.stateManagement; - opts = $.extend({ - animateLoad: false //smo.animateLoad - , includeChildren: smo.includeChildren - }, opts ); - - if (!inst.state.initialized) { - /* - * layout NOT initialized, so just update its options - */ - // MUST remove pane.children keys before applying to options - // use a copy so we don't remove keys from original data - var o = $.extend(true, {}, data); - //delete o.center; // center has no state-data - only children - $.each($.layout.config.allPanes, function (idx, pane) { - if (o[pane]) delete o[pane].children; - }); - // update CURRENT layout-options with saved state data - $.extend(true, inst.options, o); - } - else { - /* - * layout already initialized, so modify layout's configuration - */ - var noAnimate = !opts.animateLoad - , o, c, h, state, open - ; - $.each($.layout.config.borderPanes, function (idx, pane) { - o = data[ pane ]; - if (!$.isPlainObject( o )) return; // no key, skip pane - - s = o.size; - c = o.initClosed; - h = o.initHidden; - ar = o.autoResize - state = inst.state[pane]; - open = state.isVisible; - - // reset autoResize - if (ar) - state.autoResize = ar; - // resize BEFORE opening - if (!open) - inst._sizePane(pane, s, false, false, false); // false=skipCallback/noAnimation/forceResize - // open/close as necessary - DO NOT CHANGE THIS ORDER! - if (h === true) inst.hide(pane, noAnimate); - else if (c === true) inst.close(pane, false, noAnimate); - else if (c === false) inst.open (pane, false, noAnimate); - else if (h === false) inst.show (pane, false, noAnimate); - // resize AFTER any other actions - if (open) - inst._sizePane(pane, s, false, false, noAnimate); // animate resize if option passed - }); - - /* - * RECURSE INTO CHILD-LAYOUTS - */ - if (opts.includeChildren) { - var paneStateChildren, childState; - $.each(inst.children, function (pane, paneChildren) { - paneStateChildren = data[pane] ? data[pane].children : 0; - if (paneStateChildren && paneChildren) { - $.each(paneChildren, function (stateKey, child) { - childState = paneStateChildren[stateKey]; - if (child && childState) - child.loadState( childState ); - }); - } - }); - } - } - } - - /** - * Get the *current layout state* and return it as a hash - * - * @param {Object=} inst // Layout instance to get state for - * @param {object=} [opts] // State-Managements override options - */ -, readState: function (inst, opts) { - // backward compatility - if ($.type(opts) === 'string') opts = { keys: opts }; - if (!opts) opts = {}; - var sm = inst.options.stateManagement - , ic = opts.includeChildren - , recurse = ic !== undefined ? ic : sm.includeChildren - , keys = opts.stateKeys || sm.stateKeys - , alt = { isClosed: 'initClosed', isHidden: 'initHidden' } - , state = inst.state - , panes = $.layout.config.allPanes - , data = {} - , pair, pane, key, val - , ps, pC, child, array, count, branch - ; - if ($.isArray(keys)) keys = keys.join(","); - // convert keys to an array and change delimiters from '__' to '.' - keys = keys.replace(/__/g, ".").split(','); - // loop keys and create a data hash - for (var i=0, n=keys.length; i < n; i++) { - pair = keys[i].split("."); - pane = pair[0]; - key = pair[1]; - if ($.inArray(pane, panes) < 0) continue; // bad pane! - val = state[ pane ][ key ]; - if (val == undefined) continue; - if (key=="isClosed" && state[pane]["isSliding"]) - val = true; // if sliding, then *really* isClosed - ( data[pane] || (data[pane]={}) )[ alt[key] ? alt[key] : key ] = val; - } - - // recurse into the child-layouts for each pane - if (recurse) { - $.each(panes, function (idx, pane) { - pC = inst.children[pane]; - ps = state.stateData[pane]; - if ($.isPlainObject( pC ) && !$.isEmptyObject( pC )) { - // ensure a key exists for this 'pane', eg: branch = data.center - branch = data[pane] || (data[pane] = {}); - if (!branch.children) branch.children = {}; - $.each( pC, function (key, child) { - // ONLY read state from an initialize layout - if ( child.state.initialized ) - branch.children[ key ] = $.layout.state.readState( child ); - // if we have PREVIOUS (onLoad) state for this child-layout, KEEP IT! - else if ( ps && ps.children && ps.children[ key ] ) { - branch.children[ key ] = $.extend(true, {}, ps.children[ key ] ); - } - }); - } - }); - } - - return data; - } - - /** - * Stringify a JSON hash so can save in a cookie or db-field - */ -, encodeJSON: function (json) { - var local = window.JSON || {}; - return (local.stringify || stringify)(json); - - function stringify (h) { - var D=[], i=0, k, v, t // k = key, v = value - , a = $.isArray(h) - ; - for (k in h) { - v = h[k]; - t = typeof v; - if (t == 'string') // STRING - add quotes - v = '"'+ v +'"'; - else if (t == 'object') // SUB-KEY - recurse into it - v = parse(v); - D[i++] = (!a ? '"'+ k +'":' : '') + v; - } - return (a ? '[' : '{') + D.join(',') + (a ? ']' : '}'); - }; - } - - /** - * Convert stringified JSON back to a hash object - * @see $.parseJSON(), adding in jQuery 1.4.1 - */ -, decodeJSON: function (str) { - try { return $.parseJSON ? $.parseJSON(str) : window["eval"]("("+ str +")") || {}; } - catch (e) { return {}; } - } - - -, _create: function (inst) { - var s = $.layout.state - , o = inst.options - , sm = o.stateManagement - ; - // ADD State-Management plugin methods to inst - $.extend( inst, { - // readCookie - update options from cookie - returns hash of cookie data - readCookie: function () { return s.readCookie(inst); } - // deleteCookie - , deleteCookie: function () { s.deleteCookie(inst); } - // saveCookie - optionally pass keys-list and cookie-options (hash) - , saveCookie: function (keys, cookieOpts) { return s.saveCookie(inst, keys, cookieOpts); } - // loadCookie - readCookie and use to loadState() - returns hash of cookie data - , loadCookie: function () { return s.loadCookie(inst); } - // loadState - pass a hash of state to use to update options - , loadState: function (stateData, opts) { s.loadState(inst, stateData, opts); } - // readState - returns hash of current layout-state - , readState: function (keys) { return s.readState(inst, keys); } - // add JSON utility methods too... - , encodeJSON: s.encodeJSON - , decodeJSON: s.decodeJSON - }); - - // init state.stateData key, even if plugin is initially disabled - inst.state.stateData = {}; - - // autoLoad MUST BE one of: data-array, data-hash, callback-function, or TRUE - if ( !sm.autoLoad ) return; - - // When state-data exists in the autoLoad key USE IT, - // even if stateManagement.enabled == false - if ($.isPlainObject( sm.autoLoad )) { - if (!$.isEmptyObject( sm.autoLoad )) { - inst.loadState( sm.autoLoad ); - } - } - else if ( sm.enabled ) { - // update the options from cookie or callback - // if options is a function, call it to get stateData - if ($.isFunction( sm.autoLoad )) { - var d = {}; - try { - d = sm.autoLoad( inst, inst.state, inst.options, inst.options.name || '' ); // try to get data from fn - } catch (e) {} - if (d && $.isPlainObject( d ) && !$.isEmptyObject( d )) - inst.loadState(d); - } - else // any other truthy value will trigger loadCookie - inst.loadCookie(); - } - } - -, _unload: function (inst) { - var sm = inst.options.stateManagement; - if (sm.enabled && sm.autoSave) { - // if options is a function, call it to save the stateData - if ($.isFunction( sm.autoSave )) { - try { - sm.autoSave( inst, inst.state, inst.options, inst.options.name || '' ); // try to get data from fn - } catch (e) {} - } - else // any truthy value will trigger saveCookie - inst.saveCookie(); - } - } - -}; - -// add state initialization method to Layout's onCreate array of functions -$.layout.onCreate.push( $.layout.state._create ); -$.layout.onUnload.push( $.layout.state._unload ); - -})( jQuery ); - - - -/** - * @preserve jquery.layout.buttons 1.0 - * $Date: 2015/03/13 22:37:04 $ - * - * Copyright (c) 2011 - * Kevin Dalman (http://allpro.net) - * - * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) - * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. - * - * @dependancies: UI Layout 1.3.0.rc30.1 or higher - * - * @support: http://groups.google.com/group/jquery-ui-layout - * - * Docs: [ to come ] - * Tips: [ to come ] - */ -;(function ($) { - -if (!$.layout) return; - - -// tell Layout that the state plugin is available -$.layout.plugins.buttons = true; - -// Add State-Management options to layout.defaults -$.layout.defaults.autoBindCustomButtons = false; -// Set stateManagement as a layout-option, NOT a pane-option -$.layout.optionsMap.layout.push("autoBindCustomButtons"); - -var lang = $.layout.language; - -/* - * Button methods - */ -$.layout.buttons = { - // set data used by multiple methods below - config: { - borderPanes: "north,south,west,east" - } - - /** - * Searches for .ui-layout-button-xxx elements and auto-binds them as layout-buttons - * - * @see _create() - */ -, init: function (inst) { - var pre = "ui-layout-button-" - , layout = inst.options.name || "" - , name; - $.each("toggle,open,close,pin,toggle-slide,open-slide".split(","), function (i, action) { - $.each($.layout.buttons.config.borderPanes.split(","), function (ii, pane) { - $("."+pre+action+"-"+pane).each(function(){ - // if button was previously 'bound', data.layoutName was set, but is blank if layout has no 'name' - name = $(this).data("layoutName") || $(this).attr("layoutName"); - if (name == undefined || name === layout) - inst.bindButton(this, action, pane); - }); - }); - }); - } - - /** - * Helper function to validate params received by addButton utilities - * - * Two classes are added to the element, based on the buttonClass... - * The type of button is appended to create the 2nd className: - * - ui-layout-button-pin - * - ui-layout-pane-button-toggle - * - ui-layout-pane-button-open - * - ui-layout-pane-button-close - * - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. - * @return {Array.} If both params valid, the element matching 'selector' in a jQuery wrapper - otherwise returns null - */ -, get: function (inst, selector, pane, action) { - var $E = $(selector) - , o = inst.options - , err = o.showErrorMessages - ; - if (!$E.length) { // element not found - if (err) alert(lang.errButton + lang.selector +": "+ selector); - } - else if ($.layout.buttons.config.borderPanes.indexOf(pane) === -1) { // invalid 'pane' sepecified - if (err) alert(lang.errButton + lang.pane +": "+ pane); - $E = $(""); // NO BUTTON - } - else { // VALID - var btn = o[pane].buttonClass +"-"+ action; - $E .addClass( btn +" "+ btn +"-"+ pane ) - .data("layoutName", o.name); // add layout identifier - even if blank! - } - return $E; - } - - - /** - * NEW syntax for binding layout-buttons - will eventually replace addToggle, addOpen, etc. - * - * @param {(string|!Object)} sel jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} action - * @param {string} pane - */ -, bind: function (inst, sel, action, pane) { - var _ = $.layout.buttons; - switch (action.toLowerCase()) { - case "toggle": _.addToggle (inst, sel, pane); break; - case "open": _.addOpen (inst, sel, pane); break; - case "close": _.addClose (inst, sel, pane); break; - case "pin": _.addPin (inst, sel, pane); break; - case "toggle-slide": _.addToggle (inst, sel, pane, true); break; - case "open-slide": _.addOpen (inst, sel, pane, true); break; - } - return inst; - } - - /** - * Add a custom Toggler button for a pane - * - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. - * @param {boolean=} slide true = slide-open, false = pin-open - */ -, addToggle: function (inst, selector, pane, slide) { - $.layout.buttons.get(inst, selector, pane, "toggle") - .click(function(evt){ - inst.toggle(pane, !!slide); - evt.stopPropagation(); - }); - return inst; - } - - /** - * Add a custom Open button for a pane - * - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. - * @param {boolean=} slide true = slide-open, false = pin-open - */ -, addOpen: function (inst, selector, pane, slide) { - $.layout.buttons.get(inst, selector, pane, "open") - .attr("title", lang.Open) - .click(function (evt) { - inst.open(pane, !!slide); - evt.stopPropagation(); - }); - return inst; - } - - /** - * Add a custom Close button for a pane - * - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. - */ -, addClose: function (inst, selector, pane) { - $.layout.buttons.get(inst, selector, pane, "close") - .attr("title", lang.Close) - .click(function (evt) { - inst.close(pane); - evt.stopPropagation(); - }); - return inst; - } - - /** - * Add a custom Pin button for a pane - * - * Four classes are added to the element, based on the paneClass for the associated pane... - * Assuming the default paneClass and the pin is 'up', these classes are added for a west-pane pin: - * - ui-layout-pane-pin - * - ui-layout-pane-west-pin - * - ui-layout-pane-pin-up - * - ui-layout-pane-west-pin-up - * - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} pane Name of the pane the pin is for: 'north', 'south', etc. - */ -, addPin: function (inst, selector, pane) { - var $E = $.layout.buttons.get(inst, selector, pane, "pin"); - if ($E.length) { - var s = inst.state[pane]; - $E.click(function (evt) { - $.layout.buttons.setPinState(inst, $(this), pane, (s.isSliding || s.isClosed)); - if (s.isSliding || s.isClosed) inst.open( pane ); // change from sliding to open - else inst.close( pane ); // slide-closed - evt.stopPropagation(); - }); - // add up/down pin attributes and classes - $.layout.buttons.setPinState(inst, $E, pane, (!s.isClosed && !s.isSliding)); - // add this pin to the pane data so we can 'sync it' automatically - // PANE.pins key is an array so we can store multiple pins for each pane - s.pins.push( selector ); // just save the selector string - } - return inst; - } - - /** - * Change the class of the pin button to make it look 'up' or 'down' - * - * @see addPin(), syncPins() - * @param {Array.} $Pin The pin-span element in a jQuery wrapper - * @param {string} pane These are the params returned to callbacks by layout() - * @param {boolean} doPin true = set the pin 'down', false = set it 'up' - */ -, setPinState: function (inst, $Pin, pane, doPin) { - var updown = $Pin.attr("pin"); - if (updown && doPin === (updown=="down")) return; // already in correct state - var - pin = inst.options[pane].buttonClass +"-pin" - , side = pin +"-"+ pane - , UP = pin +"-up "+ side +"-up" - , DN = pin +"-down "+side +"-down" - ; - $Pin - .attr("pin", doPin ? "down" : "up") // logic - .attr("title", doPin ? lang.Unpin : lang.Pin) - .removeClass( doPin ? UP : DN ) - .addClass( doPin ? DN : UP ) - ; - } - - /** - * INTERNAL function to sync 'pin buttons' when pane is opened or closed - * Unpinned means the pane is 'sliding' - ie, over-top of the adjacent panes - * - * @see open(), close() - * @param {string} pane These are the params returned to callbacks by layout() - * @param {boolean} doPin True means set the pin 'down', False means 'up' - */ -, syncPinBtns: function (inst, pane, doPin) { - // REAL METHOD IS _INSIDE_ LAYOUT - THIS IS HERE JUST FOR REFERENCE - $.each(state[pane].pins, function (i, selector) { - $.layout.buttons.setPinState(inst, $(selector), pane, doPin); - }); - } - - -, _load: function (inst) { - // ADD Button methods to Layout Instance - $.extend( inst, { - bindButton: function (selector, action, pane) { return $.layout.buttons.bind(inst, selector, action, pane); } - // DEPRECATED METHODS... - , addToggleBtn: function (selector, pane, slide) { return $.layout.buttons.addToggle(inst, selector, pane, slide); } - , addOpenBtn: function (selector, pane, slide) { return $.layout.buttons.addOpen(inst, selector, pane, slide); } - , addCloseBtn: function (selector, pane) { return $.layout.buttons.addClose(inst, selector, pane); } - , addPinBtn: function (selector, pane) { return $.layout.buttons.addPin(inst, selector, pane); } - }); - - // init state array to hold pin-buttons - for (var i=0; i<4; i++) { - var pane = $.layout.buttons.config.borderPanes[i]; - inst.state[pane].pins = []; - } - - // auto-init buttons onLoad if option is enabled - if ( inst.options.autoBindCustomButtons ) - $.layout.buttons.init(inst); - } - -, _unload: function (inst) { - // TODO: unbind all buttons??? - } - -}; - -// add initialization method to Layout's onLoad array of functions -$.layout.onLoad.push( $.layout.buttons._load ); -//$.layout.onUnload.push( $.layout.buttons._unload ); - -})( jQuery ); - - - - -/** - * jquery.layout.browserZoom 1.0 - * $Date: 2015/03/13 22:37:04 $ - * - * Copyright (c) 2012 - * Kevin Dalman (http://allpro.net) - * - * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) - * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. - * - * @requires: UI Layout 1.3.0.rc30.1 or higher - * - * @see: http://groups.google.com/group/jquery-ui-layout - * - * TODO: Extend logic to handle other problematic zooming in browsers - * TODO: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event - */ -(function ($) { - -// tell Layout that the plugin is available -$.layout.plugins.browserZoom = true; - -$.layout.defaults.browserZoomCheckInterval = 1000; -$.layout.optionsMap.layout.push("browserZoomCheckInterval"); - -/* - * browserZoom methods - */ -$.layout.browserZoom = { - - _init: function (inst) { - // abort if browser does not need this check - if ($.layout.browserZoom.ratio() !== false) - $.layout.browserZoom._setTimer(inst); - } - -, _setTimer: function (inst) { - // abort if layout destroyed or browser does not need this check - if (inst.destroyed) return; - var o = inst.options - , s = inst.state - // don't need check if inst has parentLayout, but check occassionally in case parent destroyed! - // MINIMUM 100ms interval, for performance - , ms = inst.hasParentLayout ? 5000 : Math.max( o.browserZoomCheckInterval, 100 ) - ; - // set the timer - setTimeout(function(){ - if (inst.destroyed || !o.resizeWithWindow) return; - var d = $.layout.browserZoom.ratio(); - if (d !== s.browserZoom) { - s.browserZoom = d; - inst.resizeAll(); - } - // set a NEW timeout - $.layout.browserZoom._setTimer(inst); - } - , ms ); - } - -, ratio: function () { - var w = window - , s = screen - , d = document - , dE = d.documentElement || d.body - , b = $.layout.browser - , v = b.version - , r, sW, cW - ; - // we can ignore all browsers that fire window.resize event onZoom - if (!b.msie || v > 8) - return false; // don't need to track zoom - if (s.deviceXDPI && s.systemXDPI) // syntax compiler hack - return calc(s.deviceXDPI, s.systemXDPI); - // everything below is just for future reference! - if (b.webkit && (r = d.body.getBoundingClientRect)) - return calc((r.left - r.right), d.body.offsetWidth); - if (b.webkit && (sW = w.outerWidth)) - return calc(sW, w.innerWidth); - if ((sW = s.width) && (cW = dE.clientWidth)) - return calc(sW, cW); - return false; // no match, so cannot - or don't need to - track zoom - - function calc (x,y) { return (parseInt(x,10) / parseInt(y,10) * 100).toFixed(); } - } - -}; -// add initialization method to Layout's onLoad array of functions -$.layout.onReady.push( $.layout.browserZoom._init ); - - -})( jQuery ); - - - - -/** - * UI Layout Plugin: Slide-Offscreen Animation - * - * Prevent panes from being 'hidden' so that an iframes/objects - * does not reload/refresh when pane 'opens' again. - * This plug-in adds a new animation called "slideOffscreen". - * It is identical to the normal "slide" effect, but avoids hiding the element - * - * Requires Layout 1.3.0.RC30.1 or later for Close offscreen - * Requires Layout 1.3.0.RC30.5 or later for Hide, initClosed & initHidden offscreen - * - * Version: 1.1 - 2012-11-18 - * Author: Kevin Dalman (kevin@jquery-dev.com) - * @preserve jquery.layout.slideOffscreen-1.1.js - */ -;(function ($) { - -// Add a new "slideOffscreen" effect -if ($.effects) { - - // add an option so initClosed and initHidden will work - $.layout.defaults.panes.useOffscreenClose = false; // user must enable when needed - /* set the new animation as the default for all panes - $.layout.defaults.panes.fxName = "slideOffscreen"; - */ - - if ($.layout.plugins) - $.layout.plugins.effects.slideOffscreen = true; - - // dupe 'slide' effect defaults as new effect defaults - $.layout.effects.slideOffscreen = $.extend(true, {}, $.layout.effects.slide); - - // add new effect to jQuery UI - $.effects.slideOffscreen = function(o) { - return this.queue(function(){ - - var fx = $.effects - , opt = o.options - , $el = $(this) - , pane = $el.data('layoutEdge') - , state = $el.data('parentLayout').state - , dist = state[pane].size - , s = this.style - , props = ['top','bottom','left','right'] - // Set options - , mode = fx.setMode($el, opt.mode || 'show') // Set Mode - , show = (mode == 'show') - , dir = opt.direction || 'left' // Default Direction - , ref = (dir == 'up' || dir == 'down') ? 'top' : 'left' - , pos = (dir == 'up' || dir == 'left') - , offscrn = $.layout.config.offscreenCSS || {} - , keyLR = $.layout.config.offscreenReset - , keyTB = 'offscreenResetTop' // only used internally - , animation = {} - ; - // Animation settings - animation[ref] = (show ? (pos ? '+=' : '-=') : (pos ? '-=' : '+=')) + dist; - - if (show) { // show() animation, so save top/bottom but retain left/right set when 'hidden' - $el.data(keyTB, { top: s.top, bottom: s.bottom }); - - // set the top or left offset in preparation for animation - // Note: ALL animations work by shifting the top or left edges - if (pos) { // top (north) or left (west) - $el.css(ref, isNaN(dist) ? "-" + dist : -dist); // Shift outside the left/top edge - } - else { // bottom (south) or right (east) - shift all the way across container - if (dir === 'right') - $el.css({ left: state.container.layoutWidth, right: 'auto' }); - else // dir === bottom - $el.css({ top: state.container.layoutHeight, bottom: 'auto' }); - } - // restore the left/right setting if is a top/bottom animation - if (ref === 'top') - $el.css( $el.data( keyLR ) || {} ); - } - else { // hide() animation, so save ALL CSS - $el.data(keyTB, { top: s.top, bottom: s.bottom }); - $el.data(keyLR, { left: s.left, right: s.right }); - } - - // Animate - $el.show().animate(animation, { queue: false, duration: o.duration, easing: opt.easing, complete: function(){ - // Restore top/bottom - if ($el.data( keyTB )) - $el.css($el.data( keyTB )).removeData( keyTB ); - if (show) // Restore left/right too - $el.css($el.data( keyLR ) || {}).removeData( keyLR ); - else // Move the pane off-screen (left: -99999, right: 'auto') - $el.css( offscrn ); - - if (o.callback) o.callback.apply(this, arguments); // Callback - $el.dequeue(); - }}); - - }); - }; - -} - -})( jQuery ); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/modalService.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/modalService.js deleted file mode 100644 index 74c848e8d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/modalService.js +++ /dev/null @@ -1,185 +0,0 @@ -angular.module("modalServices",[]).service('modalService', ['$modal', function ($modal) { - - - this.showSuccess = function(heading, messageBody){ - var modalInstance = $modal.open({ - templateUrl: 'modal_informative.html', - controller: 'modalpopupController', - resolve: { - message: function () { - $(".overlayed").css("display","none"); - $(".loadingId").css("display","none"); - var message = { - title: heading, - text: messageBody - }; - return message; - } - } - }); - }; - this.showFailure = function(heading, messageBody){ - var modalInstance = $modal.open({ - templateUrl: 'modal_warning.html', - controller: 'modalpopupController', - resolve: { - message: function () { - var message = { - title: heading, - text: messageBody - }; - return message; - } - } - }); - }; - - this.showMessage = function(heading, messageBody){ - var modalInstance = $modal.open({ - templateUrl: 'modal_message.html', - controller: 'modalpopupController', - resolve: { - message: function () { - var message = { - title: heading, - text: messageBody - }; - return message; - } - } - }); - }; - - this.showWarning = function(heading, messageBody){ - var modalInstance = $modal.open({ - templateUrl: 'modal_warning_message.html', - controller: 'modalpopupController', - resolve: { - message: function () { - var message = { - title: heading, - text: messageBody - }; - return message; - } - } - }); - }; - - this.popupConfirmWin = function(title, msgBody, callback){ - var modalInstance = $modal.open({ - templateUrl: 'confirmation_informative.html', - controller: 'modalpopupController', - resolve: { - message: function () { - var message = { - title: title, - text: msgBody - }; - return message; - } - } - }); - var args = Array.prototype.slice.call( arguments, 0 ); - args.splice( 0, 3); - modalInstance.result.then(function(){ - callback.apply(null, args); - }, function() { - })['finally'](function(){ - modalInstance = undefined; - }); - - }; - this.popupConfirmWinWithCancel = function(title, msgBody, callback,dismissCallback){ - var modalInstance = $modal.open({ - templateUrl: 'confirmation_informative.html', - controller: 'modalpopupController', - resolve: { - message: function () { - var message = { - title: title, - text: msgBody - }; - return message; - } - } - }); - var args = Array.prototype.slice.call( arguments, 0 ); - args.splice( 0, 3); - modalInstance.result.then(function(){ - callback.apply(null, args); - }, function() { - dismissCallback(); - })['finally'](function(){ - modalInstance = undefined; - }); - - }; - this.popupDeleteConfirmWin = function(title, msgBody, callback, argForCallBack){ - var modalInstance = $modal.open({ - templateUrl: 'confirmation_for_delete.html', - controller: 'modalpopupController', - resolve: { - message: function () { - var message = { - title: title, - text: msgBody - }; - return message; - } - } - }); - - modalInstance.result.then(function(){ - callback(argForCallBack); - }, function() { - })['finally'](function(){ - modalInstance = undefined; - }); - - }; - - this.popupSuccessRedirectWin = function(title, msgBody, redirectUrl){ - var modalInstance = $modal.open({ - templateUrl: 'modal_informative.html', - controller: 'modalpopupController', - resolve: { - message: function () { - var message = { - title: title, - text: msgBody - }; - return message; - } - } - }); - modalInstance.result.then(function() { - }, function() { - window.location.href=redirectUrl; - })['finally'](function(){ - modalInstance = undefined; - }); - }; - - this.popupWarningRedirectWin = function(title, msgBody, redirectUrl){ - var modalInstance = $modal.open({ - templateUrl: 'modal_warning_message.html', - controller: 'modalpopupController', - resolve: { - message: function () { - var message = { - title: title, - text: msgBody - }; - return message; - } - } - }); - modalInstance.result.then(function() { - }, function() { - window.location.href=redirectUrl; - })['finally'](function(){ - modalInstance = undefined; - }); - }; - }]); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/moment.min.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/moment.min.js deleted file mode 100644 index 62b1697b6..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/moment.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// moment.js -// version : 2.1.0 -// author : Tim Wood -// license : MIT -// momentjs.com -!function(t){function e(t,e){return function(n){return u(t.call(this,n),e)}}function n(t,e){return function(n){return this.lang().ordinal(t.call(this,n),e)}}function s(){}function i(t){a(this,t)}function r(t){var e=t.years||t.year||t.y||0,n=t.months||t.month||t.M||0,s=t.weeks||t.week||t.w||0,i=t.days||t.day||t.d||0,r=t.hours||t.hour||t.h||0,a=t.minutes||t.minute||t.m||0,o=t.seconds||t.second||t.s||0,u=t.milliseconds||t.millisecond||t.ms||0;this._input=t,this._milliseconds=u+1e3*o+6e4*a+36e5*r,this._days=i+7*s,this._months=n+12*e,this._data={},this._bubble()}function a(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function o(t){return 0>t?Math.ceil(t):Math.floor(t)}function u(t,e){for(var n=t+"";n.lengthn;n++)~~t[n]!==~~e[n]&&r++;return r+i}function f(t){return t?ie[t]||t.toLowerCase().replace(/(.)s$/,"$1"):t}function l(t,e){return e.abbr=t,x[t]||(x[t]=new s),x[t].set(e),x[t]}function _(t){if(!t)return H.fn._lang;if(!x[t]&&A)try{require("./lang/"+t)}catch(e){return H.fn._lang}return x[t]}function m(t){return t.match(/\[.*\]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function y(t){var e,n,s=t.match(E);for(e=0,n=s.length;n>e;e++)s[e]=ue[s[e]]?ue[s[e]]:m(s[e]);return function(i){var r="";for(e=0;n>e;e++)r+=s[e]instanceof Function?s[e].call(i,t):s[e];return r}}function M(t,e){function n(e){return t.lang().longDateFormat(e)||e}for(var s=5;s--&&N.test(e);)e=e.replace(N,n);return re[e]||(re[e]=y(e)),re[e](t)}function g(t,e){switch(t){case"DDDD":return V;case"YYYY":return X;case"YYYYY":return $;case"S":case"SS":case"SSS":case"DDD":return I;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return R;case"a":case"A":return _(e._l)._meridiemParse;case"X":return B;case"Z":case"ZZ":return j;case"T":return q;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return J;default:return new RegExp(t.replace("\\",""))}}function p(t){var e=(j.exec(t)||[])[0],n=(e+"").match(ee)||["-",0,0],s=+(60*n[1])+~~n[2];return"+"===n[0]?-s:s}function D(t,e,n){var s,i=n._a;switch(t){case"M":case"MM":i[1]=null==e?0:~~e-1;break;case"MMM":case"MMMM":s=_(n._l).monthsParse(e),null!=s?i[1]=s:n._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":null!=e&&(i[2]=~~e);break;case"YY":i[0]=~~e+(~~e>68?1900:2e3);break;case"YYYY":case"YYYYY":i[0]=~~e;break;case"a":case"A":n._isPm=_(n._l).isPM(e);break;case"H":case"HH":case"h":case"hh":i[3]=~~e;break;case"m":case"mm":i[4]=~~e;break;case"s":case"ss":i[5]=~~e;break;case"S":case"SS":case"SSS":i[6]=~~(1e3*("0."+e));break;case"X":n._d=new Date(1e3*parseFloat(e));break;case"Z":case"ZZ":n._useUTC=!0,n._tzm=p(e)}null==e&&(n._isValid=!1)}function Y(t){var e,n,s=[];if(!t._d){for(e=0;7>e;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];s[3]+=~~((t._tzm||0)/60),s[4]+=~~((t._tzm||0)%60),n=new Date(0),t._useUTC?(n.setUTCFullYear(s[0],s[1],s[2]),n.setUTCHours(s[3],s[4],s[5],s[6])):(n.setFullYear(s[0],s[1],s[2]),n.setHours(s[3],s[4],s[5],s[6])),t._d=n}}function w(t){var e,n,s=t._f.match(E),i=t._i;for(t._a=[],e=0;eo&&(u=o,s=n);a(t,s)}function v(t){var e,n=t._i,s=K.exec(n);if(s){for(t._f="YYYY-MM-DD"+(s[2]||" "),e=0;4>e;e++)if(te[e][1].exec(n)){t._f+=te[e][0];break}j.exec(n)&&(t._f+=" Z"),w(t)}else t._d=new Date(n)}function T(e){var n=e._i,s=G.exec(n);n===t?e._d=new Date:s?e._d=new Date(+s[1]):"string"==typeof n?v(e):d(n)?(e._a=n.slice(0),Y(e)):e._d=n instanceof Date?new Date(+n):new Date(n)}function b(t,e,n,s,i){return i.relativeTime(e||1,!!n,t,s)}function S(t,e,n){var s=W(Math.abs(t)/1e3),i=W(s/60),r=W(i/60),a=W(r/24),o=W(a/365),u=45>s&&["s",s]||1===i&&["m"]||45>i&&["mm",i]||1===r&&["h"]||22>r&&["hh",r]||1===a&&["d"]||25>=a&&["dd",a]||45>=a&&["M"]||345>a&&["MM",W(a/30)]||1===o&&["y"]||["yy",o];return u[2]=e,u[3]=t>0,u[4]=n,b.apply({},u)}function F(t,e,n){var s,i=n-e,r=n-t.day();return r>i&&(r-=7),i-7>r&&(r+=7),s=H(t).add("d",r),{week:Math.ceil(s.dayOfYear()/7),year:s.year()}}function O(t){var e=t._i,n=t._f;return null===e||""===e?null:("string"==typeof e&&(t._i=e=_().preparse(e)),H.isMoment(e)?(t=a({},e),t._d=new Date(+e._d)):n?d(n)?k(t):w(t):T(t),new i(t))}function z(t,e){H.fn[t]=H.fn[t+"s"]=function(t){var n=this._isUTC?"UTC":"";return null!=t?(this._d["set"+n+e](t),H.updateOffset(this),this):this._d["get"+n+e]()}}function C(t){H.duration.fn[t]=function(){return this._data[t]}}function L(t,e){H.duration.fn["as"+t]=function(){return+this/e}}for(var H,P,U="2.1.0",W=Math.round,x={},A="undefined"!=typeof module&&module.exports,G=/^\/?Date\((\-?\d+)/i,Z=/(\-)?(\d*)?\.?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/,E=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,N=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,J=/\d\d?/,I=/\d{1,3}/,V=/\d{3}/,X=/\d{1,4}/,$=/[+\-]?\d{1,6}/,R=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,j=/Z|[\+\-]\d\d:?\d\d/i,q=/T/i,B=/[\+\-]?\d+(\.\d{1,3})?/,K=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,Q="YYYY-MM-DDTHH:mm:ssZ",te=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],ee=/([\+\-]|\d\d)/gi,ne="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),se={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},ie={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",w:"week",M:"month",y:"year"},re={},ae="DDD w W M D d".split(" "),oe="M D H h m s w W".split(" "),ue={M:function(){return this.month()+1},MMM:function(t){return this.lang().monthsShort(this,t)},MMMM:function(t){return this.lang().months(this,t)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(t){return this.lang().weekdaysMin(this,t)},ddd:function(t){return this.lang().weekdaysShort(this,t)},dddd:function(t){return this.lang().weekdays(this,t)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return u(this.year()%100,2)},YYYY:function(){return u(this.year(),4)},YYYYY:function(){return u(this.year(),5)},gg:function(){return u(this.weekYear()%100,2)},gggg:function(){return this.weekYear()},ggggg:function(){return u(this.weekYear(),5)},GG:function(){return u(this.isoWeekYear()%100,2)},GGGG:function(){return this.isoWeekYear()},GGGGG:function(){return u(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return u(~~(this.milliseconds()/10),2)},SSS:function(){return u(this.milliseconds(),3)},Z:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+u(~~(t/60),2)+":"+u(~~t%60,2)},ZZ:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+u(~~(10*t/6),4)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()}};ae.length;)P=ae.pop(),ue[P+"o"]=n(ue[P],P);for(;oe.length;)P=oe.pop(),ue[P+P]=e(ue[P],2);for(ue.DDDD=e(ue.DDD,3),s.prototype={set:function(t){var e,n;for(n in t)e=t[n],"function"==typeof e?this[n]=e:this["_"+n]=e},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(t){return this._months[t.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(t){return this._monthsShort[t.month()]},monthsParse:function(t){var e,n,s;for(this._monthsParse||(this._monthsParse=[]),e=0;12>e;e++)if(this._monthsParse[e]||(n=H([2e3,e]),s="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[e]=new RegExp(s.replace(".",""),"i")),this._monthsParse[e].test(t))return e},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(t){return this._weekdays[t.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(t){return this._weekdaysShort[t.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(t){return this._weekdaysMin[t.day()]},weekdaysParse:function(t){var e,n,s;for(this._weekdaysParse||(this._weekdaysParse=[]),e=0;7>e;e++)if(this._weekdaysParse[e]||(n=H([2e3,1]).day(e),s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[e]=new RegExp(s.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(t){var e=this._longDateFormat[t];return!e&&this._longDateFormat[t.toUpperCase()]&&(e=this._longDateFormat[t.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t]=e),e},isPM:function(t){return"p"===(t+"").toLowerCase()[0]},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(t,e){var n=this._calendar[t];return"function"==typeof n?n.apply(e):n},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(t,e,n,s){var i=this._relativeTime[n];return"function"==typeof i?i(t,e,n,s):i.replace(/%d/i,t)},pastFuture:function(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)},ordinal:function(t){return this._ordinal.replace("%d",t)},_ordinal:"%d",preparse:function(t){return t},postformat:function(t){return t},week:function(t){return F(t,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6}},H=function(t,e,n){return O({_i:t,_f:e,_l:n,_isUTC:!1})},H.utc=function(t,e,n){return O({_useUTC:!0,_isUTC:!0,_l:n,_i:t,_f:e})},H.unix=function(t){return H(1e3*t)},H.duration=function(t,e){var n,s,i=H.isDuration(t),a="number"==typeof t,o=i?t._input:a?{}:t,u=Z.exec(t);return a?e?o[e]=t:o.milliseconds=t:u&&(n="-"===u[1]?-1:1,o={y:0,d:~~u[2]*n,h:~~u[3]*n,m:~~u[4]*n,s:~~u[5]*n,ms:~~u[6]*n}),s=new r(o),i&&t.hasOwnProperty("_lang")&&(s._lang=t._lang),s},H.version=U,H.defaultFormat=Q,H.updateOffset=function(){},H.lang=function(t,e){return t?(e?l(t,e):x[t]||_(t),H.duration.fn._lang=H.fn._lang=_(t),void 0):H.fn._lang._abbr},H.langData=function(t){return t&&t._lang&&t._lang._abbr&&(t=t._lang._abbr),_(t)},H.isMoment=function(t){return t instanceof i},H.isDuration=function(t){return t instanceof r},H.fn=i.prototype={clone:function(){return H(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){return M(H(this).utc(),"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var t=this;return[t.year(),t.month(),t.date(),t.hours(),t.minutes(),t.seconds(),t.milliseconds()]},isValid:function(){return null==this._isValid&&(this._isValid=this._a?!c(this._a,(this._isUTC?H.utc(this._a):H(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(t){var e=M(this,t||H.defaultFormat);return this.lang().postformat(e)},add:function(t,e){var n;return n="string"==typeof t?H.duration(+e,t):H.duration(t,e),h(this,n,1),this},subtract:function(t,e){var n;return n="string"==typeof t?H.duration(+e,t):H.duration(t,e),h(this,n,-1),this},diff:function(t,e,n){var s,i,r=this._isUTC?H(t).zone(this._offset||0):H(t).local(),a=6e4*(this.zone()-r.zone());return e=f(e),"year"===e||"month"===e?(s=432e5*(this.daysInMonth()+r.daysInMonth()),i=12*(this.year()-r.year())+(this.month()-r.month()),i+=(this-H(this).startOf("month")-(r-H(r).startOf("month")))/s,i-=6e4*(this.zone()-H(this).startOf("month").zone()-(r.zone()-H(r).startOf("month").zone()))/s,"year"===e&&(i/=12)):(s=this-r,i="second"===e?s/1e3:"minute"===e?s/6e4:"hour"===e?s/36e5:"day"===e?(s-a)/864e5:"week"===e?(s-a)/6048e5:s),n?i:o(i)},from:function(t,e){return H.duration(this.diff(t)).lang(this.lang()._abbr).humanize(!e)},fromNow:function(t){return this.from(H(),t)},calendar:function(){var t=this.diff(H().startOf("day"),"days",!0),e=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.lang().calendar(e,this))},isLeapYear:function(){var t=this.year();return 0===t%4&&0!==t%100||0===t%400},isDST:function(){return this.zone()+H(t).startOf(e)},isBefore:function(t,e){return e="undefined"!=typeof e?e:"millisecond",+this.clone().startOf(e)<+H(t).startOf(e)},isSame:function(t,e){return e="undefined"!=typeof e?e:"millisecond",+this.clone().startOf(e)===+H(t).startOf(e)},min:function(t){return t=H.apply(null,arguments),this>t?this:t},max:function(t){return t=H.apply(null,arguments),t>this?this:t},zone:function(t){var e=this._offset||0;return null==t?this._isUTC?e:this._d.getTimezoneOffset():("string"==typeof t&&(t=p(t)),Math.abs(t)<16&&(t=60*t),this._offset=t,this._isUTC=!0,e!==t&&h(this,H.duration(e-t,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},daysInMonth:function(){return H.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(t){var e=W((H(this).startOf("day")-H(this).startOf("year"))/864e5)+1;return null==t?e:this.add("d",t-e)},weekYear:function(t){var e=F(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==t?e:this.add("y",t-e)},isoWeekYear:function(t){var e=F(this,1,4).year;return null==t?e:this.add("y",t-e)},week:function(t){var e=this.lang().week(this);return null==t?e:this.add("d",7*(t-e))},isoWeek:function(t){var e=F(this,1,4).week;return null==t?e:this.add("d",7*(t-e))},weekday:function(t){var e=(this._d.getDay()+7-this.lang()._week.dow)%7;return null==t?e:this.add("d",t-e)},isoWeekday:function(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)},lang:function(e){return e===t?this._lang:(this._lang=_(e),this)}},P=0;PERROR: ' + evt.data); -} - -function writeToScreen(message) { - var pre = document.createElement("p"); - pre.style.wordWrap = "break-word"; - pre.innerHTML = message; - output.append(pre); -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/page-resource.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/page-resource.js deleted file mode 100644 index 8449ecfce..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/page-resource.js +++ /dev/null @@ -1,95 +0,0 @@ -function loadjscssfile(filename, filetype){ - if (filetype=="js"){ //if filename is a external JavaScript file - var done = false; - var script = document.createElement('script'); - script.src = filename; - script.async = false; - document.head.appendChild(script); - }else if (filetype=="css"){ //if filename is an external CSS file - var fileref=document.createElement("link") - fileref.setAttribute("rel", "stylesheet") - fileref.setAttribute("type", "text/css") - fileref.setAttribute("async", false) - fileref.setAttribute("href", filename) - document.head.appendChild(fileref); - } -} - -function loadResource(){ - //css - loadjscssfile("app/fusion/external/ebz/fn-ebz.css", "css"); - loadjscssfile("app/fusion/external/ebz/sandbox/styles/demo.css", "css"); - loadjscssfile("app/fusion/external/ebz/sandbox/styles/base.css", "css"); - loadjscssfile("app/fusion/external/ebz/sandbox/styles/btn.css", "css"); - loadjscssfile("app/fusion/external/ebz/sandbox/styles/dtpk.css", "css"); - loadjscssfile("app/fusion/external/ebz/sandbox/styles/frms.css", "css"); - loadjscssfile("app/fusion/external/ebz/sandbox/styles/sldr.css", "css"); - loadjscssfile("app/fusion/external/ebz/sandbox/styles/style.css", "css"); - loadjscssfile("app/fusion/external/ebz/sandbox/styles/tbs.css", "css"); - loadjscssfile("app/fusion/external/ebz/ebz_header/portal_ebz_header.css", "css"); - loadjscssfile("static/fusion/css/jquery-ui.css", "css"); - - - loadjscssfile("app/fusion/external/ebz/ebz_header/header.css", "css"); - loadjscssfile("app/fusion/external/ebz/ebz_header/footer.css", "css"); - // Basic AngularJS --> - loadjscssfile("app/fusion/external/ebz/angular_js/angular.js", "js"); - loadjscssfile("app/fusion/external/ebz/angular_js/angular-sanitize.js", "js"); - loadjscssfile("app/fusion/external/ebz/angular_js/angular-route.min.js", "js"); - loadjscssfile("app/fusion/external/ebz/angular_js/angular-cookies.js", "js"); - loadjscssfile("app/fusion/external/ebz/angular_js/gestures.js", "js"); - loadjscssfile("app/fusion/external/ebz/angular_js/app.js", "js"); - - loadjscssfile("app/fusion/external/ebz/sandbox/att-abs-tpls.js", "js"); - - // jQuery --> - loadjscssfile("static/js/jquery-1.10.2.js", "js"); - loadjscssfile("static/js/jquery.mask.min.js", "js"); - loadjscssfile("static/js/jquery-ui.js", "js"); - - // AngularJS Gridster --> - loadjscssfile("static/fusion/js/att_angular_gridster/ui-gridster-tpls.js", "js"); - loadjscssfile("static/fusion/js/att_angular_gridster/angular-gridster.js", "js"); - - // AngularJS Config --> - loadjscssfile("app/fusion/external/ebz/angular_js/checklist-model.js", "js"); - - // Utility --> - loadjscssfile("app/fusion/scripts/modalService.js", "js"); - loadjscssfile("app/fusion/external/angular-ui/ui-bootstrap-tpls-1.1.2.min.js", "js"); - - // Controller js --> - loadjscssfile("app/fusion/scripts/controllers/profile-search-controller.js", "js"); - loadjscssfile("app/fusion/scripts/controllers/profile-controller.js", "js"); - loadjscssfile("app/fusion/scripts/controllers/post-search-controller.js", "js"); - loadjscssfile("app/fusion/scripts/controllers/self-profile-controller.js", "js"); - loadjscssfile("app/fusion/scripts/controllers/rolefunctionpopupController.js", "js"); - loadjscssfile("app/fusion/scripts/controllers/modelpopupController.js", "js"); - - // Header and Footer --> - loadjscssfile("app/fusion/scripts/directives/footer.js", "js"); - loadjscssfile("app/fusion/external/ebz/js/footer.js", "js"); - loadjscssfile("app/fusion/scripts/directives/header.js", "js"); - loadjscssfile("app/fusion/scripts/directives/leftMenu.js", "js"); - - // Services --> - loadjscssfile("app/fusion/scripts/services/profileService.js", "js"); - loadjscssfile("app/fusion/scripts/services/userInfoService.js", "js"); - loadjscssfile("app/fusion/scripts/services/leftMenuService.js", "js"); - loadjscssfile("app/fusion/scripts/controllers/profileController.js", "js"); -} - -window.onload = loadResource(); -window.onload = function(){ - var appLoadingInterval = setInterval(function(){ loadApp() }, 500); - var count=0; - function loadApp(){ - count++ - if(typeof angular !== 'undefined') { - angular.bootstrap(document, ['abs']); - clearInterval(appLoadingInterval); - }else if(count>10){ - clearInterval(appLoadingInterval); - } - } -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/sandbox-resources.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/sandbox-resources.html deleted file mode 100644 index d04eba9ce..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/utils/sandbox-resources.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/admin-page/admin.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/admin-page/admin.html deleted file mode 100644 index f83888d91..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/admin-page/admin.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        -
        -
        -
        -
        -
        -
        -
        - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/admin-page/profile.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/admin-page/profile.html deleted file mode 100644 index 7ee430206..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/admin-page/profile.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
        -
        -
        -
        -
        -
        - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/footer.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/footer.html deleted file mode 100644 index 561487316..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/footer.html +++ /dev/null @@ -1,42 +0,0 @@ - - -
        - -
        -
        - -
        - -
        -
        -
        - - -
        -
        - -
        -
        -
        -
        -
        -
        - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/header.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/header.html deleted file mode 100644 index adb5be35a..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/header.html +++ /dev/null @@ -1,186 +0,0 @@ - -
        -
        -
        -
        -
        - - -
        -
        -
        -
        -
      • -
        - ECOMP Portal -
      • -
        -
        - - -
        - - -
        - -
        -
        -
        -
      • - Unable to load menus -
      • -
        -
      • -
        - - -
        -
      • -
      •  
      • -
        - -
        - -
        -
        -
        -
        -
        -
        -
        -
        - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/left_menu.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/left_menu.html deleted file mode 100644 index 84ee6eadd..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/left_menu.html +++ /dev/null @@ -1,41 +0,0 @@ - -
        - - - -     {{app_name}} - -
        -
        -
        -
        - - - - - -
        -
        -
        -
        -
        \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/admin_menu_edit.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/admin_menu_edit.html deleted file mode 100644 index ee23635fa..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/admin_menu_edit.html +++ /dev/null @@ -1,175 +0,0 @@ - - -
        -
        -
        -

        Admin Menu Items

        -
        -
        - Add menu item here: -
        -
        - -
        -
        -
        - Existing menu items: -
        -
        - - - -
        -
      - -
      -
      - - - -
      Number of records to show: -
      - -
      -
      - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/broadcast.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/broadcast.html deleted file mode 100644 index a14da0565..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/broadcast.html +++ /dev/null @@ -1,61 +0,0 @@ - -
      -
      -

      Broadcast Message Edit

      -
      - -
      - Please edit the broadcast message details below: 

      -
      -
      - -
      -
      -
      -
      - - -
      - -
      -
      - - -
      - -
      -
      - -
      - -
      -
      -
      -
      - -
      -
      - - -
      -
      -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/broadcast_list.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/broadcast_list.html deleted file mode 100644 index e9c4c291c..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/broadcast_list.html +++ /dev/null @@ -1,71 +0,0 @@ - -
      - -
      - -

      Broadcast Messages

      -
      -
      - {{location.label}} Messages -
      - - - - - - - - - - - - - - - - - {{message.id}} - - - - - - - - - - - -
      No.Message TextStart DateEnd DateSort OrderServerActive?Delete?
      {{$index+1}}{{message.messageText}} - {{message.displayStartDate}} - {{message.displayEndDate}}{{message.sortOrder}}{{message.siteCd}} -
      - -
      -
      -
      -
      -
      - -


      -
      -
      -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/collaborate_list.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/collaborate_list.html deleted file mode 100644 index 5f07a47b8..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/collaborate_list.html +++ /dev/null @@ -1,57 +0,0 @@ - -
      -
      -

      User List

      -
      - - - - - - - - - - - - - - - - - - - - - - -
      User IDLast NameFirst NameEmailUser IDOnline/Offline
      {{rowData.id}}{{rowData.lastName}}{{rowData.firstName}}{{rowData.email}}{{rowData.orgUserId}} - Offline - Online -
      -
      -
      - - - - Add the Chrome Extension for DescktopCapture and refresh page -
      -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/jcs_admin.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/jcs_admin.html deleted file mode 100644 index 7da457803..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/jcs_admin.html +++ /dev/null @@ -1,87 +0,0 @@ - -
      - -

      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-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal.html deleted file mode 100644 index 3cde902c2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_fn_menu_add.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_fn_menu_add.html deleted file mode 100644 index 760f10b55..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_fn_menu_add.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_fn_menu_edit.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_fn_menu_edit.html deleted file mode 100644 index 4c23ba6fc..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_fn_menu_edit.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_role.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_role.html deleted file mode 100644 index 4663bd466..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_role.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_rolefunction.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_rolefunction.html deleted file mode 100644 index b9e8ef0e8..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/popup_modal_rolefunction.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/post_search.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/post_search.html deleted file mode 100644 index 2c4846ddc..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/post_search.html +++ /dev/null @@ -1,139 +0,0 @@ - -
      -

      User Search

      -
      - Please enter search criteria below:
      - -
      - Last Name:
      - -
      - -
      - First Name:
      - -
      - -
      - User ID:
      - -
      - -
      - Manager User ID:
      - -
      -
      -
      - Organization:
      - -
      - -
      - Email:
      - -
      -
      -
      - - - -
      -
      - - {{noResultsString}} - -
      - - - - - - - - - - - - - - - - - - - - - - - - - -
      NoNameOrgUserIdOrganizationPhoneEmailImport?
      - {{$index + 1}} - -
      - {{profile.lastName}}, {{profile.firstName}} -
      - - -
      - {{profile.orgUserId}} - - {{profile.orgCode}} - - {{profile.phone}} - - {{profile.email}} - -
      -
      - -
      -
      -
      - Exists -
      -
      -
      - Rows Per Page: - -
      -
      - Current Page: - -
      -
      - Total Page(s): - -
      - -
      - -
      - -
      - -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/profile_detail.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/profile_detail.html deleted file mode 100644 index 31f68577d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/profile_detail.html +++ /dev/null @@ -1,188 +0,0 @@ - -
      -
      -

      Profile Edit

      -
      - Please edit the profile details below: 

      - -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      -   -
      -
      - -
      -
      -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      -
      -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      -
      -
      -
      - -
      - -
      -
      -
      -
      - -
      -
      - -
      - -
      -
      -
      -
      -
      -
      -
      -
      -
      - -
      - -
      - -
      -
      - - - -
      - - - - - - - - - - - - - - - - -
      NameRemove?
      {{ role.name }} - -
      - - - - - - -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/profile_search.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/profile_search.html deleted file mode 100644 index 9f49a80ff..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/profile_search.html +++ /dev/null @@ -1,72 +0,0 @@ - -
      - -

      Profile Search

      - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      User IDLast NameFirst NameEmailUser IDManager User IDEditActive?
      -
      - -
      -
      - -
      - Records Per Page: - -
      - - - - -
      - -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role.html deleted file mode 100644 index d372f9159..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role.html +++ /dev/null @@ -1,118 +0,0 @@ - -
      -
      - -
      -

      Role Edit

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

      - -
      - - -
      - - - - - - - - - - - - - - -
      NameRemove?
      {{ role.name }} -
      -
      - -
      - - - - - - - - - - - - - - -
      Role
      -
      - -
      -
      {{ availableRole.name }}
      -
      -
      -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role_function_list.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role_function_list.html deleted file mode 100644 index b08510368..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role_function_list.html +++ /dev/null @@ -1,88 +0,0 @@ - -
      -
      - -

      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?
      - -
      -
      - -
      -
      -
      - - -
      - -
      -
      - -
      -
      -
      -
      - -
      -
      - - -
      - -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role_list.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role_list.html deleted file mode 100644 index 1100cbb07..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/role_list.html +++ /dev/null @@ -1,61 +0,0 @@ - -
      - -

      Roles

      -
      -
      -Click on a Role to view its details. - -
      -
      - - - - - - - - - - - - - - - - - - -
      NamePriorityActive?Delete?
      {{ availableRole.name }}{{ availableRole.priority }} -
      - -
      -
      -
      -
      -
      - -
      - -
      - -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/self_profile.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/self_profile.html deleted file mode 100644 index 0f1877c58..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/self_profile.html +++ /dev/null @@ -1,183 +0,0 @@ - - - -

      Self Profile

      -
      - Please edit the profile details below: 

      - -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      -
      -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      -
      -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      - -
      -
      - -
      -
      -
      -
      - -
      - -
      -
      -
      -
      - -
      -
      - -
      - -
      -
      -
      -
      -
      -
      -
      -
      -
      - -
      - -
      - -
      -
      - - - -
      - - - - - - - - - - - - - - - - -
      NameRemove?
      {{ role.name }} - -
      - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/usage_list.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/usage_list.html deleted file mode 100644 index 9bb2c8695..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/profile-page/usage_list.html +++ /dev/null @@ -1,64 +0,0 @@ - -
      -
      -

      Users

      -
      - -
      - 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)Expire User Session?
      {{user.id}}{{user.lastName}}{{user.email}}{{user.lastAccess}}{{user.remaining}}
      Current Session
      - -
      -
      -
      -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-landing.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-landing.html deleted file mode 100644 index 2b5e3b602..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-landing.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -
      -
      -
      -
      -
      -
      -
      - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-listing.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-listing.html deleted file mode 100644 index ceb886778..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-listing.html +++ /dev/null @@ -1,85 +0,0 @@ - -
      -
      -
      -
      -

      -

      -
      -
      -
      -
      - -
      -
      -
      -
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      IdNameKeyDescriptionWorkflow Server URLViewActiveCreated Created ByActionScheduleEditDelete?
      {{workflow.id}}{{workflow.name}}{{workflow.workflowKey}}{{workflow.description}}{{workflow.runLink}}
      {{workflow.active}}{{workflow.created}}{{workflow.createdBy}}
      -
      - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-new.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-new.html deleted file mode 100644 index 4622b928f..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-new.html +++ /dev/null @@ -1,108 +0,0 @@ - -
      - -
      -
      - -
      - - -
      - - -
      - Workflow Name is required !!! -
      - -
      -
      - - -
      - -
      - - -
      - Workflow Key is required !!! -
      - -
      -
      - - -
      - - -
      - -
      -
      - -
      - -
      - -
      - -
      - Run Link is required !!! - Not valid url! -
      - -
      - - - -
      - -
      - - - Active - Inactive - - -
      -
      - - -
      -
      -
      -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-preview.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-preview.html deleted file mode 100644 index 80fece4ef..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-preview.html +++ /dev/null @@ -1,36 +0,0 @@ - -
      - -
      -
      - -
      - -
      - -
      -
      -
      -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-remove.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-remove.html deleted file mode 100644 index e21efad8e..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-remove.html +++ /dev/null @@ -1,38 +0,0 @@ - -
      - -
      -
      - -
      - -
      - - -
      -
      -
      -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-schedule.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-schedule.html deleted file mode 100644 index aebc04fbd..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/view-models/workflows/workflow-schedule.html +++ /dev/null @@ -1,116 +0,0 @@ - -
      - - -
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - : - - - - - - - -
      - - -
      -
      -
      - - -Pick a date: - -Hour: - -Minute: -
      -
      - -
      -
      - - - -
      -
      -
      -
      -
      - -
      -
      - - -
      -
      -
      -
      - - - -
      -
      -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/webrtc/RTCMultiConnection.js b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/webrtc/RTCMultiConnection.js deleted file mode 100644 index 449e8d591..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/webrtc/RTCMultiConnection.js +++ /dev/null @@ -1,6788 +0,0 @@ -// Last time updated at Monday, December 21st, 2015, 5:25:26 PM - -// Quick-Demo for newbies: http://jsfiddle.net/c46de0L8/ -// Another simple demo: http://jsfiddle.net/zar6fg60/ - -// Latest file can be found here: https://cdn.webrtc-experiment.com/RTCMultiConnection.js - -// Muaz Khan - www.MuazKhan.com -// MIT License - www.WebRTC-Experiment.com/licence -// Documentation - www.RTCMultiConnection.org/docs -// FAQ - www.RTCMultiConnection.org/FAQ -// Changes log - www.RTCMultiConnection.org/changes-log/ -// Demos - www.WebRTC-Experiment.com/RTCMultiConnection - -// _________________________ -// RTCMultiConnection-v2.2.2 - -(function() { - - // RMC == RTCMultiConnection - // usually page-URL is used as channel-id - // you can always override it! - // www.RTCMultiConnection.org/docs/channel-id/ - window.RMCDefaultChannel = location.href.replace(/\/|:|#|\?|\$|\^|%|\.|`|~|!|\+|@|\[|\||]|\|*. /g, '').split('\n').join('').split('\r').join(''); - - // www.RTCMultiConnection.org/docs/constructor/ - window.RTCMultiConnection = function(channel) { - // an instance of constructor - var connection = this; - - // a reference to RTCMultiSession - var rtcMultiSession; - - // setting default channel or channel passed through constructor - connection.channel = channel || RMCDefaultChannel; - - // to allow single user to join multiple rooms; - // you can change this property at runtime! - connection.isAcceptNewSession = true; - - // www.RTCMultiConnection.org/docs/open/ - connection.open = function(args) { - connection.isAcceptNewSession = false; - - // www.RTCMultiConnection.org/docs/session-initiator/ - // you can always use this property to determine room owner! - connection.isInitiator = true; - - var dontTransmit = false; - - // a channel can contain multiple rooms i.e. sessions - if (args) { - if (isString(args)) { - connection.sessionid = args; - } else { - if (!isNull(args.transmitRoomOnce)) { - connection.transmitRoomOnce = args.transmitRoomOnce; - } - - if (!isNull(args.dontTransmit)) { - dontTransmit = args.dontTransmit; - } - - if (!isNull(args.sessionid)) { - connection.sessionid = args.sessionid; - } - } - } - - // if firebase && if session initiator - if (connection.socket && connection.socket.remove) { - connection.socket.remove(); - } - - if (!connection.sessionid) connection.sessionid = connection.channel; - connection.sessionDescription = { - sessionid: connection.sessionid, - userid: connection.userid, - session: connection.session, - extra: connection.extra - }; - - if (!connection.sessionDescriptions[connection.sessionDescription.sessionid]) { - connection.numberOfSessions++; - connection.sessionDescriptions[connection.sessionDescription.sessionid] = connection.sessionDescription; - } - - // connect with signaling channel - initRTCMultiSession(function() { - // "captureUserMediaOnDemand" is disabled by default. - // invoke "getUserMedia" only when first participant found. - rtcMultiSession.captureUserMediaOnDemand = args ? !!args.captureUserMediaOnDemand : false; - - if (args && args.onMediaCaptured) { - connection.onMediaCaptured = args.onMediaCaptured; - } - - // for session-initiator, user-media is captured as soon as "open" is invoked. - if (!rtcMultiSession.captureUserMediaOnDemand) captureUserMedia(function() { - rtcMultiSession.initSession({ - sessionDescription: connection.sessionDescription, - dontTransmit: dontTransmit - }); - - invokeMediaCaptured(connection); - }); - - if (rtcMultiSession.captureUserMediaOnDemand) { - rtcMultiSession.initSession({ - sessionDescription: connection.sessionDescription, - dontTransmit: dontTransmit - }); - } - }); - return connection.sessionDescription; - }; - - // www.RTCMultiConnection.org/docs/connect/ - connection.connect = function(sessionid) { - // a channel can contain multiple rooms i.e. sessions - if (sessionid) { - connection.sessionid = sessionid; - } - - // connect with signaling channel - initRTCMultiSession(function() { - log('Signaling channel is ready.'); - }); - - return this; - }; - - // www.RTCMultiConnection.org/docs/join/ - connection.join = joinSession; - - // www.RTCMultiConnection.org/docs/send/ - connection.send = function(data, _channel) { - if (connection.numberOfConnectedUsers <= 0) { - // no connections - setTimeout(function() { - // try again - connection.send(data, _channel); - }, 1000); - return; - } - - // send file/data or /text - if (!data) - throw 'No file, data or text message to share.'; - - // connection.send([file1, file2, file3]) - // you can share multiple files, strings or data objects using "send" method! - if (data instanceof Array && !isNull(data[0].size) && !isNull(data[0].type)) { - // this mechanism can cause failure for subsequent packets/data - // on Firefox especially; and on chrome as well! - // todo: need to use setTimeout instead. - for (var i = 0; i < data.length; i++) { - data[i].size && data[i].type && connection.send(data[i], _channel); - } - return; - } - - // File or Blob object MUST have "type" and "size" properties - if (!isNull(data.size) && !isNull(data.type)) { - if (!connection.enableFileSharing) { - throw '"enableFileSharing" boolean MUST be "true" to support file sharing.'; - } - - if (!rtcMultiSession.fileBufferReader) { - initFileBufferReader(connection, function(fbr) { - rtcMultiSession.fileBufferReader = fbr; - connection.send(data, _channel); - }); - return; - } - - var extra = merge({ - userid: connection.userid - }, data.extra || connection.extra); - - rtcMultiSession.fileBufferReader.readAsArrayBuffer(data, function(uuid) { - rtcMultiSession.fileBufferReader.getNextChunk(uuid, function(nextChunk, isLastChunk, extra) { - if (_channel) _channel.send(nextChunk); - else rtcMultiSession.send(nextChunk); - }); - }, extra); - } else { - // to allow longest string messages - // and largest data objects - // or anything of any size! - // to send multiple data objects concurrently! - - TextSender.send({ - text: data, - channel: rtcMultiSession, - _channel: _channel, - connection: connection - }); - } - }; - - function initRTCMultiSession(onSignalingReady) { - if (screenFrame) { - loadScreenFrame(); - } - - // RTCMultiSession is the backbone object; - // this object MUST be initialized once! - if (rtcMultiSession) return onSignalingReady(); - - // your everything is passed over RTCMultiSession constructor! - rtcMultiSession = new RTCMultiSession(connection, onSignalingReady); - } - - connection.disconnect = function() { - if (rtcMultiSession) rtcMultiSession.disconnect(); - rtcMultiSession = null; - }; - - function joinSession(session, joinAs) { - if (isString(session)) { - connection.skipOnNewSession = true; - } - - if (!rtcMultiSession) { - log('Signaling channel is not ready. Connecting...'); - // connect with signaling channel - initRTCMultiSession(function() { - log('Signaling channel is connected. Joining the session again...'); - setTimeout(function() { - joinSession(session, joinAs); - }, 1000); - }); - return; - } - - // connection.join('sessionid'); - if (isString(session)) { - if (connection.sessionDescriptions[session]) { - session = connection.sessionDescriptions[session]; - } else - return setTimeout(function() { - log('Session-Descriptions not found. Rechecking..'); - joinSession(session, joinAs); - }, 1000); - } - - // connection.join('sessionid', { audio: true }); - if (joinAs) { - return captureUserMedia(function() { - session.oneway = true; - joinSession(session); - }, joinAs); - } - - if (!session || !session.userid || !session.sessionid) { - error('missing arguments', arguments); - - var error = 'Invalid data passed over "connection.join" method.'; - connection.onstatechange({ - userid: 'browser', - extra: {}, - name: 'Unexpected data detected.', - reason: error - }); - - throw error; - } - - if (!connection.dontOverrideSession) { - connection.session = session.session; - } - - var extra = connection.extra || session.extra || {}; - - // todo: need to verify that if-block statement works as expected. - // expectations: if it is oneway streaming; or if it is data-only connection - // then, it shouldn't capture user-media on participant's side. - if (session.oneway || isData(session)) { - rtcMultiSession.joinSession(session, extra); - } else { - captureUserMedia(function() { - rtcMultiSession.joinSession(session, extra); - }); - } - } - - var isFirstSession = true; - - // www.RTCMultiConnection.org/docs/captureUserMedia/ - - function captureUserMedia(callback, _session, dontCheckChromExtension) { - // capture user's media resources - var session = _session || connection.session; - - if (isEmpty(session)) { - if (callback) callback(); - return; - } - - // you can force to skip media capturing! - if (connection.dontCaptureUserMedia) { - return callback(); - } - - // if it is data-only connection - // if it is one-way connection and current user is participant - if (isData(session) || (!connection.isInitiator && session.oneway)) { - // www.RTCMultiConnection.org/docs/attachStreams/ - connection.attachStreams = []; - return callback(); - } - - var constraints = { - audio: !!session.audio ? { - mandatory: {}, - optional: [{ - chromeRenderToAssociatedSink: true - }] - } : false, - video: !!session.video - }; - - // if custom audio device is selected - if (connection._mediaSources.audio) { - constraints.audio.optional.push({ - sourceId: connection._mediaSources.audio - }); - } - - // if custom video device is selected - if (connection._mediaSources.video) { - constraints.video = { - optional: [{ - sourceId: connection._mediaSources.video - }] - }; - } - - // for connection.session = {}; - if (!session.screen && !constraints.audio && !constraints.video) { - return callback(); - } - - var screen_constraints = { - audio: false, - video: { - mandatory: { - chromeMediaSource: DetectRTC.screen.chromeMediaSource, - maxWidth: screen.width > 1920 ? screen.width : 1920, - maxHeight: screen.height > 1080 ? screen.height : 1080 - }, - optional: [] - } - }; - - if (isFirefox && session.screen) { - if (location.protocol !== 'https:') { - return error(SCREEN_COMMON_FAILURE); - } - warn(Firefox_Screen_Capturing_Warning); - - screen_constraints.video = merge(screen_constraints.video.mandatory, { - mozMediaSource: 'window', // mozMediaSource is redundant here - mediaSource: 'window' // 'screen' || 'window' - }); - - // Firefox is supporting audio+screen from single getUserMedia request - // audio+video+screen will become audio+screen for Firefox - // because Firefox isn't supporting multi-streams feature version < 38 - // version >38 supports multi-stream sharing. - // we can use: firefoxVersion < 38 - // however capturing audio and screen using single getUserMedia is a better option - if (constraints.audio /* && !session.video */ ) { - screen_constraints.audio = true; - constraints = {}; - } - - delete screen_constraints.video.chromeMediaSource; - } - - // if screen is prompted - if (session.screen) { - if (isChrome && DetectRTC.screen.extensionid != ReservedExtensionID) { - useCustomChromeExtensionForScreenCapturing = true; - } - - if (isChrome && !useCustomChromeExtensionForScreenCapturing && !dontCheckChromExtension && !DetectRTC.screen.sourceId) { - listenEventHandler('message', onIFrameCallback); - - function onIFrameCallback(event) { - if (event.data && event.data.chromeMediaSourceId) { - // this event listener is no more needed - window.removeEventListener('message', onIFrameCallback); - - var sourceId = event.data.chromeMediaSourceId; - - DetectRTC.screen.sourceId = sourceId; - DetectRTC.screen.chromeMediaSource = 'desktop'; - - if (sourceId == 'PermissionDeniedError') { - var mediaStreamError = { - message: location.protocol == 'https:' ? 'User denied to share content of his screen.' : SCREEN_COMMON_FAILURE, - name: 'PermissionDeniedError', - constraintName: screen_constraints, - session: session - }; - currentUserMediaRequest.mutex = false; - DetectRTC.screen.sourceId = null; - return connection.onMediaError(mediaStreamError); - } - - captureUserMedia(callback, _session); - } - - if (event.data && event.data.chromeExtensionStatus) { - warn('Screen capturing extension status is:', event.data.chromeExtensionStatus); - DetectRTC.screen.chromeMediaSource = 'screen'; - captureUserMedia(callback, _session, true); - } - } - - if (!screenFrame) { - loadScreenFrame(); - } - - screenFrame.postMessage(); - return; - } - - // check if screen capturing extension is installed. - if (isChrome && useCustomChromeExtensionForScreenCapturing && !dontCheckChromExtension && DetectRTC.screen.chromeMediaSource == 'screen' && DetectRTC.screen.extensionid) { - if (DetectRTC.screen.extensionid == ReservedExtensionID && document.domain.indexOf('webrtc-experiment.com') == -1) { - return captureUserMedia(callback, _session, true); - } - - log('checking if chrome extension is installed.'); - DetectRTC.screen.getChromeExtensionStatus(function(status) { - if (status == 'installed-enabled') { - DetectRTC.screen.chromeMediaSource = 'desktop'; - } - - captureUserMedia(callback, _session, true); - log('chrome extension is installed?', DetectRTC.screen.chromeMediaSource == 'desktop'); - }); - return; - } - - if (isChrome && useCustomChromeExtensionForScreenCapturing && DetectRTC.screen.chromeMediaSource == 'desktop' && !DetectRTC.screen.sourceId) { - DetectRTC.screen.getSourceId(function(sourceId) { - if (sourceId == 'PermissionDeniedError') { - var mediaStreamError = { - message: 'User denied to share content of his screen.', - name: 'PermissionDeniedError', - constraintName: screen_constraints, - session: session - }; - currentUserMediaRequest.mutex = false; - DetectRTC.screen.chromeMediaSource = 'desktop'; - return connection.onMediaError(mediaStreamError); - } - - if (sourceId == 'No-Response') { - error('Chrome extension seems not available. Make sure that manifest.json#L16 has valid content-script matches pointing to your URL.'); - DetectRTC.screen.chromeMediaSource = 'screen'; - return captureUserMedia(callback, _session, true); - } - - captureUserMedia(callback, _session, true); - }); - return; - } - - if (isChrome && DetectRTC.screen.chromeMediaSource == 'desktop') { - screen_constraints.video.mandatory.chromeMediaSourceId = DetectRTC.screen.sourceId; - } - - var _isFirstSession = isFirstSession; - - _captureUserMedia(screen_constraints, constraints.audio || constraints.video ? function() { - - if (_isFirstSession) isFirstSession = true; - - _captureUserMedia(constraints, callback); - } : callback); - } else _captureUserMedia(constraints, callback, session.audio && !session.video); - - function _captureUserMedia(forcedConstraints, forcedCallback, isRemoveVideoTracks, dontPreventSSLAutoAllowed) { - connection.onstatechange({ - userid: 'browser', - extra: {}, - name: 'fetching-usermedia', - reason: 'About to capture user-media with constraints: ' + toStr(forcedConstraints) - }); - - - if (connection.preventSSLAutoAllowed && !dontPreventSSLAutoAllowed && isChrome) { - // if navigator.customGetUserMediaBar.js is missing - if (!navigator.customGetUserMediaBar) { - loadScript(connection.resources.customGetUserMediaBar, function() { - _captureUserMedia(forcedConstraints, forcedCallback, isRemoveVideoTracks, dontPreventSSLAutoAllowed); - }); - return; - } - - navigator.customGetUserMediaBar(forcedConstraints, function() { - _captureUserMedia(forcedConstraints, forcedCallback, isRemoveVideoTracks, true); - }, function() { - connection.onMediaError({ - name: 'PermissionDeniedError', - message: 'User denied permission.', - constraintName: forcedConstraints, - session: session - }); - }); - return; - } - - var mediaConfig = { - onsuccess: function(stream, returnBack, idInstance, streamid) { - onStreamSuccessCallback(stream, returnBack, idInstance, streamid, forcedConstraints, forcedCallback, isRemoveVideoTracks, screen_constraints, constraints, session); - }, - onerror: function(e, constraintUsed) { - // http://goo.gl/hrwF1a - if (isFirefox) { - if (e == 'PERMISSION_DENIED') { - e = { - message: '', - name: 'PermissionDeniedError', - constraintName: constraintUsed, - session: session - }; - } - } - - if (isFirefox && constraintUsed.video && constraintUsed.video.mozMediaSource) { - mediaStreamError = { - message: Firefox_Screen_Capturing_Warning, - name: e.name || 'PermissionDeniedError', - constraintName: constraintUsed, - session: session - }; - - connection.onMediaError(mediaStreamError); - return; - } - - if (isString(e)) { - return connection.onMediaError({ - message: 'Unknown Error', - name: e, - constraintName: constraintUsed, - session: session - }); - } - - // it seems that chrome 35+ throws "DevicesNotFoundError" exception - // when any of the requested media is either denied or absent - if (e.name && (e.name == 'PermissionDeniedError' || e.name == 'DevicesNotFoundError')) { - var mediaStreamError = 'Either: '; - mediaStreamError += '\n Media resolutions are not permitted.'; - mediaStreamError += '\n Another application is using same media device.'; - mediaStreamError += '\n Media device is not attached or drivers not installed.'; - mediaStreamError += '\n You denied access once and it is still denied.'; - - if (e.message && e.message.length) { - mediaStreamError += '\n ' + e.message; - } - - mediaStreamError = { - message: mediaStreamError, - name: e.name, - constraintName: constraintUsed, - session: session - }; - - connection.onMediaError(mediaStreamError); - - if (isChrome && (session.audio || session.video)) { - // todo: this snippet fails if user has two or more - // microphone/webcam attached. - DetectRTC.load(function() { - // it is possible to check presence of the microphone before using it! - if (session.audio && !DetectRTC.hasMicrophone) { - warn('It seems that you have no microphone attached to your device/system.'); - session.audio = session.audio = false; - - if (!session.video) { - alert('It seems that you are capturing microphone and there is no device available or access is denied. Reloading...'); - location.reload(); - } - } - - // it is possible to check presence of the webcam before using it! - if (session.video && !DetectRTC.hasWebcam) { - warn('It seems that you have no webcam attached to your device/system.'); - session.video = session.video = false; - - if (!session.audio) { - alert('It seems that you are capturing webcam and there is no device available or access is denied. Reloading...'); - location.reload(); - } - } - - if (!DetectRTC.hasMicrophone && !DetectRTC.hasWebcam) { - alert('It seems that either both microphone/webcam are not available or access is denied. Reloading...'); - location.reload(); - } else if (!connection.getUserMediaPromptedOnce) { - // make maximum two tries! - connection.getUserMediaPromptedOnce = true; - captureUserMedia(callback, session); - } - }); - } - } - - if (e.name && e.name == 'ConstraintNotSatisfiedError') { - var mediaStreamError = 'Either: '; - mediaStreamError += '\n You are prompting unknown media resolutions.'; - mediaStreamError += '\n You are using invalid media constraints.'; - - if (e.message && e.message.length) { - mediaStreamError += '\n ' + e.message; - } - - mediaStreamError = { - message: mediaStreamError, - name: e.name, - constraintName: constraintUsed, - session: session - }; - - connection.onMediaError(mediaStreamError); - } - - if (session.screen) { - if (isFirefox) { - error(Firefox_Screen_Capturing_Warning); - } else if (location.protocol !== 'https:') { - if (!isNodeWebkit && (location.protocol == 'file:' || location.protocol == 'http:')) { - error('You cannot use HTTP or file protocol for screen capturing. You must either use HTTPs or chrome extension page or Node-Webkit page.'); - } - } else { - error('Unable to detect actual issue. Maybe "deprecated" screen capturing flag was not set using command line or maybe you clicked "No" button or maybe chrome extension returned invalid "sourceId". Please install chrome-extension: http://bit.ly/webrtc-screen-extension'); - } - } - - currentUserMediaRequest.mutex = false; - - // to make sure same stream can be captured again! - var idInstance = JSON.stringify(constraintUsed); - if (currentUserMediaRequest.streams[idInstance]) { - delete currentUserMediaRequest.streams[idInstance]; - } - }, - mediaConstraints: connection.mediaConstraints || {} - }; - - mediaConfig.constraints = forcedConstraints || constraints; - mediaConfig.connection = connection; - getUserMedia(mediaConfig); - } - } - - function onStreamSuccessCallback(stream, returnBack, idInstance, streamid, forcedConstraints, forcedCallback, isRemoveVideoTracks, screen_constraints, constraints, session) { - if (!streamid) streamid = getRandomString(); - - connection.onstatechange({ - userid: 'browser', - extra: {}, - name: 'usermedia-fetched', - reason: 'Captured user media using constraints: ' + toStr(forcedConstraints) - }); - - if (isRemoveVideoTracks) { - stream = convertToAudioStream(stream); - } - - connection.localStreamids.push(streamid); - stream.onended = function() { - if (streamedObject.mediaElement && !streamedObject.mediaElement.parentNode && document.getElementById(stream.streamid)) { - streamedObject.mediaElement = document.getElementById(stream.streamid); - } - - // when a stream is stopped; it must be removed from "attachStreams" array - connection.attachStreams.forEach(function(_stream, index) { - if (_stream == stream) { - delete connection.attachStreams[index]; - connection.attachStreams = swap(connection.attachStreams); - } - }); - - onStreamEndedHandler(streamedObject, connection); - - if (connection.streams[streamid]) { - connection.removeStream(streamid); - } - - // if user clicks "stop" button to close screen sharing - var _stream = connection.streams[streamid]; - if (_stream && _stream.sockets.length) { - _stream.sockets.forEach(function(socket) { - socket.send({ - streamid: _stream.streamid, - stopped: true - }); - }); - } - - currentUserMediaRequest.mutex = false; - // to make sure same stream can be captured again! - if (currentUserMediaRequest.streams[idInstance]) { - delete currentUserMediaRequest.streams[idInstance]; - } - - // to allow re-capturing of the screen - DetectRTC.screen.sourceId = null; - }; - - if (!isIE) { - stream.streamid = streamid; - stream.isScreen = forcedConstraints == screen_constraints; - stream.isVideo = forcedConstraints == constraints && !!constraints.video; - stream.isAudio = forcedConstraints == constraints && !!constraints.audio && !constraints.video; - - // if muted stream is negotiated - stream.preMuted = { - audio: stream.getAudioTracks().length && !stream.getAudioTracks()[0].enabled, - video: stream.getVideoTracks().length && !stream.getVideoTracks()[0].enabled - }; - } - - var mediaElement = createMediaElement(stream, session); - mediaElement.muted = true; - - var streamedObject = { - stream: stream, - streamid: streamid, - mediaElement: mediaElement, - blobURL: mediaElement.mozSrcObject ? URL.createObjectURL(stream) : mediaElement.src, - type: 'local', - userid: connection.userid, - extra: connection.extra, - session: session, - isVideo: !!stream.isVideo, - isAudio: !!stream.isAudio, - isScreen: !!stream.isScreen, - isInitiator: !!connection.isInitiator, - rtcMultiConnection: connection - }; - - if (isFirstSession) { - connection.attachStreams.push(stream); - } - isFirstSession = false; - - connection.streams[streamid] = connection._getStream(streamedObject); - - if (!returnBack) { - connection.onstream(streamedObject); - } - - if (connection.setDefaultEventsForMediaElement) { - connection.setDefaultEventsForMediaElement(mediaElement, streamid); - } - - if (forcedCallback) forcedCallback(stream, streamedObject); - - if (connection.onspeaking) { - initHark({ - stream: stream, - streamedObject: streamedObject, - connection: connection - }); - } - } - - // www.RTCMultiConnection.org/docs/captureUserMedia/ - connection.captureUserMedia = captureUserMedia; - - // www.RTCMultiConnection.org/docs/leave/ - connection.leave = function(userid) { - if (!rtcMultiSession) return; - - isFirstSession = true; - - if (userid) { - connection.eject(userid); - return; - } - - rtcMultiSession.leave(); - }; - - // www.RTCMultiConnection.org/docs/eject/ - connection.eject = function(userid) { - if (!connection.isInitiator) throw 'Only session-initiator can eject a user.'; - if (!connection.peers[userid]) throw 'You ejected invalid user.'; - connection.peers[userid].sendCustomMessage({ - ejected: true - }); - }; - - // www.RTCMultiConnection.org/docs/close/ - connection.close = function() { - // close entire session - connection.autoCloseEntireSession = true; - connection.leave(); - }; - - // www.RTCMultiConnection.org/docs/renegotiate/ - connection.renegotiate = function(stream, session) { - if (connection.numberOfConnectedUsers <= 0) { - // no connections - setTimeout(function() { - // try again - connection.renegotiate(stream, session); - }, 1000); - return; - } - - rtcMultiSession.addStream({ - renegotiate: session || merge({ - oneway: true - }, connection.session), - stream: stream - }); - }; - - connection.attachExternalStream = function(stream, isScreen) { - var constraints = {}; - if (stream.getAudioTracks && stream.getAudioTracks().length) { - constraints.audio = true; - } - if (stream.getVideoTracks && stream.getVideoTracks().length) { - constraints.video = true; - } - - var screen_constraints = { - video: { - chromeMediaSource: 'fake' - } - }; - var forcedConstraints = isScreen ? screen_constraints : constraints; - onStreamSuccessCallback(stream, false, '', null, forcedConstraints, false, false, screen_constraints, constraints, constraints); - }; - - // www.RTCMultiConnection.org/docs/addStream/ - connection.addStream = function(session, socket) { - // www.RTCMultiConnection.org/docs/renegotiation/ - - if (connection.numberOfConnectedUsers <= 0) { - // no connections - setTimeout(function() { - // try again - connection.addStream(session, socket); - }, 1000); - return; - } - - // renegotiate new media stream - if (session) { - var isOneWayStreamFromParticipant; - if (!connection.isInitiator && session.oneway) { - session.oneway = false; - isOneWayStreamFromParticipant = true; - } - - captureUserMedia(function(stream) { - if (isOneWayStreamFromParticipant) { - session.oneway = true; - } - addStream(stream); - }, session); - } else addStream(); - - function addStream(stream) { - rtcMultiSession.addStream({ - stream: stream, - renegotiate: session || connection.session, - socket: socket - }); - } - }; - - // www.RTCMultiConnection.org/docs/removeStream/ - connection.removeStream = function(streamid, dontRenegotiate) { - if (connection.numberOfConnectedUsers <= 0) { - // no connections - setTimeout(function() { - // try again - connection.removeStream(streamid, dontRenegotiate); - }, 1000); - return; - } - - if (!streamid) streamid = 'all'; - if (!isString(streamid) || streamid.search(/all|audio|video|screen/gi) != -1) { - function _detachStream(_stream, config) { - if (config.local && _stream.type != 'local') return; - if (config.remote && _stream.type != 'remote') return; - - // connection.removeStream({screen:true}); - if (config.screen && !!_stream.isScreen) { - connection.detachStreams.push(_stream.streamid); - } - - // connection.removeStream({audio:true}); - if (config.audio && !!_stream.isAudio) { - connection.detachStreams.push(_stream.streamid); - } - - // connection.removeStream({video:true}); - if (config.video && !!_stream.isVideo) { - connection.detachStreams.push(_stream.streamid); - } - - // connection.removeStream({}); - if (!config.audio && !config.video && !config.screen) { - connection.detachStreams.push(_stream.streamid); - } - - if (connection.detachStreams.indexOf(_stream.streamid) != -1) { - log('removing stream', _stream.streamid); - onStreamEndedHandler(_stream, connection); - - if (config.stop) { - connection.stopMediaStream(_stream.stream); - } - } - } - - for (var stream in connection.streams) { - if (connection._skip.indexOf(stream) == -1) { - _stream = connection.streams[stream]; - - if (streamid == 'all') _detachStream(_stream, { - audio: true, - video: true, - screen: true - }); - - else if (isString(streamid)) { - // connection.removeStream('screen'); - var config = {}; - config[streamid] = true; - _detachStream(_stream, config); - } else _detachStream(_stream, streamid); - } - } - - if (!dontRenegotiate && connection.detachStreams.length) { - connection.renegotiate(); - } - - return; - } - - var stream = connection.streams[streamid]; - - // detach pre-attached streams - if (!stream) return warn('No such stream exists. Stream-id:', streamid); - - // www.RTCMultiConnection.org/docs/detachStreams/ - connection.detachStreams.push(stream.streamid); - - log('removing stream', stream.streamid); - onStreamEndedHandler(stream, connection); - - // todo: how to allow "stop" function? - // connection.stopMediaStream(stream.stream) - - if (!dontRenegotiate) { - connection.renegotiate(); - } - }; - - connection.switchStream = function(session) { - if (connection.numberOfConnectedUsers <= 0) { - // no connections - setTimeout(function() { - // try again - connection.switchStream(session); - }, 1000); - return; - } - - connection.removeStream('all', true); - connection.addStream(session); - }; - - // www.RTCMultiConnection.org/docs/sendCustomMessage/ - connection.sendCustomMessage = function(message) { - if (!rtcMultiSession || !rtcMultiSession.defaultSocket) { - return setTimeout(function() { - connection.sendCustomMessage(message); - }, 1000); - } - - rtcMultiSession.defaultSocket.send({ - customMessage: true, - message: message - }); - }; - - // set RTCMultiConnection defaults on constructor invocation - setDefaults(connection); - }; - - function RTCMultiSession(connection, callbackForSignalingReady) { - var socketObjects = {}; - var sockets = []; - var rtcMultiSession = this; - var participants = {}; - - if (!rtcMultiSession.fileBufferReader && connection.session.data && connection.enableFileSharing) { - initFileBufferReader(connection, function(fbr) { - rtcMultiSession.fileBufferReader = fbr; - }); - } - - var textReceiver = new TextReceiver(connection); - - function onDataChannelMessage(e) { - if (e.data.checkingPresence && connection.channels[e.userid]) { - connection.channels[e.userid].send({ - presenceDetected: true - }); - return; - } - - if (e.data.presenceDetected && connection.peers[e.userid]) { - connection.peers[e.userid].connected = true; - return; - } - - if (e.data.type === 'text') { - textReceiver.receive(e.data, e.userid, e.extra); - } else { - if (connection.autoTranslateText) { - e.original = e.data; - connection.Translator.TranslateText(e.data, function(translatedText) { - e.data = translatedText; - connection.onmessage(e); - }); - } else connection.onmessage(e); - } - } - - function onNewSession(session) { - if (connection.skipOnNewSession) return; - - if (!session.session) session.session = {}; - if (!session.extra) session.extra = {}; - - // todo: make sure this works as expected. - // i.e. "onNewSession" should be fired only for - // sessionid that is passed over "connect" method. - if (connection.sessionid && session.sessionid != connection.sessionid) return; - - if (connection.onNewSession) { - session.join = function(forceSession) { - if (!forceSession) return connection.join(session); - - for (var f in forceSession) { - session.session[f] = forceSession[f]; - } - - // keeping previous state - var isDontCaptureUserMedia = connection.dontCaptureUserMedia; - - connection.dontCaptureUserMedia = false; - connection.captureUserMedia(function() { - connection.dontCaptureUserMedia = true; - connection.join(session); - - // returning back previous state - connection.dontCaptureUserMedia = isDontCaptureUserMedia; - }, forceSession); - }; - if (!session.extra) session.extra = {}; - - return connection.onNewSession(session); - } - - connection.join(session); - } - - function updateSocketForLocalStreams(socket) { - for (var i = 0; i < connection.localStreamids.length; i++) { - var streamid = connection.localStreamids[i]; - if (connection.streams[streamid]) { - // using "sockets" array to keep references of all sockets using - // this media stream; so we can fire "onStreamEndedHandler" among all users. - connection.streams[streamid].sockets.push(socket); - } - } - } - - function newPrivateSocket(_config) { - var socketConfig = { - channel: _config.channel, - onmessage: socketResponse, - onopen: function(_socket) { - if (_socket) socket = _socket; - - if (isofferer && !peer) { - peerConfig.session = connection.session; - if (!peer) peer = new PeerConnection(); - peer.create('offer', peerConfig); - } - - _config.socketIndex = socket.index = sockets.length; - socketObjects[socketConfig.channel] = socket; - sockets[_config.socketIndex] = socket; - - updateSocketForLocalStreams(socket); - - if (!socket.__push) { - socket.__push = socket.send; - socket.send = function(message) { - message.userid = message.userid || connection.userid; - message.extra = message.extra || connection.extra || {}; - - socket.__push(message); - }; - } - } - }; - - socketConfig.callback = function(_socket) { - socket = _socket; - socketConfig.onopen(); - }; - - var socket = connection.openSignalingChannel(socketConfig); - if (socket) socketConfig.onopen(socket); - - var isofferer = _config.isofferer, - peer; - - var peerConfig = { - onopen: onChannelOpened, - onicecandidate: function(candidate) { - if (!connection.candidates) throw 'ICE candidates are mandatory.'; - if (!connection.iceProtocols) throw 'At least one must be true; UDP or TCP.'; - - var iceCandidates = connection.candidates; - - var stun = iceCandidates.stun; - var turn = iceCandidates.turn; - - if (!isNull(iceCandidates.reflexive)) stun = iceCandidates.reflexive; - if (!isNull(iceCandidates.relay)) turn = iceCandidates.relay; - - if (!iceCandidates.host && !!candidate.candidate.match(/a=candidate.*typ host/g)) return; - if (!turn && !!candidate.candidate.match(/a=candidate.*typ relay/g)) return; - if (!stun && !!candidate.candidate.match(/a=candidate.*typ srflx/g)) return; - - var protocol = connection.iceProtocols; - - if (!protocol.udp && !!candidate.candidate.match(/a=candidate.* udp/g)) return; - if (!protocol.tcp && !!candidate.candidate.match(/a=candidate.* tcp/g)) return; - - if (!window.selfNPObject) window.selfNPObject = candidate; - - socket && socket.send({ - candidate: JSON.stringify({ - candidate: candidate.candidate, - sdpMid: candidate.sdpMid, - sdpMLineIndex: candidate.sdpMLineIndex - }) - }); - }, - onmessage: function(data) { - if (!data) return; - - var abToStr = ab2str(data); - if (abToStr.indexOf('"userid":') != -1) { - abToStr = JSON.parse(abToStr); - onDataChannelMessage(abToStr); - } else if (data instanceof ArrayBuffer || data instanceof DataView) { - if (!connection.enableFileSharing) { - throw 'It seems that receiving data is either "Blob" or "File" but file sharing is disabled.'; - } - - if (!rtcMultiSession.fileBufferReader) { - var that = this; - initFileBufferReader(connection, function(fbr) { - rtcMultiSession.fileBufferReader = fbr; - that.onmessage(data); - }); - return; - } - - var fileBufferReader = rtcMultiSession.fileBufferReader; - - fileBufferReader.convertToObject(data, function(chunk) { - if (chunk.maxChunks || chunk.readyForNextChunk) { - // if target peer requested next chunk - if (chunk.readyForNextChunk) { - fileBufferReader.getNextChunk(chunk.uuid, function(nextChunk, isLastChunk, extra) { - rtcMultiSession.send(nextChunk); - }); - return; - } - - // if chunk is received - fileBufferReader.addChunk(chunk, function(promptNextChunk) { - // request next chunk - rtcMultiSession.send(promptNextChunk); - }); - return; - } - - connection.onmessage({ - data: chunk, - userid: _config.userid, - extra: _config.extra - }); - }); - return; - } - }, - onaddstream: function(stream, session) { - session = session || _config.renegotiate || connection.session; - - // if it is data-only connection; then return. - if (isData(session)) return; - - if (session.screen && (session.audio || session.video)) { - if (!_config.gotAudioOrVideo) { - // audio/video are fired earlier than screen - _config.gotAudioOrVideo = true; - session.screen = false; - } else { - // screen stream is always fired later - session.audio = false; - session.video = false; - } - } - - var preMuted = {}; - - if (_config.streaminfo) { - var streaminfo = _config.streaminfo.split('----'); - var strInfo = JSON.parse(streaminfo[streaminfo.length - 1]); - - if (!isIE) { - stream.streamid = strInfo.streamid; - stream.isScreen = !!strInfo.isScreen; - stream.isVideo = !!strInfo.isVideo; - stream.isAudio = !!strInfo.isAudio; - preMuted = strInfo.preMuted; - } - - streaminfo.pop(); - _config.streaminfo = streaminfo.join('----'); - } - - var mediaElement = createMediaElement(stream, merge({ - remote: true - }, session)); - - if (connection.setDefaultEventsForMediaElement) { - connection.setDefaultEventsForMediaElement(mediaElement, stream.streamid); - } - - if (!isPluginRTC && !stream.getVideoTracks().length) { - function eventListener() { - setTimeout(function() { - mediaElement.muted = false; - afterRemoteStreamStartedFlowing({ - mediaElement: mediaElement, - session: session, - stream: stream, - preMuted: preMuted - }); - }, 3000); - - mediaElement.removeEventListener('play', eventListener); - } - return mediaElement.addEventListener('play', eventListener, false); - } - - waitUntilRemoteStreamStartsFlowing({ - mediaElement: mediaElement, - session: session, - stream: stream, - preMuted: preMuted - }); - }, - - onremovestream: function(stream) { - if (stream && stream.streamid) { - stream = connection.streams[stream.streamid]; - if (stream) { - log('on:stream:ended via on:remove:stream', stream); - onStreamEndedHandler(stream, connection); - } - } else log('on:remove:stream', stream); - }, - - onclose: function(e) { - e.extra = _config.extra; - e.userid = _config.userid; - connection.onclose(e); - - // suggested in #71 by "efaj" - if (connection.channels[e.userid]) { - delete connection.channels[e.userid]; - } - }, - onerror: function(e) { - e.extra = _config.extra; - e.userid = _config.userid; - connection.onerror(e); - }, - - oniceconnectionstatechange: function(event) { - log('oniceconnectionstatechange', toStr(event)); - - if (peer.connection && peer.connection.iceConnectionState == 'connected' && peer.connection.iceGatheringState == 'complete' && peer.connection.signalingState == 'stable' && connection.numberOfConnectedUsers == 1) { - connection.onconnected({ - userid: _config.userid, - extra: _config.extra, - peer: connection.peers[_config.userid], - targetuser: _config.userinfo - }); - } - - if (!connection.isInitiator && peer.connection && peer.connection.iceConnectionState == 'connected' && peer.connection.iceGatheringState == 'complete' && peer.connection.signalingState == 'stable' && connection.numberOfConnectedUsers == 1) { - connection.onstatechange({ - userid: _config.userid, - extra: _config.extra, - name: 'connected-with-initiator', - reason: 'ICE connection state seems connected; gathering state is completed; and signaling state is stable.' - }); - } - - if (connection.peers[_config.userid] && connection.peers[_config.userid].oniceconnectionstatechange) { - connection.peers[_config.userid].oniceconnectionstatechange(event); - } - - // if ICE connectivity check is failed; renegotiate or redial - if (connection.peers[_config.userid] && connection.peers[_config.userid].peer.connection.iceConnectionState == 'failed') { - connection.onfailed({ - userid: _config.userid, - extra: _config.extra, - peer: connection.peers[_config.userid], - targetuser: _config.userinfo - }); - } - - if (connection.peers[_config.userid] && connection.peers[_config.userid].peer.connection.iceConnectionState == 'disconnected') { - !peer.connection.renegotiate && connection.ondisconnected({ - userid: _config.userid, - extra: _config.extra, - peer: connection.peers[_config.userid], - targetuser: _config.userinfo - }); - peer.connection.renegotiate = false; - } - - if (!connection.autoReDialOnFailure) return; - - if (connection.peers[_config.userid]) { - if (connection.peers[_config.userid].peer.connection.iceConnectionState != 'disconnected') { - _config.redialing = false; - } - - if (connection.peers[_config.userid].peer.connection.iceConnectionState == 'disconnected' && !_config.redialing) { - _config.redialing = true; - warn('Peer connection is closed.', toStr(connection.peers[_config.userid].peer.connection), 'ReDialing..'); - connection.peers[_config.userid].socket.send({ - redial: true - }); - - // to make sure all old "remote" streams are also removed! - connection.streams.remove({ - remote: true, - userid: _config.userid - }); - } - } - }, - - onsignalingstatechange: function(event) { - log('onsignalingstatechange', toStr(event)); - }, - - attachStreams: connection.dontAttachStream ? [] : connection.attachStreams, - iceServers: connection.iceServers, - rtcConfiguration: connection.rtcConfiguration, - bandwidth: connection.bandwidth, - sdpConstraints: connection.sdpConstraints, - optionalArgument: connection.optionalArgument, - disableDtlsSrtp: connection.disableDtlsSrtp, - dataChannelDict: connection.dataChannelDict, - preferSCTP: connection.preferSCTP, - - onSessionDescription: function(sessionDescription, streaminfo) { - sendsdp({ - sdp: sessionDescription, - socket: socket, - streaminfo: streaminfo - }); - }, - trickleIce: connection.trickleIce, - processSdp: connection.processSdp, - sendStreamId: function(stream) { - socket && socket.send({ - streamid: stream.streamid, - isScreen: !!stream.isScreen, - isAudio: !!stream.isAudio, - isVideo: !!stream.isVideo - }); - }, - rtcMultiConnection: connection - }; - - function waitUntilRemoteStreamStartsFlowing(args) { - // chrome for android may have some features missing - if (isMobileDevice || isPluginRTC || (isNull(connection.waitUntilRemoteStreamStartsFlowing) || !connection.waitUntilRemoteStreamStartsFlowing)) { - return afterRemoteStreamStartedFlowing(args); - } - - if (!args.numberOfTimes) args.numberOfTimes = 0; - args.numberOfTimes++; - - if (!(args.mediaElement.readyState <= HTMLMediaElement.HAVE_CURRENT_DATA || args.mediaElement.paused || args.mediaElement.currentTime <= 0)) { - return afterRemoteStreamStartedFlowing(args); - } - - if (args.numberOfTimes >= 60) { // wait 60 seconds while video is delivered! - return socket.send({ - failedToReceiveRemoteVideo: true, - streamid: args.stream.streamid - }); - } - - setTimeout(function() { - log('Waiting for incoming remote stream to be started flowing: ' + args.numberOfTimes + ' seconds.'); - waitUntilRemoteStreamStartsFlowing(args); - }, 900); - } - - function initFakeChannel() { - if (!connection.fakeDataChannels || connection.channels[_config.userid]) return; - - // for non-data connections; allow fake data sender! - if (!connection.session.data) { - var fakeChannel = { - send: function(data) { - socket.send({ - fakeData: data - }); - }, - readyState: 'open' - }; - // connection.channels['user-id'].send(data); - connection.channels[_config.userid] = { - channel: fakeChannel, - send: function(data) { - this.channel.send(data); - } - }; - peerConfig.onopen(fakeChannel); - } - } - - function afterRemoteStreamStartedFlowing(args) { - var mediaElement = args.mediaElement; - var session = args.session; - var stream = args.stream; - - stream.onended = function() { - if (streamedObject.mediaElement && !streamedObject.mediaElement.parentNode && document.getElementById(stream.streamid)) { - streamedObject.mediaElement = document.getElementById(stream.streamid); - } - - onStreamEndedHandler(streamedObject, connection); - }; - - var streamedObject = { - mediaElement: mediaElement, - - stream: stream, - streamid: stream.streamid, - session: session || connection.session, - - blobURL: isPluginRTC ? '' : mediaElement.mozSrcObject ? URL.createObjectURL(stream) : mediaElement.src, - type: 'remote', - - extra: _config.extra, - userid: _config.userid, - - isVideo: isPluginRTC ? !!session.video : !!stream.isVideo, - isAudio: isPluginRTC ? !!session.audio && !session.video : !!stream.isAudio, - isScreen: !!stream.isScreen, - isInitiator: !!_config.isInitiator, - - rtcMultiConnection: connection, - socket: socket - }; - - // connection.streams['stream-id'].mute({audio:true}) - connection.streams[stream.streamid] = connection._getStream(streamedObject); - connection.onstream(streamedObject); - - if (!isEmpty(args.preMuted) && (args.preMuted.audio || args.preMuted.video)) { - var fakeObject = merge({}, streamedObject); - fakeObject.session = merge(fakeObject.session, args.preMuted); - - fakeObject.isAudio = !!fakeObject.session.audio && !fakeObject.session.video; - fakeObject.isVideo = !!fakeObject.session.video; - fakeObject.isScreen = false; - - connection.onmute(fakeObject); - } - - log('on:add:stream', streamedObject); - - onSessionOpened(); - - if (connection.onspeaking) { - initHark({ - stream: stream, - streamedObject: streamedObject, - connection: connection - }); - } - } - - function onChannelOpened(channel) { - _config.channel = channel; - - // connection.channels['user-id'].send(data); - connection.channels[_config.userid] = { - channel: _config.channel, - send: function(data) { - connection.send(data, this.channel); - } - }; - - connection.onopen({ - extra: _config.extra, - userid: _config.userid, - channel: channel - }); - - // fetch files from file-queue - for (var q in connection.fileQueue) { - connection.send(connection.fileQueue[q], channel); - } - - if (isData(connection.session)) onSessionOpened(); - - if (connection.partOfScreen && connection.partOfScreen.sharing) { - connection.peers[_config.userid].sharePartOfScreen(connection.partOfScreen); - } - } - - function updateSocket() { - // todo: need to check following {if-block} MUST not affect "redial" process - if (socket.userid == _config.userid) - return; - - socket.userid = _config.userid; - sockets[_config.socketIndex] = socket; - - connection.numberOfConnectedUsers++; - // connection.peers['user-id'].addStream({audio:true}) - connection.peers[_config.userid] = { - socket: socket, - peer: peer, - userid: _config.userid, - extra: _config.extra, - userinfo: _config.userinfo, - addStream: function(session00) { - // connection.peers['user-id'].addStream({audio: true, video: true); - - connection.addStream(session00, this.socket); - }, - removeStream: function(streamid) { - if (!connection.streams[streamid]) - return warn('No such stream exists. Stream-id:', streamid); - - this.peer.connection.removeStream(connection.streams[streamid].stream); - this.renegotiate(); - }, - renegotiate: function(stream, session) { - // connection.peers['user-id'].renegotiate(); - - connection.renegotiate(stream, session); - }, - changeBandwidth: function(bandwidth) { - // connection.peers['user-id'].changeBandwidth(); - - if (!bandwidth) throw 'You MUST pass bandwidth object.'; - if (isString(bandwidth)) throw 'Pass object for bandwidth instead of string; e.g. {audio:10, video:20}'; - - // set bandwidth for self - this.peer.bandwidth = bandwidth; - - // ask remote user to synchronize bandwidth - this.socket.send({ - changeBandwidth: true, - bandwidth: bandwidth - }); - }, - sendCustomMessage: function(message) { - // connection.peers['user-id'].sendCustomMessage(); - - this.socket.send({ - customMessage: true, - message: message - }); - }, - onCustomMessage: function(message) { - log('Received "private" message from', this.userid, - isString(message) ? message : toStr(message)); - }, - drop: function(dontSendMessage) { - // connection.peers['user-id'].drop(); - - for (var stream in connection.streams) { - if (connection._skip.indexOf(stream) == -1) { - stream = connection.streams[stream]; - - if (stream.userid == connection.userid && stream.type == 'local') { - this.peer.connection.removeStream(stream.stream); - onStreamEndedHandler(stream, connection); - } - - if (stream.type == 'remote' && stream.userid == this.userid) { - onStreamEndedHandler(stream, connection); - } - } - } - - !dontSendMessage && this.socket.send({ - drop: true - }); - }, - hold: function(holdMLine) { - // connection.peers['user-id'].hold(); - - if (peer.prevCreateType == 'answer') { - this.socket.send({ - unhold: true, - holdMLine: holdMLine || 'both', - takeAction: true - }); - return; - } - - this.socket.send({ - hold: true, - holdMLine: holdMLine || 'both' - }); - - this.peer.hold = true; - this.fireHoldUnHoldEvents({ - kind: holdMLine, - isHold: true, - userid: connection.userid, - remoteUser: this.userid - }); - }, - unhold: function(holdMLine) { - // connection.peers['user-id'].unhold(); - - if (peer.prevCreateType == 'answer') { - this.socket.send({ - unhold: true, - holdMLine: holdMLine || 'both', - takeAction: true - }); - return; - } - - this.socket.send({ - unhold: true, - holdMLine: holdMLine || 'both' - }); - - this.peer.hold = false; - this.fireHoldUnHoldEvents({ - kind: holdMLine, - isHold: false, - userid: connection.userid, - remoteUser: this.userid - }); - }, - fireHoldUnHoldEvents: function(e) { - // this method is for inner usages only! - - var isHold = e.isHold; - var kind = e.kind; - var userid = e.remoteUser || e.userid; - - // hold means inactive a specific media line! - // a media line can contain multiple synced sources (ssrc) - // i.e. a media line can reference multiple tracks! - // that's why hold will affect all relevant tracks in a specific media line! - for (var stream in connection.streams) { - if (connection._skip.indexOf(stream) == -1) { - stream = connection.streams[stream]; - - if (stream.userid == userid) { - // www.RTCMultiConnection.org/docs/onhold/ - if (isHold) - connection.onhold(merge({ - kind: kind - }, stream)); - - // www.RTCMultiConnection.org/docs/onunhold/ - if (!isHold) - connection.onunhold(merge({ - kind: kind - }, stream)); - } - } - } - }, - redial: function() { - // connection.peers['user-id'].redial(); - - // 1st of all; remove all relevant remote media streams - for (var stream in connection.streams) { - if (connection._skip.indexOf(stream) == -1) { - stream = connection.streams[stream]; - - if (stream.userid == this.userid && stream.type == 'remote') { - onStreamEndedHandler(stream, connection); - } - } - } - - log('ReDialing...'); - - socket.send({ - recreatePeer: true - }); - - peer = new PeerConnection(); - peer.create('offer', peerConfig); - }, - sharePartOfScreen: function(args) { - // www.RTCMultiConnection.org/docs/onpartofscreen/ - var that = this; - var lastScreenshot = ''; - - function partOfScreenCapturer() { - // if stopped - if (that.stopPartOfScreenSharing) { - that.stopPartOfScreenSharing = false; - - if (connection.onpartofscreenstopped) { - connection.onpartofscreenstopped(); - } - return; - } - - // if paused - if (that.pausePartOfScreenSharing) { - if (connection.onpartofscreenpaused) { - connection.onpartofscreenpaused(); - } - - return setTimeout(partOfScreenCapturer, args.interval || 200); - } - - capturePartOfScreen({ - element: args.element, - connection: connection, - callback: function(screenshot) { - if (!connection.channels[that.userid]) { - throw 'No such data channel exists.'; - } - - // don't share repeated content - if (screenshot != lastScreenshot) { - lastScreenshot = screenshot; - connection.channels[that.userid].send({ - screenshot: screenshot, - isPartOfScreen: true - }); - } - - // "once" can be used to share single screenshot - !args.once && setTimeout(partOfScreenCapturer, args.interval || 200); - } - }); - } - - partOfScreenCapturer(); - }, - getConnectionStats: function(callback, interval) { - if (!callback) throw 'callback is mandatory.'; - - if (!window.getConnectionStats) { - loadScript(connection.resources.getConnectionStats, invoker); - } else invoker(); - - function invoker() { - RTCPeerConnection.prototype.getConnectionStats = window.getConnectionStats; - peer.connection && peer.connection.getConnectionStats(callback, interval); - } - }, - takeSnapshot: function(callback) { - takeSnapshot({ - userid: this.userid, - connection: connection, - callback: callback - }); - } - }; - } - - function onSessionOpened() { - // original conferencing infrastructure! - if (connection.isInitiator && getLength(participants) && getLength(participants) <= connection.maxParticipantsAllowed) { - if (!connection.session.oneway && !connection.session.broadcast) { - defaultSocket.send({ - sessionid: connection.sessionid, - newParticipant: _config.userid || socket.channel, - userData: { - userid: _config.userid || socket.channel, - extra: _config.extra - } - }); - } - } - - // 1st: renegotiation is supported only on chrome - // 2nd: must not renegotiate same media multiple times - // 3rd: todo: make sure that target-user has no such "renegotiated" media. - if (_config.userinfo.browser == 'chrome' && !_config.renegotiatedOnce) { - // this code snippet is added to make sure that "previously-renegotiated" streams are also - // renegotiated to this new user - for (var rSession in connection.renegotiatedSessions) { - _config.renegotiatedOnce = true; - - if (connection.renegotiatedSessions[rSession] && connection.renegotiatedSessions[rSession].stream) { - connection.peers[_config.userid].renegotiate(connection.renegotiatedSessions[rSession].stream, connection.renegotiatedSessions[rSession].session); - } - } - } - } - - function socketResponse(response) { - if (isRMSDeleted) return; - - if (response.userid == connection.userid) - return; - - if (response.sdp) { - _config.userid = response.userid; - _config.extra = response.extra || {}; - _config.renegotiate = response.renegotiate; - _config.streaminfo = response.streaminfo; - _config.isInitiator = response.isInitiator; - _config.userinfo = response.userinfo; - - var sdp = JSON.parse(response.sdp); - - if (sdp.type == 'offer') { - // to synchronize SCTP or RTP - peerConfig.preferSCTP = !!response.preferSCTP; - connection.fakeDataChannels = !!response.fakeDataChannels; - } - - // initializing fake channel - initFakeChannel(); - - sdpInvoker(sdp, response.labels); - } - - if (response.candidate) { - peer && peer.addIceCandidate(JSON.parse(response.candidate)); - } - - if (response.streamid) { - if (!rtcMultiSession.streamids) { - rtcMultiSession.streamids = {}; - } - if (!rtcMultiSession.streamids[response.streamid]) { - rtcMultiSession.streamids[response.streamid] = response.streamid; - connection.onstreamid(response); - } - } - - if (response.mute || response.unmute) { - if (response.promptMuteUnmute) { - if (!connection.privileges.canMuteRemoteStream) { - connection.onstatechange({ - userid: response.userid, - extra: response.extra, - name: 'mute-request-denied', - reason: response.userid + ' tried to mute your stream; however "privileges.canMuteRemoteStream" is "false".' - }); - return; - } - - if (connection.streams[response.streamid]) { - if (response.mute && !connection.streams[response.streamid].muted) { - connection.streams[response.streamid].mute(response.session); - } - if (response.unmute && connection.streams[response.streamid].muted) { - connection.streams[response.streamid].unmute(response.session); - } - } - } else { - var streamObject = {}; - if (connection.streams[response.streamid]) { - streamObject = connection.streams[response.streamid]; - } - - var session = response.session; - var fakeObject = merge({}, streamObject); - fakeObject.session = session; - - fakeObject.isAudio = !!fakeObject.session.audio && !fakeObject.session.video; - fakeObject.isVideo = !!fakeObject.session.video; - fakeObject.isScreen = !!fakeObject.session.screen; - - if (response.mute) connection.onmute(fakeObject || response); - if (response.unmute) connection.onunmute(fakeObject || response); - } - } - - if (response.isVolumeChanged) { - log('Volume of stream: ' + response.streamid + ' has changed to: ' + response.volume); - if (connection.streams[response.streamid]) { - var mediaElement = connection.streams[response.streamid].mediaElement; - if (mediaElement) mediaElement.volume = response.volume; - } - } - - // to stop local stream - if (response.stopped) { - if (connection.streams[response.streamid]) { - onStreamEndedHandler(connection.streams[response.streamid], connection); - } - } - - // to stop remote stream - if (response.promptStreamStop /* && !connection.isInitiator */ ) { - if (!connection.privileges.canStopRemoteStream) { - connection.onstatechange({ - userid: response.userid, - extra: response.extra, - name: 'stop-request-denied', - reason: response.userid + ' tried to stop your stream; however "privileges.canStopRemoteStream" is "false".' - }); - return; - } - warn('Remote stream has been manually stopped!'); - if (connection.streams[response.streamid]) { - connection.streams[response.streamid].stop(); - } - } - - if (response.left) { - // firefox is unable to stop remote streams - // firefox doesn't auto stop streams when peer.close() is called. - if (isFirefox) { - var userLeft = response.userid; - for (var stream in connection.streams) { - stream = connection.streams[stream]; - if (stream.userid == userLeft) { - connection.stopMediaStream(stream); - onStreamEndedHandler(stream, connection); - } - } - } - - if (peer && peer.connection) { - // todo: verify if-block's 2nd condition - if (peer.connection.signalingState != 'closed' && peer.connection.iceConnectionState.search(/disconnected|failed/gi) == -1) { - peer.connection.close(); - } - peer.connection = null; - } - - if (participants[response.userid]) delete participants[response.userid]; - - if (response.closeEntireSession) { - connection.onSessionClosed(response); - connection.leave(); - return; - } - - connection.remove(response.userid); - - onLeaveHandler({ - userid: response.userid, - extra: response.extra || {}, - entireSessionClosed: !!response.closeEntireSession - }, connection); - } - - // keeping session active even if initiator leaves - if (response.playRoleOfBroadcaster) { - if (response.extra) { - // clone extra-data from initial moderator - connection.extra = merge(connection.extra, response.extra); - } - if (response.participants) { - participants = response.participants; - - // make sure that if 2nd initiator leaves; control is shifted to 3rd person. - if (participants[connection.userid]) { - delete participants[connection.userid]; - } - - if (sockets[0] && sockets[0].userid == response.userid) { - delete sockets[0]; - sockets = swap(sockets); - } - - if (socketObjects[response.userid]) { - delete socketObjects[response.userid]; - } - } - - setTimeout(connection.playRoleOfInitiator, 2000); - } - - if (response.changeBandwidth) { - if (!connection.peers[response.userid]) throw 'No such peer exists.'; - - // synchronize bandwidth - connection.peers[response.userid].peer.bandwidth = response.bandwidth; - - // renegotiate to apply bandwidth - connection.peers[response.userid].renegotiate(); - } - - if (response.customMessage) { - if (!connection.peers[response.userid]) throw 'No such peer exists.'; - if (response.message.ejected) { - if (connection.sessionDescriptions[connection.sessionid].userid != response.userid) { - throw 'only initiator can eject a user.'; - } - // initiator ejected this user - connection.leave(); - - connection.onSessionClosed({ - userid: response.userid, - extra: response.extra || _config.extra, - isEjected: true - }); - } else connection.peers[response.userid].onCustomMessage(response.message); - } - - if (response.drop) { - if (!connection.peers[response.userid]) throw 'No such peer exists.'; - connection.peers[response.userid].drop(true); - connection.peers[response.userid].renegotiate(); - - connection.ondrop(response.userid); - } - - if (response.hold || response.unhold) { - if (!connection.peers[response.userid]) throw 'No such peer exists.'; - - if (response.takeAction) { - connection.peers[response.userid][!!response.hold ? 'hold' : 'unhold'](response.holdMLine); - return; - } - - connection.peers[response.userid].peer.hold = !!response.hold; - connection.peers[response.userid].peer.holdMLine = response.holdMLine; - - socket.send({ - isRenegotiate: true - }); - - connection.peers[response.userid].fireHoldUnHoldEvents({ - kind: response.holdMLine, - isHold: !!response.hold, - userid: response.userid - }); - } - - if (response.isRenegotiate) { - connection.peers[response.userid].renegotiate(null, connection.peers[response.userid].peer.session); - } - - // fake data channels! - if (response.fakeData) { - peerConfig.onmessage(response.fakeData); - } - - // sometimes we don't need to renegotiate e.g. when peers are disconnected - // or if it is firefox - if (response.recreatePeer) { - peer = new PeerConnection(); - } - - // remote video failed either out of ICE gathering process or ICE connectivity check-up - // or IceAgent was unable to locate valid candidates/ports. - if (response.failedToReceiveRemoteVideo) { - log('Remote peer hasn\'t received stream: ' + response.streamid + '. Renegotiating...'); - if (connection.peers[response.userid]) { - connection.peers[response.userid].renegotiate(); - } - } - - if (response.redial) { - if (connection.peers[response.userid]) { - if (connection.peers[response.userid].peer.connection.iceConnectionState != 'disconnected') { - _config.redialing = false; - } - - if (connection.peers[response.userid].peer.connection.iceConnectionState == 'disconnected' && !_config.redialing) { - _config.redialing = true; - - warn('Peer connection is closed.', toStr(connection.peers[response.userid].peer.connection), 'ReDialing..'); - connection.peers[response.userid].redial(); - } - } - } - } - - connection.playRoleOfInitiator = function() { - connection.dontCaptureUserMedia = true; - connection.open(); - sockets = swap(sockets); - connection.dontCaptureUserMedia = false; - }; - - connection.askToShareParticipants = function() { - defaultSocket && defaultSocket.send({ - askToShareParticipants: true - }); - }; - - connection.shareParticipants = function(args) { - var message = { - joinUsers: participants, - userid: connection.userid, - extra: connection.extra - }; - - if (args) { - if (args.dontShareWith) message.dontShareWith = args.dontShareWith; - if (args.shareWith) message.shareWith = args.shareWith; - } - - defaultSocket.send(message); - }; - - function sdpInvoker(sdp, labels) { - if (sdp.type == 'answer') { - peer.setRemoteDescription(sdp); - updateSocket(); - return; - } - if (!_config.renegotiate && sdp.type == 'offer') { - peerConfig.offerDescription = sdp; - - peerConfig.session = connection.session; - if (!peer) peer = new PeerConnection(); - peer.create('answer', peerConfig); - - updateSocket(); - return; - } - - var session = _config.renegotiate; - // detach streams - detachMediaStream(labels, peer.connection); - - if (session.oneway || isData(session)) { - createAnswer(); - delete _config.renegotiate; - } else { - if (_config.capturing) - return; - - _config.capturing = true; - - connection.captureUserMedia(function(stream) { - _config.capturing = false; - - peer.addStream(stream); - - connection.renegotiatedSessions[JSON.stringify(_config.renegotiate)] = { - session: _config.renegotiate, - stream: stream - }; - - delete _config.renegotiate; - - createAnswer(); - }, _config.renegotiate); - } - - function createAnswer() { - peer.recreateAnswer(sdp, session, function(_sdp, streaminfo) { - sendsdp({ - sdp: _sdp, - socket: socket, - streaminfo: streaminfo - }); - connection.detachStreams = []; - }); - } - } - } - - function detachMediaStream(labels, peer) { - if (!labels) return; - for (var i = 0; i < labels.length; i++) { - var label = labels[i]; - if (connection.streams[label]) { - peer.removeStream(connection.streams[label].stream); - } - } - } - - function sendsdp(e) { - e.socket.send({ - sdp: JSON.stringify({ - sdp: e.sdp.sdp, - type: e.sdp.type - }), - renegotiate: !!e.renegotiate ? e.renegotiate : false, - streaminfo: e.streaminfo || '', - labels: e.labels || [], - preferSCTP: !!connection.preferSCTP, - fakeDataChannels: !!connection.fakeDataChannels, - isInitiator: !!connection.isInitiator, - userinfo: { - browser: isFirefox ? 'firefox' : 'chrome' - } - }); - } - - // sharing new user with existing participants - - function onNewParticipant(response) { - var channel = response.newParticipant; - - if (!channel || !!participants[channel] || channel == connection.userid) - return; - - var new_channel = connection.token(); - newPrivateSocket({ - channel: new_channel, - extra: response.userData ? response.userData.extra : response.extra, - userid: response.userData ? response.userData.userid : response.userid - }); - - defaultSocket.send({ - participant: true, - targetUser: channel, - channel: new_channel - }); - } - - // if a user leaves - - function clearSession() { - connection.numberOfConnectedUsers--; - - var alertMessage = { - left: true, - extra: connection.extra || {}, - userid: connection.userid, - sessionid: connection.sessionid - }; - - if (connection.isInitiator) { - // if initiator wants to close entire session - if (connection.autoCloseEntireSession) { - alertMessage.closeEntireSession = true; - } else if (sockets[0]) { - // shift initiation control to another user - sockets[0].send({ - playRoleOfBroadcaster: true, - userid: connection.userid, - extra: connection.extra, - participants: participants - }); - } - } - - sockets.forEach(function(socket, i) { - socket.send(alertMessage); - - if (socketObjects[socket.channel]) { - delete socketObjects[socket.channel]; - } - - delete sockets[i]; - }); - - sockets = swap(sockets); - - connection.refresh(); - - webAudioMediaStreamSources.forEach(function(mediaStreamSource) { - // if source is connected; then chrome will crash on unload. - mediaStreamSource.disconnect(); - }); - - webAudioMediaStreamSources = []; - } - - // www.RTCMultiConnection.org/docs/remove/ - connection.remove = function(userid) { - if (rtcMultiSession.requestsFrom && rtcMultiSession.requestsFrom[userid]) delete rtcMultiSession.requestsFrom[userid]; - - if (connection.peers[userid]) { - if (connection.peers[userid].peer && connection.peers[userid].peer.connection) { - if (connection.peers[userid].peer.connection.signalingState != 'closed') { - connection.peers[userid].peer.connection.close(); - } - connection.peers[userid].peer.connection = null; - } - delete connection.peers[userid]; - } - if (participants[userid]) { - delete participants[userid]; - } - - for (var stream in connection.streams) { - stream = connection.streams[stream]; - if (stream.userid == userid) { - onStreamEndedHandler(stream, connection); - delete connection.streams[stream]; - } - } - - if (socketObjects[userid]) { - delete socketObjects[userid]; - } - }; - - // www.RTCMultiConnection.org/docs/refresh/ - connection.refresh = function() { - // if firebase; remove data from firebase servers - if (connection.isInitiator && !!connection.socket && !!connection.socket.remove) { - connection.socket.remove(); - } - - participants = {}; - - // to stop/remove self streams - for (var i = 0; i < connection.attachStreams.length; i++) { - connection.stopMediaStream(connection.attachStreams[i]); - } - - // to allow capturing of identical streams - currentUserMediaRequest = { - streams: [], - mutex: false, - queueRequests: [] - }; - - rtcMultiSession.isOwnerLeaving = true; - - connection.isInitiator = false; - connection.isAcceptNewSession = true; - connection.attachMediaStreams = []; - connection.sessionDescription = null; - connection.sessionDescriptions = {}; - connection.localStreamids = []; - connection.preRecordedMedias = {}; - connection.snapshots = {}; - - connection.numberOfConnectedUsers = 0; - connection.numberOfSessions = 0; - - connection.attachStreams = []; - connection.detachStreams = []; - connection.fileQueue = {}; - connection.channels = {}; - connection.renegotiatedSessions = {}; - - for (var peer in connection.peers) { - if (peer != connection.userid) { - delete connection.peers[peer]; - } - } - - // to make sure remote streams are also removed! - for (var stream in connection.streams) { - if (connection._skip.indexOf(stream) == -1) { - onStreamEndedHandler(connection.streams[stream], connection); - delete connection.streams[stream]; - } - } - - socketObjects = {}; - sockets = []; - participants = {}; - }; - - // www.RTCMultiConnection.org/docs/reject/ - connection.reject = function(userid) { - if (!isString(userid)) userid = userid.userid; - defaultSocket.send({ - rejectedRequestOf: userid - }); - - // remove relevant data to allow him join again - connection.remove(userid); - }; - - rtcMultiSession.leaveHandler = function(e) { - if (!connection.leaveOnPageUnload) return; - - if (isNull(e.keyCode)) { - return clearSession(); - } - - if (e.keyCode == 116) { - clearSession(); - } - }; - - listenEventHandler('beforeunload', rtcMultiSession.leaveHandler); - listenEventHandler('keyup', rtcMultiSession.leaveHandler); - - rtcMultiSession.onLineOffLineHandler = function() { - if (!navigator.onLine) { - rtcMultiSession.isOffLine = true; - } else if (rtcMultiSession.isOffLine) { - rtcMultiSession.isOffLine = !navigator.onLine; - - // defaultSocket = getDefaultSocketRef(); - - // pending tasks should be resumed? - // sockets should be reconnected? - // peers should be re-established? - } - }; - - listenEventHandler('load', rtcMultiSession.onLineOffLineHandler); - listenEventHandler('online', rtcMultiSession.onLineOffLineHandler); - listenEventHandler('offline', rtcMultiSession.onLineOffLineHandler); - - function onSignalingReady() { - if (rtcMultiSession.signalingReady) return; - rtcMultiSession.signalingReady = true; - - setTimeout(callbackForSignalingReady, 1000); - - if (!connection.isInitiator) { - // as soon as signaling gateway is connected; - // user should check existing rooms! - defaultSocket && defaultSocket.send({ - searchingForRooms: true - }); - } - } - - function joinParticipants(joinUsers) { - for (var user in joinUsers) { - if (!participants[joinUsers[user]]) { - onNewParticipant({ - sessionid: connection.sessionid, - newParticipant: joinUsers[user], - userid: connection.userid, - extra: connection.extra - }); - } - } - } - - function getDefaultSocketRef() { - return connection.openSignalingChannel({ - onmessage: function(response) { - // RMS == RTCMultiSession - if (isRMSDeleted) return; - - // if message is sent by same user - if (response.userid == connection.userid) return; - - if (response.sessionid && response.userid) { - if (!connection.sessionDescriptions[response.sessionid]) { - connection.numberOfSessions++; - connection.sessionDescriptions[response.sessionid] = response; - - // fire "onNewSession" only if: - // 1) "isAcceptNewSession" boolean is true - // 2) "sessionDescriptions" object isn't having same session i.e. to prevent duplicate invocations - if (connection.isAcceptNewSession) { - - if (!connection.dontOverrideSession) { - connection.session = response.session; - } - - onNewSession(response); - } - } - } - - if (response.newParticipant && !connection.isAcceptNewSession && rtcMultiSession.broadcasterid === response.userid) { - if (response.newParticipant != connection.userid) { - onNewParticipant(response); - } - } - - if (getLength(participants) < connection.maxParticipantsAllowed && response.targetUser == connection.userid && response.participant) { - if (connection.peers[response.userid] && !connection.peers[response.userid].peer) { - delete participants[response.userid]; - delete connection.peers[response.userid]; - connection.isAcceptNewSession = true; - return acceptRequest(response); - } - - if (!participants[response.userid]) { - acceptRequest(response); - } - } - - if (response.acceptedRequestOf == connection.userid) { - connection.onstatechange({ - userid: response.userid, - extra: response.extra, - name: 'request-accepted', - reason: response.userid + ' accepted your participation request.' - }); - } - - if (response.rejectedRequestOf == connection.userid) { - connection.onstatechange({ - userid: response.userid, - extra: response.extra, - name: 'request-rejected', - reason: response.userid + ' rejected your participation request.' - }); - } - - if (response.customMessage) { - if (response.message.drop) { - connection.ondrop(response.userid); - - connection.attachStreams = []; - // "drop" should detach all local streams - for (var stream in connection.streams) { - if (connection._skip.indexOf(stream) == -1) { - stream = connection.streams[stream]; - if (stream.type == 'local') { - connection.detachStreams.push(stream.streamid); - onStreamEndedHandler(stream, connection); - } else onStreamEndedHandler(stream, connection); - } - } - - if (response.message.renegotiate) { - // renegotiate; so "peer.removeStream" happens. - connection.renegotiate(); - } - } else if (connection.onCustomMessage) { - connection.onCustomMessage(response.message); - } - } - - if (connection.isInitiator && response.searchingForRooms) { - defaultSocket && defaultSocket.send({ - sessionDescription: connection.sessionDescription, - responseFor: response.userid - }); - } - - if (response.sessionDescription && response.responseFor == connection.userid) { - var sessionDescription = response.sessionDescription; - if (!connection.sessionDescriptions[sessionDescription.sessionid]) { - connection.numberOfSessions++; - connection.sessionDescriptions[sessionDescription.sessionid] = sessionDescription; - } - } - - if (connection.isInitiator && response.askToShareParticipants && defaultSocket) { - connection.shareParticipants({ - shareWith: response.userid - }); - } - - // participants are shared with single user - if (response.shareWith == connection.userid && response.dontShareWith != connection.userid && response.joinUsers) { - joinParticipants(response.joinUsers); - } - - // participants are shared with all users - if (!response.shareWith && response.joinUsers) { - if (response.dontShareWith) { - if (connection.userid != response.dontShareWith) { - joinParticipants(response.joinUsers); - } - } else joinParticipants(response.joinUsers); - } - - if (response.messageFor == connection.userid && response.presenceState) { - if (response.presenceState == 'checking') { - defaultSocket.send({ - messageFor: response.userid, - presenceState: 'available', - _config: response._config - }); - log('participant asked for availability'); - } - - if (response.presenceState == 'available') { - rtcMultiSession.presenceState = 'available'; - - connection.onstatechange({ - userid: 'browser', - extra: {}, - name: 'room-available', - reason: 'Initiator is available and room is active.' - }); - - joinSession(response._config); - } - } - - if (response.donotJoin && response.messageFor == connection.userid) { - log(response.userid, 'is not joining your room.'); - } - - // if initiator disconnects sockets, participants should also disconnect - if (response.isDisconnectSockets) { - log('Disconnecting your sockets because initiator also disconnected his sockets.'); - connection.disconnect(); - } - }, - callback: function(socket) { - socket && this.onopen(socket); - }, - onopen: function(socket) { - if (socket) defaultSocket = socket; - if (onSignalingReady) onSignalingReady(); - - rtcMultiSession.defaultSocket = defaultSocket; - - if (!defaultSocket.__push) { - defaultSocket.__push = defaultSocket.send; - defaultSocket.send = function(message) { - message.userid = message.userid || connection.userid; - message.extra = message.extra || connection.extra || {}; - - defaultSocket.__push(message); - }; - } - } - }); - } - - // default-socket is a common socket shared among all users in a specific channel; - // to share participation requests; room descriptions; and other stuff. - var defaultSocket = getDefaultSocketRef(); - - rtcMultiSession.defaultSocket = defaultSocket; - - if (defaultSocket && onSignalingReady) setTimeout(onSignalingReady, 2000); - - if (connection.session.screen) { - loadScreenFrame(); - } - // CUSTOM CODE // - - /* Commenting this - connection.getExternalIceServers && loadIceFrame(function(iceServers) - { - connection.iceServers = connection.iceServers.concat(iceServers); - }); - */ - - // CUSTOM CODE // - - if (connection.log == false) connection.skipLogs(); - if (connection.onlog) { - log = warn = error = function() { - var log = {}; - var index = 0; - Array.prototype.slice.call(arguments).forEach(function(argument) { - log[index++] = toStr(argument); - }); - toStr = function(str) { - return str; - }; - connection.onlog(log); - }; - } - - function setDirections() { - var userMaxParticipantsAllowed = 0; - - // if user has set a custom max participant setting, remember it - if (connection.maxParticipantsAllowed != 256) { - userMaxParticipantsAllowed = connection.maxParticipantsAllowed; - } - - if (connection.direction == 'one-way') connection.session.oneway = true; - if (connection.direction == 'one-to-one') connection.maxParticipantsAllowed = 1; - if (connection.direction == 'one-to-many') connection.session.broadcast = true; - if (connection.direction == 'many-to-many') { - if (!connection.maxParticipantsAllowed || connection.maxParticipantsAllowed == 1) { - connection.maxParticipantsAllowed = 256; - } - } - - // if user has set a custom max participant setting, set it back - if (userMaxParticipantsAllowed && connection.maxParticipantsAllowed != 1) { - connection.maxParticipantsAllowed = userMaxParticipantsAllowed; - } - } - - // open new session - this.initSession = function(args) { - rtcMultiSession.isOwnerLeaving = false; - - setDirections(); - participants = {}; - - rtcMultiSession.isOwnerLeaving = false; - - if (!isNull(args.transmitRoomOnce)) { - connection.transmitRoomOnce = args.transmitRoomOnce; - } - - function transmit() { - if (defaultSocket && getLength(participants) < connection.maxParticipantsAllowed && !rtcMultiSession.isOwnerLeaving) { - defaultSocket.send(connection.sessionDescription); - } - - if (!connection.transmitRoomOnce && !rtcMultiSession.isOwnerLeaving) - setTimeout(transmit, connection.interval || 3000); - } - - // todo: test and fix next line. - if (!args.dontTransmit /* || connection.transmitRoomOnce */ ) transmit(); - }; - - function joinSession(_config, skipOnStateChange) { - if (rtcMultiSession.donotJoin && rtcMultiSession.donotJoin == _config.sessionid) { - return; - } - - // dontOverrideSession allows you force RTCMultiConnection - // to not override default session for participants; - // by default, session is always overridden and set to the session coming from initiator! - if (!connection.dontOverrideSession) { - connection.session = _config.session || {}; - } - - // make sure that inappropriate users shouldn't receive onNewSession event - rtcMultiSession.broadcasterid = _config.userid; - - if (_config.sessionid) { - // used later to prevent external rooms messages to be used by this user! - connection.sessionid = _config.sessionid; - } - - connection.isAcceptNewSession = false; - - var channel = getRandomString(); - newPrivateSocket({ - channel: channel, - extra: _config.extra || {}, - userid: _config.userid - }); - - var offers = {}; - if (connection.attachStreams.length) { - var stream = connection.attachStreams[connection.attachStreams.length - 1]; - if (!!stream.getAudioTracks && stream.getAudioTracks().length) { - offers.audio = true; - } - if (stream.getVideoTracks().length) { - offers.video = true; - } - } - - if (!isEmpty(offers)) { - log(toStr(offers)); - } else log('Seems data-only connection.'); - - connection.onstatechange({ - userid: _config.userid, - extra: {}, - name: 'connecting-with-initiator', - reason: 'Checking presence of the initiator; and the room.' - }); - - defaultSocket.send({ - participant: true, - channel: channel, - targetUser: _config.userid, - session: connection.session, - offers: { - audio: !!offers.audio, - video: !!offers.video - } - }); - - connection.skipOnNewSession = false; - invokeMediaCaptured(connection); - } - - // join existing session - this.joinSession = function(_config) { - if (!defaultSocket) - return setTimeout(function() { - warn('Default-Socket is not yet initialized.'); - rtcMultiSession.joinSession(_config); - }, 1000); - - _config = _config || {}; - participants = {}; - - rtcMultiSession.presenceState = 'checking'; - - connection.onstatechange({ - userid: _config.userid, - extra: _config.extra || {}, - name: 'detecting-room-presence', - reason: 'Checking presence of the room.' - }); - - function contactInitiator() { - defaultSocket.send({ - messageFor: _config.userid, - presenceState: rtcMultiSession.presenceState, - _config: { - userid: _config.userid, - extra: _config.extra || {}, - sessionid: _config.sessionid, - session: _config.session || false - } - }); - } - contactInitiator(); - - function checker() { - if (rtcMultiSession.presenceState == 'checking') { - warn('Unable to reach initiator. Trying again...'); - contactInitiator(); - setTimeout(function() { - if (rtcMultiSession.presenceState == 'checking') { - connection.onstatechange({ - userid: _config.userid, - extra: _config.extra || {}, - name: 'room-not-available', - reason: 'Initiator seems absent. Waiting for someone to open the room.' - }); - - connection.isAcceptNewSession = true; - setTimeout(checker, 2000); - } - }, 2000); - } - } - - setTimeout(checker, 3000); - }; - - connection.donotJoin = function(sessionid) { - rtcMultiSession.donotJoin = sessionid; - - var session = connection.sessionDescriptions[sessionid]; - if (!session) return; - - defaultSocket.send({ - donotJoin: true, - messageFor: session.userid, - sessionid: sessionid - }); - - participants = {}; - connection.isAcceptNewSession = true; - connection.sessionid = null; - }; - - // send file/data or text message - this.send = function(message, _channel) { - if (!(message instanceof ArrayBuffer || message instanceof DataView)) { - message = str2ab({ - extra: connection.extra, - userid: connection.userid, - data: message - }); - } - - if (_channel) { - if (_channel.readyState == 'open') { - _channel.send(message); - } - return; - } - - for (var dataChannel in connection.channels) { - var channel = connection.channels[dataChannel].channel; - if (channel.readyState == 'open') { - channel.send(message); - } - } - }; - - // leave session - this.leave = function() { - clearSession(); - }; - - // renegotiate new stream - this.addStream = function(e) { - var session = e.renegotiate; - - if (!connection.renegotiatedSessions[JSON.stringify(e.renegotiate)]) { - connection.renegotiatedSessions[JSON.stringify(e.renegotiate)] = { - session: e.renegotiate, - stream: e.stream - }; - } - - if (e.socket) { - if (e.socket.userid != connection.userid) { - addStream(connection.peers[e.socket.userid]); - } - } else { - for (var peer in connection.peers) { - if (peer != connection.userid) { - addStream(connection.peers[peer]); - } - } - } - - function addStream(_peer) { - var socket = _peer.socket; - - if (!socket) { - warn(_peer, 'doesn\'t has socket.'); - return; - } - - updateSocketForLocalStreams(socket); - - if (!_peer || !_peer.peer) { - throw 'No peer to renegotiate.'; - } - - var peer = _peer.peer; - - if (e.stream) { - if (!peer.attachStreams) { - peer.attachStreams = []; - } - - peer.attachStreams.push(e.stream); - } - - // detaching old streams - detachMediaStream(connection.detachStreams, peer.connection); - - if (e.stream && (session.audio || session.video || session.screen)) { - peer.addStream(e.stream); - } - - peer.recreateOffer(session, function(sdp, streaminfo) { - sendsdp({ - sdp: sdp, - socket: socket, - renegotiate: session, - labels: connection.detachStreams, - streaminfo: streaminfo - }); - connection.detachStreams = []; - }); - } - }; - - // www.RTCMultiConnection.org/docs/request/ - connection.request = function(userid, extra) { - connection.captureUserMedia(function() { - // open private socket that will be used to receive offer-sdp - newPrivateSocket({ - channel: connection.userid, - extra: extra || {}, - userid: userid - }); - - // ask other user to create offer-sdp - defaultSocket.send({ - participant: true, - targetUser: userid - }); - }); - }; - - function acceptRequest(response) { - if (!rtcMultiSession.requestsFrom) rtcMultiSession.requestsFrom = {}; - if (rtcMultiSession.requestsFrom[response.userid]) return; - - var obj = { - userid: response.userid, - extra: response.extra, - channel: response.channel || response.userid, - session: response.session || connection.session - }; - - // check how participant is willing to join - if (response.offers) { - if (response.offers.audio && response.offers.video) { - log('target user has both audio/video streams.'); - } else if (response.offers.audio && !response.offers.video) { - log('target user has only audio stream.'); - } else if (!response.offers.audio && response.offers.video) { - log('target user has only video stream.'); - } else { - log('target user has no stream; it seems one-way streaming or data-only connection.'); - } - - var mandatory = connection.sdpConstraints.mandatory; - if (isNull(mandatory.OfferToReceiveAudio)) { - connection.sdpConstraints.mandatory.OfferToReceiveAudio = !!response.offers.audio; - } - if (isNull(mandatory.OfferToReceiveVideo)) { - connection.sdpConstraints.mandatory.OfferToReceiveVideo = !!response.offers.video; - } - - log('target user\'s SDP has?', toStr(connection.sdpConstraints.mandatory)); - } - - rtcMultiSession.requestsFrom[response.userid] = obj; - - // www.RTCMultiConnection.org/docs/onRequest/ - if (connection.onRequest && connection.isInitiator) { - connection.onRequest(obj); - } else _accept(obj); - } - - function _accept(e) { - if (rtcMultiSession.captureUserMediaOnDemand) { - rtcMultiSession.captureUserMediaOnDemand = false; - connection.captureUserMedia(function() { - _accept(e); - - invokeMediaCaptured(connection); - }); - return; - } - - log('accepting request from', e.userid); - participants[e.userid] = e.userid; - newPrivateSocket({ - isofferer: true, - userid: e.userid, - channel: e.channel, - extra: e.extra || {}, - session: e.session || connection.session - }); - } - - // www.RTCMultiConnection.org/docs/accept/ - connection.accept = function(e) { - // for backward compatibility - if (arguments.length > 1 && isString(arguments[0])) { - e = {}; - if (arguments[0]) e.userid = arguments[0]; - if (arguments[1]) e.extra = arguments[1]; - if (arguments[2]) e.channel = arguments[2]; - } - - connection.captureUserMedia(function() { - _accept(e); - }); - }; - - var isRMSDeleted = false; - this.disconnect = function() { - this.isOwnerLeaving = true; - - if (!connection.keepStreamsOpened) { - for (var streamid in connection.localStreams) { - connection.localStreams[streamid].stop(); - } - connection.localStreams = {}; - - currentUserMediaRequest = { - streams: [], - mutex: false, - queueRequests: [] - }; - } - - if (connection.isInitiator) { - defaultSocket.send({ - isDisconnectSockets: true - }); - } - - connection.refresh(); - - rtcMultiSession.defaultSocket = defaultSocket = null; - isRMSDeleted = true; - - connection.ondisconnected({ - userid: connection.userid, - extra: connection.extra, - peer: connection.peers[connection.userid], - isSocketsDisconnected: true - }); - - // if there is any peer still opened; close it. - connection.close(); - - window.removeEventListener('beforeunload', rtcMultiSession.leaveHandler); - window.removeEventListener('keyup', rtcMultiSession.leaveHandler); - - // it will not work, though :) - delete this; - - log('Disconnected your sockets, peers, streams and everything except RTCMultiConnection object.'); - }; - } - - var webAudioMediaStreamSources = []; - - function convertToAudioStream(mediaStream) { - if (!mediaStream) throw 'MediaStream is mandatory.'; - - if (mediaStream.getVideoTracks && !mediaStream.getVideoTracks().length) { - return mediaStream; - } - - var context = new AudioContext(); - var mediaStreamSource = context.createMediaStreamSource(mediaStream); - - var destination = context.createMediaStreamDestination(); - mediaStreamSource.connect(destination); - - webAudioMediaStreamSources.push(mediaStreamSource); - - return destination.stream; - } - - var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; - var isFirefox = typeof window.InstallTrigger !== 'undefined'; - var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; - var isChrome = !!window.chrome && !isOpera; - var isIE = !!document.documentMode; - - var isPluginRTC = isSafari || isIE; - - var isMobileDevice = !!navigator.userAgent.match(/Android|iPhone|iPad|iPod|BlackBerry|IEMobile/i); - - // detect node-webkit - var isNodeWebkit = !!(window.process && (typeof window.process == 'object') && window.process.versions && window.process.versions['node-webkit']); - - window.MediaStream = window.MediaStream || window.webkitMediaStream; - window.AudioContext = window.AudioContext || window.webkitAudioContext; - - function getRandomString() { - // suggested by @rvulpescu from #154 - if (window.crypto && crypto.getRandomValues && navigator.userAgent.indexOf('Safari') == -1) { - var a = window.crypto.getRandomValues(new Uint32Array(3)), - token = ''; - for (var i = 0, l = a.length; i < l; i++) { - token += a[i].toString(36); - } - return token; - } else { - return (Math.random() * new Date().getTime()).toString(36).replace(/\./g, ''); - } - } - - var chromeVersion = 50; - var matchArray = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); - if (isChrome && matchArray && matchArray[2]) { - chromeVersion = parseInt(matchArray[2], 10); - } - - var firefoxVersion = 50; - matchArray = navigator.userAgent.match(/Firefox\/(.*)/); - if (isFirefox && matchArray && matchArray[1]) { - firefoxVersion = parseInt(matchArray[1], 10); - } - - function isData(session) { - return !session.audio && !session.video && !session.screen && session.data; - } - - function isNull(obj) { - return typeof obj == 'undefined'; - } - - function isString(obj) { - return typeof obj == 'string'; - } - - function isEmpty(session) { - var length = 0; - for (var s in session) { - length++; - } - return length == 0; - } - - // this method converts array-buffer into string - function ab2str(buf) { - var result = ''; - try { - result = String.fromCharCode.apply(null, new Uint16Array(buf)); - } catch (e) {} - return result; - } - - // this method converts string into array-buffer - function str2ab(str) { - if (!isString(str)) str = JSON.stringify(str); - - var buf = new ArrayBuffer(str.length * 2); // 2 bytes for each char - var bufView = new Uint16Array(buf); - for (var i = 0, strLen = str.length; i < strLen; i++) { - bufView[i] = str.charCodeAt(i); - } - return buf; - } - - function swap(arr) { - var swapped = [], - length = arr.length; - for (var i = 0; i < length; i++) - if (arr[i] && arr[i] !== true) - swapped.push(arr[i]); - return swapped; - } - - function forEach(obj, callback) { - for (var item in obj) { - callback(obj[item], item); - } - } - - var console = window.console || { - log: function() {}, - error: function() {}, - warn: function() {} - }; - - function log() { - console.log(arguments); - } - - function error() { - console.error(arguments); - } - - function warn() { - console.warn(arguments); - } - - if (isChrome || isFirefox || isSafari) { - var log = console.log.bind(console); - var error = console.error.bind(console); - var warn = console.warn.bind(console); - } - - function toStr(obj) { - return JSON.stringify(obj, function(key, value) { - if (value && value.sdp) { - log(value.sdp.type, '\t', value.sdp.sdp); - return ''; - } else return value; - }, '\t'); - } - - function getLength(obj) { - var length = 0; - for (var o in obj) - if (o) length++; - return length; - } - - // Get HTMLAudioElement/HTMLVideoElement accordingly - - function createMediaElement(stream, session) { - var mediaElement = document.createElement(stream.isAudio ? 'audio' : 'video'); - mediaElement.id = stream.streamid; - - if (isPluginRTC) { - var body = (document.body || document.documentElement); - body.insertBefore(mediaElement, body.firstChild); - - setTimeout(function() { - Plugin.attachMediaStream(mediaElement, stream) - }, 1000); - - return Plugin.attachMediaStream(mediaElement, stream); - } - - // "mozSrcObject" is always preferred over "src"!! - mediaElement[isFirefox ? 'mozSrcObject' : 'src'] = isFirefox ? stream : (window.URL || window.webkitURL).createObjectURL(stream); - - mediaElement.controls = true; - mediaElement.autoplay = !!session.remote; - mediaElement.muted = session.remote ? false : true; - - // http://goo.gl/WZ5nFl - // Firefox don't yet support onended for any stream (remote/local) - isFirefox && mediaElement.addEventListener('ended', function() { - stream.onended(); - }, false); - - mediaElement.play(); - - return mediaElement; - } - - var onStreamEndedHandlerFiredFor = {}; - - function onStreamEndedHandler(streamedObject, connection) { - if (streamedObject.mediaElement && !streamedObject.mediaElement.parentNode) return; - - if (onStreamEndedHandlerFiredFor[streamedObject.streamid]) return; - onStreamEndedHandlerFiredFor[streamedObject.streamid] = streamedObject; - connection.onstreamended(streamedObject); - } - - var onLeaveHandlerFiredFor = {}; - - function onLeaveHandler(event, connection) { - if (onLeaveHandlerFiredFor[event.userid]) return; - onLeaveHandlerFiredFor[event.userid] = event; - connection.onleave(event); - } - - function takeSnapshot(args) { - var userid = args.userid; - var connection = args.connection; - - function _takeSnapshot(video) { - var canvas = document.createElement('canvas'); - canvas.width = video.videoWidth || video.clientWidth; - canvas.height = video.videoHeight || video.clientHeight; - - var context = canvas.getContext('2d'); - context.drawImage(video, 0, 0, canvas.width, canvas.height); - - connection.snapshots[userid] = canvas.toDataURL('image/png'); - args.callback && args.callback(connection.snapshots[userid]); - } - - if (args.mediaElement) return _takeSnapshot(args.mediaElement); - - for (var stream in connection.streams) { - stream = connection.streams[stream]; - if (stream.userid == userid && stream.stream && stream.stream.getVideoTracks && stream.stream.getVideoTracks().length) { - _takeSnapshot(stream.mediaElement); - continue; - } - } - } - - function invokeMediaCaptured(connection) { - // to let user know that media resource has been captured - // now, he can share "sessionDescription" using sockets - if (connection.onMediaCaptured) { - connection.onMediaCaptured(); - delete connection.onMediaCaptured; - } - } - - function merge(mergein, mergeto) { - if (!mergein) mergein = {}; - if (!mergeto) return mergein; - - for (var item in mergeto) { - mergein[item] = mergeto[item]; - } - return mergein; - } - - function loadScript(src, onload) { - var script = document.createElement('script'); - script.src = src; - script.onload = function() { - log('loaded resource:', src); - if (onload) onload(); - }; - document.documentElement.appendChild(script); - } - - function capturePartOfScreen(args) { - var connection = args.connection; - var element = args.element; - - if (!window.html2canvas) { - return loadScript(connection.resources.html2canvas, function() { - capturePartOfScreen(args); - }); - } - - if (isString(element)) { - element = document.querySelector(element); - if (!element) element = document.getElementById(element); - } - if (!element) throw 'HTML DOM Element is not accessible!'; - - // todo: store DOM element somewhere to minimize DOM querying issues - - // html2canvas.js is used to take screenshots - html2canvas(element, { - onrendered: function(canvas) { - args.callback(canvas.toDataURL()); - } - }); - } - - function initFileBufferReader(connection, callback) { - if (!window.FileBufferReader) { - loadScript(connection.resources.FileBufferReader, function() { - initFileBufferReader(connection, callback); - }); - return; - } - - function _private(chunk) { - chunk.userid = chunk.extra.userid; - return chunk; - } - - var fileBufferReader = new FileBufferReader(); - fileBufferReader.onProgress = function(chunk) { - connection.onFileProgress(_private(chunk), chunk.uuid); - }; - - fileBufferReader.onBegin = function(file) { - connection.onFileStart(_private(file)); - }; - - fileBufferReader.onEnd = function(file) { - connection.onFileEnd(_private(file)); - }; - - callback(fileBufferReader); - } - - var screenFrame, loadedScreenFrame; - - function loadScreenFrame(skip) { - if (DetectRTC.screen.extensionid != ReservedExtensionID) { - return; - } - - if (loadedScreenFrame) return; - if (!skip) return loadScreenFrame(true); - - loadedScreenFrame = true; - - var iframe = document.createElement('iframe'); - iframe.onload = function() { - iframe.isLoaded = true; - log('Screen Capturing frame is loaded.'); - }; - //iframe.src = 'https://www.webrtc-experiment.com/getSourceId/'; - // CUSTOM CODE // - iframe.src = 'app/fusion/scripts/webrtc/getSourceId.html'; - // CUSTOM CODE // - iframe.style.display = 'none'; - (document.body || document.documentElement).appendChild(iframe); - - screenFrame = { - postMessage: function() { - if (!iframe.isLoaded) { - setTimeout(screenFrame.postMessage, 100); - return; - } - iframe.contentWindow.postMessage({ - captureSourceId: true - }, '*'); - } - }; - } - - var iceFrame, loadedIceFrame; - - function loadIceFrame(callback, skip) { - if (loadedIceFrame) return; - if (!skip) return loadIceFrame(callback, true); - - loadedIceFrame = true; - - var iframe = document.createElement('iframe'); - iframe.onload = function() { - iframe.isLoaded = true; - - listenEventHandler('message', iFrameLoaderCallback); - - function iFrameLoaderCallback(event) { - if (!event.data || !event.data.iceServers) return; - callback(event.data.iceServers); - - // this event listener is no more needed - window.removeEventListener('message', iFrameLoaderCallback); - } - - iframe.contentWindow.postMessage('get-ice-servers', '*'); - }; - iframe.src = 'https://cdn.webrtc-experiment.com/getIceServers/'; - iframe.style.display = 'none'; - (document.body || document.documentElement).appendChild(iframe); - } - - function muteOrUnmute(e) { - var stream = e.stream, - root = e.root, - session = e.session || {}, - enabled = e.enabled; - - if (!session.audio && !session.video) { - if (!isString(session)) { - session = merge(session, { - audio: true, - video: true - }); - } else { - session = { - audio: true, - video: true - }; - } - } - - // implementation from #68 - if (session.type) { - if (session.type == 'remote' && root.type != 'remote') return; - if (session.type == 'local' && root.type != 'local') return; - } - - log(enabled ? 'Muting' : 'UnMuting', 'session', toStr(session)); - - // enable/disable audio/video tracks - - if (root.type == 'local' && session.audio && !!stream.getAudioTracks) { - var audioTracks = stream.getAudioTracks()[0]; - if (audioTracks) - audioTracks.enabled = !enabled; - } - - if (root.type == 'local' && (session.video || session.screen) && !!stream.getVideoTracks) { - var videoTracks = stream.getVideoTracks()[0]; - if (videoTracks) - videoTracks.enabled = !enabled; - } - - root.sockets.forEach(function(socket) { - if (root.type == 'local') { - socket.send({ - streamid: root.streamid, - mute: !!enabled, - unmute: !enabled, - session: session - }); - } - - if (root.type == 'remote') { - socket.send({ - promptMuteUnmute: true, - streamid: root.streamid, - mute: !!enabled, - unmute: !enabled, - session: session - }); - } - }); - - if (root.type == 'remote') return; - - // According to issue #135, onmute/onumute must be fired for self - // "fakeObject" is used because we need to keep session for renegotiated streams; - // and MUST pass exact session over onStreamEndedHandler/onmute/onhold/etc. events. - var fakeObject = merge({}, root); - fakeObject.session = session; - - fakeObject.isAudio = !!fakeObject.session.audio && !fakeObject.session.video; - fakeObject.isVideo = !!fakeObject.session.video; - fakeObject.isScreen = !!fakeObject.session.screen; - - if (!!enabled) { - // if muted stream is negotiated - stream.preMuted = { - audio: stream.getAudioTracks().length && !stream.getAudioTracks()[0].enabled, - video: stream.getVideoTracks().length && !stream.getVideoTracks()[0].enabled - }; - root.rtcMultiConnection.onmute(fakeObject); - } - - if (!enabled) { - stream.preMuted = {}; - root.rtcMultiConnection.onunmute(fakeObject); - } - } - - var Firefox_Screen_Capturing_Warning = 'Make sure that you are using Firefox Nightly and you enabled: media.getusermedia.screensharing.enabled flag from about:config page. You also need to add your domain in "media.getusermedia.screensharing.allowed_domains" flag. If you are using WinXP then also enable "media.getusermedia.screensharing.allow_on_old_platforms" flag. NEVER forget to use "only" HTTPs for screen capturing!'; - var SCREEN_COMMON_FAILURE = 'HTTPs i.e. SSL-based URI is mandatory to use screen capturing.'; - // CUSTOM CODE // - var ReservedExtensionID = 'icgmlogfeajbfdffajhoebcfbibfhaen'; - //var ReservedExtensionID = 'ajhifddimkapgcifgcodmmfdlknahffk'; - - // if application-developer deployed his own extension on Google App Store - var useCustomChromeExtensionForScreenCapturing = document.domain.indexOf('webrtc-experiment.com') != -1; - - function initHark(args) { - if (!window.hark) { - loadScript(args.connection.resources.hark, function() { - initHark(args); - }); - return; - } - - var connection = args.connection; - var streamedObject = args.streamedObject; - var stream = args.stream; - - var options = {}; - var speechEvents = hark(stream, options); - - speechEvents.on('speaking', function() { - if (connection.onspeaking) { - connection.onspeaking(streamedObject); - } - }); - - speechEvents.on('stopped_speaking', function() { - if (connection.onsilence) { - connection.onsilence(streamedObject); - } - }); - - speechEvents.on('volume_change', function(volume, threshold) { - if (connection.onvolumechange) { - connection.onvolumechange(merge({ - volume: volume, - threshold: threshold - }, streamedObject)); - } - }); - } - - attachEventListener = function(video, type, listener, useCapture) { - video.addEventListener(type, listener, useCapture); - }; - - var Plugin = window.PluginRTC || {}; - window.onPluginRTCInitialized = function(pluginRTCObject) { - Plugin = pluginRTCObject; - MediaStreamTrack = Plugin.MediaStreamTrack; - RTCPeerConnection = Plugin.RTCPeerConnection; - RTCIceCandidate = Plugin.RTCIceCandidate; - RTCSessionDescription = Plugin.RTCSessionDescription; - - log(isPluginRTC ? 'Java-Applet' : 'ActiveX', 'plugin has been loaded.'); - }; - if (!isEmpty(Plugin)) window.onPluginRTCInitialized(Plugin); - - // if IE or Safari - if (isPluginRTC) { - loadScript('https://cdn.webrtc-experiment.com/Plugin.EveryWhere.js'); - // loadScript('https://cdn.webrtc-experiment.com/Plugin.Temasys.js'); - } - - var MediaStream = window.MediaStream; - - if (typeof MediaStream === 'undefined' && typeof webkitMediaStream !== 'undefined') { - MediaStream = webkitMediaStream; - } - - /*global MediaStream:true */ - if (typeof MediaStream !== 'undefined' && !('stop' in MediaStream.prototype)) { - MediaStream.prototype.stop = function() { - this.getAudioTracks().forEach(function(track) { - track.stop(); - }); - - this.getVideoTracks().forEach(function(track) { - track.stop(); - }); - }; - } - - var defaultConstraints = { - mandatory: {}, - optional: [] - }; - - /* by @FreCap pull request #41 */ - var currentUserMediaRequest = { - streams: [], - mutex: false, - queueRequests: [] - }; - - function getUserMedia(options) { - if (isPluginRTC) { - if (!Plugin.getUserMedia) { - setTimeout(function() { - getUserMedia(options); - }, 1000); - return; - } - - return Plugin.getUserMedia(options.constraints || { - audio: true, - video: true - }, options.onsuccess, options.onerror); - } - - if (currentUserMediaRequest.mutex === true) { - currentUserMediaRequest.queueRequests.push(options); - return; - } - currentUserMediaRequest.mutex = true; - - var connection = options.connection; - - // tools.ietf.org/html/draft-alvestrand-constraints-resolution-00 - var mediaConstraints = options.mediaConstraints || {}; - var videoConstraints = typeof mediaConstraints.video == 'boolean' ? mediaConstraints.video : mediaConstraints.video || mediaConstraints; - var audioConstraints = typeof mediaConstraints.audio == 'boolean' ? mediaConstraints.audio : mediaConstraints.audio || defaultConstraints; - - var n = navigator; - var hints = options.constraints || { - audio: defaultConstraints, - video: defaultConstraints - }; - - if (hints.video && hints.video.mozMediaSource) { - // "mozMediaSource" is redundant - // need to check "mediaSource" instead. - videoConstraints = {}; - } - - if (hints.video == true) hints.video = defaultConstraints; - if (hints.audio == true) hints.audio = defaultConstraints; - - // connection.mediaConstraints.audio = false; - if (typeof audioConstraints == 'boolean' && hints.audio) { - hints.audio = audioConstraints; - } - - // connection.mediaConstraints.video = false; - if (typeof videoConstraints == 'boolean' && hints.video) { - hints.video = videoConstraints; - } - - // connection.mediaConstraints.audio.mandatory = {prop:true}; - var audioMandatoryConstraints = audioConstraints.mandatory; - if (!isEmpty(audioMandatoryConstraints)) { - hints.audio.mandatory = merge(hints.audio.mandatory, audioMandatoryConstraints); - } - - // connection.media.min(320,180); - // connection.media.max(1920,1080); - var videoMandatoryConstraints = videoConstraints.mandatory; - if (videoMandatoryConstraints) { - var mandatory = {}; - - if (videoMandatoryConstraints.minWidth) { - mandatory.minWidth = videoMandatoryConstraints.minWidth; - } - - if (videoMandatoryConstraints.minHeight) { - mandatory.minHeight = videoMandatoryConstraints.minHeight; - } - - if (videoMandatoryConstraints.maxWidth) { - mandatory.maxWidth = videoMandatoryConstraints.maxWidth; - } - - if (videoMandatoryConstraints.maxHeight) { - mandatory.maxHeight = videoMandatoryConstraints.maxHeight; - } - - if (videoMandatoryConstraints.minAspectRatio) { - mandatory.minAspectRatio = videoMandatoryConstraints.minAspectRatio; - } - - if (videoMandatoryConstraints.maxFrameRate) { - mandatory.maxFrameRate = videoMandatoryConstraints.maxFrameRate; - } - - if (videoMandatoryConstraints.minFrameRate) { - mandatory.minFrameRate = videoMandatoryConstraints.minFrameRate; - } - - if (mandatory.minWidth && mandatory.minHeight) { - // http://goo.gl/IZVYsj - var allowed = ['1920:1080', '1280:720', '960:720', '640:360', '640:480', '320:240', '320:180']; - - if (allowed.indexOf(mandatory.minWidth + ':' + mandatory.minHeight) == -1 || - allowed.indexOf(mandatory.maxWidth + ':' + mandatory.maxHeight) == -1) { - error('The min/max width/height constraints you passed "seems" NOT supported.', toStr(mandatory)); - } - - if (mandatory.minWidth > mandatory.maxWidth || mandatory.minHeight > mandatory.maxHeight) { - error('Minimum value must not exceed maximum value.', toStr(mandatory)); - } - - if (mandatory.minWidth >= 1280 && mandatory.minHeight >= 720) { - warn('Enjoy HD video! min/' + mandatory.minWidth + ':' + mandatory.minHeight + ', max/' + mandatory.maxWidth + ':' + mandatory.maxHeight); - } - } - - hints.video.mandatory = merge(hints.video.mandatory, mandatory); - } - - if (videoMandatoryConstraints) { - hints.video.mandatory = merge(hints.video.mandatory, videoMandatoryConstraints); - } - - // videoConstraints.optional = [{prop:true}]; - if (videoConstraints.optional && videoConstraints.optional instanceof Array && videoConstraints.optional.length) { - hints.video.optional = hints.video.optional ? hints.video.optional.concat(videoConstraints.optional) : videoConstraints.optional; - } - - // audioConstraints.optional = [{prop:true}]; - if (audioConstraints.optional && audioConstraints.optional instanceof Array && audioConstraints.optional.length) { - hints.audio.optional = hints.audio.optional ? hints.audio.optional.concat(audioConstraints.optional) : audioConstraints.optional; - } - - if (hints.video.mandatory && !isEmpty(hints.video.mandatory) && connection._mediaSources.video) { - hints.video.optional.forEach(function(video, index) { - if (video.sourceId == connection._mediaSources.video) { - delete hints.video.optional[index]; - } - }); - - hints.video.optional = swap(hints.video.optional); - - hints.video.optional.push({ - sourceId: connection._mediaSources.video - }); - } - - if (hints.audio.mandatory && !isEmpty(hints.audio.mandatory) && connection._mediaSources.audio) { - hints.audio.optional.forEach(function(audio, index) { - if (audio.sourceId == connection._mediaSources.audio) { - delete hints.audio.optional[index]; - } - }); - - hints.audio.optional = swap(hints.audio.optional); - - hints.audio.optional.push({ - sourceId: connection._mediaSources.audio - }); - } - - if (hints.video && !hints.video.mozMediaSource && hints.video.optional && hints.video.mandatory) { - if (!hints.video.optional.length && isEmpty(hints.video.mandatory)) { - hints.video = true; - } - } - - if (isMobileDevice) { - // Android fails for some constraints - // so need to force {audio:true,video:true} - hints = { - audio: !!hints.audio, - video: !!hints.video - }; - } - - // connection.mediaConstraints always overrides constraints - // passed from "captureUserMedia" function. - // todo: need to verify all possible situations - log('invoked getUserMedia with constraints:', toStr(hints)); - - // easy way to match - var idInstance = JSON.stringify(hints); - - function streaming(stream, returnBack, streamid) { - if (!streamid) streamid = getRandomString(); - - // localStreams object will store stream - // until it is removed using native-stop method. - connection.localStreams[streamid] = stream; - - var video = options.video; - if (video) { - video[isFirefox ? 'mozSrcObject' : 'src'] = isFirefox ? stream : (window.URL || window.webkitURL).createObjectURL(stream); - video.play(); - } - - options.onsuccess(stream, returnBack, idInstance, streamid); - currentUserMediaRequest.streams[idInstance] = { - stream: stream, - streamid: streamid - }; - currentUserMediaRequest.mutex = false; - if (currentUserMediaRequest.queueRequests.length) - getUserMedia(currentUserMediaRequest.queueRequests.shift()); - } - - if (currentUserMediaRequest.streams[idInstance]) { - streaming(currentUserMediaRequest.streams[idInstance].stream, true, currentUserMediaRequest.streams[idInstance].streamid); - } else { - n.getMedia = n.webkitGetUserMedia || n.mozGetUserMedia; - - // http://goo.gl/eETIK4 - n.getMedia(hints, streaming, function(error) { - options.onerror(error, hints); - }); - } - } - - var RTCSessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription; - var RTCIceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate; - - var RTCPeerConnection; - if (typeof mozRTCPeerConnection !== 'undefined') { - RTCPeerConnection = mozRTCPeerConnection; - } else if (typeof webkitRTCPeerConnection !== 'undefined') { - RTCPeerConnection = webkitRTCPeerConnection; - } else if (typeof window.RTCPeerConnection !== 'undefined') { - RTCPeerConnection = window.RTCPeerConnection; - } else { - console.error('WebRTC 1.0 (RTCPeerConnection) API seems NOT available in this browser.'); - } - - function setSdpConstraints(config) { - var sdpConstraints; - - var sdpConstraints_mandatory = { - OfferToReceiveAudio: !!config.OfferToReceiveAudio, - OfferToReceiveVideo: !!config.OfferToReceiveVideo - }; - - sdpConstraints = { - mandatory: sdpConstraints_mandatory, - optional: [{ - VoiceActivityDetection: false - }] - }; - - if (!!navigator.mozGetUserMedia && firefoxVersion > 34) { - sdpConstraints = { - OfferToReceiveAudio: !!config.OfferToReceiveAudio, - OfferToReceiveVideo: !!config.OfferToReceiveVideo - }; - } - - return sdpConstraints; - } - - function PeerConnection() { - return { - create: function(type, options) { - merge(this, options); - - var self = this; - - this.type = type; - this.init(); - this.attachMediaStreams(); - - if (isFirefox && this.session.data) { - if (this.session.data && type == 'offer') { - this.createDataChannel(); - } - - this.getLocalDescription(type); - - if (this.session.data && type == 'answer') { - this.createDataChannel(); - } - } else self.getLocalDescription(type); - - return this; - }, - getLocalDescription: function(createType) { - log('(getLocalDescription) peer createType is', createType); - - if (this.session.inactive && isNull(this.rtcMultiConnection.waitUntilRemoteStreamStartsFlowing)) { - // inactive session returns blank-stream - this.rtcMultiConnection.waitUntilRemoteStreamStartsFlowing = false; - } - - var self = this; - - if (createType == 'answer') { - this.setRemoteDescription(this.offerDescription, createDescription); - } else createDescription(); - - function createDescription() { - self.connection[createType == 'offer' ? 'createOffer' : 'createAnswer'](function(sessionDescription) { - sessionDescription.sdp = self.serializeSdp(sessionDescription.sdp, createType); - self.connection.setLocalDescription(sessionDescription); - - if (self.trickleIce) { - self.onSessionDescription(sessionDescription, self.streaminfo); - } - - if (sessionDescription.type == 'offer') { - log('offer sdp', sessionDescription.sdp); - } - - self.prevCreateType = createType; - }, self.onSdpError, self.constraints); - } - }, - serializeSdp: function(sdp, createType) { - // it is "connection.processSdp=function(sdp){return sdp;}" - sdp = this.processSdp(sdp); - - if (isFirefox) return sdp; - - if (this.session.inactive && !this.holdMLine) { - this.hold = true; - if ((this.session.screen || this.session.video) && this.session.audio) { - this.holdMLine = 'both'; - } else if (this.session.screen || this.session.video) { - this.holdMLine = 'video'; - } else if (this.session.audio) { - this.holdMLine = 'audio'; - } - } - - sdp = this.setBandwidth(sdp); - if (this.holdMLine == 'both') { - if (this.hold) { - this.prevSDP = sdp; - sdp = sdp.replace(/a=sendonly|a=recvonly|a=sendrecv/g, 'a=inactive'); - } else if (this.prevSDP) { - if (!this.session.inactive) { - // it means that DTSL key exchange already happened for single or multiple media lines. - // this block checks, key-exchange must be happened for all media lines. - sdp = this.prevSDP; - - // todo: test it: makes sense? - if (chromeVersion <= 35) { - return sdp; - } - } - } - } else if (this.holdMLine == 'audio' || this.holdMLine == 'video') { - sdp = sdp.split('m='); - - var audio = ''; - var video = ''; - - if (sdp[1] && sdp[1].indexOf('audio') == 0) { - audio = 'm=' + sdp[1]; - } - if (sdp[2] && sdp[2].indexOf('audio') == 0) { - audio = 'm=' + sdp[2]; - } - - if (sdp[1] && sdp[1].indexOf('video') == 0) { - video = 'm=' + sdp[1]; - } - if (sdp[2] && sdp[2].indexOf('video') == 0) { - video = 'm=' + sdp[2]; - } - - if (this.holdMLine == 'audio') { - if (this.hold) { - this.prevSDP = sdp[0] + audio + video; - sdp = sdp[0] + audio.replace(/a=sendonly|a=recvonly|a=sendrecv/g, 'a=inactive') + video; - } else if (this.prevSDP) { - sdp = this.prevSDP; - } - } - - if (this.holdMLine == 'video') { - if (this.hold) { - this.prevSDP = sdp[0] + audio + video; - sdp = sdp[0] + audio + video.replace(/a=sendonly|a=recvonly|a=sendrecv/g, 'a=inactive'); - } else if (this.prevSDP) { - sdp = this.prevSDP; - } - } - } - - if (!this.hold && this.session.inactive) { - // transport.cc&l=852 - http://goo.gl/0FxxqG - // dtlstransport.h&l=234 - http://goo.gl/7E4sYF - // http://tools.ietf.org/html/rfc4340 - - // From RFC 4145, SDP setup attribute values. - // http://goo.gl/xETJEp && http://goo.gl/3Wgcau - if (createType == 'offer') { - sdp = sdp.replace(/a=setup:passive|a=setup:active|a=setup:holdconn/g, 'a=setup:actpass'); - } else { - sdp = sdp.replace(/a=setup:actpass|a=setup:passive|a=setup:holdconn/g, 'a=setup:active'); - } - - // whilst doing handshake, either media lines were "inactive" - // or no media lines were present - sdp = sdp.replace(/a=inactive/g, 'a=sendrecv'); - } - // this.session.inactive = false; - return sdp; - }, - init: function() { - this.setConstraints(); - this.connection = new RTCPeerConnection(this.iceServers, this.optionalArgument); - - if (this.session.data) { - log('invoked: createDataChannel'); - this.createDataChannel(); - } - - this.connection.onicecandidate = function(event) { - if (!event.candidate) { - if (!self.trickleIce) { - returnSDP(); - } - - return; - } - - if (!self.trickleIce) return; - - self.onicecandidate(event.candidate); - }; - - function returnSDP() { - if (self.returnedSDP) { - self.returnedSDP = false; - return; - }; - self.returnedSDP = true; - - self.onSessionDescription(self.connection.localDescription, self.streaminfo); - } - - this.connection.onaddstream = function(e) { - log('onaddstream', isPluginRTC ? e.stream : toStr(e.stream)); - - self.onaddstream(e.stream, self.session); - }; - - this.connection.onremovestream = function(e) { - self.onremovestream(e.stream); - }; - - this.connection.onsignalingstatechange = function() { - self.connection && self.oniceconnectionstatechange({ - iceConnectionState: self.connection.iceConnectionState, - iceGatheringState: self.connection.iceGatheringState, - signalingState: self.connection.signalingState - }); - }; - - this.connection.oniceconnectionstatechange = function() { - if (!self.connection) return; - - self.oniceconnectionstatechange({ - iceConnectionState: self.connection.iceConnectionState, - iceGatheringState: self.connection.iceGatheringState, - signalingState: self.connection.signalingState - }); - - if (self.trickleIce) return; - - if (self.connection.iceGatheringState == 'complete') { - log('iceGatheringState', self.connection.iceGatheringState); - returnSDP(); - } - }; - - var self = this; - }, - setBandwidth: function(sdp) { - if (isMobileDevice || isFirefox || !this.bandwidth) return sdp; - - var bandwidth = this.bandwidth; - - if (this.session.screen) { - if (!bandwidth.screen) { - warn('It seems that you are not using bandwidth for screen. Screen sharing is expected to fail.'); - } else if (bandwidth.screen < 300) { - warn('It seems that you are using wrong bandwidth value for screen. Screen sharing is expected to fail.'); - } - } - - // if screen; must use at least 300kbs - if (bandwidth.screen && this.session.screen) { - sdp = sdp.replace(/b=AS([^\r\n]+\r\n)/g, ''); - sdp = sdp.replace(/a=mid:video\r\n/g, 'a=mid:video\r\nb=AS:' + bandwidth.screen + '\r\n'); - } - - // remove existing bandwidth lines - if (bandwidth.audio || bandwidth.video || bandwidth.data) { - sdp = sdp.replace(/b=AS([^\r\n]+\r\n)/g, ''); - } - - if (bandwidth.audio) { - sdp = sdp.replace(/a=mid:audio\r\n/g, 'a=mid:audio\r\nb=AS:' + bandwidth.audio + '\r\n'); - } - - if (bandwidth.video) { - sdp = sdp.replace(/a=mid:video\r\n/g, 'a=mid:video\r\nb=AS:' + (this.session.screen ? bandwidth.screen : bandwidth.video) + '\r\n'); - } - - if (bandwidth.data && !this.preferSCTP) { - sdp = sdp.replace(/a=mid:data\r\n/g, 'a=mid:data\r\nb=AS:' + bandwidth.data + '\r\n'); - } - - return sdp; - }, - setConstraints: function() { - var sdpConstraints = setSdpConstraints({ - OfferToReceiveAudio: !!this.session.audio, - OfferToReceiveVideo: !!this.session.video || !!this.session.screen - }); - - if (this.sdpConstraints.mandatory) { - sdpConstraints = setSdpConstraints(this.sdpConstraints.mandatory); - } - - this.constraints = sdpConstraints; - - if (this.constraints) { - log('sdp-constraints', toStr(this.constraints)); - } - - this.optionalArgument = { - optional: this.optionalArgument.optional || [], - mandatory: this.optionalArgument.mandatory || {} - }; - - if (!this.preferSCTP) { - this.optionalArgument.optional.push({ - RtpDataChannels: true - }); - } - - log('optional-argument', toStr(this.optionalArgument)); - - if (!isNull(this.iceServers)) { - var iceCandidates = this.rtcMultiConnection.candidates; - - var stun = iceCandidates.stun; - var turn = iceCandidates.turn; - var host = iceCandidates.host; - - if (!isNull(iceCandidates.reflexive)) stun = iceCandidates.reflexive; - if (!isNull(iceCandidates.relay)) turn = iceCandidates.relay; - - if (!host && !stun && turn) { - this.rtcConfiguration.iceTransports = 'relay'; - } else if (!host && !stun && !turn) { - this.rtcConfiguration.iceTransports = 'none'; - } - - this.iceServers = { - iceServers: this.iceServers, - iceTransports: this.rtcConfiguration.iceTransports - }; - } else this.iceServers = null; - - log('rtc-configuration', toStr(this.iceServers)); - }, - onSdpError: function(e) { - var message = toStr(e); - - if (message && message.indexOf('RTP/SAVPF Expects at least 4 fields') != -1) { - message = 'It seems that you are trying to interop RTP-datachannels with SCTP. It is not supported!'; - } - error('onSdpError:', message); - }, - onSdpSuccess: function() { - log('sdp success'); - }, - onMediaError: function(err) { - error(toStr(err)); - }, - setRemoteDescription: function(sessionDescription, onSdpSuccess) { - if (!sessionDescription) throw 'Remote session description should NOT be NULL.'; - - if (!this.connection) return; - - log('setting remote description', sessionDescription.type, sessionDescription.sdp); - - var self = this; - this.connection.setRemoteDescription( - new RTCSessionDescription(sessionDescription), - onSdpSuccess || this.onSdpSuccess, - function(error) { - if (error.search(/STATE_SENTINITIATE|STATE_INPROGRESS/gi) == -1) { - self.onSdpError(error); - } - } - ); - }, - addIceCandidate: function(candidate) { - var self = this; - if (isPluginRTC) { - RTCIceCandidate(candidate, function(iceCandidate) { - onAddIceCandidate(iceCandidate); - }); - } else onAddIceCandidate(new RTCIceCandidate(candidate)); - - function onAddIceCandidate(iceCandidate) { - self.connection.addIceCandidate(iceCandidate, function() { - log('added:', candidate.sdpMid, candidate.candidate); - }, function() { - error('onIceFailure', arguments, candidate.candidate); - }); - } - }, - createDataChannel: function(channelIdentifier) { - // skip 2nd invocation of createDataChannel - if (this.channels && this.channels.length) return; - - var self = this; - - if (!this.channels) this.channels = []; - - // protocol: 'text/chat', preset: true, stream: 16 - // maxRetransmits:0 && ordered:false && outOfOrderAllowed: false - var dataChannelDict = {}; - - if (this.dataChannelDict) dataChannelDict = this.dataChannelDict; - - if (isChrome && !this.preferSCTP) { - dataChannelDict.reliable = false; // Deprecated! - } - - log('dataChannelDict', toStr(dataChannelDict)); - - if (this.type == 'answer' || isFirefox) { - this.connection.ondatachannel = function(event) { - self.setChannelEvents(event.channel); - }; - } - - if ((isChrome && this.type == 'offer') || isFirefox) { - this.setChannelEvents( - this.connection.createDataChannel(channelIdentifier || 'channel', dataChannelDict) - ); - } - }, - setChannelEvents: function(channel) { - var self = this; - - channel.binaryType = 'arraybuffer'; - - if (this.dataChannelDict.binaryType) { - channel.binaryType = this.dataChannelDict.binaryType; - } - - channel.onmessage = function(event) { - self.onmessage(event.data); - }; - - var numberOfTimes = 0; - channel.onopen = function() { - channel.push = channel.send; - channel.send = function(data) { - if (self.connection.iceConnectionState == 'disconnected') { - return; - } - - if (channel.readyState.search(/closing|closed/g) != -1) { - return; - } - - if (channel.readyState.search(/connecting|open/g) == -1) { - return; - } - - if (channel.readyState == 'connecting') { - numberOfTimes++; - return setTimeout(function() { - if (numberOfTimes < 20) { - channel.send(data); - } else throw 'Number of times exceeded to wait for WebRTC data connection to be opened.'; - }, 1000); - } - try { - channel.push(data); - } catch (e) { - numberOfTimes++; - warn('Data transmission failed. Re-transmitting..', numberOfTimes, toStr(e)); - if (numberOfTimes >= 20) throw 'Number of times exceeded to resend data packets over WebRTC data channels.'; - setTimeout(function() { - channel.send(data); - }, 100); - } - }; - self.onopen(channel); - }; - - channel.onerror = function(event) { - self.onerror(event); - }; - - channel.onclose = function(event) { - self.onclose(event); - }; - - this.channels.push(channel); - }, - addStream: function(stream) { - if (!stream.streamid && !isIE) { - stream.streamid = getRandomString(); - } - - // todo: maybe need to add isAudio/isVideo/isScreen if missing? - - log('attaching stream:', stream.streamid, isPluginRTC ? stream : toStr(stream)); - - this.connection.addStream(stream); - - this.sendStreamId(stream); - this.getStreamInfo(); - }, - attachMediaStreams: function() { - var streams = this.attachStreams; - for (var i = 0; i < streams.length; i++) { - this.addStream(streams[i]); - } - }, - getStreamInfo: function() { - this.streaminfo = ''; - var streams = this.connection.getLocalStreams(); - for (var i = 0; i < streams.length; i++) { - if (i == 0) { - this.streaminfo = JSON.stringify({ - streamid: streams[i].streamid || '', - isScreen: !!streams[i].isScreen, - isAudio: !!streams[i].isAudio, - isVideo: !!streams[i].isVideo, - preMuted: streams[i].preMuted || {} - }); - } else { - this.streaminfo += '----' + JSON.stringify({ - streamid: streams[i].streamid || '', - isScreen: !!streams[i].isScreen, - isAudio: !!streams[i].isAudio, - isVideo: !!streams[i].isVideo, - preMuted: streams[i].preMuted || {} - }); - } - } - }, - recreateOffer: function(renegotiate, callback) { - log('recreating offer'); - - this.type = 'offer'; - this.session = renegotiate; - - // todo: make sure this doesn't affect renegotiation scenarios - // this.setConstraints(); - - this.onSessionDescription = callback; - this.getStreamInfo(); - - // one can renegotiate data connection in existing audio/video/screen connection! - if (this.session.data) { - this.createDataChannel(); - } - - this.getLocalDescription('offer'); - }, - recreateAnswer: function(sdp, session, callback) { - // if(isFirefox) this.create(this.type, this); - - log('recreating answer'); - - this.type = 'answer'; - this.session = session; - - // todo: make sure this doesn't affect renegotiation scenarios - // this.setConstraints(); - - this.onSessionDescription = callback; - this.offerDescription = sdp; - this.getStreamInfo(); - - // one can renegotiate data connection in existing audio/video/screen connection! - if (this.session.data) { - this.createDataChannel(); - } - - this.getLocalDescription('answer'); - } - }; - } - - var FileSaver = { - SaveToDisk: invokeSaveAsDialog - }; - - - function invokeSaveAsDialog(fileUrl, fileName) { - /* - if (typeof navigator.msSaveOrOpenBlob !== 'undefined') { - return navigator.msSaveOrOpenBlob(file, fileFullName); - } else if (typeof navigator.msSaveBlob !== 'undefined') { - return navigator.msSaveBlob(file, fileFullName); - } - */ - - var hyperlink = document.createElement('a'); - hyperlink.href = fileUrl; - hyperlink.target = '_blank'; - hyperlink.download = fileName || fileUrl; - - if (!!navigator.mozGetUserMedia) { - hyperlink.onclick = function() { - (document.body || document.documentElement).removeChild(hyperlink); - }; - (document.body || document.documentElement).appendChild(hyperlink); - } - - var evt = new MouseEvent('click', { - view: window, - bubbles: true, - cancelable: true - }); - - hyperlink.dispatchEvent(evt); - - if (!navigator.mozGetUserMedia) { - URL.revokeObjectURL(hyperlink.href); - } - } - - var TextSender = { - send: function(config) { - var connection = config.connection; - - if (config.text instanceof ArrayBuffer || config.text instanceof DataView) { - return config.channel.send(config.text, config._channel); - } - - var channel = config.channel, - _channel = config._channel, - initialText = config.text, - packetSize = connection.chunkSize || 1000, - textToTransfer = '', - isobject = false; - - if (!isString(initialText)) { - isobject = true; - initialText = JSON.stringify(initialText); - } - - // uuid is used to uniquely identify sending instance - var uuid = getRandomString(); - var sendingTime = new Date().getTime(); - - sendText(initialText); - - function sendText(textMessage, text) { - var data = { - type: 'text', - uuid: uuid, - sendingTime: sendingTime - }; - - if (textMessage) { - text = textMessage; - data.packets = parseInt(text.length / packetSize); - } - - if (text.length > packetSize) - data.message = text.slice(0, packetSize); - else { - data.message = text; - data.last = true; - data.isobject = isobject; - } - - channel.send(data, _channel); - - textToTransfer = text.slice(data.message.length); - - if (textToTransfer.length) { - setTimeout(function() { - sendText(null, textToTransfer); - }, connection.chunkInterval || 100); - } - } - } - }; - - function TextReceiver(connection) { - var content = {}; - - function receive(data, userid, extra) { - // uuid is used to uniquely identify sending instance - var uuid = data.uuid; - if (!content[uuid]) content[uuid] = []; - - content[uuid].push(data.message); - if (data.last) { - var message = content[uuid].join(''); - if (data.isobject) message = JSON.parse(message); - - // latency detection - var receivingTime = new Date().getTime(); - var latency = receivingTime - data.sendingTime; - - var e = { - data: message, - userid: userid, - extra: extra, - latency: latency - }; - - if (message.preRecordedMediaChunk) { - if (!connection.preRecordedMedias[message.streamerid]) { - connection.shareMediaFile(null, null, message.streamerid); - } - connection.preRecordedMedias[message.streamerid].onData(message.chunk); - } else if (connection.autoTranslateText) { - e.original = e.data; - connection.Translator.TranslateText(e.data, function(translatedText) { - e.data = translatedText; - connection.onmessage(e); - }); - } else if (message.isPartOfScreen) { - connection.onpartofscreen(message); - } else connection.onmessage(e); - - delete content[uuid]; - } - } - - return { - receive: receive - }; - } - - // Last time updated at Sep 25, 2015, 08:32:23 - - // Latest file can be found here: https://cdn.webrtc-experiment.com/DetectRTC.js - - // Muaz Khan - www.MuazKhan.com - // MIT License - www.WebRTC-Experiment.com/licence - // Documentation - github.com/muaz-khan/DetectRTC - // ____________ - // DetectRTC.js - - // DetectRTC.hasWebcam (has webcam device!) - // DetectRTC.hasMicrophone (has microphone device!) - // DetectRTC.hasSpeakers (has speakers!) - - (function() { - - 'use strict'; - - var navigator = window.navigator; - - if (navigator.mediaDevices && navigator.mediaDevices.enumerateDevices) { - // Firefox 38+ seems having support of enumerateDevices - // Thanks @xdumaine/enumerateDevices - navigator.enumerateDevices = function(callback) { - navigator.mediaDevices.enumerateDevices().then(callback); - }; - } - - if (typeof navigator !== 'undefined') { - if (typeof navigator.webkitGetUserMedia !== 'undefined') { - navigator.getUserMedia = navigator.webkitGetUserMedia; - } - - if (typeof navigator.mozGetUserMedia !== 'undefined') { - navigator.getUserMedia = navigator.mozGetUserMedia; - } - } else { - navigator = { - getUserMedia: function() {} - }; - } - - var isMobileDevice = !!navigator.userAgent.match(/Android|iPhone|iPad|iPod|BlackBerry|IEMobile/i); - var isEdge = navigator.userAgent.indexOf('Edge') !== -1 && (!!navigator.msSaveOrOpenBlob || !!navigator.msSaveBlob); - - // this one can also be used: - // https://www.websocket.org/js/stuff.js (DetectBrowser.js) - - function getBrowserInfo() { - var nVer = navigator.appVersion; - var nAgt = navigator.userAgent; - var browserName = navigator.appName; - var fullVersion = '' + parseFloat(navigator.appVersion); - var majorVersion = parseInt(navigator.appVersion, 10); - var nameOffset, verOffset, ix; - - // In Opera, the true version is after 'Opera' or after 'Version' - if ((verOffset = nAgt.indexOf('Opera')) !== -1) { - browserName = 'Opera'; - fullVersion = nAgt.substring(verOffset + 6); - - if ((verOffset = nAgt.indexOf('Version')) !== -1) { - fullVersion = nAgt.substring(verOffset + 8); - } - } - // In MSIE, the true version is after 'MSIE' in userAgent - else if ((verOffset = nAgt.indexOf('MSIE')) !== -1) { - browserName = 'IE'; - fullVersion = nAgt.substring(verOffset + 5); - } - // In Chrome, the true version is after 'Chrome' - else if ((verOffset = nAgt.indexOf('Chrome')) !== -1) { - browserName = 'Chrome'; - fullVersion = nAgt.substring(verOffset + 7); - } - // In Safari, the true version is after 'Safari' or after 'Version' - else if ((verOffset = nAgt.indexOf('Safari')) !== -1) { - browserName = 'Safari'; - fullVersion = nAgt.substring(verOffset + 7); - - if ((verOffset = nAgt.indexOf('Version')) !== -1) { - fullVersion = nAgt.substring(verOffset + 8); - } - } - // In Firefox, the true version is after 'Firefox' - else if ((verOffset = nAgt.indexOf('Firefox')) !== -1) { - browserName = 'Firefox'; - fullVersion = nAgt.substring(verOffset + 8); - } - - // In most other browsers, 'name/version' is at the end of userAgent - else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) { - browserName = nAgt.substring(nameOffset, verOffset); - fullVersion = nAgt.substring(verOffset + 1); - - if (browserName.toLowerCase() === browserName.toUpperCase()) { - browserName = navigator.appName; - } - } - - if (isEdge) { - browserName = 'Edge'; - // fullVersion = navigator.userAgent.split('Edge/')[1]; - fullVersion = parseInt(navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)[2], 10); - } - - // trim the fullVersion string at semicolon/space if present - if ((ix = fullVersion.indexOf(';')) !== -1) { - fullVersion = fullVersion.substring(0, ix); - } - - if ((ix = fullVersion.indexOf(' ')) !== -1) { - fullVersion = fullVersion.substring(0, ix); - } - - majorVersion = parseInt('' + fullVersion, 10); - - if (isNaN(majorVersion)) { - fullVersion = '' + parseFloat(navigator.appVersion); - majorVersion = parseInt(navigator.appVersion, 10); - } - - return { - fullVersion: fullVersion, - version: majorVersion, - name: browserName - }; - } - - var isMobile = { - Android: function() { - return navigator.userAgent.match(/Android/i); - }, - BlackBerry: function() { - return navigator.userAgent.match(/BlackBerry/i); - }, - iOS: function() { - return navigator.userAgent.match(/iPhone|iPad|iPod/i); - }, - Opera: function() { - return navigator.userAgent.match(/Opera Mini/i); - }, - Windows: function() { - return navigator.userAgent.match(/IEMobile/i); - }, - any: function() { - return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); - }, - getOsName: function() { - var osName = 'Unknown OS'; - if (isMobile.Android()) { - osName = 'Android'; - } - - if (isMobile.BlackBerry()) { - osName = 'BlackBerry'; - } - - if (isMobile.iOS()) { - osName = 'iOS'; - } - - if (isMobile.Opera()) { - osName = 'Opera Mini'; - } - - if (isMobile.Windows()) { - osName = 'Windows'; - } - - return osName; - } - }; - - var osName = 'Unknown OS'; - - if (isMobile.any()) { - osName = isMobile.getOsName(); - } else { - if (navigator.appVersion.indexOf('Win') !== -1) { - osName = 'Windows'; - } - - if (navigator.appVersion.indexOf('Mac') !== -1) { - osName = 'MacOS'; - } - - if (navigator.appVersion.indexOf('X11') !== -1) { - osName = 'UNIX'; - } - - if (navigator.appVersion.indexOf('Linux') !== -1) { - osName = 'Linux'; - } - } - - - var isCanvasSupportsStreamCapturing = false; - var isVideoSupportsStreamCapturing = false; - ['captureStream', 'mozCaptureStream', 'webkitCaptureStream'].forEach(function(item) { - // asdf - if (item in document.createElement('canvas')) { - isCanvasSupportsStreamCapturing = true; - } - - if (item in document.createElement('video')) { - isVideoSupportsStreamCapturing = true; - } - }); - - // via: https://github.com/diafygi/webrtc-ips - function DetectLocalIPAddress(callback) { - getIPs(function(ip) { - //local IPs - if (ip.match(/^(192\.168\.|169\.254\.|10\.|172\.(1[6-9]|2\d|3[01]))/)) { - callback('Local: ' + ip); - } - - //assume the rest are public IPs - else { - callback('Public: ' + ip); - } - }); - } - - //get the IP addresses associated with an account - function getIPs(callback) { - var ipDuplicates = {}; - - //compatibility for firefox and chrome - var RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection; - var useWebKit = !!window.webkitRTCPeerConnection; - - // bypass naive webrtc blocking using an iframe - if (!RTCPeerConnection) { - var iframe = document.getElementById('iframe'); - if (!iframe) { - // - throw 'NOTE: you need to have an iframe in the page right above the script tag.'; - } - var win = iframe.contentWindow; - RTCPeerConnection = win.RTCPeerConnection || win.mozRTCPeerConnection || win.webkitRTCPeerConnection; - useWebKit = !!win.webkitRTCPeerConnection; - } - - //minimal requirements for data connection - var mediaConstraints = { - optional: [{ - RtpDataChannels: true - }] - }; - - //firefox already has a default stun server in about:config - // media.peerconnection.default_iceservers = - // [{"url": "stun:stun.services.mozilla.com"}] - var servers; - - //add same stun server for chrome - if (useWebKit) { - servers = { - iceServers: [{ - urls: 'stun:stun.services.mozilla.com' - }] - }; - - if (typeof DetectRTC !== 'undefined' && DetectRTC.browser.isFirefox && DetectRTC.browser.version <= 38) { - servers[0] = { - url: servers[0].urls - }; - } - } - - //construct a new RTCPeerConnection - var pc = new RTCPeerConnection(servers, mediaConstraints); - - function handleCandidate(candidate) { - //match just the IP address - var ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3})/; - var ipAddress = ipRegex.exec(candidate)[1]; - - //remove duplicates - if (ipDuplicates[ipAddress] === undefined) { - callback(ipAddress); - } - - ipDuplicates[ipAddress] = true; - } - - //listen for candidate events - pc.onicecandidate = function(ice) { - //skip non-candidate events - if (ice.candidate) { - handleCandidate(ice.candidate.candidate); - } - }; - - //create a bogus data channel - pc.createDataChannel(''); - - //create an offer sdp - pc.createOffer(function(result) { - - //trigger the stun server request - pc.setLocalDescription(result, function() {}, function() {}); - - }, function() {}); - - //wait for a while to let everything done - setTimeout(function() { - //read candidate info from local description - var lines = pc.localDescription.sdp.split('\n'); - - lines.forEach(function(line) { - if (line.indexOf('a=candidate:') === 0) { - handleCandidate(line); - } - }); - }, 1000); - } - - var MediaDevices = []; - - // ---------- Media Devices detection - var canEnumerate = false; - - /*global MediaStreamTrack:true */ - if (typeof MediaStreamTrack !== 'undefined' && 'getSources' in MediaStreamTrack) { - canEnumerate = true; - } else if (navigator.mediaDevices && !!navigator.mediaDevices.enumerateDevices) { - canEnumerate = true; - } - - var hasMicrophone = canEnumerate; - var hasSpeakers = canEnumerate; - var hasWebcam = canEnumerate; - - // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediadevices - // todo: switch to enumerateDevices when landed in canary. - function checkDeviceSupport(callback) { - // This method is useful only for Chrome! - - if (!navigator.enumerateDevices && window.MediaStreamTrack && window.MediaStreamTrack.getSources) { - navigator.enumerateDevices = window.MediaStreamTrack.getSources.bind(window.MediaStreamTrack); - } - - if (!navigator.enumerateDevices && navigator.enumerateDevices) { - navigator.enumerateDevices = navigator.enumerateDevices.bind(navigator); - } - - if (!navigator.enumerateDevices) { - if (callback) { - callback(); - } - return; - } - - MediaDevices = []; - navigator.enumerateDevices(function(devices) { - devices.forEach(function(_device) { - var device = {}; - for (var d in _device) { - device[d] = _device[d]; - } - - var skip; - MediaDevices.forEach(function(d) { - if (d.id === device.id) { - skip = true; - } - }); - - if (skip) { - return; - } - - // if it is MediaStreamTrack.getSources - if (device.kind === 'audio') { - device.kind = 'audioinput'; - } - - if (device.kind === 'video') { - device.kind = 'videoinput'; - } - - if (!device.deviceId) { - device.deviceId = device.id; - } - - if (!device.id) { - device.id = device.deviceId; - } - - if (!device.label) { - device.label = 'Please invoke getUserMedia once.'; - if (!isHTTPs) { - device.label = 'HTTPs is required to get label of this ' + device.kind + ' device.'; - } - } - - if (device.kind === 'audioinput' || device.kind === 'audio') { - hasMicrophone = true; - } - - if (device.kind === 'audiooutput') { - hasSpeakers = true; - } - - if (device.kind === 'videoinput' || device.kind === 'video') { - hasWebcam = true; - } - - // there is no 'videoouput' in the spec. - - MediaDevices.push(device); - }); - - if (typeof DetectRTC !== 'undefined') { - DetectRTC.MediaDevices = MediaDevices; - DetectRTC.hasMicrophone = hasMicrophone; - DetectRTC.hasSpeakers = hasSpeakers; - DetectRTC.hasWebcam = hasWebcam; - } - - if (callback) { - callback(); - } - }); - } - - // check for microphone/camera support! - checkDeviceSupport(); - - var DetectRTC = {}; - - // ---------- - // DetectRTC.browser.name || DetectRTC.browser.version || DetectRTC.browser.fullVersion - DetectRTC.browser = getBrowserInfo(); - - // DetectRTC.isChrome || DetectRTC.isFirefox || DetectRTC.isEdge - DetectRTC.browser['is' + DetectRTC.browser.name] = true; - - var isHTTPs = location.protocol === 'https:'; - var isNodeWebkit = !!(window.process && (typeof window.process === 'object') && window.process.versions && window.process.versions['node-webkit']); - - // --------- Detect if system supports WebRTC 1.0 or WebRTC 1.1. - var isWebRTCSupported = false; - ['webkitRTCPeerConnection', 'mozRTCPeerConnection', 'RTCIceGatherer'].forEach(function(item) { - if (item in window) { - isWebRTCSupported = true; - } - }); - DetectRTC.isWebRTCSupported = isWebRTCSupported; - - //------- - DetectRTC.isORTCSupported = typeof RTCIceGatherer !== 'undefined'; - - // --------- Detect if system supports screen capturing API - var isScreenCapturingSupported = false; - if (DetectRTC.browser.isChrome && DetectRTC.browser.version >= 35) { - isScreenCapturingSupported = true; - } else if (DetectRTC.browser.isFirefox && DetectRTC.browser.version >= 34) { - isScreenCapturingSupported = true; - } - - if (!isHTTPs) { - isScreenCapturingSupported = false; - } - DetectRTC.isScreenCapturingSupported = isScreenCapturingSupported; - - // --------- Detect if WebAudio API are supported - var webAudio = {}; - ['AudioContext', 'webkitAudioContext', 'mozAudioContext', 'msAudioContext'].forEach(function(item) { - if (webAudio.isSupported && webAudio.isCreateMediaStreamSourceSupported) { - return; - } - if (item in window) { - webAudio.isSupported = true; - - if ('createMediaStreamSource' in window[item].prototype) { - webAudio.isCreateMediaStreamSourceSupported = true; - } - } - }); - DetectRTC.isAudioContextSupported = webAudio.isSupported; - DetectRTC.isCreateMediaStreamSourceSupported = webAudio.isCreateMediaStreamSourceSupported; - - // ---------- Detect if SCTP/RTP channels are supported. - - var isRtpDataChannelsSupported = false; - if (DetectRTC.browser.isChrome && DetectRTC.browser.version > 31) { - isRtpDataChannelsSupported = true; - } - DetectRTC.isRtpDataChannelsSupported = isRtpDataChannelsSupported; - - var isSCTPSupportd = false; - if (DetectRTC.browser.isFirefox && DetectRTC.browser.version > 28) { - isSCTPSupportd = true; - } else if (DetectRTC.browser.isChrome && DetectRTC.browser.version > 25) { - isSCTPSupportd = true; - } else if (DetectRTC.browser.isOpera && DetectRTC.browser.version >= 11) { - isSCTPSupportd = true; - } - DetectRTC.isSctpDataChannelsSupported = isSCTPSupportd; - - // --------- - - DetectRTC.isMobileDevice = isMobileDevice; // "isMobileDevice" boolean is defined in "getBrowserInfo.js" - - // ------ - - DetectRTC.isWebSocketsSupported = 'WebSocket' in window && 2 === window.WebSocket.CLOSING; - DetectRTC.isWebSocketsBlocked = 'Checking'; - - if (DetectRTC.isWebSocketsSupported) { - /* CUSTOM CODE */ - var href = window.location.href; - var hostPatt = new RegExp(window.location.host +"/[^/]*"); - var res = hostPatt.exec(href); - var protocol = window.location.protocol.replace("http","ws"); - - var signalingServerPath = protocol + "//" + res + "/contact"; - var websocket = new WebSocket(signalingServerPath) - // var websocket = new WebSocket('wss://echo.websocket.org:443/'); - /* CUSTOM CODE */ - websocket.onopen = function() { - DetectRTC.isWebSocketsBlocked = false; - - if (DetectRTC.loadCallback) { - DetectRTC.loadCallback(); - } - }; - websocket.onerror = function() { - DetectRTC.isWebSocketsBlocked = true; - - if (DetectRTC.loadCallback) { - DetectRTC.loadCallback(); - } - }; - } - - // ------ - var isGetUserMediaSupported = false; - if (navigator.getUserMedia) { - isGetUserMediaSupported = true; - } else if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { - isGetUserMediaSupported = true; - } - if (DetectRTC.browser.isChrome && DetectRTC.browser.version >= 47 && !isHTTPs) { - DetectRTC.isGetUserMediaSupported = 'Requires HTTPs'; - } - DetectRTC.isGetUserMediaSupported = isGetUserMediaSupported; - - // ----------- - DetectRTC.osName = osName; // "osName" is defined in "detectOSName.js" - - // ---------- - DetectRTC.isCanvasSupportsStreamCapturing = isCanvasSupportsStreamCapturing; - DetectRTC.isVideoSupportsStreamCapturing = isVideoSupportsStreamCapturing; - - // ------ - DetectRTC.DetectLocalIPAddress = DetectLocalIPAddress; - - // ------- - DetectRTC.load = function(callback) { - this.loadCallback = callback; - - checkDeviceSupport(callback); - }; - - DetectRTC.MediaDevices = MediaDevices; - DetectRTC.hasMicrophone = hasMicrophone; - DetectRTC.hasSpeakers = hasSpeakers; - DetectRTC.hasWebcam = hasWebcam; - - // ------ - var isSetSinkIdSupported = false; - if ('setSinkId' in document.createElement('video')) { - isSetSinkIdSupported = true; - } - DetectRTC.isSetSinkIdSupported = isSetSinkIdSupported; - - // ----- - var isRTPSenderReplaceTracksSupported = false; - if (DetectRTC.browser.isFirefox /*&& DetectRTC.browser.version > 39*/ ) { - /*global mozRTCPeerConnection:true */ - if ('getSenders' in mozRTCPeerConnection.prototype) { - isRTPSenderReplaceTracksSupported = true; - } - } else if (DetectRTC.browser.isChrome) { - /*global webkitRTCPeerConnection:true */ - if ('getSenders' in webkitRTCPeerConnection.prototype) { - isRTPSenderReplaceTracksSupported = true; - } - } - DetectRTC.isRTPSenderReplaceTracksSupported = isRTPSenderReplaceTracksSupported; - - //------ - var isRemoteStreamProcessingSupported = false; - if (DetectRTC.browser.isFirefox && DetectRTC.browser.version > 38) { - isRemoteStreamProcessingSupported = true; - } - DetectRTC.isRemoteStreamProcessingSupported = isRemoteStreamProcessingSupported; - - //------- - var isApplyConstraintsSupported = false; - - /*global MediaStreamTrack:true */ - if (typeof MediaStreamTrack !== 'undefined' && 'applyConstraints' in MediaStreamTrack.prototype) { - isApplyConstraintsSupported = true; - } - DetectRTC.isApplyConstraintsSupported = isApplyConstraintsSupported; - - //------- - var isMultiMonitorScreenCapturingSupported = false; - if (DetectRTC.browser.isFirefox && DetectRTC.browser.version >= 43) { - // version 43 merely supports platforms for multi-monitors - // version 44 will support exact multi-monitor selection i.e. you can select any monitor for screen capturing. - isMultiMonitorScreenCapturingSupported = true; - } - DetectRTC.isMultiMonitorScreenCapturingSupported = isMultiMonitorScreenCapturingSupported; - - window.DetectRTC = DetectRTC; - - })(); - - // DetectRTC extender - var screenCallback; - - DetectRTC.screen = { - chromeMediaSource: 'screen', - extensionid: ReservedExtensionID, - getSourceId: function(callback) { - if (!callback) throw '"callback" parameter is mandatory.'; - - // make sure that chrome extension is installed. - if (!!DetectRTC.screen.status) { - onstatus(DetectRTC.screen.status); - } else DetectRTC.screen.getChromeExtensionStatus(onstatus); - - function onstatus(status) { - if (status == 'installed-enabled') { - screenCallback = callback; - window.postMessage('get-sourceId', '*'); - return; - } - - DetectRTC.screen.chromeMediaSource = 'screen'; - callback('No-Response'); // chrome extension isn't available - } - }, - onMessageCallback: function(data) { - if (!(isString(data) || !!data.sourceId)) return; - - log('chrome message', data); - - // "cancel" button is clicked - if (data == 'PermissionDeniedError') { - DetectRTC.screen.chromeMediaSource = 'PermissionDeniedError'; - if (screenCallback) return screenCallback('PermissionDeniedError'); - else throw new Error('PermissionDeniedError'); - } - - // extension notified his presence - if (data == 'rtcmulticonnection-extension-loaded') { - DetectRTC.screen.chromeMediaSource = 'desktop'; - if (DetectRTC.screen.onScreenCapturingExtensionAvailable) { - DetectRTC.screen.onScreenCapturingExtensionAvailable(); - - // make sure that this event isn't fired multiple times - DetectRTC.screen.onScreenCapturingExtensionAvailable = null; - } - } - - // extension shared temp sourceId - if (data.sourceId) { - DetectRTC.screen.sourceId = data.sourceId; - if (screenCallback) screenCallback(DetectRTC.screen.sourceId); - } - }, - getChromeExtensionStatus: function(extensionid, callback) { - function _callback(status) { - DetectRTC.screen.status = status; - callback(status); - } - - if (isFirefox) return _callback('not-chrome'); - - if (arguments.length != 2) { - callback = extensionid; - extensionid = this.extensionid; - } - - var image = document.createElement('img'); - image.src = 'chrome-extension://' + extensionid + '/icon.png'; - image.onload = function() { - DetectRTC.screen.chromeMediaSource = 'screen'; - window.postMessage('are-you-there', '*'); - setTimeout(function() { - if (DetectRTC.screen.chromeMediaSource == 'screen') { - _callback( - DetectRTC.screen.chromeMediaSource == 'desktop' ? 'installed-enabled' : 'installed-disabled' /* if chrome extension isn't permitted for current domain, then it will be installed-disabled all the time even if extension is enabled. */ - ); - } else _callback('installed-enabled'); - }, 2000); - }; - image.onerror = function() { - _callback('not-installed'); - }; - } - }; - - // if IE - if (!window.addEventListener) { - window.addEventListener = function(el, eventName, eventHandler) { - if (!el.attachEvent) return; - el.attachEvent('on' + eventName, eventHandler); - }; - } - - function listenEventHandler(eventName, eventHandler) { - window.removeEventListener(eventName, eventHandler); - window.addEventListener(eventName, eventHandler, false); - } - - window.addEventListener('message', function(event) { - if (event.origin != window.location.origin) { - return; - } - - DetectRTC.screen.onMessageCallback(event.data); - }); - - function setDefaults(connection) { - var DetectRTC = window.DetectRTC || {}; - - // www.RTCMultiConnection.org/docs/userid/ - connection.userid = getRandomString(); - - // www.RTCMultiConnection.org/docs/session/ - connection.session = { - audio: true, - video: true - }; - - // www.RTCMultiConnection.org/docs/maxParticipantsAllowed/ - connection.maxParticipantsAllowed = 256; - - // www.RTCMultiConnection.org/docs/direction/ - // 'many-to-many' / 'one-to-many' / 'one-to-one' / 'one-way' - connection.direction = 'many-to-many'; - - // www.RTCMultiConnection.org/docs/mediaConstraints/ - connection.mediaConstraints = { - mandatory: {}, // kept for backward compatibility - optional: [], // kept for backward compatibility - audio: { - mandatory: {}, - optional: [] - }, - video: { - mandatory: {}, - optional: [] - } - }; - - // www.RTCMultiConnection.org/docs/candidates/ - connection.candidates = { - host: true, - stun: true, - turn: true - }; - - connection.sdpConstraints = {}; - - // as @serhanters proposed in #225 - // it will auto fix "all" renegotiation scenarios - connection.sdpConstraints.mandatory = { - OfferToReceiveAudio: true, - OfferToReceiveVideo: true - }; - - connection.privileges = { - canStopRemoteStream: false, // user can stop remote streams - canMuteRemoteStream: false // user can mute remote streams - }; - - connection.iceProtocols = { - tcp: true, - udp: true - }; - - // www.RTCMultiConnection.org/docs/preferSCTP/ - connection.preferSCTP = isFirefox || chromeVersion >= 32 ? true : false; - connection.chunkInterval = isFirefox || chromeVersion >= 32 ? 100 : 500; // 500ms for RTP and 100ms for SCTP - connection.chunkSize = isFirefox || chromeVersion >= 32 ? 13 * 1000 : 1000; // 1000 chars for RTP and 13000 chars for SCTP - - // www.RTCMultiConnection.org/docs/fakeDataChannels/ - connection.fakeDataChannels = false; - - connection.waitUntilRemoteStreamStartsFlowing = null; // NULL == true - - // auto leave on page unload - connection.leaveOnPageUnload = true; - - // get ICE-servers from XirSys - connection.getExternalIceServers = isChrome; - - // www.RTCMultiConnection.org/docs/UA/ - connection.UA = { - isFirefox: isFirefox, - isChrome: isChrome, - isMobileDevice: isMobileDevice, - version: isChrome ? chromeVersion : firefoxVersion, - isNodeWebkit: isNodeWebkit, - isSafari: isSafari, - isIE: isIE, - isOpera: isOpera - }; - - // file queue: to store previous file objects in memory; - // and stream over newly connected peers - // www.RTCMultiConnection.org/docs/fileQueue/ - connection.fileQueue = {}; - - // this array is aimed to store all renegotiated streams' session-types - connection.renegotiatedSessions = {}; - - // www.RTCMultiConnection.org/docs/channels/ - connection.channels = {}; - - // www.RTCMultiConnection.org/docs/extra/ - connection.extra = {}; - - // www.RTCMultiConnection.org/docs/bandwidth/ - connection.bandwidth = { - screen: 300 // 300kbps (dirty workaround) - }; - - // www.RTCMultiConnection.org/docs/caniuse/ - connection.caniuse = { - RTCPeerConnection: DetectRTC.isWebRTCSupported, - getUserMedia: !!navigator.webkitGetUserMedia || !!navigator.mozGetUserMedia, - AudioContext: DetectRTC.isAudioContextSupported, - - // there is no way to check whether "getUserMedia" flag is enabled or not! - ScreenSharing: DetectRTC.isScreenCapturingSupported, - RtpDataChannels: DetectRTC.isRtpDataChannelsSupported, - SctpDataChannels: DetectRTC.isSctpDataChannelsSupported - }; - - // www.RTCMultiConnection.org/docs/snapshots/ - connection.snapshots = {}; - - // www.WebRTC-Experiment.com/demos/MediaStreamTrack.getSources.html - connection._mediaSources = {}; - - // www.RTCMultiConnection.org/docs/devices/ - connection.devices = {}; - - // www.RTCMultiConnection.org/docs/language/ (to see list of all supported languages) - connection.language = 'en'; - - // www.RTCMultiConnection.org/docs/autoTranslateText/ - connection.autoTranslateText = false; - - // please use your own Google Translate API key - // Google Translate is a paid service. - connection.googKey = 'AIzaSyCgB5hmFY74WYB-EoWkhr9cAGr6TiTHrEE'; - - connection.localStreamids = []; - connection.localStreams = {}; - - // this object stores pre-recorded media streaming uids - // multiple pre-recorded media files can be streamed concurrently. - connection.preRecordedMedias = {}; - - // www.RTCMultiConnection.org/docs/attachStreams/ - connection.attachStreams = []; - - // www.RTCMultiConnection.org/docs/detachStreams/ - connection.detachStreams = []; - - connection.optionalArgument = { - optional: [{ - DtlsSrtpKeyAgreement: true - }, { - googImprovedWifiBwe: true - }, { - googScreencastMinBitrate: 300 - }], - mandatory: {} - }; - - connection.dataChannelDict = {}; - - // www.RTCMultiConnection.org/docs/dontAttachStream/ - connection.dontAttachStream = false; - - // www.RTCMultiConnection.org/docs/dontCaptureUserMedia/ - connection.dontCaptureUserMedia = false; - - // this feature added to keep users privacy and - // make sure HTTPs pages NEVER auto capture users media - // isChrome && location.protocol == 'https:' - connection.preventSSLAutoAllowed = false; - - connection.autoReDialOnFailure = true; - connection.isInitiator = false; - - // access DetectRTC.js features directly! - connection.DetectRTC = DetectRTC; - - // you can falsify it to merge all ICE in SDP and share only SDP! - // such mechanism is useful for SIP/XMPP and XMLHttpRequest signaling - // bug: renegotiation fails if "trickleIce" is false - connection.trickleIce = true; - - // this object stores list of all sessions in current channel - connection.sessionDescriptions = {}; - - // this object stores current user's session-description - // it is set only for initiator - // it is set as soon as "open" method is invoked. - connection.sessionDescription = null; - - // resources used in RTCMultiConnection - connection.resources = { - // CUSTOM CODE // - /* Commenting this block as we do not wasnt external dependencies - * - RecordRTC: 'https://cdn.webrtc-experiment.com/RecordRTC.js', - PreRecordedMediaStreamer: 'https://cdn.webrtc-experiment.com/PreRecordedMediaStreamer.js', - customGetUserMediaBar: 'https://cdn.webrtc-experiment.com/navigator.customGetUserMediaBar.js', - html2canvas: 'https://cdn.webrtc-experiment.com/screenshot.js', - hark: 'https://cdn.webrtc-experiment.com/hark.js', - firebase: 'https://cdn.webrtc-experiment.com/firebase.js', - firebaseio: 'https://webrtc-signaling.firebaseio.com/', - - - - getConnectionStats: 'https://cdn.webrtc-experiment.com/getConnectionStats.js', - FileBufferReader: 'https://cdn.webrtc-experiment.com/FileBufferReader.js' - */ - - // CUSTOM CODE // - - - }; - - // www.RTCMultiConnection.org/docs/body/ - connection.body = document.body || document.documentElement; - connection.screenbody = null;// document.body || document.documentElement; - connection.videobody = null;//document.body || document.documentElement; - - // www.RTCMultiConnection.org/docs/peers/ - connection.peers = {}; - - // www.RTCMultiConnection.org/docs/firebase/ - connection.firebase = 'chat'; - - connection.numberOfSessions = 0; - connection.numberOfConnectedUsers = 0; - - // by default, data-connections will always be getting - // FileBufferReader.js if absent. - connection.enableFileSharing = true; - - // www.RTCMultiConnection.org/docs/autoSaveToDisk/ - // to make sure file-saver dialog is not invoked. - connection.autoSaveToDisk = false; - - connection.processSdp = function(sdp) { - // process sdp here - return sdp; - }; - - // www.RTCMultiConnection.org/docs/onmessage/ - connection.onmessage = function(e) { - log('onmessage', toStr(e)); - }; - - // www.RTCMultiConnection.org/docs/onopen/ - connection.onopen = function(e) { - log('Data connection is opened between you and', e.userid); - }; - - // www.RTCMultiConnection.org/docs/onerror/ - connection.onerror = function(e) { - error(onerror, toStr(e)); - }; - - // www.RTCMultiConnection.org/docs/onclose/ - connection.onclose = function(e) { - warn('onclose', toStr(e)); - - // todo: should we use "stop" or "remove"? - // BTW, it is remote user! - connection.streams.remove({ - userid: e.userid - }); - }; - - var progressHelper = {}; - - // www.RTCMultiConnection.org/docs/onFileStart/ - connection.onFileStart = function(file) { - var div = document.createElement('div'); - div.title = file.name; - div.innerHTML = ' '; - connection.body.insertBefore(div, connection.body.firstChild); - progressHelper[file.uuid] = { - div: div, - progress: div.querySelector('progress'), - label: div.querySelector('label') - }; - progressHelper[file.uuid].progress.max = file.maxChunks; - }; - - // www.RTCMultiConnection.org/docs/onFileProgress/ - connection.onFileProgress = function(chunk) { - var helper = progressHelper[chunk.uuid]; - if (!helper) return; - helper.progress.value = chunk.currentPosition || chunk.maxChunks || helper.progress.max; - updateLabel(helper.progress, helper.label); - }; - - // www.RTCMultiConnection.org/docs/onFileEnd/ - connection.onFileEnd = function(file) { - if (progressHelper[file.uuid]) progressHelper[file.uuid].div.innerHTML = '' + file.name + ''; - - // for backward compatibility - if (connection.onFileSent || connection.onFileReceived) { - if (connection.onFileSent) connection.onFileSent(file, file.uuid); - if (connection.onFileReceived) connection.onFileReceived(file.name, file); - } - }; - - function updateLabel(progress, label) { - if (progress.position == -1) return; - var position = +progress.position.toFixed(2).split('.')[1] || 100; - label.innerHTML = position + '%'; - } - - // www.RTCMultiConnection.org/docs/onstream/ - connection.onstream = function(e) { - // CUSTOM CODE // - - if(e.isVideo || e.isAudio) - { - var videoTag = e.mediaElement; - var videoType = e.type; - var parentDiv = connection.videobody; - - if(videoType == "local") - { - videoTag.style.top = "auto"; - videoTag.style.position = "absolute"; - //videoTag.style.left = (parentDiv.offsetWidth - 160) + "px"; - videoTag.style.height = "150px"; - videoTag.style.width = "150px"; - videoTag.style.zIndex = 1; - - } - else if(videoType == "remote") - { - videoTag.style.top = "auto"; - videoTag.style.position = "absolute"; - videoTag.style.zIndex = -1; - } - - parentDiv.appendChild(videoTag); - } - else if(e.isScreen) - { - var screenTag = e.mediaElement; - var screenType = e.type; - var parentDiv = connection.screenbody; - - if(screenType == "local") - { - // no need to display this because the person sharing his/her screen doesn't have to see whats being shared - // enabled for demo purposes - parentDiv.appendChild(screenTag); - } - else if(screenType == "remote") - { - parentDiv.appendChild(screenTag); - } - - - } - - else - connection.body.insertBefore(e.mediaElement, connection.body.firstChild); - - // CUSTOM CODE // - }; - - // www.RTCMultiConnection.org/docs/onStreamEndedHandler/ - connection.onstreamended = function(e) { - log('onStreamEndedHandler:', e); - - if (!e.mediaElement) { - return warn('Event.mediaElement is undefined', e); - } - if (!e.mediaElement.parentNode) { - e.mediaElement = document.getElementById(e.streamid); - - if (!e.mediaElement) { - return warn('Event.mediaElement is undefined', e); - } - - if (!e.mediaElement.parentNode) { - return warn('Event.mediElement.parentNode is null.', e); - } - } - - e.mediaElement.parentNode.removeChild(e.mediaElement); - }; - - // todo: need to write documentation link - connection.onSessionClosed = function(session) { - if (session.isEjected) { - warn(session.userid, 'ejected you.'); - } else warn('Session has been closed.', session); - }; - - // www.RTCMultiConnection.org/docs/onmute/ - connection.onmute = function(e) { - if (e.isVideo && e.mediaElement) { - e.mediaElement.pause(); - e.mediaElement.setAttribute('poster', e.snapshot || connection.resources.muted); - } - if (e.isAudio && e.mediaElement) { - e.mediaElement.muted = true; - } - }; - - // www.RTCMultiConnection.org/docs/onunmute/ - connection.onunmute = function(e) { - if (e.isVideo && e.mediaElement) { - e.mediaElement.play(); - e.mediaElement.removeAttribute('poster'); - } - if (e.isAudio && e.mediaElement) { - e.mediaElement.muted = false; - } - }; - - // www.RTCMultiConnection.org/docs/onleave/ - connection.onleave = function(e) { - log('onleave', toStr(e)); - }; - - connection.token = getRandomString; - - connection.peers[connection.userid] = { - drop: function() { - connection.drop(); - }, - renegotiate: function() {}, - addStream: function() {}, - hold: function() {}, - unhold: function() {}, - changeBandwidth: function() {}, - sharePartOfScreen: function() {} - }; - - connection._skip = ['stop', 'mute', 'unmute', '_private', '_selectStreams', 'selectFirst', 'selectAll', 'remove']; - - // www.RTCMultiConnection.org/docs/streams/ - connection.streams = { - mute: function(session) { - this._private(session, true); - }, - unmute: function(session) { - this._private(session, false); - }, - _private: function(session, enabled) { - if (session && !isString(session)) { - for (var stream in this) { - if (connection._skip.indexOf(stream) == -1) { - _muteOrUnMute(this[stream], session, enabled); - } - } - - function _muteOrUnMute(stream, session, isMute) { - if (session.local && stream.type != 'local') return; - if (session.remote && stream.type != 'remote') return; - - if (session.isScreen && !stream.isScreen) return; - if (session.isAudio && !stream.isAudio) return; - if (session.isVideo && !stream.isVideo) return; - - if (isMute) stream.mute(session); - else stream.unmute(session); - } - return; - } - - // implementation from #68 - for (var stream in this) { - if (connection._skip.indexOf(stream) == -1) { - this[stream]._private(session, enabled); - } - } - }, - stop: function(type) { - var _stream; - for (var stream in this) { - if (connection._skip.indexOf(stream) == -1) { - _stream = this[stream]; - - if (!type) _stream.stop(); - - else if (isString(type)) { - // connection.streams.stop('screen'); - var config = {}; - config[type] = true; - _stopStream(_stream, config); - } else _stopStream(_stream, type); - } - } - - function _stopStream(_stream, config) { - // connection.streams.stop({ remote: true, userid: 'remote-userid' }); - if (config.userid && _stream.userid != config.userid) return; - - if (config.local && _stream.type != 'local') return; - if (config.remote && _stream.type != 'remote') return; - - if (config.screen && !!_stream.isScreen) { - _stream.stop(); - } - - if (config.audio && !!_stream.isAudio) { - _stream.stop(); - } - - if (config.video && !!_stream.isVideo) { - _stream.stop(); - } - - // connection.streams.stop('local'); - if (!config.audio && !config.video && !config.screen) { - _stream.stop(); - } - } - }, - remove: function(type) { - var _stream; - for (var stream in this) { - if (connection._skip.indexOf(stream) == -1) { - _stream = this[stream]; - - if (!type) _stopAndRemoveStream(_stream, { - local: true, - remote: true - }); - - else if (isString(type)) { - // connection.streams.stop('screen'); - var config = {}; - config[type] = true; - _stopAndRemoveStream(_stream, config); - } else _stopAndRemoveStream(_stream, type); - } - } - - function _stopAndRemoveStream(_stream, config) { - // connection.streams.remove({ remote: true, userid: 'remote-userid' }); - if (config.userid && _stream.userid != config.userid) return; - - if (config.local && _stream.type != 'local') return; - if (config.remote && _stream.type != 'remote') return; - - if (config.screen && !!_stream.isScreen) { - endStream(_stream); - } - - if (config.audio && !!_stream.isAudio) { - endStream(_stream); - } - - if (config.video && !!_stream.isVideo) { - endStream(_stream); - } - - // connection.streams.remove('local'); - if (!config.audio && !config.video && !config.screen) { - endStream(_stream); - } - } - - function endStream(_stream) { - onStreamEndedHandler(_stream, connection); - delete connection.streams[_stream.streamid]; - } - }, - selectFirst: function(args) { - return this._selectStreams(args, false); - }, - selectAll: function(args) { - return this._selectStreams(args, true); - }, - _selectStreams: function(args, all) { - if (!args || isString(args) || isEmpty(args)) throw 'Invalid arguments.'; - - // if userid is used then both local/remote shouldn't be auto-set - if (isNull(args.local) && isNull(args.remote) && isNull(args.userid)) { - args.local = args.remote = true; - } - - if (!args.isAudio && !args.isVideo && !args.isScreen) { - args.isAudio = args.isVideo = args.isScreen = true; - } - - var selectedStreams = []; - for (var stream in this) { - if (connection._skip.indexOf(stream) == -1 && (stream = this[stream]) && ((args.local && stream.type == 'local') || (args.remote && stream.type == 'remote') || (args.userid && stream.userid == args.userid))) { - if (args.isVideo && stream.isVideo) { - selectedStreams.push(stream); - } - - if (args.isAudio && stream.isAudio) { - selectedStreams.push(stream); - } - - if (args.isScreen && stream.isScreen) { - selectedStreams.push(stream); - } - } - } - - return !!all ? selectedStreams : selectedStreams[0]; - } - }; - - var iceServers = []; - - // CUSTOM CODE // - // these servers are provided by research - iceServers.push({ - url: '' /*TODO To test this WebRTC with some open stun and turn test servers*/ - }); - - iceServers.push({ - url: 'turn:207.140.168.120:3478', - credential: 'xxx', - username: 'xxx' - }); - - iceServers.push({ - url: 'turn:207.140.168.120:443?transport=tcp', - credential: 'harmfulmustard', - username: 'ambient' - }); - - /* CHANGED: Fusion: These are servers for testing purposes - - iceServers.push({ - url: 'stun:stun.l.google.com:19302' - }); - - iceServers.push({ - url: 'stun:stun.anyfirewall.com:3478' - }); - - iceServers.push({ - url: 'turn:turn.bistri.com:80', - credential: 'homeo', - username: 'homeo' - }); - - iceServers.push({ - url: 'turn:turn.anyfirewall.com:443?transport=tcp', - credential: 'webrtc', - username: 'webrtc' - }); - - */ - // CUSTOM CODE // - connection.iceServers = iceServers; - - connection.rtcConfiguration = { - iceServers: null, - iceTransports: 'all', // none || relay || all - ref: http://goo.gl/40I39K - peerIdentity: false - }; - - // www.RTCMultiConnection.org/docs/media/ - connection.media = { - min: function(width, height) { - if (!connection.mediaConstraints.video) return; - - if (!connection.mediaConstraints.video.mandatory) { - connection.mediaConstraints.video.mandatory = {}; - } - connection.mediaConstraints.video.mandatory.minWidth = width; - connection.mediaConstraints.video.mandatory.minHeight = height; - }, - max: function(width, height) { - if (!connection.mediaConstraints.video) return; - - if (!connection.mediaConstraints.video.mandatory) { - connection.mediaConstraints.video.mandatory = {}; - } - - connection.mediaConstraints.video.mandatory.maxWidth = width; - connection.mediaConstraints.video.mandatory.maxHeight = height; - } - }; - - connection._getStream = function(event) { - var resultingObject = merge({ - sockets: event.socket ? [event.socket] : [] - }, event); - - resultingObject.stop = function() { - var self = this; - - self.sockets.forEach(function(socket) { - if (self.type == 'local') { - socket.send({ - streamid: self.streamid, - stopped: true - }); - } - - if (self.type == 'remote') { - socket.send({ - promptStreamStop: true, - streamid: self.streamid - }); - } - }); - - if (self.type == 'remote') return; - - var stream = self.stream; - if (stream) self.rtcMultiConnection.stopMediaStream(stream); - }; - - resultingObject.mute = function(session) { - this.muted = true; - this._private(session, true); - }; - - resultingObject.unmute = function(session) { - this.muted = false; - this._private(session, false); - }; - - function muteOrUnmuteLocally(session, isPause, mediaElement) { - if (!mediaElement) return; - var lastPauseState = mediaElement.onpause; - var lastPlayState = mediaElement.onplay; - mediaElement.onpause = mediaElement.onplay = function() {}; - - if (isPause) mediaElement.pause(); - else mediaElement.play(); - - mediaElement.onpause = lastPauseState; - mediaElement.onplay = lastPlayState; - } - - resultingObject._private = function(session, enabled) { - if (session && !isNull(session.sync) && session.sync == false) { - muteOrUnmuteLocally(session, enabled, this.mediaElement); - return; - } - - muteOrUnmute({ - root: this, - session: session, - enabled: enabled, - stream: this.stream - }); - }; - - resultingObject.startRecording = function(session) { - var self = this; - - if (!session) { - session = { - audio: true, - video: true - }; - } - - if (isString(session)) { - session = { - audio: session == 'audio', - video: session == 'video' - }; - } - - if (!window.RecordRTC) { - return loadScript(self.rtcMultiConnection.resources.RecordRTC, function() { - self.startRecording(session); - }); - } - - log('started recording session', session); - - self.videoRecorder = self.audioRecorder = null; - - if (isFirefox) { - // firefox supports both audio/video recording in single webm file - if (session.video) { - self.videoRecorder = RecordRTC(self.stream, { - type: 'video' - }); - } else if (session.audio) { - self.audioRecorder = RecordRTC(self.stream, { - type: 'audio' - }); - } - } else if (isChrome) { - // chrome supports recording in two separate files: WAV and WebM - if (session.video) { - self.videoRecorder = RecordRTC(self.stream, { - type: 'video' - }); - } - - if (session.audio) { - self.audioRecorder = RecordRTC(self.stream, { - type: 'audio' - }); - } - } - - if (self.audioRecorder) { - self.audioRecorder.startRecording(); - } - - if (self.videoRecorder) self.videoRecorder.startRecording(); - }; - - resultingObject.stopRecording = function(callback, session) { - if (!session) { - session = { - audio: true, - video: true - }; - } - - if (isString(session)) { - session = { - audio: session == 'audio', - video: session == 'video' - }; - } - - log('stopped recording session', session); - - var self = this; - - if (session.audio && self.audioRecorder) { - self.audioRecorder.stopRecording(function() { - if (session.video && self.videoRecorder) { - self.videoRecorder.stopRecording(function() { - callback({ - audio: self.audioRecorder.getBlob(), - video: self.videoRecorder.getBlob() - }); - }); - } else callback({ - audio: self.audioRecorder.getBlob() - }); - }); - } else if (session.video && self.videoRecorder) { - self.videoRecorder.stopRecording(function() { - callback({ - video: self.videoRecorder.getBlob() - }); - }); - } - }; - - resultingObject.takeSnapshot = function(callback) { - takeSnapshot({ - mediaElement: this.mediaElement, - userid: this.userid, - connection: connection, - callback: callback - }); - }; - - // redundant: kept only for backward compatibility - resultingObject.streamObject = resultingObject; - - return resultingObject; - }; - - // new RTCMultiConnection().set({properties}).connect() - connection.set = function(properties) { - for (var property in properties) { - this[property] = properties[property]; - } - return this; - }; - - // www.RTCMultiConnection.org/docs/onMediaError/ - connection.onMediaError = function(event) { - error('name', event.name); - error('constraintName', toStr(event.constraintName)); - error('message', event.message); - error('original session', event.session); - }; - - // www.RTCMultiConnection.org/docs/takeSnapshot/ - connection.takeSnapshot = function(userid, callback) { - takeSnapshot({ - userid: userid, - connection: connection, - callback: callback - }); - }; - - connection.saveToDisk = function(blob, fileName) { - if (blob.size && blob.type) FileSaver.SaveToDisk(URL.createObjectURL(blob), fileName || blob.name || blob.type.replace('/', '-') + blob.type.split('/')[1]); - else FileSaver.SaveToDisk(blob, fileName); - }; - - // www.RTCMultiConnection.org/docs/selectDevices/ - connection.selectDevices = function(device1, device2) { - if (device1) select(this.devices[device1]); - if (device2) select(this.devices[device2]); - - function select(device) { - if (!device) return; - connection._mediaSources[device.kind] = device.id; - } - }; - - // www.RTCMultiConnection.org/docs/getDevices/ - connection.getDevices = function(callback) { - // if, not yet fetched. - if (!DetectRTC.MediaDevices.length) { - return setTimeout(function() { - connection.getDevices(callback); - }, 1000); - } - - // loop over all audio/video input/output devices - DetectRTC.MediaDevices.forEach(function(device) { - connection.devices[device.deviceId] = device; - }); - - if (callback) callback(connection.devices); - }; - - connection.getMediaDevices = connection.enumerateDevices = function(callback) { - if (!callback) throw 'callback is mandatory.'; - connection.getDevices(function() { - callback(connection.DetectRTC.MediaDevices); - }); - }; - - // www.RTCMultiConnection.org/docs/onCustomMessage/ - connection.onCustomMessage = function(message) { - log('Custom message', message); - }; - - // www.RTCMultiConnection.org/docs/ondrop/ - connection.ondrop = function(droppedBy) { - log('Media connection is dropped by ' + droppedBy); - }; - - // www.RTCMultiConnection.org/docs/drop/ - connection.drop = function(config) { - config = config || {}; - connection.attachStreams = []; - - // "drop" should detach all local streams - for (var stream in connection.streams) { - if (connection._skip.indexOf(stream) == -1) { - stream = connection.streams[stream]; - if (stream.type == 'local') { - connection.detachStreams.push(stream.streamid); - onStreamEndedHandler(stream, connection); - } else onStreamEndedHandler(stream, connection); - } - } - - // www.RTCMultiConnection.org/docs/sendCustomMessage/ - connection.sendCustomMessage({ - drop: true, - dontRenegotiate: isNull(config.renegotiate) ? true : config.renegotiate - }); - }; - - // www.RTCMultiConnection.org/docs/Translator/ - connection.Translator = { - TranslateText: function(text, callback) { - // if(location.protocol === 'https:') return callback(text); - - var newScript = document.createElement('script'); - newScript.type = 'text/javascript'; - - var sourceText = encodeURIComponent(text); // escape - - var randomNumber = 'method' + connection.token(); - window[randomNumber] = function(response) { - if (response.data && response.data.translations[0] && callback) { - callback(response.data.translations[0].translatedText); - } - - if (response.error && response.error.message == 'Daily Limit Exceeded') { - warn('Text translation failed. Error message: "Daily Limit Exceeded."'); - - // returning original text - callback(text); - } - }; - - var source = 'https://www.googleapis.com/language/translate/v2?key=' + connection.googKey + '&target=' + (connection.language || 'en-US') + '&callback=window.' + randomNumber + '&q=' + sourceText; - newScript.src = source; - document.getElementsByTagName('head')[0].appendChild(newScript); - } - }; - - // you can easily override it by setting it NULL! - connection.setDefaultEventsForMediaElement = function(mediaElement, streamid) { - mediaElement.onpause = function() { - if (connection.streams[streamid] && !connection.streams[streamid].muted) { - connection.streams[streamid].mute(); - } - }; - - // todo: need to make sure that "onplay" EVENT doesn't play self-voice! - mediaElement.onplay = function() { - if (connection.streams[streamid] && connection.streams[streamid].muted) { - connection.streams[streamid].unmute(); - } - }; - - var volumeChangeEventFired = false; - mediaElement.onvolumechange = function() { - if (!volumeChangeEventFired) { - volumeChangeEventFired = true; - connection.streams[streamid] && setTimeout(function() { - var root = connection.streams[streamid]; - connection.streams[streamid].sockets.forEach(function(socket) { - socket.send({ - streamid: root.streamid, - isVolumeChanged: true, - volume: mediaElement.volume - }); - }); - volumeChangeEventFired = false; - }, 2000); - } - }; - }; - - // www.RTCMultiConnection.org/docs/onMediaFile/ - connection.onMediaFile = function(e) { - log('onMediaFile', e); - connection.body.appendChild(e.mediaElement); - }; - - // www.RTCMultiConnection.org/docs/shareMediaFile/ - // this method handles pre-recorded media streaming - connection.shareMediaFile = function(file, video, streamerid) { - streamerid = streamerid || connection.token(); - - if (!PreRecordedMediaStreamer) { - loadScript(connection.resources.PreRecordedMediaStreamer, function() { - connection.shareMediaFile(file, video, streamerid); - }); - return streamerid; - } - - return PreRecordedMediaStreamer.shareMediaFile({ - file: file, - video: video, - streamerid: streamerid, - connection: connection - }); - }; - - // www.RTCMultiConnection.org/docs/onpartofscreen/ - connection.onpartofscreen = function(e) { - var image = document.createElement('img'); - image.src = e.screenshot; - connection.body.appendChild(image); - }; - - connection.skipLogs = function() { - log = error = warn = function() {}; - }; - - // www.RTCMultiConnection.org/docs/hold/ - connection.hold = function(mLine) { - for (var peer in connection.peers) { - connection.peers[peer].hold(mLine); - } - }; - - // www.RTCMultiConnection.org/docs/onhold/ - connection.onhold = function(track) { - log('onhold', track); - - if (track.kind != 'audio') { - track.mediaElement.pause(); - track.mediaElement.setAttribute('poster', track.screenshot || connection.resources.muted); - } - if (track.kind == 'audio') { - track.mediaElement.muted = true; - } - }; - - // www.RTCMultiConnection.org/docs/unhold/ - connection.unhold = function(mLine) { - for (var peer in connection.peers) { - connection.peers[peer].unhold(mLine); - } - }; - - // www.RTCMultiConnection.org/docs/onunhold/ - connection.onunhold = function(track) { - log('onunhold', track); - - if (track.kind != 'audio') { - track.mediaElement.play(); - track.mediaElement.removeAttribute('poster'); - } - if (track.kind != 'audio') { - track.mediaElement.muted = false; - } - }; - - connection.sharePartOfScreen = function(args) { - var lastScreenshot = ''; - - function partOfScreenCapturer() { - // if stopped - if (connection.partOfScreen && !connection.partOfScreen.sharing) { - return; - } - - capturePartOfScreen({ - element: args.element, - connection: connection, - callback: function(screenshot) { - // don't share repeated content - if (screenshot != lastScreenshot) { - lastScreenshot = screenshot; - - for (var channel in connection.channels) { - connection.channels[channel].send({ - screenshot: screenshot, - isPartOfScreen: true - }); - } - } - - // "once" can be used to share single screenshot - !args.once && setTimeout(partOfScreenCapturer, args.interval || 200); - } - }); - } - - partOfScreenCapturer(); - - connection.partOfScreen = merge({ - sharing: true - }, args); - }; - - connection.pausePartOfScreenSharing = function() { - for (var peer in connection.peers) { - connection.peers[peer].pausePartOfScreenSharing = true; - } - - if (connection.partOfScreen) { - connection.partOfScreen.sharing = false; - } - }; - - connection.resumePartOfScreenSharing = function() { - for (var peer in connection.peers) { - connection.peers[peer].pausePartOfScreenSharing = false; - } - - if (connection.partOfScreen) { - connection.partOfScreen.sharing = true; - } - }; - - connection.stopPartOfScreenSharing = function() { - for (var peer in connection.peers) { - connection.peers[peer].stopPartOfScreenSharing = true; - } - - if (connection.partOfScreen) { - connection.partOfScreen.sharing = false; - } - }; - - connection.takeScreenshot = function(element, callback) { - if (!element || !callback) throw 'Invalid number of arguments.'; - - if (!window.html2canvas) { - return loadScript(connection.resources.html2canvas, function() { - connection.takeScreenshot(element); - }); - } - - if (isString(element)) { - element = document.querySelector(element); - if (!element) element = document.getElementById(element); - } - if (!element) throw 'HTML Element is inaccessible!'; - - // html2canvas.js is used to take screenshots - html2canvas(element, { - onrendered: function(canvas) { - callback(canvas.toDataURL()); - } - }); - }; - - // this event is fired when RTCMultiConnection detects that chrome extension - // for screen capturing is installed and available - connection.onScreenCapturingExtensionAvailable = function() { - log('It seems that screen capturing extension is installed and available on your system!'); - }; - - if (!isPluginRTC && DetectRTC.screen.onScreenCapturingExtensionAvailable) { - DetectRTC.screen.onScreenCapturingExtensionAvailable = function() { - connection.onScreenCapturingExtensionAvailable(); - }; - } - - connection.changeBandwidth = function(bandwidth) { - for (var peer in connection.peers) { - connection.peers[peer].changeBandwidth(bandwidth); - } - }; - - connection.convertToAudioStream = function(mediaStream) { - convertToAudioStream(mediaStream); - }; - - connection.onstatechange = function(state) { - log('on:state:change (' + state.userid + '):', state.name + ':', state.reason || ''); - }; - - connection.onfailed = function(event) { - if (!event.peer.numOfRetries) event.peer.numOfRetries = 0; - event.peer.numOfRetries++; - - error('ICE connectivity check is failed. Renegotiating peer connection.'); - event.peer.numOfRetries < 2 && event.peer.renegotiate(); - - if (event.peer.numOfRetries >= 2) event.peer.numOfRetries = 0; - }; - - connection.onconnected = function(event) { - // event.peer.addStream || event.peer.getConnectionStats - log('Peer connection has been established between you and', event.userid); - }; - - connection.ondisconnected = function(event) { - error('Peer connection seems has been disconnected between you and', event.userid); - - if (isEmpty(connection.channels)) return; - if (!connection.channels[event.userid]) return; - - // use WebRTC data channels to detect user's presence - connection.channels[event.userid].send({ - checkingPresence: true - }); - - // wait 5 seconds, if target peer didn't response, simply disconnect - setTimeout(function() { - // iceConnectionState == 'disconnected' occurred out of low-bandwidth - // or internet connectivity issues - if (connection.peers[event.userid].connected) { - delete connection.peers[event.userid].connected; - return; - } - - // to make sure this user's all remote streams are removed. - connection.streams.remove({ - remote: true, - userid: event.userid - }); - - connection.remove(event.userid); - }, 3000); - }; - - connection.onstreamid = function(event) { - // event.isScreen || event.isVideo || event.isAudio - log('got remote streamid', event.streamid, 'from', event.userid); - }; - - connection.stopMediaStream = function(mediaStream) { - if (!mediaStream) throw 'MediaStream argument is mandatory.'; - - if (connection.keepStreamsOpened) { - if (mediaStream.onended) mediaStream.onended(); - return; - } - - // remove stream from "localStreams" object - // when native-stop method invoked. - if (connection.localStreams[mediaStream.streamid]) { - delete connection.localStreams[mediaStream.streamid]; - } - - if (isFirefox) { - // Firefox don't yet support onended for any stream (remote/local) - if (mediaStream.onended) mediaStream.onended(); - } - - // Latest firefox does support mediaStream.getAudioTrack but doesn't support stop on MediaStreamTrack - var checkForMediaStreamTrackStop = Boolean( - (mediaStream.getAudioTracks || mediaStream.getVideoTracks) && ( - (mediaStream.getAudioTracks()[0] && !mediaStream.getAudioTracks()[0].stop) || - (mediaStream.getVideoTracks()[0] && !mediaStream.getVideoTracks()[0].stop) - ) - ); - - if (!mediaStream.getAudioTracks || checkForMediaStreamTrackStop) { - if (mediaStream.stop) { - mediaStream.stop(); - } - return; - } - - if (mediaStream.getAudioTracks().length && mediaStream.getAudioTracks()[0].stop) { - mediaStream.getAudioTracks().forEach(function(track) { - track.stop(); - }); - } - - if (mediaStream.getVideoTracks().length && mediaStream.getVideoTracks()[0].stop) { - mediaStream.getVideoTracks().forEach(function(track) { - track.stop(); - }); - } - }; - - connection.changeBandwidth = function(bandwidth) { - if (!bandwidth || isString(bandwidth) || isEmpty(bandwidth)) { - throw 'Invalid "bandwidth" arguments.'; - } - - forEach(connection.peers, function(peer) { - peer.peer.bandwidth = bandwidth; - }); - - connection.renegotiate(); - }; - - // www.RTCMultiConnection.org/docs/openSignalingChannel/ - // http://goo.gl/uvoIcZ - - // CUSTOM CODE - var href = window.location.href; - var hostPatt = new RegExp(window.location.host +"/[^/]*"); - var res = hostPatt.exec(href); - var protocol = window.location.protocol.replace("http","ws"); - - var signalingServerPath = protocol + "//" + res + "/webrtc"; - var SIGNALING_SERVER = signalingServerPath; //"ws://localhost:80/quantum/webrtc"; //"wss://localhost:80/quantum/webrtc"; --> ws for http and wss for https - - connection.openSignalingChannel = function(config) { - - - config.channel = config.channel || this.channel; - var websocket = new WebSocket(SIGNALING_SERVER); - websocket.channel = config.channel; - websocket.onopen = function() { - websocket.push(JSON.stringify({ - open: true, - channel: config.channel - })); - if (config.callback) - config.callback(websocket); - }; - websocket.onmessage = function(event) { - config.onmessage(JSON.parse(event.data)); - }; - websocket.push = websocket.send; - websocket.send = function(data) { - websocket.push(JSON.stringify({ - data: data, - channel: config.channel - })); - }; - - /* - // make sure firebase.js is loaded - if (!window.Firebase) { - return loadScript(connection.resources.firebase, function() { - connection.openSignalingChannel(config); - }); - } - - var channel = config.channel || connection.channel; - - if (connection.firebase) { - // for custom firebase instances - connection.resources.firebaseio = connection.resources.firebaseio.replace('//chat.', '//' + connection.firebase + '.'); - } - - var firebase = new Firebase(connection.resources.firebaseio + channel); - firebase.channel = channel; - firebase.on('child_added', function(data) { - config.onmessage(data.val()); - }); - - firebase.send = function(data) { - // a quick dirty workaround to make sure firebase - // shouldn't fail for NULL values. - for (var prop in data) { - if (isNull(data[prop]) || typeof data[prop] == 'function') { - data[prop] = false; - } - } - - this.push(data); - }; - - if (!connection.socket) - connection.socket = firebase; - - firebase.onDisconnect().remove(); - - setTimeout(function() { - config.callback(firebase); - }, 1); - - */ - // CUSTOM CODE // - - }; - - connection.Plugin = Plugin; - } - -})(); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/webrtc/getSourceId.html b/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/webrtc/getSourceId.html deleted file mode 100644 index 6f660025e..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/scripts/webrtc/getSourceId.html +++ /dev/null @@ -1,78 +0,0 @@ - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/att_angular_gridster/sandbox-gridster.css b/ecomp-sdk-app/src/main/webapp/app/fusion/styles/att_angular_gridster/sandbox-gridster.css deleted file mode 100644 index a9edba8ff..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/att_angular_gridster/sandbox-gridster.css +++ /dev/null @@ -1,173 +0,0 @@ -.gridster { - position: relative; - margin: auto; - /* height: 0 - */} - -.gridster>ul { - margin: 0; - list-style: none; - padding: 0 -} - -.gridster-item { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - list-style: none; - z-index: 2; - position: absolute; - display: none -} - -.gridster-loaded { - -webkit-transition: height .3s; - -moz-transition: height .3s; - -o-transition: height .3s; - transition: height .3s -} - -.gridster-loaded .gridster-item { - display: block; - position: absolute; - -webkit-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s; - -moz-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s; - -o-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s; - transition: opacity .3s, left .3s, top .3s, width .3s, height .3s; - -webkit-transition-delay: 50ms; - -moz-transition-delay: 50ms; - -o-transition-delay: 50ms; - transition-delay: 50ms -} - -.gridster-loaded .gridster-preview-holder { - display: none; - z-index: 1; - position: absolute; - background-color: #067ab4; - /* - background-color: rgb(6, 122, 180); - -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#067ab4', endColorstr='#067ab4'); IE - opacity: 0.2; - */ - border-color: #fff; - -webkit-transition: width .2s, height .3s; - -moz-transition: width .2s, height .3s; - -o-transition: width .2s, height .3s; - transition: width .2s, height .3s; - -webkit-transition-delay: 50ms; - -moz-transition-delay: 50ms; - -o-transition-delay: 50ms; - transition-delay: 50ms -} - -.gridster-loaded .gridster-item.gridster-item-moving { - -webkit-transition: none; - -moz-transition: none; - -o-transition: none; - transition: none; - opacity: 0.9; -} - -.gridster-mobile { - height: auto !important -} - -.gridster-mobile .gridster-item { - height: auto; - position: static; - float: none -} - -.gridster-item.ng-leave.ng-leave-active { - opacity: 0 -} - -.gridster-item.ng-enter { - opacity: 1 -} - -.gridster-item-moving { - z-index: 3 -} - -.gridster-item-resizable-handler { - position: absolute; - font-size: 1px; - display: block -} - -.handle-se { - cursor: se-resize; - width: 0; - height: 0; - right: 1px; - bottom: 1px; - border-style: solid; - border-width: 0 0 12px 12px; - border-color: transparent -} - -.handle-ne { - cursor: ne-resize; - width: 12px; - height: 12px; - right: 1px; - top: 1px -} - -.handle-nw { - cursor: nw-resize; - width: 12px; - height: 12px; - left: 1px; - top: 1px -} - -.handle-sw { - cursor: sw-resize; - width: 12px; - height: 12px; - left: 1px; - bottom: 1px -} - -.handle-e { - cursor: e-resize; - width: 12px; - bottom: 0; - right: 1px; - top: 0 -} - -.handle-s { - cursor: s-resize; - height: 12px; - right: 0; - bottom: 1px; - left: 0 -} - -.handle-n { - cursor: n-resize; - height: 12px; - right: 0; - top: 1px; - left: 0 -} - -.handle-w { - cursor: w-resize; - width: 12px; - left: 1px; - top: 0; - bottom: 0 -} - -.gridster .gridster-item:hover .gridster-box { - border: 1.5px solid #B3B2B3 -} - -.gridster .gridster-item:hover .handle-se { - border-color: transparent transparent #ccc -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/att_angular_gridster/ui-gridster.css b/ecomp-sdk-app/src/main/webapp/app/fusion/styles/att_angular_gridster/ui-gridster.css deleted file mode 100644 index 827e354ec..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/att_angular_gridster/ui-gridster.css +++ /dev/null @@ -1,116 +0,0 @@ -/* ui-gridster.css */ -.gridster-container { - background-color: #EFEFEF; - color: #fff; - border: 1px dashed; - overflow-y: auto; - overflow-x: hidden; } - -/* app css for attGridtser */ -.gridster-item-container { - background-color: #FFFFFF; - position: relative; - margin-left: auto; - margin-right: auto; - min-height: 79px; - height: 100%; } - .gridster-item-container .gridster-item-header { - /* gridster-item Header */ - position: relative; - height: 50px !important; - border: 1px solid #d3d3d3; - border-bottom: 0; - background-color: #E5E5E5; - white-space: nowrap; - text-overflow: ellipsis; - z-index: 1; - -webkit-border-radius: 2px 2px 0 0; - -moz-border-radius: 2px 2px 0 0; - -ms-border-radius: 2px 2px 0 0; - -o-border-radius: 2px 2px 0 0; - border-radius: 2px 2px 0 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - /* IE6-8 */ } - .gridster-item-container .gridster-item-header .gridster-item-handle { - cursor: move; - margin: 12px; - position: absolute; - top: 0; - left: 0; - border: 0; - vertical-align: middle; - -ms-interpolation-mode: bicubic; - display: block; } - .gridster-item-container .gridster-item-header .gridster-item-header-content { - line-height: 44px; - margin-left: 26px; - font-family: clearviewatt; - font-size: 18px; - color: #444444; - float: left; } - .gridster-item-container .gridster-item-header .gridster-item-sub-header-content { - position: absolute; - top: 29.5px; - left: 26px; - font-family: clearviewatt; - font-size: 12px; - color: #444444; } - .gridster-item-container .gridster-item-header .gridster-item-header-buttons-container { - position: absolute; - right: 10px; - top: 10px; - overflow: hidden; - text-align: right; - height: 30px; - color: #444444; } - .gridster-item-container .gridster-item-body { - /* gridster-item Body */ - position: absolute; - width: 100%; - top: 50px; - left: 0; - right: 0; - bottom: 29px; - border: 1px solid #d3d3d3; - box-sizing: border-box; - overflow: auto; - color: #444444; - /* text-align: center; */ } - .gridster-item-container .gridster-item-footer { - /* gridster-item Footer */ - position: absolute; - bottom: 0; - width: 100%; - height: 29px !important; - text-align: left; - cursor: pointer; - border: 1px solid #d3d3d3; - border-top: 0; - background-color: #F2F2F2; - -webkit-border-radius: 0 0 2px 2px; - -moz-border-radius: 0 0 2px 2px; - -ms-border-radius: 0 0 2px 2px; - -o-border-radius: 0 0 2px 2px; - border-radius: 0 0 2px 2px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - text-decoration: none; - /* IE6-8 */ } - .gridster-item-container .gridster-item-footer:hover { - background-color: #E5E5E5; - color: #565656; - text-decoration: underline; } - .gridster-item-container .gridster-item-footer .gridster-item-footer-content { - line-height: 30px; - font-family: clearviewatt; - font-size: 12px; - color: #565656; - margin: 20px; - text-decoration: none; } - .gridster-item-container .gridster-item-footer .gridster-item-footer-content:hover { - color: #199ddf; - text-decoration: underline; } diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/fusion-sunny.css b/ecomp-sdk-app/src/main/webapp/app/fusion/styles/fusion-sunny.css deleted file mode 100644 index c83061567..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/fusion-sunny.css +++ /dev/null @@ -1,362 +0,0 @@ - input, textarea, select, div { - font-family: Arial; - font-size: 11px; - font-weight: normal; - } - - form { - margin-top: 5px; - } - - - .applicationWindow { border-width: 0px 0px 1px 0px; - border-style: solid; - border-color: #959595; - box-shadow: inset 0 0 10px #000000; - margin-top: 10px; - margin-bottom: 10px; - margin-left: 10px; - margin-right: 10px; - } - - .feedbackMessage { width: 99%; - font-family: Arial; - font-size: 11px; - color: #1f1f1f; - padding: 3px; - border: 1px #eeb420 solid; - margin: 3px; - background: #fff9e5; - } - - .menubar { - border-width: 0px 0px 0px 1px; border-style: solid; border-color: #959595; - } - - .footer { - /*clear: both;*/ - border-width: 0px 1px 0px 1px; border-style: solid; border-color: #959595; - font-family: Verdana,Arial,Helvetica, sans-serif; - font-size: 9px; - padding: 10px 10px 30px 10px; - background: white; - } - - .pageTitle { - font-family: Arial; - font-size: 18px; - font-weight: bold; - margin-top: 5px; - } - - .content { - border-width: 0px 1px 0px 1px; - border-style: solid; - border-color: #959595; - font-family: Arial; - font-size: 11px; - padding: 5px; - background: white; - /*height: 600px;*/ - } - - .popupContent { - font-family: Arial; - font-size: 11px; - padding: 3px; - } - - .logo { - border-width: 0px 1px 0px 1px; - border-style: solid; - border-color: #959595; - text-align: right; - } - - .sep { - border: 1px solid black - } - - .attLogo { /*position: relative;*/ - float:left; - padding-top: 25px; - padding-left: 25px; - } - - .applicationLogo { float:right; - padding-top: 25px; - padding-right: 25px; - } - - .applinkWhite { font-family: Arial; - font-size: 13px; - font-weight: 900; - color: #FFFFFF; - text-decoration: none; } - - .terms { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 9px; - } - - .broadcastMessage { color: red; } - .broadcastMessageList { color: red; } - - .button { - margin: 5px 1px 5px 1px; - padding: 3px; } - - .toolbarbutton:hover { - color:#005491; - } - - .headerText { font-family: Arial; - font-size: 15px; - font-weight: 700; - color: #000000; } - - .headerBackground { background: #336699; } - - .errorMessageText { font-family: Arial; - font-size: 11px; - font-weight: bold; - color: red; } - - - .normalText { font-family: Arial; - font-size: 11px; - color: #000000; } - - .normalTextRed { font-family: Arial; - font-size: 11px; - color: red; } - - - .smallNormalText { font-family: Arial; - font-size: 9px; - color: #000000; } - - .tableBorder { border:1px outset teal } - - .validationError { background: #b9eaff; } - - .templatebody { - background: url(../images/body_graphic.jpg) repeat-x; - /*margin: 40px 80px 40px 80px;*/ - } - - /*--------------------- General Content ------------------------------------*/ - - .relative { - position:relative; - } - - .clear{ - clear:both; - } - - .left { - float: left; - } - - .leftCentered{ - float: left; - text-align: center; - } - - .right { - float: right; - } - - .rightAligned{ - text-align: right; - } - - .centered { - text-align: center; - align: center; - } - - - .noWrap{ - white-space:nowrap; - } - - .disabled { - color:gray; - cursor:hand; - } - - /*--------------------- Tab styles -------------------------------------*/ - - .current { - font-weight: bold; - border-width: 1px 1px 1px 1px; - border-color: silver; - border-style: solid; - } - - .subTab { - font-weight:bold; - font-family: Arial; - font-size: 11px; - color: #0F3B82; - } - - - /*--------------------- Grid styles ------------------------------------*/ - - /* Grid navigation and header styles */ - .gridFilterLabel {font-size: 7pt; - font-align: justify; - font-weight: bold; - display: block;} - - .gridFilterText {height: 17px; - font-size: 8pt; - width: 60%; - font-align: justify;} - - .gridNavigationBar { font-family:Arial,Verdana; - font-size:11px; - font-weight:normal; - color:#000; - margin: 0px; - width: 100%; - vertical-align: middle; - } - - .gridNavigationBar .navLinks { float: left; - margin-right:15px; - padding-top: 2px; - height: 19px; - line-height: 19px; - } - - .gridNavigationBar .pageControls { float: left; - margin-right: 15px; - height: 19px; - line-height: 19px; - } - - .gridNavigationBar .pageControls input { font-size: 8pt; - height: 17px; - vertical-align: middle; - } - - .gridNavigationBar .pageInfo { float: right; - vertical-align: middle; - height: 19px; - line-height: 19px; - } - - .gridNavigationBar .pageInfo input { font-size: 8pt; - height: 17px; - vertical-align: middle; - } - - - .gridNavigationBar span { padding: 3px; } - - .gridNavigationBar a { - text-decoration:underline; - color:#000; - font-weight:normal; - } - - .gridNavigationBar img { vertical-align: middle; } - - .gridBulkUpdateRow { - height: 35px; - line-height: 35px; - } - - .gridBulkUpdateRow input { - vertical-align: middle; - } - - - /* dummy class used to lock the form elements of a grid - ex. bulk transaction processing */ - .alwaysEnabled {} - - .hidden { - display: none; - } - - .selectedPage { - background-color:#C4DFFB; - color: white; - border-style: solid; - border-width: 1px; - border-color: gray; - padding-left: 3px; - padding-right: 3px; - vertical-align: middle; - } - - .selectedRow{ - /*background-color:#C4DFFB;*/ - } - - /* Action Item styles */ - .actionList { - margin-left: -20px; - margin-right: -10px; - padding-left: 5px; - } - - .actionList li { - float:left; - padding-left: 3px; - padding-right: 3px; - } - - .actionList li a { - text-decoration:none; - color:#000; - } - - /* Filter Operator List styles */ - - .filterList { - margin: 0px; - } - - .filterList li { - list-style-type: none; - padding:3px 3px 3px 2px; - cursor:hand; - font-size:11px; - } - - .filterList li:hover { - background: #404040; - } - - .filterList li a { - color: #000; - text-decoration: none; - } - - .filterList li:hover a { - color: white; - } - - .filterList li a:hover { - text-decoration: none; - color: white; - } - - .filterListItem a { - text-decoration:none; - padding:3px 2px 3px 2px; - } - - - /*---------------------- Customized ZK Styles ------------------------------*/ - - .z-datebox input, .z-timebox input { - font-family: Arial; - font-size: 11px; - height: 15px; - margin-top:1px; - } diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/jquery-ui.css b/ecomp-sdk-app/src/main/webapp/app/fusion/styles/jquery-ui.css deleted file mode 100644 index 1c22746c8..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/jquery-ui.css +++ /dev/null @@ -1,1225 +0,0 @@ -/*! jQuery UI - v1.11.4 - 2015-03-11 -* http://jqueryui.com -* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px -* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { - display: none; -} -.ui-helper-hidden-accessible { - border: 0; - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; -} -.ui-helper-reset { - margin: 0; - padding: 0; - border: 0; - outline: 0; - line-height: 1.3; - text-decoration: none; - font-size: 100%; - list-style: none; -} -.ui-helper-clearfix:before, -.ui-helper-clearfix:after { - content: ""; - display: table; - border-collapse: collapse; -} -.ui-helper-clearfix:after { - clear: both; -} -.ui-helper-clearfix { - min-height: 0; /* support: IE7 */ -} -.ui-helper-zfix { - width: 100%; - height: 100%; - top: 0; - left: 0; - position: absolute; - opacity: 0; - filter:Alpha(Opacity=0); /* support: IE8 */ -} - -.ui-front { - z-index: 100; -} - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { - cursor: default !important; -} - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { - display: block; - text-indent: -99999px; - overflow: hidden; - background-repeat: no-repeat; -} - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; -} -.ui-accordion .ui-accordion-header { - display: block; - cursor: pointer; - position: relative; - margin: 2px 0 0 0; - padding: .5em .5em .5em .7em; - min-height: 0; /* support: IE7 */ - font-size: 100%; -} -.ui-accordion .ui-accordion-icons { - padding-left: 2.2em; -} -.ui-accordion .ui-accordion-icons .ui-accordion-icons { - padding-left: 2.2em; -} -.ui-accordion .ui-accordion-header .ui-accordion-header-icon { - position: absolute; - left: .5em; - top: 50%; - margin-top: -8px; -} -.ui-accordion .ui-accordion-content { - padding: 1em 2.2em; - border-top: 0; - overflow: auto; -} -.ui-autocomplete { - position: absolute; - top: 0; - left: 0; - cursor: default; -} -.ui-button { - display: inline-block; - position: relative; - padding: 0; - line-height: normal; - margin-right: .1em; - cursor: pointer; - vertical-align: middle; - text-align: center; - overflow: visible; /* removes extra width in IE */ -} -.ui-button, -.ui-button:link, -.ui-button:visited, -.ui-button:hover, -.ui-button:active { - text-decoration: none; -} -/* to make room for the icon, a width needs to be set here */ -.ui-button-icon-only { - width: 2.2em; -} -/* button elements seem to need a little more width */ -button.ui-button-icon-only { - width: 2.4em; -} -.ui-button-icons-only { - width: 3.4em; -} -button.ui-button-icons-only { - width: 3.7em; -} - -/* button text element */ -.ui-button .ui-button-text { - display: block; - line-height: normal; -} -.ui-button-text-only .ui-button-text { - padding: .4em 1em; -} -.ui-button-icon-only .ui-button-text, -.ui-button-icons-only .ui-button-text { - padding: .4em; - text-indent: -9999999px; -} -.ui-button-text-icon-primary .ui-button-text, -.ui-button-text-icons .ui-button-text { - padding: .4em 1em .4em 2.1em; -} -.ui-button-text-icon-secondary .ui-button-text, -.ui-button-text-icons .ui-button-text { - padding: .4em 2.1em .4em 1em; -} -.ui-button-text-icons .ui-button-text { - padding-left: 2.1em; - padding-right: 2.1em; -} -/* no icon support for input elements, provide padding by default */ -input.ui-button { - padding: .4em 1em; -} - -/* button icon element(s) */ -.ui-button-icon-only .ui-icon, -.ui-button-text-icon-primary .ui-icon, -.ui-button-text-icon-secondary .ui-icon, -.ui-button-text-icons .ui-icon, -.ui-button-icons-only .ui-icon { - position: absolute; - top: 50%; - margin-top: -8px; -} -.ui-button-icon-only .ui-icon { - left: 50%; - margin-left: -8px; -} -.ui-button-text-icon-primary .ui-button-icon-primary, -.ui-button-text-icons .ui-button-icon-primary, -.ui-button-icons-only .ui-button-icon-primary { - left: .5em; -} -.ui-button-text-icon-secondary .ui-button-icon-secondary, -.ui-button-text-icons .ui-button-icon-secondary, -.ui-button-icons-only .ui-button-icon-secondary { - right: .5em; -} - -/* button sets */ -.ui-buttonset { - margin-right: 7px; -} -.ui-buttonset .ui-button { - margin-left: 0; - margin-right: -.3em; -} - -/* workarounds */ -/* reset extra padding in Firefox, see h5bp.com/l */ -input.ui-button::-moz-focus-inner, -button.ui-button::-moz-focus-inner { - border: 0; - padding: 0; -} -.ui-datepicker { - width: 17em; - padding: .2em .2em 0; - display: none; -} -.ui-datepicker .ui-datepicker-header { - position: relative; - padding: .2em 0; -} -.ui-datepicker .ui-datepicker-prev, -.ui-datepicker .ui-datepicker-next { - position: absolute; - top: 2px; - width: 1.8em; - height: 1.8em; -} -.ui-datepicker .ui-datepicker-prev-hover, -.ui-datepicker .ui-datepicker-next-hover { - top: 1px; -} -.ui-datepicker .ui-datepicker-prev { - left: 2px; -} -.ui-datepicker .ui-datepicker-next { - right: 2px; -} -.ui-datepicker .ui-datepicker-prev-hover { - left: 1px; -} -.ui-datepicker .ui-datepicker-next-hover { - right: 1px; -} -.ui-datepicker .ui-datepicker-prev span, -.ui-datepicker .ui-datepicker-next span { - display: block; - position: absolute; - left: 50%; - margin-left: -8px; - top: 50%; - margin-top: -8px; -} -.ui-datepicker .ui-datepicker-title { - margin: 0 2.3em; - line-height: 1.8em; - text-align: center; -} -.ui-datepicker .ui-datepicker-title select { - font-size: 1em; - margin: 1px 0; -} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { - width: 45%; -} -.ui-datepicker table { - width: 100%; - font-size: .9em; - border-collapse: collapse; - margin: 0 0 .4em; -} -.ui-datepicker th { - padding: .7em .3em; - text-align: center; - font-weight: bold; - border: 0; -} -.ui-datepicker td { - border: 0; - padding: 1px; -} -.ui-datepicker td span, -.ui-datepicker td a { - display: block; - padding: .2em; - text-align: right; - text-decoration: none; -} -.ui-datepicker .ui-datepicker-buttonpane { - background-image: none; - margin: .7em 0 0 0; - padding: 0 .2em; - border-left: 0; - border-right: 0; - border-bottom: 0; -} -.ui-datepicker .ui-datepicker-buttonpane button { - float: right; - margin: .5em .2em .4em; - cursor: pointer; - padding: .2em .6em .3em .6em; - width: auto; - overflow: visible; -} -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { - float: left; -} - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { - width: auto; -} -.ui-datepicker-multi .ui-datepicker-group { - float: left; -} -.ui-datepicker-multi .ui-datepicker-group table { - width: 95%; - margin: 0 auto .4em; -} -.ui-datepicker-multi-2 .ui-datepicker-group { - width: 50%; -} -.ui-datepicker-multi-3 .ui-datepicker-group { - width: 33.3%; -} -.ui-datepicker-multi-4 .ui-datepicker-group { - width: 25%; -} -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { - border-left-width: 0; -} -.ui-datepicker-multi .ui-datepicker-buttonpane { - clear: left; -} -.ui-datepicker-row-break { - clear: both; - width: 100%; - font-size: 0; -} - -/* RTL support */ -.ui-datepicker-rtl { - direction: rtl; -} -.ui-datepicker-rtl .ui-datepicker-prev { - right: 2px; - left: auto; -} -.ui-datepicker-rtl .ui-datepicker-next { - left: 2px; - right: auto; -} -.ui-datepicker-rtl .ui-datepicker-prev:hover { - right: 1px; - left: auto; -} -.ui-datepicker-rtl .ui-datepicker-next:hover { - left: 1px; - right: auto; -} -.ui-datepicker-rtl .ui-datepicker-buttonpane { - clear: right; -} -.ui-datepicker-rtl .ui-datepicker-buttonpane button { - float: left; -} -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, -.ui-datepicker-rtl .ui-datepicker-group { - float: right; -} -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { - border-right-width: 0; - border-left-width: 1px; -} -.ui-dialog { - overflow: hidden; - position: absolute; - top: 0; - left: 0; - padding: .2em; - outline: 0; -} -.ui-dialog .ui-dialog-titlebar { - padding: .4em 1em; - position: relative; -} -.ui-dialog .ui-dialog-title { - float: left; - margin: .1em 0; - white-space: nowrap; - width: 90%; - overflow: hidden; - text-overflow: ellipsis; -} -.ui-dialog .ui-dialog-titlebar-close { - position: absolute; - right: .3em; - top: 50%; - width: 20px; - margin: -10px 0 0 0; - padding: 1px; - height: 20px; -} -.ui-dialog .ui-dialog-content { - position: relative; - border: 0; - padding: .5em 1em; - background: none; - overflow: auto; -} -.ui-dialog .ui-dialog-buttonpane { - text-align: left; - border-width: 1px 0 0 0; - background-image: none; - margin-top: .5em; - padding: .3em 1em .5em .4em; -} -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { - float: right; -} -.ui-dialog .ui-dialog-buttonpane button { - margin: .5em .4em .5em 0; - cursor: pointer; -} -.ui-dialog .ui-resizable-se { - width: 12px; - height: 12px; - right: -5px; - bottom: -5px; - background-position: 16px 16px; -} -.ui-draggable .ui-dialog-titlebar { - cursor: move; -} -.ui-draggable-handle { - -ms-touch-action: none; - touch-action: none; -} -.ui-menu { - list-style: none; - padding: 0; - margin: 0; - display: block; - outline: none; -} -.ui-menu .ui-menu { - position: absolute; -} -.ui-menu .ui-menu-item { - position: relative; - margin: 0; - padding: 3px 1em 3px .4em; - cursor: pointer; - min-height: 0; /* support: IE7 */ - /* support: IE10, see #8844 */ - list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); -} -.ui-menu .ui-menu-divider { - margin: 5px 0; - height: 0; - font-size: 0; - line-height: 0; - border-width: 1px 0 0 0; -} -.ui-menu .ui-state-focus, -.ui-menu .ui-state-active { - margin: -1px; -} - -/* icon support */ -.ui-menu-icons { - position: relative; -} -.ui-menu-icons .ui-menu-item { - padding-left: 2em; -} - -/* left-aligned */ -.ui-menu .ui-icon { - position: absolute; - top: 0; - bottom: 0; - left: .2em; - margin: auto 0; -} - -/* right-aligned */ -.ui-menu .ui-menu-icon { - left: auto; - right: 0; -} -.ui-progressbar { - height: 2em; - text-align: left; - overflow: hidden; -} -.ui-progressbar .ui-progressbar-value { - margin: -1px; - height: 100%; -} -.ui-progressbar .ui-progressbar-overlay { - background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); - height: 100%; - filter: alpha(opacity=25); /* support: IE8 */ - opacity: 0.25; -} -.ui-progressbar-indeterminate .ui-progressbar-value { - background-image: none; -} -.ui-resizable { - position: relative; -} -.ui-resizable-handle { - position: absolute; - font-size: 0.1px; - display: block; - -ms-touch-action: none; - touch-action: none; -} -.ui-resizable-disabled .ui-resizable-handle, -.ui-resizable-autohide .ui-resizable-handle { - display: none; -} -.ui-resizable-n { - cursor: n-resize; - height: 7px; - width: 100%; - top: -5px; - left: 0; -} -.ui-resizable-s { - cursor: s-resize; - height: 7px; - width: 100%; - bottom: -5px; - left: 0; -} -.ui-resizable-e { - cursor: e-resize; - width: 7px; - right: -5px; - top: 0; - height: 100%; -} -.ui-resizable-w { - cursor: w-resize; - width: 7px; - left: -5px; - top: 0; - height: 100%; -} -.ui-resizable-se { - cursor: se-resize; - width: 12px; - height: 12px; - right: 1px; - bottom: 1px; -} -.ui-resizable-sw { - cursor: sw-resize; - width: 9px; - height: 9px; - left: -5px; - bottom: -5px; -} -.ui-resizable-nw { - cursor: nw-resize; - width: 9px; - height: 9px; - left: -5px; - top: -5px; -} -.ui-resizable-ne { - cursor: ne-resize; - width: 9px; - height: 9px; - right: -5px; - top: -5px; -} -.ui-selectable { - -ms-touch-action: none; - touch-action: none; -} -.ui-selectable-helper { - position: absolute; - z-index: 100; - border: 1px dotted black; -} -.ui-selectmenu-menu { - padding: 0; - margin: 0; - position: absolute; - top: 0; - left: 0; - display: none; -} -.ui-selectmenu-menu .ui-menu { - overflow: auto; - /* Support: IE7 */ - overflow-x: hidden; - padding-bottom: 1px; -} -.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { - font-size: 1em; - font-weight: bold; - line-height: 1.5; - padding: 2px 0.4em; - margin: 0.5em 0 0 0; - height: auto; - border: 0; -} -.ui-selectmenu-open { - display: block; -} -.ui-selectmenu-button { - display: inline-block; - overflow: hidden; - position: relative; - text-decoration: none; - cursor: pointer; -} -.ui-selectmenu-button span.ui-icon { - right: 0.5em; - left: auto; - margin-top: -8px; - position: absolute; - top: 50%; -} -.ui-selectmenu-button span.ui-selectmenu-text { - text-align: left; - padding: 0.4em 2.1em 0.4em 1em; - display: block; - line-height: 1.4; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.ui-slider { - position: relative; - text-align: left; -} -.ui-slider .ui-slider-handle { - position: absolute; - z-index: 2; - width: 1.2em; - height: 1.2em; - cursor: default; - -ms-touch-action: none; - touch-action: none; -} -.ui-slider .ui-slider-range { - position: absolute; - z-index: 1; - font-size: .7em; - display: block; - border: 0; - background-position: 0 0; -} - -/* support: IE8 - See #6727 */ -.ui-slider.ui-state-disabled .ui-slider-handle, -.ui-slider.ui-state-disabled .ui-slider-range { - filter: inherit; -} - -.ui-slider-horizontal { - height: .8em; -} -.ui-slider-horizontal .ui-slider-handle { - top: -.3em; - margin-left: -.6em; -} -.ui-slider-horizontal .ui-slider-range { - top: 0; - height: 100%; -} -.ui-slider-horizontal .ui-slider-range-min { - left: 0; -} -.ui-slider-horizontal .ui-slider-range-max { - right: 0; -} - -.ui-slider-vertical { - width: .8em; - height: 100px; -} -.ui-slider-vertical .ui-slider-handle { - left: -.3em; - margin-left: 0; - margin-bottom: -.6em; -} -.ui-slider-vertical .ui-slider-range { - left: 0; - width: 100%; -} -.ui-slider-vertical .ui-slider-range-min { - bottom: 0; -} -.ui-slider-vertical .ui-slider-range-max { - top: 0; -} -.ui-sortable-handle { - -ms-touch-action: none; - touch-action: none; -} -.ui-spinner { - position: relative; - display: inline-block; - overflow: hidden; - padding: 0; - vertical-align: middle; -} -.ui-spinner-input { - border: none; - background: none; - color: inherit; - padding: 0; - margin: .2em 0; - vertical-align: middle; - margin-left: .4em; - margin-right: 22px; -} -.ui-spinner-button { - width: 16px; - height: 50%; - font-size: .5em; - padding: 0; - margin: 0; - text-align: center; - position: absolute; - cursor: default; - display: block; - overflow: hidden; - right: 0; -} -/* more specificity required here to override default borders */ -.ui-spinner a.ui-spinner-button { - border-top: none; - border-bottom: none; - border-right: none; -} -/* vertically center icon */ -.ui-spinner .ui-icon { - position: absolute; - margin-top: -8px; - top: 50%; - left: 0; -} -.ui-spinner-up { - top: 0; -} -.ui-spinner-down { - bottom: 0; -} - -/* TR overrides */ -.ui-spinner .ui-icon-triangle-1-s { - /* need to fix icons sprite */ - background-position: -65px -16px; -} -.ui-tabs { - position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ - padding: .2em; -} -.ui-tabs .ui-tabs-nav { - margin: 0; - padding: .2em .2em 0; -} -.ui-tabs .ui-tabs-nav li { - list-style: none; - float: left; - position: relative; - top: 0; - margin: 1px .2em 0 0; - border-bottom-width: 0; - padding: 0; - white-space: nowrap; -} -.ui-tabs .ui-tabs-nav .ui-tabs-anchor { - float: left; - padding: .5em 1em; - text-decoration: none; -} -.ui-tabs .ui-tabs-nav li.ui-tabs-active { - margin-bottom: -1px; - padding-bottom: 1px; -} -.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, -.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, -.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { - cursor: text; -} -.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { - cursor: pointer; -} -.ui-tabs .ui-tabs-panel { - display: block; - border-width: 0; - padding: 1em 1.4em; - background: none; -} -.ui-tooltip { - padding: 8px; - position: absolute; - z-index: 9999; - max-width: 300px; - -webkit-box-shadow: 0 0 5px #aaa; - box-shadow: 0 0 5px #aaa; -} -body .ui-tooltip { - border-width: 2px; -} - -/* Component containers -----------------------------------*/ -.ui-widget { - font-family: Verdana,Arial,sans-serif; - font-size: 1.1em; -} -.ui-widget .ui-widget { - font-size: 1em; -} -.ui-widget input, -.ui-widget select, -.ui-widget textarea, -.ui-widget button { - font-family: Verdana,Arial,sans-serif; - font-size: 1em; -} -.ui-widget-content { - border: 1px solid #aaaaaa; - background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x; - color: #222222; -} -.ui-widget-content a { - color: #222222; -} -.ui-widget-header { - border: 1px solid #aaaaaa; - background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; - color: #222222; - font-weight: bold; -} -.ui-widget-header a { - color: #222222; -} - -/* Interaction states -----------------------------------*/ -.ui-state-default, -.ui-widget-content .ui-state-default, -.ui-widget-header .ui-state-default { - border: 1px solid #d3d3d3; - background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; - font-weight: normal; - color: #555555; -} -.ui-state-default a, -.ui-state-default a:link, -.ui-state-default a:visited { - color: #555555; - text-decoration: none; -} -.ui-state-hover, -.ui-widget-content .ui-state-hover, -.ui-widget-header .ui-state-hover, -.ui-state-focus, -.ui-widget-content .ui-state-focus, -.ui-widget-header .ui-state-focus { - border: 1px solid #999999; - background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; - font-weight: normal; - color: #212121; -} -.ui-state-hover a, -.ui-state-hover a:hover, -.ui-state-hover a:link, -.ui-state-hover a:visited, -.ui-state-focus a, -.ui-state-focus a:hover, -.ui-state-focus a:link, -.ui-state-focus a:visited { - color: #212121; - text-decoration: none; -} -.ui-state-active, -.ui-widget-content .ui-state-active, -.ui-widget-header .ui-state-active { - border: 1px solid #aaaaaa; - background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; - font-weight: normal; - color: #212121; -} -.ui-state-active a, -.ui-state-active a:link, -.ui-state-active a:visited { - color: #212121; - text-decoration: none; -} - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, -.ui-widget-content .ui-state-highlight, -.ui-widget-header .ui-state-highlight { - border: 1px solid #fcefa1; - background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x; - color: #363636; -} -.ui-state-highlight a, -.ui-widget-content .ui-state-highlight a, -.ui-widget-header .ui-state-highlight a { - color: #363636; -} -.ui-state-error, -.ui-widget-content .ui-state-error, -.ui-widget-header .ui-state-error { - border: 1px solid #cd0a0a; - background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x; - color: #cd0a0a; -} -.ui-state-error a, -.ui-widget-content .ui-state-error a, -.ui-widget-header .ui-state-error a { - color: #cd0a0a; -} -.ui-state-error-text, -.ui-widget-content .ui-state-error-text, -.ui-widget-header .ui-state-error-text { - color: #cd0a0a; -} -.ui-priority-primary, -.ui-widget-content .ui-priority-primary, -.ui-widget-header .ui-priority-primary { - font-weight: bold; -} -.ui-priority-secondary, -.ui-widget-content .ui-priority-secondary, -.ui-widget-header .ui-priority-secondary { - opacity: .7; - filter:Alpha(Opacity=70); /* support: IE8 */ - font-weight: normal; -} -.ui-state-disabled, -.ui-widget-content .ui-state-disabled, -.ui-widget-header .ui-state-disabled { - opacity: .35; - filter:Alpha(Opacity=35); /* support: IE8 */ - background-image: none; -} -.ui-state-disabled .ui-icon { - filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ -} - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { - width: 16px; - height: 16px; -} -.ui-icon, -.ui-widget-content .ui-icon { - background-image: url("images/ui-icons_222222_256x240.png"); -} -.ui-widget-header .ui-icon { - background-image: url("images/ui-icons_222222_256x240.png"); -} -.ui-state-default .ui-icon { - background-image: url("images/ui-icons_888888_256x240.png"); -} -.ui-state-hover .ui-icon, -.ui-state-focus .ui-icon { - background-image: url("images/ui-icons_454545_256x240.png"); -} -.ui-state-active .ui-icon { - background-image: url("images/ui-icons_454545_256x240.png"); -} -.ui-state-highlight .ui-icon { - background-image: url("images/ui-icons_2e83ff_256x240.png"); -} -.ui-state-error .ui-icon, -.ui-state-error-text .ui-icon { - background-image: url("images/ui-icons_cd0a0a_256x240.png"); -} - -/* positioning */ -.ui-icon-blank { background-position: 16px 16px; } -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-on { background-position: -96px -144px; } -.ui-icon-radio-off { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-all, -.ui-corner-top, -.ui-corner-left, -.ui-corner-tl { - border-top-left-radius: 4px; -} -.ui-corner-all, -.ui-corner-top, -.ui-corner-right, -.ui-corner-tr { - border-top-right-radius: 4px; -} -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-left, -.ui-corner-bl { - border-bottom-left-radius: 4px; -} -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-right, -.ui-corner-br { - border-bottom-right-radius: 4px; -} - -/* Overlays */ -.ui-widget-overlay { - background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; - opacity: .3; - filter: Alpha(Opacity=30); /* support: IE8 */ -} -.ui-widget-shadow { - margin: -8px 0 0 -8px; - padding: 8px; - background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; - opacity: .3; - filter: Alpha(Opacity=30); /* support: IE8 */ - border-radius: 8px; -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/layout/layout-default-latest.css b/ecomp-sdk-app/src/main/webapp/app/fusion/styles/layout/layout-default-latest.css deleted file mode 100644 index aa382de3a..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/layout/layout-default-latest.css +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Default Layout Theme - * - * Created for jquery.layout - * - * Copyright (c) 2010 - * Fabrizio Balliano (http://www.fabrizioballiano.net) - * Kevin Dalman (http://allpro.net) - * - * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) - * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. - * - * Last Updated: 2010-02-10 - * NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars - */ - -/* - * DEFAULT FONT - * Just to make demo-pages look better - not actually relevant to Layout! - */ -body { - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 100%; - *font-size: 80%; -} - -/* - * PANES & CONTENT-DIVs - */ -.ui-layout-pane { /* all 'panes' */ - background: #FFF; - border: 1px solid #BBB; - padding: 10px; - overflow: auto; - /* DO NOT add scrolling (or padding) to 'panes' that have a content-div, - otherwise you may get double-scrollbars - on the pane AND on the content-div - - use ui-layout-wrapper class if pane has a content-div - - use ui-layout-container if pane has an inner-layout - */ - } - /* (scrolling) content-div inside pane allows for fixed header(s) and/or footer(s) */ - .ui-layout-content { - padding: 10px; - position: relative; /* contain floated or positioned elements */ - overflow: auto; /* add scrolling to content-div */ - } - -/* - * UTILITY CLASSES - * Must come AFTER pane-class above so will override - * These classes are NOT auto-generated and are NOT used by Layout - */ -.layout-child-container, -.layout-content-container { - padding: 0; - overflow: hidden; -} -.layout-child-container { - border: 0; /* remove border because inner-layout-panes probably have borders */ -} -.layout-scroll { - overflow: auto; -} -.layout-hide { - display: none; -} - -/* - * RESIZER-BARS - */ -.ui-layout-resizer { /* all 'resizer-bars' */ - background: #DDD; - border: 1px solid #BBB; - border-width: 0; - } - .ui-layout-resizer-drag { /* REAL resizer while resize in progress */ - } - .ui-layout-resizer-hover { /* affects both open and closed states */ - } - /* NOTE: It looks best when 'hover' and 'dragging' are set to the same color, - otherwise color shifts while dragging when bar can't keep up with mouse */ - .ui-layout-resizer-open-hover , /* hover-color to 'resize' */ - .ui-layout-resizer-dragging { /* resizer beging 'dragging' */ - background: #C4E1A4; - } - .ui-layout-resizer-dragging { /* CLONED resizer being dragged */ - border: 1px solid #BBB; - } - .ui-layout-resizer-north-dragging, - .ui-layout-resizer-south-dragging { - border-width: 1px 0; - } - .ui-layout-resizer-west-dragging, - .ui-layout-resizer-east-dragging { - border-width: 0 1px; - } - /* NOTE: Add a 'dragging-limit' color to provide visual feedback when resizer hits min/max size limits */ - .ui-layout-resizer-dragging-limit { /* CLONED resizer at min or max size-limit */ - background: #E1A4A4; /* red */ - } - - .ui-layout-resizer-closed-hover { /* hover-color to 'slide open' */ - background: #EBD5AA; - } - .ui-layout-resizer-sliding { /* resizer when pane is 'slid open' */ - opacity: .10; /* show only a slight shadow */ - filter: alpha(opacity=10); - } - .ui-layout-resizer-sliding-hover { /* sliding resizer - hover */ - opacity: 1.00; /* on-hover, show the resizer-bar normally */ - filter: alpha(opacity=100); - } - /* sliding resizer - add 'outside-border' to resizer on-hover - * this sample illustrates how to target specific panes and states */ - .ui-layout-resizer-north-sliding-hover { border-bottom-width: 1px; } - .ui-layout-resizer-south-sliding-hover { border-top-width: 1px; } - .ui-layout-resizer-west-sliding-hover { border-right-width: 1px; } - .ui-layout-resizer-east-sliding-hover { border-left-width: 1px; } - -/* - * TOGGLER-BUTTONS - */ -.ui-layout-toggler { - border: 1px solid #BBB; /* match pane-border */ - background-color: #BBB; - } - .ui-layout-resizer-hover .ui-layout-toggler { - opacity: .60; - filter: alpha(opacity=60); - } - .ui-layout-toggler-hover , /* need when NOT resizable */ - .ui-layout-resizer-hover .ui-layout-toggler-hover { /* need specificity when IS resizable */ - background-color: #FC6; - opacity: 1.00; - filter: alpha(opacity=100); - } - .ui-layout-toggler-north , - .ui-layout-toggler-south { - border-width: 0 1px; /* left/right borders */ - } - .ui-layout-toggler-west , - .ui-layout-toggler-east { - border-width: 1px 0; /* top/bottom borders */ - } - /* hide the toggler-button when the pane is 'slid open' */ - .ui-layout-resizer-sliding .ui-layout-toggler { - display: none; - } - /* - * style the text we put INSIDE the togglers - */ - .ui-layout-toggler .content { - color: #666; - font-size: 12px; - font-weight: bold; - width: 100%; - padding-bottom: 0.35ex; /* to 'vertically center' text inside text-span */ - } - -/* - * PANE-MASKS - * these styles are hard-coded on mask elems, but are also - * included here as !important to ensure will overrides any generic styles - */ -.ui-layout-mask { - border: none !important; - padding: 0 !important; - margin: 0 !important; - overflow: hidden !important; - position: absolute !important; - opacity: 0 !important; - filter: Alpha(Opacity="0") !important; -} -.ui-layout-mask-inside-pane { /* masks always inside pane EXCEPT when pane is an iframe */ - top: 0 !important; - left: 0 !important; - width: 100% !important; - height: 100% !important; -} -div.ui-layout-mask {} /* standard mask for iframes */ -iframe.ui-layout-mask {} /* extra mask for objects/applets */ - -/* - * Default printing styles - */ -@media print { - /* - * Unless you want to print the layout as it appears onscreen, - * these html/body styles are needed to allow the content to 'flow' - */ - html { - height: auto !important; - overflow: visible !important; - } - body.ui-layout-container { - position: static !important; - top: auto !important; - bottom: auto !important; - left: auto !important; - right: auto !important; - /* only IE6 has container width & height set by Layout */ - _width: auto !important; - _height: auto !important; - } - .ui-layout-resizer, .ui-layout-toggler { - display: none !important; - } - /* - * Default pane print styles disables positioning, borders and backgrounds. - * You can modify these styles however it suit your needs. - */ - .ui-layout-pane { - border: none !important; - background: transparent !important; - position: relative !important; - top: auto !important; - bottom: auto !important; - left: auto !important; - right: auto !important; - width: auto !important; - height: auto !important; - overflow: visible !important; - } -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/workflows/workflows.css b/ecomp-sdk-app/src/main/webapp/app/fusion/styles/workflows/workflows.css deleted file mode 100644 index b9d0146c1..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusion/styles/workflows/workflows.css +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -.scrolling-table{ - width: 1200px; -} -.scrolling-table .scroll-viewport { - height: 200px !important; - width: 99.5% !important; - background-color:white; -} - -.scrolling-table .scroll-overview{ - margin-top:-14px !important; -} - -.scrolling-table .scroll-viewport:hover{ - background-color:white; -} - -.scrolling-table #att-scroll-table-content{ - height:200px; - position: absolute !important; - width:700px; - padding-left: 0px; - padding-top: 0px; - padding-bottom: 0px; - padding-right:5px; -} - -.workflow-popup-body{ - position: relative; - padding: 30px; -} diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/drools-list-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/drools-list-controller.js deleted file mode 100644 index 4e6243458..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/drools-list-controller.js +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller("droolsListController", function ($scope,$http,droolsService, modalService, $modal) { - // Table Data - droolsService.getDrools().then(function(data){ - - var j = data; - $scope.tableData = JSON.parse(j.data); - //$scope.resetMenu(); - - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.viewPerPage = 20; - $scope.scrollViewsPerPage = 2; - $scope.currentPage = 1; - $scope.totalPage; - $scope.searchCategory = ""; - $scope.searchString = ""; - /* modalService.showSuccess('','Modal Sample') ; */ - for(x in $scope.tableData){ - if($scope.tableData[x].active_yn=='Y') - $scope.tableData[x].active_yn=true; - else - $scope.tableData[x].active_yn=false; - } - $scope.openDialog = function(droolFile){ - droolsService.setSelectedFile(droolFile); - $modal.open({ - templateUrl: 'app/fusionapp/drools/view-models/droolsView.html', - controller: 'droolsViewController' - - }) - } - - - -}); - -function openInNewTab(url) { - var win = window.open(url, '_blank'); - win.focus(); -}; diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/drools-view-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/drools-view-controller.js deleted file mode 100644 index c475e175b..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/drools-view-controller.js +++ /dev/null @@ -1,64 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('droolsViewController', function ($scope,modalService,droolsService){ - - - $scope.resultsString = ""; - // Table Data - droolsService.getDroolDetails(droolsService.getSelectedFile()).then(function(data){ - - var j = data; - $scope.postDroolsBean = JSON.parse(j.data); - //execute($scope.postDroolsBean); - - },function(error){ - console.log("failed"); - //reloadPageOnce(); - }); - - - - $scope.execute = function(postDroolsBean) { - console.log(postDroolsBean); - var uuu = "post_drools/execute"; - var postData={postDroolsBean:postDroolsBean}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.resultsString=data.resultsString; - console.log($scope.resultsString); - }); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while executing: "+ data.responseText); - } - }); - - }; - - - - }); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/droolsController.js b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/droolsController.js deleted file mode 100644 index f9c0e234f..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/droolsController.js +++ /dev/null @@ -1,30 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.config(function($routeProvider) { - $routeProvider - .when('/view', { - templateUrl: 'app/fusionapp/drools/view-models/droolsView.html', - controller : "droolsViewController" - }) - .otherwise({ - templateUrl: 'app/fusionapp/drools/view-models/droolsList.html', - controller : "droolsListController" - }); -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/controller/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/directives/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/directives/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/services/droolsService.js b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/services/droolsService.js deleted file mode 100644 index d1dbfa6c3..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/services/droolsService.js +++ /dev/null @@ -1,76 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.factory('droolsService', function ($http, $q) { - return { - getDrools: function() { - return $http.get('getDrools') - .then(function(response) { - if (typeof response.data === 'object') { - return response.data; - } else { - return $q.reject(response.data); - } - - }, function(response) { - // something went wrong - return $q.reject(response.data); - }); - }, - - getDroolDetails: function(selectedFile) { - return $http.get('getDroolDetails'+'?selectedFile=' + selectedFile ) - .then(function(response) { - if (typeof response.data === 'object') { - return response.data; - } else { - return $q.reject(response.data); - } - - }, function(response) { - // something went wrong - return $q.reject(response.data); - }); - }, - - getRole: function(roleId) { - - return $http.get('get_role?role_id=' + roleId) - .then(function(response) { - if (typeof response.data === 'object') { - return response.data; - } else { - return $q.reject(response.data); - } - - }, function(response) { - // something went wrong - return $q.reject(response.data); - }); - }, - - getSelectedFile: function() { - return this.selectedFile; - }, - - setSelectedFile: function(_selectedFile) { - this.selectedFile = _selectedFile; - } - }; -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/utils/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/utils/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsList.html b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsList.html deleted file mode 100644 index e1f7f6da1..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsList.html +++ /dev/null @@ -1,47 +0,0 @@ - -
      -
      -

      Drools List

      -
      - - - - - - - - - - - - - - - - - - -
      Drools File NameClass NameRun Rule
      {{rowData.droolsFile}}{{rowData.className}} -
      -
      -
      -
      - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsSinglePage.html b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsSinglePage.html deleted file mode 100644 index 1d4f1bfd2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsSinglePage.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -
      -
      -
      -
      -
      - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsView.html b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsView.html deleted file mode 100644 index dbe9121aa..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/droolsView.html +++ /dev/null @@ -1,61 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/drools/view-models/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/external/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/external/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/fonts/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/fonts/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7450-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7450-icon.png deleted file mode 100644 index 52ab2b54c..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7450-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7450-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7450-text.png deleted file mode 100644 index 9b3c33251..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7450-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7750-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7750-icon.png deleted file mode 100644 index 9ee5499a9..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7750-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7750-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7750-text.png deleted file mode 100644 index aeb2dd002..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/7750-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/apn-dns-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/apn-dns-icon.png deleted file mode 100644 index 0ba5c5235..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/apn-dns-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/apn-dns-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/apn-dns-text.png deleted file mode 100644 index 466311630..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/apn-dns-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atcf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atcf-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atcf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atcf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atcf-text.png deleted file mode 100644 index 1566d5be0..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atcf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atgw-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atgw-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atgw-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atgw-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atgw-text.png deleted file mode 100644 index f7c50c602..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/atgw-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/bgcf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/bgcf-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/bgcf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/bgcf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/bgcf-text.png deleted file mode 100644 index b1e0869ec..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/bgcf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/com-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/com-icon.png deleted file mode 100644 index 59463a917..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/com-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/cpm-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/cpm-icon.png deleted file mode 100644 index 9176a0d20..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/cpm-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/cpm-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/cpm-text.png deleted file mode 100644 index 5b35e77d0..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/cpm-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/default-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/default-icon.png deleted file mode 100644 index 296a6f5c2..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/default-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-epc-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-epc-icon.png deleted file mode 100644 index 74bfcfcec..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-epc-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-epc-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-epc-text.png deleted file mode 100644 index 00f2a2e45..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-epc-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-ims-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-ims-icon.png deleted file mode 100644 index 74bfcfcec..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-ims-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-ims-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-ims-text.png deleted file mode 100644 index 1d54d9aa9..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dra-ims-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dslam-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dslam-icon.png deleted file mode 100644 index b2a0585aa..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dslam-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dslam-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dslam-text.png deleted file mode 100644 index 1452d2e6a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/dslam-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/eatf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/eatf-icon.png deleted file mode 100644 index 59463a917..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/eatf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/eatf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/eatf-text.png deleted file mode 100644 index ba9b216d0..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/eatf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ecscf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ecscf-icon.png deleted file mode 100644 index dafbe9e0a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ecscf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ecscf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ecscf-text.png deleted file mode 100644 index ca98a51d2..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ecscf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/emsc-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/emsc-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/emsc-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enb-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enb-icon.png deleted file mode 100644 index e03be510d..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enb-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enb-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enb-text.png deleted file mode 100644 index 9fbf8c298..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enb-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enum-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enum-icon.png deleted file mode 100644 index daee75ac8..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enum-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enum-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enum-text.png deleted file mode 100644 index f04e3d5c5..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/enum-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/esmlc-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/esmlc-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/esmlc-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/esmlc-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/esmlc-text.png deleted file mode 100644 index 0a29e736f..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/esmlc-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ettcs-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ettcs-icon.png deleted file mode 100644 index 6f15bdbf4..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ettcs-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ettcs-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ettcs-text.png deleted file mode 100644 index 6f15bdbf4..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ettcs-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/gmlc-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/gmlc-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/gmlc-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/gmlc-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/gmlc-text.png deleted file mode 100644 index 43cf74d9b..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/gmlc-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hlr-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hlr-icon.png deleted file mode 100644 index daee75ac8..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hlr-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hlr-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hlr-text.png deleted file mode 100644 index b2762502b..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hlr-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-epc-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-epc-icon.png deleted file mode 100644 index daee75ac8..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-epc-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-epc-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-epc-text.png deleted file mode 100644 index 9739214fb..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-epc-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-ims-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-ims-icon.png deleted file mode 100644 index daee75ac8..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-ims-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-ims-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-ims-text.png deleted file mode 100644 index ec69f2599..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/hss-ims-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/icscf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/icscf-icon.png deleted file mode 100644 index dafbe9e0a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/icscf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/icscf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/icscf-text.png deleted file mode 100644 index 6dbfc819c..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/icscf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ipag-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ipag-icon.png deleted file mode 100644 index 6f15bdbf4..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ipag-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ipag-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ipag-text.png deleted file mode 100644 index 6f15bdbf4..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ipag-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/isbc-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/isbc-icon.png deleted file mode 100644 index dafbe9e0a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/isbc-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/isbc-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/isbc-text.png deleted file mode 100644 index a842e9ffd..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/isbc-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/iwf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/iwf-icon.png deleted file mode 100644 index a82e73c19..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/iwf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/iwf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/iwf-text.png deleted file mode 100644 index 4d0092eb0..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/iwf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrf-rdf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrf-rdf-icon.png deleted file mode 100644 index 82b5c473b..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrf-rdf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrf-rdf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrf-rdf-text.png deleted file mode 100644 index 14daba855..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrf-rdf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrg-rdf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrg-rdf-text.png deleted file mode 100644 index 3f7e2245f..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/lrg-rdf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgc8-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgc8-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgc8-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgc8-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgc8-text.png deleted file mode 100644 index 2ba933a74..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgc8-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgcf-emsc-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgcf-emsc-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgcf-emsc-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgcf-emsc-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgcf-emsc-text.png deleted file mode 100644 index 74bf8f2c6..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgcf-emsc-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgw-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgw-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgw-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgw-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgw-text.png deleted file mode 100644 index a2470f5d1..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mgw-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mind-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mind-icon.png deleted file mode 100644 index daee75ac8..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mind-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mind-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mind-text.png deleted file mode 100644 index 84f9d86d7..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mind-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mme-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mme-icon.png deleted file mode 100644 index 58ab86c59..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mme-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mme-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mme-text.png deleted file mode 100644 index e524f192c..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mme-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mrf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mrf-icon.png deleted file mode 100644 index 59463a917..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mrf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mrf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mrf-text.png deleted file mode 100644 index fa9a61cce..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/mrf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msc-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msc-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msc-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msn-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msn-icon.png deleted file mode 100644 index 8386fcb44..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msn-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msn-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msn-text.png deleted file mode 100644 index 954982f15..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/msn-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/multi-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/multi-icon.png deleted file mode 100644 index 296a6f5c2..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/multi-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7450-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7450-icon.png deleted file mode 100644 index 1ed07db41..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7450-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7450-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7450-text.png deleted file mode 100644 index 9b3c33251..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7450-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750a-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750a-icon.png deleted file mode 100644 index 79ba2fc22..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750a-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750a-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750a-text.png deleted file mode 100644 index afad34de6..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750a-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750b-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750b-icon.png deleted file mode 100644 index bfce0b12d..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750b-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750b-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750b-text.png deleted file mode 100644 index afad34de6..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750b-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750c-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750c-icon.png deleted file mode 100644 index 47870bc53..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750c-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750c-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750c-text.png deleted file mode 100644 index afad34de6..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750c-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750d-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750d-icon.png deleted file mode 100644 index f407a0f6b..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750d-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750d-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750d-text.png deleted file mode 100644 index 6e25a269f..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/n7750d-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/nb-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/nb-icon.png deleted file mode 100644 index e03be510d..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/nb-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/nb-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/nb-text.png deleted file mode 100644 index bbc1357ba..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/nb-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pas-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pas-icon.png deleted file mode 100644 index 74bfcfcec..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pas-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pas-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pas-text.png deleted file mode 100644 index 48b1e273b..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pas-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcef-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcef-icon.png deleted file mode 100644 index 17ed4a4a6..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcef-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcef-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcef-text.png deleted file mode 100644 index 23faa7d7f..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcef-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcrf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcrf-icon.png deleted file mode 100644 index 17ed4a4a6..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcrf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcrf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcrf-text.png deleted file mode 100644 index e48c305e2..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcrf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcscf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcscf-icon.png deleted file mode 100644 index dafbe9e0a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcscf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcscf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcscf-text.png deleted file mode 100644 index b8d2c3dc8..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pcscf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pgw-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pgw-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pgw-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pgw-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pgw-text.png deleted file mode 100644 index d5f86b59a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pgw-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/plrf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/plrf-icon.png deleted file mode 100644 index 82b5c473b..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/plrf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/plrf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/plrf-text.png deleted file mode 100644 index 72662ef42..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/plrf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/psap-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/psap-icon.png deleted file mode 100644 index 2145c5f6a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/psap-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pstn-tdm-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pstn-tdm-icon.png deleted file mode 100644 index 6f15bdbf4..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pstn-tdm-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pstn-tdm-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pstn-tdm-text.png deleted file mode 100644 index 6f15bdbf4..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/pstn-tdm-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rg-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rg-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rg-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rg-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rg-text.png deleted file mode 100644 index ab93224c1..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rg-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rnc-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rnc-icon.png deleted file mode 100644 index 733d3da5d..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rnc-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rnc-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rnc-text.png deleted file mode 100644 index 24cab754a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/rnc-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sbc-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sbc-icon.png deleted file mode 100644 index dafbe9e0a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sbc-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sbc-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sbc-text.png deleted file mode 100644 index f71bfba57..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sbc-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sccas-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sccas-icon.png deleted file mode 100644 index 59463a917..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sccas-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sccas-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sccas-text.png deleted file mode 100644 index 1ca4e1dcf..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sccas-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/scscf-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/scscf-icon.png deleted file mode 100644 index dafbe9e0a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/scscf-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/scscf-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/scscf-text.png deleted file mode 100644 index fd3cab537..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/scscf-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sdg-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sdg-icon.png deleted file mode 100644 index b4c0288b5..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sdg-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sdg-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sdg-text.png deleted file mode 100644 index 3881e6622..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sdg-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgsns4-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgsns4-icon.png deleted file mode 100644 index 8df1aac14..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgsns4-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgsns4-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgsns4-text.png deleted file mode 100644 index 92cbd290a..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgsns4-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgw-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgw-icon.png deleted file mode 100644 index 2904d2770..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgw-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgw-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgw-text.png deleted file mode 100644 index 0801d7974..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/sgw-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/siad-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/siad-icon.png deleted file mode 100644 index b2a0585aa..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/siad-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/siad-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/siad-text.png deleted file mode 100644 index 323c125e6..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/siad-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7-gport-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7-gport-icon.png deleted file mode 100644 index 319bb37c9..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7-gport-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7-gport-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7-gport-text.png deleted file mode 100644 index 1ba8a76d7..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7-gport-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7gport-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7gport-icon.png deleted file mode 100644 index daee75ac8..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7gport-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7gport-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7gport-text.png deleted file mode 100644 index 8656f9f84..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ss7gport-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/switch-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/switch-icon.png deleted file mode 100644 index 6e512719d..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/switch-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/tas-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/tas-icon.png deleted file mode 100644 index 59463a917..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/tas-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/tas-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/tas-text.png deleted file mode 100644 index 7a843e8b8..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/tas-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/transcoder-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/transcoder-icon.png deleted file mode 100644 index b2a0585aa..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/transcoder-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/transcoder-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/transcoder-text.png deleted file mode 100644 index 975dd30b0..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/transcoder-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ue-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ue-icon.png deleted file mode 100644 index e23dfd365..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/ue-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/uephone-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/uephone-icon.png deleted file mode 100644 index 50182db98..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/uephone-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/usp-dns-icon.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/usp-dns-icon.png deleted file mode 100644 index 0ba5c5235..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/usp-dns-icon.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/usp-dns-text.png b/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/usp-dns-text.png deleted file mode 100644 index 46de0c265..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/fusionapp/icons/usp-dns-text.png and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/images/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/images/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sample-page-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sample-page-controller.js deleted file mode 100644 index 0ea98a9c4..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sample-page-controller.js +++ /dev/null @@ -1,80 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('samplePageController', function($scope, $http,ProfileService,modalService){ - $scope.tableData=[]; - $scope.viewPerPage=20; - $scope.scrollViewPerPage=2; - $scope.currentPage=1; - $scope.totalPage; - $scope.searchCategory; - $scope.searchString=""; - $scope.currentPageNum=1; - ProfileService.getProfilePagination(1,$scope.viewPerPage).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.tableData =JSON.parse($scope.data.profileList); - $scope.totalPages =JSON.parse($scope.data.totalPage); - for(x in $scope.tableData){ - if($scope.tableData[x].active_yn=='Y') - $scope.tableData[x].active_yn=true; - else - $scope.tableData[x].active_yn=false; - } - //$scope.resetMenu(); - },function(error){ - console.log("failed"); - reloadPageOnce(); - }); - - $scope.$watch('currentPageNum', function(val) { - - ProfileService.getProfilePagination(val,$scope.viewPerPage).then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.tableData =JSON.parse($scope.data.profileList); - $scope.totalPages =JSON.parse($scope.data.totalPage); - for(x in $scope.tableData){ - if($scope.tableData[x].active_yn=='Y') - $scope.tableData[x].active_yn=true; - else - $scope.tableData[x].active_yn=false; - } - //$scope.resetMenu(); - },function(error){ - console.log("failed"); - }); - - }); - - $scope.editRow = function(profileId){ - window.location = 'userProfile#/profile/' + profileId; - } - - $scope.toggleProfileActive = function(rowData) { - modalService.popupConfirmWinWithCancel("Confirm","You are about to change user's active status. Do you want to continue?", - function(){ - $http.get("profile/toggleProfileActive?profile_id="+rowData.id).success(function(){}); - }, - function(){ - rowData.active=!rowData.active; - }) - }; - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sample-page-iframe-controller.js b/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sample-page-iframe-controller.js deleted file mode 100644 index 4ff99cb42..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sample-page-iframe-controller.js +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.controller('samplePageWithIframeController', function($scope, $http,ProfileService,modalService){ - - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sampleController.js b/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sampleController.js deleted file mode 100644 index 3d3daf5fd..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/controller/sampleController.js +++ /dev/null @@ -1,30 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T 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. - * ================================================================================ - */ -app.config(function($routeProvider) { - $routeProvider - .when('/iframe', { - templateUrl: 'app/fusionapp/scripts/view-models/sampleWithIframe.html', - controller : "samplePageWithIframeController" - }) - .otherwise({ - templateUrl: 'app/fusionapp/scripts/view-models/sample.html', - controller : "samplePageController" - }); -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/directives/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/directives/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/utils/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/utils/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/sample.html b/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/sample.html deleted file mode 100644 index 5b555aa47..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/sample.html +++ /dev/null @@ -1,60 +0,0 @@ - -
      - -

      Profile Search

      - - - - - - - - - - - - - - - - - - - - - - - -
      User IDLast NameFirst NameEmailUser IDManager User ID
      - -
      - Rows Per Page: - -
      -
      - Current Page: - -
      -
      - Total Page(s): - -
      -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/sampleWithIframe.html b/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/sampleWithIframe.html deleted file mode 100644 index 612e6a8c4..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/sampleWithIframe.html +++ /dev/null @@ -1,22 +0,0 @@ - -
      - -
      diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/singlePageSample.html b/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/singlePageSample.html deleted file mode 100644 index 7bded9d61..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/fusionapp/scripts/view-models/singlePageSample.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -
      -
      -
      -
      -
      - - diff --git a/ecomp-sdk-app/src/main/webapp/app/fusionapp/styles/dummy.txt b/ecomp-sdk-app/src/main/webapp/app/fusionapp/styles/dummy.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-csp.css b/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-csp.css deleted file mode 100644 index 7d724742d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-csp.css +++ /dev/null @@ -1,22 +0,0 @@ -/* Include this file in your html if you are using the CSP mode. */ - -[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], -.ng-cloak, .x-ng-cloak, -.ng-hide { - display: none !important; -} - -ng\:form { - display: block; -} - -.ng-animate-block-transitions { - transition:0s all!important; - -webkit-transition:0s all!important; -} - -/* show the element during a show/hide animation when the - * animation is ongoing, but the .ng-hide class is active */ -.ng-hide-add-active, .ng-hide-remove { - display: block!important; -} diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-ui-notification.min.css b/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-ui-notification.min.css deleted file mode 100644 index 5417bb40c..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-ui-notification.min.css +++ /dev/null @@ -1 +0,0 @@ -.ui-notification{position:fixed;z-index:9999;top:-100px;right:10px;width:300px;cursor:pointer;-webkit-transition:all ease .5s;-o-transition:all ease .5s;transition:all ease .5s;color:#fff;background:#428bca;box-shadow:5px 5px 10px rgba(0,0,0,.3)}.ui-notification.killed{-webkit-transition:opacity ease 1s;-o-transition:opacity ease 1s;transition:opacity ease 1s;opacity:0}.ui-notification>h3{font-size:14px;font-weight:700;display:block;margin:10px 10px 0;padding:0 0 5px;text-align:left;border-bottom:1px solid rgba(255,255,255,.3)}.ui-notification a{color:#fff}.ui-notification a:hover{text-decoration:underline}.ui-notification>.message{margin:10px}.ui-notification.warning{color:#fff;background:#f0ad4e}.ui-notification.error{color:#fff;background:#d9534f}.ui-notification.success{color:#fff;background:#5cb85c}.ui-notification.info{color:#fff;background:#5bc0de}.ui-notification:hover{opacity:.7} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-ui-notification.min.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-ui-notification.min.js deleted file mode 100644 index e9bcb4ccd..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/Notification/angular-ui-notification.min.js +++ /dev/null @@ -1 +0,0 @@ -angular.module("ui-notification",[]),angular.module("ui-notification").value("uiNotificationTemplates","angular-ui-notification.html"),angular.module("ui-notification").factory("Notification",["$timeout","uiNotificationTemplates","$http","$compile","$templateCache","$rootScope","$injector","$sce",function(t,e,i,n,a,o,s,c){var r=10,l=10,u=10,p=10,d=5e3,f=[],m=function(s,m){"object"!=typeof s&&(s={message:s}),s.template=s.template?s.template:e,s.delay=angular.isUndefined(s.delay)?d:s.delay,s.type=m?m:"",i.get(s.template,{cache:a}).success(function(e){var i=o.$new();if(i.message=c.trustAsHtml(s.message),i.title=c.trustAsHtml(s.title),i.t=s.type.substr(0,1),i.delay=s.delay,"object"==typeof s.scope)for(var a in s.scope)i[a]=s.scope[a];var d=function(){for(var t=0,e=0,i=r,n=f.length-1;n>=0;n--){var a=f[n],o=parseInt(a[0].offsetHeight),s=parseInt(a[0].offsetWidth);c+o>window.innerHeight&&(i=r,e++,t=0);var c=i+(0===t?0:u),d=l+e*(p+s);a.css("top",c+"px"),a.css("right",d+"px"),i=c+o,t++}},m=n(e)(i);m.addClass(s.type),m.bind("webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd click",function(t){("click"===t.type||"opacity"===t.propertyName&&t.elapsedTime>=1)&&(m.remove(),f.splice(f.indexOf(m),1),d())}),t(function(){m.addClass("killed")},s.delay),angular.element(document.getElementsByTagName("body")).append(m),f.push(m),t(d)}).error(function(t){throw new Error("Template ("+s.template+") could not be loaded. "+t)})};return m.config=function(t){r=t.top?t.top:r,u=t.verticalSpacing?t.verticalSpacing:u},m.primary=function(){this(args,"")},m.error=function(t){this(t,"error")},m.success=function(t){this(t,"success")},m.info=function(t){this(t,"info")},m.warning=function(t){this(t,"warning")},m}]),angular.module("ui-notification").run(["$templateCache",function(t){t.put("angular-ui-notification.html",'

      ')}]); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/bootstrap.min.css b/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/bootstrap.min.css deleted file mode 100644 index cd1c616ad..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/bootstrap.min.css +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Bootstrap v3.3.4 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px \9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.form-group-sm .form-control{height:30px;line-height:30px}select[multiple].form-group-sm .form-control,textarea.form-group-sm .form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:5px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.form-group-lg .form-control{height:46px;line-height:46px}select[multiple].form-group-lg .form-control,textarea.form-group-lg .form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:10px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.33px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.active,.btn-default.focus,.btn-default:active,.btn-default:focus,.btn-default:hover,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.active,.btn-primary.focus,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.active,.btn-success.focus,.btn-success:active,.btn-success:focus,.btn-success:hover,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.active,.btn-info.focus,.btn-info:active,.btn-info:focus,.btn-info:hover,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.active,.btn-warning.focus,.btn-warning:active,.btn-warning:focus,.btn-warning:hover,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.active,.btn-danger.focus,.btn-danger:active,.btn-danger:focus,.btn-danger:hover,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px)and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:2;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px 15px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding:48px 0}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:400;line-height:1.4;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:400;line-height:1.42857143;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;perspective:1000}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;margin-top:-10px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px)and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px)and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px)and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px)and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px)and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px)and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px)and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px)and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px)and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px)and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/bootstrap.min.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/bootstrap.min.js deleted file mode 100644 index 133aeecb9..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v3.3.5 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under the MIT license - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
      ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/select.css b/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/select.css deleted file mode 100644 index b07b4f8a2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/select.css +++ /dev/null @@ -1,287 +0,0 @@ -@CHARSET "ISO-8859-1"; -/*! - * ui-select - * http://github.com/angular-ui/ui-select - * Version: 0.11.2 - 2015-03-17T04:08:46.478Z - * License: MIT - */ - - -/* Style when highlighting a search. */ -.ui-select-highlight { - font-weight: bold; -} - -.ui-select-offscreen { - clip: rect(0 0 0 0) !important; - width: 1px !important; - height: 1px !important; - border: 0 !important; - margin: 0 !important; - padding: 0 !important; - overflow: hidden !important; - position: absolute !important; - outline: 0 !important; - left: 0px !important; - top: 0px !important; -} - -/* Select2 theme */ - -/* Mark invalid Select2 */ -.ng-dirty.ng-invalid > a.select2-choice { - border-color: #D44950; -} - -.select2-result-single { - padding-left: 0; -} - -.select2-locked > .select2-search-choice-close{ - display:none; -} - -.select-locked > .ui-select-match-close{ - display:none; -} - -body > .select2-container.open { - z-index: 9999; /* The z-index Select2 applies to the select2-drop */ -} - -/* Selectize theme */ - -/* Helper class to show styles when focus */ -.selectize-input.selectize-focus{ - border-color: #007FBB !important; -} - -/* Fix input width for Selectize theme */ -.selectize-control > .selectize-input > input { - width: 100%; -} - -/* Fix dropdown width for Selectize theme */ -.selectize-control > .selectize-dropdown { - width: 100%; -} - -/* Mark invalid Selectize */ -.ng-dirty.ng-invalid > div.selectize-input { - border-color: #D44950; -} - - -/* Bootstrap theme */ - -/* Helper class to show styles when focus */ -.btn-default-focus { - color: #333; - background-color: #EBEBEB; - border-color: #ADADAD; - text-decoration: none; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); -} - -.ui-select-bootstrap .ui-select-toggle { - position: relative; -} - -.ui-select-bootstrap .ui-select-toggle > .caret { - position: absolute; - height: 10px; - top: 50%; - right: 10px; - margin-top: -2px; -} - -/* Fix Bootstrap dropdown position when inside a input-group */ -.input-group > .ui-select-bootstrap.dropdown { - /* Instead of relative */ - position: static; -} - -.input-group > .ui-select-bootstrap > input.ui-select-search.form-control { - border-radius: 4px; /* FIXME hardcoded value :-/ */ - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} - -.ui-select-bootstrap > .ui-select-match > .btn{ - /* Instead of center because of .btn */ - text-align: left !important; -} - -.ui-select-bootstrap > .ui-select-match > .caret { - position: absolute; - top: 45%; - right: 15px; -} - -/* See Scrollable Menu with Bootstrap 3 http://stackoverflow.com/questions/19227496 */ -.ui-select-bootstrap > .ui-select-choices { - width: 100%; - height: auto; - max-height: 200px; - overflow-x: hidden; - margin-top: -1px; -} - -body > .ui-select-bootstrap.open { - z-index: 1000; /* Standard Bootstrap dropdown z-index */ -} - -.ui-select-multiple.ui-select-bootstrap { - height: auto; - padding: 3px 3px 0 3px; -} - -.ui-select-multiple.ui-select-bootstrap input.ui-select-search { - background-color: transparent !important; /* To prevent double background when disabled */ - border: none; - outline: none; - height: 1.666666em; - margin-bottom: 3px; -} - -.ui-select-multiple.ui-select-bootstrap .ui-select-match .close { - font-size: 1.6em; - line-height: 0.75; -} - -.ui-select-multiple.ui-select-bootstrap .ui-select-match-item { - outline: 0; - margin: 0 3px 3px 0; -} - -.ui-select-multiple .ui-select-match-item { - position: relative; -} - -.ui-select-multiple .ui-select-match-item.dropping-before:before { - content: ""; - position: absolute; - top: 0; - right: 100%; - height: 100%; - margin-right: 2px; - border-left: 1px solid #428bca; -} - -.ui-select-multiple .ui-select-match-item.dropping-after:after { - content: ""; - position: absolute; - top: 0; - left: 100%; - height: 100%; - margin-left: 2px; - border-right: 1px solid #428bca; -} - -.ui-select-bootstrap .ui-select-choices-row>a { - display: block; - padding: 3px 20px; - clear: both; - font-weight: 400; - line-height: 1.42857143; - color: #333; - white-space: nowrap; -} - -.ui-select-bootstrap .ui-select-choices-row>a:hover, .ui-select-bootstrap .ui-select-choices-row>a:focus { - text-decoration: none; - color: #262626; - background-color: #f5f5f5; -} - -.ui-select-bootstrap .ui-select-choices-row.active>a { - color: #fff; - text-decoration: none; - outline: 0; - background-color: #428bca; -} - -.ui-select-bootstrap .ui-select-choices-row.disabled>a, -.ui-select-bootstrap .ui-select-choices-row.active.disabled>a { - color: #777; - cursor: not-allowed; - background-color: #fff; -} - -/* fix hide/show angular animation */ -.ui-select-match.ng-hide-add, -.ui-select-search.ng-hide-add { - display: none !important; -} - -/* Mark invalid Bootstrap */ -.ui-select-bootstrap.ng-dirty.ng-invalid > button.btn.ui-select-match { - border-color: #D44950; -} - -.icon-lock { - width: 48px; - height: 48px; - position: relative; - overflow: hidden; - margin-left: 25px; - margin-bottom: 25px; -} - -.icon-lock .lock-top-1 { - width: 40%; - height: 40%; - position: absolute; - left: 50%; - margin-left: -20%; - top: 14%; - background-color: #000; - border-radius: 40%; -} - -.icon-lock .lock-top-2 { - width: 24%; - height: 40%; - position: absolute; - left: 50%; - margin-left: -12%; - top: 22%; - background-color: #151517; - border-radius: 25%; -} - -.icon-lock .lock-body { - width: 60%; - height: 48%; - position: absolute; - left: 50%; - margin-left: -30%; - bottom: 11%; - background-color: #000; - border-radius: 15%; -} - -.icon-lock .lock-hole { - width: 16%; - height: 16%; - position: absolute; - left: 50%; - margin-left: -8%; - top: 51%; - border-radius: 100%; - background-color: #151517; -} - -.icon-lock .lock-hole:after { - content: ""; - width: 43%; - height: 78%; - position: absolute; - left: 50%; - margin-left: -20%; - top: 100%; - background-color: inherit; -} - \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/select.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/select.js deleted file mode 100644 index e83214358..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/select.js +++ /dev/null @@ -1,1748 +0,0 @@ -/*! - * ui-select - * http://github.com/angular-ui/ui-select - * Version: 0.11.2 - 2015-03-17T04:08:46.474Z - * License: MIT - */ - - -(function () { -"use strict"; - -var KEY = { - TAB: 9, - ENTER: 13, - ESC: 27, - SPACE: 32, - LEFT: 37, - UP: 38, - RIGHT: 39, - DOWN: 40, - SHIFT: 16, - CTRL: 17, - ALT: 18, - PAGE_UP: 33, - PAGE_DOWN: 34, - HOME: 36, - END: 35, - BACKSPACE: 8, - DELETE: 46, - COMMAND: 91, - - MAP: { 91 : "COMMAND", 8 : "BACKSPACE" , 9 : "TAB" , 13 : "ENTER" , 16 : "SHIFT" , 17 : "CTRL" , 18 : "ALT" , 19 : "PAUSEBREAK" , 20 : "CAPSLOCK" , 27 : "ESC" , 32 : "SPACE" , 33 : "PAGE_UP", 34 : "PAGE_DOWN" , 35 : "END" , 36 : "HOME" , 37 : "LEFT" , 38 : "UP" , 39 : "RIGHT" , 40 : "DOWN" , 43 : "+" , 44 : "PRINTSCREEN" , 45 : "INSERT" , 46 : "DELETE", 48 : "0" , 49 : "1" , 50 : "2" , 51 : "3" , 52 : "4" , 53 : "5" , 54 : "6" , 55 : "7" , 56 : "8" , 57 : "9" , 59 : ";", 61 : "=" , 65 : "A" , 66 : "B" , 67 : "C" , 68 : "D" , 69 : "E" , 70 : "F" , 71 : "G" , 72 : "H" , 73 : "I" , 74 : "J" , 75 : "K" , 76 : "L", 77 : "M" , 78 : "N" , 79 : "O" , 80 : "P" , 81 : "Q" , 82 : "R" , 83 : "S" , 84 : "T" , 85 : "U" , 86 : "V" , 87 : "W" , 88 : "X" , 89 : "Y" , 90 : "Z", 96 : "0" , 97 : "1" , 98 : "2" , 99 : "3" , 100 : "4" , 101 : "5" , 102 : "6" , 103 : "7" , 104 : "8" , 105 : "9", 106 : "*" , 107 : "+" , 109 : "-" , 110 : "." , 111 : "/", 112 : "F1" , 113 : "F2" , 114 : "F3" , 115 : "F4" , 116 : "F5" , 117 : "F6" , 118 : "F7" , 119 : "F8" , 120 : "F9" , 121 : "F10" , 122 : "F11" , 123 : "F12", 144 : "NUMLOCK" , 145 : "SCROLLLOCK" , 186 : ";" , 187 : "=" , 188 : "," , 189 : "-" , 190 : "." , 191 : "/" , 192 : "`" , 219 : "[" , 220 : "\\" , 221 : "]" , 222 : "'" - }, - - isControl: function (e) { - var k = e.which; - switch (k) { - case KEY.COMMAND: - case KEY.SHIFT: - case KEY.CTRL: - case KEY.ALT: - return true; - } - - if (e.metaKey) return true; - - return false; - }, - isFunctionKey: function (k) { - k = k.which ? k.which : k; - return k >= 112 && k <= 123; - }, - isVerticalMovement: function (k){ - return ~[KEY.UP, KEY.DOWN].indexOf(k); - }, - isHorizontalMovement: function (k){ - return ~[KEY.LEFT,KEY.RIGHT,KEY.BACKSPACE,KEY.DELETE].indexOf(k); - } - }; - -/** - * Add querySelectorAll() to jqLite. - * - * jqLite find() is limited to lookups by tag name. - * TODO This will change with future versions of AngularJS, to be removed when this happens - * - * See jqLite.find - why not use querySelectorAll? https://github.com/angular/angular.js/issues/3586 - * See feat(jqLite): use querySelectorAll instead of getElementsByTagName in jqLite.find https://github.com/angular/angular.js/pull/3598 - */ -if (angular.element.prototype.querySelectorAll === undefined) { - angular.element.prototype.querySelectorAll = function(selector) { - return angular.element(this[0].querySelectorAll(selector)); - }; -} - -/** - * Add closest() to jqLite. - */ -if (angular.element.prototype.closest === undefined) { - angular.element.prototype.closest = function( selector) { - var elem = this[0]; - var matchesSelector = elem.matches || elem.webkitMatchesSelector || elem.mozMatchesSelector || elem.msMatchesSelector; - - while (elem) { - if (matchesSelector.bind(elem)(selector)) { - return elem; - } else { - elem = elem.parentElement; - } - } - return false; - }; -} - -var latestId = 0; - -var uis = angular.module('ui.select', []) - -.constant('uiSelectConfig', { - theme: 'bootstrap', - searchEnabled: true, - sortable: false, - placeholder: '', // Empty by default, like HTML tag "); - $compile(focusser)(scope); - $select.focusser = focusser; - - //Input that will handle focus - $select.focusInput = focusser; - - element.parent().append(focusser); - focusser.bind("focus", function(){ - scope.$evalAsync(function(){ - $select.focus = true; - }); - }); - focusser.bind("blur", function(){ - scope.$evalAsync(function(){ - $select.focus = false; - }); - }); - focusser.bind("keydown", function(e){ - - if (e.which === KEY.BACKSPACE) { - e.preventDefault(); - e.stopPropagation(); - $select.select(undefined); - scope.$apply(); - return; - } - - if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) { - return; - } - - if (e.which == KEY.DOWN || e.which == KEY.UP || e.which == KEY.ENTER || e.which == KEY.SPACE){ - e.preventDefault(); - e.stopPropagation(); - $select.activate(); - } - - scope.$digest(); - }); - - focusser.bind("keyup input", function(e){ - - if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC || e.which == KEY.ENTER || e.which === KEY.BACKSPACE) { - return; - } - - $select.activate(focusser.val()); //User pressed some regular key, so we pass it to the search input - focusser.val(''); - scope.$digest(); - - }); - - - } - }; -}]); -// Make multiple matches sortable -uis.directive('uiSelectSort', ['$timeout', 'uiSelectConfig', 'uiSelectMinErr', function($timeout, uiSelectConfig, uiSelectMinErr) { - return { - require: '^uiSelect', - link: function(scope, element, attrs, $select) { - if (scope[attrs.uiSelectSort] === null) { - throw uiSelectMinErr('sort', "Expected a list to sort"); - } - - var options = angular.extend({ - axis: 'horizontal' - }, - scope.$eval(attrs.uiSelectSortOptions)); - - var axis = options.axis, - draggingClassName = 'dragging', - droppingClassName = 'dropping', - droppingBeforeClassName = 'dropping-before', - droppingAfterClassName = 'dropping-after'; - - scope.$watch(function(){ - return $select.sortable; - }, function(n){ - if (n) { - element.attr('draggable', true); - } else { - element.removeAttr('draggable'); - } - }); - - element.on('dragstart', function(e) { - element.addClass(draggingClassName); - - (e.dataTransfer || e.originalEvent.dataTransfer).setData('text/plain', scope.$index); - }); - - element.on('dragend', function() { - element.removeClass(draggingClassName); - }); - - var move = function(from, to) { - /*jshint validthis: true */ - this.splice(to, 0, this.splice(from, 1)[0]); - }; - - var dragOverHandler = function(e) { - e.preventDefault(); - - var offset = axis === 'vertical' ? e.offsetY || e.layerY || (e.originalEvent ? e.originalEvent.offsetY : 0) : e.offsetX || e.layerX || (e.originalEvent ? e.originalEvent.offsetX : 0); - - if (offset < (this[axis === 'vertical' ? 'offsetHeight' : 'offsetWidth'] / 2)) { - element.removeClass(droppingAfterClassName); - element.addClass(droppingBeforeClassName); - - } else { - element.removeClass(droppingBeforeClassName); - element.addClass(droppingAfterClassName); - } - }; - - var dropTimeout; - - var dropHandler = function(e) { - e.preventDefault(); - - var droppedItemIndex = parseInt((e.dataTransfer || e.originalEvent.dataTransfer).getData('text/plain'), 10); - - // prevent event firing multiple times in firefox - $timeout.cancel(dropTimeout); - dropTimeout = $timeout(function() { - _dropHandler(droppedItemIndex); - }, 20); - }; - - var _dropHandler = function(droppedItemIndex) { - var theList = scope.$eval(attrs.uiSelectSort), - itemToMove = theList[droppedItemIndex], - newIndex = null; - - if (element.hasClass(droppingBeforeClassName)) { - if (droppedItemIndex < scope.$index) { - newIndex = scope.$index - 1; - } else { - newIndex = scope.$index; - } - } else { - if (droppedItemIndex < scope.$index) { - newIndex = scope.$index; - } else { - newIndex = scope.$index + 1; - } - } - - move.apply(theList, [droppedItemIndex, newIndex]); - - scope.$apply(function() { - scope.$emit('uiSelectSort:change', { - array: theList, - item: itemToMove, - from: droppedItemIndex, - to: newIndex - }); - }); - - element.removeClass(droppingClassName); - element.removeClass(droppingBeforeClassName); - element.removeClass(droppingAfterClassName); - - element.off('drop', dropHandler); - }; - - element.on('dragenter', function() { - if (element.hasClass(draggingClassName)) { - return; - } - - element.addClass(droppingClassName); - - element.on('dragover', dragOverHandler); - element.on('drop', dropHandler); - }); - - element.on('dragleave', function(e) { - if (e.target != element) { - return; - } - element.removeClass(droppingClassName); - element.removeClass(droppingBeforeClassName); - element.removeClass(droppingAfterClassName); - - element.off('dragover', dragOverHandler); - element.off('drop', dropHandler); - }); - } - }; -}]); - -/** - * Parses "repeat" attribute. - * - * Taken from AngularJS ngRepeat source code - * See https://github.com/angular/angular.js/blob/v1.2.15/src/ng/directive/ngRepeat.js#L211 - * - * Original discussion about parsing "repeat" attribute instead of fully relying on ng-repeat: - * https://github.com/angular-ui/ui-select/commit/5dd63ad#commitcomment-5504697 - */ - -uis.service('uisRepeatParser', ['uiSelectMinErr','$parse', function(uiSelectMinErr, $parse) { - var self = this; - - /** - * Example: - * expression = "address in addresses | filter: {street: $select.search} track by $index" - * itemName = "address", - * source = "addresses | filter: {street: $select.search}", - * trackByExp = "$index", - */ - self.parse = function(expression) { - - var match = expression.match(/^\s*(?:([\s\S]+?)\s+as\s+)?([\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/); - - if (!match) { - throw uiSelectMinErr('iexp', "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.", - expression); - } - - return { - itemName: match[2], // (lhs) Left-hand side, - source: $parse(match[3]), - trackByExp: match[4], - modelMapper: $parse(match[1] || match[2]) - }; - - }; - - self.getGroupNgRepeatExpression = function() { - return '$group in $select.groups'; - }; - - self.getNgRepeatExpression = function(itemName, source, trackByExp, grouped) { - var expression = itemName + ' in ' + (grouped ? '$group.items' : source); - if (trackByExp) { - expression += ' track by ' + trackByExp; - } - return expression; - }; -}]); - -}()); -angular.module("ui.select").run(["$templateCache", function($templateCache) {$templateCache.put("bootstrap/choices.tpl.html","
        0\">
      • 0\">
      "); -$templateCache.put("bootstrap/match-multiple.tpl.html"," × "); -$templateCache.put("bootstrap/match.tpl.html","
      {{$select.placeholder}}
      "); -$templateCache.put("bootstrap/select-multiple.tpl.html","
      "); -$templateCache.put("bootstrap/select.tpl.html","
      "); -$templateCache.put("select2/choices.tpl.html","
      "); -$templateCache.put("select2/match-multiple.tpl.html","
    • "); -$templateCache.put("select2/match.tpl.html","{{$select.placeholder}} "); -$templateCache.put("select2/select-multiple.tpl.html","
      "); -$templateCache.put("select2/select.tpl.html","
      "); -$templateCache.put("selectize/choices.tpl.html","
      "); -$templateCache.put("selectize/match.tpl.html","
      "); -$templateCache.put("selectize/select.tpl.html","
      ");}]); - - \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/w3.css b/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/w3.css deleted file mode 100644 index 572f0b17e..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/CSS/w3.css +++ /dev/null @@ -1,360 +0,0 @@ -@CHARSET "ISO-8859-1"; -/* W3.CSS 2.63 by Jan Egil and Borge Refsnes. Do not remove this line */ -*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} -/* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */ -html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0} -article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block} -audio,canvas,video{display:inline-block;vertical-align:baseline} -audio:not([controls]){display:none;height:0}[hidden],template{display:none} -a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted} -dfn{font-style:italic}mark{background:#ff0;color:#000} -small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} -sup{top:-0.5em}sub{bottom:-0.25em} -img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px} -hr{-moz-box-sizing:content-box;box-sizing:content-box} -code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em} -button,input,select,textarea{font:inherit;margin:0} -button{overflow:visible}button,select{text-transform:none} -button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer} -button[disabled],html input[disabled]{cursor:default} -button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0} -input[type=checkbox],input[type=radio]{padding:0} -input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto} -input[type=search]{box-sizing:content-box;-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box} -input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none} -fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em} -legend{border:0;padding:0}pre,textarea{overflow:auto} -/*End extract from normalize.css*/ -html,body{font-family:Verdana,sans-serif;font-size:15px;line-height:1.5}html{overflow-x:hidden} -h1,h2,h3,h4,h5,h6,.w3-slim,.w3-wide{font-family:"Segoe UI",Arial,sans-serif} -h1{font-size:36px}h2{font-size:30px}h3{font-size:24px}h4{font-size:20px}h5{font-size:18px}h6{font-size:16px} -.w3-serif{font-family:"Times New Roman",Times,serif} -h1,h2,h3,h4,h5,h6{font-weight:400;margin:10px 0}.w3-wide{letter-spacing:4px} -h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{font-weight:inherit} -hr{height:0;border:0;border-top:1px solid #eee;margin:20px 0} -img{margin-bottom:-5px}a{color:inherit} -table{border-collapse:collapse;border-spacing:0;width:100%;display:table} -table,th,td{border:none} -.w3-table-all{border:1px solid #ccc} -.w3-bordered tr,.w3-table-all tr{border-bottom:1px solid #ddd} -.w3-striped tbody tr:nth-child(even){background-color:#f1f1f1} -.w3-table-all tr:nth-child(odd){background-color:#fff} -.w3-table-all tr:nth-child(even){background-color:#f1f1f1} -.w3-hoverable tbody tr:hover,.w3-ul.w3-hoverable li:hover{background-color:#ccc} -.w3-centered tr th,.w3-centered tr td{text-align:center} -.w3-table td,.w3-table th,.w3-table-all td,.w3-table-all th{padding:6px 8px;display:table-cell;text-align:left;vertical-align:top} -.w3-table th:first-child,.w3-table td:first-child,.w3-table-all th:first-child,.w3-table-all td:first-child{padding-left:16px} -.w3-btn,.w3-btn-block{border:none;display:inline-block;outline:0;padding:6px 16px;vertical-align:middle;overflow:hidden;text-decoration:none!important;color:#fff;background-color:#000;text-align:center;cursor:pointer;white-space:nowrap} -.w3-btn.w3-disabled,.w3-btn-block.w3-disabled,.w3-btn-floating.w3-disabled,.w3-btn:disabled,.w3-btn-floating:disabled,.w3-btn-floating-large.w3-disabled,.w3-btn-floating-large:disabled{cursor:not-allowed;opacity:0.3} -.w3-btn.w3-disabled *,.w3-btn-block.w3-disabled,.w3-btn-floating.w3-disabled *,.w3-btn:disabled *,.w3-btn-floating:disabled *{pointer-events:none} -.w3-btn.w3-disabled:hover,.w3-btn-block.w3-disabled:hover,.w3-btn:disabled:hover,.w3-btn-floating.w3-disabled:hover,.w3-btn-floating:disabled:hover, -.w3-btn-floating-large.w3-disabled:hover,.w3-btn-floating-large:disabled:hover{box-shadow:none} -.w3-btn:hover,.w3-btn-block:hover,.w3-btn-floating:hover,.w3-btn-floating-large:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)} -.w3-btn-block{width:100%} -.w3-btn,.w3-btn-floating,.w3-btn-floating-large,.w3-closenav,.w3-opennav{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} -.w3-btn-floating,.w3-btn-floating-large{display:inline-block;text-align:center;color:#fff;background-color:#000;position:relative;overflow:hidden;z-index:1;padding:0;border-radius:50%;cursor:pointer;font-size:24px} -.w3-btn-floating{width:40px;height:40px;line-height:40px} -.w3-btn-floating-large{width:56px;height:56px;line-height:56px} -.w3-btn-group .w3-btn{float:left} -.w3-btn.w3-ripple{position:relative} -.w3-ripple:after{content:"";background:#90EE90;display:block;position:absolute;padding-top:300%;padding-left:350%;margin-left:-20px!important;margin-top:-120%;opacity:0;transition:.8s} -.w3-ripple:active:after{padding:0;margin:0;opacity:1;transition:0s} -.w3-badge,.w3-tag,.w3-sign{background-color:#000;color:#fff;display:inline-block;padding-left:8px;padding-right:8px;text-align:center} -.w3-badge{border-radius:50%} -ul.w3-ul{list-style-type:none;padding:0;margin:0} -ul.w3-ul li{padding:6px 2px 6px 16px;border-bottom:1px solid #ddd} -ul.w3-ul li:last-child{border-bottom:none} -.w3-tooltip,.w3-display-container{position:relative} -.w3-fluid{max-width:100%;height:auto} -.w3-tooltip .w3-text{display:none} -.w3-tooltip:hover .w3-text{display:inline-block} -.w3-navbar{list-style-type:none;margin:0;padding:0;overflow:hidden} -.w3-navbar li{float:left}.w3-navbar li a{display:block;padding:8px 16px}.w3-navbar li a:hover{color:#000;background-color:#ccc} -.w3-navbar .w3-dropdown-hover,.w3-navbar .w3-dropdown-click{position:static} -.w3-navbar .w3-dropdown-hover:hover,.w3-navbar .w3-dropdown-hover:first-child,.w3-navbar .w3-dropdown-click:hover{background-color:#ccc;color:#000} -.w3-navbar a,.w3-topnav a,.w3-sidenav a,.w3-dropnav a,.w3-dropdown-content a,.w3-accordion-content a{text-decoration:none!important} -.w3-navbar .w3-opennav.w3-right{float:right!important}.w3-topnav{padding:8px 8px} -.w3-topnav a{padding:0 8px;border-bottom:3px solid transparent;-webkit-transition:border-bottom .3s;transition:border-bottom .3s} -.w3-topnav a:hover{border-bottom:3px solid #fff}.w3-topnav .w3-dropdown-hover a{border-bottom:0} -.w3-opennav,.w3-closenav{color:inherit}.w3-opennav:hover,.w3-closenav:hover{cursor:pointer;opacity:0.8} -.w3-btn,.w3-btn-floating,.w3-btn-floating-large,.w3-btn-block,.w3-hover-shadow,.w3-hover-opacity, -.w3-navbar a,.w3-sidenav a,.w3-dropnav a,.w3-pagination li a,.w3-hoverable tbody tr,.w3-hoverable li,.w3-accordion-content a,.w3-dropdown-content a,.w3-dropdown-click:hover,.w3-dropdown-hover:hover,.w3-opennav,.w3-closenav,.w3-closebtn, -.w3-hover-amber,.w3-hover-aqua,.w3-hover-blue,.w3-hover-light-blue,.w3-hover-brown,.w3-hover-cyan,.w3-hover-blue-grey,.w3-hover-green,.w3-hover-light-green,.w3-hover-indigo,.w3-hover-khaki,.w3-hover-lime,.w3-hover-orange,.w3-hover-deep-orange,.w3-hover-pink, -.w3-hover-purple,.w3-hover-deep-purple,.w3-hover-red,.w3-hover-sand,.w3-hover-teal,.w3-hover-yellow,.w3-hover-white,.w3-hover-black,.w3-hover-grey,.w3-hover-light-grey,.w3-hover-dark-grey,.w3-hover-text-amber,.w3-hover-text-aqua,.w3-hover-text-blue,.w3-hover-text-light-blue, -.w3-hover-text-brown,.w3-hover-text-cyan,.w3-hover-text-blue-grey,.w3-hover-text-green,.w3-hover-text-light-green,.w3-hover-text-indigo,.w3-hover-text-khaki,.w3-hover-text-lime,.w3-hover-text-orange,.w3-hover-text-deep-orange,.w3-hover-text-pink,.w3-hover-text-purple, -.w3-hover-text-deep-purple,.w3-hover-text-red,.w3-hover-text-sand,.w3-hover-text-teal,.w3-hover-text-yellow,.w3-hover-text-white,.w3-hover-text-black,.w3-hover-text-grey,.w3-hover-text-light-grey,.w3-hover-text-dark-grey -{-webkit-transition:background-color .3s,color .15s,box-shadow .3s,opacity 0.3s;transition:background-color .3s,color .15s,box-shadow .3s,opacity 0.3s} -.w3-sidenav{height:100%;width:200px;background-color:#fff;position:fixed!important;z-index:1;overflow:auto} -.w3-sidenav a{padding:4px 2px 4px 16px}.w3-sidenav a:hover{background-color:#ccc}.w3-sidenav a,.w3-dropnav a{display:block} -.w3-sidenav .w3-dropdown-hover:hover,.w3-sidenav .w3-dropdown-hover:first-child,.w3-sidenav .w3-dropdown-click:hover{background-color:#ccc;color:#000} -.w3-sidenav .w3-dropdown-hover,.w3-sidenav .w3-dropdown-click {width:100%}.w3-sidenav .w3-dropdown-hover .w3-dropdown-content,.w3-sidenav .w3-dropdown-click .w3-dropdown-content{min-width:100%} -.w3-main,#main{transition:margin-left .4s} -.w3-dropnav{background-color:#fff}.w3-dropnav a:hover{text-decoration:underline!important} -.w3-modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4)} -.w3-modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px}.w3-closebtn{text-decoration:none;float:right;font-size:24px;font-weight:bold;color:inherit} -.w3-closebtn:hover,.w3-closebtn:focus{color:#000;text-decoration:none;cursor:pointer} -.w3-pagination{display:inline-block;padding:0;margin:0}.w3-pagination li{display:inline} -.w3-pagination li a{text-decoration:none;color:#000;float:left;padding:8px 16px} -.w3-pagination li a:hover,.w3-pagination li a:focus{background-color:#ccc} -.w3-input-group,.w3-group{margin-top:24px;margin-bottom:24px} -.w3-input{padding:8px;display:block;border:none;border-bottom:1px solid #808080;width:100%} -.w3-label{color:#009688}.w3-input:not(:valid)~.w3-validate{color:#f44336} -.w3-select{padding:8px 0;width:100%;color:#000;border:1px solid transparent;border-bottom:1px solid #009688} -.w3-select select:focus{color:#000;border:1px solid #009688}.w3-select option[disabled]{color:#009688} -.w3-dropdown-click,.w3-dropdown-hover{position:relative;display:inline-block;cursor:pointer} -.w3-dropdown-hover:hover .w3-dropdown-content{display:block;z-index:1} -.w3-dropdown-content{cursor:auto;color:#000;background-color:#fff;display:none;position:absolute;min-width:160px;margin:0;padding:0} -.w3-dropdown-content a{padding:6px 16px;display:block} -.w3-dropdown-content a:hover{background-color:#ccc} -.w3-accordion {width:100%;cursor:pointer} -.w3-accordion-content{cursor:auto;display:none;position:relative;width:100%;margin:0;padding:0} -.w3-accordion-content a{padding:6px 16px;display:block}.w3-accordion-content a:hover{background-color:#ccc} -.w3-progress-container{width:100%;height:1.5em;position:relative;background-color:#f1f1f1} -.w3-progressbar{background-color:#757575;height:100%;position:absolute;line-height:inherit} -input[type=checkbox].w3-check,input[type=radio].w3-radio{width:24px;height:24px;position:relative;top:6px} -input[type=checkbox].w3-check:checked+.w3-validate,input[type=radio].w3-radio:checked+.w3-validate{color:#009688} -input[type=checkbox].w3-check:disabled+.w3-validate,input[type=radio].w3-radio:disabled+.w3-validate{color:#aaa} -.w3-responsive{overflow-x:auto} -.w3-container:after,.w3-row:after,.w3-row-padding:after,.w3-topnav:after,.w3-clear:after,.w3-btn-group:before,.w3-btn-group:after -{content:"";display:table;clear:both} -.w3-col,.w3-half,.w3-third,.w3-twothird,.w3-threequarter,.w3-quarter{float:left;width:100%} -.w3-col.s1{width:8.33333%} -.w3-col.s2{width:16.66666%} -.w3-col.s3{width:24.99999%} -.w3-col.s4{width:33.33333%} -.w3-col.s5{width:41.66666%} -.w3-col.s6{width:49.99999%} -.w3-col.s7{width:58.33333%} -.w3-col.s8{width:66.66666%} -.w3-col.s9{width:74.99999%} -.w3-col.s10{width:83.33333%} -.w3-col.s11{width:91.66666%} -.w3-col.s12,.w3-half,.w3-third,.w3-twothird,.w3-threequarter,.w3-quarter{width:99.99999%} -@media only screen and (min-width:601px){ -.w3-col.m1{width:8.33333%} -.w3-col.m2{width:16.66666%} -.w3-col.m3,.w3-quarter{width:24.99999%} -.w3-col.m4,.w3-third{width:33.33333%} -.w3-col.m5{width:41.66666%} -.w3-col.m6,.w3-half{width:49.99999%} -.w3-col.m7{width:58.33333%} -.w3-col.m8,.w3-twothird{width:66.66666%} -.w3-col.m9,.w3-threequarter{width:74.99999%} -.w3-col.m10{width:83.33333%} -.w3-col.m11{width:91.66666%} -.w3-col.m12{width:99.99999%}} -@media only screen and (min-width:993px){ -.w3-col.l1{width:8.33333%} -.w3-col.l2{width:16.66666%} -.w3-col.l3,.w3-quarter{width:24.99999%} -.w3-col.l4,.w3-third{width:33.33333%} -.w3-col.l5{width:41.66666%} -.w3-col.l6,.w3-half{width:49.99999%} -.w3-col.l7{width:58.33333%} -.w3-col.l8,.w3-twothird{width:66.66666%} -.w3-col.l9,.w3-threequarter{width:74.99999%} -.w3-col.l10{width:83.33333%} -.w3-col.l11{width:91.66666%} -.w3-col.l12{width:99.99999%}} -.w3-content{max-width:980px;margin:auto} -.w3-rest{overflow:hidden} -.w3-hide{display:none!important}.w3-show-block,.w3-show{display:block!important}.w3-show-inline-block{display:inline-block!important} -@media (max-width:600px){.w3-modal-content{margin:0 10px;width:auto!important}.w3-modal{padding-top:30px}} -@media (max-width:768px){.w3-modal-content{width:500px}.w3-modal{padding-top:50px}} -@media (min-width:993px){.w3-modal-content{width:900px}} -@media screen and (max-width:600px){.w3-topnav a{display:block}.w3-navbar li:not(.w3-opennav){float:none;width:100%!important}.w3-navbar li.w3-right{float:none!important}} -@media screen and (max-width:600px){.w3-topnav .w3-dropdown-hover .w3-dropdown-content,.w3-navbar .w3-dropdown-click .w3-dropdown-content,.w3-navbar .w3-dropdown-hover .w3-dropdown-content{position:relative}} -@media screen and (max-width:600px){.w3-topnav,.w3-navbar{text-align:center}} -@media (max-width:600px){.w3-hide-small{display:none!important}} -@media (max-width:992px) and (min-width:601px){.w3-hide-medium{display:none!important}} -@media (min-width:993px){.w3-hide-large{display:none!important}} -@media screen and (max-width:992px){.w3-sidenav.w3-collapse{display:none}.w3-main{margin-left:0!important}} -@media screen and (min-width:992px){.w3-sidenav.w3-collapse{display:block!important}} -.w3-top,.w3-bottom{position:fixed;width:100%;z-index:1}.w3-top{top:0}.w3-bottom{bottom:0} -.w3-overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);z-index:2} -.w3-left{float:left!important}.w3-right{float:right!important} -.w3-tiny{font-size:10px!important}.w3-small{font-size:12px!important} -.w3-medium{font-size:15px!important} -.w3-large{font-size:18px!important} -.w3-xlarge{font-size:24px!important} -.w3-xxlarge{font-size:36px!important} -.w3-xxxlarge{font-size:48px!important} -.w3-jumbo{font-size:64px!important} -.w3-vertical{word-break:break-all;line-height:1;text-align:center;width:0.6em} -.w3-left-align{text-align:left!important}.w3-right-align{text-align:right!important} -.w3-justify{text-align:justify!important} -.w3-center{text-align:center!important} -.w3-display-topleft{position:absolute;left:0;top:0}.w3-display-topright{position:absolute;right:0;top:0} -.w3-display-bottomleft{position:absolute;left:0;bottom:0}.w3-display-bottomright{position:absolute;right:0;bottom:0} -.w3-display-middle{position:absolute;left:0;bottom:50%;width:100%;text-align:center} -.w3-display-topmiddle{position:absolute;left:0;top:0;width:100%;text-align:center}.w3-display-bottommiddle{position:absolute;left:0;bottom:0;width:100%;text-align:center} -.w3-circle{border-radius:50%!important} -.w3-round-small{border-radius:2px!important}.w3-round,.w3-round-medium{border-radius:4px!important} -.w3-round-large{border-radius:8px!important}.w3-round-xlarge{border-radius:16px!important} -.w3-round-xxlarge{border-radius:32px!important}.w3-round-jumbo{border-radius:64px!important} -.w3-border-0{border:0!important} -.w3-border{border:1px solid #ccc!important} -.w3-border-top{border-top:1px solid #ccc!important}.w3-border-bottom{border-bottom:1px solid #ccc!important} -.w3-border-left{border-left:1px solid #ccc!important}.w3-border-right{border-right:1px solid #ccc!important} -.w3-margin{margin:16px!important}.w3-margin-0{margin:0!important} -.w3-margin-top{margin-top:16px!important}.w3-margin-bottom{margin-bottom:16px!important} -.w3-margin-left{margin-left:16px!important}.w3-margin-right{margin-right:16px!important} -.w3-section{margin-top:16px!important;margin-bottom:16px!important} -.w3-padding-tiny{padding:2px 4px!important} -.w3-padding-small{padding:4px 8px!important} -.w3-padding-medium,.w3-padding,.w3-form{padding:8px 16px!important} -.w3-padding-large{padding:12px 24px!important} -.w3-padding-xlarge{padding:16px 32px!important} -.w3-padding-xxlarge{padding:24px 48px!important} -.w3-padding-jumbo{padding:32px 64px!important} -.w3-padding-4,.w3-padding-hor-4{padding-top:4px!important;padding-bottom:4px!important} -.w3-padding-8,.w3-padding-hor-8{padding-top:8px!important;padding-bottom:8px!important} -.w3-padding-12,.w3-padding-hor-12{padding-top:12px!important;padding-bottom:12px!important} -.w3-padding-16,.w3-padding-hor-16{padding-top:16px!important;padding-bottom:16px!important} -.w3-padding-24,.w3-padding-hor-24{padding-top:24px!important;padding-bottom:24px!important} -.w3-padding-32,.w3-padding-hor-32{padding-top:32px!important;padding-bottom:32px!important} -.w3-padding-48,.w3-padding-hor-48{padding-top:48px!important;padding-bottom:48px!important} -.w3-padding-64,.w3-padding-hor-64{padding-top:64px!important;padding-bottom:64px!important} -.w3-padding-128,.w3-padding-hor-128{padding-top:128px!important;padding-bottom:128px!important} -.w3-padding-0{padding:0!important} -/* Will be removed in a later version */ -.w3-padding-ver-4{padding-left:4px!important;padding-right:4px!important} -.w3-padding-ver-8{padding-left:8px!important;padding-right:8px!important} -.w3-padding-ver-12{padding-left:12px!important;padding-right:12px!important} -.w3-padding-ver-16{padding-left:16px!important;padding-right:16px!important} -.w3-padding-ver-24{padding-left:24px!important;padding-right:24px!important} -.w3-padding-ver-32{padding-left:32px!important;padding-right:32px!important} -.w3-padding-ver-48{padding-left:48px!important;padding-right:48px!important} -.w3-padding-ver-64{padding-left:64px!important;padding-right:64px!important} -/* End remove */ -.w3-padding-top{padding-top:8px!important}.w3-padding-bottom{padding-bottom:8px!important} -.w3-padding-left{padding-left:16px!important}.w3-padding-right{padding-right:16px!important} -.w3-topbar{border-top:6px solid #ccc!important}.w3-bottombar{border-bottom:6px solid #ccc!important} -.w3-leftbar{border-left:6px solid #ccc!important}.w3-rightbar{border-right:6px solid #ccc!important} -.w3-row-padding,.w3-row-padding>.w3-half,.w3-row-padding>.w3-third,.w3-row-padding>.w3-twothird,.w3-row-padding>.w3-threequarter,.w3-row-padding>.w3-quarter,.w3-row-padding>.w3-col{padding:0 8px} -.w3-spin{animation:w3-spin 2s infinite linear;-webkit-animation:w3-spin 2s infinite linear} -@-webkit-keyframes w3-spin{ -0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)} -100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}} -@keyframes w3-spin{ -0%{-webkit-transform:rotate(0deg);transform: rotate(0deg)} -100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}} -.w3-container{padding:0.01em 16px} -.w3-example{background-color:#f1f1f1;padding:0.01em 16px} -.w3-code{font-family:Consolas,"courier new";font-size:16px;line-height:1.4;width:auto;background-color:#fff;padding:8px 12px;border-left:4px solid #009688;word-wrap:break-word} -.w3-example,.w3-code,.w3-reference{margin:20px 0} -.w3-card{border:1px solid #ccc} -.w3-card-2,.w3-example{box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)!important} -.w3-card-4,.w3-hover-shadow:hover{box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)!important} -.w3-card-8{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)!important} -.w3-card-12{box-shadow:0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19)!important} -.w3-card-16{box-shadow:0 16px 24px 0 rgba(0,0,0,0.22),0 25px 55px 0 rgba(0,0,0,0.21)!important} -.w3-card-24{box-shadow:0 24px 24px 0 rgba(0,0,0,0.2),0 40px 77px 0 rgba(0,0,0,0.22)!important} -.w3-animate-fading{-webkit-animation:fading 10s infinite;animation:fading 10s infinite} -@-webkit-keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}} -@keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}} -.w3-animate-opacity{-webkit-animation:opac 1.5s;animation:opac 1.5s} -@-webkit-keyframes opac{from{opacity:0} to{opacity:1}} -@keyframes opac{from{opacity:0} to{opacity:1}} -.w3-animate-top{position:relative;-webkit-animation:animatetop 0.4s;animation:animatetop 0.4s} -@-webkit-keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}} -@keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}} -.w3-animate-left{position:relative;-webkit-animation:animateleft 0.4s;animation:animateleft 0.4s} -@-webkit-keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}} -@keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}} -.w3-animate-right{position:relative;-webkit-animation:animateright 0.4s;animation:animateright 0.4s} -@-webkit-keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}} -@keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}} -.w3-animate-bottom{position:relative;-webkit-animation:animatebottom 0.4s;animation:animatebottom 0.4s} -@-webkit-keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0px;opacity:1}} -@keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}} -.w3-animate-zoom {-webkit-animation:animatezoom 0.6s;animation:animatezoom 0.6s} -@-webkit-keyframes animatezoom{from{-webkit-transform:scale(0)} to{-webkit-transform:scale(1)}} -@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}} -.w3-animate-input{-webkit-transition:width 0.4s ease-in-out;transition:width 0.4s ease-in-out}.w3-animate-input:focus{width:100%!important} -.w3-transparent{background-color:transparent!important} -.w3-hover-none:hover{box-shadow:none!important;background-color:transparent!important} -.w3-amber,.w3-hover-amber:hover{color:#000!important;background-color:#ffc107!important} -.w3-aqua,.w3-hover-aqua:hover{color:#000!important;background-color:#00ffff!important} -.w3-blue,.w3-hover-blue:hover{color:#fff!important;background-color:#2196F3!important} -.w3-light-blue,.w3-hover-light-blue:hover{color:#000!important;background-color:#87CEEB!important} -.w3-brown,.w3-hover-brown:hover{color:#fff!important;background-color:#795548!important} -.w3-cyan,.w3-hover-cyan:hover{color:#000!important;background-color:#00bcd4!important} -.w3-blue-grey,.w3-hover-blue-grey:hover{color:#fff!important;background-color:#607d8b!important} -.w3-green,.w3-hover-green:hover{color:#fff!important;background-color:#4CAF50!important} -.w3-light-green,.w3-hover-light-green:hover{color:#000!important;background-color:#8bc34a!important} -.w3-indigo,.w3-hover-indigo:hover{color:#fff!important;background-color:#3f51b5!important} -.w3-khaki,.w3-hover-khaki:hover{color:#000!important;background-color:#f0e68c!important} -.w3-lime,.w3-hover-lime:hover{color:#000!important;background-color:#cddc39!important} -.w3-orange,.w3-hover-orange:hover{color:#000!important;background-color:#ff9800!important} -.w3-deep-orange,.w3-hover-deep-orange:hover{color:#fff!important;background-color:#ff5722!important} -.w3-pink,.w3-hover-pink:hover{color:#fff!important;background-color:#e91e63!important} -.w3-purple,.w3-hover-purple:hover{color:#fff!important;background-color:#9c27b0!important} -.w3-deep-purple,.w3-hover-deep-purple:hover{color:#fff!important;background-color:#673ab7!important} -.w3-red,.w3-hover-red:hover{color:#fff!important;background-color:#f44336!important} -.w3-sand,.w3-hover-sand:hover{color:#000!important;background-color:#fdf5e6!important} -.w3-teal,.w3-hover-teal:hover{color:#fff!important;background-color:#009688!important} -.w3-yellow,.w3-hover-yellow:hover{color:#000!important;background-color:#ffeb3b!important} -.w3-white,.w3-hover-white:hover{color:#000!important;background-color:#fff!important} -.w3-black,.w3-hover-black:hover{color:#fff!important;background-color:#000!important} -.w3-grey,.w3-hover-grey:hover{color:#000!important;background-color:#9e9e9e!important} -.w3-light-grey,.w3-hover-light-grey:hover{color:#000!important;background-color:#f1f1f1!important} -.w3-dark-grey,.w3-hover-dark-grey:hover{color:#fff!important;background-color:#616161!important} -.w3-pale-red,.w3-hover-pale-red:hover{color:#000!important;background-color:#ffe7e7!important}.w3-pale-green,.w3-hover-pale-green:hover{color:#000!important;background-color:#e7ffe7!important} -.w3-pale-yellow,.w3-hover-pale-yellow:hover{color:#000!important;background-color:#ffffd7!important}.w3-pale-blue,.w3-hover-pale-blue:hover{color:#000!important;background-color:#e7ffff!important} -.w3-text-amber,.w3-hover-text-amber:hover{color:#ffc107!important} -.w3-text-aqua,.w3-hover-text-aqua:hover{color:#00ffff!important} -.w3-text-blue,.w3-hover-text-blue:hover{color:#2196F3!important} -.w3-text-light-blue,.w3-hover-text-light-blue:hover{color:#87CEEB!important} -.w3-text-brown,.w3-hover-text-brown:hover{color:#795548!important} -.w3-text-cyan,.w3-hover-text-cyan:hover{color:#00bcd4!important} -.w3-text-blue-grey,.w3-hover-text-blue-grey:hover{color:#607d8b!important} -.w3-text-green,.w3-hover-text-green:hover{color:#4CAF50!important} -.w3-text-light-green,.w3-hover-text-light-green:hover{color:#8bc34a!important} -.w3-text-indigo,.w3-hover-text-indigo:hover{color:#3f51b5!important} -.w3-text-khaki,.w3-hover-text-khaki:hover{color:#b4aa50!important} -.w3-text-lime,.w3-hover-text-lime:hover{color:#cddc39!important} -.w3-text-orange,.w3-hover-text-orange:hover{color:#ff9800!important} -.w3-text-deep-orange,.w3-hover-text-deep-orange:hover{color:#ff5722!important} -.w3-text-pink,.w3-hover-text-pink:hover{color:#e91e63!important} -.w3-text-purple,.w3-hover-text-purple:hover{color:#9c27b0!important} -.w3-text-deep-purple,.w3-hover-text-deep-purple:hover{color:#673ab7!important} -.w3-text-red,.w3-hover-text-red:hover{color:#f44336!important} -.w3-text-sand,.w3-hover-text-sand:hover{color:#fdf5e6!important} -.w3-text-teal,.w3-hover-text-teal:hover{color:#009688!important} -.w3-text-yellow,.w3-hover-text-yellow:hover{color:#d2be0e!important} -.w3-text-white,.w3-hover-text-white:hover{color:#fff!important} -.w3-text-black,.w3-hover-text-black:hover{color:#000!important} -.w3-text-grey,.w3-hover-text-grey:hover{color:#757575!important} -.w3-text-light-grey,.w3-hover-text-light-grey:hover{color:#f1f1f1!important} -.w3-text-dark-grey,.w3-hover-text-dark-grey:hover{color:#3a3a3a!important} -.w3-border-amber,.w3-hover-border-amber:hover{border-color:#ffc107!important} -.w3-border-aqua,.w3-hover-border-aqua:hover{border-color:#00ffff!important} -.w3-border-blue,.w3-hover-border-blue:hover{border-color:#2196F3!important} -.w3-border-light-blue,.w3-hover-border-light-blue:hover{border-color:#87CEEB!important} -.w3-border-brown,.w3-hover-border-brown:hover{border-color:#795548!important} -.w3-border-cyan,.w3-hover-border-cyan:hover{border-color:#00bcd4!important} -.w3-border-blue-grey,.w3-hover-blue-grey:hover{border-color:#607d8b!important} -.w3-border-green,.w3-hover-border-green:hover{border-color:#4CAF50!important} -.w3-border-light-green,.w3-hover-border-light-green:hover{border-color:#8bc34a!important} -.w3-border-indigo,.w3-hover-border-indigo:hover{border-color:#3f51b5!important} -.w3-border-khaki,.w3-hover-border-khaki:hover{border-color:#f0e68c!important} -.w3-border-lime,.w3-hover-border-lime:hover{border-color:#cddc39!important} -.w3-border-orange,.w3-hover-border-orange:hover{border-color:#ff9800!important} -.w3-border-deep-orange,.w3-hover-border-deep-orange:hover{border-color:#ff5722!important} -.w3-border-pink,.w3-hover-border-pink:hover{border-color:#e91e63!important} -.w3-border-purple,.w3-hover-border-purple:hover{border-color:#9c27b0!important} -.w3-border-deep-purple,.w3-hover-border-deep-purple:hover{border-color:#673ab7!important} -.w3-border-red,.w3-hover-border-red:hover{border-color:#f44336!important} -.w3-border-sand,.w3-hover-border-sand:hover{border-color:#fdf5e6!important} -.w3-border-teal,.w3-hover-border-teal:hover{border-color:#009688!important} -.w3-border-yellow,.w3-hover-border-yellow:hover{border-color:#ffeb3b!important} -.w3-border-white,.w3-hover-border-white:hover{border-color:#fff!important} -.w3-border-black,.w3-hover-border-black:hover{border-color:#000!important} -.w3-border-grey,.w3-hover-border-grey:hover{border-color:#9e9e9e!important} -.w3-border-light-grey,.w3-hover-border-light-grey:hover{border-color:#f1f1f1!important} -.w3-border-dark-grey,.w3-hover-border-dark-grey:hover{border-color:#616161!important} -.w3-border-pale-red,.w3-hover-border-pale-red:hover{border-color:#ffe7e7!important}.w3-border-pale-green,.w3-hover-border-pale-green:hover{border-color:#e7ffe7!important} -.w3-border-pale-yellow,.w3-hover-border-pale-yellow:hover{border-color:#ffffd7!important}.w3-border-pale-blue,.w3-hover-border-pale-blue:hover{border-color:#e7ffff!important} -.w3-opacity,.w3-hover-opacity:hover{opacity:0.60} -.w3-text-shadow{text-shadow:1px 1px 0 #444}.w3-text-shadow-white{text-shadow:1px 1px 0 #ddd} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/JSONDataFiles/JSONConfig.json b/ecomp-sdk-app/src/main/webapp/app/policyApp/JSONDataFiles/JSONConfig.json deleted file mode 100644 index 23f985962..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/JSONDataFiles/JSONConfig.json +++ /dev/null @@ -1,132 +0,0 @@ -[ - { - "serviceTypePolicyName": "Registration Failure(Trinity)", - "verticaMetrics": "DATETIMEUTC\n VNFC_NAME\n BW_SIP_STATS_REGISTER_RESPONSE_CODE_VALUE \nBW_SIP_STATS_REGISTER_RESPONSE_INS \n BW_SIP_STATS_REGISTER_RESPONSE_OUTS", - "attributes": { - "Onset&abatement anomaly detection": { - "PtileLimit": "Percentile value used by anomaly detection model", - "Threshold": "initial value for the quantile at percentile(PtileLimit) used by the anomaly detection model", - "Window": "Number of weeks anomaly detection model keeps in memory to estimate Threshold", - "Training": "Number of historical weeks anomaly detection model needs for training ", - "FractionSamplePerDay": "This corresponds to the minimum number of samples per day to be used in the daily percentile computation when updating the distribution tail crossing model. When there are less samples than that threshold, the model is not updated with these samples. " - }, - "Onset signature trigger": { - "ConsecutiveIntervalOnset": "Number of consecutive intervals normalized metric must trigger the anomaly detection model before resulting in an action", - "RetryTimer": "Minimum interval between policy triggers" - }, - "Abatement signature trigger": { - "ConsecutiveIntervalAbatement": "Number of consecutive intervals normalized metric does not trigger the anomaly detection model after onset signature was triggered" - }, - "Onset & abatement UEB notification": { - "OnsetMessage": "Value of field OnSetMessage sent by Analytics Engine published on UEB", - "AbatementMessage": "Value of field AbatementMessage sent by Analytics Engine published on UEB", - "PolicyName": "Value of field PolicyName sent by Analytics Engine published on UEB" - } - }, - "policyDescription": "Policy to detect instances where SIP registration rate exceeds a normal level over a number of consecutive sampling periods. \n Notes \n (1) Vertica metrics normalized and combined in a SIP registration failure probability per Site and per VM. \n (2) Anomaly detection model operates on SIP registration failure probability. \n (3) Anomaly detection consists of an estimated distribution percentile threshold crossing. \n (4) Actions: Send email and/or UEB notification" - }, - { - "serviceTypePolicyName": "International Fraud(Trinity)", - "verticaMetrics": "INTERVAL_START_TS\n CUSTOMER\n A_SITE\n A_SBG\n BW\n Z_COUNTRY\n CALL_COUNT\n MINUTES_OF_USE", - "attributes": { - "Onset&abatement anomaly detection": { - "PtileLimit": "Percentile value used by anomaly detection model", - "Threshold": "initial value for the quantile at percentile(PtileLimit) used by the anomaly detection model", - "Window": "Number of weeks anomaly detection model keeps in memory to estimate Threshold", - "Training": "Number of historical weeks anomaly detection model needs for training ", - "FractionSamplePerDay": "This corresponds to the minimum number of samples per day to be used in the daily percentile computation when updating the distribution tail crossing model. When there are less samples than that threshold, the model is not updated with these samples. " - }, - "Onset signature trigger": { - "ConsecutiveIntervalOnset": "Number of consecutive intervals normalized metric must trigger the anomaly detection model before resulting in an action", - "RetryTimer": "Minimum interval between policy triggers" - }, - "Abatement signature trigger": { - "ConsecutiveIntervalAbatement": "Number of consecutive intervals normalized metric does not trigger the anomaly detection model after onset signature was triggered" - }, - "Onset & abatement UEB notification ": { - "OnsetMessage": "Value of field OnSetMessage sent by Analytics Engine published on UEB", - "AbatementMessage": "Value of field AbatementMessage sent by Analytics Engine published on UEB", - "PolicyName": "Value of field PolicyName sent by Analytics Engine published on UEB" - } - }, - "policyDescription": "Policy to detect instances where count of calls towards an international destination exceeds a normal level over a number of consecutive sampling periods. \n Notes \n (1) Vertica metrics normalized and combined in a SIP registration failure probability per Customer, per Site and per VM. \n (2) Anomaly detection model operates on counts towards an international destination. \n (3) Anomaly detection consists of an estimated distribution percentile threshold crossing. \n (4) Actions: Send email and/or UEB notification" - }, - { - "serviceTypePolicyName": "No dial tone(Trinity)", - "verticaMetrics": "INTERVAL_START_TS\n SUM(CALLS_ATTEMPTED)\n SUM(NO_ANSWER_OR_VOICE_MAIL)\n A_SITE or A_SBG or BW or CUSTOMER", - "attributes": { - "Onset&abatement anomaly detection": { - "PtileLimit": "Percentile value used by anomaly detection model", - "Threshold": "initial value for the quantile at percentile(PtileLimit) used by the anomaly detection model", - "Window": "Number of weeks anomaly detection model keeps in memory to estimate Threshold", - "Training": "Number of historical weeks anomaly detection model needs for training ", - "FractionSamplePerDay": "This corresponds to the minimum number of samples per day to be used in the daily percentile computation when updating the distribution tail crossing model. When there are less samples than that threshold, the model is not updated with these samples. " - }, - "Onset signature trigger": { - "ConsecutiveIntervalOnset": "Number of consecutive intervals normalized metric must trigger the anomaly detection model before resulting in an action", - "RetryTimer": "Minimum interval between policy triggers" - }, - "Abatement signature trigger": { - "ConsecutiveIntervalAbatement": "Number of consecutive intervals normalized metric does not trigger the anomaly detection model after onset signature was triggered" - }, - "Onset & abatement UEB notification ": { - "OnsetMessage": "Value of field OnSetMessage sent by Analytics Engine published on UEB", - "AbatementMessage": "Value of field AbatementMessage sent by Analytics Engine published on UEB", - "PolicyName": "Value of field PolicyName sent by Analytics Engine published on UEB" - } - }, - "policyDescription": "Policy to detect ? \n Notes:\n (1) Actions: Send email and/or UEB notification" - }, - { - "serviceTypePolicyName": "Call storm(Trinity)", - "verticaMetrics": "", - "attributes": { - "Onset&abatement anomaly detection": { - "SeasonLength": "Metric seasonality (5min sampling period with 7 days seasonality: 7*288) used by Holt-Winters model", - "TrainLength": "Training length (5min sampling period with 7 days seasonality and 5 cycles training: 7*288*5) used by Holt-Winters", - "Alpha": "Smoothing parameter (range 0-1, default 0.2)", - "Beta": "Trend parameter (range 0-1, default 0) ", - "Gamma": "Seasonality (range 0-1, default 0.05)", - "Deviation Threshold": "Approximately a limit on the factor by how much current value has deviated compared to expected variance" - }, - "Onset signature trigger": { - "RetryTimer": "Minimum interval between policy triggers" - }, - "Abatement signature trigger": { - "Hw-Timeout": "Maximum time for an HealthCheck response (measured from the time a positive App-C response was received)", - "OnSetMessage": "Value of field Message sent by Analytics Engine published on UEB " - }, - "Onset & abatement UEB notification ": { - "AbatementMessage": "Value of field AbatementMessage sent by Analytics Engine published on UEB", - "PolicyName": "Value of field PolicyName sent by Analytics Engine published on UEB" - } - }, - "policyDescription": "Policy to detect instances where count of Formatted table ? exceeds a predicted level. \n Notes \n (1) Vertica metrics normalized and combined in ? per Customer, per Site and per VM. \n (2) Anomaly detection model operates on ? \n (3) Anomaly detection consists of detecting deviations from Holt-Winters predictions. \n (4) Actions: Send email and/or UEB notification" - }, - { - "serviceTypePolicyName": "Registration storm(Trinity)", - "verticaMetrics": "", - "attributes": { - "Onset&abatement anomaly detection": { - "SeasonLength": "Metric seasonality (5min sampling period with 7 days seasonality: 7*288) used by Holt-Winters model", - "TrainLength": "Training length (5min sampling period with 7 days seasonality and 5 cycles training: 7*288*5) used by Holt-Winters", - "Alpha": "Smoothing parameter (range 0-1, default 0.2)", - "Beta": "Trend parameter (range 0-1, default 0) ", - "Gamma": "Seasonality (range 0-1, default 0.05)", - "Deviation Threshold": "Approximately a limit on the factor by how much current value has deviated compared to expected variance" - }, - "Onset signature trigger": { - "RetryTimer": "Minimum interval between policy triggers" - }, - "Abatement signature trigger": { - "Hw-Timeout": "Maximum time for an HealthCheck response (measured from the time a positive App-C response was received)", - "OnSetMessage": "Value of field Message sent by Analytics Engine published on UEB " - }, - "Onset & abatement UEB notification ": { - "AbatementMessage": "Value of field AbatementMessage sent by Analytics Engine published on UEB", - "PolicyName": "Value of field PolicyName sent by Analytics Engine published on UEB" - } - }, - "policyDescription": "Policy to detect instances where count of Formatted table ? exceeds a predicted level. \n Notes \n (1) Vertica metrics normalized and combined in ? per Customer, per Site and per VM. \n (2) Anomaly detection model operates on ? \n (3) Anomaly detection consists of detecting deviations from Holt-Winters predictions. \n (4) Actions: Send email and/or UEB notification" - } -] \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Properties/config.json b/ecomp-sdk-app/src/main/webapp/app/policyApp/Properties/config.json deleted file mode 100644 index 0d4fa3033..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Properties/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "PAP_URL" : "http://localhost:8070/pap/@Auth@dGVzdHBhcDphbHBoYTEyMw==" -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/ActionPolicyDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/ActionPolicyDictionary.html deleted file mode 100644 index b30fc7530..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/ActionPolicyDictionary.html +++ /dev/null @@ -1,89 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/AttributeDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/AttributeDictionary.html deleted file mode 100644 index e8ff563a5..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/AttributeDictionary.html +++ /dev/null @@ -1,80 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/BRMSParamDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/BRMSParamDictionary.html deleted file mode 100644 index d8013b997..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/BRMSParamDictionary.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLPepOptionsDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLPepOptionsDictionary.html deleted file mode 100644 index fba9e8de8..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLPepOptionsDictionary.html +++ /dev/null @@ -1,65 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLServiceTypeDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLServiceTypeDictionary.html deleted file mode 100644 index c3d0d3fac..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLServiceTypeDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLSiteDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLSiteDictionary.html deleted file mode 100644 index f140f9d1b..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLSiteDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVarbindDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVarbindDictionary.html deleted file mode 100644 index 52754586c..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVarbindDictionary.html +++ /dev/null @@ -1,48 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVnfTypeDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVnfTypeDictionary.html deleted file mode 100644 index 3e01e6844..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVnfTypeDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVsclActionDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVsclActionDictionary.html deleted file mode 100644 index 7716122dc..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/CLVsclActionDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/DecisionSettingsDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/DecisionSettingsDictionary.html deleted file mode 100644 index 072ccbdb1..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/DecisionSettingsDictionary.html +++ /dev/null @@ -1,60 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/DescriptiveScopeDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/DescriptiveScopeDictionary.html deleted file mode 100644 index 2daaaf815..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/DescriptiveScopeDictionary.html +++ /dev/null @@ -1,65 +0,0 @@ - - - \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/EcompNameDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/EcompNameDictionary.html deleted file mode 100644 index 8bfb091de..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/EcompNameDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/EnforcerTypeDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/EnforcerTypeDictionary.html deleted file mode 100644 index 87aaae473..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/EnforcerTypeDictionary.html +++ /dev/null @@ -1,51 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWActionListDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWActionListDictionary.html deleted file mode 100644 index 8bbb2cfd1..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWActionListDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWAddressGroupDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWAddressGroupDictionary.html deleted file mode 100644 index b0f9d6556..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWAddressGroupDictionary.html +++ /dev/null @@ -1,62 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWParentListDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWParentListDictionary.html deleted file mode 100644 index f7de1685e..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWParentListDictionary.html +++ /dev/null @@ -1,81 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWPortListDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWPortListDictionary.html deleted file mode 100644 index cb0991133..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWPortListDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWPrefixListDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWPrefixListDictionary.html deleted file mode 100644 index ab96f1faa..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWPrefixListDictionary.html +++ /dev/null @@ -1,49 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWProtocolListDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWProtocolListDictionary.html deleted file mode 100644 index 92f478750..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWProtocolListDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWSecurityZoneDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWSecurityZoneDictionary.html deleted file mode 100644 index 2e47c7ce1..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWSecurityZoneDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWServiceGroupDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWServiceGroupDictionary.html deleted file mode 100644 index 0936d342e..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWServiceGroupDictionary.html +++ /dev/null @@ -1,57 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWServiceListDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWServiceListDictionary.html deleted file mode 100644 index 46d2f1d24..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWServiceListDictionary.html +++ /dev/null @@ -1,87 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWTermListDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWTermListDictionary.html deleted file mode 100644 index 62b9f9b2d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWTermListDictionary.html +++ /dev/null @@ -1,176 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWZoneDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWZoneDictionary.html deleted file mode 100644 index 3ccc4660e..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/FWZoneDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSConfigNameDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSConfigNameDictionary.html deleted file mode 100644 index d1dfd80c6..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSConfigNameDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSDCAEUUIDDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSDCAEUUIDDictionary.html deleted file mode 100644 index 3edaf78fb..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSDCAEUUIDDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSLocationDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSLocationDictionary.html deleted file mode 100644 index d6994e951..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSLocationDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSModelsDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSModelsDictionary.html deleted file mode 100644 index 816192e97..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/MSModelsDictionary.html +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSClosedLoopDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSClosedLoopDictionary.html deleted file mode 100644 index eeb2def79..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSClosedLoopDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSGroupPolicyScopeDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSGroupPolicyScopeDictionary.html deleted file mode 100644 index 93371ea97..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSGroupPolicyScopeDictionary.html +++ /dev/null @@ -1,65 +0,0 @@ - - - \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSResourceDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSResourceDictionary.html deleted file mode 100644 index c7d0f35d7..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSResourceDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSServiceDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSServiceDictionary.html deleted file mode 100644 index b2b9589bb..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSServiceDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSTypeDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSTypeDictionary.html deleted file mode 100644 index f48e71f3c..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/PSTypeDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/RiskTypeDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/RiskTypeDictionary.html deleted file mode 100644 index 75b49bf46..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/RiskTypeDictionary.html +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/SafePolicyWarningDictionary.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/SafePolicyWarningDictionary.html deleted file mode 100644 index 726e02235..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Dictionary/SafePolicyWarningDictionary.html +++ /dev/null @@ -1,49 +0,0 @@ - - - \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Edit_Roles_Window.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Edit_Roles_Window.html deleted file mode 100644 index 2c19e02dd..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/Edit_Roles_Window.html +++ /dev/null @@ -1,48 +0,0 @@ - - - \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PDPTabWindows/AddorEditPDPtoGroup.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PDPTabWindows/AddorEditPDPtoGroup.html deleted file mode 100644 index a38b0bb9e..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PDPTabWindows/AddorEditPDPtoGroup.html +++ /dev/null @@ -1,56 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PDPTabWindows/PdpStatusWindow.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PDPTabWindows/PdpStatusWindow.html deleted file mode 100644 index 195ac8332..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PDPTabWindows/PdpStatusWindow.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PushtabWindow/removeGroupPoliciesWindow.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PushtabWindow/removeGroupPoliciesWindow.html deleted file mode 100644 index 389d31374..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/PushtabWindow/removeGroupPoliciesWindow.html +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/new_PDPGroup_Window.html b/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/new_PDPGroup_Window.html deleted file mode 100644 index 9de838015..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/Windows/new_PDPGroup_Window.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/AutoPushController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/AutoPushController.js deleted file mode 100644 index c6a6e3587..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/AutoPushController.js +++ /dev/null @@ -1,201 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -app.controller('policyPushController', function ($scope, PDPService, AdminTabService, AutoPushService, modalService, $modal, Notification,$filter){ - $( "#dialog" ).hide(); - - $scope.isDisabled = true; - $scope.loading = true; - - AdminTabService.getData().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.lockdowndata = JSON.parse($scope.data.lockdowndata); - if($scope.lockdowndata[0].lockdown == true){ - $scope.isDisabled = true; - }else{ - $scope.isDisabled = false; - } - console.log($scope.data); - },function(error){ - console.log("failed"); - }); - - $scope.pdpdata; - PDPService.getPDPData().then(function (data) { - var j = data; - $scope.pdpdata = JSON.parse(j.data); - console.log($scope.pdpdata); - $scope.pushTabPDPGrid.data = $scope.pdpdata; - }, function (error) { - console.log("failed"); - }); - - $scope.getPDPData = function(){ - $scope.pushTabPDPGrid.data = $scope.pdpdata; - }; - $scope.filterPdpGroup; - $scope.filterPDPGroupData = function() { - $scope.pushTabPDPGrid.data = $filter('filter')($scope.pdpdata, $scope.filterPdpGroup, undefined); - }; - - $scope.pushTabPDPGrid = { - onRegisterApi: function(gridApi) { - $scope.gridApi = gridApi; - }, - enableFiltering: true, - columnDefs: [ - { field: 'default',displayName : '', enableFiltering : false, enableSorting : false, - cellTemplate: ' ', - width: '8%' - }, - { field: 'id', displayName : 'ID'}, - { field: 'name', displayName : 'Name' }, - { field: 'description' } - ] - }; - - - $scope.editPDPGroupWindow = function (selectedPdpGroupData) { - $scope.removePDPGroupPolicies = selectedPdpGroupData; - if($scope.isDisabled){ - Notification.error("Policy Application has been LockDown."); - }else{ - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl: 'remove_PDPGroupPolicies_popup.html', - controller: 'removeGroupPoliciesController', - resolve: { - message: function () { - var message = { - selectedPdpGroupData: $scope.removePDPGroupPolicies - }; - return message; - } - } - }); - modalInstance.result.then(function (response) { - console.log('response', response); - $scope.pdpdata = JSON.parse(response.data); - $scope.pushTabPDPGrid.data = $scope.pdpdata; - }); - } - }; - - $scope.gridOptions = { - onRegisterApi: function(gridApi) { - $scope.gridPolicyApi = gridApi; - }, - enableSorting: true, - enableFiltering: true, - showTreeExpandNoChildren: true, - paginationPageSizes: [10, 20, 50, 100], - paginationPageSize: 20, - columnDefs: [{name: 'name'}, {name: 'version'}, {name: 'dateModified'}] - }; - - $scope.files; - var data = []; - $scope.filterPolicy; - $scope.filterPolicyData = function() { - $scope.gridOptions.data = $filter('filter')($scope.files, $scope.filterPolicy, undefined); - }; - - AutoPushService.getAutoPushPoliciesData().then(function (data1) { - $scope.loading = false; - $scope.files = data1.data; - var data = data1.data; - - var id=0; - var writeoutNode = function(childArray, currentLevel, dataArray){ - childArray.forEach( function(childNode){ - if (childNode.files.length > 0){ - childNode.$$treeLevel = currentLevel; - id=childNode.categoryId; - if(childNode.categoryId == childNode.parentCategoryId){ - childNode.parent=''; - } - }else{ - if((id!=childNode.parentCategoryId) || (childNode.categoryId == childNode.parentCategoryId)){ - if(childNode.categoryId == childNode.parentCategoryId){ - childNode.parent=''; - } - childNode.$$treeLevel = currentLevel; - } - } - dataArray.push( childNode ); - writeoutNode( childNode.files, currentLevel + 1, dataArray ); - }); - }; - - $scope.gridOptions.data = []; - writeoutNode(data, 0, $scope.gridOptions.data); - }, function (error) { - console.log("failed"); - }); - - - - $scope.pushPoliciesButton = function(){ - var policySelection = $scope.gridPolicyApi.selection.getSelectedRows(); - console.log(policySelection); - var currentSelection = $scope.gridApi.selection.getSelectedRows(); - if(policySelection.length == 0 && currentSelection.length == 0){ - Notification.error("Please Select Policy and PDP Group to Push"); - } - if(policySelection.length == 0 && currentSelection.length != 0){ - Notification.error("Please Select Policy to Push"); - } - if(policySelection.length != 0 && currentSelection.length == 0){ - Notification.error("Please Select PDP Group to Push"); - } - if(policySelection.length != 0 && currentSelection.length != 0){ - var finalData = { - "pdpDatas": currentSelection, - "policyDatas": policySelection - }; - console.log(finalData); - var uuu = "auto_Push/PushPolicyToPDP.htm"; - var postData={pushTabData: finalData}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.data=data.data; - $scope.pdpdata = JSON.parse(data.data); - $scope.pushTabPDPGrid.data = $scope.pdpdata; - Notification.success("Policy Pushed Successfully"); - }); - console.log($scope.data); - }, - error : function(data){ - Notification.error("Error Occured while Pushing Policy."); - } - }); - - } - }; - - -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/AutoPushTabController/RemovePDPGroupPoliciesController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/AutoPushTabController/RemovePDPGroupPoliciesController.js deleted file mode 100644 index 2a6c8c38f..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/AutoPushTabController/RemovePDPGroupPoliciesController.js +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var removeGroupPoliciesController = function ($scope, $modalInstance, message, Notification){ - if(message.selectedPdpGroupData !=null){ - $scope.label='Remove PDP Group Policies' - $scope.disableCd=true; - } - $scope.policies = message.selectedPdpGroupData.policies; - $scope.pdpGroupData = message.selectedPdpGroupData; - - $scope.removePoliciesGrid = { - data : 'policies', - enableFiltering: true, - columnDefs: [ - { field: 'root', displayName : 'Root', width : '10%'}, - { field: 'name', displayName : 'Name' }, - { field: 'version' , width : '10%'}, - { field: 'id' } - ] - }; - - $scope.removePoliciesGrid.onRegisterApi = function(gridApi){ - //set gridApi on scope - $scope.gridApi = gridApi; - gridApi.selection.on.rowSelectionChanged($scope,function(row){ - var msg = 'row selected ' + row.isSelected; - }); - - gridApi.selection.on.rowSelectionChangedBatch($scope,function(rows){ - var msg = 'rows changed ' + rows.length; - }); - }; - - $scope.removePolicies = function() { - $scope.removeGroupData = []; - angular.forEach($scope.gridApi.selection.getSelectedRows(), function (data, index) { - $scope.removeGroupData.push(data); - }); - var uuu = "auto_Push/remove_GroupPolicies.htm"; - var postData={data: $scope.removeGroupData, - activePdpGroup : $scope.pdpGroupData}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.data=data.data;}); - console.log($scope.data); - $modalInstance.close({data:$scope.data}); - Notification.success("Policy Removed Successfully"); - }, - error : function(data){ - Notification.error("Error Occured while removing Policy"); - } - }); - - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/DictionaryController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/DictionaryController.js deleted file mode 100644 index ea3f6c8dc..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/DictionaryController.js +++ /dev/null @@ -1,82 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -var mainDictionarys = ["Action Policy", "BRMS Policy", "Common Dictionary", "ClosedLoop Policy","Decision Policy", "Descriptive Policy", - "Enforcer Policy", "Firewall Policy", "MicroService Policy", "Policy Scope", "Safe Policy Dictionary"]; -var subDictionarys = [["Action Dictionary"], - ["BRMS Param Template"], - ["Attribute Dictionary","EcompName Dictionary"], - ["PEP Options","Site Dictionary","Service Dictionary","Varbind Dictionary", "VNF Type","VSCL Action"], - ["Settings Dictionary"], - ["Descriptive Scope"], - ["Enforcer Dictionary"], - ["Action List", "Address Group", "Parent Dictionary List", "Port List", "Prefix List", "Protocol List", "Security Zone", "Service Group", "Service List", "Term List", "Zone"], - ["DCAE UUID","MicroService ConfigName","MicroService Location", "MicroService Models"], - ["Closed Loop", "Group Policy Scope", "Resource", "Service", "Type"], - ["Risk Type", "Safe Policy Warning"]]; -app.controller('dictionaryTabController', function ($scope, AdminTabService, modalService, $modal){ - $( "#dialog" ).hide(); - - $scope.isDisabled = true; - AdminTabService.getData().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.lockdowndata = JSON.parse($scope.data.lockdowndata); - if($scope.lockdowndata[0].lockdown == true){ - $scope.isDisabled = true; - this.isDisabled = true; - }else{ - $scope.isDisabled = false; - this.isDisabled = false; - } - console.log($scope.data); - },function(error){ - console.log("failed"); - }); - - $scope.options1 = mainDictionarys; - $scope.options2 = []; - $scope.getOptions2 = function(){ - var key = $scope.options1.indexOf($scope.option1); - var myNewOptions = subDictionarys[key]; - $scope.options2 = myNewOptions; - }; - - $scope.import = function() { - $scope.data = {}; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'import_dictionary_popup.html', - controller: 'importDictionaryController', - resolve: { - message: function () { - var message = { - data: $scope.data - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - }); - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/FileSaver.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/FileSaver.js deleted file mode 100644 index 8a77cd007..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/FileSaver.js +++ /dev/null @@ -1,170 +0,0 @@ -var saveAs = saveAs || (function(view) { - "use strict"; - // IE <10 is explicitly unsupported - if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) { - return; - } - var - doc = view.document - // only get URL when necessary in case Blob.js hasn't overridden it yet - , get_URL = function() { - return view.URL || view.webkitURL || view; - } - , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a") - , can_use_save_link = "download" in save_link - , click = function(node) { - var event = new MouseEvent("click"); - node.dispatchEvent(event); - } - , is_safari = /constructor/i.test(view.HTMLElement) - , throw_outside = function(ex) { - (view.setImmediate || view.setTimeout)(function() { - throw ex; - }, 0); - } - , force_saveable_type = "application/octet-stream" - // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to - , arbitrary_revoke_timeout = 1000 * 40 // in ms - , revoke = function(file) { - var revoker = function() { - if (typeof file === "string") { // file is an object URL - get_URL().revokeObjectURL(file); - } else { // file is a File - file.remove(); - } - }; - setTimeout(revoker, arbitrary_revoke_timeout); - } - , dispatch = function(filesaver, event_types, event) { - event_types = [].concat(event_types); - var i = event_types.length; - while (i--) { - var listener = filesaver["on" + event_types[i]]; - if (typeof listener === "function") { - try { - listener.call(filesaver, event || filesaver); - } catch (ex) { - throw_outside(ex); - } - } - } - } - , auto_bom = function(blob) { - // prepend BOM for UTF-8 XML and text/* types (including HTML) - // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF - if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { - return new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type}); - } - return blob; - } - , FileSaver = function(blob, name, no_auto_bom) { - if (!no_auto_bom) { - blob = auto_bom(blob); - } - // First try a.download, then web filesystem, then object URLs - var - filesaver = this - , type = blob.type - , force = type === force_saveable_type - , object_url - , dispatch_all = function() { - dispatch(filesaver, "writestart progress write writeend".split(" ")); - } - // on any filesys errors revert to saving with object URLs - , fs_error = function() { - if (force && is_safari && view.FileReader) { - // Safari doesn't allow downloading of blob urls - var reader = new FileReader(); - reader.onloadend = function() { - var base64Data = reader.result; - view.location.href = "data:attachment/file" + base64Data.slice(base64Data.search(/[,;]/)); - filesaver.readyState = filesaver.DONE; - dispatch_all(); - }; - reader.readAsDataURL(blob); - filesaver.readyState = filesaver.INIT; - return; - } - // don't create more object URLs than needed - if (!object_url) { - object_url = get_URL().createObjectURL(blob); - } - if (force) { - view.location.href = object_url; - } else { - var opened = view.open(object_url, "_blank"); - if (!opened) { - // Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html - view.location.href = object_url; - } - } - filesaver.readyState = filesaver.DONE; - dispatch_all(); - revoke(object_url); - } - ; - filesaver.readyState = filesaver.INIT; - - if (can_use_save_link) { - object_url = get_URL().createObjectURL(blob); - setTimeout(function() { - save_link.href = object_url; - save_link.download = name; - click(save_link); - dispatch_all(); - revoke(object_url); - filesaver.readyState = filesaver.DONE; - }); - return; - } - - fs_error(); - } - , FS_proto = FileSaver.prototype - , saveAs = function(blob, name, no_auto_bom) { - return new FileSaver(blob, name || blob.name || "download", no_auto_bom); - } - ; - // IE 10+ (native saveAs) - if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) { - return function(blob, name, no_auto_bom) { - name = name || blob.name || "download"; - - if (!no_auto_bom) { - blob = auto_bom(blob); - } - return navigator.msSaveOrOpenBlob(blob, name); - }; - } - - FS_proto.abort = function(){}; - FS_proto.readyState = FS_proto.INIT = 0; - FS_proto.WRITING = 1; - FS_proto.DONE = 2; - - FS_proto.error = - FS_proto.onwritestart = - FS_proto.onprogress = - FS_proto.onwrite = - FS_proto.onabort = - FS_proto.onerror = - FS_proto.onwriteend = - null; - - return saveAs; - }( - typeof self !== "undefined" && self - || typeof window !== "undefined" && window - || this.content - )); -// `self` is undefined in Firefox for Android content script context -// while `this` is nsIContentFrameMessageManager -// with an attribute `content` that corresponds to the window - -if (typeof module !== "undefined" && module.exports) { - module.exports.saveAs = saveAs; -} else if ((typeof define !== "undefined" && define !== null) && (define.amd !== null)) { - define([], function() { - return saveAs; - }); -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/ImportDictionaryController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/ImportDictionaryController.js deleted file mode 100644 index c8e535363..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/ImportDictionaryController.js +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var importDictionaryController = function ($scope, $modalInstance, message, $http, PapUrlService, UserInfoService){ - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.uploadFile = function(files) { - var fd = new FormData(); - fd.append("file", files[0]); - - $http.post(papUrl + "/ecomp/dictionary/import_dictionary.htm/" + loginId, fd, { - withCredentials: false, - headers: {'Content-Type': undefined}, - transformRequest: angular.identity - }).success().error( ); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PDPTabController/AddorEditPdpInGroup.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PDPTabController/AddorEditPdpInGroup.js deleted file mode 100644 index c1d42287d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PDPTabController/AddorEditPdpInGroup.js +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var pdpInGroupController = function ($scope, $modalInstance, message, Notification){ - $scope.edit = 'false'; - if(message.pdpInGroup==null) - $scope.label='Add PDP to Group' - else{ - $scope.label='Edit PDP In Group' - $scope.disableCd=true; - $scope.edit = 'true'; - } - $scope.editPDPInGroup = message.pdpInGroup; - $scope.editActivePDP = message.activePDP; - - $scope.savePDPInGroup = function(pdpInGroup) { - var uuu = "pdp_Group/save_pdpTogroup.htm"; - var postData={pdpInGroup: pdpInGroup, - activePDP: $scope.editActivePDP, - update : $scope.edit}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.data=data.data;}); - console.log($scope.data); - $modalInstance.close({data:$scope.data}); - }, - error : function(data){ - Notification.error("Error Occured while Creating/Updating a PDP Group"); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PDPTabController/PDPGroupStatusController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PDPTabController/PDPGroupStatusController.js deleted file mode 100644 index 293b853b9..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PDPTabController/PDPGroupStatusController.js +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var pdpGroupStatusController = function ($scope, $modalInstance, message){ - if(message.status==null) { - $scope.label = 'No Status to Display' - }else{ - $scope.label='Status' - $scope.disableCd=true; - $scope.policies = message.policies; - $scope.pdpStatusDatas = message.status; - } - - $scope.policiesGrid = { - data : 'policies', - enableFiltering: true, - columnDefs: [ - { field: 'name', displayName : 'Name' } - ] - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PolicyAddScopeRoleController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PolicyAddScopeRoleController.js deleted file mode 100644 index 4722144bc..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PolicyAddScopeRoleController.js +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - * - */ -var editRoleController = function ($scope, RolesTabService, $modalInstance, message){ - if(message.editRoleData!=null){ - $scope.label='Edit Role' - $scope.disableCd=true; - } - $scope.editRole = message.editRoleData; - - RolesTabService.getPolicyScopesData().then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.scopeDatas = JSON.parse($scope.data.scopeDatas); - console.log($scope.scopeDatas); - }, function (error) { - console.log("failed"); - }); - - $scope.saveRole = function(editRoleData) { - var uuu = "save_NonSuperRolesData.htm"; - var postData={editRoleData: editRoleData}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.rolesDatas=data.rolesDatas;}); - console.log($scope.rolesDatas); - $modalInstance.close({rolesDatas:$scope.rolesDatas}); - }, - error : function(data){ - alert("Error while saving Role."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PolicyRolesController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PolicyRolesController.js deleted file mode 100644 index d5859abe3..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/PolicyRolesController.js +++ /dev/null @@ -1,95 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - * - */ -app.controller('policyRolesController', function ($scope, RolesTabService,modalService, $modal, AdminTabService, Notification){ - $( "#dialog" ).hide(); - - $scope.isDisabled = true; - AdminTabService.getData().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.lockdowndata = JSON.parse($scope.data.lockdowndata); - if($scope.lockdowndata[0].lockdown == true){ - $scope.isDisabled = true; - }else{ - $scope.isDisabled = false; - } - console.log($scope.data); - },function(error){ - console.log("failed"); - }); - - $scope.scopeDatas = []; - RolesTabService.getRolesData().then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.rolesDatas = JSON.parse($scope.data.rolesDatas); - console.log($scope.rolesDatas); - }, function (error) { - console.log("failed"); - }); - - $scope.rolesTableGrid = { - data : 'rolesDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, - cellTemplate: - '', width: '8%' - }, - { field: 'loginId.userName', displayName : 'Name'}, - { field: 'scope', displayName : 'Scope' }, - { field: 'role', displayName : 'Role' } - ] - }; - - - $scope.editRoleName = null; - - $scope.editRolesWindow = function(editRoleData) { - if($scope.lockdowndata[0].lockdown == true){ - Notification.error("Policy Application has been Locked") - }else{ - $scope.editRoleName = editRoleData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'edit_Role_popup.html', - controller: 'editRoleController', - resolve: { - message: function () { - var message = { - editRoleData: $scope.editRoleName - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - }); - } - - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dashboardController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dashboardController.js deleted file mode 100644 index 9ff974351..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dashboardController.js +++ /dev/null @@ -1,125 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -app.controller('policyDashboardHealthController', function ($scope,DashboardService,modalService, $modal){ - $( "#dialog" ).hide(); - $scope.pdpTableDatas = []; - $scope.papTableDatas = []; - $scope.policyActivityTableDatas = []; - DashboardService.getSystemAlertData().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.systemAlertsTableDatas =JSON.parse($scope.data.systemAlertsTableDatas); - },function(error){ - console.log("failed"); - //reloadPageOnce(); - }); - - DashboardService.getPAPStatusData().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.papTableMapDatas =JSON.parse($scope.data.papTableDatas); - if($scope.papTableMapDatas != null){ - for(i = 0; i < $scope.papTableMapDatas.length; i++){ - $scope.papTableDatas.push($scope.papTableMapDatas[i].map); - } - } - },function(error){ - console.log("failed"); - //reloadPageOnce(); - }); - - DashboardService.getPDPStatusData().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.pdpTableMapDatas =JSON.parse($scope.data.pdpTableDatas); - if($scope.pdpTableMapDatas != null) { - for (i = 0; i < $scope.pdpTableMapDatas.length; i++) { - $scope.pdpTableDatas.push($scope.pdpTableMapDatas[i].map); - } - } - },function(error){ - console.log("failed"); - //reloadPageOnce(); - }); - - DashboardService.getPolicyActivityData().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.policyActivityTableMapDatas =JSON.parse($scope.data.policyActivityTableDatas); - if($scope.policyActivityTableMapDatas != null) { - for (i = 0; i < $scope.policyActivityTableMapDatas.length; i++) { - $scope.policyActivityTableDatas.push($scope.policyActivityTableMapDatas[i].map); - } - } - },function(error){ - console.log("failed"); - //reloadPageOnce(); - }); - - $scope.availableGridHealthDatas = { - data : 'systemAlertsTableDatas', - enableFiltering: true, - columnDefs: [{ field: 'id'}, - { field: 'type'}, - { field: 'system'}, - {field: 'logtype'}, - {field : 'date' ,type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field : 'description'} - ], - }; - - $scope.papStatusDatas = { - data : 'papTableDatas', - enableFiltering: true, - columnDefs: [{ field: 'system'}, - { field: 'status'}, - { field: 'noOfPolicy'}, - {field: 'noOfConnectedTrap'} - ], - }; - - $scope.pdpStatusDatas = { - data : 'pdpTableDatas', - enableFiltering: true, - columnDefs: [{ field: 'id'}, - { field: 'name'}, - { field: 'groupname'}, - {field: 'status'}, - {field : 'description' }, - {field : 'permitCount'}, - {field : 'denyCount'}, - {field : 'naCount'} - ], - }; - - $scope.policyActivityDatas = { - data : 'policyActivityTableDatas', - enableFiltering: true, - columnDefs: [{ field: 'policyId'}, - { field: 'fireCount'}, - { field: 'system'} - ], - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dashboard_Logging_Controller.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dashboard_Logging_Controller.js deleted file mode 100644 index 7b07b1d71..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dashboard_Logging_Controller.js +++ /dev/null @@ -1,81 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -app.controller('policyDashboardController', function ($scope,DashboardService,modalService, $modal, uiGridConstants,Grid){ - $( "#dialog" ).hide(); - - $scope.loading = true; - DashboardService.getData().then(function(data){ - $scope.loading = false; - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.availableLoggingDatas =JSON.parse($scope.data.availableLoggingDatas); - console.log($scope.availableLoggingDatas); - },function(error){ - console.log("failed"); - //reloadPageOnce(); - }); - - $scope.availableGridLoggingDatas = { - data : 'availableLoggingDatas', - enableFiltering: true, - columnDefs: [{ field: 'id'}, - { field: 'type'}, - { field: 'system'}, - {field: 'logtype'}, - {field : 'date' ,type: 'date', cellFilter: 'date:\'yyyy-MM-dd HH:MM:ss a\'' }, - {field : 'description'} - ], - enableGridMenu: true, - enableSelectAll: true, - exporterCsvFilename: 'DashboardLogging.csv', - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterFieldCallback: function(grid, row, col, input) { - if( col.name == 'date') { - var date = new Date(input); - return date; - } else { - return input; - } - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - - }; - -}); - diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js deleted file mode 100644 index 030f08f43..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js +++ /dev/null @@ -1,88 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editBRMSParamController = function ($scope, $modalInstance, message, $http, PapUrlService, UserInfoService, Notification){ - if(message.brmsParamDictionaryData==null) - $scope.label='Add BRMS Rule' - else{ - $scope.label='Edit BRMS Rule' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editBRMSParam = message.brmsParamDictionaryData; - - $scope.uploadFile = function(files) { - var fd = new FormData(); - fd.append("file", files[0]); - $http.post(papUrl + "/ecomp/brms_dictionary/set_BRMSParamData.htm", fd, { - withCredentials: false, - headers: {'Content-Type': undefined }, - transformRequest: angular.identity - }).success().error( ); - - }; - - $scope.MyFile = []; - $scope.saveBRMSParam = function(brmsParamDictionaryData) { - var file = $scope.MyFile; - var uuu = papUrl + "/ecomp/brms_dictionary/save_BRMSParam.htm"; - var postData={brmsParamDictionaryData: brmsParamDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.brmsParamDictionaryDatas=data.brmsParamDictionaryDatas;}); - if($scope.brmsParamDictionaryDatas == "Duplicate"){ - Notification.error("BRMSParan Dictionary exists with Same Name.") - }else{ - console.log($scope.brmsParamDictionaryDatas); - $modalInstance.close({brmsParamDictionaryDatas:$scope.brmsParamDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLPepOptionsDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLPepOptionsDictController.js deleted file mode 100644 index 5ec078f11..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLPepOptionsDictController.js +++ /dev/null @@ -1,120 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editPEPOptionsController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.pepOptionsDictionaryData==null) - $scope.label='Add PEP Options', - $scope.choices = []; - else{ - $scope.label='Edit PEP Options' - $scope.disableCd=true; - $scope.choices = []; - var headers = message.pepOptionsDictionaryData.actions; - var SplitChars = ':#@'; - if (headers.indexOf(SplitChars) >= 0) { - var splitHeader = headers.split(SplitChars); - var singleHeader = splitHeader; - var splitEqual = '=#@'; - for(i = 0; i < singleHeader.length; i++){ - if (singleHeader[i].indexOf(splitEqual) >= 0) { - var splitValue = singleHeader[i].split(splitEqual); - var key = splitValue[0]; - var value = splitValue[1]; - var newItemNo = $scope.choices.length+1; - $scope.choices.push({'id':'choice'+newItemNo, 'option': key , 'number' : value }); - } - } - }else{ - var splitEqual = '=#@'; - if (headers.indexOf(splitEqual) >= 0) { - var splitValue = headers.split(splitEqual); - var key = splitValue[0]; - var value = splitValue[1]; - $scope.choices.push({'id':'choice'+1, 'option': key , 'number' : value }); - } - } - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editPEPOptions = message.pepOptionsDictionaryData; - - $scope.saveCLPepOptions = function(pepOptionsDictionaryData) { - var finalData = extend(pepOptionsDictionaryData, $scope.actions[0]); - var uuu = papUrl + "/ecomp/cl_dictionary/save_pepOptions.htm"; - var postData={pepOptionsDictionaryData: finalData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.pepOptionsDictionaryDatas=data.pepOptionsDictionaryDatas;}); - if($scope.pepOptionsDictionaryDatas == "Duplicate"){ - Notification.error("PEP Options Dictionary exists with Same PEP Name.") - }else{ - console.log($scope.pepOptionsDictionaryDatas); - $modalInstance.close({pepOptionsDictionaryDatas:$scope.pepOptionsDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; - - function extend(obj, src) { - for (var key in src) { - if (src.hasOwnProperty(key)) obj[key] = src[key]; - } - return obj; - } - - $scope.actions = [{"attributes" : $scope.choices}]; - $scope.addNewChoice = function() { - var newItemNo = $scope.choices.length+1; - $scope.choices.push({'id':'choice'+newItemNo}); - }; - $scope.removeChoice = function() { - var lastItem = $scope.choices.length-1; - $scope.choices.splice(lastItem); - }; - -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLServiceDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLServiceDictController.js deleted file mode 100644 index c3acc72b2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLServiceDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editCLServiceController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.closedLoopServiceDictionaryData==null) - $scope.label='Add Service Name' - else{ - $scope.label='Edit Service Name' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editCLService = message.closedLoopServiceDictionaryData; - - $scope.saveCLServiceDict = function(closedLoopServiceDictionaryData) { - var uuu = papUrl + "/ecomp/cl_dictionary/save_service.htm"; - var postData={closedLoopServiceDictionaryData: closedLoopServiceDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.closedLoopServiceDictionaryDatas=data.closedLoopServiceDictionaryDatas;}); - if($scope.closedLoopServiceDictionaryDatas == "Duplicate"){ - Notification.error("ClosedLoop Service Dictionary exists with Same Service Name.") - }else{ - console.log($scope.closedLoopServiceDictionaryDatas); - $modalInstance.close({closedLoopServiceDictionaryDatas:$scope.closedLoopServiceDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLSiteDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLSiteDictController.js deleted file mode 100644 index 7150ca891..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLSiteDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editCLSiteController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.closedLoopSiteDictionaryData==null) - $scope.label='Add Site Name' - else{ - $scope.label='Edit Site Name' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editCLSite = message.closedLoopSiteDictionaryData; - - $scope.saveCLSite = function(closedLoopSiteDictionaryData) { - var uuu = papUrl + "/ecomp/cl_dictionary/save_siteName.htm"; - var postData={closedLoopSiteDictionaryData: closedLoopSiteDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.closedLoopSiteDictionaryDatas=data.closedLoopSiteDictionaryDatas;}); - if($scope.closedLoopSiteDictionaryDatas == "Duplicate"){ - Notification.error("ClosedLoop Site Dictionary exists with Same Site Name.") - }else{ - console.log($scope.closedLoopSiteDictionaryDatas); - $modalInstance.close({closedLoopSiteDictionaryDatas:$scope.closedLoopSiteDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVarbindDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVarbindDictController.js deleted file mode 100644 index 03c2eb345..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVarbindDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editCLVarbindController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.varbindDictionaryData==null) - $scope.label='Add Varbind ' - else{ - $scope.label='Edit Varbind' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editCLVarbind = message.varbindDictionaryData; - - $scope.saveCLVarbind = function(varbindDictionaryData) { - var uuu = papUrl + "/ecomp/cl_dictionary/save_varbind.htm"; - var postData={varbindDictionaryData: varbindDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.varbindDictionaryDatas=data.varbindDictionaryDatas;}); - if($scope.varbindDictionaryDatas == "Duplicate"){ - Notification.error("ClosedLoop Varbind Dictionary exists with Same Varbind Name.") - }else{ - console.log($scope.varbindDictionaryDatas); - $modalInstance.close({varbindDictionaryDatas:$scope.varbindDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVnfTypeDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVnfTypeDictController.js deleted file mode 100644 index 5b46e67a2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVnfTypeDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editVnfTypeController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.vnfTypeDictionaryData==null) - $scope.label='Add VNF Type' - else{ - $scope.label='Edit VNF Type' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editVnfType = message.vnfTypeDictionaryData; - - $scope.saveCLVnfType = function(vnfTypeDictionaryData) { - var uuu = papUrl + "/ecomp/cl_dictionary/save_vnfType.htm"; - var postData={vnfTypeDictionaryData: vnfTypeDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.vnfTypeDictionaryDatas=data.vnfTypeDictionaryDatas;}); - if($scope.vnfTypeDictionaryDatas == "Duplicate"){ - Notification.error("ClosedLoop VNFType Dictionary exists with Same VNFType Name.") - }else{ - console.log($scope.vnfTypeDictionaryDatas); - $modalInstance.close({vnfTypeDictionaryDatas:$scope.vnfTypeDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVsclActionDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVsclActionDictController.js deleted file mode 100644 index d69a30e7a..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/CLVsclActionDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editVsclActionController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.vsclActionDictionaryData==null) - $scope.label='Add VSCL Action' - else{ - $scope.label='Edit VSCL Action' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editvsclAction = message.vsclActionDictionaryData; - - $scope.saveCLVSCLAction = function(vsclActionDictionaryData) { - var uuu = papUrl + "/ecomp/cl_dictionary/save_vsclAction.htm"; - var postData={vsclActionDictionaryData: vsclActionDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.vsclActionDictionaryDatas=data.vsclActionDictionaryDatas;}); - if($scope.vsclActionDictionaryDatas == "Duplicate"){ - Notification.error("ClosedLoop VSCLAction Dictionary exists with Same VSCLAction Name.") - }else{ - console.log($scope.vsclActionDictionaryDatas); - $modalInstance.close({vsclActionDictionaryDatas:$scope.vsclActionDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/DecisionSettingsDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/DecisionSettingsDictController.js deleted file mode 100644 index cbe99c094..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/DecisionSettingsDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editSettingsDictController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.settingsDictionaryData==null) - $scope.label='Add Decision Settings' - else{ - $scope.label='Edit Decision Settings' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editSettingsDict = message.settingsDictionaryData; - - $scope.saveDecisionSettings = function(settingsDictionaryData) { - var uuu = papUrl + "/ecomp/decision_dictionary/save_Settings.htm"; - var postData={settingsDictionaryData: settingsDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.settingsDictionaryDatas=data.settingsDictionaryDatas;}); - if($scope.settingsDictionaryDatas == "Duplicate"){ - Notification.error("Decision Dictionary exists with Same Settings Name.") - }else{ - console.log($scope.settingsDictionaryDatas); - $modalInstance.close({settingsDictionaryDatas:$scope.settingsDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/DescriptiveSearchDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/DescriptiveSearchDictController.js deleted file mode 100644 index f78cedc24..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/DescriptiveSearchDictController.js +++ /dev/null @@ -1,121 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editDescriptiveScopeController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.descriptiveScopeDictionaryData==null) - $scope.label='Add Descriptive Scope', - $scope.choices = []; - else{ - $scope.label='Edit Descriptive Scope' - $scope.disableCd=true; - $scope.choices = []; - var headers = message.descriptiveScopeDictionaryData.search; - var SplitChars = 'AND'; - if (headers.indexOf(SplitChars) >= 0) { - var splitHeader = headers.split(SplitChars); - var singleHeader = splitHeader; - var splitEqual = ':'; - for(i = 0; i < singleHeader.length; i++){ - if (singleHeader[i].indexOf(splitEqual) >= 0) { - var splitValue = singleHeader[i].split(splitEqual); - var key = splitValue[0]; - var value = splitValue[1]; - var newItemNo = $scope.choices.length+1; - $scope.choices.push({'id':'choice'+newItemNo, 'option': key , 'number' : value }); - } - } - }else{ - var splitEqual = ':'; - if (headers.indexOf(splitEqual) >= 0) { - var splitValue = headers.split(splitEqual); - var key = splitValue[0]; - var value = splitValue[1]; - $scope.choices.push({'id':'choice'+1, 'option': key , 'number' : value }); - } - } - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editDescriptiveScope = message.descriptiveScopeDictionaryData; - - $scope.saveDescriptiveScope = function(descriptiveScopeDictionaryData) { - var finalData = extend(descriptiveScopeDictionaryData, $scope.actions[0]); - var uuu = papUrl + "/ecomp/descriptive_dictionary/save_descriptive.htm"; - var postData={descriptiveScopeDictionaryData: finalData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.descriptiveScopeDictionaryDatas=data.descriptiveScopeDictionaryDatas;}); - if($scope.descriptiveScopeDictionaryDatas == "Duplicate"){ - Notification.error("Descriptive Scope Dictionary exists with Same Scope Name.") - }else{ - console.log($scope.descriptiveScopeDictionaryDatas); - $modalInstance.close({descriptiveScopeDictionaryDatas:$scope.descriptiveScopeDictionaryDatas}); - } - - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; - - function extend(obj, src) { - for (var key in src) { - if (src.hasOwnProperty(key)) obj[key] = src[key]; - } - return obj; - } - - $scope.actions = [{"attributes" : $scope.choices}]; - $scope.addNewChoice = function() { - var newItemNo = $scope.choices.length+1; - $scope.choices.push({'id':'choice'+newItemNo}); - }; - $scope.removeChoice = function() { - var lastItem = $scope.choices.length-1; - $scope.choices.splice(lastItem); - }; - -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/EnforcerDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/EnforcerDictController.js deleted file mode 100644 index caf17204f..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/EnforcerDictController.js +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editEnforcerTypeController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService){ - if(message.enforcerDictionaryData==null) - $scope.label='Add Enforcing Type' - else{ - $scope.label='Edit Enforcing Type' - $scope.disableCd=true; - } - $scope.editEnforcerType = message.enforcerDictionaryData; - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.saveEnforcerType = function(enforcerDictionaryData) { - var uuu = papUrl + "/ecomp/enforcer_dictionary/save_enforcerType.htm"; - var postData={enforcerDictionaryData: enforcerDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.enforcerDictionaryDatas=data.enforcerDictionaryDatas;}); - console.log($scope.enforcerDictionaryDatas); - $modalInstance.close({enforcerDictionaryDatas:$scope.enforcerDictionaryDatas}); - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWActionListDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWActionListDictController.js deleted file mode 100644 index 14432e9b9..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWActionListDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editFWActionListController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.actionListDictionaryData==null) - $scope.label='Add Action Name' - else{ - $scope.label='Edit Action Name' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editActionList = message.actionListDictionaryData; - - $scope.saveFWActionList = function(actionListDictionaryData) { - var uuu = papUrl + "/ecomp/fw_dictionary/save_ActionList.htm"; - var postData={actionListDictionaryData: actionListDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.actionListDictionaryDatas=data.actionListDictionaryDatas;}); - if($scope.actionListDictionaryDatas == "Duplicate"){ - Notification.error("FW ActionList Dictionary exists with Same ActionList Name.") - }else{ - console.log($scope.actionListDictionaryDatas); - $modalInstance.close({actionListDictionaryDatas:$scope.actionListDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWAddressGroupDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWAddressGroupDictController.js deleted file mode 100644 index 57d9ae95d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWAddressGroupDictController.js +++ /dev/null @@ -1,120 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editFWAddressGroupController = function ($scope, $modalInstance, message, FWDictionaryService, PapUrlService, UserInfoService, Notification){ - if(message.addressGroupDictionaryData==null) - $scope.label='Add Address Group', - $scope.apchoices = []; - else{ - $scope.label='Edit Address Group' - $scope.disableCd=true; - $scope.apchoices = []; - var headers = message.addressGroupDictionaryData.prefixList; - var splitEqual = ','; - if(headers != null){ - if (headers.indexOf(splitEqual) >= 0) { - var splitValue = headers.split(splitEqual); - for(i = 0; i < splitValue.length; i++){ - var key = splitValue[i]; - $scope.apchoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = headers; - $scope.apchoices.push({'id':'choice'+1, 'option': key}); - } - } - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getPrefixListDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.prefixListDictionaryDatas = JSON.parse($scope.data.prefixListDictionaryDatas); - console.log($scope.prefixListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editAddressGroup = message.addressGroupDictionaryData; - - $scope.saveFWAddressGroup = function(addressGroupDictionaryData) { - var finalData = extend(addressGroupDictionaryData, $scope.attributeDatas[0]); - var uuu = papUrl + "/ecomp/fw_dictionary/save_addressGroup.htm"; - var postData={addressGroupDictionaryData: finalData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.addressGroupDictionaryDatas=data.addressGroupDictionaryDatas;}); - if($scope.addressGroupDictionaryDatas == "Duplicate"){ - Notification.error("FW AddressGroup Dictionary exists with Same Address group Name.") - }else{ - console.log($scope.addressGroupDictionaryDatas); - $modalInstance.close({addressGroupDictionaryDatas:$scope.addressGroupDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; - - function extend(obj, src) { - for (var key in src) { - if (src.hasOwnProperty(key)) obj[key] = src[key]; - } - return obj; - } - - $scope.attributeDatas = [{"attributes" : $scope.apchoices}]; - $scope.addAPNewChoice = function() { - var newItemNo = $scope.apchoices.length+1; - $scope.apchoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeAPChoice = function() { - var lastItem = $scope.apchoices.length-1; - $scope.apchoices.splice(lastItem); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWParentListDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWParentListDictController.js deleted file mode 100644 index d73faf5f7..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWParentListDictController.js +++ /dev/null @@ -1,156 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editFWParentListController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, FWDictionaryService, Notification){ - if(message.fwDictListDictionaryData==null){ - $scope.slchoices = []; - $scope.alchoices = []; - $scope.label='Add Parent List' - }else{ - $scope.label='Edit Parent List' - $scope.disableCd=true; - $scope.slchoices = []; - $scope.alchoices = []; - var slList = message.fwDictListDictionaryData.serviceList; - var alList = message.fwDictListDictionaryData.addressList; - var splitEqual = ','; - if(slList != null){ - if (slList.indexOf(splitEqual) >= 0) { - var splitValue = slList.split(splitEqual); - for(i = 0; i < splitValue.length; i++){ - var key = splitValue[i]; - $scope.slchoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = slList; - $scope.slchoices.push({'id':'choice'+1, 'option': key}); - } - } - if(alList != null){ - if (alList.indexOf(splitEqual) >= 0) { - var splitALValue = alList.split(splitEqual); - for(i = 0; i < splitALValue.length; i++){ - var key = splitALValue[i]; - $scope.alchoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = alList; - $scope.alchoices.push({'id':'choice'+1, 'option': key}); - } - } - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getServiceListDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.serviceListDictionaryDatas = JSON.parse($scope.data.serviceListDictionaryDatas); - console.log($scope.serviceListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - FWDictionaryService.getAddressGroupDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.addressGroupDictionaryDatas = JSON.parse($scope.data.addressGroupDictionaryDatas); - console.log($scope.addressGroupDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editParentList = message.fwDictListDictionaryData; - - $scope.saveFWParentList = function(fwDictListDictionaryData) { - var addSLData = extend(fwDictListDictionaryData, $scope.attributeDatas[0]); - var finalData = extend(addSLData, $scope.attributeALDatas[0]); - var uuu = papUrl + "/ecomp/fw_dictionary/save_FWDictionaryList.htm"; - var postData={fwDictListDictionaryData: finalData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.fwDictListDictionaryDatas=data.fwDictListDictionaryDatas;}); - if($scope.fwDictListDictionaryDatas == "Duplicate"){ - Notification.error("FW DictionaryList Dictionary exists with Same Name.") - }else{ - console.log($scope.fwDictListDictionaryDatas); - $modalInstance.close({fwDictListDictionaryDatas:$scope.fwDictListDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; - - function extend(obj, src) { - for (var key in src) { - if (src.hasOwnProperty(key)) obj[key] = src[key]; - } - return obj; - } - - - $scope.attributeDatas = [{"attributes" : $scope.slchoices}]; - $scope.addServiceGroupNewChoice = function() { - var newItemNo = $scope.slchoices.length+1; - $scope.slchoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeServiceGroupChoice = function() { - var lastItem = $scope.slchoices.length-1; - $scope.slchoices.splice(lastItem); - }; - - $scope.attributeALDatas = [{"alAttributes" : $scope.alchoices}]; - $scope.addAddressGroupNewChoice = function() { - var newItemNo = $scope.alchoices.length+1; - $scope.alchoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeAddressGroupChoice = function() { - var lastItem = $scope.alchoices.length-1; - $scope.alchoices.splice(lastItem); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWPortListDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWPortListDictController.js deleted file mode 100644 index a2fbfe6d2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWPortListDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editFWPortListController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.portListDictionaryData==null) - $scope.label='Add Port Name' - else{ - $scope.label='Edit Port Name' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editPortList = message.portListDictionaryData; - - $scope.saveFWPortList = function(portListDictionaryData) { - var uuu = papUrl + "/ecomp/fw_dictionary/save_portName.htm"; - var postData={portListDictionaryData: portListDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.portListDictionaryDatas=data.portListDictionaryDatas;}); - if($scope.portListDictionaryDatas == "Duplicate"){ - Notification.error("FW PortList Dictionary exists with Same Port Name.") - }else{ - console.log($scope.portListDictionaryDatas); - $modalInstance.close({portListDictionaryDatas:$scope.portListDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWPrefixListDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWPrefixListDictController.js deleted file mode 100644 index f4e66e09c..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWPrefixListDictController.js +++ /dev/null @@ -1,103 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editFWPrefixListController = function ($scope, $modalInstance, message, Notification, PapUrlService, UserInfoService, Notification){ - $scope.validate = 'false'; - if(message.prefixListDictionaryData==null) - $scope.label='Add PrefixList' - else{ - $scope.label='Edit PrefixList' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editPrefixList = message.prefixListDictionaryData; - - $scope.saveFWPrefixList = function(prefixListDictionaryData) { - if($scope.validate == 'true'){ - var uuu = papUrl + "/ecomp/fw_dictionary/save_prefixList.htm"; - var postData={prefixListDictionaryData: prefixListDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.prefixListDictionaryDatas=data.prefixListDictionaryDatas;}); - if($scope.prefixListDictionaryDatas == "Duplicate"){ - Notification.error("FW PrefixList Dictionary exists with Same PrefixList Name.") - }else{ - console.log($scope.prefixListDictionaryDatas); - $modalInstance.close({prefixListDictionaryDatas:$scope.prefixListDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }else{ - Notification.error('Prefix List Validation is Not Successful'); - } - - }; - - $scope.validateFWPrefixList = function(prefixListDictionaryData) { - var uuu = papUrl + "/ecomp/fw_dictionary/validate_prefixList.htm"; - var postData={prefixListDictionaryData: prefixListDictionaryData}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.result=data.result;}); - console.log($scope.result); - if($scope.result == 'error'){ - Notification.error('IP not according to CIDR notation'); - }else{ - $scope.validate = 'true'; - } - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWProtocolListDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWProtocolListDictController.js deleted file mode 100644 index 4de12b8fe..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWProtocolListDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editFWProtocolListController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.protocolListDictionaryData==null) - $scope.label='Add Protocol Name' - else{ - $scope.label='Edit Protocol Name' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editProtocolList = message.protocolListDictionaryData; - - $scope.saveProtocolList = function(protocolListDictionaryData) { - var uuu = papUrl + "/ecomp/fw_dictionary/save_protocolList.htm"; - var postData={protocolListDictionaryData: protocolListDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.protocolListDictionaryDatas=data.protocolListDictionaryDatas;}); - if($scope.protocolListDictionaryDatas == "Duplicate"){ - Notification.error("FW ProtocolList Dictionary exists with Same Protocol Name.") - }else{ - console.log($scope.protocolListDictionaryDatas); - $modalInstance.close({protocolListDictionaryDatas:$scope.protocolListDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js deleted file mode 100644 index cd43a41b8..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editfwSecurityZoneController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.securityZoneDictionaryData==null) - $scope.label='Add Security Zone' - else{ - $scope.label='Edit Security Zone' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editSecurityZone = message.securityZoneDictionaryData; - - $scope.saveSecurityZone = function(securityZoneDictionaryData) { - var uuu = papUrl + "/ecomp/fw_dictionary/save_securityZone.htm"; - var postData={securityZoneDictionaryData: securityZoneDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.securityZoneDictionaryDatas=data.securityZoneDictionaryDatas;}); - if($scope.securityZoneDictionaryDatas == "Duplicate"){ - Notification.error("FW SecurityZone Dictionary exists with Same Zone Name.") - }else{ - console.log($scope.securityZoneDictionaryDatas); - $modalInstance.close({securityZoneDictionaryDatas:$scope.securityZoneDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceGroupDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceGroupDictController.js deleted file mode 100644 index 3cf6d9be7..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceGroupDictController.js +++ /dev/null @@ -1,121 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editFWServiceGroupController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, FWDictionaryService, Notification){ - if(message.serviceGroupDictionaryData==null){ - $scope.slchoices = []; - $scope.label='Add Service Group' - }else{ - $scope.label='Edit Service Group' - $scope.disableCd=true; - $scope.slchoices = []; - var headers = message.serviceGroupDictionaryData.serviceList; - var splitEqual = ','; - if(headers != null){ - if (headers.indexOf(splitEqual) >= 0) { - var splitValue = headers.split(splitEqual); - for(i = 0; i < splitValue.length; i++){ - var key = splitValue[i]; - $scope.slchoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = headers; - $scope.slchoices.push({'id':'choice'+1, 'option': key}); - } - } - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getServiceListDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.serviceListDictionaryDatas = JSON.parse($scope.data.serviceListDictionaryDatas); - console.log($scope.serviceListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editServiceGroup = message.serviceGroupDictionaryData; - - $scope.saveFWServiceGroup = function(serviceGroupDictionaryData) { - var finalData = extend(serviceGroupDictionaryData, $scope.attributeDatas[0]); - var uuu = papUrl + "/ecomp/fw_dictionary/save_serviceGroup.htm"; - var postData={serviceGroupDictionaryData: finalData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.serviceGroupDictionaryDatas=data.serviceGroupDictionaryDatas;}); - if($scope.serviceGroupDictionaryDatas == "Duplicate"){ - Notification.error("FW Service Group Dictionary exists with Same Group Name.") - }else{ - console.log($scope.serviceGroupDictionaryDatas); - $modalInstance.close({serviceGroupDictionaryDatas:$scope.serviceGroupDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; - - function extend(obj, src) { - for (var key in src) { - if (src.hasOwnProperty(key)) obj[key] = src[key]; - } - return obj; - } - - - - $scope.attributeDatas = [{"attributes" : $scope.slchoices}]; - $scope.addServiceGroupNewChoice = function() { - var newItemNo = $scope.slchoices.length+1; - $scope.slchoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeServiceGroupChoice = function() { - var lastItem = $scope.slchoices.length-1; - $scope.slchoices.splice(lastItem); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceListDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceListDictController.js deleted file mode 100644 index 73da6c486..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceListDictController.js +++ /dev/null @@ -1,147 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editFWServiceListController = function ($scope, $modalInstance, message, FWDictionaryService, PapUrlService, UserInfoService, Notification){ - $scope.protocolListDictionaryDatas =[]; - - $scope.tpchoices = []; - $scope.apchoices = []; - if(message.serviceListDictionaryData==null){ - $scope.label='Add Service List' - }else{ - $scope.label='Edit Service List' - $scope.disableCd=true; - var tcpheaders = message.serviceListDictionaryData.serviceTransProtocol; - var splitEqual = ','; - if(tcpheaders != null){ - if (tcpheaders.indexOf(splitEqual) >= 0) { - var splitValue = tcpheaders.split(splitEqual); - for(i = 0; i < splitValue.length; i++){ - var key = splitValue[i]; - $scope.tpchoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = tcpheaders; - $scope.tpchoices.push({'id':'choice'+1, 'option': key}); - } - } - var appheaders = message.serviceListDictionaryData.serviceAppProtocol; - var splitEqual1 = ','; - if(appheaders != null){ - if (appheaders.indexOf(splitEqual1) >= 0) { - var splitValue1 = appheaders.split(splitEqual1); - for(i = 0; i < splitValue1.length; i++){ - var key1 = splitValue1[i]; - $scope.apchoices.push({'id':'choice'+i+1, 'option': key1}); - } - }else{ - var key1 = appheaders; - $scope.apchoices.push({'id':'choice'+1, 'option': key1}); - } - } - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getProtocolListDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.protocolListDictionaryDatas = JSON.parse($scope.data.protocolListDictionaryDatas); - console.log($scope.protocolListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editServiceList = message.serviceListDictionaryData; - - $scope.saveFWServiceList = function(serviceListDictionaryData) { - var addtcpData = extend(serviceListDictionaryData, $scope.attributeTCPDatas[0]); - var finalData = extend(addtcpData, $scope.attributeAPPDatas[0]); - var uuu = papUrl + "/ecomp/fw_dictionary/save_serviceList.htm"; - var postData={serviceListDictionaryData: finalData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.serviceListDictionaryDatas=data.serviceListDictionaryDatas;}); - if($scope.serviceListDictionaryDatas == "Duplicate"){ - Notification.error("FW ServiceList Dictionary exists with Same ServiceList Name.") - }else{ - console.log($scope.serviceListDictionaryDatas); - $modalInstance.close({serviceListDictionaryDatas:$scope.serviceListDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; - - function extend(obj, src) { - for (var key in src) { - if (src.hasOwnProperty(key)) obj[key] = src[key]; - } - return obj; - } - - $scope.attributeTCPDatas = [{"transportProtocols" : $scope.tpchoices}]; - $scope.addTPNewChoice = function() { - var newItemNo = $scope.tpchoices.length+1; - $scope.tpchoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeTPChoice = function() { - var lastItem = $scope.tpchoices.length-1; - $scope.tpchoices.splice(lastItem); - }; - - - $scope.attributeAPPDatas = [{"appProtocols" : $scope.apchoices}]; - $scope.addAPNewChoice = function() { - var newItemNo = $scope.apchoices.length+1; - $scope.apchoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeAPChoice = function() { - var lastItem = $scope.apchoices.length-1; - $scope.apchoices.splice(lastItem); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWTermListDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWTermListDictController.js deleted file mode 100644 index 8615082a2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWTermListDictController.js +++ /dev/null @@ -1,331 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editFWTermListController = function ($scope, $modalInstance, message, FWDictionaryService, PapUrlService, UserInfoService, Notification){ - $scope.fromZonechoices = []; - $scope.toZonechoices = []; - $scope.sourceListchoices = []; - $scope.destinationListchoices = []; - $scope.sourceServicechoices = []; - $scope.destinationServicechoices = []; - $scope.actionListchoices = []; - if(message.termListDictionaryData==null){ - $scope.label='Add Term List Name' - }else{ - $scope.label='Edit Term List Name' - $scope.disableCd=true; - var fromZoneheaders = message.termListDictionaryData.fromZone; - var splitFromZone = ','; - if(fromZoneheaders != null){ - if (fromZoneheaders.indexOf(splitFromZone) >= 0) { - var splitFromZoneValue = fromZoneheaders.split(splitFromZone); - for(i = 0; i < splitFromZoneValue.length; i++){ - var key = splitFromZoneValue[i]; - $scope.fromZonechoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = fromZoneheaders; - $scope.fromZonechoices.push({'id':'choice'+1, 'option': key}); - } - } - - var toZoneheaders = message.termListDictionaryData.toZone; - var splitToZone = ','; - if(toZoneheaders != null){ - if (toZoneheaders.indexOf(splitToZone) >= 0) { - var splitToZoneValue = toZoneheaders.split(splitToZone); - for(i = 0; i < splitToZoneValue.length; i++){ - var key = splitToZoneValue[i]; - $scope.toZonechoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = toZoneheaders; - $scope.toZonechoices.push({'id':'choice'+1, 'option': key}); - } - } - - var srcIPheaders = message.termListDictionaryData.srcIPList; - var splitSrcIP = ','; - if(srcIPheaders != null){ - if (srcIPheaders.indexOf(splitSrcIP) >= 0) { - var splitSrcIPValue = srcIPheaders.split(splitSrcIP); - for(i = 0; i < splitSrcIPValue.length; i++){ - var key = splitSrcIPValue[i]; - $scope.sourceListchoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = srcIPheaders; - $scope.sourceListchoices.push({'id':'choice'+1, 'option': key}); - } - } - - var desIPheaders = message.termListDictionaryData.destIPList; - var splitDesIP = ','; - if(desIPheaders != null){ - if (desIPheaders.indexOf(splitDesIP) >= 0) { - var splitDestIPValue = desIPheaders.split(splitDesIP); - for(i = 0; i < splitDestIPValue.length; i++){ - var key = splitDestIPValue[i]; - $scope.destinationListchoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = desIPheaders; - $scope.destinationListchoices.push({'id':'choice'+1, 'option': key}); - } - } - - var srcServheaders = message.termListDictionaryData.srcPortList; - var splitSrcServ = ','; - if(srcServheaders != null){ - if (srcServheaders.indexOf(splitSrcServ) >= 0) { - var splitSrcServValue = srcServheaders.split(splitSrcServ); - for(i = 0; i < splitSrcServValue.length; i++){ - var key = splitSrcServValue[i]; - $scope.sourceServicechoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = srcServheaders; - $scope.sourceServicechoices.push({'id':'choice'+1, 'option': key}); - } - } - - var desServheaders = message.termListDictionaryData.destPortList; - var splitdesSer = ','; - if(desServheaders != null){ - if (desServheaders.indexOf(splitdesSer) >= 0) { - var splitDesSerValue = desServheaders.split(splitdesSer); - for(i = 0; i < splitDesSerValue.length; i++){ - var key = splitDesSerValue[i]; - $scope.destinationServicechoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = desServheaders; - $scope.destinationServicechoices.push({'id':'choice'+1, 'option': key}); - } - } - - var actionheaders = message.termListDictionaryData.action; - var splitAction = ','; - if(actionheaders != null){ - if (actionheaders.indexOf(splitAction) >= 0) { - var splitActionValue = actionheaders.split(splitAction); - for(i = 0; i < splitActionValue.length; i++){ - var key = splitActionValue[i]; - $scope.actionListchoices.push({'id':'choice'+i+1, 'option': key}); - } - }else{ - var key = actionheaders; - $scope.actionListchoices.push({'id':'choice'+1, 'option': key}); - } - } - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getPrefixListDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.prefixListDictionaryDatas = JSON.parse($scope.data.prefixListDictionaryDatas); - console.log($scope.prefixListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - FWDictionaryService.getZoneDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.zoneDictionaryDatas = JSON.parse($scope.data.zoneDictionaryDatas); - console.log($scope.zoneDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - FWDictionaryService.getAddressGroupDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.addressGroupDictionaryDatas = JSON.parse($scope.data.addressGroupDictionaryDatas); - console.log($scope.addressGroupDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - FWDictionaryService.getServiceListDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.serviceListDictionaryDatas = JSON.parse($scope.data.serviceListDictionaryDatas); - console.log($scope.serviceListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - FWDictionaryService.getServiceGroupDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.serviceGroupDictionaryDatas = JSON.parse($scope.data.serviceGroupDictionaryDatas); - console.log($scope.serviceGroupDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - FWDictionaryService.getActionListDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.actionListDictionaryDatas = JSON.parse($scope.data.actionListDictionaryDatas); - console.log($scope.actionListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editTermList = message.termListDictionaryData; - - $scope.saveTermName = function(termListDictionaryData) { - var mergeFromZoneData = extend(termListDictionaryData, $scope.fromZoneDatas[0]); - var mergeToData = extend(mergeFromZoneData, $scope.toZoneDatas[0]); - var mergeSourceListData = extend(mergeToData, $scope.sourceListDatas[0]); - var mergeDListData = extend(mergeSourceListData, $scope.destinationListDatas[0]); - var mergeSServicesData = extend(mergeDListData, $scope.sourceServicesDatas[0]); - var mergeDServicesData = extend(mergeSServicesData, $scope.destinationServicesDatas[0]); - var finalData = extend(mergeDServicesData, $scope.actionListDatas[0]); - var uuu = papUrl + "/ecomp/fw_dictionary/save_termList.htm"; - var postData={termListDictionaryData: finalData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.termListDictionaryDatas=data.termListDictionaryDatas;}); - if($scope.termListDictionaryDatas == "Duplicate"){ - Notification.error("FW TermList Dictionary exists with Same Term Name.") - }else{ - console.log($scope.termListDictionaryDatas); - $modalInstance.close({termListDictionaryDatas:$scope.termListDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; - - - function extend(obj, src) { - for (var key in src) { - if (src.hasOwnProperty(key)) obj[key] = src[key]; - } - return obj; - } - - $scope.fromZoneDatas = [{"fromZoneDatas" : $scope.fromZonechoices}]; - $scope.addFromZoneNewChoice = function() { - var newItemNo = $scope.fromZonechoices.length+1; - $scope.fromZonechoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeFromZoneChoice = function() { - var lastItem = $scope.fromZonechoices.length-1; - $scope.fromZonechoices.splice(lastItem); - }; - - $scope.toZoneDatas = [{"toZoneDatas" : $scope.toZonechoices}]; - $scope.addToZoneNewChoice = function() { - var newItemNo = $scope.toZonechoices.length+1; - $scope.toZonechoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeToZoneChoice = function() { - var lastItem = $scope.toZonechoices.length-1; - $scope.toZonechoices.splice(lastItem); - }; - - $scope.sourceListDatas = [{"sourceListDatas" : $scope.sourceListchoices}]; - $scope.addSourceListNewChoice = function() { - var newItemNo = $scope.sourceListchoices.length+1; - $scope.sourceListchoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeSourceListChoice = function() { - var lastItem = $scope.sourceListchoices.length-1; - $scope.sourceListchoices.splice(lastItem); - }; - - $scope.destinationListDatas = [{"destinationListDatas" : $scope.destinationListchoices}]; - $scope.addDListNewChoice = function() { - var newItemNo = $scope.destinationListchoices.length+1; - $scope.destinationListchoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeDlistChoice = function() { - var lastItem = $scope.destinationListchoices.length-1; - $scope.destinationListchoices.splice(lastItem); - }; - - $scope.sourceServicesDatas = [{"sourceServiceDatas" : $scope.sourceServicechoices}]; - $scope.addSourceServiceNewChoice = function() { - var newItemNo = $scope.sourceServicechoices.length+1; - $scope.sourceServicechoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeSourceServiceChoice = function() { - var lastItem = $scope.sourceServicechoices.length-1; - $scope.sourceServicechoices.splice(lastItem); - }; - - $scope.destinationServicesDatas = [{"destinationServiceDatas" : $scope.destinationServicechoices}]; - $scope.addDServicesNewChoice = function() { - var newItemNo = $scope.destinationServicechoices.length+1; - $scope.destinationServicechoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeDServicesChoice = function() { - var lastItem = $scope.destinationServicechoices.length-1; - $scope.destinationServicechoices.splice(lastItem); - }; - - $scope.actionListDatas = [{"actionListDatas" : $scope.actionListchoices}]; - $scope.addActionListNewChoice = function() { - var newItemNo = $scope.actionListchoices.length+1; - $scope.actionListchoices.push({'id':'choice'+newItemNo}); - }; - $scope.removeActionListChoice = function() { - var lastItem = $scope.actionListchoices.length-1; - $scope.actionListchoices.splice(lastItem); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWZoneDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWZoneDictController.js deleted file mode 100644 index 8780ddd35..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/FWZoneDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editFWZoneController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.zoneDictionaryData==null) - $scope.label='Add Zone Name' - else{ - $scope.label='Edit Zone Name' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editZoneName = message.zoneDictionaryData; - - $scope.saveZoneName = function(zoneDictionaryData) { - var uuu = papUrl + "/ecomp/fw_dictionary/save_zoneName.htm"; - var postData={zoneDictionaryData: zoneDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.zoneDictionaryDatas=data.zoneDictionaryDatas;}); - if($scope.zoneDictionaryDatas == "Duplicate"){ - Notification.error("FW Zone Dictionary exists with Same Zone Name.") - }else{ - console.log($scope.zoneDictionaryDatas); - $modalInstance.close({zoneDictionaryDatas:$scope.zoneDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSConfigNameDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSConfigNameDictController.js deleted file mode 100644 index d96a62ad8..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSConfigNameDictController.js +++ /dev/null @@ -1,76 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editMSConfigController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.microServiceCongigNameDictionaryData==null) - $scope.label='Add Config Name' - else{ - $scope.label='Edit Config Name' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editMSConfig = message.microServiceCongigNameDictionaryData; - - $scope.saveMSConfig = function(microServiceCongigNameDictionaryData) { - var uuu = papUrl + "/ecomp/ms_dictionary/save_configName.htm"; - var postData={microServiceCongigNameDictionaryData: microServiceCongigNameDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.microServiceCongigNameDictionaryDatas=data.microServiceCongigNameDictionaryDatas;}); - if($scope.microServiceCongigNameDictionaryDatas == "Duplicate"){ - Notification.error("MS ConfigName Dictionary exists with Same Config Name.") - }else{ - console.log($scope.microServiceCongigNameDictionaryDatas); - $modalInstance.close({microServiceCongigNameDictionaryDatas:$scope.microServiceCongigNameDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSDcaeUUIDDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSDcaeUUIDDictController.js deleted file mode 100644 index c08dbbe22..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSDcaeUUIDDictController.js +++ /dev/null @@ -1,76 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editDCAEuuidController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.dcaeUUIDDictionaryData==null) - $scope.label='Add Micro Service UUID' - else{ - $scope.label='Edit Micro Service UUID' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editDCAEuuid = message.dcaeUUIDDictionaryData; - - $scope.saveDCAEUUID = function(dcaeUUIDDictionaryData) { - var uuu = papUrl + "/ecomp/ms_dictionary/save_dcaeUUID.htm"; - var postData={dcaeUUIDDictionaryData: dcaeUUIDDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.dcaeUUIDDictionaryDatas=data.dcaeUUIDDictionaryDatas;}); - if($scope.dcaeUUIDDictionaryDatas == "Duplicate"){ - Notification.error("MS DCAEUUID Dictionary exists with Same DCAEUUID Name.") - }else{ - console.log($scope.dcaeUUIDDictionaryDatas); - $modalInstance.close({dcaeUUIDDictionaryDatas:$scope.dcaeUUIDDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSLocationDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSLocationDictController.js deleted file mode 100644 index 001f635a9..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSLocationDictController.js +++ /dev/null @@ -1,76 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editMSLocationController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.microServiceLocationDictionaryData==null) - $scope.label='Add Micro Service Location' - else{ - $scope.label='Edit Micro Service Location' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editMSLocation = message.microServiceLocationDictionaryData; - - $scope.saveMSLocation = function(microServiceLocationDictionaryData) { - var uuu = papUrl + "/ecomp/ms_dictionary/save_location.htm"; - var postData={microServiceLocationDictionaryData: microServiceLocationDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.microServiceLocationDictionaryDatas=data.microServiceLocationDictionaryDatas;}); - if($scope.microServiceLocationDictionaryDatas == "Duplicate"){ - Notification.error("MS Location Dictionary exists with Same Location Name.") - }else{ - console.log($scope.microServiceLocationDictionaryDatas); - $modalInstance.close({microServiceLocationDictionaryDatas:$scope.microServiceLocationDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js deleted file mode 100644 index 101f2c1c9..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js +++ /dev/null @@ -1,87 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editMSModelController = function ($scope, $modalInstance, message, $http, PapUrlService, UserInfoService, Notification){ - if(message.microServiceModelsDictionaryData==null) - $scope.label='Add Micro Service Model' - else{ - $scope.label='Edit Micro Service Model' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editMSmodelName = message.microServiceModelsDictionaryData; - - $scope.uploadFile = function(files) { - var fd = new FormData(); - fd.append("file", files[0]); - $http.post(papUrl + "/ecomp/ms_dictionary/set_MSModelData.htm", fd, { - withCredentials: false, - headers: {'Content-Type': undefined }, - transformRequest: angular.identity - }).success().error( ); - - }; - - $scope.saveMSModel = function(microServiceModelsDictionaryData) { - var uuu = papUrl + "/ecomp/ms_dictionary/save_model.htm"; - var postData={microServiceModelsDictionaryData: microServiceModelsDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.microServiceModelsDictionaryDatas=data.microServiceModelsDictionaryDatas;}); - if($scope.microServiceModelsDictionaryDatas == "Duplicate"){ - Notification.error("MS Models Dictionary exists with Same Model Name.") - }else{ - console.log($scope.microServiceModelsDictionaryDatas); - $modalInstance.close({microServiceModelsDictionaryDatas:$scope.microServiceModelsDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSClosedLoopDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSClosedLoopDictController.js deleted file mode 100644 index 6986209cd..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSClosedLoopDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editPSClosedLoopController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.psClosedLoopDictionaryData==null) - $scope.label='Add New Policy Scope ClosedLoop' - else{ - $scope.label='Edit Policy Scope ClosedLoop' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editPSClosedLoop = message.psClosedLoopDictionaryData; - - $scope.savePSClosedLoop = function(psClosedLoopDictionaryData) { - var uuu = papUrl + "/ecomp/ps_dictionary/save_psClosedLoop.htm"; - var postData={psClosedLoopDictionaryData: psClosedLoopDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.psClosedLoopDictionaryDatas=data.psClosedLoopDictionaryDatas;}); - if($scope.psClosedLoopDictionaryDatas == "Duplicate"){ - Notification.error("ClosedLoop Dictionary exists with Same ClosedLoop Name.") - }else{ - console.log($scope.psClosedLoopDictionaryDatas); - $modalInstance.close({psClosedLoopDictionaryDatas:$scope.psClosedLoopDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSGroupPolicyScopeDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSGroupPolicyScopeDictController.js deleted file mode 100644 index ec1c575df..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSGroupPolicyScopeDictController.js +++ /dev/null @@ -1,137 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editPSGroupPolicyScopeController = function ($scope, $modalInstance, message, PolicyScopeService, PapUrlService, UserInfoService, Notification){ - $scope.edit = false; - if(message.groupPolicyScopeListData==null) - $scope.label='Add New Group Policy Scope' - else{ - $scope.label='Edit Group Policy Scope' - $scope.disableCd=true; - $scope.edit = true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - PolicyScopeService.getPSServiceDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.psServiceDictionaryDatas = JSON.parse($scope.data.psServiceDictionaryDatas); - console.log($scope.psServiceDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - PolicyScopeService.getPSTypeDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.psTypeDictionaryDatas = JSON.parse($scope.data.psTypeDictionaryDatas); - console.log($scope.psTypeDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - PolicyScopeService.getPSResourceDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.psResourceDictionaryDatas = JSON.parse($scope.data.psResourceDictionaryDatas); - console.log($scope.psResourceDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - PolicyScopeService.getPSClosedLoopDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.psClosedLoopDictionaryDatas = JSON.parse($scope.data.psClosedLoopDictionaryDatas); - console.log($scope.psClosedLoopDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editPSGroupPolicyScope = message.groupPolicyScopeListData; - $scope.editPSGroupPolicyScope1 = {resource: [], type:[], service: [], closedloop: []}; - if($scope.edit){ - if(message.groupPolicyScopeListData.groupList != null){ - var splitValue = message.groupPolicyScopeListData.groupList.split(","); - console.log(splitValue); - $scope.splittedGroupListValues = []; - var splitResource = splitValue[0].split("="); - $scope.editPSGroupPolicyScope1.resource.push(splitResource[1]); - var splitType = splitValue[1].split("="); - $scope.editPSGroupPolicyScope1.type.push(splitType[1]); - var splitService = splitValue[2].split("="); - $scope.editPSGroupPolicyScope1.service.push(splitService[1]); - var splitCloop = splitValue[3].split("="); - $scope.editPSGroupPolicyScope1.closedloop.push(splitCloop[1]); - } - } - - $scope.savePSGroupPolicyScope = function(groupPolicyScopeListData, groupPolicyScopeListData1) { - console.log(groupPolicyScopeListData1); - var uuu = papUrl + "/ecomp/ps_dictionary/save_psGroupPolicyScope.htm"; - var postData={groupPolicyScopeListData: groupPolicyScopeListData, - groupPolicyScopeListData1: groupPolicyScopeListData1, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.groupPolicyScopeListDatas=data.groupPolicyScopeListDatas;}); - if($scope.groupPolicyScopeListDatas == "Duplicate"){ - Notification.error("GroupPolicyScope Dictionary exists with Same Group Name.") - }else if($scope.groupPolicyScopeListDatas == "DuplicateGroup"){ - Notification.error("GroupPolicyScope Dictionary exists with Same Group List.") - }else{ - console.log($scope.groupPolicyScopeListDatas); - $modalInstance.close({groupPolicyScopeListDatas:$scope.groupPolicyScopeListDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSResourceDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSResourceDictController.js deleted file mode 100644 index 7aaf21834..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSResourceDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editPSResourceController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.psResourceDictionaryData==null) - $scope.label='Add New Resource' - else{ - $scope.label='Edit Resource' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editPSResource = message.psResourceDictionaryData; - - $scope.savePSResource = function(psResourceDictionaryData) { - var uuu = papUrl + "/ecomp/ps_dictionary/save_psResource.htm"; - var postData={psResourceDictionaryData: psResourceDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.psResourceDictionaryDatas=data.psResourceDictionaryDatas;}); - if($scope.psResourceDictionaryDatas == "Duplicate"){ - Notification.error("Resource Dictionary exists with Same Resource Name.") - }else{ - console.log($scope.psResourceDictionaryDatas); - $modalInstance.close({psResourceDictionaryDatas:$scope.psResourceDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSServiceDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSServiceDictController.js deleted file mode 100644 index 5cccf30ad..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSServiceDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editPSServiceController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.psServiceDictionaryData==null) - $scope.label='Add New Service' - else{ - $scope.label='Edit Service' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editPSService = message.psServiceDictionaryData; - - $scope.savePSService = function(psServiceDictionaryData) { - var uuu = papUrl + "/ecomp/ps_dictionary/save_psService.htm"; - var postData={psServiceDictionaryData: psServiceDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.psServiceDictionaryDatas=data.psServiceDictionaryDatas;}); - if($scope.psServiceDictionaryDatas == "Duplicate"){ - Notification.error("Service Dictionary exists with Same Service Name.") - }else{ - console.log($scope.psServiceDictionaryDatas); - $modalInstance.close({psServiceDictionaryDatas:$scope.psServiceDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSTypeDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSTypeDictController.js deleted file mode 100644 index b3d5b833b..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/PSTypeDictController.js +++ /dev/null @@ -1,76 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editPSTypeController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.psTypeDictionaryData==null) - $scope.label='Add New Type' - else{ - $scope.label='Edit Type' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editPSType = message.psTypeDictionaryData; - - $scope.savePSType = function(psTypeDictionaryData) { - var uuu = papUrl + "/ecomp/ps_dictionary/save_psType.htm"; - var postData={psTypeDictionaryData: psTypeDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.psTypeDictionaryDatas=data.psTypeDictionaryDatas;}); - console.log($scope.psTypeDictionaryDatas); - if($scope.psTypeDictionaryDatas == "Duplicate"){ - Notification.error("Type Dictionary exists with Same Type Name.") - }else{ - console.log($scope.psTypeDictionaryDatas); - $modalInstance.close({psTypeDictionaryDatas:$scope.psTypeDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/RiskTypeDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/RiskTypeDictController.js deleted file mode 100644 index 9df0d4771..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/RiskTypeDictController.js +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editRiskTypeController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.riskTypeDictionaryData==null) - $scope.label='Add New Type' - else{ - $scope.label='Edit Type' - $scope.disableCd=true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editRiskType = message.riskTypeDictionaryData; - - $scope.saveRiskType = function(riskTypeDictionaryData) { - var uuu = papUrl + "/ecomp/sp_dictionary/save_riskType.htm"; - var postData={riskTypeDictionaryData: riskTypeDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.riskTypeDictionaryDatas=data.riskTypeDictionaryDatas;}); - if($scope.riskTypeDictionaryDatas == "Duplicate"){ - Notification.error("Risk type Dictionary exists with Same RiskType Name.") - }else{ - console.log($scope.riskTypeDictionaryDatas); - $modalInstance.close({riskTypeDictionaryDatas:$scope.riskTypeDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/SafePolicyWarningDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/SafePolicyWarningDictController.js deleted file mode 100644 index 4fe700768..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/SafePolicyWarningDictController.js +++ /dev/null @@ -1,107 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editSafePolicyWarningController = function ($scope, $modalInstance, message, SafePolicyService, PapUrlService, UserInfoService, Notification){ - $scope.edit = false; - if(message.safePolicyWarningData==null) - $scope.label='Add New Safe Policy Warning' - else{ - $scope.label='Edit Safe Policy Warning' - $scope.disableCd=true; - $scope.edit = true; - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - SafePolicyService.getSafePolicyWarningDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.safePolicyWarningDatas = JSON.parse($scope.data.safePolicyWarningDatas); - console.log($scope.safePolicyWarningDatas); - }, function (error) { - console.log("failed"); - }); - SafePolicyService.getRiskTypeDictionaryDataByName(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.riskTypeDictionaryDatas = JSON.parse($scope.data.riskTypeDictionaryDatas); - console.log($scope.riskTypeDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editSafePolicyWarning = message.safePolicyWarningData; - $scope.editSafePolicyWarning1 = {resource: [], type:[], service: [], closedloop: []}; - if($scope.edit){ - if(message.safePolicyWarningData.groupList != null){ - var splitValue = message.safePolicyWarningData.groupList.split(","); - console.log(splitValue); - $scope.splittedGroupListValues = []; - var splitResource = splitValue[0].split("="); - $scope.editSafePolicyWarningScope1.riskType.push(splitResource[1]); - } - } - - $scope.saveSafePolicyWarning = function(safePolicyWarningData) { - console.log(safePolicyWarningData); - var uuu = papUrl + "/ecomp/sp_dictionary/save_safePolicyWarning.htm"; - var postData={safePolicyWarningData: safePolicyWarningData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.safePolicyWarningDatas=data.safePolicyWarningDatas;}); - if($scope.safePolicyWarningDatas == "Duplicate"){ - Notification.error("Safe Policy Dictionary exists with Same Name.") - }else{ - console.log($scope.safePolicyWarningDatas); - $modalInstance.close({safePolicyWarningDatas:$scope.safePolicyWarningDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/actionPolicyDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/actionPolicyDictController.js deleted file mode 100644 index b889a98cb..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/actionPolicyDictController.js +++ /dev/null @@ -1,119 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editActionPolicyDictController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.actionPolicyDictionaryData==null) - $scope.label='Add Action Dictionary', - $scope.choices = []; - else{ - $scope.choices = []; - $scope.label='Edit Action Dictionary' - $scope.disableCd=true; - var headers = message.actionPolicyDictionaryData.header; - var SplitChars = ':'; - if (headers.indexOf(SplitChars) >= 0) { - var splitHeader = headers.split(SplitChars); - var singleHeader = splitHeader; - var splitEqual = '='; - for(i = 0; i < singleHeader.length; i++){ - if (singleHeader[i].indexOf(splitEqual) >= 0) { - var splitValue = singleHeader[i].split(splitEqual); - var key = splitValue[0]; - var value = splitValue[1]; - var newItemNo = $scope.choices.length+1; - $scope.choices.push({'id':'choice'+newItemNo, 'option': key , 'number' : value }); - } - } - }else{ - var splitEqual = '='; - if (headers.indexOf(splitEqual) >= 0) { - var splitValue = headers.split(splitEqual); - var key = splitValue[0]; - var value = splitValue[1]; - $scope.choices.push({'id':'choice'+1, 'option': key , 'number' : value }); - } - } - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editActionDict = message.actionPolicyDictionaryData; - $scope.saveActionDict = function(actionPolicyDictionaryData) { - var finalData = extend(actionPolicyDictionaryData, $scope.headerDatas[0]); - var uuu = papUrl + "/ecomp/action_dictionary/save_ActionDict.htm"; - var postData={actionPolicyDictionaryData: finalData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.actionPolicyDictionaryDatas=data.actionPolicyDictionaryDatas;}); - if($scope.actionPolicyDictionaryDatas == "Duplicate"){ - Notification.error("ActionPolicy Dictionary exists with Same Attribute Name.") - }else{ - console.log($scope.actionPolicyDictionaryDatas); - $modalInstance.close({actionPolicyDictionaryDatas:$scope.actionPolicyDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; - - function extend(obj, src) { - for (var key in src) { - if (src.hasOwnProperty(key)) obj[key] = src[key]; - } - return obj; - } - - $scope.headerDatas = [{"headers" : $scope.choices}]; - $scope.addNewChoice = function() { - var newItemNo = $scope.choices.length+1; - $scope.choices.push({'id':'choice'+newItemNo}); - }; - $scope.removeChoice = function() { - var lastItem = $scope.choices.length-1; - $scope.choices.splice(lastItem); - }; - -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/attributeDictController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/attributeDictController.js deleted file mode 100644 index 9e32f0304..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/attributeDictController.js +++ /dev/null @@ -1,109 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editAttributeController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.attributeDictionaryData==null) - $scope.label='Add New Attribute', - $scope.attributes = []; - else{ - $scope.attributes = []; - $scope.label='Edit Attribute' - $scope.disableCd=true; - var headers = message.attributeDictionaryData.attributeValue; - var splitEqual = ','; - if(headers != null){ - if (headers.indexOf(splitEqual) >= 0) { - var splitValue = headers.split(splitEqual); - for(i = 0; i < splitValue.length; i++){ - var key = splitValue[i]; - $scope.attributes.push({'id':'choice'+i+1, 'attributeValues': key}); - } - }else{ - var key = headers; - $scope.attributes.push({'id':'choice'+1, 'attributeValues': key}); - } - } - } - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl) - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.editAttributeName = message.attributeDictionaryData; - - $scope.saveAttributeName = function(attributeDictionaryData) { - var finalData = extend(attributeDictionaryData, $scope.attributeDatas[0]); - var uuu = papUrl + "/ecomp/attribute_dictionary/save_attribute.htm"; - var postData={attributeDictionaryData: attributeDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.attributeDictionaryDatas=data.attributeDictionaryDatas;}); - if($scope.attributeDictionaryDatas == "Duplicate"){ - Notification.error("Attribute Dictionary exists with Same Attribute Name.") - }else{ - console.log($scope.attributeDictionaryDatas); - $modalInstance.close({attributeDictionaryDatas:$scope.attributeDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - function extend(obj, src) { - for (var key in src) { - if (src.hasOwnProperty(key)) obj[key] = src[key]; - } - return obj; - } - - $scope.attributeDatas = [{"userDataTypeValues" : $scope.attributes}]; - $scope.addNewChoice = function() { - var newItemNo = $scope.attributes.length+1; - $scope.attributes.push({'id':'choice'+newItemNo}); - }; - $scope.removeChoice = function() { - var lastItem = $scope.attributes.length-1; - $scope.attributes.splice(lastItem); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/ecompNameEditorController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/ecompNameEditorController.js deleted file mode 100644 index 5dd19a7fc..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryController/ecompNameEditorController.js +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var editEcompNameController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService, Notification){ - if(message.ecompNameDictionaryData==null) - $scope.label='Add New Ecomp Name' - else{ - $scope.label='Edit Ecomp Name' - $scope.disableCd=true; - } - $scope.editEcompName = message.ecompNameDictionaryData; - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - }); - - /*getting user info from session*/ - var loginId = null; - UserInfoService.getFunctionalMenuStaticDetailSession() - .then(function (response) { - loginId = response.userid; - }); - - $scope.saveEcompName = function(ecompNameDictionaryData) { - var uuu = papUrl + "/ecomp/ecomp_dictionary/save_ecompName.htm"; - var postData={ecompNameDictionaryData: ecompNameDictionaryData, loginId: loginId}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.ecompNameDictionaryDatas=data.ecompNameDictionaryDatas;}); - if($scope.ecompNameDictionaryDatas == "Duplicate"){ - Notification.error("EcompName Dictionary exists with Same Ecomp Name.") - }else{ - console.log($scope.ecompNameDictionaryDatas); - $modalInstance.close({ecompNameDictionaryDatas:$scope.ecompNameDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSParamDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSParamDictGridController.js deleted file mode 100644 index 642fca248..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSParamDictGridController.js +++ /dev/null @@ -1,127 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('brmsParamDictGridController', function ($scope, DictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - DictionaryService.getBRMSParamDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.brmsParamDictionaryDatas = JSON.parse($scope.data.brmsParamDictionaryDatas); - console.log($scope.brmsParamDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.brmsParamDictionaryGrid = { - data : 'brmsParamDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'BRMSParamDictionary.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ', width: '8%' - }, - { field: 'ruleName', displayName : 'Rule Name'}, - { field: 'description'}, - {field: 'userCreatedBy.userName', displayName : 'Created By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editBRMSParam = null; - $scope.createNewBRMSParamWindow = function(){ - $scope.editBRMSParam = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_brmsParam_popup.html', - controller: 'editBRMSParamController', - resolve: { - message: function () { - var message = { - brmsParamDictionaryDatas: $scope.editBRMSParam - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.brmsParamDictionaryDatas=response.brmsParamDictionaryDatas; - }); - }; - - $scope.deleteBRMSParam = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the BRMS Param Name "+data.ruleName+". \n Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/brms_dictionary/remove_brmsParam.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.brmsParamDictionaryDatas=data.brmsParamDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLPepOptionsDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLPepOptionsDictGridController.js deleted file mode 100644 index 5600ed16b..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLPepOptionsDictGridController.js +++ /dev/null @@ -1,183 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('pepOptionsDictGridController', function ($scope, PapUrlService, CLDictionaryService,modalService, $modal){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - CLDictionaryService.getPepOptionsDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.pepOptionsDictionaryDatas = JSON.parse($scope.data.pepOptionsDictionaryDatas); - console.log($scope.pepOptionsDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.pepOptionsDictionaryGrid = { - data : 'pepOptionsDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'PEPOptions.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - }, - { field: 'pepName', displayName : 'PEP Name'}, - { field: 'actions', displayName : 'Actions'}, - { field: 'description'}, - {field: 'userCreatedBy.userName', displayName : 'Created By'}, - {field: 'userModifiedBy.userName', displayName : 'Modified By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editPEPOptions = null; - $scope.createNewPEPOptionsWindow = function(){ - $scope.editEcompName = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PEPOptions_popup.html', - controller: 'editPEPOptionsController', - resolve: { - message: function () { - var message = { - pepOptionsDictionaryDatas: $scope.editPEPOptions - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.pepOptionsDictionaryDatas=response.pepOptionsDictionaryDatas; - }); - }; - - $scope.editPEPOptionsWindow = function(pepOptionsDictionaryData) { - $scope.editPEPOptions = pepOptionsDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PEPOptions_popup.html', - controller: 'editPEPOptionsController', - resolve: { - message: function () { - var message = { - pepOptionsDictionaryData: $scope.editPEPOptions - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.pepOptionsDictionaryDatas = response.pepOptionsDictionaryDatas; - }); - }; - - $scope.deletePEPOptions = function(data) { - var uuu = "searchDictionary.htm"; - var postData={data: data, type: "pepOptions"}; - var searchString = "\n"; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(resultList){ - $scope.$apply(function(){ - $scope.list =resultList.result;}); - $scope.searchData = JSON.stringify(resultList.result); - $scope.searchDatas = JSON.parse($scope.searchData); - $scope.success = true; - var i; - if($scope.searchDatas.length > 0){ - for(i = 0 ; i < $scope.searchDatas.length; i++){ - searchString += $scope.searchDatas[i].name + "\n"; - } - }else{ - searchString += "No Policies is Using this Value" - } - - console.log($scope.list); - if($scope.success){ - modalService.popupConfirmWin("Confirm","You are about to delete the PEP Options : "+data.pepName+". \n "+searchString+" \n Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/cl_dictionary/remove_pepOptions.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.pepOptionsDictionaryDatas=data.pepOptionsDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - })} - }, - error : function(data){ - alert("Error while Searching."); - } - }); - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLServiceDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLServiceDictGridController.js deleted file mode 100644 index 8f5893da9..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLServiceDictGridController.js +++ /dev/null @@ -1,161 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('serviceDictGridController', function ($scope, PapUrlService, CLDictionaryService,modalService, $modal){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - CLDictionaryService.getServiceDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.closedLoopServiceDictionaryDatas = JSON.parse($scope.data.closedLoopServiceDictionaryDatas); - console.log($scope.closedLoopServiceDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.serviceDictionaryGrid = { - data : 'closedLoopServiceDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - }, - { field: 'serviceName', displayName : 'Service Name'}, - { field: 'description'}, - {field: 'userCreatedBy.userName', displayName : 'Created By'}, - {field: 'userModifiedBy.userName', displayName : 'Modified By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ] - }; - - $scope.editCLService = null; - $scope.createNewServiceDictWindow = function(){ - $scope.editCLService = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_CLService_popup.html', - controller: 'editCLServiceController', - resolve: { - message: function () { - var message = { - closedLoopServiceDictionaryDatas: $scope.editCLService - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.closedLoopServiceDictionaryDatas=response.closedLoopServiceDictionaryDatas; - }); - }; - - $scope.editServiceDictWindow = function(closedLoopServiceDictionaryData) { - $scope.editCLService = closedLoopServiceDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_CLService_popup.html', - controller: 'editCLServiceController', - resolve: { - message: function () { - var message = { - closedLoopServiceDictionaryData: $scope.editCLService - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.closedLoopServiceDictionaryDatas = response.closedLoopServiceDictionaryDatas; - }); - }; - - $scope.deleteServiceDict = function(data) { - var uuu = "searchDictionary.htm"; - var postData={data: data, type: "clService"}; - var searchString = "\n"; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(resultList){ - $scope.$apply(function(){ - $scope.list =resultList.result;}); - $scope.searchData = JSON.stringify(resultList.result); - $scope.searchDatas = JSON.parse($scope.searchData); - $scope.success = true; - var i; - if($scope.searchDatas.length > 0){ - for(i = 0 ; i < $scope.searchDatas.length; i++){ - searchString += $scope.searchDatas[i].name + "\n"; - } - }else{ - searchString += "No Policies is Using this Value" - } - - console.log($scope.list); - if($scope.success){ - modalService.popupConfirmWin("Confirm","You are about to delete the Service Dictionary "+data.serviceName+". \n "+searchString+" \n Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/cl_dictionary/remove_Service.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.closedLoopServiceDictionaryDatas=data.closedLoopServiceDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - })} - }, - error : function(data){ - alert("Error while Searching."); - } - }); - }; - - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLSiteDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLSiteDictGridController.js deleted file mode 100644 index 0a0e72a7f..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLSiteDictGridController.js +++ /dev/null @@ -1,161 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('siteDictGridController', function ($scope, PapUrlService, CLDictionaryService,modalService, $modal){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - CLDictionaryService.getSiteDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.closedLoopSiteDictionaryDatas = JSON.parse($scope.data.closedLoopSiteDictionaryDatas); - console.log($scope.closedLoopSiteDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.siteDictionaryGrid = { - data : 'closedLoopSiteDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - }, - { field: 'siteName', displayName : 'Site Name'}, - { field: 'description'}, - {field: 'userCreatedBy.userName', displayName : 'Created By'}, - {field: 'userModifiedBy.userName', displayName : 'Modified By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ] - }; - - $scope.editCLSite = null; - $scope.createNewSiteDictWindow = function(){ - $scope.editCLSite = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_CLSite_popup.html', - controller: 'editCLSiteController', - resolve: { - message: function () { - var message = { - closedLoopSiteDictionaryDatas: $scope.editCLSite - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.closedLoopSiteDictionaryDatas=response.closedLoopSiteDictionaryDatas; - }); - }; - - $scope.editSiteDictWindow = function(closedLoopSiteDictionaryData) { - $scope.editCLSite = closedLoopSiteDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_CLSite_popup.html', - controller: 'editCLSiteController', - resolve: { - message: function () { - var message = { - closedLoopSiteDictionaryData: $scope.editCLSite - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.closedLoopSiteDictionaryDatas = response.closedLoopSiteDictionaryDatas; - }); - }; - - $scope.deleteSiteDict = function(data) { - var uuu = "searchDictionary.htm"; - var postData={data: data, type: "clSite"}; - var searchString = "\n"; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(resultList){ - $scope.$apply(function(){ - $scope.list =resultList.result;}); - $scope.searchData = JSON.stringify(resultList.result); - $scope.searchDatas = JSON.parse($scope.searchData); - $scope.success = true; - var i; - if($scope.searchDatas.length > 0){ - for(i = 0 ; i < $scope.searchDatas.length; i++){ - searchString += $scope.searchDatas[i].name + "\n"; - } - }else{ - searchString += "No Policies is Using this Value" - } - - console.log($scope.list); - if($scope.success){ - modalService.popupConfirmWin("Confirm","You are about to delete the Site Dictionary : "+data.siteName+". \n "+searchString+" \n Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/cl_dictionary/remove_site.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.closedLoopSiteDictionaryDatas=data.closedLoopSiteDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - })} - }, - error : function(data){ - alert("Error while Searching."); - } - }); - }; - - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVarbindDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVarbindDictGridController.js deleted file mode 100644 index 87ccac953..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVarbindDictGridController.js +++ /dev/null @@ -1,184 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('varbindDictGridController', function ($scope, PapUrlService, CLDictionaryService,modalService, $modal){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - CLDictionaryService.getVarbindDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.varbindDictionaryDatas = JSON.parse($scope.data.varbindDictionaryDatas); - console.log($scope.varbindDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.varbindDictionaryGrid = { - data : 'varbindDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'VarbindDictionary.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - }, - { field: 'varbindName', displayName : 'Varbind Name'}, - { field: 'varbindDescription', displayName : 'Varbind Description'}, - { field: 'varbindOID', displayName : 'Varbind OID'}, - {field: 'userCreatedBy.userName', displayName : 'Created By'}, - {field: 'userModifiedBy.userName', displayName : 'Modified By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editCLVarbind = null; - $scope.createNewVarbindDictWindow = function(){ - $scope.editCLVarbind = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_varbind_popup.html', - controller: 'editCLVarbindController', - resolve: { - message: function () { - var message = { - varbindDictionaryDatas: $scope.editCLVarbind - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.varbindDictionaryDatas=response.varbindDictionaryDatas; - }); - }; - - $scope.editVarbindDictWindow = function(varbindDictionaryData) { - $scope.editCLVarbind = varbindDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_varbind_popup.html', - controller: 'editCLVarbindController', - resolve: { - message: function () { - var message = { - varbindDictionaryData: $scope.editCLVarbind - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.varbindDictionaryDatas = response.varbindDictionaryDatas; - }); - }; - - $scope.deleteVarbindDictionary = function(data) { - var uuu = "searchDictionary.htm"; - var postData={data: data, type: "clVarbind"}; - var searchString = "\n"; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(resultList){ - $scope.$apply(function(){ - $scope.list =resultList.result;}); - $scope.searchData = JSON.stringify(resultList.result); - $scope.searchDatas = JSON.parse($scope.searchData); - $scope.success = true; - var i; - if($scope.searchDatas.length > 0){ - for(i = 0 ; i < $scope.searchDatas.length; i++){ - searchString += $scope.searchDatas[i].name + "\n"; - } - }else{ - searchString += "No Policies is Using this Value" - } - - console.log($scope.list); - if($scope.success){ - modalService.popupConfirmWin("Confirm","You are about to delete the Varbind Dictionary "+data.varbindName+". \n "+searchString+" \n Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/cl_dictionary/remove_varbindDict.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.varbindDictionaryDatas=data.varbindDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - })} - }, - error : function(data){ - alert("Error while Searching."); - } - }); - }; - - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVnfTypeDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVnfTypeDictGridController.js deleted file mode 100644 index 4e5f27ca4..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVnfTypeDictGridController.js +++ /dev/null @@ -1,181 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('vnfTypeDictGridController', function ($scope, PapUrlService, CLDictionaryService,modalService, $modal){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - CLDictionaryService.getVnfTypeDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.vnfTypeDictionaryDatas = JSON.parse($scope.data.vnfTypeDictionaryDatas); - console.log($scope.vnfTypeDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.vnfTypeDictionaryGrid = { - data : 'vnfTypeDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'VNFType.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - }, - { field: 'vnftype', displayName : 'VNF Type'}, - { field: 'description'}, - {field: 'userCreatedBy.userName', displayName : 'Created By'}, - {field: 'userModifiedBy.userName', displayName : 'Modified By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editVnfType = null; - $scope.createNewVnfTypeWindow = function(){ - $scope.editVnfType = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_vnfType_popup.html', - controller: 'editVnfTypeController', - resolve: { - message: function () { - var message = { - vnfTypeDictionaryDatas: $scope.editVnfType - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.vnfTypeDictionaryDatas=response.vnfTypeDictionaryDatas; - }); - }; - - $scope.editVnfTypeWindow = function(vnfTypeDictionaryData) { - $scope.editVnfType = vnfTypeDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_vnfType_popup.html', - controller: 'editVnfTypeController', - resolve: { - message: function () { - var message = { - vnfTypeDictionaryData: $scope.editVnfType - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.vnfTypeDictionaryDatas = response.vnfTypeDictionaryDatas; - }); - }; - - $scope.deleteVnfType = function(data) { - var uuu = "searchDictionary.htm"; - var postData={data: data, type: "attribute"}; - var searchString = "\n"; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(resultList){ - $scope.$apply(function(){ - $scope.list =resultList.result;}); - $scope.searchData = JSON.stringify(resultList.result); - $scope.searchDatas = JSON.parse($scope.searchData); - $scope.success = true; - var i; - if($scope.searchDatas.length > 0){ - for(i = 0 ; i < $scope.searchDatas.length; i++){ - searchString += $scope.searchDatas[i].name + "\n"; - } - }else{ - searchString += "No Policies is Using this Value" - } - - console.log($scope.list); - if($scope.success){ - modalService.popupConfirmWin("Confirm","You are about to delete the Vnf Type Dictionary Item "+data.vnftype+". \n "+searchString+" \n Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/cl_dictionary/remove_vnfType.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.vnfTypeDictionaryDatas=data.vnfTypeDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - })} - }, - error : function(data){ - alert("Error while Searching."); - } - }); - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVsclActionDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVsclActionDictGridController.js deleted file mode 100644 index 1ff52f203..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLVsclActionDictGridController.js +++ /dev/null @@ -1,183 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('vsclActionDictGridController', function ($scope, PapUrlService, CLDictionaryService,modalService, $modal){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - CLDictionaryService.getVSCLActionDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.vsclActionDictionaryDatas = JSON.parse($scope.data.vsclActionDictionaryDatas); - console.log($scope.vsclActionDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.vsclActionDictionaryGrid = { - data : 'vsclActionDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'VSCLAction.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - }, - { field: 'vsclaction', displayName : 'VSCL Action'}, - { field: 'description'}, - {field: 'userCreatedBy.userName', displayName : 'Created By'}, - {field: 'userModifiedBy.userName', displayName : 'Modified By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editvsclAction = null; - $scope.createvsclActionWindow = function(){ - $scope.editvsclAction = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_vsclAction_popup.html', - controller: 'editVsclActionController', - resolve: { - message: function () { - var message = { - vsclActionDictionaryDatas: $scope.editvsclAction - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.vsclActionDictionaryDatas=response.vsclActionDictionaryDatas; - }); - }; - - $scope.editvsclActionWindow = function(vsclActionDictionaryData) { - $scope.editvsclAction = vsclActionDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_vsclAction_popup.html', - controller: 'editVsclActionController', - resolve: { - message: function () { - var message = { - vsclActionDictionaryData: $scope.editvsclAction - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.vsclActionDictionaryDatas = response.vsclActionDictionaryDatas; - }); - }; - - $scope.success = false; - $scope.deletevsclAction = function(data) { - var uuu = "searchDictionary.htm"; - var postData={data: data, type: "clVSCL"}; - var searchString = "\n"; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(resultList){ - $scope.$apply(function(){ - $scope.list =resultList.result;}); - $scope.searchData = JSON.stringify(resultList.result); - $scope.searchDatas = JSON.parse($scope.searchData); - $scope.success = true; - var i; - if($scope.searchDatas.length > 0){ - for(i = 0 ; i < $scope.searchDatas.length; i++){ - searchString += $scope.searchDatas[i].name + "\n"; - } - }else{ - searchString += "No Policies is Using this Value" - } - - console.log($scope.list); - if($scope.success){ - modalService.popupConfirmWin("Confirm","You are about to delete the Vscl Action Item "+data.vsclaction+". \n "+searchString+" \n Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/cl_dictionary/remove_VsclAction.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.vsclActionDictionaryDatas=data.vsclActionDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - })} - }, - error : function(data){ - alert("Error while Searching."); - } - }); - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/DecisionSettingsDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/DecisionSettingsDictGridController.js deleted file mode 100644 index 8a81853a6..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/DecisionSettingsDictGridController.js +++ /dev/null @@ -1,151 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('decisionSettingsDictGridController', function ($scope, DictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - DictionaryService.getDecisionSettingsDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.settingsDictionaryDatas = JSON.parse($scope.data.settingsDictionaryDatas); - console.log($scope.settingsDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.decisionSettingsDictionaryGrid = { - data : 'settingsDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'Settings.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'xacmlId', displayName : 'Settings ID'}, - { field: 'datatypeBean.shortName', displayName : 'Data Type' }, - { field: 'description' }, - {field: 'userCreatedBy.userName', displayName : 'Created By' }, - {field: 'userModifiedBy.userName', displayName : 'Modified By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editSettingsDict = null; - $scope.createNewSettingsDictWindow = function(){ - $scope.editSettingsDict = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_SettingsDict_popup.html', - controller: 'editSettingsDictController', - resolve: { - message: function () { - var message = { - settingsDictionaryDatas: $scope.editSettingsDict - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.settingsDictionaryDatas=response.settingsDictionaryDatas; - }); - }; - - $scope.editSettingsDictWindow = function(settingsDictionaryData) { - $scope.editSettingsDict = settingsDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_SettingsDict_popup.html', - controller: 'editSettingsDictController', - resolve: { - message: function () { - var message = { - settingsDictionaryData: $scope.editSettingsDict - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.settingsDictionaryDatas = response.settingsDictionaryDatas; - }); - }; - - $scope.deleteSettingsDict = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Settings Dictionary "+data.xacmlId+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/settings_dictionary/remove_settings.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.settingsDictionaryDatas=data.settingsDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/DescriptiveScopeDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/DescriptiveScopeDictGridController.js deleted file mode 100644 index b35a28de2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/DescriptiveScopeDictGridController.js +++ /dev/null @@ -1,150 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('descriptiveDictGridController', function ($scope, DictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - DictionaryService.getDescriptiveDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.descriptiveScopeDictionaryDatas = JSON.parse($scope.data.descriptiveScopeDictionaryDatas); - console.log($scope.descriptiveScopeDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.descriptiveDictionaryGrid = { - data : 'descriptiveScopeDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'SearchCriteria.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'scopeName', displayName : 'Descriptive Scope Name'}, - { field: 'search', displayName : 'Search Criteria' }, - { field: 'description' }, - {field: 'userCreatedBy.userName', displayName : 'Created By' }, - {field: 'userModifiedBy.userName', displayName : 'Modified By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editDescriptiveScope = null; - $scope.createNewDescriptiveScopeWindow = function(){ - $scope.editDescriptiveScope = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_descriptiveScope_popup.html', - controller: 'editDescriptiveScopeController', - resolve: { - message: function () { - var message = { - descriptiveScopeDictionaryDatas: $scope.editDescriptiveScope - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.descriptiveScopeDictionaryDatas=response.descriptiveScopeDictionaryDatas; - }); - }; - - $scope.editDescriptiveScopeWindow = function(descriptiveScopeDictionaryData) { - $scope.editDescriptiveScope = descriptiveScopeDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_descriptiveScope_popup.html', - controller: 'editDescriptiveScopeController', - resolve: { - message: function () { - var message = { - descriptiveScopeDictionaryData: $scope.editDescriptiveScope - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.descriptiveScopeDictionaryDatas = response.descriptiveScopeDictionaryDatas; - }); - }; - - $scope.deleteDescriptiveScope = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Descriptive Scope : "+data.scopeName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/descriptive_dictionary/remove_descriptiveScope.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.descriptiveScopeDictionaryDatas=data.descriptiveScopeDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/EnforcerTypeDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/EnforcerTypeDictGridController.js deleted file mode 100644 index d5fceb8d6..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/EnforcerTypeDictGridController.js +++ /dev/null @@ -1,126 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('enforcerDictGridController', function ($scope, DictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - - DictionaryService.getEnforcerDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.enforcerDictionaryDatas = JSON.parse($scope.data.enforcerDictionaryDatas); - console.log($scope.enforcerDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.enforcerDictionaryGrid = { - data : 'enforcerDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'enforcingType', displayName : 'Enforcing Type'}, - { field: 'script' , displayName : 'Script'}, - {field: 'connectionQuery', displayName : 'Connection Query' }, - {field: 'valueQuery', displayName : 'Value Query'} - ] - }; - - $scope.editEnforcerType = null; - $scope.createNewEnforcerTypeWindow = function(){ - $scope.editEnforcerType = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_EnforcerType_popup.html', - controller: 'editEnforcerTypeController', - resolve: { - message: function () { - var message = { - enforcerDictionaryDatas: $scope.editEnforcerType - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.enforcerDictionaryDatas=response.enforcerDictionaryDatas; - }); - }; - - $scope.editEnforcerTypeWindow = function(enforcerDictionaryData) { - $scope.editEnforcerType = enforcerDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_EnforcerType_popup.html', - controller: 'editEnforcerTypeController', - resolve: { - message: function () { - var message = { - enforcerDictionaryData: $scope.editEnforcerType - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.enforcerDictionaryDatas = response.enforcerDictionaryDatas; - }); - }; - - $scope.deleteEnforcerType = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Enforcing Type "+data.enforcingType+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/enforcer_dictionary/remove_enforcer.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.enforcerDictionaryDatas=data.enforcerDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWActionListDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWActionListDictGridController.js deleted file mode 100644 index 6f8c0aad5..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWActionListDictGridController.js +++ /dev/null @@ -1,145 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('actionListDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getActionListDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.actionListDictionaryDatas = JSON.parse($scope.data.actionListDictionaryDatas); - console.log($scope.actionListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.actionListDictionaryGrid = { - data : 'actionListDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'ActionList.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'actionName', displayName : 'Action Name'}, - { field: 'description' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editActionList = null; - $scope.createNewFWActionListWindow = function(){ - $scope.editActionList = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWActionList_popup.html', - controller: 'editFWActionListController', - resolve: { - message: function () { - var message = { - actionListDictionaryDatas: $scope.editActionList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.actionListDictionaryDatas=response.actionListDictionaryDatas; - }); - }; - - $scope.editFWActionListWindow = function(actionListDictionaryData) { - $scope.editActionList = actionListDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWActionList_popup.html', - controller: 'editFWActionListController', - resolve: { - message: function () { - var message = { - actionListDictionaryData: $scope.editActionList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.actionListDictionaryDatas = response.actionListDictionaryDatas; - }); - }; - - $scope.deleteFWActionList = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Action List "+data.actionName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_ActionList.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.actionListDictionaryDatas=data.actionListDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWAddressGroupDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWAddressGroupDictGridController.js deleted file mode 100644 index 4220a7c6d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWAddressGroupDictGridController.js +++ /dev/null @@ -1,146 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('addressGroupDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getAddressGroupDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.addressGroupDictionaryDatas = JSON.parse($scope.data.addressGroupDictionaryDatas); - console.log($scope.addressGroupDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - $scope.addressGroupDictionaryGrid = { - data : 'addressGroupDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'AddressGroup.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'groupName', displayName : 'Group Name'}, - { field: 'prefixList', displayName : 'Prefix List' }, - { field: 'description' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - - $scope.editAddressGroup = null; - $scope.createNewFWAddressGroupWindow = function(){ - $scope.editAddressGroup = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWAddressGroup_popup.html', - controller: 'editFWAddressGroupController', - resolve: { - message: function () { - var message = { - addressGroupDictionaryDatas: $scope.editAddressGroup - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.addressGroupDictionaryDatas=response.addressGroupDictionaryDatas; - }); - }; - - $scope.editFWAddressGroupWindow = function(addressGroupDictionaryData) { - $scope.editAddressGroup = addressGroupDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWAddressGroup_popup.html', - controller: 'editFWAddressGroupController', - resolve: { - message: function () { - var message = { - addressGroupDictionaryData: $scope.editAddressGroup - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.addressGroupDictionaryDatas = response.addressGroupDictionaryDatas; - }); - }; - - $scope.deleteFWAddressGroup = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Address Group "+data.groupName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_AddressGroup.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.addressGroupDictionaryDatas=data.addressGroupDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWParentListDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWParentListDictGridController.js deleted file mode 100644 index a4fc959f6..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWParentListDictGridController.js +++ /dev/null @@ -1,149 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('parentDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getParentListDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.fwDictListDictionaryDatas = JSON.parse($scope.data.fwDictListDictionaryDatas); - console.log($scope.fwDictListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - - - $scope.parentDictionaryGrid = { - data : 'fwDictListDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'ParentList.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'parentItemName', displayName : 'Parent Name'}, - { field: 'description', displayName : 'Description' }, - { field: 'addressList', displayName : 'Address List' }, - { field: 'serviceList', displayName : 'Service List' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editParentList = null; - $scope.createNewFWParentListWindow = function(){ - $scope.editParentList = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_fwParentList_popup.html', - controller: 'editFWParentListController', - resolve: { - message: function () { - var message = { - fwDictListDictionaryDatas: $scope.editParentList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.fwDictListDictionaryDatas=response.fwDictListDictionaryDatas; - }); - }; - - $scope.editFWParentListWindow = function(fwDictListDictionaryData) { - $scope.editParentList = fwDictListDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_fwParentList_popup.html', - controller: 'editFWParentListController', - resolve: { - message: function () { - var message = { - fwDictListDictionaryData: $scope.editParentList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.fwDictListDictionaryDatas = response.fwDictListDictionaryDatas; - }); - }; - - $scope.deleteFWParentList = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Parent List: "+data.parentItemName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_FWDictionaryList.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.fwDictListDictionaryDatas=data.fwDictListDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWPortListDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWPortListDictGridController.js deleted file mode 100644 index 647b97a80..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWPortListDictGridController.js +++ /dev/null @@ -1,132 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('portListDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getPortListDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.portListDictionaryDatas = JSON.parse($scope.data.portListDictionaryDatas); - console.log($scope.portListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - FWDictionaryService.getPortListDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.portListDictionaryDatas = JSON.parse($scope.data.portListDictionaryDatas); - console.log($scope.portListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - $scope.portListDictionaryGrid = { - data : 'portListDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'portName', displayName : 'Port Name'}, - { field: 'description' } - ] - }; - - $scope.editPortList = null; - $scope.createNewFWPortListWindow = function(){ - $scope.editPortList = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWPortList_popup.html', - controller: 'editFWPortListController', - resolve: { - message: function () { - var message = { - portListDictionaryDatas: $scope.editPortList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.portListDictionaryDatas=response.portListDictionaryDatas; - }); - }; - - $scope.editFWPortListWindow = function(portListDictionaryData) { - $scope.editPortList = portListDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWPortList_popup.html', - controller: 'editFWPortListController', - resolve: { - message: function () { - var message = { - portListDictionaryData: $scope.editPortList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.portListDictionaryDatas = response.portListDictionaryDatas; - }); - }; - - $scope.deleteFWPortList = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Port List "+data.portName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_PortList.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.portListDictionaryDatas=data.portListDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWPrefixListDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWPrefixListDictGridController.js deleted file mode 100644 index 09f3f3eb4..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWPrefixListDictGridController.js +++ /dev/null @@ -1,148 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('prefixListDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getPrefixListDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.prefixListDictionaryDatas = JSON.parse($scope.data.prefixListDictionaryDatas); - console.log($scope.prefixListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.prefixListDictionaryGrid = { - data : 'prefixListDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'PrefixList.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'prefixListName', displayName : 'PrefixList Name'}, - { field: 'description' }, - {field: 'prefixListValue', displayName : 'PrefixList Value' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - - $scope.editPrefixList = null; - $scope.createNewFWPrefixListWindow = function(){ - $scope.editPrefixList = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWPrefixList_popup.html', - controller: 'editFWPrefixListController', - resolve: { - message: function () { - var message = { - prefixListDictionaryDatas: $scope.editPrefixList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.prefixListDictionaryDatas=response.prefixListDictionaryDatas; - }); - }; - - $scope.editFWPrefixListWindow = function(prefixListDictionaryData) { - $scope.editPrefixList = prefixListDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWPrefixList_popup.html', - controller: 'editFWPrefixListController', - resolve: { - message: function () { - var message = { - prefixListDictionaryData: $scope.editPrefixList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.prefixListDictionaryDatas = response.prefixListDictionaryDatas; - }); - }; - - $scope.deleteFWPrefixList = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Prefix List "+data.prefixListName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_PrefixList.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.prefixListDictionaryDatas=data.prefixListDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWProtocolListDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWProtocolListDictGridController.js deleted file mode 100644 index e31d0757b..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWProtocolListDictGridController.js +++ /dev/null @@ -1,157 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('protocolListDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getProtocolListDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.protocolListDictionaryDatas = JSON.parse($scope.data.protocolListDictionaryDatas); - console.log($scope.protocolListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - FWDictionaryService.getProtocolListDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.protocolListDictionaryDatas = JSON.parse($scope.data.protocolListDictionaryDatas); - console.log($scope.protocolListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.protocolListDictionaryGrid = { - data : 'protocolListDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'ProtocolList.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'protocolName', displayName : 'Protocol Name'}, - { field: 'description' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - - $scope.editProtocolList = null; - $scope.createNewFWProtocolListWindow = function(){ - $scope.editProtocolList = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWProtocolList_popup.html', - controller: 'editFWProtocolListController', - resolve: { - message: function () { - var message = { - protocolListDictionaryDatas: $scope.editProtocolList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.protocolListDictionaryDatas=response.protocolListDictionaryDatas; - }); - }; - - $scope.editFWProtocolListWindow = function(protocolListDictionaryData) { - $scope.editProtocolList = protocolListDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWProtocolList_popup.html', - controller: 'editFWProtocolListController', - resolve: { - message: function () { - var message = { - protocolListDictionaryData: $scope.editProtocolList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.protocolListDictionaryDatas = response.protocolListDictionaryDatas; - }); - }; - - $scope.deleteFWProtocolList = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Protocol List "+data.protocolName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_protocol.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.protocolListDictionaryDatas=data.protocolListDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWSecurityZoneDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWSecurityZoneDictGridController.js deleted file mode 100644 index 7f1367924..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWSecurityZoneDictGridController.js +++ /dev/null @@ -1,147 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('securityZoneDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getSecurityZoneDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.securityZoneDictionaryDatas = JSON.parse($scope.data.securityZoneDictionaryDatas); - console.log($scope.securityZoneDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - - $scope.securityZoneDictionaryGrid = { - data : 'securityZoneDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'SecurityZone.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'zoneName', displayName : 'Zone Name'}, - { field: 'zoneValue', displayName : 'Zone Value' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editSecurityZone = null; - $scope.createNewFWSecurityZoneWindow = function(){ - $scope.editSecurityZone = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_fwSecurityZone_popup.html', - controller: 'editfwSecurityZoneController', - resolve: { - message: function () { - var message = { - securityZoneDictionaryDatas: $scope.editSecurityZone - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.securityZoneDictionaryDatas=response.securityZoneDictionaryDatas; - }); - }; - - $scope.editFWSecurityZoneWindow = function(securityZoneDictionaryData) { - $scope.editSecurityZone = securityZoneDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_fwSecurityZone_popup.html', - controller: 'editfwSecurityZoneController', - resolve: { - message: function () { - var message = { - securityZoneDictionaryData: $scope.editSecurityZone - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.securityZoneDictionaryDatas = response.securityZoneDictionaryDatas; - }); - }; - - $scope.deleteFWSecurityZone = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Security Zone "+data.zoneName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_securityZone.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.securityZoneDictionaryDatas=data.securityZoneDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWServiceGroupDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWServiceGroupDictGridController.js deleted file mode 100644 index fd6bba456..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWServiceGroupDictGridController.js +++ /dev/null @@ -1,147 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('serviceGroupDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getServiceGroupDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.serviceGroupDictionaryDatas = JSON.parse($scope.data.serviceGroupDictionaryDatas); - console.log($scope.serviceGroupDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - - - $scope.serviceGroupDictionaryGrid = { - data : 'serviceGroupDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'ServiceGroup.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'groupName', displayName : 'Group Name'}, - { field: 'serviceList', displayName : 'Service List' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editServiceGroup = null; - $scope.createNewFWServiceGroupWindow = function(){ - $scope.editServiceGroup = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_fwServiceGroup_popup.html', - controller: 'editFWServiceGroupController', - resolve: { - message: function () { - var message = { - serviceGroupDictionaryDatas: $scope.editServiceGroup - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.serviceGroupDictionaryDatas=response.serviceGroupDictionaryDatas; - }); - }; - - $scope.editFWServiceGroupWindow = function(serviceGroupDictionaryData) { - $scope.editServiceGroup = serviceGroupDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_fwServiceGroup_popup.html', - controller: 'editFWServiceGroupController', - resolve: { - message: function () { - var message = { - serviceGroupDictionaryData: $scope.editServiceGroup - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.serviceGroupDictionaryDatas = response.serviceGroupDictionaryDatas; - }); - }; - - $scope.deleteFWServiceGroup = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Service Group: "+data.groupName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_serviceGroup.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.serviceGroupDictionaryDatas=data.serviceGroupDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWServiceListDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWServiceListDictGridController.js deleted file mode 100644 index 1b56240fd..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWServiceListDictGridController.js +++ /dev/null @@ -1,162 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('serviceListDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getServiceListDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.serviceListDictionaryDatas = JSON.parse($scope.data.serviceListDictionaryDatas); - console.log($scope.serviceListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - FWDictionaryService.getProtocolListDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.protocolListDictionaryDatas = JSON.parse($scope.data.protocolListDictionaryDatas); - console.log($scope.protocolListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - - - $scope.serviceListDictionaryGrid = { - data : 'serviceListDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'ServiceList.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'serviceName', displayName : 'Service Name'}, - { field: 'serviceDescription' , displayName : 'Description'}, - {field: 'serviceType', displayName : 'Service Type' }, - {field: 'serviceTransProtocol', displayName : 'Transport Protocol'}, - {field: 'serviceAppProtocol',displayName : 'APP Protocol' }, - {field: 'servicePorts',displayName : 'Ports' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editServiceList = null; - $scope.createNewFWServiceListWindow = function(){ - $scope.editServiceList = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWServiceList_popup.html', - controller: 'editFWServiceListController', - resolve: { - message: function () { - var message = { - serviceListDictionaryDatas: $scope.editServiceList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.serviceListDictionaryDatas=response.serviceListDictionaryDatas; - }); - }; - - $scope.editFWServiceListWindow = function(serviceListDictionaryData) { - $scope.editServiceList = serviceListDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWServiceList_popup.html', - controller: 'editFWServiceListController', - resolve: { - message: function () { - var message = { - serviceListDictionaryData: $scope.editServiceList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.serviceListDictionaryDatas = response.serviceListDictionaryDatas; - }); - }; - - $scope.deleteFWServiceList = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Service List "+data.serviceName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_serviceList.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.serviceListDictionaryDatas=data.serviceListDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTermListDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTermListDictGridController.js deleted file mode 100644 index 3ba588da9..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTermListDictGridController.js +++ /dev/null @@ -1,159 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('termListDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getTermListDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.termListDictionaryDatas = JSON.parse($scope.data.termListDictionaryDatas); - console.log($scope.termListDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - - }); - - $scope.termListDictionaryGrid = { - data : 'termListDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'TermList.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'termName', displayName : 'Term-Name'}, - { field: 'termDescription', displayName : 'Term-Description' }, - { field: 'fromZone', displayName : 'From Zone' }, - {field: 'toZone', displayName : 'To Zone' }, - {field: 'srcIPList', displayName : 'Source-IP-List'}, - {field: 'destIPList',displayName : 'Destination-IP-List' }, - {field: 'srcPortList',displayName : 'Source-Port-List' }, - {field: 'destPortList',displayName : 'Destination-Port-List' }, - {field: 'action',displayName : 'Action List' }, - {field: 'userCreatedBy.userName',displayName : 'Created By' }, - {field: 'userModifiedBy.userName',displayName : 'Modified By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editTermList = null; - $scope.createNewFWTermListWindow = function(){ - $scope.editTermList = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_fwTermList_popup.html', - controller: 'editFWTermListController', - resolve: { - message: function () { - var message = { - termListDictionaryDatas: $scope.editTermList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.termListDictionaryDatas=response.termListDictionaryDatas; - }); - }; - - $scope.editFWTermListWindow = function(termListDictionaryData) { - $scope.editTermList = termListDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_fwTermList_popup.html', - controller: 'editFWTermListController', - resolve: { - message: function () { - var message = { - termListDictionaryData: $scope.editTermList - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.termListDictionaryDatas = response.termListDictionaryDatas; - }); - }; - - $scope.deleteFWTermList = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the TermList "+data.termName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_termList.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.termListDictionaryDatas=data.termListDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWZoneDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWZoneDictGridController.js deleted file mode 100644 index bbdd03c14..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWZoneDictGridController.js +++ /dev/null @@ -1,148 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('zoneDictGridController', function ($scope, FWDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - FWDictionaryService.getZoneDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.zoneDictionaryDatas = JSON.parse($scope.data.zoneDictionaryDatas); - console.log($scope.zoneDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - - $scope.zoneDictionaryGrid = { - data : 'zoneDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'Zone.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'zoneName', displayName : 'Zone Name'}, - { field: 'zoneValue', displayName : 'Zone Value' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - $scope.editZoneName = null; - $scope.createNewFWZoneWindow = function(){ - $scope.editZoneName = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWZone_popup.html', - controller: 'editFWZoneController', - resolve: { - message: function () { - var message = { - zoneDictionaryDatas: $scope.editZoneName - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.zoneDictionaryDatas=response.zoneDictionaryDatas; - }); - }; - - $scope.editFWZoneWindow = function(zoneDictionaryData) { - $scope.editZoneName = zoneDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_FWZone_popup.html', - controller: 'editFWZoneController', - resolve: { - message: function () { - var message = { - zoneDictionaryData: $scope.editZoneName - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.zoneDictionaryDatas = response.zoneDictionaryDatas; - }); - }; - - $scope.deleteFWZone = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Zone Name "+data.zoneName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/fw_dictionary/remove_zone.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.zoneDictionaryDatas=data.zoneDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSConfigNameDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSConfigNameDictGridController.js deleted file mode 100644 index 15a296799..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSConfigNameDictGridController.js +++ /dev/null @@ -1,124 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('msConfigNameDictGridController', function ($scope, MSDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - MSDictionaryService.getMSConfigNameDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.microServiceCongigNameDictionaryDatas = JSON.parse($scope.data.microServiceCongigNameDictionaryDatas); - console.log($scope.microServiceCongigNameDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - - $scope.msConfigNameDictionaryGrid = { - data : 'microServiceCongigNameDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'name', displayName : 'Name'}, - { field: 'descriptionValue', displayName : 'Description' } - ] - }; - - $scope.editMSConfig = null; - $scope.createNewMSConfigNameWindow = function(){ - $scope.editMSConfig = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_msConfigName_popup.html', - controller: 'editMSConfigController', - resolve: { - message: function () { - var message = { - microServiceCongigNameDictionaryDatas: $scope.editMSConfig - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.microServiceCongigNameDictionaryDatas=response.microServiceCongigNameDictionaryDatas; - }); - }; - - $scope.editMSConfigNameWindow = function(microServiceCongigNameDictionaryData) { - $scope.editMSConfig = microServiceCongigNameDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_msConfigName_popup.html', - controller: 'editMSConfigController', - resolve: { - message: function () { - var message = { - microServiceCongigNameDictionaryData: $scope.editMSConfig - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.microServiceCongigNameDictionaryDatas = response.microServiceCongigNameDictionaryDatas; - }); - }; - - $scope.deleteMSConfigName = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Micro Service Config Name "+data.name+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/ms_dictionary/remove_msConfigName.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.microServiceCongigNameDictionaryDatas=data.microServiceCongigNameDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSDcaeUUIDDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSDcaeUUIDDictGridController.js deleted file mode 100644 index 731731ff3..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSDcaeUUIDDictGridController.js +++ /dev/null @@ -1,124 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('msDCAEUUIDDictGridController', function ($scope, MSDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - MSDictionaryService.getDCAEUUIDDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.dcaeUUIDDictionaryDatas = JSON.parse($scope.data.dcaeUUIDDictionaryDatas); - console.log($scope.dcaeUUIDDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.dcaeUUIDDictionaryGrid = { - data : 'dcaeUUIDDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'name', displayName : 'Name'}, - { field: 'description' } - ] - }; - - $scope.editDCAEuuid = null; - $scope.createNewMSDCAEUUIDWindow = function(){ - $scope.editDCAEuuid = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_DCAEuuid_popup.html', - controller: 'editDCAEuuidController', - resolve: { - message: function () { - var message = { - dcaeUUIDDictionaryDatas: $scope.editDCAEuuid - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.dcaeUUIDDictionaryDatas=response.dcaeUUIDDictionaryDatas; - }); - }; - - $scope.editMSDCAEUUIDWindow = function(dcaeUUIDDictionaryData) { - $scope.editDCAEuuid = dcaeUUIDDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_DCAEuuid_popup.html', - controller: 'editDCAEuuidController', - resolve: { - message: function () { - var message = { - dcaeUUIDDictionaryData: $scope.editDCAEuuid - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.dcaeUUIDDictionaryDatas = response.dcaeUUIDDictionaryDatas; - }); - }; - - $scope.deleteMSDCAEUUID = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the DCAE UUID : "+data.name+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/ms_dictionary/remove_dcaeuuid.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.dcaeUUIDDictionaryDatas=data.dcaeUUIDDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSLocationDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSLocationDictGridController.js deleted file mode 100644 index e3d7b1ab7..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSLocationDictGridController.js +++ /dev/null @@ -1,124 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('msLocationDictGridController', function ($scope, MSDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - MSDictionaryService.getMSLocationDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.microServiceLocationDictionaryDatas = JSON.parse($scope.data.microServiceLocationDictionaryDatas); - console.log($scope.microServiceLocationDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.msLocationDictionaryGrid = { - data : 'microServiceLocationDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'name', displayName : 'Name'}, - { field: 'descriptionValue', displayName : 'Description' } - ] - }; - - $scope.editMSLocation = null; - $scope.createNewMSLocationWindow = function(){ - $scope.editMSLocation = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_msLocation_popup.html', - controller: 'editMSLocationController', - resolve: { - message: function () { - var message = { - microServiceLocationDictionaryDatas: $scope.editMSLocation - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.microServiceLocationDictionaryDatas=response.microServiceLocationDictionaryDatas; - }); - }; - - $scope.editMSLocationWindow = function(microServiceLocationDictionaryData) { - $scope.editMSLocation = microServiceLocationDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_msLocation_popup.html', - controller: 'editMSLocationController', - resolve: { - message: function () { - var message = { - microServiceLocationDictionaryData: $scope.editMSLocation - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.microServiceLocationDictionaryDatas = response.microServiceLocationDictionaryDatas; - }); - }; - - $scope.deleteMSLocation = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Micro Service Location "+data.name+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/ms_dictionary/remove_msLocation.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.microServiceLocationDictionaryDatas=data.microServiceLocationDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSModelDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSModelDictGridController.js deleted file mode 100644 index 4556a8296..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSModelDictGridController.js +++ /dev/null @@ -1,124 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('msModelsDictGridController', function ($scope, MSDictionaryService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - MSDictionaryService.getMSModelDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.microServiceModelsDictionaryDatas = JSON.parse($scope.data.microServiceModelsDictionaryDatas); - console.log($scope.microServiceModelsDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.msModelsDictionaryGrid = { - data : 'microServiceModelsDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ', width: '8%' - },{ field: 'modelName', displayName : 'Micro Service Model'}, - { field: 'description' }, - { field: 'version', displayName : 'Model Version' }, - {field: 'userCreatedBy.userName', displayName : 'Imported By' } - ] - }; - $scope.editMSmodelName = null; - $scope.createNewMSModelsWindow = function(){ - $scope.editMSmodelName = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_msModel_popup.html', - controller: 'editMSModelController', - resolve: { - message: function () { - var message = { - microServiceModelsDictionaryDatas: $scope.editMSmodelName - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.microServiceModelsDictionaryDatas=response.microServiceModelsDictionaryDatas; - }); - }; - - $scope.editMSModelsWindow = function(microServiceModelsDictionaryData) { - $scope.editMSmodelName = microServiceModelsDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_msModel_popup.html', - controller: 'editMSModelController', - resolve: { - message: function () { - var message = { - microServiceModelsDictionaryData: $scope.editMSmodelName - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.microServiceModelsDictionaryDatas = response.microServiceModelsDictionaryDatas; - }); - }; - - $scope.deleteMSModels = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the MicroService Model : "+data.modelName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/ms_dictionary/remove_msModel.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.microServiceModelsDictionaryDatas=data.microServiceModelsDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSClosedLoopDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSClosedLoopDictGridController.js deleted file mode 100644 index ba64bc8e1..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSClosedLoopDictGridController.js +++ /dev/null @@ -1,123 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('psClosedLoopDictGridController', function ($scope, PolicyScopeService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - PolicyScopeService.getPSClosedLoopDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.psClosedLoopDictionaryDatas = JSON.parse($scope.data.psClosedLoopDictionaryDatas); - console.log($scope.psClosedLoopDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.psClosedLoopDictionaryGrid = { - data : 'psClosedLoopDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'name', displayName : 'Closed Loop Name'}, - { field: 'descriptionValue' , displayName : 'Description'} - ] - }; - - $scope.editPSClosedLoop = null; - $scope.createNewPSClosedLoopWindow = function(){ - $scope.editPSClosedLoop = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PSClosedLoop_popup.html', - controller: 'editPSClosedLoopController', - resolve: { - message: function () { - var message = { - psClosedLoopDictionaryDatas: $scope.editPSClosedLoop - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.psClosedLoopDictionaryDatas=response.psClosedLoopDictionaryDatas; - }); - }; - - $scope.editPSClosedLoopWindow = function(psClosedLoopDictionaryData) { - $scope.editPSClosedLoop = psClosedLoopDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PSClosedLoop_popup.html', - controller: 'editPSClosedLoopController', - resolve: { - message: function () { - var message = { - psClosedLoopDictionaryData: $scope.editPSClosedLoop - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.psClosedLoopDictionaryDatas = response.psClosedLoopDictionaryDatas; - }); - }; - - $scope.deletePSClosedLoop = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Closed Loop "+data.name+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/ps_dictionary/remove_PSClosedLoop.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.psClosedLoopDictionaryDatas=data.psClosedLoopDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSGroupPolicyScopeDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSGroupPolicyScopeDictGridController.js deleted file mode 100644 index 756be7661..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSGroupPolicyScopeDictGridController.js +++ /dev/null @@ -1,127 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('psGroupPolicyScopeDictGridController', function ($scope, PolicyScopeService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - PolicyScopeService.getPSGroupPolicyScopeDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.groupPolicyScopeListDatas = JSON.parse($scope.data.groupPolicyScopeListDatas); - console.log($scope.groupPolicyScopeListDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.psGroupPolicyScopeDictionaryGrid = { - data : 'groupPolicyScopeListDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'groupName', displayName : 'Policy Scope Group Name'}, - { field: 'groupList', displayName : 'Policy Scope List'} - ], - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - $scope.gridApi.core.refresh(); - } - }; - - $scope.editPSGroupPolicyScope = null; - $scope.createNewGroupPolicyScopeWindow = function(){ - $scope.editPSGroupPolicyScope = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PSGroupPolicyScope_popup.html', - controller: 'editPSGroupPolicyScopeController', - resolve: { - message: function () { - var message = { - groupPolicyScopeListDatas: $scope.editPSGroupPolicyScope - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.groupPolicyScopeListDatas=response.groupPolicyScopeListDatas; - }); - }; - - $scope.editGroupPolicyScopeWindow = function(groupPolicyScopeListData) { - $scope.editPSGroupPolicyScope = groupPolicyScopeListData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PSGroupPolicyScope_popup.html', - controller: 'editPSGroupPolicyScopeController', - resolve: { - message: function () { - var message = { - groupPolicyScopeListData: $scope.editPSGroupPolicyScope - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.groupPolicyScopeListDatas = response.groupPolicyScopeListDatas; - }); - }; - - $scope.deleteGroupPolicyScope = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Group Policy Scope "+data.name+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/ps_dictionary/remove_GroupPolicyScope.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.groupPolicyScopeListDatas=data.groupPolicyScopeListDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSResourceDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSResourceDictGridController.js deleted file mode 100644 index e4ad05263..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSResourceDictGridController.js +++ /dev/null @@ -1,123 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('psResourceDictGridController', function ($scope, PolicyScopeService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - PolicyScopeService.getPSResourceDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.psResourceDictionaryDatas = JSON.parse($scope.data.psResourceDictionaryDatas); - console.log($scope.psResourceDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.psResourceDictionaryGrid = { - data : 'psResourceDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'name', displayName : 'Resource Name'}, - { field: 'descriptionValue' } - ] - }; - - $scope.editPSResource = null; - $scope.createNewPSResourceWindow = function(){ - $scope.editPSResource = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PSResource_popup.html', - controller: 'editPSResourceController', - resolve: { - message: function () { - var message = { - psResourceDictionaryDatas: $scope.editPSResource - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.psResourceDictionaryDatas=response.psResourceDictionaryDatas; - }); - }; - - $scope.editPSResourceWindow = function(psResourceDictionaryData) { - $scope.editPSResource = psResourceDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PSResource_popup.html', - controller: 'editPSResourceController', - resolve: { - message: function () { - var message = { - psResourceDictionaryData: $scope.editPSResource - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.psResourceDictionaryDatas = response.psResourceDictionaryDatas; - }); - }; - - $scope.deletePSResource = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Resource "+data.name+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/ps_dictionary/remove_PSResource.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.psResourceDictionaryDatas=data.psResourceDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSServiceDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSServiceDictGridController.js deleted file mode 100644 index ac16a3eb2..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSServiceDictGridController.js +++ /dev/null @@ -1,122 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('psServiceDictGridController', function ($scope, PolicyScopeService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - PolicyScopeService.getPSServiceDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.psServiceDictionaryDatas = JSON.parse($scope.data.psServiceDictionaryDatas); - console.log($scope.psServiceDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - $scope.psServiceDictionaryGrid = { - data : 'psServiceDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'name', displayName : 'Service Name'}, - { field: 'descriptionValue' } - ] - }; - - $scope.editPSService = null; - $scope.createNewPSServiceWindow = function(){ - $scope.editPSService = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PSService_popup.html', - controller: 'editPSServiceController', - resolve: { - message: function () { - var message = { - psServiceDictionaryDatas: $scope.editPSService - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.psServiceDictionaryDatas=response.psServiceDictionaryDatas; - }); - }; - - $scope.editPSServiceWindow = function(psServiceDictionaryData) { - $scope.editPSService = psServiceDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PSService_popup.html', - controller: 'editPSServiceController', - resolve: { - message: function () { - var message = { - psServiceDictionaryData: $scope.editPSService - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.psServiceDictionaryDatas = response.psServiceDictionaryDatas; - }); - }; - - $scope.deletePSService = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Port List "+data.name+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/ps_dictionary/remove_PSService.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.psServiceDictionaryDatas=data.psServiceDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSTypeDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSTypeDictGridController.js deleted file mode 100644 index e66b58931..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/PSTypeDictGridController.js +++ /dev/null @@ -1,122 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('psTypeDictGridController', function ($scope, PolicyScopeService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - PolicyScopeService.getPSTypeDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.psTypeDictionaryDatas = JSON.parse($scope.data.psTypeDictionaryDatas); - console.log($scope.psTypeDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - $scope.psTypeDictionaryGrid = { - data : 'psTypeDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'name', displayName : 'Type Name'}, - { field: 'descriptionValue' } - ] - }; - - $scope.editPSType = null; - $scope.createPSTypeWindow = function(){ - $scope.editPSType = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PSType_popup.html', - controller: 'editPSTypeController', - resolve: { - message: function () { - var message = { - psTypeDictionaryDatas: $scope.editPSType - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.psTypeDictionaryDatas=response.psTypeDictionaryDatas; - }); - }; - - $scope.editPSTypeWindow = function(psTypeDictionaryData) { - $scope.editPSType = psTypeDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_PSType_popup.html', - controller: 'editPSTypeController', - resolve: { - message: function () { - var message = { - psTypeDictionaryData: $scope.editPSType - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.psTypeDictionaryDatas = response.psTypeDictionaryDatas; - }); - }; - - $scope.deletePSType = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Type "+data.name+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/ps_dictionary/remove_PSType.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.psTypeDictionaryDatas=data.psTypeDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/RiskTypeDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/RiskTypeDictGridController.js deleted file mode 100644 index d22a1ce48..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/RiskTypeDictGridController.js +++ /dev/null @@ -1,152 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('riskTypeDictGridController', function ($scope, SafePolicyService,modalService,PapUrlService, $modal, uiGridConstants,Grid){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - SafePolicyService.getRiskTypeDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.riskTypeDictionaryDatas = JSON.parse($scope.data.riskTypeDictionaryDatas); - console.log($scope.riskTypeDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - $scope.riskTypeDictionaryGrid = { - data : 'riskTypeDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'RiskType.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - }, - { field: 'riskName', displayName : 'Risk Type Name' }, - { field: 'description', width: '20%' }, - {field: 'userCreatedBy.userName', displayName : 'Created By'}, - {field: 'userModifiedBy.userName', displayName : 'Modified By' }, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\''}, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\''} - ], - enableColumnResize : true, - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - - $scope.editRiskType = null; - $scope.createNewRiskType = function(){ - $scope.editRiskType = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_riskType_popup.html', - controller: 'editRiskTypeController', - resolve: { - message: function () { - var message = { - riskTypeDictionaryDatas: $scope.editRiskType - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.riskTypeDictionaryDatas=response.riskTypeDictionaryDatas; - }); - }; - - $scope.editRiskTypeWindow = function(riskTypeDictionaryData) { - $scope.editRiskType = riskTypeDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_riskType_popup.html', - controller: 'editRiskTypeController', - resolve: { - message: function () { - var message = { - riskTypeDictionaryData: $scope.editRiskType - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.riskTypeDictionaryDatas = response.riskTypeDictionaryData; - }); - }; - - $scope.deleteRiskType = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Ecomp Name "+data.riskType+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/sp_dictionary/remove_riskType.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.riskTypeDictionaryDatas=data.riskTypeDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/SafePolicyWarningDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/SafePolicyWarningDictGridController.js deleted file mode 100644 index 303ae5704..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/SafePolicyWarningDictGridController.js +++ /dev/null @@ -1,127 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('safePolicyWarningDictGridController', function ($scope, SafePolicyService,modalService, $modal, PapUrlService){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - SafePolicyService.getSafePolicyWarningDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.safePolicyWarningDatas = JSON.parse($scope.data.safePolicyWarningDatas); - console.log($scope.safePolicyWarningDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.safePolicyWarningDictionaryGrid = { - data : 'safePolicyWarningDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'name', displayName : 'Safe Policy Warning Name'}, - { field: 'riskType', displayName : 'Risk Type'},{ field: 'message', displayName : 'Message'} - ], - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - $scope.gridApi.core.refresh(); - } - }; - - $scope.editSafePolicyWarning = null; - $scope.createNewSafePolicyWarningWindow = function(){ - $scope.editSafePolicyWarning = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_SafePolicyWarning_popup.html', - controller: 'editSafePolicyWarningController', - resolve: { - message: function () { - var message = { - safePolicyWarningDatas: $scope.editSafePolicyWarningScope - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.safePolicyWarningDatas=response.safePolicyWarningDatas; - }); - }; - - $scope.editSafePolicyWarningWindow = function(safePolicyWarningData) { - $scope.editSafePolicyWarning = safePolicyWarningData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_SafePolicyWarning_popup.html', - controller: 'editSafePolicyWarningController', - resolve: { - message: function () { - var message = { - safePolicyWarningData: $scope.editSafePolicyWarning - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.groupPolicyScopeListDatas = response.safePolicyWarningData; - }); - }; - - $scope.deleteSafePolicyWarning = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Safe Policy Warning "+data.name+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/sp_dictionary/remove_SafePolicyWarning.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.safePolicyWarningDatas=data.safePolicyWarningDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/actionPolicyDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/actionPolicyDictGridController.js deleted file mode 100644 index 223aec6cf..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/actionPolicyDictGridController.js +++ /dev/null @@ -1,161 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -var Actiontype = ["REST"]; -app.controller('actionPolicyDictGridController', function ($scope, DictionaryService,modalService, $modal, uiGridConstants,Grid, PapUrlService){ - $( "#dialog" ).hide(); - $scope.type = Actiontype; - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - DictionaryService.getActionPolicyDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.actionPolicyDictionaryDatas = JSON.parse($scope.data.actionPolicyDictionaryDatas); - console.log($scope.actionPolicyDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - - }); - - $scope.actionPolicyDictionaryGrid = { - enableFiltering: true, - data: 'actionPolicyDictionaryDatas', - exporterCsvFilename: 'ActionPolicyDictionary.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', - enableFiltering: false, - headerCellTemplate: '' + - '', - cellTemplate: ' ' + - ' ', - width: '8%' - }, - {field: 'attributeName', displayName: 'Attribute Name'}, - {field: 'type'}, - {field: 'url'}, - {field: 'method'}, - {field: 'header', displayName: 'Headers'}, - {field: 'description'}, - {field: 'userCreatedBy.userName', displayName: 'Created By'}, - {field: 'userModifiedBy.userName', displayName: 'Modified By'}, - {field: 'createdDate', type: 'date', cellFilter: 'date:\'yyyy-MM-dd\''}, - {field: 'modifiedDate', type: 'date', cellFilter: 'date:\'yyyy-MM-dd\''} - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - - $scope.editActionPolicyName = null; - $scope.createNewActionPolicyDictWindow = function () { - $scope.editActionPolicyName = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl: 'add_actionPolicyDict_popup.html', - controller: 'editActionPolicyDictController', - resolve: { - message: function () { - var message = { - actionPolicyDictionaryDatas: $scope.editActionPolicyName - }; - return message; - } - } - }); - modalInstance.result.then(function (response) { - console.log('response', response); - $scope.actionPolicyDictionaryDatas = response.actionPolicyDictionaryDatas; - }); - }; - - $scope.editActionPolicyDictWindow = function (actionPolicyDictionaryData) { - $scope.editActionPolicyName = actionPolicyDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl: 'add_actionPolicyDict_popup.html', - controller: 'editActionPolicyDictController', - resolve: { - message: function () { - var message = { - actionPolicyDictionaryData: $scope.editActionPolicyName - }; - return message; - } - } - }); - modalInstance.result.then(function (response) { - console.log('response', response); - $scope.actionPolicyDictionaryDatas = response.actionPolicyDictionaryDatas; - }); - }; - - $scope.deleteActionPolicyDict = function (data) { - modalService.popupConfirmWin("Confirm", "You are about to delete the Action Policy Dictionary Item " + data.attributeName + ". Do you want to continue?", - function () { - var uuu = papUrl + "/ecomp/action_dictionary/remove_actionPolicyDict.htm"; - var postData = {data: data}; - $.ajax({ - type: 'POST', - url: uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success: function (data) { - $scope.$apply(function () { - $scope.actionPolicyDictionaryDatas = data.actionPolicyDictionaryDatas; - }); - }, - error: function (data) { - console.log(data); - modalService.showFailure("Fail", "Error while deleting: " + data.responseText); - } - }); - - }) - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/attributeDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/attributeDictGridController.js deleted file mode 100644 index 5405bb0d7..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/attributeDictGridController.js +++ /dev/null @@ -1,159 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('attributeDictGridController', function ($scope, DictionaryService, PapUrlService, modalService, $modal){ - $( "#dialog" ).hide(); - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - DictionaryService.getAttributeDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.attributeDictionaryDatas = JSON.parse($scope.data.attributeDictionaryDatas); - console.log($scope.attributeDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - $scope.exportData = function () { - var blob = new Blob([document.getElementById('attributeTable').innerHTML], { - type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8" - }); - saveAs(blob, "Attribute.xls"); - }; - - $scope.attributeDictionaryGrid = { - data : 'attributeDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'Attribute.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id' , enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - },{ field: 'xacmlId', displayName : 'Attribute ID'}, - { field: 'datatypeBean.shortName', displayName : 'Data Type' }, - { field: 'attributeValue'}, - { field: 'description' }, - { field: 'priority' , displayName : 'Priority'}, - {field: 'userCreatedBy.userName', displayName : 'Created By' }, - {field: 'userModifiedBy.userName', displayName : 'Modified By'}, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ], - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - - $scope.editAttributeName = null; - $scope.createNewAttributeWindow = function(){ - $scope.editAttributeName = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_Attribute_popup.html', - controller: 'editAttributeController', - resolve: { - message: function () { - var message = { - attributeDictionaryDatas: $scope.editAttributeName - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.attributeDictionaryDatas=response.attributeDictionaryDatas; - }); - }; - - $scope.editAttributeWindow = function(attributeDictionaryData) { - $scope.editAttributeName = attributeDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_Attribute_popup.html', - controller: 'editAttributeController', - resolve: { - message: function () { - var message = { - attributeDictionaryData: $scope.editAttributeName - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.attributeDictionaryDatas = response.attributeDictionaryDatas; - }); - }; - - $scope.deleteAttribute = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Attribute Dictionary : "+data.xacmlId+". \n "+searchString+" \n Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/attribute_dictionary/remove_attribute.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.attributeDictionaryDatas=data.attributeDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/ecompNameDictGridController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/ecompNameDictGridController.js deleted file mode 100644 index 3ae3ee21d..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/dictionaryGridController/ecompNameDictGridController.js +++ /dev/null @@ -1,152 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - */ -app.controller('ecompNameDictGridController', function ($scope, DictionaryService,modalService,PapUrlService, $modal, uiGridConstants,Grid){ - $( "#dialog" ).hide(); - - var papUrl; - PapUrlService.getPapUrl().then(function(data) { - var config = data; - papUrl = config.PAP_URL; - console.log(papUrl); - - DictionaryService.getEcompDictionaryData(papUrl).then(function (data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.ecompNameDictionaryDatas = JSON.parse($scope.data.ecompNameDictionaryDatas); - console.log($scope.ecompNameDictionaryDatas); - }, function (error) { - console.log("failed"); - }); - }); - - $scope.ecompNameDictionaryGrid = { - data : 'ecompNameDictionaryDatas', - enableFiltering: true, - exporterCsvFilename: 'EcompName.csv', - enableGridMenu: true, - enableSelectAll: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' ', width: '8%' - }, - { field: 'ecompName', displayName : 'Ecomp Name' }, - { field: 'description', width: '20%' }, - {field: 'userCreatedBy.userName', displayName : 'Created By'}, - {field: 'userModifiedBy.userName', displayName : 'Modified By' }, - {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\''}, - {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\''} - ], - enableColumnResize : true, - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), - onRegisterApi: function(gridApi){ - $scope.gridApi = gridApi; - } - }; - - - $scope.editEcompName = null; - $scope.createNewEcompName = function(){ - $scope.editEcompName = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_ecompName_popup.html', - controller: 'editEcompNameController', - resolve: { - message: function () { - var message = { - ecompNameDictionaryDatas: $scope.editEcompName - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.ecompNameDictionaryDatas=response.ecompNameDictionaryDatas; - }); - }; - - $scope.editEcompNameWindow = function(ecompNameDictionaryData) { - $scope.editEcompName = ecompNameDictionaryData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_ecompName_popup.html', - controller: 'editEcompNameController', - resolve: { - message: function () { - var message = { - ecompNameDictionaryData: $scope.editEcompName - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.ecompNameDictionaryDatas = response.ecompNameDictionaryDatas; - }); - }; - - $scope.deleteEcompName = function(data) { - modalService.popupConfirmWin("Confirm","You are about to delete the Ecomp Name "+data.ecompName+". Do you want to continue?", - function(){ - var uuu = papUrl + "/ecomp/ecomp_dictionary/remove_ecomp.htm"; - var postData={data: data}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.ecompNameDictionaryDatas=data.ecompNameDictionaryDatas;}); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/editorTabController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/editorTabController.js deleted file mode 100644 index d9a6bbcc1..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/editorTabController.js +++ /dev/null @@ -1,211 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/* -/!** - *!/ -(function(window, angular, $) { - 'use strict'; - app.controller('policyeditorTabController', [ - '$scope', '$translate', '$cookies', 'fileManagerConfig', 'item', 'fileNavigator', 'fileUploader', - function($scope, $translate, $cookies, fileManagerConfig, Item, FileNavigator, FileUploader) { - -/!*app.controller('policyeditorTabController', function ($scope, $translate, $cookies, fileManagerConfig, Item, FileNavigator, FileUploader){*!/ - $( "#dialog" ).hide(); - $scope.config = fileManagerConfig; - $scope.reverse = false; - $scope.predicate = ['model.type', 'model.name']; - $scope.order = function(predicate) { - $scope.reverse = ($scope.predicate[1] === predicate) ? !$scope.reverse : false; - $scope.predicate[1] = predicate; - }; - - $scope.query = ''; - $scope.temp = new Item(); - $scope.fileNavigator = new FileNavigator(); - $scope.fileUploader = FileUploader; - $scope.uploadFileList = []; - $scope.viewTemplate = $cookies.viewTemplate || 'main-table.html'; - - $scope.setTemplate = function(name) { - $scope.viewTemplate = $cookies.viewTemplate = name; - }; - - $scope.changeLanguage = function (locale) { - if (locale) { - return $translate.use($cookies.language = locale); - } - $translate.use($cookies.language || fileManagerConfig.defaultLang); - }; - - $scope.touch = function(item) { - item = item instanceof Item ? item : new Item(); - item.revert(); - $scope.temp = item; - }; - - $scope.smartClick = function(item) { - if (item.isFolder()) { - return $scope.fileNavigator.folderClick(item); - } - if (item.isImage()) { - return $scope.openImagePreview(item); - } - if (item.isEditable()) { - return $scope.openEditItem(item); - } - }; - - $scope.openImagePreview = function(item) { - item.inprocess = true; - $scope.modal('imagepreview') - .find('#imagepreview-target') - .attr('src', item.getUrl(true)) - .unbind('load error') - .on('load error', function() { - item.inprocess = false; - $scope.$apply(); - }); - return $scope.touch(item); - }; - - $scope.openEditItem = function(item) { - item.getContent(); - $scope.modal('edit'); - return $scope.touch(item); - }; - - $scope.modal = function(id, hide) { - return $('#' + id).modal(hide ? 'hide' : 'show'); - }; - - $scope.isInThisPath = function(path) { - var currentPath = $scope.fileNavigator.currentPath.join('/'); - return currentPath.indexOf(path) !== -1; - }; - - $scope.edit = function(item) { - item.edit().then(function() { - $scope.modal('edit', true); - }); - }; - - $scope.changePermissions = function(item) { - item.changePermissions().then(function() { - $scope.modal('changepermissions', true); - }); - }; - - $scope.copy = function(item) { - var samePath = item.tempModel.path.join() === item.model.path.join(); - if (samePath && $scope.fileNavigator.fileNameExists(item.tempModel.name)) { - item.error = $translate.instant('error_invalid_filename'); - return false; - } - item.copy().then(function() { - $scope.fileNavigator.refresh(); - $scope.modal('copy', true); - }); - }; - - $scope.compress = function(item) { - item.compress().then(function() { - $scope.fileNavigator.refresh(); - if (! $scope.config.compressAsync) { - return $scope.modal('compress', true); - } - item.asyncSuccess = true; - }, function() { - item.asyncSuccess = false; - }); - }; - - $scope.extract = function(item) { - item.extract().then(function() { - $scope.fileNavigator.refresh(); - if (! $scope.config.extractAsync) { - return $scope.modal('extract', true); - } - item.asyncSuccess = true; - }, function() { - item.asyncSuccess = false; - }); - }; - - $scope.remove = function(item) { - item.remove().then(function() { - $scope.fileNavigator.refresh(); - $scope.modal('delete', true); - }); - }; - - $scope.rename = function(item) { - var samePath = item.tempModel.path.join() === item.model.path.join(); - if (samePath && $scope.fileNavigator.fileNameExists(item.tempModel.name)) { - item.error = $translate.instant('error_invalid_filename'); - return false; - } - item.rename().then(function() { - $scope.fileNavigator.refresh(); - $scope.modal('rename', true); - }); - }; - - $scope.createFolder = function(item) { - var name = item.tempModel.name && item.tempModel.name.trim(); - item.tempModel.type = 'dir'; - item.tempModel.path = $scope.fileNavigator.currentPath; - if (name && !$scope.fileNavigator.fileNameExists(name)) { - item.createFolder().then(function() { - $scope.fileNavigator.refresh(); - $scope.modal('newfolder', true); - }); - } else { - item.error = $translate.instant('error_invalid_filename'); - return false; - } - }; - - $scope.uploadFiles = function() { - $scope.fileUploader.upload($scope.uploadFileList, $scope.fileNavigator.currentPath).then(function() { - $scope.fileNavigator.refresh(); - $scope.modal('uploadfile', true); - }, function(data) { - var errorMsg = data.result && data.result.error || $translate.instant('error_uploading_files'); - $scope.temp.error = errorMsg; - }); - }; - - $scope.getQueryParam = function(param) { - var found; - window.location.search.substr(1).split('&').forEach(function(item) { - if (param === item.split('=')[0]) { - found = item.split('=')[1]; - return false; - } - }); - return found; - }; - - $scope.changeLanguage($scope.getQueryParam('lang')); - $scope.isWindows = $scope.getQueryParam('server') === 'Windows'; - $scope.fileNavigator.refresh(); - }]); -})(window, angular, jQuery);*/ diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/pdpController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/pdpController.js deleted file mode 100644 index 368375cda..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/pdpController.js +++ /dev/null @@ -1,178 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -app.controller('pdpTabController', function ($scope,PDPService,modalService, $modal, AdminTabService){ - $( "#dialog" ).hide(); - - $scope.isDisabled = true; - $scope.createPdpGroupId = false; - $scope.deletePdpGroupId = false; - $scope.editPdpGroupId = false; - $scope.pdpdatas = []; - AdminTabService.getData().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.lockdowndata = JSON.parse($scope.data.lockdowndata); - if($scope.lockdowndata[0].lockdown == true){ - $scope.isDisabled = true; - }else{ - $scope.isDisabled = false; - } - console.log($scope.data); - - AdminTabService.getRolesData().then(function(data) { - var j = data; - $scope.data = JSON.parse(j.data); - console.log($scope.data); - $scope.userRolesDatas = JSON.parse($scope.data.userRolesDatas); - console.log($scope.userRolesDatas); - if($scope.isDisabled == false){ - if($scope.userRolesDatas[0] == 'super-admin' || $scope.userRolesDatas[0] == 'admin'){ - $scope.createPdpGroupId = true; - $scope.deletePdpGroupId = true; - $scope.editPdpGroupId = true; - }else if($scope.userRolesDatas[0] == 'super-editor' || $scope.userRolesDatas[0] == 'editor'){ - $scope.editPdpGroupId = true; - }else if($scope.userRolesDatas[0] == 'super-guest' || $scope.userRolesDatas[0] == 'guest'){ - $scope.editPdpGroupId = true; - } - } - - PDPService.getPDPGroupEntityData().then(function(data){ - var j = data; - $scope.pdpdatas = JSON.parse(j.data); - console.log($scope.pdpdatas); - },function(error){ - console.log("failed"); - }); - },function (error) { - console.log("failed"); - }); - },function(error){ - console.log("failed"); - }); - - - $scope.addNewPDPGroupFunctionPopup = function() { - $scope.editPDPGroup = null; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.editPDPGroup = null; - var dialog = null; - $scope.editPDPGroupFunctionPopup = function(pdpGroupData) { - $scope.editPDPGroup = pdpGroupData; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.editPDPGroupFunctionModalPopup = function(pdpGroupData) { - $scope.editPDPGroup = pdpGroupData; - if($scope.userRolesDatas[0] == 'super-guest' || $scope.userRolesDatas[0] == 'guest'){ - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl: 'show_policies_pdp_group_popup.html', - controller: 'editPDPGrouppopupController', - resolve: { - message: function () { - var message = { - pdpGroupData : $scope.editPDPGroup - }; - return message; - } - } - }); - }else{ - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl: 'edit_pdp_group_popup.html', - controller: 'editPDPGrouppopupController', - resolve: { - message: function () { - var message = { - pdpGroupData : $scope.editPDPGroup - }; - return message; - } - } - }); - } - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.pdpdatas=response.data; - }); - }; - - $scope.addNewPDPGroupPopUpWindow = function(editPDPGroup) { - $scope.editPDPGroup = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'add_pdp_group_popup.html', - controller: 'editPDPGrouppopupController', - resolve: { - message: function () { - var message = { - data: $scope.editPDPGroup - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.pdpdatas=JSON.parse(response.data); - }); - }; - - $scope.addNewPDPGroupFunctionPopup = function() { - $scope.editPDPGroup = null; - $( "#dialog" ).dialog({ - modal: true - }); - }; - - $scope.removePDPGroup = function(pdpGroupData) { - modalService.popupConfirmWin("Confirm","You are about to delete the PDP Group "+pdpGroupData.name+". Do you want to continue?", - function(){ - var uuu = "pdp_Group/remove_pdp_group.htm"; - var postData={pdpGroupData: pdpGroupData}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.pdpdata=data.data;}); - $scope.pdpdatas=JSON.parse(data.data); - }, - error : function(data){ - console.log(data); - modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - - }; -}); diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/pdpGroupPopUpController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/pdpGroupPopUpController.js deleted file mode 100644 index 31a094e5f..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/pdpGroupPopUpController.js +++ /dev/null @@ -1,179 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -var editPDPGrouppopupController = function ($scope, $modalInstance, message, modalService, $modal, Notification){ - if(message.pdpGroupData==null) - $scope.label='Add New PDP Group' - else{ - $scope.label='Edit PDP Group' - $scope.disableCd=true; - $scope.policies = message.pdpGroupData.policies; - $scope.pdps = message.pdpGroupData.pdps; - $scope.selectedPdp = message.pdpGroupData; - } - $scope.editPDPGroup = message.pdpGroupData; - - $scope.policiesGrid = { - data : 'policies', - enableFiltering: true, - columnDefs: [ - { field: 'root', displayName : 'Root', width : '10%'}, - { field: 'name', displayName : 'Name' }, - { field: 'version' , width : '10%'}, - { field: 'id' } - ] - }; - - $scope.pdpsGrid = { - data : 'pdps', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '', - cellTemplate: - ' ' + - ' '+ - '', width: '15%' - }, - { field: 'id', displayName : 'PDP URL'}, - { field: 'jmxPort', displayName : 'JMX Port' , width : '10%' }, - { field: 'name' , displayName : 'PDP Name'}, - { field: 'description' } - ] - }; - - $scope.createNewPDPInGroup = function(pdpInGroup) { - $scope.pdpInGroup = null; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'create_newPDP_InGroup.html', - controller: 'pdpInGroupController', - resolve: { - message: function () { - var message = { - data: $scope.pdpInGroup, - activePDP : $scope.selectedPdp - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.data=response.data; - }); - }; - - $scope.editPDPInGroup = function(pdpInGroup) { - $scope.editPDPInGroupData = pdpInGroup; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl: 'create_newPDP_InGroup.html', - controller: 'pdpInGroupController', - resolve: { - message: function () { - var message = { - pdpInGroup : $scope.editPDPInGroupData, - activePDP : $scope.selectedPdp - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.data=response.data; - }); - }; - - $scope.deletePDPFromGroup = function(data){ - modalService.popupConfirmWin("Confirm","You are about to delete the PDP Group : "+data.name+". Do you want to continue?", - function(){ - var uuu = "pdp_Group/remove_pdpFromGroup.htm"; - var postData={data: data, - activePDP : $scope.selectedPdp}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.data=data.data;}); - Notification.success("PDP Group Deleted Successfully"); - }, - error : function(data){ - console.log(data); - Notification.error("Error Occured While Deleting a PDP Group") - //modalService.showFailure("Fail","Error while deleting: "+ data.responseText); - } - }); - - }) - }; - - $scope.statusOfPDP = function(status){ - $scope.pdpStatus = status; - console.log($scope.pdpStatus); - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl: 'pdpGroupStatusWindow.html', - controller: 'pdpGroupStatusController', - resolve: { - message: function () { - var message = { - status : $scope.pdpStatus, - policies : $scope.policies - }; - return message; - } - } - }); - modalInstance.result.then(function(response){ - console.log('response', response); - $scope.data=response.data; - }); - }; - - $scope.savePDPGroup = function(pdpGroupData) { - var uuu = "pdp_Group/save_pdp_group.htm"; - var postData={pdpGroupData: pdpGroupData}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.data=data.data;}); - console.log($scope.data); - $modalInstance.close({data:$scope.data}); - }, - error : function(data){ - alert("Error while saving."); - } - }); - }; - - $scope.close = function() { - $modalInstance.close(); - }; -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/policyAdminTabController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/policyAdminTabController.js deleted file mode 100644 index 698b7e807..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/policyAdminTabController.js +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - * - */ -app.controller("policyAdminController", function($scope, AdminTabService, modalService, $modal, Notification){ - $( "#dialog" ).hide(); - - $scope.isDisabled = true; - AdminTabService.getData().then(function(data){ - var j = data; - $scope.data = JSON.parse(j.data); - $scope.lockdowndata = JSON.parse($scope.data.lockdowndata); - if($scope.lockdowndata[0].lockdown == true){ - $scope.isDisabled = true; - }else{ - $scope.isDisabled = false; - } - console.log($scope.data); - },function(error){ - console.log("failed"); - }); - - $scope.saveLockDownValue = function(lockdownValue){ - console.log(lockdownValue); - if(lockdownValue == true){ - Notification.success("Policy Application has been Locked Successfully"); - $scope.isDisabled = true; - }else{ - Notification.success("Policy Application has been UnLocked Successfully"); - $scope.isDisabled = false; - } - var uuu = "adminTabController/save_LockDownValue.htm"; - var postData={lockdowndata: {lockdown : lockdownValue}}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.data=data.data; - }); - console.log($scope.data); - }, - error : function(data){ - alert("Error Occured while saving Lockdown Value."); - } - }); - }; -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/policyController.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/policyController.js deleted file mode 100644 index c5822a7e7..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/controller/policyController.js +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ECOMP Policy Engine - * ================================================================================ - * Copyright (C) 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. - * ============LICENSE_END========================================================= - */ - -/** - * - */ -angular.module('abs').requires.push('ui.grid','ui.grid.pagination','ui.grid.selection', 'ui.grid.exporter', 'ui.grid.edit', 'ui.grid.autoResize', - 'ui.grid.resizeColumns','ngRoute', 'pascalprecht.translate', 'ngCookies', 'ui-notification', 'ui.grid.treeView'); -app.config(function($routeProvider) { - $routeProvider - .when('/Editor', { - templateUrl:'app/policyApp/policy-models/Editor/src/templates/main.html', - controller : "FileManagerCtrl" - }) - .when('/Dictionary', { - templateUrl: 'app/policyApp/policy-models/policy_Dictionary.html', - controller : "dictionaryTabController" - }) - .when('/Pdp', { - templateUrl: 'app/policyApp/policy-models/policy_PDPManagement.html', - controller : "pdpTabController" - }) - .when('/Push', { - templateUrl: 'app/policyApp/policy-models/policy_AutoPush.html', - controller : "policyPushController" - }) - .when('/Admin', { - templateUrl: 'app/policyApp/policy-models/policy_AdminTab.html', - controller : "policyAdminController" - }) - .when('/Roles', { - templateUrl: 'app/policyApp/policy-models/policy_Roles.html', - controller : "policyRolesController" - }) - .when('/Dashboard', { - templateUrl: 'app/policyApp/policy-models/policy_DashboardLogging.html', - controller : "policyDashboardController" - }) - .when('/Dashboard_Health', { - templateUrl: 'app/policyApp/policy-models/policy_DashboardHealth.html', - controller : "policyDashboardHealthController" - }) - .otherwise({ - templateUrl:'app/policyApp/policy-models/Editor/src/templates/main.html', - controller : "FileManagerCtrl" - }); - -}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/images/loading.gif b/ecomp-sdk-app/src/main/webapp/app/policyApp/images/loading.gif deleted file mode 100644 index cccb0fc9f..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/policyApp/images/loading.gif and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/images/loading_bar.gif b/ecomp-sdk-app/src/main/webapp/app/policyApp/images/loading_bar.gif deleted file mode 100644 index eed8a505e..000000000 Binary files a/ecomp-sdk-app/src/main/webapp/app/policyApp/images/loading_bar.gif and /dev/null differ diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/README.md b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/README.md deleted file mode 100644 index 3aa457dbe..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/README.md +++ /dev/null @@ -1,48 +0,0 @@ -tableExport.jquery.plugin -========================= - -

      Export HTML Table to

      -
        -
      • JSON -
      • XML -
      • PNG -
      • CSV -
      • TXT -
      • SQL -
      • MS-Word -
      • Ms-Excel -
      • Ms-Powerpoint -
      • PDF -
      - -Installation -============ -jquery Plugin
      -<script type="text/javascript" src="tableExport.js">
      -<script type="text/javascript" src="jquery.base64.js">
      -
      -PNG Export -========== -<script type="text/javascript" src="html2canvas.js"> - -PDF Export -========== -<script type="text/javascript" src="jspdf/libs/sprintf.js">
      -<script type="text/javascript" src="jspdf/jspdf.js">
      -<script type="text/javascript" src="jspdf/libs/base64.js">
      - -Usage -====== -onClick ="$('#tableID').tableExport({type:'pdf',escape:'false'});"
      - -Options -======= -separator: ','
      -ignoreColumn: [2,3],
      -tableName:'yourTableName'
      -type:'csv'
      -pdfFontSize:14
      -pdfLeftMargin:20
      -escape:'true'
      -htmlContent:'false'
      -consoleLog:'false'
      diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/.bower.json b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/.bower.json deleted file mode 100644 index 10e57c5c1..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/.bower.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "angular-cookies", - "version": "1.3.20", - "main": "./angular-cookies.js", - "ignore": [], - "dependencies": { - "angular": "1.3.20" - }, - "homepage": "https://github.com/angular/bower-angular-cookies", - "_release": "1.3.20", - "_resolution": { - "type": "version", - "tag": "v1.3.20", - "commit": "fe6acf196d30f65b2d75438c9f7d9eb283da0d6f" - }, - "_source": "git://github.com/angular/bower-angular-cookies.git", - "_target": "~1.3.17", - "_originalSource": "angular-cookies" -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/README.md b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/README.md deleted file mode 100644 index 7b190d346..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# packaged angular-cookies - -This repo is for distribution on `npm` and `bower`. The source for this module is in the -[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngCookies). -Please file issues and pull requests against that repo. - -## Install - -You can install this package either with `npm` or with `bower`. - -### npm - -```shell -npm install angular-cookies -``` - -Then add `ngCookies` as a dependency for your app: - -```javascript -angular.module('myApp', [require('angular-cookies')]); -``` - -### bower - -```shell -bower install angular-cookies -``` - -Add a ` -``` - -Then add `ngCookies` as a dependency for your app: - -```javascript -angular.module('myApp', ['ngCookies']); -``` - -## Documentation - -Documentation is available on the -[AngularJS docs site](http://docs.angularjs.org/api/ngCookies). - -## License - -The MIT License - -Copyright (c) 2010-2015 Google, Inc. http://angularjs.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.js deleted file mode 100644 index d564aa251..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.js +++ /dev/null @@ -1,207 +0,0 @@ -/** - * @license AngularJS v1.3.20 - * (c) 2010-2014 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular, undefined) {'use strict'; - -/** - * @ngdoc module - * @name ngCookies - * @description - * - * # ngCookies - * - * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies. - * - * - *
      - * - * See {@link ngCookies.$cookies `$cookies`} and - * {@link ngCookies.$cookieStore `$cookieStore`} for usage. - */ - - -angular.module('ngCookies', ['ng']). - /** - * @ngdoc service - * @name $cookies - * - * @description - * Provides read/write access to browser's cookies. - * - * Only a simple Object is exposed and by adding or removing properties to/from this object, new - * cookies are created/deleted at the end of current $eval. - * The object's properties can only be strings. - * - * Requires the {@link ngCookies `ngCookies`} module to be installed. - * - * @example - * - * ```js - * angular.module('cookiesExample', ['ngCookies']) - * .controller('ExampleController', ['$cookies', function($cookies) { - * // Retrieving a cookie - * var favoriteCookie = $cookies.myFavorite; - * // Setting a cookie - * $cookies.myFavorite = 'oatmeal'; - * }]); - * ``` - */ - factory('$cookies', ['$rootScope', '$browser', function($rootScope, $browser) { - var cookies = {}, - lastCookies = {}, - lastBrowserCookies, - runEval = false, - copy = angular.copy, - isUndefined = angular.isUndefined; - - //creates a poller fn that copies all cookies from the $browser to service & inits the service - $browser.addPollFn(function() { - var currentCookies = $browser.cookies(); - if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl - lastBrowserCookies = currentCookies; - copy(currentCookies, lastCookies); - copy(currentCookies, cookies); - if (runEval) $rootScope.$apply(); - } - })(); - - runEval = true; - - //at the end of each eval, push cookies - //TODO: this should happen before the "delayed" watches fire, because if some cookies are not - // strings or browser refuses to store some cookies, we update the model in the push fn. - $rootScope.$watch(push); - - return cookies; - - - /** - * Pushes all the cookies from the service to the browser and verifies if all cookies were - * stored. - */ - function push() { - var name, - value, - browserCookies, - updated; - - //delete any cookies deleted in $cookies - for (name in lastCookies) { - if (isUndefined(cookies[name])) { - $browser.cookies(name, undefined); - delete lastCookies[name]; - } - } - - //update all cookies updated in $cookies - for (name in cookies) { - value = cookies[name]; - if (!angular.isString(value)) { - value = '' + value; - cookies[name] = value; - } - if (value !== lastCookies[name]) { - $browser.cookies(name, value); - lastCookies[name] = value; - updated = true; - } - } - - //verify what was actually stored - if (updated) { - browserCookies = $browser.cookies(); - - for (name in cookies) { - if (cookies[name] !== browserCookies[name]) { - //delete or reset all cookies that the browser dropped from $cookies - if (isUndefined(browserCookies[name])) { - delete cookies[name]; - delete lastCookies[name]; - } else { - cookies[name] = lastCookies[name] = browserCookies[name]; - } - } - } - } - } - }]). - - - /** - * @ngdoc service - * @name $cookieStore - * @requires $cookies - * - * @description - * Provides a key-value (string-object) storage, that is backed by session cookies. - * Objects put or retrieved from this storage are automatically serialized or - * deserialized by angular's toJson/fromJson. - * - * Requires the {@link ngCookies `ngCookies`} module to be installed. - * - * @example - * - * ```js - * angular.module('cookieStoreExample', ['ngCookies']) - * .controller('ExampleController', ['$cookieStore', function($cookieStore) { - * // Put cookie - * $cookieStore.put('myFavorite','oatmeal'); - * // Get cookie - * var favoriteCookie = $cookieStore.get('myFavorite'); - * // Removing a cookie - * $cookieStore.remove('myFavorite'); - * }]); - * ``` - */ - factory('$cookieStore', ['$cookies', function($cookies) { - - return { - /** - * @ngdoc method - * @name $cookieStore#get - * - * @description - * Returns the value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {Object} Deserialized cookie value. - */ - get: function(key) { - var value = $cookies[key]; - return value ? angular.fromJson(value) : value; - }, - - /** - * @ngdoc method - * @name $cookieStore#put - * - * @description - * Sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {Object} value Value to be stored. - */ - put: function(key, value) { - $cookies[key] = angular.toJson(value); - }, - - /** - * @ngdoc method - * @name $cookieStore#remove - * - * @description - * Remove given cookie - * - * @param {string} key Id of the key-value pair to delete. - */ - remove: function(key) { - delete $cookies[key]; - } - }; - - }]); - - -})(window, window.angular); diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.min.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.min.js deleted file mode 100644 index f73736b53..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - AngularJS v1.3.20 - (c) 2010-2014 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(p,g,n){'use strict';g.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,b){var c={},f={},h,k=!1,l=g.copy,m=g.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,f),l(a,c),k&&e.$apply())})();k=!0;e.$watch(function(){var a,d,e;for(a in f)m(c[a])&&(b.cookies(a,n),delete f[a]);for(a in c)d=c[a],g.isString(d)||(d=""+d,c[a]=d),d!==f[a]&&(b.cookies(a,d),f[a]=d,e=!0);if(e)for(a in d=b.cookies(),c)c[a]!==d[a]&&(m(d[a])?(delete c[a],delete f[a]):c[a]= -f[a]=d[a])});return c}]).factory("$cookieStore",["$cookies",function(e){return{get:function(b){return(b=e[b])?g.fromJson(b):b},put:function(b,c){e[b]=g.toJson(c)},remove:function(b){delete e[b]}}}])})(window,window.angular); -//# sourceMappingURL=angular-cookies.min.js.map diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.min.js.map b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.min.js.map deleted file mode 100644 index 87491ad1b..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/angular-cookies.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular-cookies.min.js", -"lineCount":7, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CAmBtCD,CAAAE,OAAA,CAAe,WAAf,CAA4B,CAAC,IAAD,CAA5B,CAAAC,QAAA,CA0BW,UA1BX,CA0BuB,CAAC,YAAD,CAAe,UAAf,CAA2B,QAAQ,CAACC,CAAD,CAAaC,CAAb,CAAuB,CAAA,IACvEC,EAAU,EAD6D,CAEvEC,EAAc,EAFyD,CAGvEC,CAHuE,CAIvEC,EAAU,CAAA,CAJ6D,CAKvEC,EAAOV,CAAAU,KALgE,CAMvEC,EAAcX,CAAAW,YAGlBN,EAAAO,UAAA,CAAmB,QAAQ,EAAG,CAC5B,IAAIC,EAAiBR,CAAAC,QAAA,EACjBE,EAAJ,EAA0BK,CAA1B,GACEL,CAGA,CAHqBK,CAGrB,CAFAH,CAAA,CAAKG,CAAL,CAAqBN,CAArB,CAEA,CADAG,CAAA,CAAKG,CAAL,CAAqBP,CAArB,CACA,CAAIG,CAAJ,EAAaL,CAAAU,OAAA,EAJf,CAF4B,CAA9B,CAAA,EAUAL,EAAA,CAAU,CAAA,CAKVL,EAAAW,OAAA,CASAC,QAAa,EAAG,CAAA,IACVC,CADU,CAEVC,CAFU,CAIVC,CAGJ,KAAKF,CAAL,GAAaV,EAAb,CACMI,CAAA,CAAYL,CAAA,CAAQW,CAAR,CAAZ,CAAJ,GACEZ,CAAAC,QAAA,CAAiBW,CAAjB,CAAuBhB,CAAvB,CACA,CAAA,OAAOM,CAAA,CAAYU,CAAZ,CAFT,CAOF,KAAKA,CAAL,GAAaX,EAAb,CACEY,CAKA,CALQZ,CAAA,CAAQW,CAAR,CAKR,CAJKjB,CAAAoB,SAAA,CAAiBF,CAAjB,CAIL,GAHEA,CACA,CADQ,EACR,CADaA,CACb,CAAAZ,CAAA,CAAQW,CAAR,CAAA,CAAgBC,CAElB,EAAIA,CAAJ,GAAcX,CAAA,CAAYU,CAAZ,CAAd,GACEZ,CAAAC,QAAA,CAAiBW,CAAjB,CAAuBC,CAAvB,CAEA,CADAX,CAAA,CAAYU,CAAZ,CACA,CADoBC,CACpB,CAAAC,CAAA,CAAU,CAAA,CAHZ,CAQF,IAAIA,CAAJ,CAGE,IAAKF,CAAL,GAFAI,EAEaf,CAFID,CAAAC,QAAA,EAEJA,CAAAA,CAAb,CACMA,CAAA,CAAQW,CAAR,CAAJ,GAAsBI,CAAA,CAAeJ,CAAf,CAAtB,GAEMN,CAAA,CAAYU,CAAA,CAAeJ,CAAf,CAAZ,CAAJ,EACE,OAAOX,CAAA,CAAQW,CAAR,CACP,CAAA,OAAOV,CAAA,CAAYU,CAAZ,CAFT,EAIEX,CAAA,CAAQW,CAAR,CAJF;AAIkBV,CAAA,CAAYU,CAAZ,CAJlB,CAIsCI,CAAA,CAAeJ,CAAf,CANxC,CAjCU,CAThB,CAEA,OAAOX,EA1BoE,CAA1D,CA1BvB,CAAAH,QAAA,CAqIW,cArIX,CAqI2B,CAAC,UAAD,CAAa,QAAQ,CAACmB,CAAD,CAAW,CAErD,MAAO,CAWLC,IAAKA,QAAQ,CAACC,CAAD,CAAM,CAEjB,MAAO,CADHN,CACG,CADKI,CAAA,CAASE,CAAT,CACL,EAAQxB,CAAAyB,SAAA,CAAiBP,CAAjB,CAAR,CAAkCA,CAFxB,CAXd,CA0BLQ,IAAKA,QAAQ,CAACF,CAAD,CAAMN,CAAN,CAAa,CACxBI,CAAA,CAASE,CAAT,CAAA,CAAgBxB,CAAA2B,OAAA,CAAeT,CAAf,CADQ,CA1BrB,CAuCLU,OAAQA,QAAQ,CAACJ,CAAD,CAAM,CACpB,OAAOF,CAAA,CAASE,CAAT,CADa,CAvCjB,CAF8C,CAAhC,CArI3B,CAnBsC,CAArC,CAAD,CAyMGzB,MAzMH,CAyMWA,MAAAC,QAzMX;", -"sources":["angular-cookies.js"], -"names":["window","angular","undefined","module","factory","$rootScope","$browser","cookies","lastCookies","lastBrowserCookies","runEval","copy","isUndefined","addPollFn","currentCookies","$apply","$watch","push","name","value","updated","isString","browserCookies","$cookies","get","key","fromJson","put","toJson","remove"] -} diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/bower.json b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/bower.json deleted file mode 100644 index d4075a279..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/bower.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "angular-cookies", - "version": "1.3.20", - "main": "./angular-cookies.js", - "ignore": [], - "dependencies": { - "angular": "1.3.20" - } -} diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/index.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/index.js deleted file mode 100644 index 657667549..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/index.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./angular-cookies'); -module.exports = 'ngCookies'; diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/package.json b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/package.json deleted file mode 100644 index 97e74204f..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-cookies/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "angular-cookies", - "version": "1.3.20", - "description": "AngularJS module for cookies", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/angular/angular.js.git" - }, - "keywords": [ - "angular", - "framework", - "browser", - "cookies", - "client-side" - ], - "author": "Angular Core Team ", - "license": "MIT", - "bugs": { - "url": "https://github.com/angular/angular.js/issues" - }, - "homepage": "http://angularjs.org" -} diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-translate/angular-translate.min.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-translate/angular-translate.min.js deleted file mode 100644 index 933deba79..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular-translate/angular-translate.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * angular-translate - v2.9.1 - 2016-02-13 - * - * Copyright (c) 2016 The angular-translate team, Pascal Precht; Licensed MIT - */ -!function(a,b){"function"==typeof define&&define.amd?define([],function(){return b()}):"object"==typeof exports?module.exports=b():b()}(this,function(){function a(a){"use strict";var b=a.storageKey(),c=a.storage(),d=function(){var d=a.preferredLanguage();angular.isString(d)?a.use(d):c.put(b,a.use())};d.displayName="fallbackFromIncorrectStorageValue",c?c.get(b)?a.use(c.get(b))["catch"](d):d():angular.isString(a.preferredLanguage())&&a.use(a.preferredLanguage())}function b(){"use strict";var a,b,c=null,d=!1,e=!1;b={sanitize:function(a,b){return"text"===b&&(a=g(a)),a},escape:function(a,b){return"text"===b&&(a=f(a)),a},sanitizeParameters:function(a,b){return"params"===b&&(a=h(a,g)),a},escapeParameters:function(a,b){return"params"===b&&(a=h(a,f)),a}},b.escaped=b.escapeParameters,this.addStrategy=function(a,c){return b[a]=c,this},this.removeStrategy=function(a){return delete b[a],this},this.useStrategy=function(a){return d=!0,c=a,this},this.$get=["$injector","$log",function(f,g){var h={},i=function(a,c,d){return angular.forEach(d,function(d){if(angular.isFunction(d))a=d(a,c);else if(angular.isFunction(b[d]))a=b[d](a,c);else{if(!angular.isString(b[d]))throw new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '"+d+"'");if(!h[b[d]])try{h[b[d]]=f.get(b[d])}catch(e){throw h[b[d]]=function(){},new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '"+d+"'")}a=h[b[d]](a,c)}}),a},j=function(){d||e||(g.warn("pascalprecht.translate.$translateSanitization: No sanitization strategy has been configured. This can have serious security implications. See http://angular-translate.github.io/docs/#/guide/19_security for details."),e=!0)};return f.has("$sanitize")&&(a=f.get("$sanitize")),{useStrategy:function(a){return function(b){a.useStrategy(b)}}(this),sanitize:function(a,b,d){if(c||j(),arguments.length<3&&(d=c),!d)return a;var e=angular.isArray(d)?d:[d];return i(a,b,e)}}}];var f=function(a){var b=angular.element("
      ");return b.text(a),b.html()},g=function(b){if(!a)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot find $sanitize service. Either include the ngSanitize module (https://docs.angularjs.org/api/ngSanitize) or use a sanitization strategy which does not depend on $sanitize, such as 'escape'.");return a(b)},h=function(a,b){if(angular.isObject(a)){var c=angular.isArray(a)?[]:{};return angular.forEach(a,function(a,d){c[d]=h(a,b)}),c}return angular.isNumber(a)?a:b(a)}}function c(a,b,c,d){"use strict";var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t={},u=[],v=a,w=[],x="translate-cloak",y=!1,z=!1,A=".",B=!1,C=0,D=!0,E="default",F={"default":function(a){return(a||"").split("-").join("_")},java:function(a){var b=(a||"").split("-").join("_"),c=b.split("_");return c.length>1?c[0].toLowerCase()+"_"+c[1].toUpperCase():b},bcp47:function(a){var b=(a||"").split("_").join("-"),c=b.split("-");return c.length>1?c[0].toLowerCase()+"-"+c[1].toUpperCase():b}},G="2.9.1",H=function(){if(angular.isFunction(d.getLocale))return d.getLocale();var a,c,e=b.$get().navigator,f=["language","browserLanguage","systemLanguage","userLanguage"];if(angular.isArray(e.languages))for(a=0;ac;c++)if(a[c]===b)return c;return-1},K=function(){return this.toString().replace(/^\s+|\s+$/g,"")},L=function(a){if(a){for(var b=[],c=angular.lowercase(a),d=0,e=u.length;e>d;d++)b.push(angular.lowercase(u[d]));if(J(b,c)>-1)return a;if(f){var g;for(var h in f){var i=!1,j=Object.prototype.hasOwnProperty.call(f,h)&&angular.lowercase(h)===angular.lowercase(a);if("*"===h.slice(-1)&&(i=h.slice(0,-1)===a.slice(0,h.length-1)),(j||i)&&(g=f[h],J(b,angular.lowercase(g))>-1))return g}}var k=a.split("_");return k.length>1&&J(b,angular.lowercase(k[0]))>-1?k[0]:void 0}},M=function(a,b){if(!a&&!b)return t;if(a&&!b){if(angular.isString(a))return t[a]}else angular.isObject(t[a])||(t[a]={}),angular.extend(t[a],N(b));return this};this.translations=M,this.cloakClassName=function(a){return a?(x=a,this):x},this.nestedObjectDelimeter=function(a){return a?(A=a,this):A};var N=function(a,b,c,d){var e,f,g,h;b||(b=[]),c||(c={});for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(h=a[e],angular.isObject(h)?N(h,b.concat(e),c,e):(f=b.length?""+b.join(A)+A+e:e,b.length&&e===d&&(g=""+b.join(A),c[g]="@:"+f),c[f]=h));return c};N.displayName="flatObject",this.addInterpolation=function(a){return w.push(a),this},this.useMessageFormatInterpolation=function(){return this.useInterpolation("$translateMessageFormatInterpolation")},this.useInterpolation=function(a){return n=a,this},this.useSanitizeValueStrategy=function(a){return c.useStrategy(a),this},this.preferredLanguage=function(a){return a?(O(a),this):e};var O=function(a){return a&&(e=a),e};this.translationNotFoundIndicator=function(a){return this.translationNotFoundIndicatorLeft(a),this.translationNotFoundIndicatorRight(a),this},this.translationNotFoundIndicatorLeft=function(a){return a?(q=a,this):q},this.translationNotFoundIndicatorRight=function(a){return a?(r=a,this):r},this.fallbackLanguage=function(a){return P(a),this};var P=function(a){return a?(angular.isString(a)?(h=!0,g=[a]):angular.isArray(a)&&(h=!1,g=a),angular.isString(e)&&J(g,e)<0&&g.push(e),this):h?g[0]:g};this.use=function(a){if(a){if(!t[a]&&!o)throw new Error("$translateProvider couldn't find translationTable for langKey: '"+a+"'");return i=a,this}return i};var Q=function(a){return a?(v=a,this):l?l+v:v};this.storageKey=Q,this.useUrlLoader=function(a,b){return this.useLoader("$translateUrlLoader",angular.extend({url:a},b))},this.useStaticFilesLoader=function(a){return this.useLoader("$translateStaticFilesLoader",a)},this.useLoader=function(a,b){return o=a,p=b||{},this},this.useLocalStorage=function(){return this.useStorage("$translateLocalStorage")},this.useCookieStorage=function(){return this.useStorage("$translateCookieStorage")},this.useStorage=function(a){return k=a,this},this.storagePrefix=function(a){return a?(l=a,this):a},this.useMissingTranslationHandlerLog=function(){return this.useMissingTranslationHandler("$translateMissingTranslationHandlerLog")},this.useMissingTranslationHandler=function(a){return m=a,this},this.usePostCompiling=function(a){return y=!!a,this},this.forceAsyncReload=function(a){return z=!!a,this},this.uniformLanguageTag=function(a){return a?angular.isString(a)&&(a={standard:a}):a={},E=a.standard,this},this.determinePreferredLanguage=function(a){var b=a&&angular.isFunction(a)?a():I();return e=u.length?L(b)||b:b,this},this.registerAvailableLanguageKeys=function(a,b){return a?(u=a,b&&(f=b),this):u},this.useLoaderCache=function(a){return a===!1?s=void 0:a===!0?s=!0:"undefined"==typeof a?s="$translationCache":a&&(s=a),this},this.directivePriority=function(a){return void 0===a?C:(C=a,this)},this.statefulFilter=function(a){return void 0===a?D:(D=a,this)},this.$get=["$log","$injector","$rootScope","$q",function(a,b,c,d){var f,l,u,E=b.get(n||"$translateDefaultInterpolation"),F=!1,H={},I={},R=function(a,b,c,h,j){var m=j&&j!==i?L(j)||j:i;if(angular.isArray(a)){var n=function(a){for(var e={},f=[],g=function(a){var f=d.defer(),g=function(b){e[a]=b,f.resolve([a,b])};return R(a,b,c,h,j).then(g,g),f.promise},i=0,k=a.length;k>i;i++)f.push(g(a[i]));return d.all(f).then(function(){return e})};return n(a)}var o=d.defer();a&&(a=K.apply(a));var p=function(){var a=e?I[e]:I[m];if(l=0,k&&!a){var b=f.get(v);if(a=I[b],g&&g.length){var c=J(g,b);l=0===c?1:0,J(g,e)<0&&g.push(e)}}return a}();if(p){var q=function(){j||(m=i),ca(a,b,c,h,m).then(o.resolve,o.reject)};q.displayName="promiseResolved",p["finally"](q,o.reject)}else ca(a,b,c,h,m).then(o.resolve,o.reject);return o.promise},S=function(a){return q&&(a=[q,a].join(" ")),r&&(a=[a,r].join(" ")),a},T=function(a){i=a,k&&f.put(R.storageKey(),i),c.$emit("$translateChangeSuccess",{language:a}),E.setLocale(i);var b=function(a,b){H[b].setLocale(i)};b.displayName="eachInterpolatorLocaleSetter",angular.forEach(H,b),c.$emit("$translateChangeEnd",{language:a})},U=function(a){if(!a)throw"No language key specified for loading.";var e=d.defer();c.$emit("$translateLoadingStart",{language:a}),F=!0;var f=s;"string"==typeof f&&(f=b.get(f));var g=angular.extend({},p,{key:a,$http:angular.extend({},{cache:f},p.$http)}),h=function(b){var d={};c.$emit("$translateLoadingSuccess",{language:a}),angular.isArray(b)?angular.forEach(b,function(a){angular.extend(d,N(a))}):angular.extend(d,N(b)),F=!1,e.resolve({key:a,table:d}),c.$emit("$translateLoadingEnd",{language:a})};h.displayName="onLoaderSuccess";var i=function(a){c.$emit("$translateLoadingError",{language:a}),e.reject(a),c.$emit("$translateLoadingEnd",{language:a})};return i.displayName="onLoaderError",b.get(o)(g).then(h,i),e.promise};if(k&&(f=b.get(k),!f.get||!f.put))throw new Error("Couldn't use storage '"+k+"', missing get() or put() method!");if(w.length){var V=function(a){var c=b.get(a);c.setLocale(e||i),H[c.getInterpolationIdentifier()]=c};V.displayName="interpolationFactoryAdder",angular.forEach(w,V)}var W=function(a){var b=d.defer();if(Object.prototype.hasOwnProperty.call(t,a))b.resolve(t[a]);else if(I[a]){var c=function(a){M(a.key,a.table),b.resolve(a.table)};c.displayName="translationTableResolver",I[a].then(c,b.reject)}else b.reject();return b.promise},X=function(a,b,c,e){var f=d.defer(),g=function(d){if(Object.prototype.hasOwnProperty.call(d,b)){e.setLocale(a);var g=d[b];"@:"===g.substr(0,2)?X(a,g.substr(2),c,e).then(f.resolve,f.reject):f.resolve(e.interpolate(d[b],c)),e.setLocale(i)}else f.reject()};return g.displayName="fallbackTranslationResolver",W(a).then(g,f.reject),f.promise},Y=function(a,b,c,d){var e,f=t[a];if(f&&Object.prototype.hasOwnProperty.call(f,b)){if(d.setLocale(a),e=d.interpolate(f[b],c),"@:"===e.substr(0,2))return Y(a,e.substr(2),c,d);d.setLocale(i)}return e},Z=function(a,c){if(m){var d=b.get(m)(a,i,c);return void 0!==d?d:a}return a},$=function(a,b,c,e,f){var h=d.defer();if(a0?u:l,a,b,c,d)},ba=function(a,b,c){return _(u>0?u:l,a,b,c)},ca=function(a,b,c,e,f){var h=d.defer(),i=f?t[f]:t,j=c?H[c]:E;if(i&&Object.prototype.hasOwnProperty.call(i,a)){var k=i[a];"@:"===k.substr(0,2)?R(k.substr(2),b,c,e,f).then(h.resolve,h.reject):h.resolve(j.interpolate(k,b))}else{var l;m&&!F&&(l=Z(a,b)),f&&g&&g.length?aa(a,b,j,e).then(function(a){h.resolve(a)},function(a){h.reject(S(a))}):m&&!F&&l?e?h.resolve(e):h.resolve(l):e?h.resolve(e):h.reject(S(a))}return h.promise},da=function(a,b,c,d){var e,f=d?t[d]:t,h=E;if(H&&Object.prototype.hasOwnProperty.call(H,c)&&(h=H[c]),f&&Object.prototype.hasOwnProperty.call(f,a)){var i=f[a];e="@:"===i.substr(0,2)?da(i.substr(2),b,c,d):h.interpolate(i,b)}else{var j;m&&!F&&(j=Z(a,b)),d&&g&&g.length?(l=0,e=ba(a,b,h)):e=m&&!F&&j?j:S(a)}return e},ea=function(a){j===a&&(j=void 0),I[a]=void 0};R.preferredLanguage=function(a){return a&&O(a),e},R.cloakClassName=function(){return x},R.nestedObjectDelimeter=function(){return A},R.fallbackLanguage=function(a){if(void 0!==a&&null!==a){if(P(a),o&&g&&g.length)for(var b=0,c=g.length;c>b;b++)I[g[b]]||(I[g[b]]=U(g[b]));R.use(R.use())}return h?g[0]:g},R.useFallbackLanguage=function(a){if(void 0!==a&&null!==a)if(a){var b=J(g,a);b>-1&&(u=b)}else u=0},R.proposedLanguage=function(){return j},R.storage=function(){return f},R.negotiateLocale=L,R.use=function(a){if(!a)return i;var b=d.defer();c.$emit("$translateChangeStart",{language:a});var e=L(a);return e&&(a=e),!z&&t[a]||!o||I[a]?j===a&&I[a]?I[a].then(function(a){return b.resolve(a.key),a},function(a){return b.reject(a),d.reject(a)}):(b.resolve(a),T(a)):(j=a,I[a]=U(a).then(function(c){return M(c.key,c.table),b.resolve(c.key),j===a&&T(c.key),c},function(a){return c.$emit("$translateChangeError",{language:a}),b.reject(a),c.$emit("$translateChangeEnd",{language:a}),d.reject(a)}),I[a]["finally"](function(){ea(a)})),b.promise},R.storageKey=function(){return Q()},R.isPostCompilingEnabled=function(){return y},R.isForceAsyncReloadEnabled=function(){return z},R.refresh=function(a){function b(){f.resolve(),c.$emit("$translateRefreshEnd",{language:a})}function e(){f.reject(),c.$emit("$translateRefreshEnd",{language:a})}if(!o)throw new Error("Couldn't refresh translation table, no loader registered!");var f=d.defer();if(c.$emit("$translateRefreshStart",{language:a}),a)if(t[a]){var h=function(c){M(c.key,c.table),a===i&&T(i),b()};h.displayName="refreshPostProcessor",U(a).then(h,e)}else e();else{var j=[],k={};if(g&&g.length)for(var l=0,m=g.length;m>l;l++)j.push(U(g[l])),k[g[l]]=!0;i&&!k[i]&&j.push(U(i));var n=function(a){t={},angular.forEach(a,function(a){M(a.key,a.table)}),i&&T(i),b()};n.displayName="refreshPostProcessor",d.all(j).then(n,e)}return f.promise},R.instant=function(a,b,c,d){var f=d&&d!==i?L(d)||d:i;if(null===a||angular.isUndefined(a))return a;if(angular.isArray(a)){for(var h={},j=0,k=a.length;k>j;j++)h[a[j]]=R.instant(a[j],b,c,d);return h}if(angular.isString(a)&&a.length<1)return a;a&&(a=K.apply(a));var l,n=[];e&&n.push(e),f&&n.push(f),g&&g.length&&(n=n.concat(g));for(var o=0,p=n.length;p>o;o++){var s=n[o];if(t[s]&&"undefined"!=typeof t[s][a]&&(l=da(a,b,c,f)),"undefined"!=typeof l)break}return l||""===l||(q||r?l=S(a):(l=E.interpolate(a,b),m&&!F&&(l=Z(a,b)))),l},R.versionInfo=function(){return G},R.loaderCache=function(){return s},R.directivePriority=function(){return C},R.statefulFilter=function(){return D},R.isReady=function(){return B};var fa=d.defer();fa.promise.then(function(){B=!0}),R.onReady=function(a){var b=d.defer();return angular.isFunction(a)&&b.promise.then(a),B?b.resolve():fa.promise.then(b.resolve),b.promise};var ga=c.$on("$translateReady",function(){fa.resolve(),ga(),ga=null}),ha=c.$on("$translateChangeEnd",function(){fa.resolve(),ha(),ha=null});if(o){if(angular.equals(t,{})&&R.use()&&R.use(R.use()),g&&g.length)for(var ia=function(a){return M(a.key,a.table),c.$emit("$translateChangeEnd",{language:a.key}),a},ja=0,ka=g.length;ka>ja;ja++){var la=g[ja];(z||!t[la])&&(I[la]=U(la).then(ia))}}else c.$emit("$translateReady",{language:R.use()});return R}]}function d(a,b){"use strict";var c,d={},e="default";return d.setLocale=function(a){c=a},d.getInterpolationIdentifier=function(){return e},d.useSanitizeValueStrategy=function(a){return b.useStrategy(a),this},d.interpolate=function(c,d){d=d||{},d=b.sanitize(d,"params");var e=a(c)(d);return e=b.sanitize(e,"text")},d}function e(a,b,c,d,e,g){"use strict";var h=function(){return this.toString().replace(/^\s+|\s+$/g,"")};return{restrict:"AE",scope:!0,priority:a.directivePriority(),compile:function(b,i){var j=i.translateValues?i.translateValues:void 0,k=i.translateInterpolation?i.translateInterpolation:void 0,l=b[0].outerHTML.match(/translate-value-+/i),m="^(.*)("+c.startSymbol()+".*"+c.endSymbol()+")(.*)",n="^(.*)"+c.startSymbol()+"(.*)"+c.endSymbol()+"(.*)";return function(b,o,p){b.interpolateParams={},b.preText="",b.postText="",b.translateNamespace=f(b);var q={},r=function(a,c,d){if(c.translateValues&&angular.extend(a,e(c.translateValues)(b.$parent)),l)for(var f in d)if(Object.prototype.hasOwnProperty.call(c,f)&&"translateValue"===f.substr(0,14)&&"translateValues"!==f){var g=angular.lowercase(f.substr(14,1))+f.substr(15);a[g]=d[f]}},s=function(a){if(angular.isFunction(s._unwatchOld)&&(s._unwatchOld(),s._unwatchOld=void 0),angular.equals(a,"")||!angular.isDefined(a)){var d=h.apply(o.text()),e=d.match(m);if(angular.isArray(e)){b.preText=e[1],b.postText=e[3],q.translate=c(e[2])(b.$parent);var f=d.match(n);angular.isArray(f)&&f[2]&&f[2].length&&(s._unwatchOld=b.$watch(f[2],function(a){q.translate=a,y()}))}else q.translate=d?d:void 0}else q.translate=a;y()},t=function(a){p.$observe(a,function(b){q[a]=b,y()})};r(b.interpolateParams,p,i);var u=!0;p.$observe("translate",function(a){"undefined"==typeof a?s(""):""===a&&u||(q.translate=a,y()),u=!1});for(var v in p)p.hasOwnProperty(v)&&"translateAttr"===v.substr(0,13)&&t(v);if(p.$observe("translateDefault",function(a){b.defaultText=a,y()}),j&&p.$observe("translateValues",function(a){a&&b.$parent.$watch(function(){angular.extend(b.interpolateParams,e(a)(b.$parent))})}),l){var w=function(a){p.$observe(a,function(c){var d=angular.lowercase(a.substr(14,1))+a.substr(15);b.interpolateParams[d]=c})};for(var x in p)Object.prototype.hasOwnProperty.call(p,x)&&"translateValue"===x.substr(0,14)&&"translateValues"!==x&&w(x)}var y=function(){for(var a in q)q.hasOwnProperty(a)&&void 0!==q[a]&&z(a,q[a],b,b.interpolateParams,b.defaultText,b.translateNamespace)},z=function(b,c,d,e,f,g){c?(g&&"."===c.charAt(0)&&(c=g+c),a(c,e,k,f,d.translateLanguage).then(function(a){A(a,d,!0,b)},function(a){A(a,d,!1,b)})):A(c,d,!1,b)},A=function(b,c,e,f){if("translate"===f){e||"undefined"==typeof c.defaultText||(b=c.defaultText),o.empty().append(c.preText+b+c.postText);var g=a.isPostCompilingEnabled(),h="undefined"!=typeof i.translateCompile,j=h&&"false"!==i.translateCompile;(g&&!h||j)&&d(o.contents())(c)}else{e||"undefined"==typeof c.defaultText||(b=c.defaultText);var k=p.$attr[f];"data-"===k.substr(0,5)&&(k=k.substr(5)),k=k.substr(15),o.attr(k,b)}};(j||l||p.translateDefault)&&b.$watch("interpolateParams",y,!0),b.$watch("translateLanguage",y);var B=g.$on("$translateChangeSuccess",y);o.text().length?s(p.translate?p.translate:""):p.translate&&s(p.translate),y(),b.$on("$destroy",B)}}}}function f(a){"use strict";return a.translateNamespace?a.translateNamespace:a.$parent?f(a.$parent):void 0}function g(a,b){"use strict";return{compile:function(c){var d=function(){c.addClass(a.cloakClassName())},e=function(){c.removeClass(a.cloakClassName())};return a.onReady(function(){e()}),d(),function(c,f,g){g.translateCloak&&g.translateCloak.length&&(g.$observe("translateCloak",function(b){a(b).then(e,d)}),b.$on("$translateChangeSuccess",function(){a(g.translateCloak).then(e,d)}))}}}}function h(){"use strict";return{restrict:"A",scope:!0,compile:function(){return{pre:function(a,b,c){a.translateNamespace=f(a),a.translateNamespace&&"."===c.translateNamespace.charAt(0)?a.translateNamespace+=c.translateNamespace:a.translateNamespace=c.translateNamespace}}}}}function f(a){"use strict";return a.translateNamespace?a.translateNamespace:a.$parent?f(a.$parent):void 0}function i(){"use strict";return{restrict:"A",scope:!0,compile:function(){return function(a,b,c){c.$observe("translateLanguage",function(b){a.translateLanguage=b})}}}}function j(a,b){"use strict";var c=function(c,d,e,f){return angular.isObject(d)||(d=a(d)(this)),b.instant(c,d,e,f)};return b.statefulFilter()&&(c.$stateful=!0),c}function k(a){"use strict";return a("translations")}return angular.module("pascalprecht.translate",["ng"]).run(a),a.$inject=["$translate"],a.displayName="runTranslate",angular.module("pascalprecht.translate").provider("$translateSanitization",b),angular.module("pascalprecht.translate").constant("pascalprechtTranslateOverrider",{}).provider("$translate",c),c.$inject=["$STORAGE_KEY","$windowProvider","$translateSanitizationProvider","pascalprechtTranslateOverrider"],c.displayName="displayName",angular.module("pascalprecht.translate").factory("$translateDefaultInterpolation",d),d.$inject=["$interpolate","$translateSanitization"],d.displayName="$translateDefaultInterpolation",angular.module("pascalprecht.translate").constant("$STORAGE_KEY","NG_TRANSLATE_LANG_KEY"),angular.module("pascalprecht.translate").directive("translate",e),e.$inject=["$translate","$q","$interpolate","$compile","$parse","$rootScope"],e.displayName="translateDirective",angular.module("pascalprecht.translate").directive("translateCloak",g),g.$inject=["$translate","$rootScope"],g.displayName="translateCloakDirective",angular.module("pascalprecht.translate").directive("translateNamespace",h),h.displayName="translateNamespaceDirective",angular.module("pascalprecht.translate").directive("translateLanguage",i),i.displayName="translateLanguageDirective",angular.module("pascalprecht.translate").filter("translate",j),j.$inject=["$parse","$translate"],j.displayName="translateFilterFactory",angular.module("pascalprecht.translate").factory("$translationCache",k),k.$inject=["$cacheFactory"],k.displayName="$translationCache","pascalprecht.translate"}); \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/.bower.json b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/.bower.json deleted file mode 100644 index e7ab211e3..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/.bower.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "angular", - "version": "1.3.20", - "main": "./angular.js", - "ignore": [], - "dependencies": {}, - "homepage": "https://github.com/angular/bower-angular", - "_release": "1.3.20", - "_resolution": { - "type": "version", - "tag": "v1.3.20", - "commit": "0cd10f27471310fe07167b00f8a4242c6bba4df2" - }, - "_source": "git://github.com/angular/bower-angular.git", - "_target": "~1.3.15", - "_originalSource": "angular" -} \ No newline at end of file diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/README.md b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/README.md deleted file mode 100644 index d1bc0eddf..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# packaged angular - -This repo is for distribution on `npm` and `bower`. The source for this module is in the -[main AngularJS repo](https://github.com/angular/angular.js). -Please file issues and pull requests against that repo. - -## Install - -You can install this package either with `npm` or with `bower`. - -### npm - -```shell -npm install angular -``` - -Then add a ` -``` - -Or `require('angular')` from your code. - -### bower - -```shell -bower install angular -``` - -Then add a ` -``` - -## Documentation - -Documentation is available on the -[AngularJS docs site](http://docs.angularjs.org/). - -## License - -The MIT License - -Copyright (c) 2010-2015 Google, Inc. http://angularjs.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular-csp.css b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular-csp.css deleted file mode 100644 index 0ce9d864c..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular-csp.css +++ /dev/null @@ -1,13 +0,0 @@ -/* Include this file in your html if you are using the CSP mode. */ - -@charset "UTF-8"; - -[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], -.ng-cloak, .x-ng-cloak, -.ng-hide:not(.ng-hide-animate) { - display: none !important; -} - -ng\:form { - display: block; -} diff --git a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular.js b/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular.js deleted file mode 100644 index 2445ab55e..000000000 --- a/ecomp-sdk-app/src/main/webapp/app/policyApp/libs/bower_components/angular/angular.js +++ /dev/null @@ -1,26451 +0,0 @@ -/** - * @license AngularJS v1.3.20 - * (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. - * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning - * error from returned function, for cases when a particular type of error is useful. - * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance - */ - -function minErr(module, ErrorConstructor) { - ErrorConstructor = ErrorConstructor || Error; - return function() { - var code = arguments[0], - prefix = '[' + (module ? module + ':' : '') + code + '] ', - template = arguments[1], - templateArgs = arguments, - - message, i; - - message = prefix + template.replace(/\{\d+\}/g, function(match) { - var index = +match.slice(1, -1), arg; - - if (index + 2 < templateArgs.length) { - return toDebugString(templateArgs[index + 2]); - } - return match; - }); - - message = message + '\nhttp://errors.angularjs.org/1.3.20/' + - (module ? module + '/' : '') + code; - for (i = 2; i < arguments.length; i++) { - message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' + - encodeURIComponent(toDebugString(arguments[i])); - } - return new ErrorConstructor(message); - }; -} - -/* We need to tell jshint what variables are being exported */ -/* global angular: true, - msie: true, - jqLite: true, - jQuery: true, - slice: true, - splice: true, - push: true, - toString: true, - ngMinErr: true, - angularModule: true, - uid: true, - REGEX_STRING_REGEXP: 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, - isFormData: true, - isBlob: true, - isBoolean: true, - isPromiseLike: true, - trim: true, - escapeForRegexp: true, - isElement: true, - makeMap: true, - includes: true, - arrayRemove: true, - copy: true, - shallowCopy: true, - equals: true, - csp: true, - concat: true, - sliceArgs: true, - bind: true, - toJsonReplacer: true, - toJson: true, - fromJson: true, - startingTag: true, - tryDecodeURIComponent: true, - parseKeyValue: true, - toKeyValue: true, - encodeUriSegment: true, - encodeUriQuery: true, - angularInit: true, - bootstrap: true, - getTestability: true, - snake_case: true, - bindJQuery: true, - assertArg: true, - assertArgFn: true, - assertNotHasOwnProperty: true, - getter: true, - getBlockNodes: true, - hasOwnProperty: true, - createMap: true, - - NODE_TYPE_ELEMENT: true, - NODE_TYPE_ATTRIBUTE: true, - NODE_TYPE_TEXT: true, - NODE_TYPE_COMMENT: true, - NODE_TYPE_DOCUMENT: true, - NODE_TYPE_DOCUMENT_FRAGMENT: 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. - * - *
      - */ - -var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/; - -// 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 - msie, // holds major version number for IE, or NaN if UA is not IE. - jqLite, // delay binding since jQuery could be loaded after us. - jQuery, // delay binding - slice = [].slice, - splice = [].splice, - push = [].push, - toString = Object.prototype.toString, - ngMinErr = minErr('ng'), - - /** @name angular */ - angular = window.angular || (window.angular = {}), - angularModule, - uid = 0; - -/** - * documentMode is an IE-only property - * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx - */ -msie = document.documentMode; - - -/** - * @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; - } - - // Support: iOS 8.2 (not reproducible in simulator) - // "length" in obj used to prevent JIT error (gh-11508) - var length = "length" in Object(obj) && obj.length; - - if (obj.nodeType === NODE_TYPE_ELEMENT && 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, obj)`, where `value` - * is the value of an object property or an array element, `key` is the object property key or - * array element index and obj is the `obj` itself. 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. - * - * Unlike ES262's - * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18), - * Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just - * return the value provided. - * - ```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, length; - 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, obj); - } - } - } else if (isArray(obj) || isArrayLike(obj)) { - var isPrimitive = typeof obj !== 'object'; - for (key = 0, length = obj.length; key < length; key++) { - if (isPrimitive || key in obj) { - iterator.call(context, obj[key], key, obj); - } - } - } else if (obj.forEach && obj.forEach !== forEach) { - obj.forEach(iterator, context, obj); - } else { - for (key in obj) { - if (obj.hasOwnProperty(key)) { - iterator.call(context, obj[key], key, obj); - } - } - } - } - return obj; -} - -function sortedKeys(obj) { - return Object.keys(obj).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. - * - * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before - * we hit number precision issues in JavaScript. - * - * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M - * - * @returns {number} an unique alpha-numeric string - */ -function nextUid() { - return ++uid; -} - - -/** - * 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 own enumerable properties from the `src` object(s) - * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so - * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`. - * Note: Keep in mind that `angular.extend` does not support recursive merge (deep copy). - * - * @param {Object} dst Destination object. - * @param {...Object} src Source object(s). - * @returns {Object} Reference to `dst`. - */ -function extend(dst) { - var h = dst.$$hashKey; - - for (var i = 1, ii = arguments.length; i < ii; i++) { - var obj = arguments[i]; - if (obj) { - var keys = Object.keys(obj); - for (var j = 0, jj = keys.length; j < jj; j++) { - var key = keys[j]; - dst[key] = obj[key]; - } - } - } - - setHashKey(dst, h); - return dst; -} - -function int(str) { - return parseInt(str, 10); -} - - -function inherit(parent, extra) { - return extend(Object.create(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); - }; - ``` - * @param {*} value to be returned. - * @returns {*} the value passed in. - */ -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) { - // http://jsperf.com/isobject4 - 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`. - * - * This includes the "special" numbers `NaN`, `+Infinity` and `-Infinity`. - * - * If you wish to exclude these then you can use the native - * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) - * method. - * - * @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 = 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.window === obj; -} - - -function isScope(obj) { - return obj && obj.$evalAsync && obj.$watch; -} - - -function isFile(obj) { - return toString.call(obj) === '[object File]'; -} - - -function isFormData(obj) { - return toString.call(obj) === '[object FormData]'; -} - - -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(value) { - return isString(value) ? value.trim() : value; -}; - -// Copied from: -// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021 -// Prereq: s is a string. -var escapeForRegexp = function(s) { - return s.replace(/([-()\[\]{}+?*.$\^|,:#= 0) - array.splice(index, 1); - return value; -} - -/** - * @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 arrays) 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)) { - var emptyObject = Object.create(Object.getPrototypeOf(source)); - destination = copy(source, emptyObject, 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 = stackSource.indexOf(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) { - if (source.hasOwnProperty(key)) { - 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. - * - * Assumes that there are no proto properties for objects. - */ -function shallowCopy(src, dst) { - if (isArray(src)) { - dst = dst || []; - - for (var i = 0, ii = src.length; i < ii; i++) { - dst[i] = src[i]; - } - } else if (isObject(src)) { - dst = dst || {}; - - for (var key in src) { - if (!(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 < length; key++) { - if (!equals(o1[key], o2[key])) return false; - } - return true; - } - } else if (isDate(o1)) { - if (!isDate(o2)) return false; - return equals(o1.getTime(), o2.getTime()); - } else if (isRegExp(o1)) { - return isRegExp(o2) ? o1.toString() == o2.toString() : false; - } else { - if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || - isArray(o2) || isDate(o2) || isRegExp(o2)) return false; - keySet = {}; - for (key in o1) { - if (key.charAt(0) === '$' || isFunction(o1[key])) continue; - if (!equals(o1[key], o2[key])) return false; - keySet[key] = true; - } - for (key in o2) { - if (!keySet.hasOwnProperty(key) && - key.charAt(0) !== '$' && - o2[key] !== undefined && - !isFunction(o2[key])) return false; - } - return true; - } - } - } - return false; -} - -var csp = function() { - if (isDefined(csp.isActive_)) return csp.isActive_; - - var active = !!(document.querySelector('[ng-csp]') || - document.querySelector('[data-ng-csp]')); - - if (!active) { - try { - /* jshint -W031, -W054 */ - new Function(''); - /* jshint +W031, +W054 */ - } catch (e) { - active = true; - } - } - - return (csp.isActive_ = active); -}; - - - -function concat(array1, array2, index) { - return array1.concat(slice.call(array2, index)); -} - -function sliceArgs(args, startIndex) { - return slice.call(args, startIndex || 0); -} - - -/* jshint -W101 */ -/** - * @ngdoc function - * @name angular.bind - * @module ng - * @kind function - * - * @description - * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for - * `fn`). You can supply optional `args` that are prebound to the function. This feature is also - * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as - * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application). - * - * @param {Object} self Context which `fn` should be evaluated in. - * @param {function()} fn Function to be bound. - * @param {...*} args Optional arguments to be prebound to the `fn` function call. - * @returns {function()} Function that wraps the `fn` with all the specified bindings. - */ -/* jshint +W101 */ -function bind(self, fn) { - var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : []; - if (isFunction(fn) && !(fn instanceof RegExp)) { - return curryArgs.length - ? function() { - return arguments.length - ? fn.apply(self, concat(curryArgs, 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) === '$' && key.charAt(1) === '$') { - 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|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace. - * If set to an integer, the JSON output will contain that many spaces per indentation. - * @returns {string|undefined} JSON-ified string representing `obj`. - */ -function toJson(obj, pretty) { - if (typeof obj === 'undefined') return undefined; - if (!isNumber(pretty)) { - pretty = pretty ? 2 : null; - } - return JSON.stringify(obj, toJsonReplacer, pretty); -} - - -/** - * @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 JSON string. - */ -function fromJson(json) { - return isString(json) - ? JSON.parse(json) - : json; -} - - -/** - * @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) {} - var elemHtml = jqLite('
      ').append(element).html(); - try { - return element[0].nodeType === NODE_TYPE_TEXT ? 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(/%3B/gi, ';'). - replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); -} - -var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-']; - -function getNgAttribute(element, ngAttr) { - var attr, i, ii = ngAttrPrefixes.length; - element = jqLite(element); - for (i = 0; i < ii; ++i) { - attr = ngAttrPrefixes[i] + ngAttr; - if (isString(attr = element.attr(attr))) { - return attr; - } - } - return null; -} - -/** - * @ngdoc directive - * @name ngApp - * @module ng - * - * @element ANY - * @param {angular.Module} ngApp an optional application - * {@link angular.module module} name to load. - * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be - * created in "strict-di" mode. This means that the application will fail to invoke functions which - * do not use explicit function annotation (and are thus unsuitable for minification), as described - * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in - * tracking down the root of these bugs. - * - * @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. It - * 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; - }); - -
      - * - * Using `ngStrictDi`, you would see something like this: - * - - -
      -
      - I can add: {{a}} + {{b}} = {{ a+b }} - -

      This renders because the controller does not fail to - instantiate, by using explicit annotation style (see - script.js for details) -

      -
      - -
      - Name:
      - Hello, {{name}}! - -

      This renders because the controller does not fail to - instantiate, by using explicit annotation style - (see script.js for details) -

      -
      - -
      - I can add: {{a}} + {{b}} = {{ a+b }} - -

      The controller could not be instantiated, due to relying - on automatic function annotations (which are disabled in - strict mode). As such, the content of this section is not - interpolated, and there should be an error in your web console. -

      -
      -
      -
      - - angular.module('ngAppStrictDemo', []) - // BadController will fail to instantiate, due to relying on automatic function annotation, - // rather than an explicit annotation - .controller('BadController', function($scope) { - $scope.a = 1; - $scope.b = 2; - }) - // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated, - // due to using explicit annotations using the array style and $inject property, respectively. - .controller('GoodController1', ['$scope', function($scope) { - $scope.a = 1; - $scope.b = 2; - }]) - .controller('GoodController2', GoodController2); - function GoodController2($scope) { - $scope.name = "World"; - } - GoodController2.$inject = ['$scope']; - - - div[ng-controller] { - margin-bottom: 1em; - -webkit-border-radius: 4px; - border-radius: 4px; - border: 1px solid; - padding: .5em; - } - div[ng-controller^=Good] { - border-color: #d6e9c6; - background-color: #dff0d8; - color: #3c763d; - } - div[ng-controller^=Bad] { - border-color: #ebccd1; - background-color: #f2dede; - color: #a94442; - margin-bottom: 0; - } - -
      - */ -function angularInit(element, bootstrap) { - var appElement, - module, - config = {}; - - // The element `element` has priority over any other element - forEach(ngAttrPrefixes, function(prefix) { - var name = prefix + 'app'; - - if (!appElement && element.hasAttribute && element.hasAttribute(name)) { - appElement = element; - module = element.getAttribute(name); - } - }); - forEach(ngAttrPrefixes, function(prefix) { - var name = prefix + 'app'; - var candidate; - - if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { - appElement = candidate; - module = candidate.getAttribute(name); - } - }); - if (appElement) { - config.strictDi = getNgAttribute(appElement, "strict-di") !== null; - bootstrap(appElement, module ? [module] : [], config); - } -} - -/** - * @ngdoc function - * @name angular.bootstrap - * @module ng - * @description - * Use this function to manually start up angular application. - * - * See: {@link guide/bootstrap Bootstrap} - * - * Note that Protractor 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. - * - * ```html - * - * - * - *
      - * {{greeting}} - *
      - * - * - * - * - * - * ``` - * - * @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 `config` block. - * See: {@link angular.module modules} - * @param {Object=} config an object for defining configuration options for the application. The - * following keys are supported: - * - * * `strictDi` - disable automatic function annotation for the application. This is meant to - * assist in finding bugs which break minified code. Defaults to `false`. - * - * @returns {auto.$injector} Returns the newly created injector for this app. - */ -function bootstrap(element, modules, config) { - if (!isObject(config)) config = {}; - var defaultConfig = { - strictDi: false - }; - config = extend(defaultConfig, config); - 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); - }]); - - if (config.debugInfoEnabled) { - // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`. - modules.push(['$compileProvider', function($compileProvider) { - $compileProvider.debugInfoEnabled(true); - }]); - } - - modules.unshift('ng'); - var injector = createInjector(modules, config.strictDi); - injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', - function bootstrapApply(scope, element, compile, injector) { - scope.$apply(function() { - element.data('$injector', injector); - compile(element)(scope); - }); - }] - ); - return injector; - }; - - var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/; - var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/; - - if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) { - config.debugInfoEnabled = true; - window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, ''); - } - - 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); - }); - return doBootstrap(); - }; - - if (isFunction(angular.resumeDeferredBootstrap)) { - angular.resumeDeferredBootstrap(); - } -} - -/** - * @ngdoc function - * @name angular.reloadWithDebugInfo - * @module ng - * @description - * Use this function to reload the current application with debug information turned on. - * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`. - * - * See {@link ng.$compileProvider#debugInfoEnabled} for more. - */ -function reloadWithDebugInfo() { - window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name; - window.location.reload(); -} - -/** - * @name angular.getTestability - * @module ng - * @description - * Get the testability service for the instance of Angular on the given - * element. - * @param {DOMElement} element DOM element which is the root of angular application. - */ -function getTestability(rootElement) { - var injector = angular.element(rootElement).injector(); - if (!injector) { - throw ngMinErr('test', - 'no injector found for element argument to getTestability'); - } - return injector.get('$$testability'); -} - -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(); - }); -} - -var bindJQueryFired = false; -var skipDestroyOnNextJQueryCleanData; -function bindJQuery() { - var originalCleanData; - - if (bindJQueryFired) { - return; - } - - // 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+ for on()/off() support. - // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older - // versions. It will not work for sure with jQuery <1.7, though. - 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 - }); - - // All nodes removed from the DOM via various jQuery APIs like .remove() - // are passed through jQuery.cleanData. Monkey-patch this method to fire - // the $destroy event on all removed nodes. - originalCleanData = jQuery.cleanData; - jQuery.cleanData = function(elems) { - var events; - if (!skipDestroyOnNextJQueryCleanData) { - for (var i = 0, elem; (elem = elems[i]) != null; i++) { - events = jQuery._data(elem, "events"); - if (events && events.$destroy) { - jQuery(elem).triggerHandler('$destroy'); - } - } - } else { - skipDestroyOnNextJQueryCleanData = false; - } - originalCleanData(elems); - }; - } else { - jqLite = JQLite; - } - - angular.element = jqLite; - - // Prevent double-proxying. - bindJQueryFired = true; -} - -/** - * 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 {jqLite} jqLite collection containing the nodes - */ -function getBlockNodes(nodes) { - // TODO(perf): just check if all items in `nodes` are siblings and if they are return the original - // collection, otherwise update the original collection. - var node = nodes[0]; - var endNode = nodes[nodes.length - 1]; - var blockNodes = [node]; - - do { - node = node.nextSibling; - if (!node) break; - blockNodes.push(node); - } while (node !== endNode); - - return jqLite(blockNodes); -} - - -/** - * Creates a new object without a prototype. This object is useful for lookup without having to - * guard against prototypically inherited properties via hasOwnProperty. - * - * Related micro-benchmarks: - * - http://jsperf.com/object-create2 - * - http://jsperf.com/proto-map-lookup/2 - * - http://jsperf.com/for-in-vs-object-keys2 - * - * @returns {Object} - */ -function createMap() { - return Object.create(null); -} - -var NODE_TYPE_ELEMENT = 1; -var NODE_TYPE_ATTRIBUTE = 2; -var NODE_TYPE_TEXT = 3; -var NODE_TYPE_COMMENT = 8; -var NODE_TYPE_DOCUMENT = 9; -var NODE_TYPE_DOCUMENT_FRAGMENT = 11; - -/** - * @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 configBlocks = []; - - /** @type {!Array.} */ - var runBlocks = []; - - var config = invokeLater('$injector', 'invoke', 'push', configBlocks); - - /** @type {angular.Module} */ - var moduleInstance = { - // Private state - _invokeQueue: invokeQueue, - _configBlocks: configBlocks, - _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 ng.$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 - this must be a valid angular expression identifier - * @param {Function} filterFactory Factory function for creating new instance of filter. - * @description - * See {@link ng.$filterProvider#register $filterProvider.register()}. - * - *
      - * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`. - * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace - * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores - * (`myapp_subsection_filterx`). - *
      - */ - 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#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, queue) { - if (!queue) queue = invokeQueue; - return function() { - queue[insertMethod || 'push']([provider, method, arguments]); - return moduleInstance; - }; - } - }); - }; - }); - -} - -/* global: toDebugString: true */ - -function serializeObject(obj) { - var seen = []; - - return JSON.stringify(obj, function(key, val) { - val = toJsonReplacer(key, val); - if (isObject(val)) { - - if (seen.indexOf(val) >= 0) return '<>'; - - seen.push(val); - } - return val; - }); -} - -function toDebugString(obj) { - if (typeof obj === 'function') { - return obj.toString().replace(/ \{[\s\S]*$/, ''); - } else if (typeof obj === 'undefined') { - return 'undefined'; - } else if (typeof obj !== 'string') { - return serializeObject(obj); - } - return obj; -} - -/* 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, - patternDirective, - patternDirective, - requiredDirective, - requiredDirective, - minlengthDirective, - minlengthDirective, - maxlengthDirective, - maxlengthDirective, - ngValueDirective, - ngModelOptionsDirective, - ngAttributeAliasDirectives, - ngEventDirectives, - - $AnchorScrollProvider, - $AnimateProvider, - $BrowserProvider, - $CacheFactoryProvider, - $ControllerProvider, - $DocumentProvider, - $ExceptionHandlerProvider, - $FilterProvider, - $InterpolateProvider, - $IntervalProvider, - $HttpProvider, - $HttpBackendProvider, - $LocationProvider, - $LogProvider, - $ParseProvider, - $RootScopeProvider, - $QProvider, - $$QProvider, - $$SanitizeUriProvider, - $SceProvider, - $SceDelegateProvider, - $SnifferProvider, - $TemplateCacheProvider, - $TemplateRequestProvider, - $$TestabilityProvider, - $TimeoutProvider, - $$RAFProvider, - $$AsyncCallbackProvider, - $WindowProvider, - $$jqLiteProvider -*/ - - -/** - * @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.3.20', // all of these placeholder strings will be replaced by grunt's - major: 1, // package task - minor: 3, - dot: 20, - codeName: 'shallow-translucence' -}; - - -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}, - 'getTestability': getTestability, - '$$minErr': minErr, - '$$csp': csp, - 'reloadWithDebugInfo': reloadWithDebugInfo - }); - - 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, - pattern: patternDirective, - ngPattern: patternDirective, - required: requiredDirective, - ngRequired: requiredDirective, - minlength: minlengthDirective, - ngMinlength: minlengthDirective, - maxlength: maxlengthDirective, - ngMaxlength: maxlengthDirective, - ngValue: ngValueDirective, - ngModelOptions: ngModelOptionsDirective - }). - 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, - $$q: $$QProvider, - $sce: $SceProvider, - $sceDelegate: $SceDelegateProvider, - $sniffer: $SnifferProvider, - $templateCache: $TemplateCacheProvider, - $templateRequest: $TemplateRequestProvider, - $$testability: $$TestabilityProvider, - $timeout: $TimeoutProvider, - $window: $WindowProvider, - $$rAF: $$RAFProvider, - $$asyncCallback: $$AsyncCallbackProvider, - $$jqLite: $$jqLiteProvider - }); - } - ]); -} - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* global JQLitePrototype: true, - addEventListenerFn: true, - removeEventListenerFn: true, - BOOLEAN_ATTR: true, - ALIASED_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 ensure it is loaded before the `angular.js` file. - * - *
      **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/) - Does not support functions as parameters - * - [`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/) - Only retrieves inline-styles, does not call `getComputedStyle()`. As a setter, does not convert numbers to strings or append 'px'. - * - [`data()`](http://api.jquery.com/data/) - * - [`detach()`](http://api.jquery.com/detach/) - * - [`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. Requires {@link guide/production#disabling-debug-data Debug Data} to - * be enabled. - * - `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. - * Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled. - * - `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 = function(element, type, fn) { - element.addEventListener(type, fn, false); - }, - removeEventListenerFn = function(element, type, fn) { - element.removeEventListener(type, fn, false); - }; - -/* - * !!! This is an undocumented "private" function !!! - */ -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 MOUSE_EVENT_MAP= { mouseleave: "mouseout", mouseenter: "mouseover"}; -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'); -} - -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 jqLiteAcceptsData(node) { - // The window object can accept data but has no nodeType - // Otherwise we are only interested in elements (1) and documents (9) - var nodeType = node.nodeType; - return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT; -} - -function jqLiteBuildFragment(html, context) { - var tmp, tag, wrap, - fragment = context.createDocumentFragment(), - nodes = [], i; - - if (jqLiteIsTextNode(html)) { - // Convert non-html into a text node - nodes.push(context.createTextNode(html)); - } else { - // Convert html into DOM nodes - tmp = tmp || fragment.appendChild(context.createElement("div")); - 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]; - - // Descend through wrappers to the right content - i = wrap[0]; - while (i--) { - tmp = tmp.lastChild; - } - - nodes = concat(nodes, tmp.childNodes); - - tmp = fragment.firstChild; - tmp.textContent = ""; - } - - // Remove wrapper from fragment - fragment.textContent = ""; - fragment.innerHTML = ""; // Clear inner HTML - forEach(nodes, function(node) { - fragment.appendChild(node); - }); - - return fragment; -} - -function jqLiteParseHTML(html, context) { - context = context || document; - var parsed; - - if ((parsed = SINGLE_TAG_REGEXP.exec(html))) { - return [context.createElement(parsed[1])]; - } - - if ((parsed = jqLiteBuildFragment(html, context))) { - return parsed.childNodes; - } - - return []; -} - -///////////////////////////////////////////// -function JQLite(element) { - if (element instanceof JQLite) { - return element; - } - - var argIsString; - - if (isString(element)) { - element = trim(element); - argIsString = true; - } - if (!(this instanceof JQLite)) { - if (argIsString && element.charAt(0) != '<') { - throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element'); - } - return new JQLite(element); - } - - if (argIsString) { - jqLiteAddNodes(this, jqLiteParseHTML(element)); - } else { - jqLiteAddNodes(this, element); - } -} - -function jqLiteClone(element) { - return element.cloneNode(true); -} - -function jqLiteDealoc(element, onlyDescendants) { - if (!onlyDescendants) jqLiteRemoveData(element); - - if (element.querySelectorAll) { - var descendants = element.querySelectorAll('*'); - for (var i = 0, l = descendants.length; i < l; i++) { - jqLiteRemoveData(descendants[i]); - } - } -} - -function jqLiteOff(element, type, fn, unsupported) { - if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument'); - - var expandoStore = jqLiteExpandoStore(element); - var events = expandoStore && expandoStore.events; - var handle = expandoStore && expandoStore.handle; - - if (!handle) return; //no listeners registered - - if (!type) { - for (type in events) { - if (type !== '$destroy') { - removeEventListenerFn(element, type, handle); - } - delete events[type]; - } - } else { - forEach(type.split(' '), function(type) { - if (isDefined(fn)) { - var listenerFns = events[type]; - arrayRemove(listenerFns || [], fn); - if (listenerFns && listenerFns.length > 0) { - return; - } - } - - removeEventListenerFn(element, type, handle); - delete events[type]; - }); - } -} - -function jqLiteRemoveData(element, name) { - var expandoId = element.ng339; - var expandoStore = expandoId && jqCache[expandoId]; - - if (expandoStore) { - if (name) { - delete expandoStore.data[name]; - return; - } - - if (expandoStore.handle) { - if (expandoStore.events.$destroy) { - expandoStore.handle({}, '$destroy'); - } - jqLiteOff(element); - } - delete jqCache[expandoId]; - element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it - } -} - - -function jqLiteExpandoStore(element, createIfNecessary) { - var expandoId = element.ng339, - expandoStore = expandoId && jqCache[expandoId]; - - if (createIfNecessary && !expandoStore) { - element.ng339 = expandoId = jqNextId(); - expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined}; - } - - return expandoStore; -} - - -function jqLiteData(element, key, value) { - if (jqLiteAcceptsData(element)) { - - var isSimpleSetter = isDefined(value); - var isSimpleGetter = !isSimpleSetter && key && !isObject(key); - var massGetter = !key; - var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter); - var data = expandoStore && expandoStore.data; - - if (isSimpleSetter) { // data('key', value) - data[key] = value; - } else { - if (massGetter) { // data() - return data; - } else { - if (isSimpleGetter) { // data('key') - // don't force creation of expandoStore if it doesn't exist yet - return data && data[key]; - } else { // mass-setter: data({key1: val1, key2: val2}) - extend(data, key); - } - } - } - } -} - -function jqLiteHasClass(element, selector) { - if (!element.getAttribute) return false; - return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " "). - indexOf(" " + selector + " ") > -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) { - // THIS CODE IS VERY HOT. Don't make changes without benchmarking. - - if (elements) { - - // if a Node (the most common case) - if (elements.nodeType) { - root[root.length++] = elements; - } else { - var length = elements.length; - - // if an Array or NodeList and not a Window - if (typeof length === 'number' && elements.window !== elements) { - if (length) { - for (var i = 0; i < length; i++) { - root[root.length++] = elements[i]; - } - } - } else { - root[root.length++] = elements; - } - } - } -} - - -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 == NODE_TYPE_DOCUMENT) { - 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 === NODE_TYPE_DOCUMENT_FRAGMENT && element.host); - } -} - -function jqLiteEmpty(element) { - jqLiteDealoc(element, true); - while (element.firstChild) { - element.removeChild(element.firstChild); - } -} - -function jqLiteRemove(element, keepData) { - if (!keepData) jqLiteDealoc(element); - var parent = element.parentNode; - if (parent) parent.removeChild(element); -} - - -function jqLiteDocumentLoaded(action, win) { - win = win || window; - if (win.document.readyState === 'complete') { - // Force the action to be run async for consistent behaviour - // from the action's point of view - // i.e. it will definitely not be in a $apply - win.setTimeout(action); - } else { - // No need to unbind this handler as load is only ever called once - jqLite(win).on('load', action); - } -} - -////////////////////////////////////////// -// 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 is already 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[value] = true; -}); -var ALIASED_ATTR = { - 'ngMinlength': 'minlength', - 'ngMaxlength': 'maxlength', - 'ngMin': 'min', - 'ngMax': 'max', - 'ngPattern': 'pattern' -}; - -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[nodeName_(element)] && booleanAttr; -} - -function getAliasedAttrName(element, name) { - var nodeName = element.nodeName; - return (nodeName === 'INPUT' || nodeName === 'TEXTAREA') && ALIASED_ATTR[name]; -} - -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 { - return element.style[name]; - } - }, - - attr: function(element, name, value) { - var nodeType = element.nodeType; - if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT) { - return; - } - 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() { - getText.$dv = ''; - return getText; - - function getText(element, value) { - if (isUndefined(value)) { - var nodeType = element.nodeType; - return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : ''; - } - element.textContent = value; - } - })(), - - val: function(element, value) { - if (isUndefined(value)) { - if (element.multiple && nodeName_(element) === 'select') { - 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; - } - jqLiteDealoc(element, true); - 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) { - // jQuery specific api - event.isDefaultPrevented = function() { - return event.defaultPrevented; - }; - - var eventFns = events[type || event.type]; - var eventFnsLength = eventFns ? eventFns.length : 0; - - if (!eventFnsLength) return; - - if (isUndefined(event.immediatePropagationStopped)) { - var originalStopImmediatePropagation = event.stopImmediatePropagation; - event.stopImmediatePropagation = function() { - event.immediatePropagationStopped = true; - - if (event.stopPropagation) { - event.stopPropagation(); - } - - if (originalStopImmediatePropagation) { - originalStopImmediatePropagation.call(event); - } - }; - } - - event.isImmediatePropagationStopped = function() { - return event.immediatePropagationStopped === true; - }; - - // Copy event handlers in case event handlers array is modified during execution. - if ((eventFnsLength > 1)) { - eventFns = shallowCopy(eventFns); - } - - for (var i = 0; i < eventFnsLength; i++) { - if (!event.isImmediatePropagationStopped()) { - eventFns[i].call(element, event); - } - } - }; - - // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all - // events on `element` - eventHandler.elem = element; - return eventHandler; -} - -////////////////////////////////////////// -// Functions iterating traversal. -// These functions chain results into a single -// selector. -////////////////////////////////////////// -forEach({ - removeData: jqLiteRemoveData, - - on: function jqLiteOn(element, type, fn, unsupported) { - if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters'); - - // Do not add event handlers to non-elements because they will not be cleaned up. - if (!jqLiteAcceptsData(element)) { - return; - } - - var expandoStore = jqLiteExpandoStore(element, true); - var events = expandoStore.events; - var handle = expandoStore.handle; - - if (!handle) { - handle = expandoStore.handle = createEventHandler(element, events); - } - - // http://jsperf.com/string-indexof-vs-split - var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type]; - var i = types.length; - - while (i--) { - type = types[i]; - var eventFns = events[type]; - - if (!eventFns) { - events[type] = []; - - if (type === 'mouseenter' || type === 'mouseleave') { - // Refer to jQuery's implementation of mouseenter & mouseleave - // Read about mouseenter and mouseleave: - // http://www.quirksmode.org/js/events_mouse.html#link8 - - jqLiteOn(element, MOUSE_EVENT_MAP[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 && !target.contains(related))) { - handle(event, type); - } - }); - - } else { - if (type !== '$destroy') { - addEventListenerFn(element, type, handle); - } - } - 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 === NODE_TYPE_ELEMENT) - children.push(element); - }); - return children; - }, - - contents: function(element) { - return element.contentDocument || element.childNodes || []; - }, - - append: function(element, node) { - var nodeType = element.nodeType; - if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return; - - node = new JQLite(node); - - for (var i = 0, ii = node.length; i < ii; i++) { - var child = node[i]; - element.appendChild(child); - } - }, - - prepend: function(element, node) { - if (element.nodeType === NODE_TYPE_ELEMENT) { - var index = element.firstChild; - forEach(new JQLite(node), function(child) { - element.insertBefore(child, index); - }); - } - }, - - wrap: function(element, wrapNode) { - wrapNode = jqLite(wrapNode).eq(0).clone()[0]; - var parent = element.parentNode; - if (parent) { - parent.replaceChild(wrapNode, element); - } - wrapNode.appendChild(element); - }, - - remove: jqLiteRemove, - - detach: function(element) { - jqLiteRemove(element, true); - }, - - after: function(element, newElement) { - var index = element, parent = element.parentNode; - newElement = new JQLite(newElement); - - for (var i = 0, ii = newElement.length; i < ii; i++) { - var node = newElement[i]; - 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 !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null; - }, - - next: function(element) { - return element.nextElementSibling; - }, - - 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 expandoStore = jqLiteExpandoStore(element); - var events = expandoStore && expandoStore.events; - var eventFns = events && 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; }, - stopImmediatePropagation: function() { this.immediatePropagationStopped = true; }, - isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === 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) { - if (!dummyEvent.isImmediatePropagationStopped()) { - fn.apply(element, handlerArgs); - } - }); - } - } -}, function(fn, name) { - /** - * chaining functions - */ - JQLite.prototype[name] = function(arg1, arg2, arg3) { - var value; - - for (var i = 0, ii = this.length; i < ii; 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; -}); - - -// Provider for private $$jqLite service -function $$jqLiteProvider() { - this.$get = function $$jqLite() { - return extend(JQLite, { - hasClass: function(node, classes) { - if (node.attr) node = node[0]; - return jqLiteHasClass(node, classes); - }, - addClass: function(node, classes) { - if (node.attr) node = node[0]; - return jqLiteAddClass(node, classes); - }, - removeClass: function(node, classes) { - if (node.attr) node = node[0]; - return jqLiteRemoveClass(node, classes); - } - }); - }; -} - -/** - * 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 key = obj && obj.$$hashKey; - - if (key) { - if (typeof key === 'function') { - key = obj.$$hashKey(); - } - return key; - } - - var objType = typeof obj; - if (objType == 'function' || (objType == 'object' && obj !== null)) { - key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)(); - } else { - key = objType + ':' + obj; - } - - return 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 object 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. - * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which - * disallows argument name annotation inference. - * @returns {injector} Injector object. 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 anonFn(fn) { - // For anonymous functions, showing at the very least the function signature can help in - // debugging. - var fnText = fn.toString().replace(STRIP_COMMENTS, ''), - args = fnText.match(FN_ARGS); - if (args) { - return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')'; - } - return 'fn'; -} - -function annotate(fn, strictDi, name) { - var $inject, - fnText, - argDecl, - last; - - if (typeof fn === 'function') { - if (!($inject = fn.$inject)) { - $inject = []; - if (fn.length) { - if (strictDi) { - if (!isString(name) || !name) { - name = fn.name || anonFn(fn); - } - throw $injectorMinErr('strictdi', - '{0} is not using explicit annotation and cannot be invoked in strict mode', name); - } - 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 - * - * @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. This method of discovering - * annotations is disallowed when the injector is in strict mode. - * *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. - * @param {string=} caller An optional string to provide the origin of the function call for error messages. - * @return {*} The instance. - */ - -/** - * @ngdoc method - * @name $injector#invoke - * - * @description - * Invoke the method and supply the method arguments from the `$injector`. - * - * @param {Function|Array.} fn The injectable 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 Name of the service to query. - * @returns {boolean} `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']); - * ``` - * - * You can disallow this method by using strict injection mode. - * - * 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. - * - * @param {boolean=} [strictDi=false] Disallow argument name annotation inference. - * - * @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|Array.} $getFn The injectable $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|Array.} constructor An injectable 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|Array.} 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, strictDi) { - strictDi = (strictDi === true); - 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(serviceName, caller) { - if (angular.isString(caller)) { - path.push(caller); - } - throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- ')); - })), - instanceCache = {}, - instanceInjector = (instanceCache.$injector = - createInternalInjector(instanceCache, function(serviceName, caller) { - var provider = providerInjector.get(serviceName + providerSuffix, caller); - return instanceInjector.invoke(provider.$get, provider, undefined, serviceName); - })); - - - 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 enforceReturnValue(name, factory) { - return function enforcedReturnValue() { - var result = instanceInjector.invoke(factory, this); - if (isUndefined(result)) { - throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name); - } - return result; - }; - } - - function factory(name, factoryFn, enforce) { - return provider(name, { - $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn - }); - } - - function service(name, constructor) { - return factory(name, ['$injector', function($injector) { - return $injector.instantiate(constructor); - }]); - } - - function value(name, val) { return factory(name, valueFn(val), false); } - - 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; - forEach(modulesToLoad, function(module) { - if (loadedModules.get(module)) return; - loadedModules.put(module, true); - - function runInvokeQueue(queue) { - var i, ii; - for (i = 0, ii = queue.length; i < ii; i++) { - var invokeArgs = queue[i], - provider = providerInjector.get(invokeArgs[0]); - - provider[invokeArgs[1]].apply(provider, invokeArgs[2]); - } - } - - try { - if (isString(module)) { - moduleFn = angularModule(module); - runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); - runInvokeQueue(moduleFn._invokeQueue); - runInvokeQueue(moduleFn._configBlocks); - } 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, caller) { - 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, caller); - } catch (err) { - if (cache[serviceName] === INSTANTIATING) { - delete cache[serviceName]; - } - throw err; - } finally { - path.shift(); - } - } - } - - function invoke(fn, self, locals, serviceName) { - if (typeof locals === 'string') { - serviceName = locals; - locals = null; - } - - var args = [], - $inject = createInjector.$$annotate(fn, strictDi, serviceName), - 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, serviceName) - ); - } - if (isArray(fn)) { - fn = fn[length]; - } - - // http://jsperf.com/angularjs-invoke-apply-vs-switch - // #5388 - return fn.apply(self, args); - } - - function instantiate(Type, locals, serviceName) { - // 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) {}]); - // Object creation: http://jsperf.com/create-constructor/2 - var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype || null); - var returnedValue = invoke(Type, instance, locals, serviceName); - - return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance; - } - - return { - invoke: invoke, - instantiate: instantiate, - get: getService, - annotate: createInjector.$$annotate, - has: function(name) { - return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name); - } - }; - } -} - -createInjector.$$annotate = annotate; - -/** - * @ngdoc provider - * @name $anchorScrollProvider - * - * @description - * Use `$anchorScrollProvider` to disable automatic scrolling whenever - * {@link ng.$location#hash $location.hash()} changes. - */ -function $AnchorScrollProvider() { - - var autoScrollingEnabled = true; - - /** - * @ngdoc method - * @name $anchorScrollProvider#disableAutoScrolling - * - * @description - * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to - * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.
      - * Use this method to disable automatic scrolling. - * - * If automatic scrolling is disabled, one must explicitly call - * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the - * current hash. - */ - this.disableAutoScrolling = function() { - autoScrollingEnabled = false; - }; - - /** - * @ngdoc service - * @name $anchorScroll - * @kind function - * @requires $window - * @requires $location - * @requires $rootScope - * - * @description - * When called, it checks the current value of {@link ng.$location#hash $location.hash()} and - * scrolls to the related element, according to the rules specified in the - * [Html5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document). - * - * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to - * match any anchor whenever it changes. This can be disabled by calling - * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}. - * - * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a - * vertical scroll-offset (either fixed or dynamic). - * - * @property {(number|function|jqLite)} yOffset - * If set, specifies a vertical scroll-offset. This is often useful when there are fixed - * positioned elements at the top of the page, such as navbars, headers etc. - * - * `yOffset` can be specified in various ways: - * - **number**: A fixed number of pixels to be used as offset.

      - * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return - * a number representing the offset (in pixels).

      - * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from - * the top of the page to the element's bottom will be used as offset.
      - * **Note**: The element will be taken into account only as long as its `position` is set to - * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust - * their height and/or positioning according to the viewport's size. - * - *
      - *
      - * In order for `yOffset` to work properly, scrolling should take place on the document's root and - * not some child element. - *
      - * - * @example - - -
      - Go to bottom - You're at the bottom! -
      -
      - - angular.module('anchorScrollExample', []) - .controller('ScrollController', ['$scope', '$location', '$anchorScroll', - function ($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: 280px; - overflow: auto; - } - - #bottom { - display: block; - margin-top: 2000px; - } - -
      - * - *
      - * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value). - * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details. - * - * @example - - - -
      - Anchor {{x}} of 5 -
      -
      - - angular.module('anchorScrollOffsetExample', []) - .run(['$anchorScroll', function($anchorScroll) { - $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels - }]) - .controller('headerCtrl', ['$anchorScroll', '$location', '$scope', - function ($anchorScroll, $location, $scope) { - $scope.gotoAnchor = function(x) { - var newHash = 'anchor' + x; - if ($location.hash() !== newHash) { - // set the $location.hash to `newHash` and - // $anchorScroll will automatically scroll to it - $location.hash('anchor' + x); - } else { - // call $anchorScroll() explicitly, - // since $location.hash hasn't changed - $anchorScroll(); - } - }; - } - ]); - - - body { - padding-top: 50px; - } - - .anchor { - border: 2px dashed DarkOrchid; - padding: 10px 10px 200px 10px; - } - - .fixed-header { - background-color: rgba(0, 0, 0, 0.2); - height: 50px; - position: fixed; - top: 0; left: 0; right: 0; - } - - .fixed-header > a { - display: inline-block; - margin: 5px 15px; - } - -
      - */ - this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) { - var document = $window.document; - - // Helper function to get first anchor from a NodeList - // (using `Array#some()` instead of `angular#forEach()` since it's more performant - // and working in all supported browsers.) - function getFirstAnchor(list) { - var result = null; - Array.prototype.some.call(list, function(element) { - if (nodeName_(element) === 'a') { - result = element; - return true; - } - }); - return result; - } - - function getYOffset() { - - var offset = scroll.yOffset; - - if (isFunction(offset)) { - offset = offset(); - } else if (isElement(offset)) { - var elem = offset[0]; - var style = $window.getComputedStyle(elem); - if (style.position !== 'fixed') { - offset = 0; - } else { - offset = elem.getBoundingClientRect().bottom; - } - } else if (!isNumber(offset)) { - offset = 0; - } - - return offset; - } - - function scrollTo(elem) { - if (elem) { - elem.scrollIntoView(); - - var offset = getYOffset(); - - if (offset) { - // `offset` is the number of pixels we should scroll UP in order to align `elem` properly. - // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the - // top of the viewport. - // - // IF the number of pixels from the top of `elem` to the end of the page's content is less - // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some - // way down the page. - // - // This is often the case for elements near the bottom of the page. - // - // In such cases we do not need to scroll the whole `offset` up, just the difference between - // the top of the element and the offset, which is enough to align the top of `elem` at the - // desired position. - var elemTop = elem.getBoundingClientRect().top; - $window.scrollBy(0, elemTop - offset); - } - } else { - $window.scrollTo(0, 0); - } - } - - function scroll() { - var hash = $location.hash(), elm; - - // empty hash, scroll to the top of the page - if (!hash) scrollTo(null); - - // element with given id - else if ((elm = document.getElementById(hash))) scrollTo(elm); - - // first anchor with given name :-D - else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm); - - // no element and hash == 'top', scroll to the top of the page - else if (hash === 'top') scrollTo(null); - } - - // 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(newVal, oldVal) { - // skip the initial scroll if $location.hash is empty - if (newVal === oldVal && newVal === '') return; - - jqLiteDocumentLoaded(function() { - $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 = ['$$q', '$$asyncCallback', '$rootScope', function($$q, $$asyncCallback, $rootScope) { - - var currentDefer; - - function runAnimationPostDigest(fn) { - var cancelFn, defer = $$q.defer(); - defer.promise.$$cancelFn = function ngAnimateMaybeCancel() { - cancelFn && cancelFn(); - }; - - $rootScope.$$postDigest(function ngAnimatePostDigest() { - cancelFn = fn(function ngAnimateNotifyComplete() { - defer.resolve(); - }); - }); - - return defer.promise; - } - - function resolveElementClasses(element, classes) { - var toAdd = [], toRemove = []; - - var hasClasses = createMap(); - forEach((element.attr('class') || '').split(/\s+/), function(className) { - hasClasses[className] = true; - }); - - forEach(classes, function(status, className) { - var hasClass = hasClasses[className]; - - // If the most recent class manipulation (via $animate) was to remove the class, and the - // element currently has the class, the class is scheduled for removal. Otherwise, if - // the most recent class manipulation (via $animate) was to add the class, and the - // element does not currently have the class, the class is scheduled to be added. - if (status === false && hasClass) { - toRemove.push(className); - } else if (status === true && !hasClass) { - toAdd.push(className); - } - }); - - return (toAdd.length + toRemove.length) > 0 && - [toAdd.length ? toAdd : null, toRemove.length ? toRemove : null]; - } - - function cachedClassManipulation(cache, classes, op) { - for (var i=0, ii = classes.length; i < ii; ++i) { - var className = classes[i]; - cache[className] = op; - } - } - - function asyncPromise() { - // only serve one instance of a promise in order to save CPU cycles - if (!currentDefer) { - currentDefer = $$q.defer(); - $$asyncCallback(function() { - currentDefer.resolve(); - currentDefer = null; - }); - } - return currentDefer.promise; - } - - function applyStyles(element, options) { - if (angular.isObject(options)) { - var styles = extend(options.from || {}, options.to || {}); - element.css(styles); - } - } - - /** - * - * @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 { - animate: function(element, from, to) { - applyStyles(element, { from: from, to: to }); - return asyncPromise(); - }, - - /** - * - * @ngdoc method - * @name $animate#enter - * @kind function - * @description Inserts the element into the DOM either after the `after` element or - * as the first child within the `parent` element. When the function is called a promise - * is returned that will be resolved at a later time. - * @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 {object=} options an optional collection of styles that will be applied to the element. - * @return {Promise} the animation callback promise - */ - enter: function(element, parent, after, options) { - applyStyles(element, options); - after ? after.after(element) - : parent.prepend(element); - return asyncPromise(); - }, - - /** - * - * @ngdoc method - * @name $animate#leave - * @kind function - * @description Removes the element from the DOM. When the function is called a promise - * is returned that will be resolved at a later time. - * @param {DOMElement} element the element which will be removed from the DOM - * @param {object=} options an optional collection of options that will be applied to the element. - * @return {Promise} the animation callback promise - */ - leave: function(element, options) { - applyStyles(element, options); - element.remove(); - return asyncPromise(); - }, - - /** - * - * @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. When the function - * is called a promise is returned that will be resolved at a later time. - * - * @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 {object=} options an optional collection of options that will be applied to the element. - * @return {Promise} the animation callback promise - */ - move: function(element, parent, after, options) { - // Do not remove element before insert. Removing will cause data associated with the - // element to be dropped. Insert will implicitly do the remove. - return this.enter(element, parent, after, options); - }, - - /** - * - * @ngdoc method - * @name $animate#addClass - * @kind function - * @description Adds the provided className CSS class value to the provided element. - * When the function is called a promise is returned that will be resolved at a later time. - * @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 {object=} options an optional collection of options that will be applied to the element. - * @return {Promise} the animation callback promise - */ - addClass: function(element, className, options) { - return this.setClass(element, className, [], options); - }, - - $$addClassImmediately: function(element, className, options) { - element = jqLite(element); - className = !isString(className) - ? (isArray(className) ? className.join(' ') : '') - : className; - forEach(element, function(element) { - jqLiteAddClass(element, className); - }); - applyStyles(element, options); - return asyncPromise(); - }, - - /** - * - * @ngdoc method - * @name $animate#removeClass - * @kind function - * @description Removes the provided className CSS class value from the provided element. - * When the function is called a promise is returned that will be resolved at a later time. - * @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 {object=} options an optional collection of options that will be applied to the element. - * @return {Promise} the animation callback promise - */ - removeClass: function(element, className, options) { - return this.setClass(element, [], className, options); - }, - - $$removeClassImmediately: function(element, className, options) { - element = jqLite(element); - className = !isString(className) - ? (isArray(className) ? className.join(' ') : '') - : className; - forEach(element, function(element) { - jqLiteRemoveClass(element, className); - }); - applyStyles(element, options); - return asyncPromise(); - }, - - /** - * - * @ngdoc method - * @name $animate#setClass - * @kind function - * @description Adds and/or removes the given CSS classes to and from the element. - * When the function is called a promise is returned that will be resolved at a later time. - * @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 {object=} options an optional collection of options that will be applied to the element. - * @return {Promise} the animation callback promise - */ - setClass: function(element, add, remove, options) { - var self = this; - var STORAGE_KEY = '$$animateClasses'; - var createdCache = false; - element = jqLite(element); - - var cache = element.data(STORAGE_KEY); - if (!cache) { - cache = { - classes: {}, - options: options - }; - createdCache = true; - } else if (options && cache.options) { - cache.options = angular.extend(cache.options || {}, options); - } - - var classes = cache.classes; - - add = isArray(add) ? add : add.split(' '); - remove = isArray(remove) ? remove : remove.split(' '); - cachedClassManipulation(classes, add, true); - cachedClassManipulation(classes, remove, false); - - if (createdCache) { - cache.promise = runAnimationPostDigest(function(done) { - var cache = element.data(STORAGE_KEY); - element.removeData(STORAGE_KEY); - - // in the event that the element is removed before postDigest - // is run then the cache will be undefined and there will be - // no need anymore to add or remove and of the element classes - if (cache) { - var classes = resolveElementClasses(element, cache.classes); - if (classes) { - self.$$setClassImmediately(element, classes[0], classes[1], cache.options); - } - } - - done(); - }); - element.data(STORAGE_KEY, cache); - } - - return cache.promise; - }, - - $$setClassImmediately: function(element, add, remove, options) { - add && this.$$addClassImmediately(element, add); - remove && this.$$removeClassImmediately(element, remove); - applyStyles(element, options); - return asyncPromise(); - }, - - enabled: noop, - cancel: 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); - }; - }]; -} - -/* global stripHash: true */ - -/** - * ! 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 {object} $log window.console 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); - } - } - } - } - } - - function getHash(url) { - var index = url.indexOf('#'); - return index === -1 ? '' : url.substr(index); - } - - /** - * @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 cachedState, lastHistoryState, - lastBrowserUrl = location.href, - baseElement = document.find('base'), - reloadLocation = null; - - cacheState(); - lastHistoryState = cachedState; - - /** - * @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? - * @param {object=} state object to use with pushState/replaceState - */ - self.url = function(url, replace, state) { - // In modern browsers `history.state` is `null` by default; treating it separately - // from `undefined` would cause `$browser.url('/foo')` to change `history.state` - // to undefined via `pushState`. Instead, let's change `undefined` to `null` here. - if (isUndefined(state)) { - state = null; - } - - // 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) { - var sameState = lastHistoryState === state; - - // Don't change anything if previous and current URLs and states match. This also prevents - // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode. - // See https://github.com/angular/angular.js/commit/ffb2701 - if (lastBrowserUrl === url && (!$sniffer.history || sameState)) { - return self; - } - var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url); - lastBrowserUrl = url; - lastHistoryState = state; - // Don't use history API if only the hash changed - // due to a bug in IE10/IE11 which leads - // to not firing a `hashchange` nor `popstate` event - // in some cases (see #9143). - if ($sniffer.history && (!sameBase || !sameState)) { - history[replace ? 'replaceState' : 'pushState'](state, '', url); - cacheState(); - // Do the assignment again so that those two variables are referentially identical. - lastHistoryState = cachedState; - } else { - if (!sameBase || reloadLocation) { - reloadLocation = url; - } - if (replace) { - location.replace(url); - } else if (!sameBase) { - location.href = url; - } else { - location.hash = getHash(url); - } - } - return self; - // getter - } else { - // - reloadLocation is needed as browsers don't allow to read out - // the new location.href if a reload happened. - // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172 - return reloadLocation || location.href.replace(/%27/g,"'"); - } - }; - - /** - * @name $browser#state - * - * @description - * This method is a getter. - * - * Return history.state or null if history.state is undefined. - * - * @returns {object} state - */ - self.state = function() { - return cachedState; - }; - - var urlChangeListeners = [], - urlChangeInit = false; - - function cacheStateAndFireUrlChange() { - cacheState(); - fireUrlChange(); - } - - function getCurrentState() { - try { - return history.state; - } catch (e) { - // MSIE can reportedly throw when there is no state (UNCONFIRMED). - } - } - - // This variable should be used *only* inside the cacheState function. - var lastCachedState = null; - function cacheState() { - // This should be the only place in $browser where `history.state` is read. - cachedState = getCurrentState(); - cachedState = isUndefined(cachedState) ? null : cachedState; - - // Prevent callbacks fo fire twice if both hashchange & popstate were fired. - if (equals(cachedState, lastCachedState)) { - cachedState = lastCachedState; - } - lastCachedState = cachedState; - } - - function fireUrlChange() { - if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) { - return; - } - - lastBrowserUrl = self.url(); - lastHistoryState = cachedState; - forEach(urlChangeListeners, function(listener) { - listener(self.url(), cachedState); - }); - } - - /** - * @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', cacheStateAndFireUrlChange); - // hashchange event - jqLite(window).on('hashchange', cacheStateAndFireUrlChange); - - 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(); - - function safeDecodeURIComponent(str) { - try { - return decodeURIComponent(str); - } catch (e) { - return str; - } - } - - /** - * @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) { - var cookieLength, cookieArray, cookie, i, index; - - if (name) { - if (value === undefined) { - rawDocument.cookie = encodeURIComponent(name) + "=;path=" + cookiePath + - ";expires=Thu, 01 Jan 1970 00:00:00 GMT"; - } else { - if (isString(value)) { - cookieLength = (rawDocument.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(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 = safeDecodeURIComponent(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] = safeDecodeURIComponent(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 a descendent of the {@link ng.$rootElement $rootElement} (IE, - * element with ng-app attribute), otherwise the template will be ignored. - * - * 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'); - }]; -} - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* ! 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', - * templateNamespace: 'html', - * scope: false, - * controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... }, - * controllerAs: 'stringIdentifier', - * bindToController: false, - * 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: - * - * #### `multiElement` - * When this property is set to true, the HTML compiler will collect DOM nodes between - * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them - * together as the directive elements. It is recommended that this feature be used on directives - * which are not strictly behavioural (such as {@link ngClick}), and which - * do not manipulate or replace child nodes (such as {@link ngInclude}). - * - * #### `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). Note that expressions - * and other directives used in the directive's template will also be excluded from execution. - * - * #### `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. If - * you want to shallow watch for changes (i.e. $watchCollection instead of $watch) you can use - * `=*` or `=*attr` (`=*?` or `=*?attr` if the property is 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})`. - * - * - * #### `bindToController` - * When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will - * allow a component to have its properties bound to the controller, rather than to scope. When the controller - * is instantiated, the initial values of the isolate scope bindings are already available. - * - * #### `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: - * `function([scope], cloneLinkingFn, futureParentElement)`. - * * `scope`: optional argument to override the scope. - * * `cloneLinkingFn`: optional argument to create clones of the original transcluded content. - * * `futureParentElement`: - * * defines the parent to which the `cloneLinkingFn` will add the cloned elements. - * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`. - * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements) - * and when the `cloneLinkinFn` is passed, - * as those elements need to created and cloned in a special way when they are defined outside their - * usual containers (e.g. like ``). - * * See also the `directive.templateNamespace` property. - * - * - * #### `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 (unless no link function - * is specified, in which case error checking is skipped). 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. - * * `^^` - Locate the required controller by searching the element's 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. - * * `?^^` - Attempt to locate the required controller by searching the element's 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 defaults (elements and attributes) are used. - * - * * `E` - Element name (default): `` - * * `A` - Attribute (default): `
      ` - * * `C` - Class: `
      ` - * * `M` - Comment: `` - * - * - * #### `templateNamespace` - * String representing the document type used by the markup in the template. - * AngularJS needs this information as those elements need to be created and cloned - * in a special way when they are defined outside their usual containers like `` and ``. - * - * * `html` - All root nodes in the template are HTML. Root nodes may also be - * top-level elements such as `` or ``. - * * `svg` - The root nodes in the template are SVG elements (excluding ``). - * * `math` - The root nodes in the template are MathML elements (excluding ``). - * - * If no `templateNamespace` is specified, then the namespace is considered to be `html`. - * - * #### `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` - * This is similar to `template` but the template is loaded from the specified URL, asynchronously. - * - * Because template loading is asynchronous the compiler will suspend compilation of directives on that element - * for later when the template has been resolved. In the meantime it will continue to compile and link - * sibling and parent elements as though this element had not contained any directives. - * - * The compiler does not suspend the entire compilation to wait for templates to be loaded because this - * would result in the whole app "stalling" until all templates are loaded asynchronously - even in the - * case when only one deeply nested directive has `templateUrl`. - * - * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache} - * - * 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 - * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}. - * - * - * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0) - * 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#template-expanding-directive - * Directives Guide} for an example. - * - * There are very few scenarios where element replacement is required for the application function, - * the main one being reusable custom components that are used within SVG contexts - * (because SVG doesn't work with custom elements in the DOM tree). - * - * #### `transclude` - * Extract the contents of the element where the directive appears and make it available to the directive. - * The contents are compiled and provided to the directive as a **transclusion function**. See the - * {@link $compile#transclusion Transclusion} section below. - * - * There are two kinds of transclusion depending upon whether you want to transclude just the contents of the - * directive's element or the entire element: - * - * * `true` - transclude the content (i.e. the child nodes) of the directive's element. - * * `'element'` - transclude the whole of the directive's element including any directives on this - * element that defined at a lower priority than this directive. When used, the `template` - * property is ignored. - * - * - * #### `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` - the directive's required controller instance(s) - Instances are shared - * among all directives, which allows the directives to use the controllers as a communication - * channel. The exact value depends on the directive's `require` property: - * * `string`: the controller instance - * * `array`: array of controller instances - * * no controller(s) required: `undefined` - * - * If a required controller cannot be found, and it is optional, the instance is `null`, - * otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown. - * - * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope. - * This is the same as the `$transclude` - * parameter of directive controllers, see there for details. - * `function([scope], cloneLinkingFn, futureParentElement)`. - * - * #### 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. - * - * Note that child elements that contain `templateUrl` directives will not have been compiled - * and linked since they are waiting for their template to load asynchronously and their own - * compilation and linking has been suspended until that occurs. - * - * It is safe to do DOM transformation in the post-linking function on elements that are not waiting - * for their async templates to be resolved. - * - * - * ### Transclusion - * - * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and - * copying them to another part of the DOM, while maintaining their connection to the original AngularJS - * scope from where they were taken. - * - * Transclusion is used (often with {@link ngTransclude}) to insert the - * original contents of a directive's element into a specified place in the template of the directive. - * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded - * content has access to the properties on the scope from which it was taken, even if the directive - * has isolated scope. - * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}. - * - * This makes it possible for the widget to have private state for its template, while the transcluded - * content has access to its originating scope. - * - *
      - * **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}. - *
      - * - * #### Transclusion Functions - * - * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion - * function** to the directive's `link` function and `controller`. This transclusion function is a special - * **linking function** that will return the compiled contents linked to a new transclusion scope. - * - *
      - * If you are just using {@link ngTransclude} then you don't need to worry about this function, since - * ngTransclude will deal with it for us. - *
      - * - * If you want to manually control the insertion and removal of the transcluded content in your directive - * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery - * object that contains the compiled DOM, which is linked to the correct transclusion scope. - * - * When you call a transclusion function you can pass in a **clone attach function**. This function accepts - * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded - * content and the `scope` is the newly created transclusion scope, to which the clone is bound. - * - *
      - * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a translude function - * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope. - *
      - * - * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone - * attach function**: - * - * ```js - * var transcludedContent, transclusionScope; - * - * $transclude(function(clone, scope) { - * element.append(clone); - * transcludedContent = clone; - * transclusionScope = scope; - * }); - * ``` - * - * Later, if you want to remove the transcluded content from your DOM then you should also destroy the - * associated transclusion scope: - * - * ```js - * transcludedContent.remove(); - * transclusionScope.$destroy(); - * ``` - * - *
      - * **Best Practice**: if you intend to add and remove transcluded content manually in your directive - * (by calling the transclude function to get the DOM and and calling `element.remove()` to remove it), - * then you are also responsible for calling `$destroy` on the transclusion scope. - *
      - * - * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat} - * automatically destroy their transluded clones as necessary so you do not need to worry about this if - * you are simply using {@link ngTransclude} to inject the transclusion into your directive. - * - * - * #### Transclusion Scopes - * - * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion - * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed - * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it - * was taken. - * - * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look - * like this: - * - * ```html - *
      - *
      - *
      - *
      - *
      - *
      - * ``` - * - * The `$parent` scope hierarchy will look like this: - * - * ``` - * - $rootScope - * - isolate - * - transclusion - * ``` - * - * but the scopes will inherit prototypically from different scopes to their `$parent`. - * - * ``` - * - $rootScope - * - transclusion - * - isolate - * ``` - * - * - * ### 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); - * }); - * } - * ``` - * - * ## Example - * - *
      - * **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 - DEPRECATED. - * - *
      - * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it - * e.g. will not use the right outer scope. Please pass the transclude function as a - * `parentBoundTranscludeFn` to the link function instead. - *
      - * - * @param {number} maxPriority only apply directives lower than given priority (Only effects the - * root element(s), not their children) - * @returns {function(scope, cloneAttachFn=, options=)} 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. - * - * * `options` - An optional object hash with linking options. If `options` is provided, then the following - * keys may be used to control linking behavior: - * - * * `parentBoundTranscludeFn` - the transclude function made available to - * directives; if given, it will be passed through to the link functions of - * directives found in `element` during compilation. - * * `transcludeControllers` - an object hash with keys that map controller names - * to controller instances; if given, it will make the controllers - * available to directives. - * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add - * the cloned elements; only needed for transcludes that are allowed to contain non html - * elements (e.g. SVG elements). See also the directive.controller property. - * - * 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 - * - * @description - */ -$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider']; -function $CompileProvider($provide, $$sanitizeUriProvider) { - var hasDirectives = {}, - Suffix = 'Directive', - COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\w\-]+)\s+(.*)$/, - CLASS_DIRECTIVE_REGEXP = /(([\w\-]+)(?:\:([^;]+))?;?)/, - ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'), - REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/; - - // 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)$/; - - function parseIsolateBindings(scope, directiveName) { - var LOCAL_REGEXP = /^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/; - - var bindings = {}; - - forEach(scope, function(definition, scopeName) { - var match = definition.match(LOCAL_REGEXP); - - if (!match) { - throw $compileMinErr('iscp', - "Invalid isolate scope definition for directive '{0}'." + - " Definition: {... {1}: '{2}' ...}", - directiveName, scopeName, definition); - } - - bindings[scopeName] = { - mode: match[1][0], - collection: match[2] === '*', - optional: match[3] === '?', - attrName: match[4] || scopeName - }; - }); - - return bindings; - } - - /** - * @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 || 'EA'; - if (isObject(directive.scope)) { - directive.$$isolateBindings = parseIsolateBindings(directive.scope, directive.name); - } - 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 preventing 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(); - } - }; - - /** - * @ngdoc method - * @name $compileProvider#debugInfoEnabled - * - * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the - * current debugInfoEnabled state - * @returns {*} current value if used as getter or itself (chaining) if used as setter - * - * @kind function - * - * @description - * Call this method to enable/disable various debug runtime information in the compiler such as adding - * binding information and a reference to the current scope on to DOM elements. - * If enabled, the compiler will add the following to DOM elements that have been bound to the scope - * * `ng-binding` CSS class - * * `$binding` data property containing an array of the binding expressions - * - * You may want to disable this in production for a significant performance boost. See - * {@link guide/production#disabling-debug-data Disabling Debug Data} for more. - * - * The default value is true. - */ - var debugInfoEnabled = true; - this.debugInfoEnabled = function(enabled) { - if (isDefined(enabled)) { - debugInfoEnabled = enabled; - return this; - } - return debugInfoEnabled; - }; - - this.$get = [ - '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse', - '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri', - function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse, - $controller, $rootScope, $document, $sce, $animate, $$sanitizeUri) { - - var Attributes = function(element, attributesToCopy) { - if (attributesToCopy) { - var keys = Object.keys(attributesToCopy); - var i, l, key; - - for (i = 0, l = keys.length; i < l; i++) { - key = keys[i]; - this[key] = attributesToCopy[key]; - } - } else { - this.$attr = {}; - } - - this.$$element = element; - }; - - Attributes.prototype = { - /** - * @ngdoc method - * @name $compile.directive.Attributes#$normalize - * @kind function - * - * @description - * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or - * `data-`) to its normalized, camelCase form. - * - * Also there is special case for Moz prefix starting with upper case letter. - * - * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives} - * - * @param {string} name Name to normalize - */ - $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); - if (toAdd && toAdd.length) { - $animate.addClass(this.$$element, toAdd); - } - - var toRemove = tokenDifference(oldClasses, newClasses); - if (toRemove && toRemove.length) { - $animate.removeClass(this.$$element, 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 node = this.$$element[0], - booleanKey = getBooleanAttrName(node, key), - aliasedKey = getAliasedAttrName(node, key), - observer = key, - nodeName; - - if (booleanKey) { - this.$$element.prop(key, value); - attrName = booleanKey; - } else if (aliasedKey) { - this[aliasedKey] = value; - observer = aliasedKey; - } - - 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); - - if ((nodeName === 'a' && key === 'href') || - (nodeName === 'img' && key === 'src')) { - // sanitize a[href] and img[src] values - this[key] = value = $$sanitizeUri(value, key === 'src'); - } else if (nodeName === 'img' && key === 'srcset') { - // sanitize img[srcset] values - var result = ""; - - // first check if there are spaces because it's not the same pattern - var trimmedSrcset = trim(value); - // ( 999x ,| 999w ,| ,|, ) - var srcPattern = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/; - var pattern = /\s/.test(trimmedSrcset) ? srcPattern : /(,)/; - - // split srcset into tuple of uri and descriptor except for the last item - var rawUris = trimmedSrcset.split(pattern); - - // for each tuples - var nbrUrisWith2parts = Math.floor(rawUris.length / 2); - for (var i = 0; i < nbrUrisWith2parts; i++) { - var innerIdx = i * 2; - // sanitize the uri - result += $$sanitizeUri(trim(rawUris[innerIdx]), true); - // add the descriptor - result += (" " + trim(rawUris[innerIdx + 1])); - } - - // split the last item into uri and descriptor - var lastTuple = trim(rawUris[i * 2]).split(/\s/); - - // sanitize the last uri - result += $$sanitizeUri(trim(lastTuple[0]), true); - - // and add the last descriptor if any - if (lastTuple.length === 2) { - result += (" " + trim(lastTuple[1])); - } - this[key] = value = result; - } - - 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[observer], 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#text-and-attribute-bindings Directives} guide for more info. - * @returns {function()} Returns a deregistration function for this observer. - */ - $observe: function(key, fn) { - var attrs = this, - $$observers = (attrs.$$observers || (attrs.$$observers = createMap())), - listeners = ($$observers[key] || ($$observers[key] = [])); - - listeners.push(fn); - $rootScope.$evalAsync(function() { - if (!listeners.$$inter && attrs.hasOwnProperty(key)) { - // no one registered attribute interpolation function, so lets call it manually - fn(attrs[key]); - } - }); - - return function() { - arrayRemove(listeners, fn); - }; - } - }; - - - function safeAddClass($element, className) { - try { - $element.addClass(className); - } catch (e) { - // ignore, since it means that we are trying to set class on - // SVG element, where class name is read-only. - } - } - - - 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]/; - - compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) { - var bindings = $element.data('$binding') || []; - - if (isArray(binding)) { - bindings = bindings.concat(binding); - } else { - bindings.push(binding); - } - - $element.data('$binding', bindings); - } : noop; - - compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) { - safeAddClass($element, 'ng-binding'); - } : noop; - - compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) { - var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope'; - $element.data(dataName, scope); - } : noop; - - compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) { - safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope'); - } : noop; - - 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 == NODE_TYPE_TEXT && node.nodeValue.match(/\S+/) /* non-empty */ ) { - $compileNodes[index] = jqLite(node).wrap('').parent()[0]; - } - }); - var compositeLinkFn = - compileNodes($compileNodes, transcludeFn, $compileNodes, - maxPriority, ignoreDirective, previousCompileContext); - compile.$$addScopeClass($compileNodes); - var namespace = null; - return function publicLinkFn(scope, cloneConnectFn, options) { - assertArg(scope, 'scope'); - - options = options || {}; - var parentBoundTranscludeFn = options.parentBoundTranscludeFn, - transcludeControllers = options.transcludeControllers, - futureParentElement = options.futureParentElement; - - // When `parentBoundTranscludeFn` is passed, it is a - // `controllersBoundTransclude` function (it was previously passed - // as `transclude` to directive.link) so we must unwrap it to get - // its `boundTranscludeFn` - if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) { - parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude; - } - - if (!namespace) { - namespace = detectNamespaceForChildElements(futureParentElement); - } - var $linkNode; - if (namespace !== 'html') { - // When using a directive with replace:true and templateUrl the $compileNodes - // (or a child element inside of them) - // might change, so we need to recreate the namespace adapted compileNodes - // for call to the link function. - // Note: This will already clone the nodes... - $linkNode = jqLite( - wrapTemplate(namespace, jqLite('
      ').append($compileNodes).html()) - ); - } else if (cloneConnectFn) { - // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart - // and sometimes changes the structure of the DOM. - $linkNode = JQLitePrototype.clone.call($compileNodes); - } else { - $linkNode = $compileNodes; - } - - if (transcludeControllers) { - for (var controllerName in transcludeControllers) { - $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance); - } - } - - compile.$$addScopeInfo($linkNode, scope); - - if (cloneConnectFn) cloneConnectFn($linkNode, scope); - if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn); - return $linkNode; - }; - } - - function detectNamespaceForChildElements(parentElement) { - // TODO: Make this detect MathML as well... - var node = parentElement && parentElement[0]; - if (!node) { - return 'html'; - } else { - return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/) ? 'svg' : 'html'; - } - } - - /** - * Compile function matches each node in nodeList against the directives. Once all directives - * for a particular node are collected their compile functions are executed. The compile - * functions return values - the linking functions - are combined into a composite linking - * function, which is the a linking function for the node. - * - * @param {NodeList} nodeList an array of nodes or NodeList to compile - * @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 {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then - * the rootElement must be set the jqLite collection of the compile root. This is - * needed so that the jqLite collection items can be replaced with widgets. - * @param {number=} maxPriority Max directive priority. - * @returns {Function} A composite linking function of all of the matched directives or null. - */ - function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective, - previousCompileContext) { - var linkFns = [], - attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; - - for (var i = 0; i < nodeList.length; i++) { - attrs = new Attributes(); - - // we must always refer to nodeList[i] since the nodes can be replaced underneath us. - directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined, - ignoreDirective); - - nodeLinkFn = (directives.length) - ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, - null, [], [], previousCompileContext) - : null; - - if (nodeLinkFn && nodeLinkFn.scope) { - compile.$$addScopeClass(attrs.$$element); - } - - childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || - !(childNodes = nodeList[i].childNodes) || - !childNodes.length) - ? null - : compileNodes(childNodes, - nodeLinkFn ? ( - (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement) - && nodeLinkFn.transclude) : transcludeFn); - - if (nodeLinkFn || childLinkFn) { - linkFns.push(i, nodeLinkFn, childLinkFn); - linkFnFound = true; - nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn; - } - - //use the previous context only for the first element in the virtual group - previousCompileContext = null; - } - - // return a linking function if we have found anything, null otherwise - return linkFnFound ? compositeLinkFn : null; - - function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) { - var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn; - var stableNodeList; - - - if (nodeLinkFnFound) { - // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our - // offsets don't get screwed up - var nodeListLength = nodeList.length; - stableNodeList = new Array(nodeListLength); - - // create a sparse array by only copying the elements which have a linkFn - for (i = 0; i < linkFns.length; i+=3) { - idx = linkFns[i]; - stableNodeList[idx] = nodeList[idx]; - } - } else { - stableNodeList = nodeList; - } - - for (i = 0, ii = linkFns.length; i < ii;) { - node = stableNodeList[linkFns[i++]]; - nodeLinkFn = linkFns[i++]; - childLinkFn = linkFns[i++]; - - if (nodeLinkFn) { - if (nodeLinkFn.scope) { - childScope = scope.$new(); - compile.$$addScopeInfo(jqLite(node), childScope); - } else { - childScope = scope; - } - - if (nodeLinkFn.transcludeOnThisElement) { - childBoundTranscludeFn = createBoundTranscludeFn( - scope, nodeLinkFn.transclude, parentBoundTranscludeFn, - nodeLinkFn.elementTranscludeOnThisElement); - - } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) { - childBoundTranscludeFn = parentBoundTranscludeFn; - - } else if (!parentBoundTranscludeFn && transcludeFn) { - childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn); - - } else { - childBoundTranscludeFn = null; - } - - nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn); - - } else if (childLinkFn) { - childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn); - } - } - } - } - - function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn, elementTransclusion) { - - var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) { - - if (!transcludedScope) { - transcludedScope = scope.$new(false, containingScope); - transcludedScope.$$transcluded = true; - } - - return transcludeFn(transcludedScope, cloneFn, { - parentBoundTranscludeFn: previousBoundTranscludeFn, - transcludeControllers: controllers, - futureParentElement: futureParentElement - }); - }; - - return boundTranscludeFn; - } - - /** - * Looks for directives on the given node and adds them to the directive collection which is - * sorted. - * - * @param node Node to search. - * @param directives An array to which the directives are added to. This array is sorted before - * the function returns. - * @param attrs The shared attrs object which is used to populate the normalized attributes. - * @param {number=} maxPriority Max directive priority. - */ - function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) { - var nodeType = node.nodeType, - attrsMap = attrs.$attr, - match, - className; - - switch (nodeType) { - case NODE_TYPE_ELEMENT: /* Element */ - // use the node name: - addDirective(directives, - directiveNormalize(nodeName_(node)), '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]; - name = attr.name; - value = trim(attr.value); - - // support ngAttr attribute binding - ngAttrName = directiveNormalize(name); - if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) { - name = name.replace(PREFIX_REGEXP, '') - .substr(8).replace(/_(.)/g, function(match, letter) { - return letter.toUpperCase(); - }); - } - - var directiveNName = ngAttrName.replace(/(Start|End)$/, ''); - if (directiveIsMultiElement(directiveNName)) { - 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, isNgAttr); - addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, - attrEndName); - } - - // use class as directive - className = node.className; - if (isObject(className)) { - // Maybe SVGAnimatedString - className = className.animVal; - } - 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 NODE_TYPE_TEXT: /* Text Node */ - addTextInterpolateDirective(directives, node.nodeValue); - break; - case NODE_TYPE_COMMENT: /* 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)) { - do { - if (!node) { - throw $compileMinErr('uterdir', - "Unterminated attribute, found '{0}' but no matching '{1}' found.", - attrStart, attrEnd); - } - if (node.nodeType == NODE_TYPE_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, - controllers, - 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) { - - // skip the check for directives with async templates, we'll check the derived sync - // directive when the template arrives - if (!directive.templateUrl) { - if (isObject(directiveValue)) { - // This directive is trying to add an isolated scope. - // Check that there is no scope of any kind already - assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective, - directive, $compileNode); - newIsolateScopeDirective = directive; - } else { - // This directive is trying to add a child scope. - // Check that there is no isolated scope already - assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive, - $compileNode); - } - } - - newScopeDirective = newScopeDirective || 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 = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue))); - } - compileNode = $template[0]; - - if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { - 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.elementTranscludeOnThisElement = hasElementTranscludeDirective; - 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; - var $searchElement = $element; - var match; - if (isString(require)) { - match = require.match(REQUIRE_PREFIX_REGEXP); - require = require.substring(match[0].length); - - if (match[3]) { - if (match[1]) match[3] = null; - else match[1] = match[3]; - } - if (match[1] === '^') { - retrievalMethod = 'inheritedData'; - } else if (match[1] === '^^') { - retrievalMethod = 'inheritedData'; - $searchElement = $element.parent(); - } - if (match[2] === '?') { - optional = true; - } - - value = null; - - if (elementControllers && retrievalMethod === 'data') { - if (value = elementControllers[require]) { - value = value.instance; - } - } - value = value || $searchElement[retrievalMethod]('$' + require + 'Controller'); - - if (!value && !optional) { - throw $compileMinErr('ctreq', - "Controller '{0}', required by directive '{1}', can't be found!", - require, directiveName); - } - return value || null; - } 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 i, ii, linkFn, controller, isolateScope, elementControllers, transcludeFn, $element, - attrs; - - if (compileNode === linkNode) { - attrs = templateAttrs; - $element = templateAttrs.$$element; - } else { - $element = jqLite(linkNode); - attrs = new Attributes($element, templateAttrs); - } - - if (newIsolateScopeDirective) { - isolateScope = scope.$new(true); - } - - if (boundTranscludeFn) { - // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` - // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` - transcludeFn = controllersBoundTransclude; - transcludeFn.$$boundTransclude = boundTranscludeFn; - } - - if (controllerDirectives) { - // TODO: merge `controllers` and `elementControllers` into single object. - controllers = {}; - elementControllers = {}; - 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, true, directive.controllerAs); - - // 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.instance); - } - - controllers[directive.name] = controllerInstance; - }); - } - - if (newIsolateScopeDirective) { - compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || - templateDirective === newIsolateScopeDirective.$$originalDirective))); - compile.$$addScopeClass($element, true); - - var isolateScopeController = controllers && controllers[newIsolateScopeDirective.name]; - var isolateBindingContext = isolateScope; - if (isolateScopeController && isolateScopeController.identifier && - newIsolateScopeDirective.bindToController === true) { - isolateBindingContext = isolateScopeController.instance; - } - - forEach(isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings, function(definition, scopeName) { - var attrName = definition.attrName, - optional = definition.optional, - mode = definition.mode, // @, =, or & - lastValue, - parentGet, parentSet, compare; - - switch (mode) { - - case '@': - attrs.$observe(attrName, function(value) { - isolateBindingContext[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 - isolateBindingContext[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 = isolateBindingContext[scopeName] = parentGet(scope); - throw $compileMinErr('nonassign', - "Expression '{0}' used with directive '{1}' is non-assignable!", - attrs[attrName], newIsolateScopeDirective.name); - }; - lastValue = isolateBindingContext[scopeName] = parentGet(scope); - var parentValueWatch = function parentValueWatch(parentValue) { - if (!compare(parentValue, isolateBindingContext[scopeName])) { - // we are out of sync and need to copy - if (!compare(parentValue, lastValue)) { - // parent changed and it has precedence - isolateBindingContext[scopeName] = parentValue; - } else { - // if the parent can be assigned then do so - parentSet(scope, parentValue = isolateBindingContext[scopeName]); - } - } - return lastValue = parentValue; - }; - parentValueWatch.$stateful = true; - var unwatch; - if (definition.collection) { - unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch); - } else { - unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal); - } - isolateScope.$on('$destroy', unwatch); - break; - - case '&': - parentGet = $parse(attrs[attrName]); - isolateBindingContext[scopeName] = function(locals) { - return parentGet(scope, locals); - }; - break; - } - }); - } - if (controllers) { - forEach(controllers, function(controller) { - controller(); - }); - controllers = null; - } - - // PRELINKING - for (i = 0, ii = preLinkFns.length; i < ii; i++) { - linkFn = preLinkFns[i]; - invokeLinkFn(linkFn, - linkFn.isolateScope ? isolateScope : scope, - $element, - attrs, - linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), - transcludeFn - ); - } - - // 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--) { - linkFn = postLinkFns[i]; - invokeLinkFn(linkFn, - linkFn.isolateScope ? isolateScope : scope, - $element, - attrs, - linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), - transcludeFn - ); - } - - // This is the function that is injected as `$transclude`. - // Note: all arguments are optional! - function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) { - var transcludeControllers; - - // No scope passed in: - if (!isScope(scope)) { - futureParentElement = cloneAttachFn; - cloneAttachFn = scope; - scope = undefined; - } - - if (hasElementTranscludeDirective) { - transcludeControllers = elementControllers; - } - if (!futureParentElement) { - futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element; - } - return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); - } - } - } - - 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 < ii; i++) { - try { - directive = directives[i]; - if ((maxPriority === undefined || maxPriority > 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; - } - - - /** - * looks up the directive and returns true if it is a multi-element directive, - * and therefore requires DOM nodes between -start and -end markers to be grouped - * together. - * - * @param {string} name name of the directive to look up. - * @returns true if directive was registered as multi-element. - */ - function directiveIsMultiElement(name) { - if (hasDirectives.hasOwnProperty(name)) { - for (var directive, directives = $injector.get(name + Suffix), - i = 0, ii = directives.length; i < ii; i++) { - directive = directives[i]; - if (directive.multiElement) { - return true; - } - } - } - return false; - } - - /** - * 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(), - derivedSyncDirective = inherit(origAsyncDirective, { - templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective - }), - templateUrl = (isFunction(origAsyncDirective.templateUrl)) - ? origAsyncDirective.templateUrl($compileNode, tAttrs) - : origAsyncDirective.templateUrl, - templateNamespace = origAsyncDirective.templateNamespace; - - $compileNode.empty(); - - $templateRequest(templateUrl) - .then(function(content) { - var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn; - - content = denormalizeTemplate(content); - - if (origAsyncDirective.replace) { - if (jqLiteIsTextNode(content)) { - $template = []; - } else { - $template = removeComments(wrapTemplate(templateNamespace, trim(content))); - } - compileNode = $template[0]; - - if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { - 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 (scope.$$destroyed) continue; - - 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; - }); - - return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) { - var childBoundTranscludeFn = boundTranscludeFn; - if (scope.$$destroyed) return; - if (linkQueue) { - linkQueue.push(scope, - node, - rootElement, - 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) { - var templateNodeParent = templateNode.parent(), - hasCompileParent = !!templateNodeParent.length; - - // When transcluding a template that has bindings in the root - // we don't have a parent and thus need to add the class during linking fn. - if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); - - return function textInterpolateLinkFn(scope, node) { - var parent = node.parent(); - if (!hasCompileParent) compile.$$addBindingClass(parent); - compile.$$addBindingInfo(parent, interpolateFn.expressions); - scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { - node[0].nodeValue = value; - }); - }; - } - }); - } - } - - - function wrapTemplate(type, template) { - type = lowercase(type || 'html'); - switch (type) { - case 'svg': - case 'math': - var wrapper = document.createElement('div'); - wrapper.innerHTML = '<' + type + '>' + template + ''; - return wrapper.childNodes[0].childNodes; - default: - return template; - } - } - - - 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, allOrNothing) { - var trustedContext = getTrustedContext(node, name); - allOrNothing = ALL_OR_NOTHING_ATTRS[name] || allOrNothing; - - var interpolateFn = $interpolate(value, true, trustedContext, allOrNothing); - - // 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."); - } - - // If the attribute has changed since last $interpolate()ed - var newValue = attr[name]; - if (newValue !== value) { - // we need to interpolate again since the attribute value has been updated - // (e.g. by another directive's compile function) - // ensure unset/empty values make interpolateFn falsy - interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing); - value = newValue; - } - - // if attribute was updated so that there is no interpolation going on we don't want to - // register any observers - if (!interpolateFn) return; - - // initialize attr object so that it's ready in case we need the value for isolate - // scope initialization, otherwise the value would not be available from isolate - // directive's linking fn during linking phase - 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; - - // If the replaced element is also the jQuery .context then replace it - // .context is a deprecated jQuery api, so we should set it only when jQuery set it - // http://api.jquery.com/context/ - if ($rootElement.context === firstElementToRemove) { - $rootElement.context = newNode; - } - break; - } - } - } - - if (parent) { - parent.replaceChild(newNode, firstElementToRemove); - } - - // TODO(perf): what's this document fragment for? is it needed? can we at least reuse it? - var fragment = document.createDocumentFragment(); - fragment.appendChild(firstElementToRemove); - - // Copy over user data (that includes Angular's $scope etc.). Don't copy private - // data here because there's no public interface in jQuery to do that and copying over - // event listeners (which is the main use of private data) wouldn't work anyway. - jqLite(newNode).data(jqLite(firstElementToRemove).data()); - - // Remove data of the replaced element. We cannot just call .remove() - // on the element it since that would deallocate scope that is needed - // for the new node. Instead, remove the data "manually". - if (!jQuery) { - delete jqLite.cache[firstElementToRemove[jqLite.expando]]; - } else { - // jQuery 2.x doesn't expose the data storage. Use jQuery.cleanData to clean up after - // the replaced element. The cleanData version monkey-patched by Angular would cause - // the scope to be trashed and we do need the very same scope to work with the new - // element. However, we cannot just cache the non-patched version and use it here as - // that would break if another library patches the method after Angular does (one - // example is jQuery UI). Instead, set a flag indicating scope destroying should be - // skipped this one time. - skipDestroyOnNextJQueryCleanData = true; - jQuery.cleanData([firstElementToRemove]); - } - - 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); - } - - - function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) { - try { - linkFn(scope, $element, attrs, controllers, transcludeFn); - } catch (e) { - $exceptionHandler(e, startingTag($element)); - } - } - }]; -} - -var PREFIX_REGEXP = /^((?:x|data)[\:\-_])/i; -/** - * Converts all accepted directives format into proper directive name. - * @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; -} - -function removeComments(jqNodes) { - jqNodes = jqLite(jqNodes); - var i = jqNodes.length; - - if (i <= 1) { - return jqNodes; - } - - while (i--) { - var node = jqNodes[i]; - if (node.nodeType === NODE_TYPE_COMMENT) { - splice.call(jqNodes, i, 1); - } - } - return jqNodes; -} - -var $controllerMinErr = minErr('$controller'); - -/** - * @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 = {}, - globals = false, - 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; - } - }; - - /** - * @ngdoc method - * @name $controllerProvider#allowGlobals - * @description If called, allows `$controller` to find controller constructors on `window` - */ - this.allowGlobals = function() { - globals = true; - }; - - - 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 - * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global - * `window` object (not recommended) - * - * The string can use the `controller as property` syntax, where the controller instance is published - * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this - * to work correctly. - * - * @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, later, ident) { - // PRIVATE API: - // param `later` --- indicates that the controller's constructor is invoked at a later time. - // If true, $controller will allocate the object with the correct - // prototype chain, but will not invoke the controller until a returned - // callback is invoked. - // param `ident` --- An optional label which overrides the label parsed from the controller - // expression, if any. - var instance, match, constructor, identifier; - later = later === true; - if (ident && isString(ident)) { - identifier = ident; - } - - if (isString(expression)) { - match = expression.match(CNTRL_REG); - if (!match) { - throw $controllerMinErr('ctrlfmt', - "Badly formed controller string '{0}'. " + - "Must match `__name__ as __id__` or `__name__`.", expression); - } - constructor = match[1], - identifier = identifier || match[3]; - expression = controllers.hasOwnProperty(constructor) - ? controllers[constructor] - : getter(locals.$scope, constructor, true) || - (globals ? getter($window, constructor, true) : undefined); - - assertArgFn(expression, constructor, true); - } - - if (later) { - // Instantiate controller later: - // This machinery is used to create an instance of the object before calling the - // controller's constructor itself. - // - // This allows properties to be added to the controller before the constructor is - // invoked. Primarily, this is used for isolate scope bindings in $compile. - // - // This feature is not intended for use by applications, and is thus not documented - // publicly. - // Object creation: http://jsperf.com/create-constructor/2 - var controllerPrototype = (isArray(expression) ? - expression[expression.length - 1] : expression).prototype; - instance = Object.create(controllerPrototype || null); - - if (identifier) { - addIdentifier(locals, identifier, instance, constructor || expression.name); - } - - return extend(function() { - $injector.invoke(expression, instance, locals, constructor); - return instance; - }, { - instance: instance, - identifier: identifier - }); - } - - instance = $injector.instantiate(expression, locals, constructor); - - if (identifier) { - addIdentifier(locals, identifier, instance, constructor || expression.name); - } - - return instance; - }; - - function addIdentifier(locals, identifier, instance, name) { - if (!(locals && isObject(locals.$scope))) { - throw minErr('$controller')('noscp', - "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.", - name, identifier); - } - - locals.$scope[identifier] = 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. - * - *
      - * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind` - * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler} - * (unless executed during a digest). - * - * If you wish, you can manually delegate exceptions, e.g. - * `try { ... } catch(e) { $exceptionHandler(e); }` - * - * @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); - }; - }]; -} - -var APPLICATION_JSON = 'application/json'; -var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'}; -var JSON_START = /^\[|^\{(?!\{)/; -var JSON_ENDS = { - '[': /]$/, - '{': /}$/ -}; -var JSON_PROTECTION_PREFIX = /^\)\]\}',?\n/; - -function defaultHttpResponseTransform(data, headers) { - if (isString(data)) { - // Strip json vulnerability protection prefix and trim whitespace - var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim(); - - if (tempData) { - var contentType = headers('Content-Type'); - if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) { - data = fromJson(tempData); - } - } - } - - return data; -} - -function isJsonLike(str) { - var jsonStart = str.match(JSON_START); - return jsonStart && JSON_ENDS[jsonStart[0]].test(str); -} - -/** - * 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 = createMap(), 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) { - var value = headersObj[lowercase(name)]; - if (value === void 0) { - value = null; - } - return value; - } - - 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 {number} status HTTP status code of the response. - * @param {(Function|Array.)} fns Function or an array of functions. - * @returns {*} Transformed data. - */ -function transformData(data, headers, status, fns) { - if (isFunction(fns)) - return fns(data, headers, status); - - forEach(fns, function(fn) { - data = fn(data, headers, status); - }); - - 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() { - /** - * @ngdoc property - * @name $httpProvider#defaults - * @description - * - * Object containing default values for all {@link ng.$http $http} requests. - * - * - **`defaults.cache`** - {Object} - an object built with {@link ng.$cacheFactory `$cacheFactory`} - * that will provide the cache for all requests who set their `cache` property to `true`. - * If you set the `default.cache = false` then only requests that specify their own custom - * cache object will be cached. See {@link $http#caching $http Caching} for more information. - * - * - **`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: [defaultHttpResponseTransform], - - // transform outgoing request data - transformRequest: [function(d) { - return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(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' - }; - - var useApplyAsync = false; - /** - * @ngdoc method - * @name $httpProvider#useApplyAsync - * @description - * - * Configure $http service to combine processing of multiple http responses received at around - * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in - * significant performance improvement for bigger applications that make many HTTP requests - * concurrently (common during application bootstrap). - * - * Defaults to false. If no value is specifed, returns the current configured value. - * - * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred - * "apply" on the next tick, giving time for subsequent requests in a roughly ~10ms window - * to load and share the same digest cycle. - * - * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. - * otherwise, returns the current configured value. - **/ - this.useApplyAsync = function(value) { - if (isDefined(value)) { - useApplyAsync = !!value; - return this; - } - return useApplyAsync; - }; - - /** - * @ngdoc property - * @name $httpProvider#interceptors - * @description - * - * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http} - * pre-processing of request or postprocessing of responses. - * - * These service factories are ordered by request, i.e. they are applied in the same order as the - * array, on request, but reverse order, on response. - * - * {@link ng.$http#interceptors Interceptors detailed info} - **/ - var interceptorFactories = this.interceptors = []; - - 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)); - }); - - /** - * @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 - * // Simple GET request example : - * $http.get('/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. - * }); - * ``` - * - * ```js - * // Simple POST request example (passing data) : - * $http.post('/someUrl', {msg:'hello word!'}). - * 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. - * - * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis, - * Use the `headers` property, setting the desired header to `undefined`. For example: - * - * ```js - * var req = { - * method: 'POST', - * url: 'http://example.com', - * headers: { - * 'Content-Type': undefined - * }, - * data: { test: 'test' } - * } - * - * $http(req).success(function(){...}).error(function(){...}); - * ``` - * - * ## Transforming Requests and Responses - * - * Both requests and responses can be transformed using transformation functions: `transformRequest` - * and `transformResponse`. These properties can be a single function that returns - * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions, - * which allows you to `push` or `unshift` a new transformation function into the transformation chain. - * - * ### Default Transformations - * - * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and - * `defaults.transformResponse` properties. If a request does not provide its own transformations - * then these will be applied. - * - * You can augment or replace the default transformations by modifying these properties by adding to or - * replacing the array. - * - * Angular provides the following default transformations: - * - * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`): - * - * - If the `data` property of the request configuration object contains an object, serialize it - * into JSON format. - * - * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`): - * - * - If XSRF prefix is detected, strip it (see Security Considerations section below). - * - If JSON response is detected, deserialize it using a JSON parser. - * - * - * ### Overriding the Default Transformations Per Request - * - * If you wish override the request/response transformations only for a single request then provide - * `transformRequest` and/or `transformResponse` properties on the configuration object passed - * into `$http`. - * - * Note that if you provide these properties on the config object the default transformations will be - * overwritten. If you wish to augment the default transformations then you must include them in your - * local transformation array. - * - * The following code demonstrates adding a new response transformation to be run after the default response - * transformations have been run. - * - * ```js - * function appendTransform(defaults, transform) { - * - * // We can't guarantee that the default transformation is an array - * defaults = angular.isArray(defaults) ? defaults : [defaults]; - * - * // Append the new transformation to the defaults - * return defaults.concat(transform); - * } - * - * $http({ - * url: '...', - * method: 'GET', - * transformResponse: appendTransform($http.defaults.transformResponse, function(value) { - * return doTransform(value); - * }) - * }); - * ``` - * - * - * ## 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#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 - * } - * }; - * }); - * ``` - * - * ## 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. - * See {@link ng.$http#overriding-the-default-transformations-per-request - * Overriding the Default Transformations} - * - **transformResponse** – - * `{function(data, headersGetter, status)|Array.}` – - * transform function or an array of such functions. The transform function takes the http - * response body, headers and status and returns its transformed (typically deserialized) version. - * See {@link ng.$http#overriding-the-default-transformations-per-request - * Overriding the Default Transformations} - * - **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!/); - }); - -// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185 -// 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) { - - if (!angular.isObject(requestConfig)) { - throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig); - } - - var config = extend({ - method: 'get', - transformRequest: defaults.transformRequest, - transformResponse: defaults.transformResponse - }, requestConfig); - - config.headers = mergeHeaders(requestConfig); - config.method = uppercase(config.method); - - var serverRequest = function(config) { - var headers = config.headers; - var reqData = transformData(config.data, headersGetter(headers), undefined, 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).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) { - assertArgFn(fn, 'fn'); - - promise.then(function(response) { - fn(response.data, response.status, response.headers, config); - }); - return promise; - }; - - promise.error = function(fn) { - assertArgFn(fn, '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); - if (!response.data) { - resp.data = response.data; - } else { - resp.data = transformData(response.data, response.headers, response.status, config.transformResponse); - } - return (isSuccess(response.status)) - ? resp - : $q.reject(resp); - } - - function executeHeaderFns(headers) { - var headerContent, processedHeaders = {}; - - forEach(headers, function(headerFn, header) { - if (isFunction(headerFn)) { - headerContent = headerFn(); - if (headerContent != null) { - processedHeaders[header] = headerContent; - } - } else { - processedHeaders[header] = headerFn; - } - }); - - return processedHeaders; - } - - 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 - return executeHeaderFns(reqHeaders); - } - } - - $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 - */ - - /** - * @ngdoc method - * @name $http#patch - * - * @description - * Shortcut method to perform `PATCH` 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', 'patch'); - - /** - * @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) { - var deferred = $q.defer(), - promise = deferred.promise, - cache, - cachedResp, - reqHeaders = config.headers, - 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(resolvePromiseWithResult, resolvePromiseWithResult); - } 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); - } - } - - function resolveHttpPromise() { - resolvePromise(response, status, headersString, statusText); - } - - if (useApplyAsync) { - $rootScope.$applyAsync(resolveHttpPromise); - } else { - resolveHttpPromise(); - if (!$rootScope.$$phase) $rootScope.$apply(); - } - } - - - /** - * Resolves the raw $http promise. - */ - function resolvePromise(response, status, headers, statusText) { - //status: HTTP response status code, 0, -1 (aborted by timeout / promise) - status = status >= -1 ? status : 0; - - (isSuccess(status) ? deferred.resolve : deferred.reject)({ - data: response, - status: status, - headers: headersGetter(headers), - config: config, - statusText: statusText - }); - } - - function resolvePromiseWithResult(result) { - resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText); - } - - function removePendingReq() { - var idx = $http.pendingRequests.indexOf(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() { - return new window.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) { - // TODO(vojta): fix the signature - return function(method, url, post, callback, headers, timeout, withCredentials, responseType) { - $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(); - - xhr.open(method, url, true); - forEach(headers, function(value, key) { - if (isDefined(value)) { - xhr.setRequestHeader(key, value); - } - }); - - xhr.onload = function requestLoaded() { - var statusText = xhr.statusText || ''; - - // responseText is the old-school way of retrieving response (supported by IE9) - // response/responseType properties were introduced in XHR Level2 spec (supported by IE10) - var response = ('response' in xhr) ? xhr.response : xhr.responseText; - - // normalize IE9 bug (http://bugs.jquery.com/ticket/1450) - var status = xhr.status === 1223 ? 204 : xhr.status; - - // 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; - } - - completeRequest(callback, - status, - response, - xhr.getAllResponseHeaders(), - statusText); - }; - - var requestError = function() { - // The response is always empty - // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error - completeRequest(callback, -1, null, null, ''); - }; - - xhr.onerror = requestError; - xhr.onabort = requestError; - - 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() { - jsonpDone && jsonpDone(); - xhr && xhr.abort(); - } - - function completeRequest(callback, status, response, headersString, statusText) { - // cancel timeout and subsequent timeout promise resolution - if (timeoutId !== undefined) { - $browserDefer.cancel(timeoutId); - } - jsonpDone = xhr = null; - - callback(status, response, headersString, statusText); - $browser.$$completeOutstandingRequest(noop); - } - }; - - function jsonpReq(url, callbackId, done) { - // we can't use jQuery/jqLite here because jQuery does crazy stuff 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); - rawDocument.body.appendChild(script); - return callback; - } -} - -var $interpolateMinErr = minErr('$interpolate'); - -/** - * @ngdoc provider - * @name $interpolateProvider - * - * @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, - escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'), - escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g'); - - function escape(ch) { - return '\\\\\\' + ch; - } - - /** - * @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!'); - * ``` - * - * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is - * `true`, the interpolation function will return `undefined` unless all embedded expressions - * evaluate to a value other than `undefined`. - * - * ```js - * var $interpolate = ...; // injected - * var context = {greeting: 'Hello', name: undefined }; - * - * // default "forgiving" mode - * var exp = $interpolate('{{greeting}} {{name}}!'); - * expect(exp(context)).toEqual('Hello !'); - * - * // "allOrNothing" mode - * exp = $interpolate('{{greeting}} {{name}}!', false, null, true); - * expect(exp(context)).toBeUndefined(); - * context.name = 'Angular'; - * expect(exp(context)).toEqual('Hello Angular!'); - * ``` - * - * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior. - * - * ####Escaped Interpolation - * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers - * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash). - * It will be rendered as a regular start/end marker, and will not be interpreted as an expression - * or binding. - * - * This enables web-servers to prevent script injection attacks and defacing attacks, to some - * degree, while also enabling code examples to work without relying on the - * {@link ng.directive:ngNonBindable ngNonBindable} directive. - * - * **For security purposes, it is strongly encouraged that web servers escape user-supplied data, - * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all - * interpolation start/end markers with their escaped counterparts.** - * - * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered - * output when the $interpolate service processes the text. So, for HTML elements interpolated - * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter - * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such, - * this is typically useful only when user-data is used in rendering a template from the server, or - * when otherwise untrusted data is used by a directive. - * - * - * - *
      - *

      {{apptitle}}: \{\{ username = "defaced value"; \}\} - *

      - *

      {{username}} attempts to inject code which will deface the - * application, but fails to accomplish their task, because the server has correctly - * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash) - * characters.

      - *

      Instead, the result of the attempted script injection is visible, and can be removed - * from the database by an administrator.

      - *
      - *
      - *
      - * - * @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. - * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined - * unless all embedded expressions evaluate to a value other than `undefined`. - * @returns {function(context)} an interpolation function which is used to compute the - * interpolated string. The function has these parameters: - * - * - `context`: evaluation context for all expressions embedded in the interpolated text - */ - function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) { - allOrNothing = !!allOrNothing; - var startIndex, - endIndex, - index = 0, - expressions = [], - parseFns = [], - textLength = text.length, - exp, - concat = [], - expressionPositions = []; - - while (index < textLength) { - if (((startIndex = text.indexOf(startSymbol, index)) != -1) && - ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) { - if (index !== startIndex) { - concat.push(unescapeText(text.substring(index, startIndex))); - } - exp = text.substring(startIndex + startSymbolLength, endIndex); - expressions.push(exp); - parseFns.push($parse(exp, parseStringifyInterceptor)); - index = endIndex + endSymbolLength; - expressionPositions.push(concat.length); - concat.push(''); - } else { - // we did not find an interpolation, so we have to add the remainder to the separators array - if (index !== textLength) { - concat.push(unescapeText(text.substring(index))); - } - break; - } - } - - // 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 && concat.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 || expressions.length) { - var compute = function(values) { - for (var i = 0, ii = expressions.length; i < ii; i++) { - if (allOrNothing && isUndefined(values[i])) return; - concat[expressionPositions[i]] = values[i]; - } - return concat.join(''); - }; - - var getValue = function(value) { - return trustedContext ? - $sce.getTrusted(trustedContext, value) : - $sce.valueOf(value); - }; - - var stringify = function(value) { - if (value == null) { // null || undefined - return ''; - } - switch (typeof value) { - case 'string': - break; - case 'number': - value = '' + value; - break; - default: - value = toJson(value); - } - - return value; - }; - - return extend(function interpolationFn(context) { - var i = 0; - var ii = expressions.length; - var values = new Array(ii); - - try { - for (; i < ii; i++) { - values[i] = parseFns[i](context); - } - - return compute(values); - } catch (err) { - var newErr = $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, - err.toString()); - $exceptionHandler(newErr); - } - - }, { - // all of these properties are undocumented for now - exp: text, //just for compatibility with regular watchers created via $watch - expressions: expressions, - $$watchDelegate: function(scope, listener, objectEquality) { - var lastValue; - return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) { - var currValue = compute(values); - if (isFunction(listener)) { - listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope); - } - lastValue = currValue; - }, objectEquality); - } - }); - } - - function unescapeText(text) { - return text.replace(escapedStartRegexp, startSymbol). - replace(escapedEndRegexp, endSymbol); - } - - function parseStringifyInterceptor(value) { - try { - value = getValue(value); - return allOrNothing && !isDefined(value) ? value : stringify(value); - } catch (err) { - var newErr = $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, - err.toString()); - $exceptionHandler(newErr); - } - } - } - - - /** - * @ngdoc method - * @name $interpolate#startSymbol - * @description - * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`. - * - * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change - * the symbol. - * - * @returns {string} start symbol. - */ - $interpolate.startSymbol = function() { - return startSymbol; - }; - - - /** - * @ngdoc method - * @name $interpolate#endSymbol - * @description - * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. - * - * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change - * the symbol. - * - * @returns {string} end symbol. - */ - $interpolate.endSymbol = function() { - return endSymbol; - }; - - return $interpolate; - }]; -} - -function $IntervalProvider() { - this.$get = ['$rootScope', '$window', '$q', '$$q', - function($rootScope, $window, $q, $$q) { - var intervals = {}; - - - /** - * @ngdoc service - * @name $interval - * - * @description - * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay` - * milliseconds. - * - * The return value of registering an interval function is a promise. This promise will be - * notified upon each tick of the interval, and will be resolved after `count` iterations, or - * run indefinitely if `count` is not defined. The value of the notification will be the - * number of iterations that have run. - * To cancel an interval, call `$interval.cancel(promise)`. - * - * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to - * move forward by `millis` milliseconds and trigger any functions scheduled to run in that - * time. - * - *
      - * **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, - iteration = 0, - skipApply = (isDefined(invokeApply) && !invokeApply), - deferred = (skipApply ? $$q : $q).defer(), - promise = deferred.promise; - - 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', - ERANAMES: [ - "Before Christ", - "Anno Domini" - ], - ERAS: [ - "BC", - "AD" - ] - }, - - 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) { - var parsedUrl = urlResolve(absoluteUrl); - - locationObj.$$protocol = parsedUrl.protocol; - locationObj.$$host = parsedUrl.hostname; - locationObj.$$port = int(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; -} - - -function parseAppUrl(relativeUrl, locationObj) { - var prefixed = (relativeUrl.charAt(0) !== '/'); - if (prefixed) { - relativeUrl = '/' + relativeUrl; - } - var match = urlResolve(relativeUrl); - 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 trimEmptyHash(url) { - return url.replace(/(#.+)|#$/, '$1'); -} - - -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} appBaseNoFile application base URL stripped of any filename - * @param {string} basePrefix url path prefix - */ -function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) { - this.$$html5 = true; - basePrefix = basePrefix || ''; - parseAbsoluteUrl(appBase, this); - - - /** - * Parse given html5 (regular) url string into properties - * @param {string} url 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); - - 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.$$parseLinkUrl = function(url, relHref) { - if (relHref && relHref[0] === '#') { - // special case for links to hash fragments: - // keep the old url and only replace the hash fragment - this.hash(relHref.slice(1)); - return true; - } - var appUrl, prevAppUrl; - var rewrittenUrl; - - if ((appUrl = beginsWith(appBase, url)) !== undefined) { - prevAppUrl = appUrl; - if ((appUrl = beginsWith(basePrefix, appUrl)) !== undefined) { - rewrittenUrl = appBaseNoFile + (beginsWith('/', appUrl) || appUrl); - } else { - rewrittenUrl = appBase + prevAppUrl; - } - } else if ((appUrl = beginsWith(appBaseNoFile, url)) !== undefined) { - rewrittenUrl = appBaseNoFile + appUrl; - } else if (appBaseNoFile == url + '/') { - rewrittenUrl = appBaseNoFile; - } - if (rewrittenUrl) { - this.$$parse(rewrittenUrl); - } - return !!rewrittenUrl; - }; -} - - -/** - * 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} appBaseNoFile application base URL stripped of any filename - * @param {string} hashPrefix hashbang prefix - */ -function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) { - - parseAbsoluteUrl(appBase, this); - - - /** - * 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; - - if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') { - - // The rest of the url starts with a hash so we have - // got either a hashbang path or a plain hash fragment - withoutHashUrl = beginsWith(hashPrefix, withoutBaseUrl); - if (isUndefined(withoutHashUrl)) { - // There was no hashbang prefix so we just have a hash fragment - withoutHashUrl = withoutBaseUrl; - } - - } else { - // There was no hashbang path nor hash fragment: - // If we are in HTML5 mode we use what is left as the path; - // Otherwise we ignore what is left - if (this.$$html5) { - withoutHashUrl = withoutBaseUrl; - } else { - withoutHashUrl = ''; - if (isUndefined(withoutBaseUrl)) { - appBase = url; - this.replace(); - } - } - } - - parseAppUrl(withoutHashUrl, this); - - 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.$$parseLinkUrl = function(url, relHref) { - if (stripHash(appBase) == stripHash(url)) { - this.$$parse(url); - return true; - } - return false; - }; -} - - -/** - * 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} appBaseNoFile application base URL stripped of any filename - * @param {string} hashPrefix hashbang prefix - */ -function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) { - this.$$html5 = true; - LocationHashbangUrl.apply(this, arguments); - - this.$$parseLinkUrl = function(url, relHref) { - if (relHref && relHref[0] === '#') { - // special case for links to hash fragments: - // keep the old url and only replace the hash fragment - this.hash(relHref.slice(1)); - return true; - } - - var rewrittenUrl; - var appUrl; - - if (appBase == stripHash(url)) { - rewrittenUrl = url; - } else if ((appUrl = beginsWith(appBaseNoFile, url))) { - rewrittenUrl = appBase + hashPrefix + appUrl; - } else if (appBaseNoFile === url + '/') { - rewrittenUrl = appBaseNoFile; - } - if (rewrittenUrl) { - this.$$parse(rewrittenUrl); - } - return !!rewrittenUrl; - }; - - 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 IE9 does not reload page because of removal of '#' - this.$$absUrl = appBase + hashPrefix + this.$$url; - }; - -} - - -var locationPrototype = { - - /** - * 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). - * - * - * ```js - * // given url http://example.com/#/some/path?foo=bar&baz=xoxo - * var absUrl = $location.absUrl(); - * // => "http://example.com/#/some/path?foo=bar&baz=xoxo" - * ``` - * - * @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`. - * - * - * ```js - * // given url http://example.com/#/some/path?foo=bar&baz=xoxo - * var url = $location.url(); - * // => "/some/path?foo=bar&baz=xoxo" - * ``` - * - * @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] || url === '') this.path(decodeURIComponent(match[1])); - if (match[2] || match[1] || url === '') 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. - * - * - * ```js - * // given url http://example.com/#/some/path?foo=bar&baz=xoxo - * var protocol = $location.protocol(); - * // => "http" - * ``` - * - * @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. - * - * Note: compared to the non-angular version `location.host` which returns `hostname:port`, this returns the `hostname` portion only. - * - * - * ```js - * // given url http://example.com/#/some/path?foo=bar&baz=xoxo - * var host = $location.host(); - * // => "example.com" - * - * // given url http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo - * host = $location.host(); - * // => "example.com" - * host = location.host; - * // => "example.com:8080" - * ``` - * - * @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. - * - * - * ```js - * // given url http://example.com/#/some/path?foo=bar&baz=xoxo - * var port = $location.port(); - * // => 80 - * ``` - * - * @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. - * - * - * ```js - * // given url http://example.com/#/some/path?foo=bar&baz=xoxo - * var path = $location.path(); - * // => "/some/path" - * ``` - * - * @param {(string|number)=} path New path - * @return {string} path - */ - path: locationGetterSetter('$$path', function(path) { - path = path !== null ? 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.search() => {foo: 'yipee', baz: 'xoxo'} - * ``` - * - * @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)) { - search = copy(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`. - * - * - * ```js - * // given url http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue - * var hash = $location.hash(); - * // => "hashValue" - * ``` - * - * @param {(string|number)=} hash New hash fragment - * @return {string} hash - */ - hash: locationGetterSetter('$$hash', function(hash) { - return hash !== null ? 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; - } -}; - -forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) { - Location.prototype = Object.create(locationPrototype); - - /** - * @ngdoc method - * @name $location#state - * - * @description - * This method is getter / setter. - * - * Return the history state object when called without any parameter. - * - * Change the history state object when called with one parameter and return `$location`. - * The state object is later passed to `pushState` or `replaceState`. - * - * NOTE: This method is supported only in HTML5 mode and only in browsers supporting - * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support - * older browsers (like IE9 or Android < 4.0), don't use this method. - * - * @param {object=} state State object for pushState or replaceState - * @return {object} state - */ - Location.prototype.state = function(state) { - if (!arguments.length) - return this.$$state; - - if (Location !== LocationHtml5Url || !this.$$html5) { - throw $locationMinErr('nostate', 'History API state support is available only ' + - 'in HTML5 mode and only in browsers supporting HTML5 History API'); - } - // The user might modify `stateObject` after invoking `$location.state(stateObject)` - // but we're changing the $$state reference to $browser.state() during the $digest - // so the modification window is narrow. - this.$$state = isUndefined(state) ? null : state; - - 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 = { - enabled: false, - requireBase: true, - rewriteLinks: true - }; - - /** - * @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|Object)=} mode If boolean, sets `html5Mode.enabled` to value. - * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported - * properties: - * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to - * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not - * support `pushState`. - * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies - * whether or not a tag is required to be present. If `enabled` and `requireBase` are - * true, and a base tag is not present, an error will be thrown when `$location` is injected. - * See the {@link guide/$location $location guide for more information} - * - **rewriteLinks** - `{boolean}` - (default: `true`) When html5Mode is enabled, - * enables/disables url rewriting for relative links. - * - * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter - */ - this.html5Mode = function(mode) { - if (isBoolean(mode)) { - html5Mode.enabled = mode; - return this; - } else if (isObject(mode)) { - - if (isBoolean(mode.enabled)) { - html5Mode.enabled = mode.enabled; - } - - if (isBoolean(mode.requireBase)) { - html5Mode.requireBase = mode.requireBase; - } - - if (isBoolean(mode.rewriteLinks)) { - html5Mode.rewriteLinks = mode.rewriteLinks; - } - - 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#$locationChangeSuccess $locationChangeSuccess} is fired. - * - * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when - * the browser supports the HTML5 History API. - * - * @param {Object} angularEvent Synthetic event object. - * @param {string} newUrl New URL - * @param {string=} oldUrl URL that was before it was changed. - * @param {string=} newState New history state object - * @param {string=} oldState History state object that was before it was changed. - */ - - /** - * @ngdoc event - * @name $location#$locationChangeSuccess - * @eventType broadcast on root scope - * @description - * Broadcasted after a URL was changed. - * - * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when - * the browser supports the HTML5 History API. - * - * @param {Object} angularEvent Synthetic event object. - * @param {string} newUrl New URL - * @param {string=} oldUrl URL that was before it was changed. - * @param {string=} newState New history state object - * @param {string=} oldState History state object that was before it was changed. - */ - - this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window', - function($rootScope, $browser, $sniffer, $rootElement, $window) { - var $location, - LocationMode, - baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to '' - initialUrl = $browser.url(), - appBase; - - if (html5Mode.enabled) { - if (!baseHref && html5Mode.requireBase) { - throw $locationMinErr('nobase', - "$location in HTML5 mode requires a tag to be present!"); - } - appBase = serverBase(initialUrl) + (baseHref || '/'); - LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url; - } else { - appBase = stripHash(initialUrl); - LocationMode = LocationHashbangUrl; - } - var appBaseNoFile = stripFile(appBase); - - $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix); - $location.$$parseLinkUrl(initialUrl, initialUrl); - - $location.$$state = $browser.state(); - - var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i; - - function setBrowserUrlWithFallback(url, replace, state) { - var oldUrl = $location.url(); - var oldState = $location.$$state; - try { - $browser.url(url, replace, state); - - // Make sure $location.state() returns referentially identical (not just deeply equal) - // state object; this makes possible quick checking if the state changed in the digest - // loop. Checking deep equality would be too expensive. - $location.$$state = $browser.state(); - } catch (e) { - // Restore old values if pushState fails - $location.url(oldUrl); - $location.$$state = oldState; - - throw e; - } - } - - $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 (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return; - - var elm = jqLite(event.target); - - // traverse the DOM up to find first A tag - while (nodeName_(elm[0]) !== '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'); - // get the actual href attribute - see - // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx - var relHref = elm.attr('href') || elm.attr('xlink: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; - - if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) { - if ($location.$$parseLinkUrl(absHref, relHref)) { - // We do a preventDefault for all urls that are part of the angular application, - // in html5mode and also without, so that we are able to abort navigation without - // getting double entries in the location history. - event.preventDefault(); - // update location manually - if ($location.absUrl() != $browser.url()) { - $rootScope.$apply(); - // hack to work around FF6 bug 684208 when scenario runner clicks on links - $window.angular['ff-684208-preventDefault'] = true; - } - } - } - }); - - - // rewrite hashbang url <> html5 url - if (trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)) { - $browser.url($location.absUrl(), true); - } - - var initializing = true; - - // update $location when $browser url changes - $browser.onUrlChange(function(newUrl, newState) { - - if (isUndefined(beginsWith(appBaseNoFile, newUrl))) { - // If we are navigating outside of the app then force a reload - $window.location.href = newUrl; - return; - } - - $rootScope.$evalAsync(function() { - var oldUrl = $location.absUrl(); - var oldState = $location.$$state; - var defaultPrevented; - - $location.$$parse(newUrl); - $location.$$state = newState; - - defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, - newState, oldState).defaultPrevented; - - // if the location was changed by a `$locationChangeStart` handler then stop - // processing this location change - if ($location.absUrl() !== newUrl) return; - - if (defaultPrevented) { - $location.$$parse(oldUrl); - $location.$$state = oldState; - setBrowserUrlWithFallback(oldUrl, false, oldState); - } else { - initializing = false; - afterLocationChange(oldUrl, oldState); - } - }); - if (!$rootScope.$$phase) $rootScope.$digest(); - }); - - // update browser - $rootScope.$watch(function $locationWatch() { - var oldUrl = trimEmptyHash($browser.url()); - var newUrl = trimEmptyHash($location.absUrl()); - var oldState = $browser.state(); - var currentReplace = $location.$$replace; - var urlOrStateChanged = oldUrl !== newUrl || - ($location.$$html5 && $sniffer.history && oldState !== $location.$$state); - - if (initializing || urlOrStateChanged) { - initializing = false; - - $rootScope.$evalAsync(function() { - var newUrl = $location.absUrl(); - var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, - $location.$$state, oldState).defaultPrevented; - - // if the location was changed by a `$locationChangeStart` handler then stop - // processing this location change - if ($location.absUrl() !== newUrl) return; - - if (defaultPrevented) { - $location.$$parse(oldUrl); - $location.$$state = oldState; - } else { - if (urlOrStateChanged) { - setBrowserUrlWithFallback(newUrl, currentReplace, - oldState === $location.$$state ? null : $location.$$state); - } - afterLocationChange(oldUrl, oldState); - } - }); - } - - $location.$$replace = false; - - // we don't need to return anything because $evalAsync will make the digest loop dirty when - // there is a change - }); - - return $location; - - function afterLocationChange(oldUrl, oldState) { - $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl, - $location.$$state, oldState); - } -}]; -} - -/** - * @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); - }; - } - }]; -} - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -var $parseMinErr = minErr('$parse'); - -// 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. -// -// See https://docs.angularjs.org/guide/security - - -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 getStringValue(name, fullExpression) { - // From the JavaScript docs: - // Property names must be strings. This means that non-string objects cannot be used - // as keys in an object. Any non-string object, including a number, is typecasted - // into a string via the toString method. - // - // So, to ensure that we are checking the same `name` that JavaScript would use, - // we cast it to a string, if possible. - // Doing `name + ''` can cause a repl error if the result to `toString` is not a string, - // this is, this will handle objects that misbehave. - name = name + ''; - if (!isString(name)) { - throw $parseMinErr('iseccst', - 'Cannot convert object to primitive value! ' - + '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.window === obj) { - 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 || obj === BIND) { - throw $parseMinErr('isecff', - 'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}', - fullExpression); - } - } -} - -//Keyword constants -var CONSTANTS = createMap(); -forEach({ - 'null': function() { return null; }, - 'true': function() { return true; }, - 'false': function() { return false; }, - 'undefined': function() {} -}, function(constantGetter, name) { - constantGetter.constant = constantGetter.literal = constantGetter.sharedGetter = true; - CONSTANTS[name] = constantGetter; -}); - -//Not quite a constant, but can be lex/parsed the same -CONSTANTS['this'] = function(self) { return self; }; -CONSTANTS['this'].sharedGetter = true; - - -//Operators - will be wrapped by binaryFn/unaryFn/assignment/filter -var OPERATORS = extend(createMap(), { - '+':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);}, - '!==':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(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) {return !a(self, locals);}, - - //Tokenized as operators but parsed as assignment/filters - '=':true, - '|':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.tokens = []; - - while (this.index < this.text.length) { - var ch = this.text.charAt(this.index); - if (ch === '"' || ch === "'") { - this.readString(ch); - } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) { - this.readNumber(); - } else if (this.isIdent(ch)) { - this.readIdent(); - } else if (this.is(ch, '(){}[].,;:?')) { - this.tokens.push({index: this.index, text: ch}); - this.index++; - } else if (this.isWhitespace(ch)) { - this.index++; - } else { - var ch2 = ch + this.peek(); - var ch3 = ch2 + this.peek(2); - var op1 = OPERATORS[ch]; - var op2 = OPERATORS[ch2]; - var op3 = OPERATORS[ch3]; - if (op1 || op2 || op3) { - var token = op3 ? ch3 : (op2 ? ch2 : ch); - this.tokens.push({index: this.index, text: token, operator: true}); - this.index += token.length; - } else { - this.throwError('Unexpected next character ', this.index, this.index + 1); - } - } - } - return this.tokens; - }, - - is: function(ch, chars) { - return chars.indexOf(ch) !== -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') && typeof ch === "string"; - }, - - 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++; - } - this.tokens.push({ - index: start, - text: number, - constant: true, - value: Number(number) - }); - }, - - readIdent: function() { - var start = this.index; - while (this.index < this.text.length) { - var ch = this.text.charAt(this.index); - if (!(this.isIdent(ch) || this.isNumber(ch))) { - break; - } - this.index++; - } - this.tokens.push({ - index: start, - text: this.text.slice(start, this.index), - identifier: true - }); - }, - - 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, - constant: true, - value: string - }); - return; - } else { - string += ch; - } - this.index++; - } - this.throwError('Unterminated quote', start); - } -}; - - -function isConstant(exp) { - return exp.constant; -} - -/** - * @constructor - */ -var Parser = function(lexer, $filter, options) { - this.lexer = lexer; - this.$filter = $filter; - this.options = options; -}; - -Parser.ZERO = extend(function() { - return 0; -}, { - sharedGetter: true, - 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 if (this.peek().identifier && this.peek().text in CONSTANTS) { - primary = CONSTANTS[this.consume().text]; - } else if (this.peek().identifier) { - primary = this.identifier(); - } else if (this.peek().constant) { - primary = this.constant(); - } else { - this.throwError('not a primary expression', this.peek()); - } - - 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) { - return this.peekAhead(0, e1, e2, e3, e4); - }, - peekAhead: function(i, e1, e2, e3, e4) { - if (this.tokens.length > i) { - var token = this.tokens[i]; - 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.tokens.length === 0) { - throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); - } - - var token = this.expect(e1); - if (!token) { - this.throwError('is unexpected, expecting [' + e1 + ']', this.peek()); - } - return token; - }, - - unaryFn: function(op, right) { - var fn = OPERATORS[op]; - return extend(function $parseUnaryFn(self, locals) { - return fn(self, locals, right); - }, { - constant:right.constant, - inputs: [right] - }); - }, - - binaryFn: function(left, op, right, isBranching) { - var fn = OPERATORS[op]; - return extend(function $parseBinaryFn(self, locals) { - return fn(self, locals, left, right); - }, { - constant: left.constant && right.constant, - inputs: !isBranching && [left, right] - }); - }, - - identifier: function() { - var id = this.consume().text; - - //Continue reading each `.identifier` unless it is a method invocation - while (this.peek('.') && this.peekAhead(1).identifier && !this.peekAhead(2, '(')) { - id += this.consume().text + this.consume().text; - } - - return getterFn(id, this.options, this.text); - }, - - constant: function() { - var value = this.consume().value; - - return extend(function $parseConstant() { - return value; - }, { - constant: true, - literal: true - }); - }, - - 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 $parseStatements(self, locals) { - var value; - for (var i = 0, ii = statements.length; i < ii; i++) { - value = statements[i](self, locals); - } - return value; - }; - } - } - }, - - filterChain: function() { - var left = this.expression(); - var token; - while ((token = this.expect('|'))) { - left = this.filter(left); - } - return left; - }, - - filter: function(inputFn) { - var fn = this.$filter(this.consume().text); - var argsFn; - var args; - - if (this.peek(':')) { - argsFn = []; - args = []; // we can safely reuse the array - while (this.expect(':')) { - argsFn.push(this.expression()); - } - } - - var inputs = [inputFn].concat(argsFn || []); - - return extend(function $parseFilter(self, locals) { - var input = inputFn(self, locals); - if (args) { - args[0] = input; - - var i = argsFn.length; - while (i--) { - args[i + 1] = argsFn[i](self, locals); - } - - return fn.apply(undefined, args); - } - - return fn(input); - }, { - constant: !fn.$stateful && inputs.every(isConstant), - inputs: !fn.$stateful && inputs - }); - }, - - 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 extend(function $parseAssignment(scope, locals) { - return left.assign(scope, right(scope, locals), locals); - }, { - inputs: [left, right] - }); - } - return left; - }, - - ternary: function() { - var left = this.logicalOR(); - var middle; - var token; - if ((token = this.expect('?'))) { - middle = this.assignment(); - if (this.consume(':')) { - var right = this.assignment(); - - return extend(function $parseTernary(self, locals) { - return left(self, locals) ? middle(self, locals) : right(self, locals); - }, { - constant: left.constant && middle.constant && right.constant - }); - } - } - - return left; - }, - - logicalOR: function() { - var left = this.logicalAND(); - var token; - while ((token = this.expect('||'))) { - left = this.binaryFn(left, token.text, this.logicalAND(), true); - } - return left; - }, - - logicalAND: function() { - var left = this.equality(); - var token; - while ((token = this.expect('&&'))) { - left = this.binaryFn(left, token.text, this.equality(), true); - } - return left; - }, - - equality: function() { - var left = this.relational(); - var token; - while ((token = this.expect('==','!=','===','!=='))) { - left = this.binaryFn(left, token.text, this.relational()); - } - return left; - }, - - relational: function() { - var left = this.additive(); - var token; - while ((token = this.expect('<', '>', '<=', '>='))) { - left = this.binaryFn(left, token.text, this.additive()); - } - return left; - }, - - additive: function() { - var left = this.multiplicative(); - var token; - while ((token = this.expect('+','-'))) { - left = this.binaryFn(left, token.text, this.multiplicative()); - } - return left; - }, - - multiplicative: function() { - var left = this.unary(); - var token; - while ((token = this.expect('*','/','%'))) { - left = this.binaryFn(left, token.text, 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.text, this.unary()); - } else if ((token = this.expect('!'))) { - return this.unaryFn(token.text, this.unary()); - } else { - return this.primary(); - } - }, - - fieldAccess: function(object) { - var getter = this.identifier(); - - return extend(function $parseFieldAccess(scope, locals, self) { - var o = self || object(scope, locals); - return (o == null) ? undefined : getter(o); - }, { - assign: function(scope, value, locals) { - var o = object(scope, locals); - if (!o) object.assign(scope, o = {}, locals); - return getter.assign(o, value); - } - }); - }, - - objectIndex: function(obj) { - var expression = this.text; - - var indexFn = this.expression(); - this.consume(']'); - - return extend(function $parseObjectIndex(self, locals) { - var o = obj(self, locals), - i = getStringValue(indexFn(self, locals), expression), - v; - - ensureSafeMemberName(i, expression); - if (!o) return undefined; - v = ensureSafeObject(o[i], expression); - return v; - }, { - assign: function(self, value, locals) { - var key = ensureSafeMemberName(getStringValue(indexFn(self, locals), expression), expression); - // prevent overwriting of Function.constructor which would break ensureSafeObject check - var o = ensureSafeObject(obj(self, locals), expression); - if (!o) obj.assign(self, o = {}, locals); - return o[key] = value; - } - }); - }, - - functionCall: function(fnGetter, contextGetter) { - var argsFn = []; - if (this.peekToken().text !== ')') { - do { - argsFn.push(this.expression()); - } while (this.expect(',')); - } - this.consume(')'); - - var expressionText = this.text; - // we can safely reuse the array across invocations - var args = argsFn.length ? [] : null; - - return function $parseFunctionCall(scope, locals) { - var context = contextGetter ? contextGetter(scope, locals) : isDefined(contextGetter) ? undefined : scope; - var fn = fnGetter(scope, locals, context) || noop; - - if (args) { - var i = argsFn.length; - while (i--) { - args[i] = ensureSafeObject(argsFn[i](scope, locals), expressionText); - } - } - - ensureSafeObject(context, expressionText); - ensureSafeFunction(fn, expressionText); - - // IE doesn't have apply for some native functions - var v = fn.apply - ? fn.apply(context, args) - : fn(args[0], args[1], args[2], args[3], args[4]); - - if (args) { - // Free-up the memory (arguments of the last function call). - args.length = 0; - } - - return ensureSafeObject(v, expressionText); - }; - }, - - // This is used with json array declaration - arrayDeclaration: function() { - var elementFns = []; - if (this.peekToken().text !== ']') { - do { - if (this.peek(']')) { - // Support trailing commas per ES5.1. - break; - } - elementFns.push(this.expression()); - } while (this.expect(',')); - } - this.consume(']'); - - return extend(function $parseArrayLiteral(self, locals) { - var array = []; - for (var i = 0, ii = elementFns.length; i < ii; i++) { - array.push(elementFns[i](self, locals)); - } - return array; - }, { - literal: true, - constant: elementFns.every(isConstant), - inputs: elementFns - }); - }, - - object: function() { - var keys = [], valueFns = []; - if (this.peekToken().text !== '}') { - do { - if (this.peek('}')) { - // Support trailing commas per ES5.1. - break; - } - var token = this.consume(); - if (token.constant) { - keys.push(token.value); - } else if (token.identifier) { - keys.push(token.text); - } else { - this.throwError("invalid key", token); - } - this.consume(':'); - valueFns.push(this.expression()); - } while (this.expect(',')); - } - this.consume('}'); - - return extend(function $parseObjectLiteral(self, locals) { - var object = {}; - for (var i = 0, ii = valueFns.length; i < ii; i++) { - object[keys[i]] = valueFns[i](self, locals); - } - return object; - }, { - literal: true, - constant: valueFns.every(isConstant), - inputs: valueFns - }); - } -}; - - -////////////////////////////////////////////////// -// Parser helper functions -////////////////////////////////////////////////// - -function setter(obj, locals, path, setValue, fullExp) { - ensureSafeObject(obj, fullExp); - ensureSafeObject(locals, fullExp); - - var element = path.split('.'), key; - for (var i = 0; element.length > 1; i++) { - key = ensureSafeMemberName(element.shift(), fullExp); - var propertyObj = (i === 0 && locals && locals[key]) || obj[key]; - if (!propertyObj) { - propertyObj = {}; - obj[key] = propertyObj; - } - obj = ensureSafeObject(propertyObj, fullExp); - } - key = ensureSafeMemberName(element.shift(), fullExp); - ensureSafeObject(obj[key], fullExp); - obj[key] = setValue; - return setValue; -} - -var getterFnCacheDefault = createMap(); -var getterFnCacheExpensive = createMap(); - -function isPossiblyDangerousMemberName(name) { - return name == 'constructor'; -} - -/** - * 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, expensiveChecks) { - ensureSafeMemberName(key0, fullExp); - ensureSafeMemberName(key1, fullExp); - ensureSafeMemberName(key2, fullExp); - ensureSafeMemberName(key3, fullExp); - ensureSafeMemberName(key4, fullExp); - var eso = function(o) { - return ensureSafeObject(o, fullExp); - }; - var eso0 = (expensiveChecks || isPossiblyDangerousMemberName(key0)) ? eso : identity; - var eso1 = (expensiveChecks || isPossiblyDangerousMemberName(key1)) ? eso : identity; - var eso2 = (expensiveChecks || isPossiblyDangerousMemberName(key2)) ? eso : identity; - var eso3 = (expensiveChecks || isPossiblyDangerousMemberName(key3)) ? eso : identity; - var eso4 = (expensiveChecks || isPossiblyDangerousMemberName(key4)) ? eso : identity; - - return function cspSafeGetter(scope, locals) { - var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope; - - if (pathVal == null) return pathVal; - pathVal = eso0(pathVal[key0]); - - if (!key1) return pathVal; - if (pathVal == null) return undefined; - pathVal = eso1(pathVal[key1]); - - if (!key2) return pathVal; - if (pathVal == null) return undefined; - pathVal = eso2(pathVal[key2]); - - if (!key3) return pathVal; - if (pathVal == null) return undefined; - pathVal = eso3(pathVal[key3]); - - if (!key4) return pathVal; - if (pathVal == null) return undefined; - pathVal = eso4(pathVal[key4]); - - return pathVal; - }; -} - -function getterFnWithEnsureSafeObject(fn, fullExpression) { - return function(s, l) { - return fn(s, l, ensureSafeObject, fullExpression); - }; -} - -function getterFn(path, options, fullExp) { - var expensiveChecks = options.expensiveChecks; - var getterFnCache = (expensiveChecks ? getterFnCacheExpensive : getterFnCacheDefault); - var fn = getterFnCache[path]; - if (fn) return fn; - - - var pathKeys = path.split('.'), - pathKeysLength = pathKeys.length; - - // 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, expensiveChecks); - } else { - fn = function cspSafeGetter(scope, locals) { - var i = 0, val; - do { - val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++], - pathKeys[i++], fullExp, expensiveChecks)(scope, locals); - - locals = undefined; // clear after first iteration - scope = val; - } while (i < pathKeysLength); - return val; - }; - } - } else { - var code = ''; - if (expensiveChecks) { - code += 's = eso(s, fe);\nl = eso(l, fe);\n'; - } - var needsEnsureSafeObject = expensiveChecks; - forEach(pathKeys, function(key, index) { - ensureSafeMemberName(key, fullExp); - var lookupJs = (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 - : '((l&&l.hasOwnProperty("' + key + '"))?l:s)') + '.' + key; - if (expensiveChecks || isPossiblyDangerousMemberName(key)) { - lookupJs = 'eso(' + lookupJs + ', fe)'; - needsEnsureSafeObject = true; - } - code += 'if(s == null) return undefined;\n' + - 's=' + lookupJs + ';\n'; - }); - code += 'return s;'; - - /* jshint -W054 */ - var evaledFnGetter = new Function('s', 'l', 'eso', 'fe', code); // s=scope, l=locals, eso=ensureSafeObject - /* jshint +W054 */ - evaledFnGetter.toString = valueFn(code); - if (needsEnsureSafeObject) { - evaledFnGetter = getterFnWithEnsureSafeObject(evaledFnGetter, fullExp); - } - fn = evaledFnGetter; - } - - fn.sharedGetter = true; - fn.assign = function(self, value, locals) { - return setter(self, locals, path, value, path); - }; - getterFnCache[path] = fn; - return fn; -} - -var objectValueOf = Object.prototype.valueOf; - -function getValueOf(value) { - return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value); -} - -/////////////////////////////////// - -/** - * @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 - * - * @description - * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse} - * service. - */ -function $ParseProvider() { - var cacheDefault = createMap(); - var cacheExpensive = createMap(); - - - - this.$get = ['$filter', '$sniffer', function($filter, $sniffer) { - var $parseOptions = { - csp: $sniffer.csp, - expensiveChecks: false - }, - $parseOptionsExpensive = { - csp: $sniffer.csp, - expensiveChecks: true - }; - - function wrapSharedExpression(exp) { - var wrapped = exp; - - if (exp.sharedGetter) { - wrapped = function $parseWrapper(self, locals) { - return exp(self, locals); - }; - wrapped.literal = exp.literal; - wrapped.constant = exp.constant; - wrapped.assign = exp.assign; - } - - return wrapped; - } - - return function $parse(exp, interceptorFn, expensiveChecks) { - var parsedExpression, oneTime, cacheKey; - - switch (typeof exp) { - case 'string': - cacheKey = exp = exp.trim(); - - var cache = (expensiveChecks ? cacheExpensive : cacheDefault); - parsedExpression = cache[cacheKey]; - - if (!parsedExpression) { - if (exp.charAt(0) === ':' && exp.charAt(1) === ':') { - oneTime = true; - exp = exp.substring(2); - } - - var parseOptions = expensiveChecks ? $parseOptionsExpensive : $parseOptions; - var lexer = new Lexer(parseOptions); - var parser = new Parser(lexer, $filter, parseOptions); - parsedExpression = parser.parse(exp); - - if (parsedExpression.constant) { - parsedExpression.$$watchDelegate = constantWatchDelegate; - } else if (oneTime) { - //oneTime is not part of the exp passed to the Parser so we may have to - //wrap the parsedExpression before adding a $$watchDelegate - parsedExpression = wrapSharedExpression(parsedExpression); - parsedExpression.$$watchDelegate = parsedExpression.literal ? - oneTimeLiteralWatchDelegate : oneTimeWatchDelegate; - } else if (parsedExpression.inputs) { - parsedExpression.$$watchDelegate = inputsWatchDelegate; - } - - cache[cacheKey] = parsedExpression; - } - return addInterceptor(parsedExpression, interceptorFn); - - case 'function': - return addInterceptor(exp, interceptorFn); - - default: - return addInterceptor(noop, interceptorFn); - } - }; - - function collectExpressionInputs(inputs, list) { - for (var i = 0, ii = inputs.length; i < ii; i++) { - var input = inputs[i]; - if (!input.constant) { - if (input.inputs) { - collectExpressionInputs(input.inputs, list); - } else if (list.indexOf(input) === -1) { // TODO(perf) can we do better? - list.push(input); - } - } - } - - return list; - } - - function expressionInputDirtyCheck(newValue, oldValueOfValue) { - - if (newValue == null || oldValueOfValue == null) { // null/undefined - return newValue === oldValueOfValue; - } - - if (typeof newValue === 'object') { - - // attempt to convert the value to a primitive type - // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can - // be cheaply dirty-checked - newValue = getValueOf(newValue); - - if (typeof newValue === 'object') { - // objects/arrays are not supported - deep-watching them would be too expensive - return false; - } - - // fall-through to the primitive equality check - } - - //Primitive or NaN - return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue); - } - - function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var inputExpressions = parsedExpression.$$inputs || - (parsedExpression.$$inputs = collectExpressionInputs(parsedExpression.inputs, [])); - - var lastResult; - - if (inputExpressions.length === 1) { - var oldInputValue = expressionInputDirtyCheck; // init to something unique so that equals check fails - inputExpressions = inputExpressions[0]; - return scope.$watch(function expressionInputWatch(scope) { - var newInputValue = inputExpressions(scope); - if (!expressionInputDirtyCheck(newInputValue, oldInputValue)) { - lastResult = parsedExpression(scope); - oldInputValue = newInputValue && getValueOf(newInputValue); - } - return lastResult; - }, listener, objectEquality); - } - - var oldInputValueOfValues = []; - for (var i = 0, ii = inputExpressions.length; i < ii; i++) { - oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails - } - - return scope.$watch(function expressionInputsWatch(scope) { - var changed = false; - - for (var i = 0, ii = inputExpressions.length; i < ii; i++) { - var newInputValue = inputExpressions[i](scope); - if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) { - oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue); - } - } - - if (changed) { - lastResult = parsedExpression(scope); - } - - return lastResult; - }, listener, objectEquality); - } - - function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var unwatch, lastValue; - return unwatch = scope.$watch(function oneTimeWatch(scope) { - return parsedExpression(scope); - }, function oneTimeListener(value, old, scope) { - lastValue = value; - if (isFunction(listener)) { - listener.apply(this, arguments); - } - if (isDefined(value)) { - scope.$$postDigest(function() { - if (isDefined(lastValue)) { - unwatch(); - } - }); - } - }, objectEquality); - } - - function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var unwatch, lastValue; - return unwatch = scope.$watch(function oneTimeWatch(scope) { - return parsedExpression(scope); - }, function oneTimeListener(value, old, scope) { - lastValue = value; - if (isFunction(listener)) { - listener.call(this, value, old, scope); - } - if (isAllDefined(value)) { - scope.$$postDigest(function() { - if (isAllDefined(lastValue)) unwatch(); - }); - } - }, objectEquality); - - function isAllDefined(value) { - var allDefined = true; - forEach(value, function(val) { - if (!isDefined(val)) allDefined = false; - }); - return allDefined; - } - } - - function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var unwatch; - return unwatch = scope.$watch(function constantWatch(scope) { - return parsedExpression(scope); - }, function constantListener(value, old, scope) { - if (isFunction(listener)) { - listener.apply(this, arguments); - } - unwatch(); - }, objectEquality); - } - - function addInterceptor(parsedExpression, interceptorFn) { - if (!interceptorFn) return parsedExpression; - var watchDelegate = parsedExpression.$$watchDelegate; - - var regularWatch = - watchDelegate !== oneTimeLiteralWatchDelegate && - watchDelegate !== oneTimeWatchDelegate; - - var fn = regularWatch ? function regularInterceptedExpression(scope, locals) { - var value = parsedExpression(scope, locals); - return interceptorFn(value, scope, locals); - } : function oneTimeInterceptedExpression(scope, locals) { - var value = parsedExpression(scope, locals); - var result = interceptorFn(value, scope, locals); - // we only return the interceptor's result if the - // initial value is defined (for bind-once) - return isDefined(value) ? result : value; - }; - - // Propagate $$watchDelegates other then inputsWatchDelegate - if (parsedExpression.$$watchDelegate && - parsedExpression.$$watchDelegate !== inputsWatchDelegate) { - fn.$$watchDelegate = parsedExpression.$$watchDelegate; - } else if (!interceptorFn.$stateful) { - // If there is an interceptor, but no watchDelegate then treat the interceptor like - // we treat filters - it is assumed to be a pure function unless flagged with $stateful - fn.$$watchDelegate = inputsWatchDelegate; - fn.inputs = [parsedExpression]; - } - - return fn; - } - }]; -} - -/** - * @ngdoc service - * @name $q - * @requires $rootScope - * - * @description - * A service that helps you run functions asynchronously, and use their return values (or exceptions) - * when they are done processing. - * - * This is an implementation of promises/deferred objects inspired by - * [Kris Kowal's Q](https://github.com/kriskowal/q). - * - * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred - * implementations, and the other which resembles ES6 promises to some degree. - * - * # $q constructor - * - * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver` - * function as the first argument. This is similar to the native Promise implementation from ES6 Harmony, - * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * While the constructor-style use is supported, not all of the supporting methods from ES6 Harmony promises are - * available yet. - * - * It can be used like so: - * - * ```js - * // for the purpose of this example let's assume that variables `$q` and `okToGreet` - * // are available in the current lexical scope (they could have been injected or passed in). - * - * function asyncGreet(name) { - * // perform some asynchronous operation, resolve or reject the promise when appropriate. - * return $q(function(resolve, reject) { - * setTimeout(function() { - * if (okToGreet(name)) { - * resolve('Hello, ' + name + '!'); - * } else { - * reject('Greeting ' + name + ' is not allowed.'); - * } - * }, 1000); - * }); - * } - * - * var promise = asyncGreet('Robin Hood'); - * promise.then(function(greeting) { - * alert('Success: ' + greeting); - * }, function(reason) { - * alert('Failed: ' + reason); - * }); - * ``` - * - * Note: progress/notify callbacks are not currently supported via the ES6-style interface. - * - * However, the more traditional CommonJS-style usage is still available, and documented below. - * - * [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` 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 cannot be resolved or rejected from the notifyCallback - * method. - * - * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)` - * - * - `finally(callback, notifyCallback)` – 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. - * - * # 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); - * })); - * ``` - * - * @param {function(function, function)} resolver Function which is responsible for resolving or - * rejecting the newly created promise. The first parameter is a function which resolves the - * promise, the second parameter is a function which rejects the promise. - * - * @returns {Promise} The newly created promise. - */ -function $QProvider() { - - this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) { - return qFactory(function(callback) { - $rootScope.$evalAsync(callback); - }, $exceptionHandler); - }]; -} - -function $$QProvider() { - this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) { - return qFactory(function(callback) { - $browser.defer(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) { - var $qMinErr = minErr('$q', TypeError); - function callOnce(self, resolveFn, rejectFn) { - var called = false; - function wrap(fn) { - return function(value) { - if (called) return; - called = true; - fn.call(self, value); - }; - } - - return [wrap(resolveFn), wrap(rejectFn)]; - } - - /** - * @ngdoc method - * @name ng.$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() { - return new Deferred(); - }; - - function Promise() { - this.$$state = { status: 0 }; - } - - Promise.prototype = { - then: function(onFulfilled, onRejected, progressBack) { - var result = new Deferred(); - - this.$$state.pending = this.$$state.pending || []; - this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]); - if (this.$$state.status > 0) scheduleProcessQueue(this.$$state); - - return result.promise; - }, - - "catch": function(callback) { - return this.then(null, callback); - }, - - "finally": function(callback, progressBack) { - return this.then(function(value) { - return handleCallback(value, true, callback); - }, function(error) { - return handleCallback(error, false, callback); - }, progressBack); - } - }; - - //Faster, more basic than angular.bind http://jsperf.com/angular-bind-vs-custom-vs-native - function simpleBind(context, fn) { - return function(value) { - fn.call(context, value); - }; - } - - function processQueue(state) { - var fn, promise, pending; - - pending = state.pending; - state.processScheduled = false; - state.pending = undefined; - for (var i = 0, ii = pending.length; i < ii; ++i) { - promise = pending[i][0]; - fn = pending[i][state.status]; - try { - if (isFunction(fn)) { - promise.resolve(fn(state.value)); - } else if (state.status === 1) { - promise.resolve(state.value); - } else { - promise.reject(state.value); - } - } catch (e) { - promise.reject(e); - exceptionHandler(e); - } - } - } - - function scheduleProcessQueue(state) { - if (state.processScheduled || !state.pending) return; - state.processScheduled = true; - nextTick(function() { processQueue(state); }); - } - - function Deferred() { - this.promise = new Promise(); - //Necessary to support unbound execution :/ - this.resolve = simpleBind(this, this.resolve); - this.reject = simpleBind(this, this.reject); - this.notify = simpleBind(this, this.notify); - } - - Deferred.prototype = { - resolve: function(val) { - if (this.promise.$$state.status) return; - if (val === this.promise) { - this.$$reject($qMinErr( - 'qcycle', - "Expected promise to be resolved with value other than itself '{0}'", - val)); - } else { - this.$$resolve(val); - } - - }, - - $$resolve: function(val) { - var then, fns; - - fns = callOnce(this, this.$$resolve, this.$$reject); - try { - if ((isObject(val) || isFunction(val))) then = val && val.then; - if (isFunction(then)) { - this.promise.$$state.status = -1; - then.call(val, fns[0], fns[1], this.notify); - } else { - this.promise.$$state.value = val; - this.promise.$$state.status = 1; - scheduleProcessQueue(this.promise.$$state); - } - } catch (e) { - fns[1](e); - exceptionHandler(e); - } - }, - - reject: function(reason) { - if (this.promise.$$state.status) return; - this.$$reject(reason); - }, - - $$reject: function(reason) { - this.promise.$$state.value = reason; - this.promise.$$state.status = 2; - scheduleProcessQueue(this.promise.$$state); - }, - - notify: function(progress) { - var callbacks = this.promise.$$state.pending; - - if ((this.promise.$$state.status <= 0) && callbacks && callbacks.length) { - nextTick(function() { - var callback, result; - for (var i = 0, ii = callbacks.length; i < ii; i++) { - result = callbacks[i][0]; - callback = callbacks[i][3]; - try { - result.notify(isFunction(callback) ? callback(progress) : progress); - } catch (e) { - exceptionHandler(e); - } - } - }); - } - } - }; - - /** - * @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 = new Deferred(); - result.reject(reason); - return result.promise; - }; - - var makePromise = function makePromise(value, resolved) { - var result = new Deferred(); - if (resolved) { - result.resolve(value); - } else { - result.reject(value); - } - return result.promise; - }; - - var handleCallback = function handleCallback(value, isResolved, callback) { - var callbackOutput = null; - try { - if (isFunction(callback)) callbackOutput = callback(); - } 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); - } - }; - - /** - * @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 = new Deferred(); - result.resolve(value); - return result.promise.then(callback, errback, progressBack); - }; - - /** - * @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 = new Deferred(), - counter = 0, - results = isArray(promises) ? [] : {}; - - forEach(promises, function(promise, key) { - counter++; - when(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; - } - - var $Q = function Q(resolver) { - if (!isFunction(resolver)) { - throw $qMinErr('norslvr', "Expected resolverFn, got '{0}'", resolver); - } - - if (!(this instanceof Q)) { - // More useful when $Q is the Promise itself. - return new Q(resolver); - } - - var deferred = new Deferred(); - - function resolveFn(value) { - deferred.resolve(value); - } - - function rejectFn(reason) { - deferred.reject(reason); - } - - resolver(resolveFn, rejectFn); - - return deferred.promise; - }; - - $Q.defer = defer; - $Q.reject = reject; - $Q.when = when; - $Q.all = all; - - return $Q; -} - -function $$RAFProvider() { //rAF - this.$get = ['$window', '$timeout', function($window, $timeout) { - var requestAnimationFrame = $window.requestAnimationFrame || - $window.webkitRequestAnimationFrame; - - var cancelAnimationFrame = $window.cancelAnimationFrame || - $window.webkitCancelAnimationFrame || - $window.webkitCancelRequestAnimationFrame; - - var rafSupported = !!requestAnimationFrame; - var rafFn = 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); - }; - }; - - queueFn.supported = rafSupported; - - var cancelLastRAF; - var taskCount = 0; - var taskQueue = []; - return queueFn; - - function flush() { - for (var i = 0; i < taskQueue.length; i++) { - var task = taskQueue[i]; - if (task) { - taskQueue[i] = null; - task(); - } - } - taskCount = taskQueue.length = 0; - } - - function queueFn(asyncFn) { - var index = taskQueue.length; - - taskCount++; - taskQueue.push(asyncFn); - - if (index === 0) { - cancelLastRAF = rafFn(flush); - } - - return function cancelQueueFn() { - if (index >= 0) { - taskQueue[index] = null; - index = null; - - if (--taskCount === 0 && cancelLastRAF) { - cancelLastRAF(); - cancelLastRAF = null; - taskQueue.length = 0; - } - } - }; - } - }]; -} - -/** - * 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; - var applyAsyncId = null; - - this.digestTtl = function(value) { - if (arguments.length) { - TTL = value; - } - return TTL; - }; - - function createChildScopeClass(parent) { - function ChildScope() { - this.$$watchers = this.$$nextSibling = - this.$$childHead = this.$$childTail = null; - this.$$listeners = {}; - this.$$listenerCount = {}; - this.$id = nextUid(); - this.$$ChildScope = null; - } - ChildScope.prototype = parent; - return ChildScope; - } - - this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser', - function($injector, $exceptionHandler, $parse, $browser) { - - function destroyChildScope($event) { - $event.currentScope.$$destroyed = true; - } - - /** - * @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.) See also the {@link guide/scope Scopes guide} for - * an in-depth introduction and usage examples. - * - * - * # Inheritance - * A scope can inherit from a parent scope, as in this example: - * ```js - var parent = $rootScope; - var child = parent.$new(); - - parent.salutation = "Hello"; - expect(child.salutation).toEqual('Hello'); - - child.salutation = "Welcome"; - expect(child.salutation).toEqual('Welcome'); - expect(parent.salutation).toEqual('Hello'); - * ``` - * - * When interacting with `Scope` in tests, additional helper methods are available on the - * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional - * details. - * - * - * @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.$root = this; - this.$$destroyed = false; - this.$$listeners = {}; - this.$$listenerCount = {}; - this.$$isolateBindings = null; - } - - /** - * @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. - * - * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent` - * of the newly created scope. Defaults to `this` scope if not provided. - * This is used when creating a transclude scope to correctly place it - * in the scope hierarchy while maintaining the correct prototypical - * inheritance. - * - * @returns {Object} The newly created child scope. - * - */ - $new: function(isolate, parent) { - var child; - - parent = parent || this; - - if (isolate) { - child = new Scope(); - child.$root = this.$root; - } else { - // Only create a child scope class if somebody asks for one, - // but cache it to allow the VM to optimize lookups. - if (!this.$$ChildScope) { - this.$$ChildScope = createChildScopeClass(this); - } - child = new this.$$ChildScope(); - } - child.$parent = parent; - child.$$prevSibling = parent.$$childTail; - if (parent.$$childHead) { - parent.$$childTail.$$nextSibling = child; - parent.$$childTail = child; - } else { - parent.$$childHead = parent.$$childTail = child; - } - - // When the new scope is not isolated or we inherit from `this`, and - // the parent scope is destroyed, the property `$$destroyed` is inherited - // prototypically. In all other cases, this property needs to be set - // when the parent scope is destroyed. - // The listener needs to be added after the parent is set - if (isolate || parent != this) child.$on('$destroy', destroyChildScope); - - 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`. (Be prepared for - * multiple calls to your `watchExpression` because it will execute multiple times in a - * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.) - * - * 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. - * - * - * - * # 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 function as a watchExpression - var food; - scope.foodCounter = 0; - expect(scope.foodCounter).toEqual(0); - scope.$watch( - // This function returns the value being watched. It is called for each turn of the $digest loop - function() { return food; }, - // This is the change listener, called when the value returned from the above function changes - 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(newVal, oldVal, scope)} listener Callback called whenever the value - * of `watchExpression` changes. - * - * - `newVal` contains the current value of the `watchExpression` - * - `oldVal` contains the previous value of the `watchExpression` - * - `scope` refers to the current scope - * @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 get = $parse(watchExp); - - if (get.$$watchDelegate) { - return get.$$watchDelegate(this, listener, objectEquality, get); - } - var scope = this, - array = scope.$$watchers, - watcher = { - fn: listener, - last: initWatchVal, - get: get, - exp: watchExp, - eq: !!objectEquality - }; - - lastDirtyWatch = null; - - if (!isFunction(listener)) { - watcher.fn = noop; - } - - 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#$watchGroup - * @kind function - * - * @description - * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`. - * If any one expression in the collection changes the `listener` is executed. - * - * - The items in the `watchExpressions` array are observed via standard $watch operation and are examined on every - * call to $digest() to see if any items changes. - * - The `listener` is called whenever any expression in the `watchExpressions` array changes. - * - * @param {Array.} watchExpressions Array of expressions that will be individually - * watched using {@link ng.$rootScope.Scope#$watch $watch()} - * - * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any - * expression in `watchExpressions` changes - * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching - * those of `watchExpression` - * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching - * those of `watchExpression` - * The `scope` refers to the current scope. - * @returns {function()} Returns a de-registration function for all listeners. - */ - $watchGroup: function(watchExpressions, listener) { - var oldValues = new Array(watchExpressions.length); - var newValues = new Array(watchExpressions.length); - var deregisterFns = []; - var self = this; - var changeReactionScheduled = false; - var firstRun = true; - - if (!watchExpressions.length) { - // No expressions means we call the listener ASAP - var shouldCall = true; - self.$evalAsync(function() { - if (shouldCall) listener(newValues, newValues, self); - }); - return function deregisterWatchGroup() { - shouldCall = false; - }; - } - - if (watchExpressions.length === 1) { - // Special case size of one - return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) { - newValues[0] = value; - oldValues[0] = oldValue; - listener(newValues, (value === oldValue) ? newValues : oldValues, scope); - }); - } - - forEach(watchExpressions, function(expr, i) { - var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) { - newValues[i] = value; - oldValues[i] = oldValue; - if (!changeReactionScheduled) { - changeReactionScheduled = true; - self.$evalAsync(watchGroupAction); - } - }); - deregisterFns.push(unwatchFn); - }); - - function watchGroupAction() { - changeReactionScheduled = false; - - if (firstRun) { - firstRun = false; - listener(newValues, newValues, self); - } else { - listener(newValues, oldValues, self); - } - } - - return function deregisterWatchGroup() { - while (deregisterFns.length) { - deregisterFns.shift()(); - } - }; - }, - - - /** - * @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) { - $watchCollectionInterceptor.$stateful = true; - - 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 changeDetector = $parse(obj, $watchCollectionInterceptor); - var internalArray = []; - var internalObject = {}; - var initRun = true; - var oldLength = 0; - - function $watchCollectionInterceptor(_value) { - newValue = _value; - var newLength, key, bothNaN, newItem, oldItem; - - // If the new value is undefined, then return undefined as the watch may be a one-time watch - if (isUndefined(newValue)) return; - - 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++) { - oldItem = oldValue[i]; - newItem = newValue[i]; - - bothNaN = (oldItem !== oldItem) && (newItem !== newItem); - if (!bothNaN && (oldItem !== newItem)) { - changeDetected++; - oldValue[i] = newItem; - } - } - } 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++; - newItem = newValue[key]; - oldItem = oldValue[key]; - - if (key in oldValue) { - bothNaN = (oldItem !== oldItem) && (newItem !== newItem); - if (!bothNaN && (oldItem !== newItem)) { - changeDetected++; - oldValue[key] = newItem; - } - } else { - oldLength++; - oldValue[key] = newItem; - changeDetected++; - } - } - } - if (oldLength > newLength) { - // we used to have more keys, need to find them and destroy them. - changeDetected++; - for (key in oldValue) { - if (!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(changeDetector, $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 directive}), 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, - 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(); - - if (this === $rootScope && applyAsyncId !== null) { - // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then - // cancel the scheduled $apply and flush the queue of expressions to be evaluated. - $browser.defer.cancel(applyAsyncId); - flushApplyAsync(); - } - - lastDirtyWatch = null; - - do { // "while dirty" loop - dirty = false; - current = target; - - while (asyncQueue.length) { - try { - asyncTask = asyncQueue.shift(); - asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals); - } catch (e) { - $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] = []; - watchLog[logIdx].push({ - msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp, - newVal: value, - oldVal: last - }); - } - } 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) { - $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, 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; - - for (var eventName in this.$$listenerCount) { - decrementListenerCount(this, this.$$listenerCount[eventName], eventName); - } - - // 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; - - // Disable listeners, watchers and apply/digest methods - this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop; - this.$on = this.$watch = this.$watchGroup = function() { return noop; }; - this.$$listeners = {}; - - // 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 = this.$$watchers = null; - }, - - /** - * @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. - * - * @param {(object)=} locals Local variables object, useful for overriding values in scope. - */ - $evalAsync: function(expr, locals) { - // 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 && !asyncQueue.length) { - $browser.defer(function() { - if (asyncQueue.length) { - $rootScope.$digest(); - } - }); - } - - asyncQueue.push({scope: this, expression: expr, locals: locals}); - }, - - $$postDigest: function(fn) { - 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#$applyAsync - * @kind function - * - * @description - * Schedule the invocation of $apply to occur at a later time. The actual time difference - * varies across browsers, but is typically around ~10 milliseconds. - * - * This can be used to queue up multiple expressions which need to be evaluated in the same - * digest. - * - * @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. - */ - $applyAsync: function(expr) { - var scope = this; - expr && applyAsyncQueue.push($applyAsyncExpression); - scheduleApplyAsync(); - - function $applyAsyncExpression() { - scope.$eval(expr); - } - }, - - /** - * @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 scope that is currently handling the event. Once the - * event propagates through the scope hierarchy, this property is set to null. - * - `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() { - var indexOfListener = namedListeners.indexOf(listener); - if (indexOfListener !== -1) { - namedListeners[indexOfListener] = 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 < length; i++) { - - // if listeners were deregistered, defragment the array - if (!namedListeners[i]) { - namedListeners.splice(i, 1); - i--; - length--; - continue; - } - try { - //allow all listeners attached to the current scope to run - namedListeners[i].apply(null, listenerArgs); - } catch (e) { - $exceptionHandler(e); - } - } - //if any listener on the current scope stops propagation, prevent bubbling - if (stopPropagation) { - event.currentScope = null; - return event; - } - //traverse upwards - scope = scope.$parent; - } while (scope); - - event.currentScope = null; - - return event; - }, - - - /** - * @ngdoc method - * @name $rootScope.Scope#$broadcast - * @kind function - * - * @description - * Dispatches an event `name` downwards to all child scopes (and their children) notifying the - * registered {@link ng.$rootScope.Scope#$on} listeners. - * - * The event life cycle starts at the scope on which `$broadcast` was called. All - * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get - * notified. Afterwards, the event propagates to all direct and indirect scopes of the current - * scope and calls all registered listeners along the way. The event cannot be canceled. - * - * 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 broadcast. - * @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} - */ - $broadcast: function(name, args) { - var target = this, - current = target, - next = target, - event = { - name: name, - targetScope: target, - preventDefault: function() { - event.defaultPrevented = true; - }, - defaultPrevented: false - }; - - if (!target.$$listenerCount[name]) return event; - - var listenerArgs = concat([event], arguments, 1), - listeners, i, length; - - //down while you can, then up and next sibling or up and next sibling until back at root - while ((current = next)) { - event.currentScope = current; - listeners = current.$$listeners[name] || []; - for (i = 0, length = listeners.length; i < length; i++) { - // if listeners were deregistered, defragment the array - if (!listeners[i]) { - listeners.splice(i, 1); - i--; - length--; - continue; - } - - try { - listeners[i].apply(null, listenerArgs); - } catch (e) { - $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 $digest - // (though it differs due to having the extra check for $$listenerCount) - if (!(next = ((current.$$listenerCount[name] && current.$$childHead) || - (current !== target && current.$$nextSibling)))) { - while (current !== target && !(next = current.$$nextSibling)) { - current = current.$parent; - } - } - } - - event.currentScope = null; - return event; - } - }; - - var $rootScope = new Scope(); - - //The internal queues. Expose them on the $rootScope for debugging/testing purposes. - var asyncQueue = $rootScope.$$asyncQueue = []; - var postDigestQueue = $rootScope.$$postDigestQueue = []; - var applyAsyncQueue = $rootScope.$$applyAsyncQueue = []; - - return $rootScope; - - - function beginPhase(phase) { - if ($rootScope.$$phase) { - throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase); - } - - $rootScope.$$phase = phase; - } - - function clearPhase() { - $rootScope.$$phase = null; - } - - - function decrementListenerCount(current, count, name) { - do { - current.$$listenerCount[name] -= count; - - if (current.$$listenerCount[name] === 0) { - delete current.$$listenerCount[name]; - } - } while ((current = current.$parent)); - } - - /** - * function used as an initial value for watchers. - * because it's unique we can easily tell it apart from other values - */ - function initWatchVal() {} - - function flushApplyAsync() { - while (applyAsyncQueue.length) { - try { - applyAsyncQueue.shift()(); - } catch (e) { - $exceptionHandler(e); - } - } - applyAsyncId = null; - } - - function scheduleApplyAsync() { - if (applyAsyncId === null) { - applyAsyncId = $browser.defer(function() { - $rootScope.$apply(flushApplyAsync); - }); - } - } - }]; -} - -/** - * @description - * Private service to sanitize uris for links and images. Used by $compile and $sanitize. - */ -function $$SanitizeUriProvider() { - var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/, - imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/; - - /** - * @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)) { - aHrefSanitizationWhitelist = regexp; - return this; - } - return aHrefSanitizationWhitelist; - }; - - - /** - * @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)) { - imgSrcSanitizationWhitelist = regexp; - return this; - } - return imgSrcSanitizationWhitelist; - }; - - this.$get = function() { - return function sanitizeUri(uri, isImage) { - var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; - var normalizedVal; - normalizedVal = urlResolve(uri).href; - if (normalizedVal !== '' && !normalizedVal.match(regex)) { - return 'unsafe:' + normalizedVal; - } - return uri; - }; - }; -} - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -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. - -function adjustMatcher(matcher) { - if (matcher === 'self') { - return matcher; - } else if (isString(matcher)) { - // Strings match exactly except for 2 wildcards - '*' and '**'. - // '*' matches any character except those from the set ':/.?&'. - // '**' matches any character (like .* in a RegExp). - // More than 2 *'s raises an error as it's ill defined. - if (matcher.indexOf('***') > -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), IE<11 in quirks mode is not supported. In this mode, IE<11 allow - * 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#parseAs $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 - * - * 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 - * appropriate for use in 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 - * 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}}: - * - *
      - *
      - *
      - *
      - *
      - * - * - * angular.module('mySceApp', ['ngSanitize']) - * .controller('AppController', ['$http', '$templateCache', '$sce', - * function($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', '$sceDelegate', function( - $parse, $sceDelegate) { - // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow - // the "expression(javascript expression)" syntax which is insecure. - if (enabled && msie < 8) { - throw $sceMinErr('iequirks', - 'Strict Contextual Escaping does not support Internet Explorer version < 11 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 $parse(expr, function(value) { - return sce.getTrusted(type, value); - }); - } - }; - - /** - * @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#parseAs `$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#parseAs `$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#parseAs `$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#parseAs `$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#parseAs `$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} 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] || {}, - vendorPrefix, - vendorRegex = /^(Moz|webkit|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 - 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. - // IE10+ implements 'input' event but it erroneously fires under various situations, - // e.g. when placeholder changes, or a form is focused. - if (event === 'input' && msie <= 11) 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 - }; - }]; -} - -var $compileMinErr = minErr('$compile'); - -/** - * @ngdoc service - * @name $templateRequest - * - * @description - * The `$templateRequest` service runs security checks then downloads the provided template using - * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request - * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the - * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the - * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted - * when `tpl` is of type string and `$templateCache` has the matching entry. - * - * @param {string|TrustedResourceUrl} tpl The HTTP request template URL - * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty - * - * @return {Promise} the HTTP Promise for the given. - * - * @property {number} totalPendingRequests total amount of pending template requests being downloaded. - */ -function $TemplateRequestProvider() { - this.$get = ['$templateCache', '$http', '$q', '$sce', function($templateCache, $http, $q, $sce) { - function handleRequestFn(tpl, ignoreRequestError) { - handleRequestFn.totalPendingRequests++; - - // We consider the template cache holds only trusted templates, so - // there's no need to go through whitelisting again for keys that already - // are included in there. This also makes Angular accept any script - // directive, no matter its name. However, we still need to unwrap trusted - // types. - if (!isString(tpl) || !$templateCache.get(tpl)) { - tpl = $sce.getTrustedResourceUrl(tpl); - } - - var transformResponse = $http.defaults && $http.defaults.transformResponse; - - if (isArray(transformResponse)) { - transformResponse = transformResponse.filter(function(transformer) { - return transformer !== defaultHttpResponseTransform; - }); - } else if (transformResponse === defaultHttpResponseTransform) { - transformResponse = null; - } - - var httpOptions = { - cache: $templateCache, - transformResponse: transformResponse - }; - - return $http.get(tpl, httpOptions) - ['finally'](function() { - handleRequestFn.totalPendingRequests--; - }) - .then(function(response) { - return response.data; - }, handleError); - - function handleError(resp) { - if (!ignoreRequestError) { - throw $compileMinErr('tpload', 'Failed to load template: {0}', tpl); - } - return $q.reject(resp); - } - } - - handleRequestFn.totalPendingRequests = 0; - - return handleRequestFn; - }]; -} - -function $$TestabilityProvider() { - this.$get = ['$rootScope', '$browser', '$location', - function($rootScope, $browser, $location) { - - /** - * @name $testability - * - * @description - * The private $$testability service provides a collection of methods for use when debugging - * or by automated test and debugging tools. - */ - var testability = {}; - - /** - * @name $$testability#findBindings - * - * @description - * Returns an array of elements that are bound (via ng-bind or {{}}) - * to expressions matching the input. - * - * @param {Element} element The element root to search from. - * @param {string} expression The binding expression to match. - * @param {boolean} opt_exactMatch If true, only returns exact matches - * for the expression. Filters and whitespace are ignored. - */ - testability.findBindings = function(element, expression, opt_exactMatch) { - var bindings = element.getElementsByClassName('ng-binding'); - var matches = []; - forEach(bindings, function(binding) { - var dataBinding = angular.element(binding).data('$binding'); - if (dataBinding) { - forEach(dataBinding, function(bindingName) { - if (opt_exactMatch) { - var matcher = new RegExp('(^|\\s)' + escapeForRegexp(expression) + '(\\s|\\||$)'); - if (matcher.test(bindingName)) { - matches.push(binding); - } - } else { - if (bindingName.indexOf(expression) != -1) { - matches.push(binding); - } - } - }); - } - }); - return matches; - }; - - /** - * @name $$testability#findModels - * - * @description - * Returns an array of elements that are two-way found via ng-model to - * expressions matching the input. - * - * @param {Element} element The element root to search from. - * @param {string} expression The model expression to match. - * @param {boolean} opt_exactMatch If true, only returns exact matches - * for the expression. - */ - testability.findModels = function(element, expression, opt_exactMatch) { - var prefixes = ['ng-', 'data-ng-', 'ng\\:']; - for (var p = 0; p < prefixes.length; ++p) { - var attributeEquals = opt_exactMatch ? '=' : '*='; - var selector = '[' + prefixes[p] + 'model' + attributeEquals + '"' + expression + '"]'; - var elements = element.querySelectorAll(selector); - if (elements.length) { - return elements; - } - } - }; - - /** - * @name $$testability#getLocation - * - * @description - * Shortcut for getting the location in a browser agnostic way. Returns - * the path, search, and hash. (e.g. /path?a=b#hash) - */ - testability.getLocation = function() { - return $location.url(); - }; - - /** - * @name $$testability#setLocation - * - * @description - * Shortcut for navigating to a location without doing a full page reload. - * - * @param {string} url The location url (path, search and hash, - * e.g. /path?a=b#hash) to go to. - */ - testability.setLocation = function(url) { - if (url !== $location.url()) { - $location.url(url); - $rootScope.$digest(); - } - }; - - /** - * @name $$testability#whenStable - * - * @description - * Calls the callback when $timeout and $http requests are completed. - * - * @param {function} callback - */ - testability.whenStable = function(callback) { - $browser.notifyWhenNoOutstandingRequests(callback); - }; - - return testability; - }]; -} - -function $TimeoutProvider() { - this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler', - function($rootScope, $browser, $q, $$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 skipApply = (isDefined(invokeApply) && !invokeApply), - deferred = (skipApply ? $$q : $q).defer(), - promise = deferred.promise, - 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); - - -/** - * - * 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 <= 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. - * - * 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) { - 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. - * - *
      - * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`. - * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace - * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores - * (`myapp_subsection_filterx`). - *
      - * - * ```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. - * - *
      - * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`. - * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace - * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores - * (`myapp_subsection_filterx`). - *
      - * @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 used for matching against the contents of the `array`. All strings or - * objects with string properties in `array` that match this string will be returned. This also - * applies to nested object properties. - * 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 or its nested object properties. 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". - * - * Note that a named property will match properties on the same level only, while the special - * `$` property will match properties on the same level or deeper. E.g. an array item like - * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but - * **will** be matched by `{$: 'John'}`. - * - * - `function(value, index)`: 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 both values should be considered equal. - * - * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`. - * 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 expressionType = (expression !== null) ? typeof expression : 'null'; - var predicateFn; - var matchAgainstAnyProp; - - switch (expressionType) { - case 'function': - predicateFn = expression; - break; - case 'boolean': - case 'null': - case 'number': - case 'string': - matchAgainstAnyProp = true; - //jshint -W086 - case 'object': - //jshint +W086 - predicateFn = createPredicateFn(expression, comparator, matchAgainstAnyProp); - break; - default: - return array; - } - - return array.filter(predicateFn); - }; -} - -// Helper functions for `filterFilter` -function createPredicateFn(expression, comparator, matchAgainstAnyProp) { - var shouldMatchPrimitives = isObject(expression) && ('$' in expression); - var predicateFn; - - if (comparator === true) { - comparator = equals; - } else if (!isFunction(comparator)) { - comparator = function(actual, expected) { - if (isUndefined(actual)) { - // No substring matching against `undefined` - return false; - } - if ((actual === null) || (expected === null)) { - // No substring matching against `null`; only match against `null` - return actual === expected; - } - if (isObject(actual) || isObject(expected)) { - // Prevent an object to be considered equal to a string like `'[object'` - return false; - } - - actual = lowercase('' + actual); - expected = lowercase('' + expected); - return actual.indexOf(expected) !== -1; - }; - } - - predicateFn = function(item) { - if (shouldMatchPrimitives && !isObject(item)) { - return deepCompare(item, expression.$, comparator, false); - } - return deepCompare(item, expression, comparator, matchAgainstAnyProp); - }; - - return predicateFn; -} - -function deepCompare(actual, expected, comparator, matchAgainstAnyProp, dontMatchWholeObject) { - var actualType = (actual !== null) ? typeof actual : 'null'; - var expectedType = (expected !== null) ? typeof expected : 'null'; - - if ((expectedType === 'string') && (expected.charAt(0) === '!')) { - return !deepCompare(actual, expected.substring(1), comparator, matchAgainstAnyProp); - } else if (isArray(actual)) { - // In case `actual` is an array, consider it a match - // if ANY of it's items matches `expected` - return actual.some(function(item) { - return deepCompare(item, expected, comparator, matchAgainstAnyProp); - }); - } - - switch (actualType) { - case 'object': - var key; - if (matchAgainstAnyProp) { - for (key in actual) { - if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, true)) { - return true; - } - } - return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, false); - } else if (expectedType === 'object') { - for (key in expected) { - var expectedVal = expected[key]; - if (isFunction(expectedVal) || isUndefined(expectedVal)) { - continue; - } - - var matchAnyProperty = key === '$'; - var actualVal = matchAnyProperty ? actual : actual[key]; - if (!deepCompare(actualVal, expectedVal, comparator, matchAnyProperty, matchAnyProperty)) { - return false; - } - } - return true; - } else { - return comparator(actual, expected); - } - break; - case 'function': - return false; - default: - return comparator(actual, expected); - } -} - -/** - * @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. - * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale - * @returns {string} Formatted number. - * - * - * @example - - - -
      -
      - default currency symbol ($): {{amount | currency}}
      - custom currency identifier (USD$): {{amount | currency:"USD$"}} - no fractions (0): {{amount | currency:"USD$":0}} -
      -
      - - it('should init with 1234.56', function() { - expect(element(by.id('currency-default')).getText()).toBe('$1,234.56'); - expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56'); - expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235'); - }); - 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.id('currency-custom')).getText()).toBe('(USD$1,234.00)'); - expect(element(by.id('currency-no-fractions')).getText()).toBe('(USD$1,234)'); - }); - -
      - */ -currencyFilter.$inject = ['$locale']; -function currencyFilter($locale) { - var formats = $locale.NUMBER_FORMATS; - return function(amount, currencySymbol, fractionSize) { - if (isUndefined(currencySymbol)) { - currencySymbol = formats.CURRENCY_SYM; - } - - if (isUndefined(fractionSize)) { - fractionSize = formats.PATTERNS[1].maxFrac; - } - - // if null or undefined pass it through - return (amount == null) - ? amount - : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize). - replace(/\u00A4/g, currencySymbol); - }; -} - -/** - * @ngdoc filter - * @name number - * @kind function - * - * @description - * Formats a number as text. - * - * If the input is null or undefined, it will just be returned. - * If the input is infinite (Infinity/-Infinity) the Infinity symbol '∞' is returned. - * 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) { - - // if null or undefined pass it through - return (number == null) - ? number - : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP, - fractionSize); - }; -} - -var DECIMAL_SEP = '.'; -function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { - if (!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) { - 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); - - 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) { - formatedText = number.toFixed(fractionSize); - number = parseFloat(formatedText); - } - } - - if (number === 0) { - isNegative = false; - } - - parts.push(isNegative ? pattern.negPre : pattern.posPre, - formatedText, - 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 getFirstThursdayOfYear(year) { - // 0 = index of January - var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay(); - // 4 = index of Thursday (+1 to account for 1st = 5) - // 11 = index of *next* Thursday (+1 account for 1st = 12) - return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst); -} - -function getThursdayThisWeek(datetime) { - return new Date(datetime.getFullYear(), datetime.getMonth(), - // 4 = index of Thursday - datetime.getDate() + (4 - datetime.getDay())); -} - -function weekGetter(size) { - return function(date) { - var firstThurs = getFirstThursdayOfYear(date.getFullYear()), - thisThurs = getThursdayThisWeek(date); - - var diff = +thisThurs - +firstThurs, - result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week - - return padNumber(result, size); - }; -} - -function ampmGetter(date, formats) { - return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]; -} - -function eraGetter(date, formats) { - return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1]; -} - -function longEraGetter(date, formats) { - return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[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, - ww: weekGetter(2), - w: weekGetter(1), - G: eraGetter, - GG: eraGetter, - GGG: eraGetter, - GGGG: longEraGetter -}; - -var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/, - 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'`: Millisecond in second, padded (000-999) - * * `'a'`: AM/PM marker - * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200) - * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year - * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year - * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD') - * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini') - * - * `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. - * @param {string=} timezone Timezone to be used for formatting. Right now, only `'UTC'` is supported. - * If not specified, the timezone of the browser will be 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, timezone) { - 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; - } - } - - if (timezone && timezone === 'UTC') { - date = new Date(date.getTime()); - date.setMinutes(date.getMinutes() + date.getTimezoneOffset()); - } - 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. - * @param {number=} spacing The number of spaces to use per indentation, defaults to 2. - * @returns {string} JSON string. - * - * - * @example - - -
      {{ {'name':'value'} | json }}
      -
      {{ {'name':'value'} | json:4 }}
      -
      - - it('should jsonify filtered objects', function() { - expect(element(by.id('default-spacing')).getText()).toMatch(/\{\n "name": ?"value"\n}/); - expect(element(by.id('custom-spacing')).getText()).toMatch(/\{\n "name": ?"value"\n}/); - }); - -
      - * - */ -function jsonFilter() { - return function(object, spacing) { - if (isUndefined(spacing)) { - spacing = 2; - } - return toJson(object, spacing); - }; -} - - -/** - * @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, string or number, as specified by - * the value and sign (positive or negative) of `limit`. If a number is used as input, it is - * converted to a string. - * - * @param {Array|string|number} input Source array, string or number 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 }}

      - Limit {{longNumber}} to: -

      Output long number: {{ longNumber | limitTo:longNumberLimit }}

      -
      -
      - - var numLimitInput = element(by.model('numLimit')); - var letterLimitInput = element(by.model('letterLimit')); - var longNumberLimitInput = element(by.model('longNumberLimit')); - var limitedNumbers = element(by.binding('numbers | limitTo:numLimit')); - var limitedLetters = element(by.binding('letters | limitTo:letterLimit')); - var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit')); - - it('should limit the number array to first three items', function() { - expect(numLimitInput.getAttribute('value')).toBe('3'); - expect(letterLimitInput.getAttribute('value')).toBe('3'); - expect(longNumberLimitInput.getAttribute('value')).toBe('3'); - expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]'); - expect(limitedLetters.getText()).toEqual('Output letters: abc'); - expect(limitedLongNumber.getText()).toEqual('Output long number: 234'); - }); - - // There is a bug in safari and protractor that doesn't like the minus key - // it('should update the output when -3 is entered', function() { - // numLimitInput.clear(); - // numLimitInput.sendKeys('-3'); - // letterLimitInput.clear(); - // letterLimitInput.sendKeys('-3'); - // longNumberLimitInput.clear(); - // longNumberLimitInput.sendKeys('-3'); - // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]'); - // expect(limitedLetters.getText()).toEqual('Output letters: ghi'); - // expect(limitedLongNumber.getText()).toEqual('Output long number: 342'); - // }); - - it('should not exceed the maximum size of input array', function() { - numLimitInput.clear(); - numLimitInput.sendKeys('100'); - letterLimitInput.clear(); - letterLimitInput.sendKeys('100'); - longNumberLimitInput.clear(); - longNumberLimitInput.sendKeys('100'); - expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]'); - expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi'); - expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342'); - }); - -
      -*/ -function limitToFilter() { - return function(input, limit) { - if (isNumber(input)) input = input.toString(); - if (!isArray(input) && !isString(input)) return input; - - if (Math.abs(Number(limit)) === Infinity) { - limit = Number(limit); - } else { - limit = int(limit); - } - - //NaN check on limit - if (limit) { - return limit > 0 ? input.slice(0, limit) : input.slice(limit); - } else { - return isString(input) ? "" : []; - } - }; -} - -/** - * @ngdoc filter - * @name orderBy - * @kind function - * - * @description - * Orders a specified `array` by the `expression` predicate. It is ordered alphabetically - * for strings and numerically for numbers. Note: if you notice numbers are not being sorted - * correctly, make sure they are actually being saved as numbers and not strings. - * - * @param {Array} array The array to sort. - * @param {function(*)|string|Array.<(function(*)|string)>=} 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`). If no property is provided, (e.g. `'+'`) then the array - * element itself is used to compare where sorting. - * - `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. - * - * If the predicate is missing or empty then it defaults to `'+'`. - * - * @param {boolean=} reverse Reverse the order of the array. - * @returns {Array} Sorted copy of the source array. - * - * - * @example - * The example below demonstrates a simple ngRepeat, where the data is sorted - * by age in descending order (predicate is set to `'-age'`). - * `reverse` is not set, which means it defaults to `false`. - - - -
      - - - - - - - - - - - -
      NamePhone NumberAge
      {{friend.name}}{{friend.phone}}{{friend.age}}
      -
      -
      -
      - * - * The predicate and reverse parameters can be controlled dynamically through scope properties, - * as shown in the next example. - * @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; - sortPredicate = isArray(sortPredicate) ? sortPredicate : [sortPredicate]; - if (sortPredicate.length === 0) { sortPredicate = ['+']; } - sortPredicate = sortPredicate.map(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); - } - if (predicate === '') { - // Effectively no predicate was passed so we compare identity - return reverseComparator(compare, descending); - } - 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); - }); - return slice.call(array).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 descending - ? function(a, b) {return comp(b,a);} - : comp; - } - - function isPrimitive(value) { - switch (typeof value) { - case 'number': /* falls through */ - case 'boolean': /* falls through */ - case 'string': - return true; - default: - return false; - } - } - - function objectToString(value) { - if (value === null) return 'null'; - if (typeof value.valueOf === 'function') { - value = value.valueOf(); - if (isPrimitive(value)) return value; - } - if (typeof value.toString === 'function') { - value = value.toString(); - if (isPrimitive(value)) return value; - } - return ''; - } - - function compare(v1, v2) { - var t1 = typeof v1; - var t2 = typeof v2; - if (t1 === t2 && t1 === "object") { - v1 = objectToString(v1); - v2 = objectToString(v2); - } - if (t1 === t2) { - 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 (!attr.href && !attr.xlinkHref && !attr.name) { - return function(scope, element) { - // If the linked element is not an anchor tag anymore, do nothing - if (element[0].nodeName.toLowerCase() !== 'a') return; - - // 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 - * link1 - * ``` - * - * The correct way to write it: - * ```html - * link1 - * ``` - * - * @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 - * - * This directive sets the `disabled` attribute on the element if the - * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy. - * - * A special directive is necessary because we cannot use interpolation inside the `disabled` - * attribute. The following example would make the button enabled on Chrome/Firefox - * but not on older IEs: - * - * ```html - * - *
      - * - *
      - * ``` - * - * This is because 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. - * - * @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 the `disabled` attribute 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 { - restrict: 'A', - priority: 100, - link: function(scope, element, attr) { - scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { - attr.$set(attrName, !!value); - }); - } - }; - }; -}); - -// aliased input attrs are evaluated -forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) { - ngAttributeAliasDirectives[ngAttr] = function() { - return { - priority: 100, - link: function(scope, element, attr) { - //special case ngPattern when a literal regular expression value - //is used as the expression (this way we don't have to watch anything). - if (ngAttr === "ngPattern" && attr.ngPattern.charAt(0) == "/") { - var match = attr.ngPattern.match(REGEX_STRING_REGEXP); - if (match) { - attr.$set("ngPattern", new RegExp(match[1], match[2])); - return; - } - } - - scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) { - attr.$set(ngAttr, 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, -SUBMITTED_CLASS, addSetValidityMethod: true - */ -var nullFormCtrl = { - $addControl: noop, - $$renameControl: nullFormRenameControl, - $removeControl: noop, - $setValidity: noop, - $setDirty: noop, - $setPristine: noop, - $setSubmitted: noop -}, -SUBMITTED_CLASS = 'ng-submitted'; - -function nullFormRenameControl(control, name) { - control.$name = name; -} - -/** - * @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 {boolean} $submitted True if user has submitted the form even if its invalid. - * - * @property {Object} $error Is an object hash, containing references to controls or - * forms with failing validators, where: - * - * - keys are validation tokens (error names), - * - values are arrays of controls or forms that have a failing validator for given error name. - * - * Built-in validation tokens: - * - * - `email` - * - `max` - * - `maxlength` - * - `min` - * - `minlength` - * - `number` - * - `pattern` - * - `required` - * - `url` - * - `date` - * - `datetimelocal` - * - `time` - * - `week` - * - `month` - * - * @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', '$interpolate']; -function FormController(element, attrs, $scope, $animate, $interpolate) { - var form = this, - controls = []; - - var parentForm = form.$$parentForm = element.parent().controller('form') || nullFormCtrl; - - // init state - form.$error = {}; - form.$$success = {}; - form.$pending = undefined; - form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope); - form.$dirty = false; - form.$pristine = true; - form.$valid = true; - form.$invalid = false; - form.$submitted = false; - - parentForm.$addControl(form); - - /** - * @ngdoc method - * @name form.FormController#$rollbackViewValue - * - * @description - * Rollback all form controls pending updates to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. This method is typically needed by the reset button of - * a form that uses `ng-model-options` to pend updates. - */ - form.$rollbackViewValue = function() { - forEach(controls, function(control) { - control.$rollbackViewValue(); - }); - }; - - /** - * @ngdoc method - * @name form.FormController#$commitViewValue - * - * @description - * Commit all form controls pending updates to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. This method is rarely needed as `NgModelController` - * usually handles calling this in response to input events. - */ - form.$commitViewValue = function() { - forEach(controls, function(control) { - control.$commitViewValue(); - }); - }; - - /** - * @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; - } - }; - - // Private API: rename a form control - form.$$renameControl = function(control, newName) { - var oldName = control.$name; - - if (form[oldName] === control) { - delete form[oldName]; - } - form[newName] = control; - control.$name = newName; - }; - - /** - * @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(form.$pending, function(value, name) { - form.$setValidity(name, null, control); - }); - forEach(form.$error, function(value, name) { - form.$setValidity(name, null, control); - }); - forEach(form.$$success, function(value, name) { - form.$setValidity(name, null, 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. - */ - addSetValidityMethod({ - ctrl: this, - $element: element, - set: function(object, property, controller) { - var list = object[property]; - if (!list) { - object[property] = [controller]; - } else { - var index = list.indexOf(controller); - if (index === -1) { - list.push(controller); - } - } - }, - unset: function(object, property, controller) { - var list = object[property]; - if (!list) { - return; - } - arrayRemove(list, controller); - if (list.length === 0) { - delete object[property]; - } - }, - parentForm: parentForm, - $animate: $animate - }); - - /** - * @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.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS); - form.$dirty = false; - form.$pristine = true; - form.$submitted = false; - forEach(controls, function(control) { - control.$setPristine(); - }); - }; - - /** - * @ngdoc method - * @name form.FormController#$setUntouched - * - * @description - * Sets the form to its untouched state. - * - * This method can be called to remove the 'ng-touched' class and set the form controls to their - * untouched state (ng-untouched class). - * - * Setting a form controls back to their untouched state is often useful when setting the form - * back to its pristine state. - */ - form.$setUntouched = function() { - forEach(controls, function(control) { - control.$setUntouched(); - }); - }; - - /** - * @ngdoc method - * @name form.FormController#$setSubmitted - * - * @description - * Sets the form to its submitted state. - */ - form.$setSubmitted = function() { - $animate.addClass(element, SUBMITTED_CLASS); - form.$submitted = true; - parentForm.$setSubmitted(); - }; -} - -/** - * @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. - * - `ng-submitted` is set if the form was submitted. - * - * 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`) - * - * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is - * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit` - * to have access to the updated model. - * - * ## 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 ngFormCompile(formElement, attr) { - // Setup initial state of the control - formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS); - - var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false); - - return { - pre: function ngFormPreLink(scope, formElement, attr, controller) { - // if `action` attr is not present on the form, prevent the default action (submission) - if (!('action' in attr)) { - // 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 handleFormSubmission = function(event) { - scope.$apply(function() { - controller.$commitViewValue(); - controller.$setSubmitted(); - }); - - event.preventDefault(); - }; - - addEventListenerFn(formElement[0], 'submit', handleFormSubmission); - - // 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', handleFormSubmission); - }, 0, false); - }); - } - - var parentFormCtrl = controller.$$parentForm; - - if (nameAttr) { - setter(scope, null, controller.$name, controller, controller.$name); - attr.$observe(nameAttr, function(newValue) { - if (controller.$name === newValue) return; - setter(scope, null, controller.$name, undefined, controller.$name); - parentFormCtrl.$$renameControl(controller, newValue); - setter(scope, null, controller.$name, controller, controller.$name); - }); - } - formElement.on('$destroy', function() { - parentFormCtrl.$removeControl(controller); - if (nameAttr) { - setter(scope, null, attr[nameAttr], undefined, controller.$name); - } - extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards - }); - } - }; - } - }; - - return formDirective; - }]; -}; - -var formDirective = formDirectiveFactory(); -var ngFormDirective = formDirectiveFactory(true); - -/* global VALID_CLASS: false, - INVALID_CLASS: false, - PRISTINE_CLASS: false, - DIRTY_CLASS: false, - UNTOUCHED_CLASS: false, - TOUCHED_CLASS: false, - ngModelMinErr: false, -*/ - -// Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231 -var ISO_DATE_REGEXP = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/; -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 DATE_REGEXP = /^(\d{4})-(\d{2})-(\d{2})$/; -var DATETIMELOCAL_REGEXP = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; -var WEEK_REGEXP = /^(\d{4})-W(\d\d)$/; -var MONTH_REGEXP = /^(\d{4})-(\d\d)$/; -var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; - -var inputType = { - - /** - * @ngdoc input - * @name input[text] - * - * @description - * Standard HTML text input with angular data binding, inherited by most of the `input` elements. - * - * - * @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. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match - * a RegExp found by evaluating the Angular expression given in the attribute value. - * If the expression evaluates to a RegExp object then this is used directly. - * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` - * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. - * @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 = {{example.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('example.text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.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[date] - * - * @description - * Input with date validation and transformation. In browsers that do not yet support - * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601 - * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many - * modern browsers do not yet support this input type, it is important to provide cues to users on the - * expected input format via a placeholder or label. - * - * The model must always be a Date object, otherwise Angular will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @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`. This must be a - * valid ISO date string (yyyy-MM-dd). - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be - * a valid ISO date string (yyyy-MM-dd). - * @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 {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
      - Pick a date in 2013: - - - Required! - - Not a valid date! - value = {{example.value | date: "yyyy-MM-dd"}}
      - 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('example.value | date: "yyyy-MM-dd"')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (see https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-10-22'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01-01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
      - */ - 'date': createDateInputType('date', DATE_REGEXP, - createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']), - 'yyyy-MM-dd'), - - /** - * @ngdoc input - * @name input[datetime-local] - * - * @description - * Input with datetime validation and transformation. In browsers that do not yet support - * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`. - * - * The model must always be a Date object, otherwise Angular will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @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`. This must be a - * valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be - * a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). - * @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 {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
      - Pick a date between in 2013: - - - Required! - - Not a valid date! - value = {{example.value | date: "yyyy-MM-ddTHH:mm:ss"}}
      - 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('example.value | date: "yyyy-MM-ddTHH:mm:ss"')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2010-12-28T14:57:00'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01-01T23:59:00'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
      - */ - 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP, - createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']), - 'yyyy-MM-ddTHH:mm:ss.sss'), - - /** - * @ngdoc input - * @name input[time] - * - * @description - * Input with time validation and transformation. In browsers that do not yet support - * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a - * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`. - * - * The model must always be a Date object, otherwise Angular will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @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`. This must be a - * valid ISO time format (HH:mm:ss). - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be a - * valid ISO time format (HH:mm:ss). - * @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 {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
      - Pick a between 8am and 5pm: - - - Required! - - Not a valid date! - value = {{example.value | date: "HH:mm:ss"}}
      - 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('example.value | date: "HH:mm:ss"')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('14:57:00'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('23:59:00'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
      - */ - 'time': createDateInputType('time', TIME_REGEXP, - createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']), - 'HH:mm:ss.sss'), - - /** - * @ngdoc input - * @name input[week] - * - * @description - * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support - * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * week format (yyyy-W##), for example: `2013-W02`. - * - * The model must always be a Date object, otherwise Angular will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @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`. This must be a - * valid ISO week format (yyyy-W##). - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be - * a valid ISO week format (yyyy-W##). - * @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 {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
      - Pick a date between in 2013: - - - Required! - - Not a valid date! - value = {{example.value | date: "yyyy-Www"}}
      - 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('example.value | date: "yyyy-Www"')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-W01'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-W01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
      - */ - 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'), - - /** - * @ngdoc input - * @name input[month] - * - * @description - * Input with month validation and transformation. In browsers that do not yet support - * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * month format (yyyy-MM), for example: `2009-01`. - * - * The model must always be a Date object, otherwise Angular will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * If the model is not set to the first of the month, the next view to model update will set it - * to the first of the month. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @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`. This must be - * a valid ISO month format (yyyy-MM). - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must - * be a valid ISO month format (yyyy-MM). - * @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 {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
      - Pick a month in 2013: - - - Required! - - Not a valid month! - value = {{example.value | date: "yyyy-MM"}}
      - 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('example.value | date: "yyyy-MM"')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-10'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
      - */ - 'month': createDateInputType('month', MONTH_REGEXP, - createDateParser(MONTH_REGEXP, ['yyyy', 'MM']), - 'yyyy-MM'), - - /** - * @ngdoc input - * @name input[number] - * - * @description - * Text input with number validation and transformation. Sets the `number` validation - * error if not a valid number. - * - *
      - * The model must always be of type `number` otherwise Angular will throw an error. - * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt} - * error docs for more information and an example of how to convert your model if necessary. - *
      - * - * @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. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match - * a RegExp found by evaluating the Angular expression given in the attribute value. - * If the expression evaluates to a RegExp object then this is used directly. - * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` - * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. - * @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 = {{example.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('example.value')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.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. - * - *
      - * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex - * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify - * the built-in validators (see the {@link guide/forms Forms guide}) - *
      - * - * @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. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match - * a RegExp found by evaluating the Angular expression given in the attribute value. - * If the expression evaluates to a RegExp object then this is used directly. - * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` - * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. - * @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 = {{url.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('url.text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('url.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. - * - *
      - * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex - * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can - * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide}) - *
      - * - * @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. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match - * a RegExp found by evaluating the Angular expression given in the attribute value. - * If the expression evaluates to a RegExp object then this is used directly. - * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` - * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. - * @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 = {{email.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('email.text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('email.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.name | 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.name')); - - expect(color.getText()).toContain('blue'); - - element.all(by.model('color.name')).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 {expression=} ngTrueValue The value to which the expression should be set when selected. - * @param {expression=} 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 = {{checkboxModel.value1}}
      - value2 = {{checkboxModel.value2}}
      -
      -
      - - it('should change state', function() { - var value1 = element(by.binding('checkboxModel.value1')); - var value2 = element(by.binding('checkboxModel.value2')); - - expect(value1.getText()).toContain('true'); - expect(value2.getText()).toContain('YES'); - - element(by.model('checkboxModel.value1')).click(); - element(by.model('checkboxModel.value2')).click(); - - expect(value1.getText()).toContain('false'); - expect(value2.getText()).toContain('NO'); - }); - -
      - */ - 'checkbox': checkboxInputType, - - 'hidden': noop, - 'button': noop, - 'submit': noop, - 'reset': noop, - 'file': noop -}; - -function stringBasedInputType(ctrl) { - ctrl.$formatters.push(function(value) { - return ctrl.$isEmpty(value) ? value : value.toString(); - }); -} - -function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); -} - -function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) { - var type = lowercase(element[0].type); - - // In composition mode, users are still inputing intermediate text buffer, - // hold the listener until composition is done. - // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent - if (!$sniffer.android) { - var composing = false; - - element.on('compositionstart', function(data) { - composing = true; - }); - - element.on('compositionend', function() { - composing = false; - listener(); - }); - } - - var listener = function(ev) { - if (timeout) { - $browser.defer.cancel(timeout); - timeout = null; - } - if (composing) return; - var value = element.val(), - event = ev && ev.type; - - // By default we will trim the value - // If the attribute ng-trim exists we will avoid trimming - // If input type is 'password', the value is never trimmed - if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) { - value = trim(value); - } - - // If a control is suffering from bad input (due to native validators), browsers discard its - // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the - // control's value is the same empty value twice in a row. - if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) { - ctrl.$setViewValue(value, event); - } - }; - - // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the - // input event on backspace, delete or cut - if ($sniffer.hasEvent('input')) { - element.on('input', listener); - } else { - var timeout; - - var deferListener = function(ev, input, origValue) { - if (!timeout) { - timeout = $browser.defer(function() { - timeout = null; - if (!input || input.value !== origValue) { - listener(ev); - } - }); - } - }; - - element.on('keydown', function(event) { - var key = event.keyCode; - - // ignore - // command modifiers arrows - if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return; - - deferListener(event, this, this.value); - }); - - // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it - if ($sniffer.hasEvent('paste')) { - element.on('paste cut', deferListener); - } - } - - // if user paste into input using mouse on older browser - // or form autocomplete on newer browser, we need "change" event to catch it - element.on('change', listener); - - ctrl.$render = function() { - element.val(ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue); - }; -} - -function weekParser(isoWeek, existingDate) { - if (isDate(isoWeek)) { - return isoWeek; - } - - if (isString(isoWeek)) { - WEEK_REGEXP.lastIndex = 0; - var parts = WEEK_REGEXP.exec(isoWeek); - if (parts) { - var year = +parts[1], - week = +parts[2], - hours = 0, - minutes = 0, - seconds = 0, - milliseconds = 0, - firstThurs = getFirstThursdayOfYear(year), - addDays = (week - 1) * 7; - - if (existingDate) { - hours = existingDate.getHours(); - minutes = existingDate.getMinutes(); - seconds = existingDate.getSeconds(); - milliseconds = existingDate.getMilliseconds(); - } - - return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); - } - } - - return NaN; -} - -function createDateParser(regexp, mapping) { - return function(iso, date) { - var parts, map; - - if (isDate(iso)) { - return iso; - } - - if (isString(iso)) { - // When a date is JSON'ified to wraps itself inside of an extra - // set of double quotes. This makes the date parsing code unable - // to match the date string and parse it as a date. - if (iso.charAt(0) == '"' && iso.charAt(iso.length - 1) == '"') { - iso = iso.substring(1, iso.length - 1); - } - if (ISO_DATE_REGEXP.test(iso)) { - return new Date(iso); - } - regexp.lastIndex = 0; - parts = regexp.exec(iso); - - if (parts) { - parts.shift(); - if (date) { - map = { - yyyy: date.getFullYear(), - MM: date.getMonth() + 1, - dd: date.getDate(), - HH: date.getHours(), - mm: date.getMinutes(), - ss: date.getSeconds(), - sss: date.getMilliseconds() / 1000 - }; - } else { - map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 }; - } - - forEach(parts, function(part, index) { - if (index < mapping.length) { - map[mapping[index]] = +part; - } - }); - return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0); - } - } - - return NaN; - }; -} - -function createDateInputType(type, regexp, parseDate, format) { - return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) { - badInputChecker(scope, element, attr, ctrl); - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - var timezone = ctrl && ctrl.$options && ctrl.$options.timezone; - var previousDate; - - ctrl.$$parserName = type; - ctrl.$parsers.push(function(value) { - if (ctrl.$isEmpty(value)) return null; - if (regexp.test(value)) { - // Note: We cannot read ctrl.$modelValue, as there might be a different - // parser/formatter in the processing chain so that the model - // contains some different data format! - var parsedDate = parseDate(value, previousDate); - if (timezone === 'UTC') { - parsedDate.setMinutes(parsedDate.getMinutes() - parsedDate.getTimezoneOffset()); - } - return parsedDate; - } - return undefined; - }); - - ctrl.$formatters.push(function(value) { - if (value && !isDate(value)) { - throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value); - } - if (isValidDate(value)) { - previousDate = value; - if (previousDate && timezone === 'UTC') { - var timezoneOffset = 60000 * previousDate.getTimezoneOffset(); - previousDate = new Date(previousDate.getTime() + timezoneOffset); - } - return $filter('date')(value, format, timezone); - } else { - previousDate = null; - return ''; - } - }); - - if (isDefined(attr.min) || attr.ngMin) { - var minVal; - ctrl.$validators.min = function(value) { - return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal; - }; - attr.$observe('min', function(val) { - minVal = parseObservedDateValue(val); - ctrl.$validate(); - }); - } - - if (isDefined(attr.max) || attr.ngMax) { - var maxVal; - ctrl.$validators.max = function(value) { - return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal; - }; - attr.$observe('max', function(val) { - maxVal = parseObservedDateValue(val); - ctrl.$validate(); - }); - } - - function isValidDate(value) { - // Invalid Date: getTime() returns NaN - return value && !(value.getTime && value.getTime() !== value.getTime()); - } - - function parseObservedDateValue(val) { - return isDefined(val) ? (isDate(val) ? val : parseDate(val)) : undefined; - } - }; -} - -function badInputChecker(scope, element, attr, ctrl) { - var node = element[0]; - var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity); - if (nativeValidation) { - ctrl.$parsers.push(function(value) { - var validity = element.prop(VALIDITY_STATE_PROPERTY) || {}; - // Detect bug in FF35 for input[email] (https://bugzilla.mozilla.org/show_bug.cgi?id=1064430): - // - also sets validity.badInput (should only be validity.typeMismatch). - // - see http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email) - // - can ignore this case as we can still read out the erroneous email... - return validity.badInput && !validity.typeMismatch ? undefined : value; - }); - } -} - -function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { - badInputChecker(scope, element, attr, ctrl); - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - - ctrl.$$parserName = 'number'; - ctrl.$parsers.push(function(value) { - if (ctrl.$isEmpty(value)) return null; - if (NUMBER_REGEXP.test(value)) return parseFloat(value); - return undefined; - }); - - ctrl.$formatters.push(function(value) { - if (!ctrl.$isEmpty(value)) { - if (!isNumber(value)) { - throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); - } - value = value.toString(); - } - return value; - }); - - if (isDefined(attr.min) || attr.ngMin) { - var minVal; - ctrl.$validators.min = function(value) { - return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal; - }; - - attr.$observe('min', function(val) { - if (isDefined(val) && !isNumber(val)) { - val = parseFloat(val, 10); - } - minVal = isNumber(val) && !isNaN(val) ? val : undefined; - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - }); - } - - if (isDefined(attr.max) || attr.ngMax) { - var maxVal; - ctrl.$validators.max = function(value) { - return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal; - }; - - attr.$observe('max', function(val) { - if (isDefined(val) && !isNumber(val)) { - val = parseFloat(val, 10); - } - maxVal = isNumber(val) && !isNaN(val) ? val : undefined; - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - }); - } -} - -function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) { - // Note: no badInputChecker here by purpose as `url` is only a validation - // in browsers, i.e. we can always read out input.value even if it is not valid! - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); - - ctrl.$$parserName = 'url'; - ctrl.$validators.url = function(modelValue, viewValue) { - var value = modelValue || viewValue; - return ctrl.$isEmpty(value) || URL_REGEXP.test(value); - }; -} - -function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) { - // Note: no badInputChecker here by purpose as `url` is only a validation - // in browsers, i.e. we can always read out input.value even if it is not valid! - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); - - ctrl.$$parserName = 'email'; - ctrl.$validators.email = function(modelValue, viewValue) { - var value = modelValue || viewValue; - return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value); - }; -} - -function radioInputType(scope, element, attr, ctrl) { - // make the name unique, if not defined - if (isUndefined(attr.name)) { - element.attr('name', nextUid()); - } - - var listener = function(ev) { - if (element[0].checked) { - ctrl.$setViewValue(attr.value, ev && ev.type); - } - }; - - element.on('click', listener); - - ctrl.$render = function() { - var value = attr.value; - element[0].checked = (value == ctrl.$viewValue); - }; - - attr.$observe('value', ctrl.$render); -} - -function parseConstantExpr($parse, context, name, expression, fallback) { - var parseFn; - if (isDefined(expression)) { - parseFn = $parse(expression); - if (!parseFn.constant) { - throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' + - '`{1}`.', name, expression); - } - return parseFn(context); - } - return fallback; -} - -function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) { - var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true); - var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false); - - var listener = function(ev) { - ctrl.$setViewValue(element[0].checked, ev && ev.type); - }; - - element.on('click', listener); - - ctrl.$render = function() { - element[0].checked = ctrl.$viewValue; - }; - - // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false` - // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert - // it to a boolean. - ctrl.$isEmpty = function(value) { - return value === false; - }; - - ctrl.$formatters.push(function(value) { - return equals(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. Setting the attribute to a negative or non-numeric value, allows view values of any - * length. - * @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. When used together with {@link ngModel `ngModel`}, it provides data-binding, - * input state control, and validation. - * 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. - * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`. - *
      - * - * @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. Setting the attribute to a negative or non-numeric value, allows view values of any - * length. - * @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.exactBinding('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', '$filter', '$parse', - function($browser, $sniffer, $filter, $parse) { - return { - restrict: 'E', - require: ['?ngModel'], - link: { - pre: function(scope, element, attr, ctrls) { - if (ctrls[0]) { - (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer, - $browser, $filter, $parse); - } - } - } - }; -}]; - - - -var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/; -/** - * @ngdoc directive - * @name ngValue - * - * @description - * Binds the given expression to the value of `