@sapui5/sap.ushell 1.120.7 → 1.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/main/js/sap/ushell/.library +1 -1
- package/src/main/js/sap/ushell/AppInfoParameters.js +46 -49
- package/src/main/js/sap/ushell/CanvasShapesManager.js +8 -7
- package/src/main/js/sap/ushell/Container.js +333 -108
- package/src/main/js/sap/ushell/EventHub.js +6 -9
- package/src/main/js/sap/ushell/Fiori20Adapter.js +6 -7
- package/src/main/js/sap/ushell/Fiori20AdapterTest.js +5 -7
- package/src/main/js/sap/ushell/Layout.js +20 -16
- package/src/main/js/sap/ushell/NWBCInterface.js +1 -1
- package/src/main/js/sap/ushell/SessionHandler.js +20 -12
- package/src/main/js/sap/ushell/System.js +4 -2
- package/src/main/js/sap/ushell/TechnicalParameters.js +34 -57
- package/src/main/js/sap/ushell/UIActions.js +28 -39
- package/src/main/js/sap/ushell/URLTemplateProcessor.js +1 -1
- package/src/main/js/sap/ushell/Ui5NativeServiceFactory.js +8 -7
- package/src/main/js/sap/ushell/Ui5ServiceFactory.js +10 -10
- package/src/main/js/sap/ushell/User.js +6 -4
- package/src/main/js/sap/ushell/UserActivityLog.js +13 -11
- package/src/main/js/sap/ushell/_ApplicationType/guiResolution.js +15 -19
- package/src/main/js/sap/ushell/_ApplicationType/systemAlias.js +5 -3
- package/src/main/js/sap/ushell/_ApplicationType/ui5Resolution.js +11 -10
- package/src/main/js/sap/ushell/_ApplicationType/urlTemplateResolution.js +17 -15
- package/src/main/js/sap/ushell/_ApplicationType/utils.js +7 -7
- package/src/main/js/sap/ushell/_ApplicationType/wdaResolution.js +8 -6
- package/src/main/js/sap/ushell/_Config/utils.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/DefinitionParameterSetBuilder.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/DependencyGraph.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/Functions.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/Resolvers.js +2 -2
- package/src/main/js/sap/ushell/_URLTemplateProcessor/TemplateParameterParser.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/utils.js +1 -1
- package/src/main/js/sap/ushell/adapters/AppVariantPersonalizationAdapter.js +5 -3
- package/src/main/js/sap/ushell/adapters/cdm/ClientSideTargetResolutionAdapter.js +6 -11
- package/src/main/js/sap/ushell/adapters/cdm/CommonDataModelAdapter.js +6 -16
- package/src/main/js/sap/ushell/adapters/cdm/ConfigurationDefaultsAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/ContainerAdapter.js +18 -14
- package/src/main/js/sap/ushell/adapters/cdm/LaunchPageAdapter.js +16 -21
- package/src/main/js/sap/ushell/adapters/cdm/PagesCommonDataModelAdapter.js +7 -18
- package/src/main/js/sap/ushell/adapters/cdm/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/PersonalizationV2Adapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/modifyHome.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/readCatalogs.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/readHome.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/uri.transform.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_Personalization/internals.js +9 -9
- package/src/main/js/sap/ushell/adapters/cdm/util/AppForInbound.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/util/cdmSiteUtils.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/AdapterBase.js +36 -13
- package/src/main/js/sap/ushell/adapters/cdm/v3/FlpLaunchPageAdapter.js +2629 -0
- package/src/main/js/sap/ushell/adapters/cdm/v3/LaunchPageAdapter.js +4 -2525
- package/src/main/js/sap/ushell/adapters/cdm/v3/StaticGroupsAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readApplications.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readCatalogs.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readHome.js +13 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readPages.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readUtils.js +91 -25
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readVisualizations.js +1 -1
- package/src/main/js/sap/ushell/adapters/cep/MenuAdapter.js +6 -6
- package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionAdapter.js +31 -6
- package/src/main/js/sap/ushell/adapters/cep/SearchCEPAdapter.js +7 -6
- package/src/main/js/sap/ushell/adapters/cflp/UserDefaultParameterPersistenceAdapter.js +10 -20
- package/src/main/js/sap/ushell/adapters/local/AdapterContainer.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/AppStateAdapter.js +14 -19
- package/src/main/js/sap/ushell/adapters/local/ClientSideTargetResolutionAdapter.js +18 -20
- package/src/main/js/sap/ushell/adapters/local/ContainerAdapter.js +25 -18
- package/src/main/js/sap/ushell/adapters/local/FlpLaunchPageAdapter.js +1558 -0
- package/src/main/js/sap/ushell/adapters/local/LaunchPageAdapter.js +4 -1551
- package/src/main/js/sap/ushell/adapters/local/MenuAdapter.js +3 -3
- package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionAdapter.js +2 -4
- package/src/main/js/sap/ushell/adapters/local/PageBuildingAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PagePersistenceAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PersonalizationAdapter.js +11 -8
- package/src/main/js/sap/ushell/adapters/local/PersonalizationV2Adapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/SearchAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/SearchCEPAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/SupportTicketAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/UserDefaultParameterPersistenceAdapter.js +11 -23
- package/src/main/js/sap/ushell/adapters/local/UserInfoAdapter.js +1 -1
- package/src/main/js/sap/ushell/api/RTA.js +27 -0
- package/src/main/js/sap/ushell/api/workpage/Designtime.js +69 -0
- package/src/main/js/sap/ushell/api/workpage/Runtime.js +97 -0
- package/src/main/js/sap/ushell/appRuntime/neo/AppInfoService.js +12 -3
- package/src/main/js/sap/ushell/appRuntime/neo/AppRuntimeNeo.js +4 -0
- package/src/main/js/sap/ushell/appRuntime/neo/ProxyAppUtils.js +4 -0
- package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntime.js +82 -78
- package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntimeContext.js +4 -3
- package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntimeService.js +8 -0
- package/src/main/js/sap/ushell/appRuntime/ui5/SessionHandlerAgent.js +35 -37
- package/src/main/js/sap/ushell/appRuntime/ui5/performance/FesrEnhancer.js +4 -5
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/baseRta/AppLifeCycleUtils.js +2 -8
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/baseRta/Trigger.js +9 -5
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaAgent/Component.js +6 -4
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaAgent/i18n/i18n_en.properties +0 -7
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaAgent/i18n/i18n_en_US_saprigi.properties +5 -5
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaShell/Component.js +4 -3
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaShell/i18n/i18n_en.properties +0 -4
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaShell/i18n/i18n_en_US_saprigi.properties +2 -2
- package/src/main/js/sap/ushell/appRuntime/ui5/renderers/fiori2/AccessKeysAgent.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/renderers/fiori2/Renderer.js +14 -14
- package/src/main/js/sap/ushell/appRuntime/ui5/renderers/fiori2/RendererExtensions.js +2 -2
- package/src/main/js/sap/ushell/appRuntime/ui5/services/AppConfiguration.js +8 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/AppLifeCycleAgent.js +39 -39
- package/src/main/js/sap/ushell/appRuntime/ui5/services/AppState.js +15 -16
- package/src/main/js/sap/ushell/appRuntime/ui5/services/Bookmark.js +12 -54
- package/src/main/js/sap/ushell/appRuntime/ui5/services/BookmarkV2.js +154 -0
- package/src/main/js/sap/ushell/appRuntime/ui5/services/CommonDataModel.js +1 -3
- package/src/main/js/sap/ushell/appRuntime/ui5/services/Container.js +221 -206
- package/src/main/js/sap/ushell/appRuntime/ui5/services/CrossApplicationNavigation.js +15 -14
- package/src/main/js/sap/ushell/appRuntime/ui5/services/MessageBroker.js +35 -55
- package/src/main/js/sap/ushell/appRuntime/ui5/services/NavTargetResolution.js +10 -14
- package/src/main/js/sap/ushell/appRuntime/ui5/services/Navigation.js +212 -0
- package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellNavigation.js +6 -5
- package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellNavigationInternal.js +67 -0
- package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellUIService.js +4 -4
- package/src/main/js/sap/ushell/appRuntime/ui5/services/UserInfo.js +9 -3
- package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/ContainerAdapter.js +9 -10
- package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/EmptyAdapter.js +3 -0
- package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/FLPScheduler.js +12 -6
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/StepConfiguration.json +1 -3
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/logger.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/state.js +6 -7
- package/src/main/js/sap/ushell/bootstrap/cdm/cdm-def-dev.js +2 -1
- package/src/main/js/sap/ushell/bootstrap/cdm/cdm-def-loader.js +15 -5
- package/src/main/js/sap/ushell/bootstrap/cdm/cdm-def.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/cdm/cdm.boot.task.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/cdm/cdm.constants.js +14 -0
- package/src/main/js/sap/ushell/bootstrap/cdm.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.boot.path.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.boot.script.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.boot.task.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5.extractLibs.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5datetimeformat.js +6 -6
- package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5language.js +4 -4
- package/src/main/js/sap/ushell/bootstrap/common/common.configure.ushell.js +37 -41
- package/src/main/js/sap/ushell/bootstrap/common/common.constants.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.create.configcontract.core.js +31 -20
- package/src/main/js/sap/ushell/bootstrap/common/common.debug.mode.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.load.bootstrapExtension.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.load.core-min.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/common/common.load.launchpad.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.load.model.js +3 -3
- package/src/main/js/sap/ushell/bootstrap/common/common.load.ui5theme.js +3 -3
- package/src/main/js/sap/ushell/bootstrap/common/common.read.metatags.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.read.ushell.config.from.url.js +5 -4
- package/src/main/js/sap/ushell/bootstrap/common/common.util.js +48 -14
- package/src/main/js/sap/ushell/bootstrap/sandbox2.js +8 -9
- package/src/main/js/sap/ushell/bootstrap/ui5loader-config.js +2 -2
- package/src/main/js/sap/ushell/components/CatalogsManager.js +49 -47
- package/src/main/js/sap/ushell/components/ComponentKeysHandler.js +57 -45
- package/src/main/js/sap/ushell/components/DestroyHelper.js +2 -2
- package/src/main/js/sap/ushell/components/HeaderManager.js +3 -3
- package/src/main/js/sap/ushell/components/HomepageManager.js +27 -29
- package/src/main/js/sap/ushell/components/MessagingHelper.js +2 -2
- package/src/main/js/sap/ushell/components/SharedComponentUtils.js +13 -10
- package/src/main/js/sap/ushell/components/StateHelper.js +1 -1
- package/src/main/js/sap/ushell/components/_HeaderManager/AddHeadEndItemsStrategy.js +15 -15
- package/src/main/js/sap/ushell/components/_HeaderManager/AddHeadItemsStrategy.js +3 -3
- package/src/main/js/sap/ushell/components/_HeaderManager/ControlManager.js +4 -4
- package/src/main/js/sap/ushell/components/_HeaderManager/RemoveItemsStrategy.js +2 -2
- package/src/main/js/sap/ushell/components/_HeaderManager/ShellHeader.controller.js +13 -13
- package/src/main/js/sap/ushell/components/_HomepageManager/DashboardLoadingManager.js +3 -3
- package/src/main/js/sap/ushell/components/_HomepageManager/PagingManager.js +1 -1
- package/src/main/js/sap/ushell/components/_HomepageManager/PersistentPageOperationAdapter.js +4 -4
- package/src/main/js/sap/ushell/components/appfinder/AppFinder.controller.js +9 -8
- package/src/main/js/sap/ushell/components/appfinder/AppFinderView.js +6 -6
- package/src/main/js/sap/ushell/components/appfinder/Catalog.controller.js +29 -16
- package/src/main/js/sap/ushell/components/appfinder/CatalogView.js +17 -17
- package/src/main/js/sap/ushell/components/appfinder/Component.js +4 -4
- package/src/main/js/sap/ushell/components/appfinder/EasyAccess.controller.js +7 -7
- package/src/main/js/sap/ushell/components/appfinder/EasyAccessView.js +3 -9
- package/src/main/js/sap/ushell/components/appfinder/GroupListPopover.controller.js +3 -3
- package/src/main/js/sap/ushell/components/appfinder/HierarchyAppsView.js +6 -7
- package/src/main/js/sap/ushell/components/appfinder/HierarchyFolders.controller.js +2 -4
- package/src/main/js/sap/ushell/components/appfinder/HierarchyFoldersView.js +3 -3
- package/src/main/js/sap/ushell/components/appfinder/VisualizationOrganizerHelper.js +9 -5
- package/src/main/js/sap/ushell/components/appfinder/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/AppLifeCycle.js +38 -55
- package/src/main/js/sap/ushell/components/applicationIntegration/application/Application.js +20 -22
- package/src/main/js/sap/ushell/components/applicationIntegration/application/BlueBoxHandler.js +22 -33
- package/src/main/js/sap/ushell/components/applicationIntegration/application/PostMessageAPI.js +563 -372
- package/src/main/js/sap/ushell/components/applicationIntegration/application/WebGUIStatefulHandler.js +8 -7
- package/src/main/js/sap/ushell/components/applicationIntegration/configuration/AppMeta.js +8 -6
- package/src/main/js/sap/ushell/components/applicationIntegration/elements/model.js +9 -7
- package/src/main/js/sap/ushell/components/applicationIntegration/relatedServices/RelatedServices.js +6 -5
- package/src/main/js/sap/ushell/components/applicationIntegration/relatedShellElements/RelatedShellElements.js +2 -2
- package/src/main/js/sap/ushell/components/cards/Configuration.controller.js +6 -5
- package/src/main/js/sap/ushell/components/cepsearchresult/app/Component.js +1 -1
- package/src/main/js/sap/ushell/components/cepsearchresult/app/Main.controller.js +2 -2
- package/src/main/js/sap/ushell/components/cepsearchresult/app/cards/searchresultwidget/Component.js +2 -2
- package/src/main/js/sap/ushell/components/cepsearchresult/app/cards/searchresultwidget/i18n/i18n_en.properties +0 -34
- package/src/main/js/sap/ushell/components/cepsearchresult/app/cards/searchresultwidget/i18n/i18n_en_US_saprigi.properties +37 -37
- package/src/main/js/sap/ushell/components/cepsearchresult/app/i18n/i18n_en.properties +0 -11
- package/src/main/js/sap/ushell/components/cepsearchresult/app/i18n/i18n_en_US_saprigi.properties +9 -9
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/controls/Category.css +4 -0
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/controls/Highlighter.js +1 -3
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/controls/Paginator.js +1 -3
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/controls/categories/Application.js +27 -1
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/i18n/i18n_ca.properties +3 -3
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/i18n/i18n_en.properties +0 -111
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/i18n/i18n_en_US_saprigi.properties +109 -109
- package/src/main/js/sap/ushell/components/container/ApplicationContainer.js +105 -96
- package/src/main/js/sap/ushell/components/container/IframePOSTUtils.js +13 -13
- package/src/main/js/sap/ushell/components/container/resources/resources_en.properties +0 -9
- package/src/main/js/sap/ushell/components/container/resources/resources_en_US_saprigi.properties +6 -6
- package/src/main/js/sap/ushell/components/contentFinder/Component.js +54 -105
- package/src/main/js/sap/ushell/components/contentFinder/controller/AppSearch.controller.js +108 -142
- package/src/main/js/sap/ushell/components/contentFinder/controller/ContentFinderDialog.controller.js +16 -11
- package/src/main/js/sap/ushell/components/contentFinder/controller/WidgetGallery.controller.js +9 -7
- package/src/main/js/sap/ushell/components/contentFinder/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/model/formatter.js +6 -6
- package/src/main/js/sap/ushell/components/contentFinder/resources/resources.properties +4 -2
- package/src/main/js/sap/ushell/components/contentFinder/resources/resources_en.properties +0 -29
- package/src/main/js/sap/ushell/components/contentFinder/resources/resources_en_US_saprigi.properties +24 -24
- package/src/main/js/sap/ushell/components/contentFinder/view/AppSearch.view.xml +37 -17
- package/src/main/js/sap/ushell/components/contentFinder/view/AppSearchBox.fragment.xml +5 -3
- package/src/main/js/sap/ushell/components/contentFinder/view/ContentFinderDialog.view.xml +9 -4
- package/src/main/js/sap/ushell/components/factsheet/Component.js +1 -1
- package/src/main/js/sap/ushell/components/factsheet/controls/PictureTileRenderer.js +2 -1
- package/src/main/js/sap/ushell/components/factsheet/controls/PictureViewerRenderer.js +2 -1
- package/src/main/js/sap/ushell/components/homepage/ActionMode.js +23 -19
- package/src/main/js/sap/ushell/components/homepage/Component.js +3 -3
- package/src/main/js/sap/ushell/components/homepage/DashboardContent.controller.js +3 -2
- package/src/main/js/sap/ushell/components/homepage/DashboardContent.view.js +3 -4
- package/src/main/js/sap/ushell/components/homepage/DashboardGroupsBox.js +17 -9
- package/src/main/js/sap/ushell/components/homepage/DashboardUIActions.js +10 -3
- package/src/main/js/sap/ushell/components/homepage/FLPAnalytics.js +6 -4
- package/src/main/js/sap/ushell/components/homepage/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/pages/ActionMode.js +5 -5
- package/src/main/js/sap/ushell/components/pages/Component.js +2 -2
- package/src/main/js/sap/ushell/components/pages/MyHomeImport.js +7 -7
- package/src/main/js/sap/ushell/components/pages/StateManager.js +3 -3
- package/src/main/js/sap/ushell/components/pages/controller/ImportDialog.controller.js +9 -12
- package/src/main/js/sap/ushell/components/pages/controller/MyHome.controller.js +2 -2
- package/src/main/js/sap/ushell/components/pages/controller/PageRuntime.controller.js +70 -15
- package/src/main/js/sap/ushell/components/pages/controller/PagesAndSpaceId.js +2 -2
- package/src/main/js/sap/ushell/components/pages/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/pages/view/PageRuntime.view.xml +7 -5
- package/src/main/js/sap/ushell/components/runtimeSwitcher/controller/RuntimeSwitcher.controller.js +50 -8
- package/src/main/js/sap/ushell/components/runtimeSwitcher/manifest.json +1 -8
- package/src/main/js/sap/ushell/components/runtimeSwitcher/view/RuntimeSwitcher.view.xml +13 -8
- package/src/main/js/sap/ushell/components/shell/MenuBar/Component.js +6 -4
- package/src/main/js/sap/ushell/components/shell/MenuBar/controller/MenuBar.controller.js +6 -7
- package/src/main/js/sap/ushell/components/shell/MenuBar/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/controller/NavigationBarMenu.controller.js +13 -11
- package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/Notifications/Component.js +16 -12
- package/src/main/js/sap/ushell/components/shell/Notifications/Notifications.controller.js +5 -5
- package/src/main/js/sap/ushell/components/shell/PostLoadingHeaderEnhancement/Component.js +14 -14
- package/src/main/js/sap/ushell/components/shell/ProductSwitch/Component.js +7 -7
- package/src/main/js/sap/ushell/components/shell/Search/Component.js +5 -4
- package/src/main/js/sap/ushell/components/shell/Search/ESearch.js +8 -6
- package/src/main/js/sap/ushell/components/shell/Search/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/Component.js +25 -18
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchCEP.controller.js +89 -67
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/FrequentActivityProvider.js +5 -4
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/RecentSearchProvider.js +5 -4
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchServiceProvider.js +8 -6
- package/src/main/js/sap/ushell/components/shell/Settings/Component.js +7 -7
- package/src/main/js/sap/ushell/components/shell/Settings/ErrorMessageHelper.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/UserSettings.controller.js +6 -6
- package/src/main/js/sap/ushell/components/shell/Settings/appearance/Appearance.controller.js +4 -2
- package/src/main/js/sap/ushell/components/shell/Settings/homepage/HomepageEntry.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/homepage/HomepageSetting.view.xml +3 -1
- package/src/main/js/sap/ushell/components/shell/Settings/search/SearchEntry.js +95 -96
- package/src/main/js/sap/ushell/components/shell/Settings/userAccount/UserAccountEntry.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/userAccount/UserAccountSelector.controller.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/userAccount/UserAccountSetting.fragment.xml +7 -1
- package/src/main/js/sap/ushell/components/shell/Settings/userActivities/UserActivitiesSetting.controller.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/userActivities/UserActivitiesSetting.view.xml +7 -1
- package/src/main/js/sap/ushell/components/shell/Settings/userDefaults/UserDefaultsForm.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/userDefaults/controller/UserDefaultsSetting.controller.js +3 -3
- package/src/main/js/sap/ushell/components/shell/Settings/userLanguageRegion/LanguageRegionSelector.controller.js +27 -31
- package/src/main/js/sap/ushell/components/shell/Settings/userLanguageRegion/LanguageRegionSelector.view.xml +9 -2
- package/src/main/js/sap/ushell/components/shell/UserActionsMenu/Component.js +6 -6
- package/src/main/js/sap/ushell/components/shell/UserActionsMenu/UserActionsMenu.controller.js +22 -20
- package/src/main/js/sap/ushell/components/shell/UserImage/Component.js +8 -11
- package/src/main/js/sap/ushell/components/tiles/action/Configuration.controller.js +5 -4
- package/src/main/js/sap/ushell/components/tiles/applauncher/StaticTile.controller.js +1 -1
- package/src/main/js/sap/ushell/components/tiles/applauncherdynamic/DynamicTile.controller.js +5 -3
- package/src/main/js/sap/ushell/components/tiles/cdm/applauncher/StaticTile.controller.js +16 -31
- package/src/main/js/sap/ushell/components/tiles/cdm/applauncher/StaticTile.view.xml +1 -1
- package/src/main/js/sap/ushell/components/tiles/cdm/applauncherdynamic/DynamicTile.controller.js +16 -33
- package/src/main/js/sap/ushell/components/tiles/cdm/applauncherdynamic/DynamicTile.view.xml +1 -1
- package/src/main/js/sap/ushell/components/tiles/generic.js +2 -1
- package/src/main/js/sap/ushell/components/tiles/indicatorDualComparison/DualComparison.controller.js +1 -1
- package/src/main/js/sap/ushell/components/tiles/indicatorDualContribution/DualContribution.controller.js +1 -1
- package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/cache.js +12 -10
- package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/oData4Analytics.js +49 -42
- package/src/main/js/sap/ushell/components/tiles/indicatorcontribution/ContributionTile.controller.js +1 -1
- package/src/main/js/sap/ushell/components/tiles/indicatorcontribution/ContributionTile.view.js +16 -18
- package/src/main/js/sap/ushell/components/tiles/utils.js +19 -15
- package/src/main/js/sap/ushell/components/visualizationOrganizer/Component.js +31 -29
- package/src/main/js/sap/ushell/components/workPageBuilder/Component.js +18 -219
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.accessibility.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.controller.js +62 -137
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.layout.js +4 -2
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageHost.js +185 -68
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPage.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageButton.js +3 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageCell.js +3 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumn.js +3 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnRenderer.js +2 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnResizer.js +4 -7
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRenderer.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRow.js +7 -5
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRowRenderer.js +5 -5
- package/src/main/js/sap/ushell/components/workPageBuilder/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources.properties +4 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en.properties +0 -76
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en_US_saprigi.properties +66 -66
- package/src/main/js/sap/ushell/components/workPageBuilder/view/WorkPageBuilder.view.xml +8 -0
- package/src/main/js/sap/ushell/components/workPageRuntime/Component.js +2 -2
- package/src/main/js/sap/ushell/components/workPageRuntime/controller/WorkPageRuntime.controller.js +4 -7
- package/src/main/js/sap/ushell/components/workPageRuntime/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/workPageRuntime/view/WorkPageRuntime.view.xml +15 -8
- package/src/main/js/sap/ushell/designtime/ApplicationContainer.designtime.js +1 -1
- package/src/main/js/sap/ushell/iconfonts.js +1 -1
- package/src/main/js/sap/ushell/library.js +28 -26
- package/src/main/js/sap/ushell/navigationMode.js +4 -6
- package/src/main/js/sap/ushell/performance/FesrEnhancer.js +97 -18
- package/src/main/js/sap/ushell/performance/ShellAnalytics.js +7 -7
- package/src/main/js/sap/ushell/performance/StatisticalRecord.js +78 -23
- package/src/main/js/sap/ushell/plugins/BaseRTAPlugin.js +4 -3
- package/src/main/js/sap/ushell/plugins/appwarmup/Component.js +1 -1
- package/src/main/js/sap/ushell/plugins/rta/i18n/i18n_en.properties +0 -10
- package/src/main/js/sap/ushell/plugins/rta/i18n/i18n_en_US_saprigi.properties +8 -8
- package/src/main/js/sap/ushell/plugins/rta-personalize/Component.js +10 -6
- package/src/main/js/sap/ushell/plugins/rta-personalize/i18n/i18n_en.properties +0 -14
- package/src/main/js/sap/ushell/plugins/rta-personalize/i18n/i18n_en_US_saprigi.properties +12 -12
- package/src/main/js/sap/ushell/renderer/AccessKeysHandler.js +15 -13
- package/src/main/js/sap/ushell/renderer/LogonFrameProvider.js +7 -7
- package/src/main/js/sap/ushell/renderer/Renderer.js +163 -221
- package/src/main/js/sap/ushell/renderer/Shell.controller.js +133 -163
- package/src/main/js/sap/ushell/renderer/Shell.view.js +13 -14
- package/src/main/js/sap/ushell/renderer/allMyApps/AllMyApps.controller.js +65 -14
- package/src/main/js/sap/ushell/renderer/allMyApps/AllMyAppsManager.js +40 -17
- package/src/main/js/sap/ushell/renderer/resources/resources.properties +9 -3
- package/src/main/js/sap/ushell/renderer/resources/resources_ca.properties +5 -5
- package/src/main/js/sap/ushell/renderer/resources/resources_en.properties +18 -951
- package/src/main/js/sap/ushell/renderer/resources/resources_en_US_saprigi.properties +991 -991
- package/src/main/js/sap/ushell/renderer/search/searchComponent/Component.js +8 -2
- package/src/main/js/sap/ushell/renderer/search/searchComponent/controller/CEPSearchApp.controller.js +20 -13
- package/src/main/js/sap/ushell/renderer/search/searchComponent/controller/SearchApp.controller.js +13 -9
- package/src/main/js/sap/ushell/renderer/search/searchComponent/manifest.json +1 -1
- package/src/main/js/sap/ushell/renderer/search/searchComponent/view/CEPSearchApp.view.js +1 -1
- package/src/main/js/sap/ushell/renderer/search/searchComponent/view/SearchApp.view.js +1 -1
- package/src/main/js/sap/ushell/renderer/search/util.js +5 -7
- package/src/main/js/sap/ushell/renderer/utils.js +6 -6
- package/src/main/js/sap/ushell/renderers/fiori2/Renderer.js +14 -11
- package/src/main/js/sap/ushell/renderers/fiori2/RendererExtensions.js +50 -42
- package/src/main/js/sap/ushell/resources.js +3 -3
- package/src/main/js/sap/ushell/services/AllMyApps.js +2 -3
- package/src/main/js/sap/ushell/services/AppConfiguration.js +56 -15
- package/src/main/js/sap/ushell/services/AppLifeCycle.js +14 -29
- package/src/main/js/sap/ushell/services/AppState.js +39 -28
- package/src/main/js/sap/ushell/services/Bookmark.js +18 -45
- package/src/main/js/sap/ushell/services/BookmarkV2.js +118 -120
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution.js +20 -22
- package/src/main/js/sap/ushell/services/CommonDataModel.js +31 -94
- package/src/main/js/sap/ushell/services/Configuration.js +5 -5
- package/src/main/js/sap/ushell/services/ConfigurationDefaults.js +2 -3
- package/src/main/js/sap/ushell/services/Container.js +6 -5
- package/src/main/js/sap/ushell/services/ContentExtensionAdapterFactory.js +7 -5
- package/src/main/js/sap/ushell/services/CrossApplicationNavigation.js +80 -98
- package/src/main/js/sap/ushell/services/DarkModeSupport.js +6 -6
- package/src/main/js/sap/ushell/services/EndUserFeedback.js +17 -15
- package/src/main/js/sap/ushell/services/Extension/FloatingContainer.js +139 -67
- package/src/main/js/sap/ushell/services/Extension/Footer.js +2 -1
- package/src/main/js/sap/ushell/services/Extension/Header.js +9 -16
- package/src/main/js/sap/ushell/services/Extension/Item.js +12 -8
- package/src/main/js/sap/ushell/services/Extension/SidePane.js +5 -5
- package/src/main/js/sap/ushell/services/Extension/ToolArea.js +5 -5
- package/src/main/js/sap/ushell/services/Extension.js +12 -13
- package/src/main/js/sap/ushell/services/FlpLaunchPage.js +1791 -0
- package/src/main/js/sap/ushell/services/LaunchPage.js +653 -1715
- package/src/main/js/sap/ushell/services/Menu.js +3 -3
- package/src/main/js/sap/ushell/services/Message.js +16 -9
- package/src/main/js/sap/ushell/services/MessageBroker.js +6 -6
- package/src/main/js/sap/ushell/services/NavTargetResolution.js +25 -28
- package/src/main/js/sap/ushell/services/Navigation/utils.js +1 -1
- package/src/main/js/sap/ushell/services/Navigation.js +17 -16
- package/src/main/js/sap/ushell/services/NavigationDataProvider.js +2 -2
- package/src/main/js/sap/ushell/services/Notifications.js +55 -38
- package/src/main/js/sap/ushell/services/NotificationsV2.js +122 -49
- package/src/main/js/sap/ushell/services/PageBuilding.js +3 -4
- package/src/main/js/sap/ushell/services/PagePersistence.js +3 -3
- package/src/main/js/sap/ushell/services/PageReferencing.js +2 -2
- package/src/main/js/sap/ushell/services/Pages.js +295 -320
- package/src/main/js/sap/ushell/services/Personalization.js +40 -37
- package/src/main/js/sap/ushell/services/PersonalizationV2/ContextContainer.js +27 -24
- package/src/main/js/sap/ushell/services/PersonalizationV2/Personalizer.js +7 -4
- package/src/main/js/sap/ushell/services/PersonalizationV2/TransientPersonalizer.js +2 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/Variant.js +7 -4
- package/src/main/js/sap/ushell/services/PersonalizationV2/VariantSet.js +10 -11
- package/src/main/js/sap/ushell/services/PersonalizationV2/VariantSetAdapter.js +10 -10
- package/src/main/js/sap/ushell/services/PersonalizationV2/WindowAdapter.js +2 -2
- package/src/main/js/sap/ushell/services/PersonalizationV2/WindowAdapterContainer.js +5 -5
- package/src/main/js/sap/ushell/services/PersonalizationV2/constants.js +1 -1
- package/src/main/js/sap/ushell/services/PersonalizationV2.js +10 -9
- package/src/main/js/sap/ushell/services/PluginManager.js +77 -75
- package/src/main/js/sap/ushell/services/ReferenceResolver.js +36 -38
- package/src/main/js/sap/ushell/services/Search.js +4 -4
- package/src/main/js/sap/ushell/services/SearchCEP.js +2 -3
- package/src/main/js/sap/ushell/services/SearchableContent.js +93 -80
- package/src/main/js/sap/ushell/services/ShellNavigation.js +160 -450
- package/src/main/js/sap/ushell/services/ShellNavigationHashChanger.js +27 -26
- package/src/main/js/sap/ushell/services/ShellNavigationInternal.js +532 -0
- package/src/main/js/sap/ushell/services/SmartNavigation.js +23 -23
- package/src/main/js/sap/ushell/services/SpaceContent.js +4 -4
- package/src/main/js/sap/ushell/services/SupportTicket.js +4 -5
- package/src/main/js/sap/ushell/services/UITracer.js +2 -2
- package/src/main/js/sap/ushell/services/URLParsing.js +15 -14
- package/src/main/js/sap/ushell/services/URLShortening.js +1 -1
- package/src/main/js/sap/ushell/services/URLTemplate.js +2 -2
- package/src/main/js/sap/ushell/services/Ui5ComponentLoader.js +47 -10
- package/src/main/js/sap/ushell/services/UsageAnalytics.js +25 -9
- package/src/main/js/sap/ushell/services/UserDefaultParameterPersistence.js +11 -11
- package/src/main/js/sap/ushell/services/UserDefaultParameters.js +34 -41
- package/src/main/js/sap/ushell/services/UserInfo.js +29 -53
- package/src/main/js/sap/ushell/services/UserRecents/RecentActivity.js +480 -0
- package/src/main/js/sap/ushell/services/UserRecents/RecentAppsUsage.js +207 -0
- package/src/main/js/sap/ushell/services/UserRecents/RecentsList.js +119 -0
- package/src/main/js/sap/ushell/services/{_UserRecents → UserRecents}/UserRecentsBase.js +41 -9
- package/src/main/js/sap/ushell/services/UserRecents.js +185 -188
- package/src/main/js/sap/ushell/services/VisualizationDataProvider.js +42 -41
- package/src/main/js/sap/ushell/services/VisualizationInstantiation.js +27 -26
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Formatter.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundIndex.js +6 -6
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundProvider.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/ParameterMapping.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/PrelaunchOperations.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Search.js +7 -9
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/StagedLogger.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/SystemContext.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Utils.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/VirtualInbounds.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/XAppStateProcessing.js +2 -2
- package/src/main/js/sap/ushell/services/_CommonDataModel/PersonalizationProcessor.js +5 -7
- package/src/main/js/sap/ushell/services/_CommonDataModel/SiteConverter.js +2 -2
- package/src/main/js/sap/ushell/services/_CommonDataModel/vizTypeDefaults/VizTypeDefaults.js +105 -0
- package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/ContentExtensionAdapterConfig.js +1 -1
- package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/FeaturedGroupConfig.js +1 -1
- package/src/main/js/sap/ushell/services/_CrossApplicationNavigation/utils.js +1 -1
- package/src/main/js/sap/ushell/services/_MessageBroker/MessageBrokerEngine.js +19 -37
- package/src/main/js/sap/ushell/services/_PageReferencing/PageReferencer.js +1 -1
- package/src/main/js/sap/ushell/services/_Personalization/ContextContainer.js +28 -29
- package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainer.js +10 -10
- package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainerVariant.js +7 -5
- package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainerVariantSet.js +9 -6
- package/src/main/js/sap/ushell/services/_Personalization/Personalizer.js +9 -18
- package/src/main/js/sap/ushell/services/_Personalization/TransientPersonalizer.js +4 -11
- package/src/main/js/sap/ushell/services/_Personalization/Variant.js +11 -9
- package/src/main/js/sap/ushell/services/_Personalization/VariantSet.js +6 -5
- package/src/main/js/sap/ushell/services/_Personalization/utils.js +1 -2
- package/src/main/js/sap/ushell/services/_PluginManager/Extensions.js +1 -1
- package/src/main/js/sap/ushell/services/_PluginManager/HeaderExtensions.js +1 -1
- package/src/main/js/sap/ushell/services/_PluginManager/MenuExtensions.js +1 -1
- package/src/main/js/sap/ushell/services/_Ui5ComponentLoader/utils.js +8 -22
- package/src/main/js/sap/ushell/services/appstate/Sequentializer.js +1 -1
- package/src/main/js/sap/ushell/services/appstate/SequentializingAdapter.js +3 -5
- package/src/main/js/sap/ushell/services/appstate/WindowAdapter.js +13 -12
- package/src/main/js/sap/ushell/services/personalization/VariantSetAdapter.js +2 -2
- package/src/main/js/sap/ushell/support/plugins/flpConfig/FlpConfigurationPlugin.js +26 -22
- package/src/main/js/sap/ushell/themes/base/Catalog.less +12 -1
- package/src/main/js/sap/ushell/themes/base/ContentFinder.less +1 -0
- package/src/main/js/sap/ushell/themes/base/SearchCEP.less +9 -0
- package/src/main/js/sap/ushell/themes/base/img/SAPLogo.svg +1 -1
- package/src/main/js/sap/ushell/themes/base/img/launchicons/114_iPhone-Retina_Web_Clip.png +0 -0
- package/src/main/js/sap/ushell/themes/base/img/launchicons/144_iPad_Retina_Web_Clip.png +0 -0
- package/src/main/js/sap/ushell/themes/base/img/launchicons/57_iPhone_Desktop_Launch.png +0 -0
- package/src/main/js/sap/ushell/themes/base/img/launchicons/72_iPad_Desktop_Launch.png +0 -0
- package/src/main/js/sap/ushell/themes/base/img/launchpad_favicon.ico +0 -0
- package/src/main/js/sap/ushell/themes/sap_horizon/ShellHeader.less +0 -1
- package/src/main/js/sap/ushell/themes/sap_horizon_dark/ShellHeader.less +0 -1
- package/src/main/js/sap/ushell/themes/sap_horizon_hcb/ShellHeader.less +0 -1
- package/src/main/js/sap/ushell/themes/sap_horizon_hcw/ShellHeader.less +0 -1
- package/src/main/js/sap/ushell/ui/AppContainer.js +17 -22
- package/src/main/js/sap/ushell/ui/AppContainerRenderer.js +4 -6
- package/src/main/js/sap/ushell/ui/ContentNodeSelector.js +8 -9
- package/src/main/js/sap/ushell/ui/ContentNodeTreeItem.js +2 -3
- package/src/main/js/sap/ushell/ui/QuickAccess.js +90 -81
- package/src/main/js/sap/ushell/ui/ShellHeader.js +26 -25
- package/src/main/js/sap/ushell/ui/ShellHeaderRenderer.js +2 -1
- package/src/main/js/sap/ushell/ui/appfinder/AppBox.js +20 -7
- package/src/main/js/sap/ushell/ui/appfinder/AppBoxRenderer.js +9 -0
- package/src/main/js/sap/ushell/ui/appfinder/PinButton.js +7 -6
- package/src/main/js/sap/ushell/ui/appfinder/PinButtonRenderer.js +2 -1
- package/src/main/js/sap/ushell/ui/cards/FrequentActivitiesExtension.js +4 -4
- package/src/main/js/sap/ushell/ui/cards/RecentActivitiesExtension.js +5 -5
- package/src/main/js/sap/ushell/ui/footerbar/AboutButton.js +8 -13
- package/src/main/js/sap/ushell/ui/footerbar/AddBookmarkButton.js +10 -12
- package/src/main/js/sap/ushell/ui/footerbar/ContactSupportButton.js +22 -229
- package/src/main/js/sap/ushell/ui/footerbar/ContactSupportDialog.controller.js +116 -0
- package/src/main/js/sap/ushell/ui/footerbar/ContactSupportDialog.fragment.xml +85 -0
- package/src/main/js/sap/ushell/ui/footerbar/JamDiscussButton.js +8 -12
- package/src/main/js/sap/ushell/ui/footerbar/JamShareButton.js +9 -18
- package/src/main/js/sap/ushell/ui/footerbar/LogoutButton.js +8 -12
- package/src/main/js/sap/ushell/ui/footerbar/SaveAsTile.controller.js +4 -1
- package/src/main/js/sap/ushell/ui/footerbar/SaveAsTile.view.js +4 -1
- package/src/main/js/sap/ushell/ui/footerbar/SendAsEmailButton.js +6 -13
- package/src/main/js/sap/ushell/ui/launchpad/AccessibilityCustomData.js +4 -5
- package/src/main/js/sap/ushell/ui/launchpad/ActionItem.js +5 -4
- package/src/main/js/sap/ushell/ui/launchpad/AnchorItem.js +8 -11
- package/src/main/js/sap/ushell/ui/launchpad/AnchorItemRenderer.js +6 -2
- package/src/main/js/sap/ushell/ui/launchpad/AnchorNavigationBar.js +22 -19
- package/src/main/js/sap/ushell/ui/launchpad/AnchorNavigationBarRenderer.js +6 -1
- package/src/main/js/sap/ushell/ui/launchpad/CatalogEntryContainer.js +10 -6
- package/src/main/js/sap/ushell/ui/launchpad/CatalogsContainer.js +9 -5
- package/src/main/js/sap/ushell/ui/launchpad/DashboardGroupsContainer.js +9 -5
- package/src/main/js/sap/ushell/ui/launchpad/DashboardGroupsContainerRenderer.js +6 -1
- package/src/main/js/sap/ushell/ui/launchpad/ExtendedChangeDetection.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/GroupHeaderActions.js +7 -9
- package/src/main/js/sap/ushell/ui/launchpad/GroupListItem.js +59 -67
- package/src/main/js/sap/ushell/ui/launchpad/GroupListItemRenderer.js +15 -15
- package/src/main/js/sap/ushell/ui/launchpad/LinkTileWrapper.js +4 -4
- package/src/main/js/sap/ushell/ui/launchpad/LinkTileWrapperRenderer.js +2 -1
- package/src/main/js/sap/ushell/ui/launchpad/LoadingDialog.js +7 -11
- package/src/main/js/sap/ushell/ui/launchpad/LoadingDialogRenderer.js +2 -2
- package/src/main/js/sap/ushell/ui/launchpad/Page.js +8 -12
- package/src/main/js/sap/ushell/ui/launchpad/PageRenderer.js +2 -1
- package/src/main/js/sap/ushell/ui/launchpad/PlusTile.js +5 -11
- package/src/main/js/sap/ushell/ui/launchpad/PlusTileRenderer.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/Section.js +14 -26
- package/src/main/js/sap/ushell/ui/launchpad/SectionRenderer.js +3 -2
- package/src/main/js/sap/ushell/ui/launchpad/Tile.js +10 -13
- package/src/main/js/sap/ushell/ui/launchpad/TileContainer.js +10 -11
- package/src/main/js/sap/ushell/ui/launchpad/TileContainerRenderer.js +3 -2
- package/src/main/js/sap/ushell/ui/launchpad/TileRenderer.js +2 -1
- package/src/main/js/sap/ushell/ui/launchpad/TileState.js +8 -81
- package/src/main/js/sap/ushell/ui/launchpad/TileStateInternal.js +119 -0
- package/src/main/js/sap/ushell/ui/launchpad/TileStateInternalRenderer.js +72 -0
- package/src/main/js/sap/ushell/ui/launchpad/TileStateRenderer.js +4 -65
- package/src/main/js/sap/ushell/ui/launchpad/ViewPortState.js +6 -7
- package/src/main/js/sap/ushell/{services/_VisualizationInstantiation → ui/launchpad}/VizInstance.js +86 -78
- package/src/main/js/sap/ushell/{services/_VisualizationInstantiation → ui/launchpad}/VizInstanceAbap.js +6 -5
- package/src/main/js/sap/ushell/ui/launchpad/VizInstanceBase.js +40 -0
- package/src/main/js/sap/ushell/{services/_VisualizationInstantiation → ui/launchpad}/VizInstanceCdm.js +13 -11
- package/src/main/js/sap/ushell/{services/_VisualizationInstantiation → ui/launchpad}/VizInstanceLaunchPage.js +10 -7
- package/src/main/js/sap/ushell/{services/_VisualizationInstantiation → ui/launchpad}/VizInstanceLink.js +9 -61
- package/src/main/js/sap/ushell/ui/launchpad/section/CompactArea.js +8 -6
- package/src/main/js/sap/ushell/ui/launchpad/section/CompactAreaRenderer.js +2 -1
- package/src/main/js/sap/ushell/ui/shell/ContentRenderer.js +3 -3
- package/src/main/js/sap/ushell/ui/shell/FloatingContainer.js +10 -8
- package/src/main/js/sap/ushell/ui/shell/RightFloatingContainer.js +3 -3
- package/src/main/js/sap/ushell/ui/shell/ShellAppTitle.js +32 -34
- package/src/main/js/sap/ushell/ui/shell/ShellFloatingAction.js +9 -6
- package/src/main/js/sap/ushell/ui/shell/ShellFloatingActionRenderer.js +1 -3
- package/src/main/js/sap/ushell/ui/shell/ShellHeadItem.js +4 -7
- package/src/main/js/sap/ushell/ui/shell/ShellNavigationMenu.js +8 -8
- package/src/main/js/sap/ushell/ui/shell/SysInfoBar.js +3 -8
- package/src/main/js/sap/ushell/ui/shell/ToolArea.js +2 -2
- package/src/main/js/sap/ushell/ui/shell/ToolAreaItem.js +1 -1
- package/src/main/js/sap/ushell/ui/tile/DynamicTile.js +6 -8
- package/src/main/js/sap/ushell/ui/tile/DynamicTileRenderer.js +1 -1
- package/src/main/js/sap/ushell/ui/tile/ImageTile.js +4 -5
- package/src/main/js/sap/ushell/ui/tile/ImageTileRenderer.js +5 -6
- package/src/main/js/sap/ushell/ui/tile/StaticTile.js +4 -5
- package/src/main/js/sap/ushell/ui/tile/StaticTileRenderer.js +5 -6
- package/src/main/js/sap/ushell/ui/tile/TileBase.js +5 -8
- package/src/main/js/sap/ushell/ui/tile/TileBaseRenderer.js +3 -3
- package/src/main/js/sap/ushell/ui/utils.js +2 -4
- package/src/main/js/sap/ushell/ui5service/ShellUIService.js +8 -9
- package/src/main/js/sap/ushell/ui5service/UserStatus.js +11 -12
- package/src/main/js/sap/ushell/ui5service/_ShellUIService/shelluiservice.class.factory.js +6 -8
- package/src/main/js/sap/ushell/utils/DynamicTileRequest.js +5 -3
- package/src/main/js/sap/ushell/utils/HttpClient.js +6 -7
- package/src/main/js/sap/ushell/utils/RestrictedJSONModel.js +1 -1
- package/src/main/js/sap/ushell/utils/UrlParsing.js +5 -14
- package/src/main/js/sap/ushell/utils/UrlShortening.js +4 -4
- package/src/main/js/sap/ushell/utils/chipsUtils.js +10 -10
- package/src/main/js/sap/ushell/utils/workpage/WorkPageService.js +234 -0
- package/src/main/js/sap/ushell/utils/workpage/WorkPageVizInstantiation.js +141 -0
- package/src/main/js/sap/ushell/utils.js +17 -13
- package/src/test/js/sap/ushell/bootstrap/sandbox.js +1 -1
- package/ui5.yaml +6 -2
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaAgent/i18n/i18n_cnr.properties +0 -10
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaShell/i18n/i18n_cnr.properties +0 -4
- package/src/main/js/sap/ushell/components/cepsearchresult/app/cards/searchresultwidget/i18n/i18n_cnr.properties +0 -41
- package/src/main/js/sap/ushell/components/cepsearchresult/app/i18n/i18n_cnr.properties +0 -19
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/i18n/i18n_cnr.properties +0 -117
- package/src/main/js/sap/ushell/components/container/resources/resources_cnr.properties +0 -10
- package/src/main/js/sap/ushell/components/contentFinder/resources/resources_cnr.properties +0 -29
- package/src/main/js/sap/ushell/components/contentFinder/view/AppSearchPaginated.view.xml +0 -137
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_cnr.properties +0 -78
- package/src/main/js/sap/ushell/components/workPageRuntime/services/NavigationResolver.js +0 -115
- package/src/main/js/sap/ushell/components/workPageRuntime/services/WorkPage.js +0 -130
- package/src/main/js/sap/ushell/plugins/rta/i18n/i18n_cnr.properties +0 -13
- package/src/main/js/sap/ushell/plugins/rta-personalize/i18n/i18n_cnr.properties +0 -24
- package/src/main/js/sap/ushell/renderer/allMyApps/AllMyAppsKeyboardHandler.js +0 -108
- package/src/main/js/sap/ushell/renderer/resources/resources_cnr.properties +0 -993
- package/src/main/js/sap/ushell/renderers/fiori2/allMyApps/AllMyAppsKeyboardHandler.js +0 -13
- package/src/main/js/sap/ushell/services/_UserRecents/RecentActivity.js +0 -481
- package/src/main/js/sap/ushell/services/_UserRecents/RecentAppsUsage.js +0 -207
- package/src/main/js/sap/ushell/services/_UserRecents/RecentsList.js +0 -92
- package/src/main/js/sap/ushell/themes/base/img/launchpadDefaultIcon.jpg +0 -0
- /package/src/main/js/sap/ushell/{services/_VisualizationInstantiation → ui/launchpad}/VizInstanceRenderer.js +0 -0
|
@@ -5,2535 +5,14 @@
|
|
|
5
5
|
* 'CDM' platform - Version 3 (V3)
|
|
6
6
|
*
|
|
7
7
|
* @deprecated since 1.100
|
|
8
|
-
* @version 1.
|
|
8
|
+
* @version 1.121.0
|
|
9
9
|
*/
|
|
10
10
|
sap.ui.define([
|
|
11
|
-
"sap/ushell/adapters/cdm/v3/
|
|
12
|
-
"sap/ushell/adapters/cdm/_LaunchPage/modifyHome",
|
|
13
|
-
"sap/ushell/adapters/cdm/v3/_LaunchPage/readCatalogs",
|
|
14
|
-
"sap/m/library",
|
|
15
|
-
"sap/ushell/utils",
|
|
16
|
-
"sap/ushell/utils/WindowUtils",
|
|
17
|
-
"sap/ushell/utils/UrlParsing",
|
|
18
|
-
"sap/ushell/adapters/cdm/v3/utilsCdm",
|
|
19
|
-
"sap/ushell/components/tiles/utils",
|
|
20
|
-
"sap/ushell/adapters/cdm/v3/AdapterBase",
|
|
21
|
-
"sap/ushell/adapters/cdm/v3/_LaunchPage/readVisualizations",
|
|
22
|
-
"sap/ushell/adapters/cdm/v3/_LaunchPage/readApplications",
|
|
23
|
-
"sap/ushell/navigationMode",
|
|
24
|
-
"sap/ushell/Config",
|
|
25
|
-
"sap/ui/model/json/JSONModel",
|
|
26
|
-
"sap/ui/thirdparty/jquery",
|
|
27
|
-
"sap/base/util/deepExtend",
|
|
28
|
-
"sap/base/util/isEmptyObject",
|
|
29
|
-
"sap/base/util/ObjectPath",
|
|
30
|
-
"sap/base/Log",
|
|
31
|
-
"sap/ushell/EventHub"
|
|
11
|
+
"sap/ushell/adapters/cdm/v3/FlpLaunchPageAdapter"
|
|
32
12
|
], function (
|
|
33
|
-
|
|
34
|
-
oModifyHomePageUtils,
|
|
35
|
-
oReadCatalog,
|
|
36
|
-
mobileLibrary,
|
|
37
|
-
oUshellUtils,
|
|
38
|
-
WindowUtils,
|
|
39
|
-
urlParsing,
|
|
40
|
-
oUtilsCdm,
|
|
41
|
-
oUtils,
|
|
42
|
-
AdapterBase,
|
|
43
|
-
oReadVisualization,
|
|
44
|
-
oReadApplications,
|
|
45
|
-
navigationMode,
|
|
46
|
-
Config,
|
|
47
|
-
JSONModel,
|
|
48
|
-
jQuery,
|
|
49
|
-
deepExtend,
|
|
50
|
-
isEmptyObject,
|
|
51
|
-
ObjectPath,
|
|
52
|
-
Log,
|
|
53
|
-
EventHub
|
|
13
|
+
FlpLaunchPageAdapter
|
|
54
14
|
) {
|
|
55
15
|
"use strict";
|
|
56
16
|
|
|
57
|
-
//
|
|
58
|
-
var oGenericTileMode = mobileLibrary.GenericTileMode;
|
|
59
|
-
|
|
60
|
-
/* global hasher */
|
|
61
|
-
|
|
62
|
-
var STATIC_TILE_COMPONENT_NAME = "sap.ushell.components.tiles.cdm.applauncher";
|
|
63
|
-
var DYNAMIC_TILE_COMPONENT_NAME = "sap.ushell.components.tiles.cdm.applauncherdynamic";
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* This method MUST be called by the Unified Shell's container only.
|
|
67
|
-
* Constructs a new instance of the LaunchPageAdapter for the 'CDM' platform.
|
|
68
|
-
*
|
|
69
|
-
* @param {object} oUnused
|
|
70
|
-
* the system served by the adapter
|
|
71
|
-
* @param {string} sParameter
|
|
72
|
-
* parameter as string (legacy, was used before oAdapterConfiguration was added)
|
|
73
|
-
* @param {oject} oAdapterConfiguration
|
|
74
|
-
* configuration for the adapter.
|
|
75
|
-
*
|
|
76
|
-
* @class
|
|
77
|
-
*
|
|
78
|
-
* @since 1.15.0
|
|
79
|
-
* @deprecated since 1.100
|
|
80
|
-
*/
|
|
81
|
-
function LaunchPageAdapter (oUnused, sParameter, oAdapterConfiguration) {
|
|
82
|
-
AdapterBase.call(this, oUnused, sParameter, oAdapterConfiguration);
|
|
83
|
-
Promise.all([
|
|
84
|
-
sap.ushell.Container.getServiceAsync("URLParsing"),
|
|
85
|
-
sap.ushell.Container.getServiceAsync("CommonDataModel")
|
|
86
|
-
]).then(function (aServices) {
|
|
87
|
-
this.oURLParsingService = aServices[0]; // It is not used internally. Keep it for back compatibility.
|
|
88
|
-
this.oCDMService = aServices[1];
|
|
89
|
-
}.bind(this));
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Returns the tile resolution result in the context of a given site.
|
|
93
|
-
*
|
|
94
|
-
* @param {function} fnResolver
|
|
95
|
-
* The resolve function. Must take <code>sIntent</code> and return a
|
|
96
|
-
* promise that resolves with the corresponding tile resolution
|
|
97
|
-
* result.
|
|
98
|
-
*
|
|
99
|
-
* @param {object} oCatalogTilePromiseCache
|
|
100
|
-
* A cache of promises that may include the tile resolution result
|
|
101
|
-
* already.
|
|
102
|
-
*
|
|
103
|
-
* @param {string} sIntent
|
|
104
|
-
* The intent to be resolved (including '#').
|
|
105
|
-
*
|
|
106
|
-
* @returns {jQuery.Promise}
|
|
107
|
-
* A promise which will be resolved with an object representing the
|
|
108
|
-
* tile resolution result, and rejected when the tile resolution
|
|
109
|
-
* failed.
|
|
110
|
-
*
|
|
111
|
-
* @private
|
|
112
|
-
*/
|
|
113
|
-
this._getTileFromHashInContextOfSite = function (fnResolver, oCatalogTilePromiseCache, sIntent) {
|
|
114
|
-
var oDeferred = new jQuery.Deferred();
|
|
115
|
-
var oCatalogTilePromise = oCatalogTilePromiseCache[sIntent];
|
|
116
|
-
|
|
117
|
-
if (!oCatalogTilePromise) {
|
|
118
|
-
// only call resolve if it was not resolved before
|
|
119
|
-
oCatalogTilePromise = fnResolver(sIntent);
|
|
120
|
-
|
|
121
|
-
// store promise for the next call
|
|
122
|
-
oCatalogTilePromiseCache[sIntent] = oCatalogTilePromise;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
oCatalogTilePromise.done(function (oTileIntentResolutionResult) {
|
|
126
|
-
var oTileResolutionResult = {
|
|
127
|
-
tileIntent: sIntent,
|
|
128
|
-
tileResolutionResult: oTileIntentResolutionResult
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
oDeferred.resolve(oTileResolutionResult);
|
|
132
|
-
}).fail(function (sErrorMsg) {
|
|
133
|
-
oDeferred.reject("Hash '" + sIntent + "' could not be resolved to a tile. " + sErrorMsg);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
return oDeferred.promise();
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Construct an appropriate tile by resolving a given intent.
|
|
141
|
-
*
|
|
142
|
-
* @param {string} sIntent
|
|
143
|
-
* Intent to be resolved including leading "#"
|
|
144
|
-
*
|
|
145
|
-
* @returns {jQuery.Promise}
|
|
146
|
-
* A promise which will be resolved with an object representing the
|
|
147
|
-
* tile resolution result, and rejected when the tile resolution
|
|
148
|
-
* failed.
|
|
149
|
-
*
|
|
150
|
-
* @private
|
|
151
|
-
*/
|
|
152
|
-
this._getTileFromHash = function (sIntent) {
|
|
153
|
-
var oDeferred = new jQuery.Deferred();
|
|
154
|
-
|
|
155
|
-
sap.ushell.Container.getServiceAsync("ClientSideTargetResolution").then(function (oCstrService) {
|
|
156
|
-
var fnResolveTile = oCstrService.resolveTileIntent.bind(oCstrService);
|
|
157
|
-
this._getTileFromHashInContextOfSite(fnResolveTile, this._mCatalogTilePromises, sIntent)
|
|
158
|
-
.done(oDeferred.resolve)
|
|
159
|
-
.fail(oDeferred.reject);
|
|
160
|
-
}.bind(this));
|
|
161
|
-
|
|
162
|
-
return oDeferred.promise();
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Construct an appropriate tile from an URL.
|
|
167
|
-
* @param {object} oTile
|
|
168
|
-
* tile with indicatorDataSource
|
|
169
|
-
* @returns {object}
|
|
170
|
-
* The tile resolution result
|
|
171
|
-
*
|
|
172
|
-
* @private
|
|
173
|
-
*/
|
|
174
|
-
this._getTileForUrl = function (oTile) {
|
|
175
|
-
var oTileComponentLoadInfo = {
|
|
176
|
-
componentName: oTile.indicatorDataSource ? DYNAMIC_TILE_COMPONENT_NAME : STATIC_TILE_COMPONENT_NAME
|
|
177
|
-
};
|
|
178
|
-
return {
|
|
179
|
-
tileIntent: "#",
|
|
180
|
-
tileResolutionResult: {
|
|
181
|
-
tileComponentLoadInfo: oTileComponentLoadInfo,
|
|
182
|
-
isCustomTile: false
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Constructs the hash for a given tile object. Additionaly parameters
|
|
189
|
-
* get formatted.
|
|
190
|
-
*
|
|
191
|
-
* @param {object} oTile
|
|
192
|
-
* Tile object for which the hash should be constructed.
|
|
193
|
-
* @returns {string} constructed hash or <code>undefined</code>
|
|
194
|
-
* in case something went wrong.
|
|
195
|
-
*
|
|
196
|
-
* @private
|
|
197
|
-
*/
|
|
198
|
-
this._prepareTileHash = function (oTile) {
|
|
199
|
-
var oParams = {};
|
|
200
|
-
|
|
201
|
-
if (this._isCatalogTile(oTile)) {
|
|
202
|
-
return oTile.tileIntent;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (this._isGroupTile(oTile) && oTile.target) {
|
|
206
|
-
// TODO use hash from _mResolvedTiles if tile has been already resolved
|
|
207
|
-
var aRawParams = oTile.target.parameters || [];
|
|
208
|
-
aRawParams.forEach(function (oParameter) {
|
|
209
|
-
if (oParameter.name && oParameter.value) {
|
|
210
|
-
oParams[oParameter.name] = [oParameter.value];
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
var oTarget = {
|
|
215
|
-
target: {
|
|
216
|
-
semanticObject: oTile.target.semanticObject,
|
|
217
|
-
action: oTile.target.action
|
|
218
|
-
},
|
|
219
|
-
params: oParams,
|
|
220
|
-
appSpecificRoute: oTile.target.appSpecificRoute
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
return "#" + urlParsing.constructShellHash(oTarget);
|
|
224
|
-
}
|
|
225
|
-
return undefined;
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Returns the default group.
|
|
230
|
-
*
|
|
231
|
-
* @returns {jQuery.Promise}
|
|
232
|
-
* In case of success its <code>done</code> handler is called with the default
|
|
233
|
-
* group as an argument. In case of failure an error message gets passed to the
|
|
234
|
-
* fail handler.
|
|
235
|
-
*
|
|
236
|
-
* @public
|
|
237
|
-
*/
|
|
238
|
-
this.getDefaultGroup = function () {
|
|
239
|
-
var oDeferred = new jQuery.Deferred();
|
|
240
|
-
var oAssureLoadedDeferred;
|
|
241
|
-
var that = this;
|
|
242
|
-
// check whether assureLoaded was already called.
|
|
243
|
-
// The default group is not set before.
|
|
244
|
-
if (!this._oDefaultGroup) {
|
|
245
|
-
oAssureLoadedDeferred = this._ensureLoaded();
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
if (oAssureLoadedDeferred) {
|
|
249
|
-
oAssureLoadedDeferred
|
|
250
|
-
.done(function () {
|
|
251
|
-
oDeferred.resolve(that._oDefaultGroup);
|
|
252
|
-
})
|
|
253
|
-
.fail(function (sMessage) {
|
|
254
|
-
oDeferred.reject("Failed to access default group. " + sMessage);
|
|
255
|
-
});
|
|
256
|
-
} else {
|
|
257
|
-
oDeferred.resolve(that._oDefaultGroup);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
return oDeferred.promise();
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Adds a group to the homepage. Furthermore the personalization will be
|
|
265
|
-
* persisted for the end user.
|
|
266
|
-
*
|
|
267
|
-
* @param {string} sTitle
|
|
268
|
-
* Group title
|
|
269
|
-
* @returns {jQuery.Promise}
|
|
270
|
-
* A promise which will be resolved when group has been added successfully.
|
|
271
|
-
* The group object itself and the group id will be passed to the promise's
|
|
272
|
-
* done handler. In case of failure, the fail handler will be called with
|
|
273
|
-
* a respective error message.
|
|
274
|
-
*/
|
|
275
|
-
this.addGroup = function (sTitle) {
|
|
276
|
-
var oDeferred = new jQuery.Deferred();
|
|
277
|
-
var sGeneratedId;
|
|
278
|
-
var that = this;
|
|
279
|
-
|
|
280
|
-
if (!this._isValidTitle(sTitle)) {
|
|
281
|
-
return oDeferred.reject("No valid group title").promise();
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
var sGenericErrorMessage = "Failed to add the group with title '" + sTitle + "' to the homepage. ";
|
|
285
|
-
|
|
286
|
-
// add group to site
|
|
287
|
-
this.oCDMService.getSite()
|
|
288
|
-
.done(function (oSite) {
|
|
289
|
-
sGeneratedId = oUshellUtils.generateUniqueId(oReadHomePageUtils.getGroupIdsFromSite(oSite));
|
|
290
|
-
|
|
291
|
-
// append the group at the end
|
|
292
|
-
oModifyHomePageUtils.addGroupToSite(oSite, oModifyHomePageUtils.createEmptyGroup(sGeneratedId, sTitle));
|
|
293
|
-
|
|
294
|
-
// store personalization
|
|
295
|
-
that.oCDMService.save()
|
|
296
|
-
.done(function () {
|
|
297
|
-
delete that._ensureLoadedDeferred;
|
|
298
|
-
oDeferred.resolve(oSite.groups[sGeneratedId], sGeneratedId);
|
|
299
|
-
})
|
|
300
|
-
.fail(function (sErrorMsg0) {
|
|
301
|
-
oDeferred.reject(sErrorMsg0);
|
|
302
|
-
});
|
|
303
|
-
})
|
|
304
|
-
.fail(function (sErrorMsg) {
|
|
305
|
-
oDeferred.reject(sGenericErrorMessage + sErrorMsg);
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
return oDeferred.promise();
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Sets a new title for a given group
|
|
313
|
-
*
|
|
314
|
-
* @param {object} oGroup
|
|
315
|
-
* Group object
|
|
316
|
-
* @param {string} sNewTitle
|
|
317
|
-
* Title which should be set
|
|
318
|
-
* @returns {jQuery.Promise}
|
|
319
|
-
* A promise which will be resolved when the group has been set successfully.
|
|
320
|
-
* In case of failure, the fail handler will be called with the old group title.
|
|
321
|
-
*/
|
|
322
|
-
this.setGroupTitle = function (oGroup, sNewTitle) {
|
|
323
|
-
var that = this;
|
|
324
|
-
var oDeferred = new jQuery.Deferred();
|
|
325
|
-
|
|
326
|
-
if (typeof oGroup !== "object" || !oReadHomePageUtils.getGroupId(oGroup)) {
|
|
327
|
-
return oDeferred.reject("Unexpected group value").promise();
|
|
328
|
-
}
|
|
329
|
-
if (!that._isValidTitle(sNewTitle)) {
|
|
330
|
-
return oDeferred.reject("Unexpected oGroup title value").promise();
|
|
331
|
-
}
|
|
332
|
-
var sGenericErrorMessage = "Failed to set new title for group with id '" +
|
|
333
|
-
oReadHomePageUtils.getGroupId(oGroup) + "'. ";
|
|
334
|
-
|
|
335
|
-
// necessary in case the renaming operation fails
|
|
336
|
-
var sOldTitle = oReadHomePageUtils.getGroupTitle(oGroup);
|
|
337
|
-
|
|
338
|
-
this.oCDMService.getSite()
|
|
339
|
-
.done(function (oSite) {
|
|
340
|
-
// adapt title
|
|
341
|
-
if (oGroup) {
|
|
342
|
-
oModifyHomePageUtils.setGroupTitle(oGroup, sNewTitle);
|
|
343
|
-
}
|
|
344
|
-
// save personalization
|
|
345
|
-
that.oCDMService.save()
|
|
346
|
-
.done(function () {
|
|
347
|
-
oDeferred.resolve();
|
|
348
|
-
})
|
|
349
|
-
.fail(function (sErrorMsg) {
|
|
350
|
-
Log.error(sErrorMsg);
|
|
351
|
-
oDeferred.reject(sOldTitle);
|
|
352
|
-
});
|
|
353
|
-
})
|
|
354
|
-
.fail(function (sError) {
|
|
355
|
-
oDeferred.reject(sOldTitle, sGenericErrorMessage + sError);
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
return oDeferred.promise();
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Hides a given set of groups on the homepage.
|
|
363
|
-
* In case an empty array gets passed, all exisiting groups
|
|
364
|
-
* on the homepage should be set to be visible.
|
|
365
|
-
*
|
|
366
|
-
* @param {object} aHiddenGroupIds
|
|
367
|
-
* Groups which should be set to be hidden
|
|
368
|
-
* @returns {jQuery.Promise}
|
|
369
|
-
* Resolves in case the groups are set to be hidden successfully.
|
|
370
|
-
* In case of failure, the promise rejects with a respective
|
|
371
|
-
* error message.
|
|
372
|
-
*/
|
|
373
|
-
this.hideGroups = function (aHiddenGroupIds) {
|
|
374
|
-
var oDeferred = new jQuery.Deferred();
|
|
375
|
-
var oCdmSiteService = this.oCDMService;
|
|
376
|
-
|
|
377
|
-
if (aHiddenGroupIds && Array.isArray(aHiddenGroupIds)) {
|
|
378
|
-
var sGenericErrorMessage = "Failed to hide group. ";
|
|
379
|
-
oCdmSiteService.getSite()
|
|
380
|
-
.done(function (oSite) {
|
|
381
|
-
oReadHomePageUtils.getGroupsArrayFromSite(oSite).forEach(function (oGroup) {
|
|
382
|
-
var bIsInList = Array.prototype.indexOf.call(aHiddenGroupIds, oReadHomePageUtils.getGroupId(oGroup)) === -1;
|
|
383
|
-
oModifyHomePageUtils.setGroupVisibility(oGroup, bIsInList);
|
|
384
|
-
});
|
|
385
|
-
|
|
386
|
-
// persist personalization
|
|
387
|
-
oCdmSiteService.save()
|
|
388
|
-
.done(function () {
|
|
389
|
-
oDeferred.resolve();
|
|
390
|
-
})
|
|
391
|
-
.fail(function (oErrorMsg0) {
|
|
392
|
-
oDeferred.reject("Hiding of groups did not work as expected - " + oErrorMsg0);
|
|
393
|
-
});
|
|
394
|
-
})
|
|
395
|
-
.fail(function (sError) {
|
|
396
|
-
oDeferred.reject(sGenericErrorMessage + sError);
|
|
397
|
-
});
|
|
398
|
-
} else {
|
|
399
|
-
oDeferred.reject("Invalid input parameter aHiddenGroupIds. Please pass a valid input parameter.");
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
return oDeferred.promise();
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* Moves a given group to a defined position
|
|
407
|
-
*
|
|
408
|
-
* @param {object} oGroup
|
|
409
|
-
* Group object
|
|
410
|
-
* @param {int} nNewIndex
|
|
411
|
-
* New index the group will be moved to
|
|
412
|
-
* @returns {jQuery.Deferred}
|
|
413
|
-
* A promise which will be resolved when the group has been moved successfully.
|
|
414
|
-
* In case of failure, the fail handler will be called with a respective error message.
|
|
415
|
-
*/
|
|
416
|
-
this.moveGroup = function (oGroup, nNewIndex) {
|
|
417
|
-
var oDeferred = new jQuery.Deferred();
|
|
418
|
-
var oCdmSiteService = this.oCDMService;
|
|
419
|
-
|
|
420
|
-
if (!oGroup || !oReadHomePageUtils.getGroupId(oGroup) || nNewIndex < 0) {
|
|
421
|
-
return oDeferred.reject("Unable to move groups - invalid parameters").promise();
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
var sGenericErrorMessage = "Failed to move group with id '" + oGroup.identification.id + "'. ";
|
|
425
|
-
// move group inside the site object
|
|
426
|
-
oCdmSiteService.getSite()
|
|
427
|
-
.done(function (oSite) {
|
|
428
|
-
var aGroupsOrder = oReadHomePageUtils.getGroupIdsFromSite(oSite);
|
|
429
|
-
var sGroupId = oReadHomePageUtils.getGroupId(oGroup);
|
|
430
|
-
|
|
431
|
-
if (!aGroupsOrder) {
|
|
432
|
-
return oDeferred.reject("groupsOrder not found - abort operation of adding a group.");
|
|
433
|
-
} if (aGroupsOrder.indexOf(sGroupId) === nNewIndex) {
|
|
434
|
-
return oDeferred.resolve();
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// move group inside the groupsOrder array
|
|
438
|
-
var aGroupsOrderAfterMove = oUshellUtils.moveElementInsideOfArray(aGroupsOrder, aGroupsOrder.indexOf(sGroupId), nNewIndex);
|
|
439
|
-
|
|
440
|
-
if (!aGroupsOrderAfterMove) {
|
|
441
|
-
return oDeferred.reject("invalid move group operation - abort.");
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
oModifyHomePageUtils.setGroupsOrder(oSite, aGroupsOrderAfterMove);
|
|
445
|
-
|
|
446
|
-
// store personalization
|
|
447
|
-
oCdmSiteService.save()
|
|
448
|
-
.done(function () {
|
|
449
|
-
oDeferred.resolve();
|
|
450
|
-
})
|
|
451
|
-
.fail(function (sErrorMsg) {
|
|
452
|
-
oDeferred.reject(sErrorMsg);
|
|
453
|
-
});
|
|
454
|
-
return undefined;
|
|
455
|
-
})
|
|
456
|
-
.fail(function (sError) {
|
|
457
|
-
oDeferred.reject(sGenericErrorMessage + sError);
|
|
458
|
-
});
|
|
459
|
-
return oDeferred.promise();
|
|
460
|
-
};
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
* Removes a given group
|
|
464
|
-
*
|
|
465
|
-
* @param {object} oGroup
|
|
466
|
-
* Group object
|
|
467
|
-
* @returns {jQuery.Deferred}
|
|
468
|
-
* A promise which will be resolved when the group has been removed successfully.
|
|
469
|
-
* In case of failure, the fail handler will be called with a respective error message.
|
|
470
|
-
*/
|
|
471
|
-
this.removeGroup = function (oGroup) {
|
|
472
|
-
var oDeferred = new jQuery.Deferred();
|
|
473
|
-
var oCdmSiteService = this.oCDMService;
|
|
474
|
-
|
|
475
|
-
if (typeof oGroup !== "object") {
|
|
476
|
-
return oDeferred.reject("invalid group parameter").promise();
|
|
477
|
-
}
|
|
478
|
-
var sGroupId = oReadHomePageUtils.getGroupId(oGroup);
|
|
479
|
-
if (!sGroupId) {
|
|
480
|
-
return oDeferred.reject("group without id given").promise();
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
var sGenericErrorMessage = "Failed to remove group with id '" + sGroupId + "'. ";
|
|
484
|
-
|
|
485
|
-
// remove group from site object
|
|
486
|
-
oCdmSiteService.getSite()
|
|
487
|
-
.done(function (oSite) {
|
|
488
|
-
oModifyHomePageUtils.removeGroupFromSite(oSite, oGroup);
|
|
489
|
-
|
|
490
|
-
oCdmSiteService.save()
|
|
491
|
-
.done(function () {
|
|
492
|
-
oDeferred.resolve();
|
|
493
|
-
})
|
|
494
|
-
.fail(function (sErrorMsg) {
|
|
495
|
-
oDeferred.reject(sErrorMsg);
|
|
496
|
-
});
|
|
497
|
-
})
|
|
498
|
-
.fail(function (sError) {
|
|
499
|
-
oDeferred.reject(sGenericErrorMessage + sError);
|
|
500
|
-
});
|
|
501
|
-
|
|
502
|
-
return oDeferred.promise();
|
|
503
|
-
};
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Resets a given group. Only groups for which <code>isGroupRemovable</code> returns
|
|
507
|
-
* false can be reset.
|
|
508
|
-
*
|
|
509
|
-
* @param {object} oGroup
|
|
510
|
-
* Group object
|
|
511
|
-
* @returns {jQuery.Deferred}
|
|
512
|
-
* A promise which will be resolved when the group has been reset successfully.
|
|
513
|
-
* In case of failure, the fail handler will be called with a respective error message
|
|
514
|
-
* and the set of groups.
|
|
515
|
-
*/
|
|
516
|
-
this.resetGroup = function (oGroup) {
|
|
517
|
-
var oDeferred = new jQuery.Deferred();
|
|
518
|
-
var oCdmSiteService = this.oCDMService;
|
|
519
|
-
var aSiteGroupsBackup = [];
|
|
520
|
-
var that = this;
|
|
521
|
-
|
|
522
|
-
if (typeof oGroup === "object" && oReadHomePageUtils.getGroupId(oGroup)) {
|
|
523
|
-
var sGroupId = oReadHomePageUtils.getGroupId(oGroup);
|
|
524
|
-
var sGenericErrorMessage = "Failed to reset group with id '" + sGroupId + "'. ";
|
|
525
|
-
|
|
526
|
-
oCdmSiteService.getSite()
|
|
527
|
-
.done(function (oSite) {
|
|
528
|
-
deepExtend(aSiteGroupsBackup, oReadHomePageUtils.getGroupsArrayFromSite(oSite));
|
|
529
|
-
|
|
530
|
-
if (that.isGroupRemovable(oGroup) === false) {
|
|
531
|
-
oCdmSiteService.getGroupFromOriginalSite(sGroupId)
|
|
532
|
-
.done(function (oGroupFromOriginalSite) {
|
|
533
|
-
// overwrite respective group in site with the one returned by the original site
|
|
534
|
-
if (typeof oSite === "object" && oReadHomePageUtils.getGroupFromSite(oSite, sGroupId)) {
|
|
535
|
-
oModifyHomePageUtils.overwriteGroup(oSite, oGroupFromOriginalSite, sGroupId);
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
// persist personalization
|
|
539
|
-
oCdmSiteService.save()
|
|
540
|
-
.done(function () {
|
|
541
|
-
oDeferred.resolve(oGroupFromOriginalSite);
|
|
542
|
-
})
|
|
543
|
-
.fail(function (sErrorMsg1) {
|
|
544
|
-
oDeferred.reject("Group could not be reset - " + sErrorMsg1, aSiteGroupsBackup);
|
|
545
|
-
});
|
|
546
|
-
})
|
|
547
|
-
.fail(function (sErrorMsg) {
|
|
548
|
-
oDeferred.reject("Group could not be reset - " + sErrorMsg, aSiteGroupsBackup);
|
|
549
|
-
});
|
|
550
|
-
} else {
|
|
551
|
-
oDeferred.reject("Group could not be reset as it was created by the user", aSiteGroupsBackup);
|
|
552
|
-
}
|
|
553
|
-
})
|
|
554
|
-
.fail(function (sError) {
|
|
555
|
-
// reject with the original groups cannot be done in this case as
|
|
556
|
-
// loading of site failed
|
|
557
|
-
oDeferred.reject(sGenericErrorMessage + sError, []);
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
return oDeferred.promise();
|
|
561
|
-
};
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
* Returns the links for a given group
|
|
565
|
-
*
|
|
566
|
-
* @param {object} oGroup
|
|
567
|
-
* Group object
|
|
568
|
-
* @returns {array}
|
|
569
|
-
* The array consists of all group items (tiles and links).
|
|
570
|
-
* In case the group does not have items, the array will
|
|
571
|
-
* be empty.
|
|
572
|
-
*/
|
|
573
|
-
this.getLinkTiles = function (oGroup) {
|
|
574
|
-
// Note: This method is actually not used by the FLP Renderer ...
|
|
575
|
-
// getGroupTiles + getTileType is used instead
|
|
576
|
-
return oReadHomePageUtils.getGroupLinks(oGroup);
|
|
577
|
-
};
|
|
578
|
-
|
|
579
|
-
/**
|
|
580
|
-
* Checks if a tile personalization is supported
|
|
581
|
-
*
|
|
582
|
-
* @param {object} oTile
|
|
583
|
-
* Tile to check for personalization support
|
|
584
|
-
* @returns {boolean}
|
|
585
|
-
* The return value is <code>true</true> if the tile personalizationis is
|
|
586
|
-
* supported, and <code>false</code> if not.
|
|
587
|
-
*/
|
|
588
|
-
this.isLinkPersonalizationSupported = function (/*oTile*/) {
|
|
589
|
-
return true;
|
|
590
|
-
};
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* Conditionally informs the tile that it should refresh it's dynamic content.
|
|
594
|
-
* But only if the tile implements the required handler.
|
|
595
|
-
*
|
|
596
|
-
* @param {sap.ui.core.Component} oTileComponent
|
|
597
|
-
* The component of the tile.
|
|
598
|
-
*
|
|
599
|
-
* @private
|
|
600
|
-
*/
|
|
601
|
-
this._notifyTileAboutRefresh = function (oTileComponent) {
|
|
602
|
-
if (typeof oTileComponent.tileRefresh === "function") {
|
|
603
|
-
oTileComponent.tileRefresh();
|
|
604
|
-
}
|
|
605
|
-
};
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* Refreshs a given tile
|
|
609
|
-
*
|
|
610
|
-
* @param {object} oTile
|
|
611
|
-
* Tile object
|
|
612
|
-
*/
|
|
613
|
-
this.refreshTile = function (oTile) {
|
|
614
|
-
var oResolvedTile = this._mResolvedTiles[oTile.id];
|
|
615
|
-
|
|
616
|
-
if (oResolvedTile) {
|
|
617
|
-
if (oResolvedTile.tileComponent) {
|
|
618
|
-
this._notifyTileAboutRefresh(oResolvedTile.tileComponent);
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
};
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* Conditionally informs the tile about it's visibility. But only if
|
|
625
|
-
* it was updated and the tile implements the handler.
|
|
626
|
-
*
|
|
627
|
-
* @param {sap.ui.core.Component} oTileComponent
|
|
628
|
-
* The component of the tile.
|
|
629
|
-
* @param {boolean} bNewVisibility
|
|
630
|
-
* The mandatory new visibility of the tile.
|
|
631
|
-
* @param {boolean} [bOldVisibility]
|
|
632
|
-
* The old visibility of the tile. May be undefined or null.
|
|
633
|
-
*
|
|
634
|
-
* @private
|
|
635
|
-
*/
|
|
636
|
-
this._notifyTileAboutVisibility = function (oTileComponent, bNewVisibility, bOldVisibility) {
|
|
637
|
-
if (typeof oTileComponent.tileSetVisible === "function"
|
|
638
|
-
&& bOldVisibility !== bNewVisibility) {
|
|
639
|
-
oTileComponent.tileSetVisible(bNewVisibility);
|
|
640
|
-
}
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* Returns the UI for a given group tile
|
|
645
|
-
*
|
|
646
|
-
* @param {object} oGroupTile
|
|
647
|
-
* Group tile
|
|
648
|
-
* @returns {jQuery.Promise}
|
|
649
|
-
* In case of success, the done handler is called with the respective
|
|
650
|
-
* tile UI. In case of failure a respective error message is passed
|
|
651
|
-
* to the fail handler which will be called in this case.
|
|
652
|
-
*/
|
|
653
|
-
this.getTileView = function (oGroupTile) {
|
|
654
|
-
var that = this;
|
|
655
|
-
return new jQuery.Deferred(function (oDeferred) {
|
|
656
|
-
return that._getTileView(oGroupTile, false).then(function (oTileUI) {
|
|
657
|
-
oDeferred.resolve(oTileUI);
|
|
658
|
-
}, function (sReason) {
|
|
659
|
-
var sErrorMessage = "Tile with ID '" + oGroupTile.id + "' could not be initialized" + (sReason ? ":\n" + sReason : ".");
|
|
660
|
-
|
|
661
|
-
Log.error(sErrorMessage, null, oGroupTile.tileType);
|
|
662
|
-
oDeferred.reject(sErrorMessage);
|
|
663
|
-
});
|
|
664
|
-
}).promise();
|
|
665
|
-
};
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* Returns the UI for a given catalog tile.
|
|
669
|
-
*
|
|
670
|
-
* @param {object} oCatalogTile
|
|
671
|
-
* Catalog tile
|
|
672
|
-
*
|
|
673
|
-
* @returns {object}
|
|
674
|
-
* return promise of Catalog tile view of given catalog tile
|
|
675
|
-
*
|
|
676
|
-
* @private
|
|
677
|
-
*/
|
|
678
|
-
this._getCatalogTileViewControl = function (oCatalogTile) {
|
|
679
|
-
var oDeferred = new jQuery.Deferred();
|
|
680
|
-
|
|
681
|
-
if (typeof oCatalogTile !== "object") {
|
|
682
|
-
var sErrorMessage = "Invalid input parameter passed to _getCatalogTileView: " + oCatalogTile;
|
|
683
|
-
Log.error(sErrorMessage);
|
|
684
|
-
return oDeferred.reject(sErrorMessage).promise();
|
|
685
|
-
}
|
|
686
|
-
// As catalog tiles are already passed as resolved catalog tiles,
|
|
687
|
-
// we do not distinguish between the unresolved and resolved variant
|
|
688
|
-
// as part of the following call.
|
|
689
|
-
return this._getTileUiComponentContainer(oCatalogTile, oCatalogTile, true);
|
|
690
|
-
};
|
|
691
|
-
|
|
692
|
-
/**
|
|
693
|
-
* Creates a link instance for the given tile
|
|
694
|
-
*
|
|
695
|
-
* @param {object} oTile
|
|
696
|
-
* The title serves as text for the link
|
|
697
|
-
* @param {boolean} bIsCatalogTile
|
|
698
|
-
* Indicates whether the tile is a catalog tile or not
|
|
699
|
-
* @param {string} sNavigationMode
|
|
700
|
-
* Navigation mode
|
|
701
|
-
* @param {function} fnGenericTile
|
|
702
|
-
* Constructor for generic tile
|
|
703
|
-
* @param {object} oResources
|
|
704
|
-
* Text resources
|
|
705
|
-
* @returns {object}
|
|
706
|
-
* Link object
|
|
707
|
-
*
|
|
708
|
-
* @private
|
|
709
|
-
*/
|
|
710
|
-
this._createLinkInstance = function (oTile, bIsCatalogTile, sNavigationMode, fnGenericTile, oResources) {
|
|
711
|
-
var sTileTitle;
|
|
712
|
-
var sTileSubTitle = this.getTileSubtitle(oTile);
|
|
713
|
-
|
|
714
|
-
var GenericTile = fnGenericTile;
|
|
715
|
-
|
|
716
|
-
// should only be called after tile has been resolved
|
|
717
|
-
if (bIsCatalogTile === true) {
|
|
718
|
-
sTileTitle = this.getCatalogTileTitle(oTile);
|
|
719
|
-
} else {
|
|
720
|
-
sTileTitle = this.getTileTitle(oTile);
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
// By using the LineMode, the GenericTile is displayed as a Link
|
|
724
|
-
var linkTileControl = new GenericTile({
|
|
725
|
-
mode: oGenericTileMode.LineMode,
|
|
726
|
-
subheader: sTileSubTitle,
|
|
727
|
-
header: sTileTitle,
|
|
728
|
-
url: WindowUtils.getLeanURL(this.getTileTarget(oTile)),
|
|
729
|
-
//TODO: The below code is for POC only, should be removed once UI5 provide action buttons for line mode
|
|
730
|
-
press: function (oEvent) {
|
|
731
|
-
this._genericTilePressHandler(oTile, oEvent);
|
|
732
|
-
}.bind(this)
|
|
733
|
-
});
|
|
734
|
-
if (sNavigationMode) {
|
|
735
|
-
var sTranslatedNavMode = oResources.i18n.getText(sNavigationMode + "NavigationMode");
|
|
736
|
-
//According to ACC-257 aria-label should start with the navigation mode, then the tile content
|
|
737
|
-
linkTileControl.setAriaLabel(sTranslatedNavMode + " " + sTileTitle + " " + sTileSubTitle);
|
|
738
|
-
}
|
|
739
|
-
this._mResolvedTiles[oTile.id].linkTileControl = linkTileControl;
|
|
740
|
-
return linkTileControl;
|
|
741
|
-
};
|
|
742
|
-
|
|
743
|
-
this._genericTilePressHandler = function (oTile, oEvent) {
|
|
744
|
-
var sTargetURL;
|
|
745
|
-
|
|
746
|
-
if (oEvent.getSource().getScope && oEvent.getSource().getScope() === "Display") {
|
|
747
|
-
sTargetURL = this.getTileTarget(oTile);
|
|
748
|
-
if (sTargetURL) {
|
|
749
|
-
EventHub.emit("UITracer.trace", {
|
|
750
|
-
reason: "LaunchApp",
|
|
751
|
-
source: "Tile",
|
|
752
|
-
data: {
|
|
753
|
-
targetUrl: sTargetURL
|
|
754
|
-
}
|
|
755
|
-
});
|
|
756
|
-
if (sTargetURL[0] === "#") {
|
|
757
|
-
hasher.setHash(sTargetURL);
|
|
758
|
-
} else {
|
|
759
|
-
WindowUtils.openURL(sTargetURL, "_blank");
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
};
|
|
764
|
-
|
|
765
|
-
/**
|
|
766
|
-
* Adds a tile to the homepage. Furthermore the personalization will be
|
|
767
|
-
* persisted for the end user.
|
|
768
|
-
*
|
|
769
|
-
* @param {object} oCatalogTile
|
|
770
|
-
* Catalog Tile
|
|
771
|
-
* @param {object} oGroup
|
|
772
|
-
* Group object
|
|
773
|
-
* @returns {jQuery.Promise}
|
|
774
|
-
* A promise which will be resolved when the tile has been added successfully.
|
|
775
|
-
* The new tile itself will be passed to the promise's done handler in case of
|
|
776
|
-
* success. In case of failure, the fail handler will be called with a respective
|
|
777
|
-
* error message.
|
|
778
|
-
*/
|
|
779
|
-
this.addTile = function (oCatalogTile, oGroup) {
|
|
780
|
-
var oDeferred = new jQuery.Deferred();
|
|
781
|
-
var oCdmSiteService = this.oCDMService;
|
|
782
|
-
|
|
783
|
-
if (!oGroup) {
|
|
784
|
-
oGroup = this._oDefaultGroup;
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
var oGroupTile = composeNewTile();
|
|
788
|
-
oGroupTile.vizId = oCatalogTile.vizId;
|
|
789
|
-
|
|
790
|
-
// add new tile to list of resolved tiles
|
|
791
|
-
this._mResolvedTiles[oGroupTile.id] = {
|
|
792
|
-
tileIntent: oCatalogTile.tileIntent,
|
|
793
|
-
tileResolutionResult: oCatalogTile.tileResolutionResult,
|
|
794
|
-
isLink: false
|
|
795
|
-
};
|
|
796
|
-
oCdmSiteService.getSite()
|
|
797
|
-
.done(function (oSite) {
|
|
798
|
-
// We should think about the reasons why it's not safe to
|
|
799
|
-
// do the following, even though it's more succint:
|
|
800
|
-
// oGroup.payload.tiles.push(oTile);
|
|
801
|
-
oSite.groups[oGroup.identification.id].payload.tiles.push(oGroupTile);
|
|
802
|
-
oCdmSiteService.save()
|
|
803
|
-
.done(function () {
|
|
804
|
-
oDeferred.resolve(oGroupTile);
|
|
805
|
-
})
|
|
806
|
-
.fail(function (sReason) {
|
|
807
|
-
oDeferred.reject(sReason);
|
|
808
|
-
});
|
|
809
|
-
})
|
|
810
|
-
.fail(function (sError) {
|
|
811
|
-
var sGenericErrorMessage = "Failed to add tile with id '" + oGroupTile.id +
|
|
812
|
-
"' to group with id '" + oGroup.identification.id + "'. ";
|
|
813
|
-
oDeferred.reject(sGenericErrorMessage + sError);
|
|
814
|
-
});
|
|
815
|
-
|
|
816
|
-
return oDeferred.promise();
|
|
817
|
-
};
|
|
818
|
-
|
|
819
|
-
/**
|
|
820
|
-
* Removes a tile from a given group on the homepage. Furthermore the personalization will be
|
|
821
|
-
* persisted for the end user.
|
|
822
|
-
*
|
|
823
|
-
* @param {object} oGroup
|
|
824
|
-
* Group object
|
|
825
|
-
* @param {object} oTile
|
|
826
|
-
* Tile object
|
|
827
|
-
* @param {int} iIndex
|
|
828
|
-
* Index of the given tile in the respective group
|
|
829
|
-
* @returns {jQuery.Promise}
|
|
830
|
-
* A promise which will be resolved when the tile has been removed successfully.
|
|
831
|
-
* In case of failure, the fail handler will be called with a collection of existing groups.
|
|
832
|
-
*/
|
|
833
|
-
this.removeTile = function (oGroup, oTile, iIndex) {
|
|
834
|
-
var oCdmSiteService = this.oCDMService;
|
|
835
|
-
var oDeferred = new jQuery.Deferred();
|
|
836
|
-
var that = this;
|
|
837
|
-
|
|
838
|
-
if (!oGroup || typeof oGroup !== "object" || !oGroup.identification || !oGroup.identification.id ||
|
|
839
|
-
!oTile || typeof oTile !== "object" || !oTile.id) {
|
|
840
|
-
return oDeferred.reject({}, "Failed to remove tile. No valid input parameters passed to removeTile method.").promise();
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
var sGenericErrorMessage = "Failed to remove tile with id '" + oTile.id + "' from group with id '" + oGroup.identification.id + "'. ";
|
|
844
|
-
|
|
845
|
-
oCdmSiteService.getSite()
|
|
846
|
-
.done(function (oSite) {
|
|
847
|
-
var oPayload;
|
|
848
|
-
|
|
849
|
-
// succinctly convert iIndex to number
|
|
850
|
-
iIndex = +iIndex;
|
|
851
|
-
|
|
852
|
-
try {
|
|
853
|
-
oPayload = oSite.groups[oGroup.identification.id].payload;
|
|
854
|
-
} catch (e) {
|
|
855
|
-
oDeferred.reject(oSite.groups[oGroup.identification.id], sGenericErrorMessage);
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
//according to the tile type set oPayload tile / links to be truncated.
|
|
859
|
-
var sPayloadType = that.getTileType(oTile) === that.TileType.Link ? "links" : "tiles";
|
|
860
|
-
|
|
861
|
-
//In case the target is a link convert the iTargetIndex to the index of links payload.
|
|
862
|
-
if (that.getTileType(oTile) === that.TileType.Link) {
|
|
863
|
-
iIndex -= oPayload.tiles.length;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
if (iIndex >= 0) {
|
|
867
|
-
// remove element in group
|
|
868
|
-
oPayload[sPayloadType].splice(iIndex, 1);
|
|
869
|
-
} else {
|
|
870
|
-
oPayload[sPayloadType] = oPayload[sPayloadType].filter(function (oGroupElement) {
|
|
871
|
-
return oGroupElement.id !== oTile.id;
|
|
872
|
-
});
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
oCdmSiteService.save()
|
|
876
|
-
.done(function () {
|
|
877
|
-
oDeferred.resolve();
|
|
878
|
-
})
|
|
879
|
-
.fail(function (sErrorMsg) {
|
|
880
|
-
Log.error(sErrorMsg);
|
|
881
|
-
oDeferred.reject(oSite.groups[oGroup.identification.id], sErrorMsg);
|
|
882
|
-
});
|
|
883
|
-
})
|
|
884
|
-
.fail(function (sError) {
|
|
885
|
-
// Reject an empty group object, as site with correct group data could not get accessed
|
|
886
|
-
oDeferred.reject({}, sGenericErrorMessage + sError);
|
|
887
|
-
});
|
|
888
|
-
|
|
889
|
-
return oDeferred.promise();
|
|
890
|
-
};
|
|
891
|
-
|
|
892
|
-
/**
|
|
893
|
-
* Moves a tile within a certain group or across different groups
|
|
894
|
-
* on the homepage
|
|
895
|
-
*
|
|
896
|
-
* @param {object} oTile
|
|
897
|
-
* Tile to be moved
|
|
898
|
-
* @param {int} iSourceIndex
|
|
899
|
-
* Position index of tile in source group
|
|
900
|
-
* @param {int} iTargetIndex
|
|
901
|
-
* Aimed position index of tile in target group
|
|
902
|
-
* @param {object} oSourceGroup
|
|
903
|
-
* Source group which currently contains the tile
|
|
904
|
-
* @param {object} oTargetGroup
|
|
905
|
-
* Aimed target group where the tile should be moved to
|
|
906
|
-
* @param {object} newTileType
|
|
907
|
-
* tile type of target tile, optional
|
|
908
|
-
* @returns {jQuery.Promise}
|
|
909
|
-
* A promise which will be resolved when the tile has been removed successfully.
|
|
910
|
-
* In case of failure, the fail handler will be called with a collection of existing groups.
|
|
911
|
-
*/
|
|
912
|
-
this.moveTile = function (oTile, iSourceIndex, iTargetIndex, oSourceGroup, oTargetGroup, newTileType) {
|
|
913
|
-
var oDeferred = new jQuery.Deferred();
|
|
914
|
-
var oCdmSiteService = this.oCDMService;
|
|
915
|
-
var that = this;
|
|
916
|
-
|
|
917
|
-
if (!oTile || isEmptyObject(oTile) ||
|
|
918
|
-
iSourceIndex === undefined || iSourceIndex < 0 ||
|
|
919
|
-
iTargetIndex === undefined || iTargetIndex < 0 ||
|
|
920
|
-
!oSourceGroup || !oSourceGroup.identification || !oSourceGroup.identification.id ||
|
|
921
|
-
!oTargetGroup || !oTargetGroup.identification || !oTargetGroup.identification.id) {
|
|
922
|
-
return oDeferred.reject("Invalid input parameters").promise();
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
var sGenericErrorMessage = "Failed to move tile with id '" + oTile.id + "'. ";
|
|
926
|
-
|
|
927
|
-
oCdmSiteService.getSite()
|
|
928
|
-
.done(function (oSite) {
|
|
929
|
-
var sOrigTileType = that.getTileType(oTile) === that.TileType.Link ? "links" : "tiles";
|
|
930
|
-
|
|
931
|
-
//if newTileType is not defined convert to the same type.
|
|
932
|
-
if (!newTileType) {
|
|
933
|
-
newTileType = that._mResolvedTiles[oTile.id].isLink ? "link" : "tile";
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
var sTargetPayloadType = newTileType === "link" ? "links" : "tiles";
|
|
937
|
-
|
|
938
|
-
// change the _mResolvedTiles tile type.
|
|
939
|
-
if (sOrigTileType !== sTargetPayloadType && that._mResolvedTiles[oTile.id]) {
|
|
940
|
-
that._mResolvedTiles[oTile.id].isLink = newTileType === "link"; // currently only bookmark tiles can be created
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
//In case the target is a link convert the iTargetIndex to the index of links payload.
|
|
944
|
-
if (sTargetPayloadType === "links") {
|
|
945
|
-
iTargetIndex -= oSite.groups[oTargetGroup.identification.id].payload.tiles.length;
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
//In case the source is a link convert the index to the index of links payload.
|
|
949
|
-
if (sOrigTileType === "links") {
|
|
950
|
-
iSourceIndex -= oSite.groups[oSourceGroup.identification.id].payload.tiles.length;
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
// check for move operation within a group or across different groups
|
|
954
|
-
if (oSourceGroup.identification.id === oTargetGroup.identification.id) {
|
|
955
|
-
// within a group
|
|
956
|
-
if (iSourceIndex !== iTargetIndex || sOrigTileType !== sTargetPayloadType) {
|
|
957
|
-
var oGroupPayload = oSite.groups[oTargetGroup.identification.id].payload;
|
|
958
|
-
oGroupPayload[sOrigTileType].splice(iSourceIndex, 1); // remove tile at source index
|
|
959
|
-
oGroupPayload[sTargetPayloadType].splice(iTargetIndex, 0, oTile); // add tile at target index
|
|
960
|
-
} else {
|
|
961
|
-
// no move operation took place
|
|
962
|
-
return oDeferred.resolve(oTile).promise();
|
|
963
|
-
}
|
|
964
|
-
} else {
|
|
965
|
-
// across different groups
|
|
966
|
-
oSite.groups[oSourceGroup.identification.id].payload[sOrigTileType].splice(iSourceIndex, 1); // remove tile in source group
|
|
967
|
-
oSite.groups[oTargetGroup.identification.id].payload[sTargetPayloadType].splice(iTargetIndex, 0, oTile); // add tile to target group
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
oCdmSiteService.save()
|
|
971
|
-
.done(function () {
|
|
972
|
-
oDeferred.resolve(oTile);
|
|
973
|
-
})
|
|
974
|
-
.fail(function (sError) {
|
|
975
|
-
Log.error(sGenericErrorMessage + sError);
|
|
976
|
-
oDeferred.reject(sGenericErrorMessage + sError);
|
|
977
|
-
});
|
|
978
|
-
return undefined;
|
|
979
|
-
})
|
|
980
|
-
.fail(function (sError) {
|
|
981
|
-
Log.error(sGenericErrorMessage + sError);
|
|
982
|
-
oDeferred.reject(sGenericErrorMessage + sError);
|
|
983
|
-
});
|
|
984
|
-
|
|
985
|
-
return oDeferred.promise();
|
|
986
|
-
};
|
|
987
|
-
|
|
988
|
-
/**
|
|
989
|
-
* Sort catalogs by title
|
|
990
|
-
* @param {object} oA Catalog A
|
|
991
|
-
* @param {object} oB Catalog B
|
|
992
|
-
* @returns {int} Sort order
|
|
993
|
-
* @private
|
|
994
|
-
*/
|
|
995
|
-
this._compareCatalogs = function (oA, oB) {
|
|
996
|
-
return (oA.identification.title || "").toLowerCase() > (oB.identification.title || "").toLowerCase() ? 1 : -1;
|
|
997
|
-
};
|
|
998
|
-
|
|
999
|
-
/**
|
|
1000
|
-
* Requests a collection of catalogs. The catalogs get extracted out of
|
|
1001
|
-
* the Common Data Model site. Consumers of this method have the
|
|
1002
|
-
* opportunity to attach a progress handler to the returned jQuery
|
|
1003
|
-
* Promise to get notified for each catalog once it got processed.
|
|
1004
|
-
* The argument of the attached progress handler will be the respective
|
|
1005
|
-
* catalog object.
|
|
1006
|
-
*
|
|
1007
|
-
* @returns {jQuery.Promise}
|
|
1008
|
-
* In case of success the done handler will be called with an array of
|
|
1009
|
-
* catalog objects. In case of failure the fail handler will be called
|
|
1010
|
-
* with a respective error message. No assumption should be made on
|
|
1011
|
-
* the order with which the catalogs are returned.
|
|
1012
|
-
*/
|
|
1013
|
-
this.getCatalogs = function () {
|
|
1014
|
-
var that = this;
|
|
1015
|
-
var oDeferred = new jQuery.Deferred();
|
|
1016
|
-
var aCatalogs = [];
|
|
1017
|
-
|
|
1018
|
-
function processCatalog (oCdmSite, sCatalogId, aCatalogs, oGetCatalogsDeferred) {
|
|
1019
|
-
var oCatalog = oCdmSite.catalogs[sCatalogId];
|
|
1020
|
-
aCatalogs.push(oCatalog);
|
|
1021
|
-
oGetCatalogsDeferred.notify(oCatalog);
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
// setTimeout is required here. Otherwise the the oDeferred.notify() would
|
|
1025
|
-
// be a synchronous call, which would cause wrong behavior in some scenarios
|
|
1026
|
-
sap.ushell.Container.getServiceAsync("CommonDataModel").then(function (oCDMSiteService) {
|
|
1027
|
-
oCDMSiteService.getSite().done(function (oSite) {
|
|
1028
|
-
Object.keys(oSite.catalogs).forEach(function (sCatalogId) {
|
|
1029
|
-
processCatalog(oSite, sCatalogId, aCatalogs, oDeferred);
|
|
1030
|
-
});
|
|
1031
|
-
// In our tests we use indices to access specific
|
|
1032
|
-
// catalogs from the getCatalogs response. For this
|
|
1033
|
-
// reason we are sorting the result. As stated in the
|
|
1034
|
-
// documentation, this shouldn't really matter for the
|
|
1035
|
-
// caller. The caller should not code against a
|
|
1036
|
-
// specific sort order.
|
|
1037
|
-
//
|
|
1038
|
-
// Note that oA.identification.id is a string and
|
|
1039
|
-
// usually not a number Note that "A" is bigger than
|
|
1040
|
-
// "1"
|
|
1041
|
-
oDeferred.resolve(aCatalogs.sort(that._compareCatalogs));
|
|
1042
|
-
});
|
|
1043
|
-
});
|
|
1044
|
-
return oDeferred.promise();
|
|
1045
|
-
};
|
|
1046
|
-
|
|
1047
|
-
/**
|
|
1048
|
-
* Check wether an inbound is startable.
|
|
1049
|
-
*
|
|
1050
|
-
* @param {object} oInbound An inbound
|
|
1051
|
-
* @returns {boolean} Indicates whether the inbound appears to be startable
|
|
1052
|
-
*
|
|
1053
|
-
* @private
|
|
1054
|
-
*/
|
|
1055
|
-
this._isStartableInbound = function (oInbound) {
|
|
1056
|
-
if (!oInbound.semanticObject || !oInbound.action) {
|
|
1057
|
-
return false;
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
var aNonStartableInbounds = [
|
|
1061
|
-
"Shell-plugin",
|
|
1062
|
-
"Shell-bootConfig" // just in case
|
|
1063
|
-
];
|
|
1064
|
-
if (aNonStartableInbounds.indexOf(oInbound.semanticObject + "-" + oInbound.action) > -1) {
|
|
1065
|
-
// This is a special intent which is not startable
|
|
1066
|
-
return false;
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
return true;
|
|
1070
|
-
};
|
|
1071
|
-
|
|
1072
|
-
/**
|
|
1073
|
-
* Check whether a visualization is potentially startable together with the inbound it points to.
|
|
1074
|
-
* This is only a quick and cheap check and does not perform a full client side target resolution.
|
|
1075
|
-
* Therefore it does not filter out all non-startable visualizations but the larger part of them.
|
|
1076
|
-
*
|
|
1077
|
-
* @param {object} oVisualization A visualization
|
|
1078
|
-
* @param {object} oInbound An inbound
|
|
1079
|
-
* @returns {boolean} Indicates whether visualization appears to be startable
|
|
1080
|
-
*
|
|
1081
|
-
* @since 1.89.0
|
|
1082
|
-
* @private
|
|
1083
|
-
*/
|
|
1084
|
-
this._isStartableVisualization = function (oVisualization, oInbound) {
|
|
1085
|
-
var oInboundParameters = ObjectPath.get("signature.parameters", oInbound);
|
|
1086
|
-
if (!oInboundParameters) {
|
|
1087
|
-
return true;
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
var oVisualizationParameters = ObjectPath.get("parameters", oReadVisualization.getTarget(oVisualization));
|
|
1091
|
-
|
|
1092
|
-
// check for matching filter parameters
|
|
1093
|
-
return Object.keys(oInboundParameters).every(function (sInboundParameter) {
|
|
1094
|
-
var oInboundParameter = oInboundParameters[sInboundParameter];
|
|
1095
|
-
|
|
1096
|
-
// don't filter out legacy URL applications that use the intent Shell-launchURL to model URL tiles
|
|
1097
|
-
if (sInboundParameter === "sap-external-url") {
|
|
1098
|
-
return true;
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
// as this check is intended to be cheap and simple only plain filters are checked
|
|
1102
|
-
if (!oInboundParameter.filter ||
|
|
1103
|
-
oInboundParameter.filter.format !== "plain") {
|
|
1104
|
-
return true;
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
var sExpectedFilterValue = oInboundParameter.filter.value;
|
|
1108
|
-
var sSuppliedParameterValue = ObjectPath.get([sInboundParameter, "value", "value"], oVisualizationParameters);
|
|
1109
|
-
|
|
1110
|
-
if (sExpectedFilterValue !== sSuppliedParameterValue) {
|
|
1111
|
-
return false;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
return true;
|
|
1115
|
-
});
|
|
1116
|
-
};
|
|
1117
|
-
|
|
1118
|
-
this._isHiddenInbound = function (oInbound) {
|
|
1119
|
-
return !!oInbound.hideLauncher;
|
|
1120
|
-
};
|
|
1121
|
-
|
|
1122
|
-
/**
|
|
1123
|
-
* Constructs an inner shell hash for an inbound which represents a hash.
|
|
1124
|
-
* This includes the hash, e.g. #SO-action?abc=def
|
|
1125
|
-
*
|
|
1126
|
-
* @param {object} oInbound
|
|
1127
|
-
* Inbound which gets used to construct the hash
|
|
1128
|
-
*
|
|
1129
|
-
* @returns {string}
|
|
1130
|
-
* Constructed Hash (with prefix '#')
|
|
1131
|
-
*
|
|
1132
|
-
* @private
|
|
1133
|
-
*/
|
|
1134
|
-
this._toHashFromInbound = function (oInbound) {
|
|
1135
|
-
var sConstructedHash = oUtilsCdm.toHashFromInbound(oInbound);
|
|
1136
|
-
|
|
1137
|
-
if (!sConstructedHash) {
|
|
1138
|
-
return undefined;
|
|
1139
|
-
}
|
|
1140
|
-
return "#" + sConstructedHash;
|
|
1141
|
-
};
|
|
1142
|
-
|
|
1143
|
-
/**
|
|
1144
|
-
* Returns the URL to be launched from a given inbound.
|
|
1145
|
-
*
|
|
1146
|
-
* @param {object} oInbound
|
|
1147
|
-
* An application inbound as found in the site
|
|
1148
|
-
*
|
|
1149
|
-
* @returns {string}
|
|
1150
|
-
* The URL to launch when the tile is clicked or null if the launch
|
|
1151
|
-
* url cannot be found.
|
|
1152
|
-
*
|
|
1153
|
-
* @private
|
|
1154
|
-
*/
|
|
1155
|
-
this._getExternalUrlFromInbound = function (oInbound) {
|
|
1156
|
-
return ObjectPath.get("signature.parameters.sap-external-url.launcherValue.value", oInbound) || null;
|
|
1157
|
-
};
|
|
1158
|
-
|
|
1159
|
-
/**
|
|
1160
|
-
* Constructs an inner shell hash for an outbound which represents a hash.
|
|
1161
|
-
* This includes the hash, e.g. #SO-action?abc=def
|
|
1162
|
-
*
|
|
1163
|
-
* @param {object} oOutbound
|
|
1164
|
-
* Outbound which gets used to construct the hash
|
|
1165
|
-
*
|
|
1166
|
-
* @returns {string}
|
|
1167
|
-
* Constructed Hash (with prefix '#')
|
|
1168
|
-
*
|
|
1169
|
-
* @private
|
|
1170
|
-
*/
|
|
1171
|
-
this._toHashFromOutbound = function (oOutbound) {
|
|
1172
|
-
var sConstructedHash = oUtilsCdm.toHashFromOutbound(oOutbound);
|
|
1173
|
-
|
|
1174
|
-
if (!sConstructedHash) {
|
|
1175
|
-
return undefined;
|
|
1176
|
-
}
|
|
1177
|
-
return "#" + sConstructedHash;
|
|
1178
|
-
};
|
|
1179
|
-
|
|
1180
|
-
/**
|
|
1181
|
-
* Delivers the catalog tiles for a given catalog
|
|
1182
|
-
*
|
|
1183
|
-
* @param {object} oCatalog
|
|
1184
|
-
* Catalog
|
|
1185
|
-
* @returns {jQuery.Promise}
|
|
1186
|
-
* In case of success the done handler will be called with an array
|
|
1187
|
-
* of catalog tiles.
|
|
1188
|
-
*/
|
|
1189
|
-
this.getCatalogTiles = function (oCatalog) {
|
|
1190
|
-
var that = this;
|
|
1191
|
-
var oDeferred = new jQuery.Deferred();
|
|
1192
|
-
|
|
1193
|
-
if (typeof oCatalog !== "object" || oCatalog === null) {
|
|
1194
|
-
return oDeferred.reject("Invalid input parameter '" + oCatalog + "' passed to getCatalogTiles.").promise();
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
this.oCDMService.getSite()
|
|
1198
|
-
.done(function (oSite) {
|
|
1199
|
-
getCatalogTilesFromSite.call(that, oCatalog, oSite)
|
|
1200
|
-
.done(oDeferred.resolve)
|
|
1201
|
-
.fail(oDeferred.reject);
|
|
1202
|
-
})
|
|
1203
|
-
.fail(function (sErrorMessage2) {
|
|
1204
|
-
oDeferred.reject("Failed to get site: " + sErrorMessage2);
|
|
1205
|
-
});
|
|
1206
|
-
|
|
1207
|
-
return oDeferred.promise();
|
|
1208
|
-
};
|
|
1209
|
-
|
|
1210
|
-
function getCatalogTilesFromSite (oCatalog, oSite) {
|
|
1211
|
-
var that = this;
|
|
1212
|
-
var oDeferred = new jQuery.Deferred();
|
|
1213
|
-
|
|
1214
|
-
setTimeout(function () {
|
|
1215
|
-
// calculate async
|
|
1216
|
-
var aCatalogTiles = ((oCatalog.payload && oCatalog.payload.viz) || [])
|
|
1217
|
-
.reduce(function (aReturnedCatalogTiles, sVisualizationId) {
|
|
1218
|
-
var sAppId;
|
|
1219
|
-
var oVisualization;
|
|
1220
|
-
var sVisualizationTypeId;
|
|
1221
|
-
var oVisualizationType;
|
|
1222
|
-
var oAppDescriptor;
|
|
1223
|
-
var oInboundResult;
|
|
1224
|
-
var sHash;
|
|
1225
|
-
var oMapped;
|
|
1226
|
-
var sNavigationMode;
|
|
1227
|
-
var oOutbound;
|
|
1228
|
-
var oTileResolutionResult;
|
|
1229
|
-
var oCatalogTile;
|
|
1230
|
-
var sExternalUrl;
|
|
1231
|
-
var sApplicationType;
|
|
1232
|
-
var sAdditionalInformation;
|
|
1233
|
-
var bIsApplicationTypeConfiguredInPlace;
|
|
1234
|
-
var oEnableInPlaceForClassicUIsConfig;
|
|
1235
|
-
var aTechnicalAttributes;
|
|
1236
|
-
|
|
1237
|
-
// Get visualization and type
|
|
1238
|
-
if (!sVisualizationId) {
|
|
1239
|
-
return aReturnedCatalogTiles;
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
oVisualization = oReadVisualization.get(oSite, sVisualizationId);
|
|
1243
|
-
if (!oVisualization) {
|
|
1244
|
-
return aReturnedCatalogTiles;
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
sVisualizationTypeId = oReadVisualization.getTypeId(oVisualization);
|
|
1248
|
-
oVisualizationType = oReadVisualization.getType(oSite, sVisualizationTypeId);
|
|
1249
|
-
|
|
1250
|
-
sAppId = oReadVisualization.getAppId(oVisualization);
|
|
1251
|
-
|
|
1252
|
-
if (sAppId) {
|
|
1253
|
-
// Read its target app descriptor and inbound
|
|
1254
|
-
oAppDescriptor = oReadVisualization.getAppDescriptor(oSite, sAppId);
|
|
1255
|
-
if (!oAppDescriptor) {
|
|
1256
|
-
return aReturnedCatalogTiles;
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
// Resolve tile via app id in visualization target
|
|
1260
|
-
oInboundResult = oReadHomePageUtils.getInbound(oAppDescriptor, oReadVisualization.getTarget(oVisualization).inboundId);
|
|
1261
|
-
if (!oInboundResult) {
|
|
1262
|
-
return aReturnedCatalogTiles;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
if (!that._isStartableInbound(oInboundResult.inbound) ||
|
|
1266
|
-
!that._isStartableVisualization(oVisualization, oInboundResult.inbound) ||
|
|
1267
|
-
that._isHiddenInbound(oInboundResult.inbound)) {
|
|
1268
|
-
return aReturnedCatalogTiles;
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
oMapped = oUtilsCdm.mapOne(oInboundResult.key, oInboundResult.inbound, oAppDescriptor, oVisualization, oVisualizationType, oSite);
|
|
1272
|
-
if (!oMapped || !oMapped.tileResolutionResult) {
|
|
1273
|
-
return aReturnedCatalogTiles;
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
// Add Navigation mode
|
|
1277
|
-
sApplicationType = oMapped.resolutionResult.applicationType;
|
|
1278
|
-
sAdditionalInformation = oMapped.resolutionResult.additionalInformation;
|
|
1279
|
-
oEnableInPlaceForClassicUIsConfig = Config.last("/core/navigation/enableInPlaceForClassicUIs");
|
|
1280
|
-
bIsApplicationTypeConfiguredInPlace = oEnableInPlaceForClassicUIsConfig ? oEnableInPlaceForClassicUIsConfig[sApplicationType] : false;
|
|
1281
|
-
sNavigationMode = navigationMode.computeNavigationModeForHomepageTiles(sApplicationType, sAdditionalInformation, bIsApplicationTypeConfiguredInPlace);
|
|
1282
|
-
|
|
1283
|
-
oOutbound = oReadVisualization.getOutbound(oVisualization, oInboundResult.inbound);
|
|
1284
|
-
sHash = that._toHashFromOutbound(oOutbound);
|
|
1285
|
-
|
|
1286
|
-
aTechnicalAttributes = oReadApplications.getTechnicalAttributes(oAppDescriptor);
|
|
1287
|
-
} else {
|
|
1288
|
-
// Resolve tile via visualization's configuration
|
|
1289
|
-
var oConfig = oReadVisualization.getConfig(oVisualization);
|
|
1290
|
-
if (oConfig === undefined) {
|
|
1291
|
-
return aReturnedCatalogTiles;
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
oMapped = oUtilsCdm.mapOne(undefined, undefined, undefined, oVisualization, oVisualizationType, oSite);
|
|
1295
|
-
|
|
1296
|
-
if (oUshellUtils.getMember(oConfig, "sap|flp.target.type") === "URL") {
|
|
1297
|
-
sExternalUrl = oUshellUtils.getMember(oConfig, "sap|flp.target.url");
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
oTileResolutionResult = oMapped.tileResolutionResult;
|
|
1302
|
-
oTileResolutionResult.navigationMode = sNavigationMode;
|
|
1303
|
-
oTileResolutionResult.technicalAttributes = aTechnicalAttributes;
|
|
1304
|
-
|
|
1305
|
-
// Device check
|
|
1306
|
-
if (!that._isFormFactorSupported(oTileResolutionResult)) {
|
|
1307
|
-
return aReturnedCatalogTiles;
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
if (oCatalog.contentProviderId) {
|
|
1311
|
-
// This is an extension catalog from an extension site provided by a
|
|
1312
|
-
// ContentProvider plugin. See "sap-ushell-plugin-type": "ContentProvider"
|
|
1313
|
-
sExternalUrl = that._getMember(
|
|
1314
|
-
oAppDescriptor,
|
|
1315
|
-
"sap|app.crossNavigation.inbounds.Shell-launchURL.signature.parameters.sap-external-url.launcherValue.value"
|
|
1316
|
-
);
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
oCatalogTile = {
|
|
1320
|
-
id: sVisualizationId, // reuse the vizId as it is stable and unique
|
|
1321
|
-
vizId: sVisualizationId,
|
|
1322
|
-
tileIntent: sExternalUrl || sHash,
|
|
1323
|
-
tileResolutionResult: oTileResolutionResult,
|
|
1324
|
-
isCatalogTile: true
|
|
1325
|
-
};
|
|
1326
|
-
|
|
1327
|
-
if (oCatalog.contentProviderId && sExternalUrl) {
|
|
1328
|
-
// extension catalog tiles get additional properties
|
|
1329
|
-
// as they are treated differently in addTile
|
|
1330
|
-
oCatalogTile.contentProviderId = oCatalog.contentProviderId;
|
|
1331
|
-
oCatalogTile.externalUrl = sExternalUrl;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
aReturnedCatalogTiles.push(oCatalogTile);
|
|
1335
|
-
|
|
1336
|
-
return aReturnedCatalogTiles;
|
|
1337
|
-
}, []);
|
|
1338
|
-
|
|
1339
|
-
oDeferred.resolve(aCatalogTiles);
|
|
1340
|
-
}, 0);
|
|
1341
|
-
|
|
1342
|
-
return oDeferred.promise();
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
/**
|
|
1346
|
-
* Returns the catalog's technical error message in case it could not be loaded.
|
|
1347
|
-
* <p>
|
|
1348
|
-
* <b>Beware:</b> The technical error message is not translated!
|
|
1349
|
-
*
|
|
1350
|
-
* @param {object} oCatalog
|
|
1351
|
-
* Catalog
|
|
1352
|
-
* @returns {string}
|
|
1353
|
-
* Technical error message or <code>undefined</code> if the catalog was loaded
|
|
1354
|
-
* properly
|
|
1355
|
-
*/
|
|
1356
|
-
this.getCatalogError = function (oCatalog) {
|
|
1357
|
-
if (oCatalog.error) {
|
|
1358
|
-
return oCatalog.error;
|
|
1359
|
-
}
|
|
1360
|
-
return undefined;
|
|
1361
|
-
};
|
|
1362
|
-
|
|
1363
|
-
/**
|
|
1364
|
-
* Returns the ID for a given catalog
|
|
1365
|
-
*
|
|
1366
|
-
* @param {object} oCatalog
|
|
1367
|
-
* Catalog object
|
|
1368
|
-
* @returns {string}
|
|
1369
|
-
* Catalog ID
|
|
1370
|
-
*/
|
|
1371
|
-
this.getCatalogId = function (oCatalog) {
|
|
1372
|
-
return oReadCatalog.getId(oCatalog);
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
/**
|
|
1376
|
-
* Returns the title for a given catalog
|
|
1377
|
-
*
|
|
1378
|
-
* @param {object} oCatalog
|
|
1379
|
-
* Catalog object
|
|
1380
|
-
* @returns {string}
|
|
1381
|
-
* Catalog title
|
|
1382
|
-
*/
|
|
1383
|
-
this.getCatalogTitle = function (oCatalog) {
|
|
1384
|
-
return oReadCatalog.getTitle(oCatalog);
|
|
1385
|
-
};
|
|
1386
|
-
|
|
1387
|
-
this._isFailedCatalogTile = function (oTile) {
|
|
1388
|
-
return !!(oTile && this._mFailedResolvedCatalogTiles &&
|
|
1389
|
-
this._mFailedResolvedCatalogTiles[oReadHomePageUtils.getTileId(oTile)]);
|
|
1390
|
-
};
|
|
1391
|
-
|
|
1392
|
-
/**
|
|
1393
|
-
* Returns the catalog tile title for a given tile (group or catalog tile)
|
|
1394
|
-
*
|
|
1395
|
-
* @param {object} oGroupTileOrCatalogTile
|
|
1396
|
-
* Group tile or catalog tile
|
|
1397
|
-
* @returns {string}
|
|
1398
|
-
* Title of respective group tile or catalog tile.
|
|
1399
|
-
* In case the title could not be determined,
|
|
1400
|
-
* <code>""</code> is returned.
|
|
1401
|
-
* @throws an exception when the tile is not valid
|
|
1402
|
-
*/
|
|
1403
|
-
this.getCatalogTileTitle = function (oGroupTileOrCatalogTile) {
|
|
1404
|
-
if (this._isGroupTile(oGroupTileOrCatalogTile)) {
|
|
1405
|
-
if (this._isFailedGroupTile(oGroupTileOrCatalogTile)) {
|
|
1406
|
-
return "";
|
|
1407
|
-
}
|
|
1408
|
-
// the vizId of the group tile is the id of the catalog tile
|
|
1409
|
-
return this._mResolvedTiles[oGroupTileOrCatalogTile.id].tileResolutionResult.title;
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
if (this._isCatalogTile(oGroupTileOrCatalogTile)) {
|
|
1413
|
-
if (this._isFailedCatalogTile(oGroupTileOrCatalogTile)) {
|
|
1414
|
-
return undefined;
|
|
1415
|
-
}
|
|
1416
|
-
return oGroupTileOrCatalogTile.tileResolutionResult.title;
|
|
1417
|
-
}
|
|
1418
|
-
return undefined;
|
|
1419
|
-
};
|
|
1420
|
-
|
|
1421
|
-
/**
|
|
1422
|
-
* Returns the size for a given catalog tile
|
|
1423
|
-
*
|
|
1424
|
-
* @param {object} oCatalogTile
|
|
1425
|
-
* Catalog tile
|
|
1426
|
-
* @returns {string}
|
|
1427
|
-
* Size of given catalog tile
|
|
1428
|
-
*/
|
|
1429
|
-
this.getCatalogTileSize = function (oCatalogTile) {
|
|
1430
|
-
return oCatalogTile.tileResolutionResult.size || "1x1";
|
|
1431
|
-
};
|
|
1432
|
-
|
|
1433
|
-
/**
|
|
1434
|
-
* Returns the UI for a given catalog tile
|
|
1435
|
-
* Asynchronous version of the method
|
|
1436
|
-
*
|
|
1437
|
-
* @param {object} oCatalogTile
|
|
1438
|
-
* Catalog tile
|
|
1439
|
-
* @returns {object}
|
|
1440
|
-
* returns a promise of a given catalog tile
|
|
1441
|
-
*/
|
|
1442
|
-
this.getCatalogTileViewControl = function (oCatalogTile) {
|
|
1443
|
-
return this._getCatalogTileViewControl(oCatalogTile);
|
|
1444
|
-
};
|
|
1445
|
-
|
|
1446
|
-
/**
|
|
1447
|
-
* Returns the preview subTitle for a given catalog tile
|
|
1448
|
-
*
|
|
1449
|
-
* @param {object} oGroupTileOrCatalogTile
|
|
1450
|
-
* Group tile or catalog tile
|
|
1451
|
-
* @returns {string}
|
|
1452
|
-
* Preview subtitle of given catalog tile
|
|
1453
|
-
* @throws an exception when the tile is not valid
|
|
1454
|
-
*/
|
|
1455
|
-
this.getCatalogTilePreviewSubtitle = function (oGroupTileOrCatalogTile) {
|
|
1456
|
-
if (this._isGroupTile(oGroupTileOrCatalogTile)) {
|
|
1457
|
-
return this.getTileSubtitle(oGroupTileOrCatalogTile);
|
|
1458
|
-
}
|
|
1459
|
-
return (oGroupTileOrCatalogTile.tileResolutionResult &&
|
|
1460
|
-
oGroupTileOrCatalogTile.tileResolutionResult.subTitle) || "";
|
|
1461
|
-
};
|
|
1462
|
-
|
|
1463
|
-
/**
|
|
1464
|
-
* Returns the preview icon for a given catalog tile
|
|
1465
|
-
*
|
|
1466
|
-
* @param {object} oGroupTileOrCatalogTile
|
|
1467
|
-
* Group tile or catalog tile
|
|
1468
|
-
* @returns {string}
|
|
1469
|
-
* Preview icon of given catalog tile
|
|
1470
|
-
* @throws an exception when the tile is not valid
|
|
1471
|
-
*/
|
|
1472
|
-
this.getCatalogTilePreviewIcon = function (oGroupTileOrCatalogTile) {
|
|
1473
|
-
if (this._isGroupTile(oGroupTileOrCatalogTile)) {
|
|
1474
|
-
return this.getTileIcon(oGroupTileOrCatalogTile);
|
|
1475
|
-
}
|
|
1476
|
-
return (oGroupTileOrCatalogTile.tileResolutionResult &&
|
|
1477
|
-
oGroupTileOrCatalogTile.tileResolutionResult.icon) || "";
|
|
1478
|
-
};
|
|
1479
|
-
|
|
1480
|
-
/**
|
|
1481
|
-
* Returns the preview Info for a given catalog tile
|
|
1482
|
-
*
|
|
1483
|
-
* @param {object} oGroupTileOrCatalogTile
|
|
1484
|
-
* Group tile or catalog tile
|
|
1485
|
-
* @returns {string}
|
|
1486
|
-
* Preview Info of given catalog tile
|
|
1487
|
-
* @throws an exception when the tile is not valid
|
|
1488
|
-
*/
|
|
1489
|
-
this.getCatalogTilePreviewInfo = function (oGroupTileOrCatalogTile) {
|
|
1490
|
-
if (this._isGroupTile(oGroupTileOrCatalogTile)) {
|
|
1491
|
-
return this.getTileInfo(oGroupTileOrCatalogTile);
|
|
1492
|
-
}
|
|
1493
|
-
return (oGroupTileOrCatalogTile.tileResolutionResult &&
|
|
1494
|
-
oGroupTileOrCatalogTile.tileResolutionResult.info) || "";
|
|
1495
|
-
};
|
|
1496
|
-
|
|
1497
|
-
/**
|
|
1498
|
-
* Returns the indicator data source url
|
|
1499
|
-
*
|
|
1500
|
-
* @param {object} oGroupTileOrCatalogTile
|
|
1501
|
-
* Group tile or catalog tile
|
|
1502
|
-
* @returns {object} The catalog tile indicator data source
|
|
1503
|
-
* @since 1.70.0
|
|
1504
|
-
*/
|
|
1505
|
-
this.getCatalogTilePreviewIndicatorDataSource = function (oGroupTileOrCatalogTile) {
|
|
1506
|
-
return oGroupTileOrCatalogTile.tileResolutionResult && oGroupTileOrCatalogTile.tileResolutionResult.indicatorDataSource;
|
|
1507
|
-
};
|
|
1508
|
-
|
|
1509
|
-
/**
|
|
1510
|
-
* Returns the keywords for a given tile (group or catalog tile)
|
|
1511
|
-
*
|
|
1512
|
-
* @param {object} oGroupTileOrCatalogTile
|
|
1513
|
-
* Group tile or catalog tile
|
|
1514
|
-
* @returns {array}
|
|
1515
|
-
* Keywords of respective catalog tile
|
|
1516
|
-
*/
|
|
1517
|
-
this.getCatalogTileKeywords = function (oGroupTileOrCatalogTile) {
|
|
1518
|
-
var aKeywords = [];
|
|
1519
|
-
var oResolvedTile = oGroupTileOrCatalogTile;
|
|
1520
|
-
|
|
1521
|
-
if (!oResolvedTile) {
|
|
1522
|
-
Log.error(
|
|
1523
|
-
"Could not find the Tile",
|
|
1524
|
-
"sap.ushell.adapters.cdm.LaunchPageAdapter"
|
|
1525
|
-
);
|
|
1526
|
-
return aKeywords;
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
if (this._mResolvedTiles && this._mResolvedTiles[oGroupTileOrCatalogTile.id]) {
|
|
1530
|
-
// input tile is a group tile
|
|
1531
|
-
oResolvedTile = this._mResolvedTiles[oGroupTileOrCatalogTile.id];
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
// Keywords from catalog tile
|
|
1535
|
-
if (oResolvedTile && oResolvedTile.tileResolutionResult &&
|
|
1536
|
-
Array.isArray(oResolvedTile.tileResolutionResult.keywords)) {
|
|
1537
|
-
Array.prototype.push.apply(aKeywords, oResolvedTile.tileResolutionResult.keywords);
|
|
1538
|
-
}
|
|
1539
|
-
if (oResolvedTile && oResolvedTile.tileResolutionResult &&
|
|
1540
|
-
oResolvedTile.tileResolutionResult.title) {
|
|
1541
|
-
aKeywords.push(oResolvedTile.tileResolutionResult.title);
|
|
1542
|
-
}
|
|
1543
|
-
if (oResolvedTile && oResolvedTile.tileResolutionResult &&
|
|
1544
|
-
oResolvedTile.tileResolutionResult.subTitle) {
|
|
1545
|
-
aKeywords.push(oResolvedTile.tileResolutionResult.subTitle);
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
|
-
return aKeywords;
|
|
1549
|
-
};
|
|
1550
|
-
|
|
1551
|
-
/**
|
|
1552
|
-
* Returns the technical attributes for a given tile (group or catalog tile)
|
|
1553
|
-
*
|
|
1554
|
-
* @param {object} oGroupTileOrCatalogTile
|
|
1555
|
-
* Group tile or catalog tile
|
|
1556
|
-
* @returns {array}
|
|
1557
|
-
* Technical attributes of respective catalog tile
|
|
1558
|
-
*/
|
|
1559
|
-
this.getCatalogTileTechnicalAttributes = function (oGroupTileOrCatalogTile) {
|
|
1560
|
-
var aTechnicalAttributes = [];
|
|
1561
|
-
var oResolvedTile = oGroupTileOrCatalogTile;
|
|
1562
|
-
|
|
1563
|
-
if (!oResolvedTile) {
|
|
1564
|
-
Log.error(
|
|
1565
|
-
"Could not find the Tile",
|
|
1566
|
-
"sap.ushell.adapters.cdm.LaunchPageAdapter"
|
|
1567
|
-
);
|
|
1568
|
-
return [];
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
if (this._mResolvedTiles && this._mResolvedTiles[oGroupTileOrCatalogTile.id]) {
|
|
1572
|
-
// input tile is a group tile
|
|
1573
|
-
oResolvedTile = this._mResolvedTiles[oGroupTileOrCatalogTile.id];
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
|
-
// technical attributes from catalog tile
|
|
1577
|
-
if (oResolvedTile && oResolvedTile.tileResolutionResult &&
|
|
1578
|
-
Array.isArray(oResolvedTile.tileResolutionResult.technicalAttributes)) {
|
|
1579
|
-
Array.prototype.push.apply(aTechnicalAttributes, oResolvedTile.tileResolutionResult.technicalAttributes);
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
|
-
return aTechnicalAttributes;
|
|
1583
|
-
};
|
|
1584
|
-
|
|
1585
|
-
/**
|
|
1586
|
-
* Counts <b>all</b> bookmarks pointing to the given URL from all of the user's groups.
|
|
1587
|
-
* The count is performed by visiting each matching bookmark and executing the optional
|
|
1588
|
-
* visitor procedure if it was provided. This method can be used to check if a bookmark
|
|
1589
|
-
* already exists. It will return a promise that resolves to a number greater than zero
|
|
1590
|
-
* if a bookmark exists.
|
|
1591
|
-
* <p>
|
|
1592
|
-
* This is a potentially asynchronous operation in case the user's groups have not yet been
|
|
1593
|
-
* loaded completely!
|
|
1594
|
-
*
|
|
1595
|
-
* @param {string} sUrl
|
|
1596
|
-
* The URL of the bookmarks to be counted, exactly as specified to {@link #addBookmark}.
|
|
1597
|
-
* @param {function} [fnVisitor]
|
|
1598
|
-
* For each bookmark tile that matches the given url, this function will be called with
|
|
1599
|
-
* the respective tile as argument.
|
|
1600
|
-
* @param {string} [sVizType]
|
|
1601
|
-
* (added with 1.83) The visualization type (viz type) which was used to create the bookmark using {@link #addCustomBookmark}.
|
|
1602
|
-
*
|
|
1603
|
-
* @returns {object}
|
|
1604
|
-
* A <code>jQuery.Deferred</code> object's promise which informs about success or failure
|
|
1605
|
-
* of this asynchronous operation. In case of success, the count of existing bookmarks
|
|
1606
|
-
* is provided (which might be zero). In case of failure, an error message is passed.
|
|
1607
|
-
*
|
|
1608
|
-
* @see #countBookmark
|
|
1609
|
-
* @see #addBookmark
|
|
1610
|
-
*
|
|
1611
|
-
* @private
|
|
1612
|
-
*/
|
|
1613
|
-
this._visitBookmarks = function (sUrl, fnVisitor, sVizType, sContentProviderId) {
|
|
1614
|
-
var oReferenceTarget;
|
|
1615
|
-
var oIntent = urlParsing.parseShellHash(sUrl);
|
|
1616
|
-
|
|
1617
|
-
if (oIntent) {
|
|
1618
|
-
// oUrlParser.parseShellHash was successful
|
|
1619
|
-
oReferenceTarget = createNewTargetFromIntent(oIntent);
|
|
1620
|
-
} else {
|
|
1621
|
-
// this is an arbitrary URL as oUrlParser.parseShellHash failed
|
|
1622
|
-
oReferenceTarget = createNewTargetFromUrl(sUrl);
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
return this.oCDMService.getSite().then(function (oSite) {
|
|
1626
|
-
var oGroups = oSite.groups;
|
|
1627
|
-
|
|
1628
|
-
var aTiles = Object.keys(oGroups)
|
|
1629
|
-
.filter(function (sKey) {
|
|
1630
|
-
// Always ignore locked groups.
|
|
1631
|
-
return !oGroups[sKey].payload.locked;
|
|
1632
|
-
})
|
|
1633
|
-
.map(function (sKey) {
|
|
1634
|
-
return oGroups[sKey].payload.tiles.filter(function (oTile) {
|
|
1635
|
-
// Consider only matching bookmark tiles. VizType is only set for custom bookmark tiles.
|
|
1636
|
-
return oTile.isBookmark
|
|
1637
|
-
&& oTile.vizType === sVizType
|
|
1638
|
-
&& (oTile.contentProvider || "") === (sContentProviderId || "")
|
|
1639
|
-
&& isSameTarget(oReferenceTarget, oTile.target);
|
|
1640
|
-
});
|
|
1641
|
-
})
|
|
1642
|
-
.reduce(function (aAllTiles, aCurrentGroupTiles) {
|
|
1643
|
-
Array.prototype.push.apply(aAllTiles, aCurrentGroupTiles);
|
|
1644
|
-
return aAllTiles;
|
|
1645
|
-
}, []);
|
|
1646
|
-
|
|
1647
|
-
if (!fnVisitor) {
|
|
1648
|
-
return aTiles.length;
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
return jQuery.when(aTiles.map(fnVisitor)).then(function () {
|
|
1652
|
-
return aTiles.length;
|
|
1653
|
-
});
|
|
1654
|
-
});
|
|
1655
|
-
};
|
|
1656
|
-
|
|
1657
|
-
/**
|
|
1658
|
-
* Adds a bookmark to the user's home page.
|
|
1659
|
-
* Given a specific group the bookmark is added to the group,
|
|
1660
|
-
* otherwise it's added to the default group on the user's home page.
|
|
1661
|
-
*
|
|
1662
|
-
* @param {object} oParameters
|
|
1663
|
-
* Bookmark parameters. In addition to title and URL, a bookmark might allow additional
|
|
1664
|
-
* settings, such as an icon or a subtitle. Which settings are supported depends
|
|
1665
|
-
* on the environment in which the application is running. Unsupported parameters will be
|
|
1666
|
-
* ignored.
|
|
1667
|
-
* <p>
|
|
1668
|
-
* The <code>oParameters.dataSource</code> property always shadows <code>oParameters.serviceUrl</code>.
|
|
1669
|
-
* So if both are provided, the former is used and the later ignored. In essence, note that
|
|
1670
|
-
* <code>oParameters.serviceUrl</code> is marked for eventual deprecation.
|
|
1671
|
-
*
|
|
1672
|
-
* @param {string} oParameters.title
|
|
1673
|
-
* The title of the bookmark.
|
|
1674
|
-
* @param {string} oParameters.url
|
|
1675
|
-
* The URL of the bookmark. If the target application shall run in the Shell the URL has
|
|
1676
|
-
* to be in the format <code>"#SO-Action~Context?P1=a&P2=x&/route?RPV=1"</code>
|
|
1677
|
-
* @param {string} [oParameters.icon]
|
|
1678
|
-
* The optional icon URL of the bookmark (e.g. <code>"sap-icon://home"</code>).
|
|
1679
|
-
* @param {string} [oParameters.info]
|
|
1680
|
-
* The optional information text of the bookmark. This is a legacy property
|
|
1681
|
-
* and is not applicable in CDM context.
|
|
1682
|
-
* @param {string} [oParameters.subtitle]
|
|
1683
|
-
* The optional subtitle of the bookmark.
|
|
1684
|
-
*
|
|
1685
|
-
* @param {object} [oParameters.dataSource]
|
|
1686
|
-
* This object describes settings for reaching the service the service
|
|
1687
|
-
* that provides dynamic information for the bookmark. This property,
|
|
1688
|
-
* together with the <code>serviceUrlPath</code> are the accepted means
|
|
1689
|
-
* for specifying the location of the dynamic data resource.
|
|
1690
|
-
* @param {string} [oParameters.dataSource.uri]
|
|
1691
|
-
* The base URL to the REST or OData service.
|
|
1692
|
-
* @param {string} [oParameters.dataSource.type]
|
|
1693
|
-
* The type of the service e.g. "OData".
|
|
1694
|
-
* @param {object} [oParameters.dataSource.Settings]
|
|
1695
|
-
* In-depth details of the data source service.
|
|
1696
|
-
* @param {string} [oParameters.dataSource.Settings.odataVersion]
|
|
1697
|
-
* The version of oData implementation the service is based on.
|
|
1698
|
-
* @param {string} [oParameters.dataSource.Settings.annotations]
|
|
1699
|
-
* The annotations of the data source service
|
|
1700
|
-
* @param {string} [oParameters.dataSource.Settings.localUri]
|
|
1701
|
-
* The local URI of the data source service
|
|
1702
|
-
* @param {int} [oParameters.dataSource.Settings.maxAge]
|
|
1703
|
-
* The maxAge parameter of the data source service
|
|
1704
|
-
* @param {string} [oParameters.serviceUrlPath]
|
|
1705
|
-
* The path to the service method/action that actually returns the dynamic
|
|
1706
|
-
* information.
|
|
1707
|
-
* @param {string} [oParameters.serviceRefreshInterval]
|
|
1708
|
-
* The refresh interval for the <code>serviceUrl</code> in seconds.
|
|
1709
|
-
*
|
|
1710
|
-
* @param {string} [oParameters.serviceUrl]
|
|
1711
|
-
* The URL to a REST or OData service that provides some dynamic information
|
|
1712
|
-
* for the bookmark.
|
|
1713
|
-
* The <code>dataSource</code> property is the preferred interface for
|
|
1714
|
-
* defining where and how the dynamic data is fetched. This property
|
|
1715
|
-
* remains for legacy reasons. Going forward, you are highly discouraged
|
|
1716
|
-
* from utilising this property.
|
|
1717
|
-
* @param {string} [oParameters.numberUnit]
|
|
1718
|
-
* The unit for the number retrieved from <code>serviceUrl</code>. This
|
|
1719
|
-
* is a legacy property and is not applicable in CDM context.
|
|
1720
|
-
*
|
|
1721
|
-
* Reference to the group the bookmark should be added to.
|
|
1722
|
-
* @param {object} [oGroup]
|
|
1723
|
-
* Group
|
|
1724
|
-
* @param {object} [sContentProviderId] The content provider id in cFLP scenario
|
|
1725
|
-
*
|
|
1726
|
-
* @returns {object}
|
|
1727
|
-
* A <code>jQuery.Deferred</code> promise which resolves on success, but rejects
|
|
1728
|
-
* (with a reason-message) on failure to add the bookmark to the specified or implied group.
|
|
1729
|
-
* Group
|
|
1730
|
-
* @see sap.ushell.services.URLParsing#getShellHash
|
|
1731
|
-
* @since 1.42.0
|
|
1732
|
-
* @public
|
|
1733
|
-
*/
|
|
1734
|
-
this.addBookmark = function (oParameters, oGroup, sContentProviderId) {
|
|
1735
|
-
var that = this;
|
|
1736
|
-
|
|
1737
|
-
return new jQuery.Deferred(function (oDeferred) {
|
|
1738
|
-
var oCdmSiteService = that.oCDMService;
|
|
1739
|
-
|
|
1740
|
-
jQuery.when(oGroup || that.getDefaultGroup(), oCdmSiteService.getSite())
|
|
1741
|
-
.done(function (oGroup, oSite) {
|
|
1742
|
-
var oTarget;
|
|
1743
|
-
var oIntent = urlParsing.parseShellHash(oParameters.url);
|
|
1744
|
-
var oResolveTilePromise;
|
|
1745
|
-
var bIsUrlBookmarkTile = false;
|
|
1746
|
-
|
|
1747
|
-
if (!oIntent) {
|
|
1748
|
-
oTarget = createNewTargetFromUrl(oParameters.url);
|
|
1749
|
-
bIsUrlBookmarkTile = true;
|
|
1750
|
-
} else {
|
|
1751
|
-
oTarget = createNewTargetFromIntent(oIntent);
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1754
|
-
var oTile = composeNewBookmarkTile(
|
|
1755
|
-
oParameters,
|
|
1756
|
-
oTarget,
|
|
1757
|
-
sContentProviderId
|
|
1758
|
-
);
|
|
1759
|
-
|
|
1760
|
-
if (bIsUrlBookmarkTile) {
|
|
1761
|
-
oResolveTilePromise = new jQuery.Deferred();
|
|
1762
|
-
oResolveTilePromise.resolve(that._getTileForUrl(oTile));
|
|
1763
|
-
} else {
|
|
1764
|
-
// resolve tile for later use (other tiles are resolved in getGroups)
|
|
1765
|
-
oResolveTilePromise = that._getTileFromHash(oParameters.url);
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
oResolveTilePromise
|
|
1769
|
-
.done(function (oNewResolvedTile) {
|
|
1770
|
-
oNewResolvedTile.isLink = false; // currently only bookmark tiles can be created
|
|
1771
|
-
that._mResolvedTiles[oTile.id] = oNewResolvedTile;
|
|
1772
|
-
|
|
1773
|
-
// add tile to the side and save
|
|
1774
|
-
oSite.groups[oGroup.identification.id].payload.tiles.push(oTile);
|
|
1775
|
-
oCdmSiteService.save()
|
|
1776
|
-
.done(function () {
|
|
1777
|
-
oDeferred.resolve(oTile);
|
|
1778
|
-
})
|
|
1779
|
-
.fail(function (sReason) {
|
|
1780
|
-
oDeferred.reject(sReason);
|
|
1781
|
-
});
|
|
1782
|
-
})
|
|
1783
|
-
.fail(function (sErrorMsg) {
|
|
1784
|
-
// Note: do not add error message to that._mFailedResolvedTiles[oTile.id]
|
|
1785
|
-
// as the tile was not created which makes the cache useless
|
|
1786
|
-
oDeferred.reject("Bookmark creation failed because: " + sErrorMsg);
|
|
1787
|
-
});
|
|
1788
|
-
})
|
|
1789
|
-
.fail(function (sReason) {
|
|
1790
|
-
oDeferred.reject(sReason);
|
|
1791
|
-
});
|
|
1792
|
-
}).promise();
|
|
1793
|
-
};
|
|
1794
|
-
|
|
1795
|
-
/**
|
|
1796
|
-
* Adds a custom bookmark to the user's home page.
|
|
1797
|
-
* Given a specific group the bookmark is added to the group,
|
|
1798
|
-
* otherwise it's added to the default group on the user's home page.
|
|
1799
|
-
*
|
|
1800
|
-
* @param {object} oBookmarkConfig The configuration of the bookmark. See below for the structure.
|
|
1801
|
-
* <pre>
|
|
1802
|
-
* {
|
|
1803
|
-
* vizType: "sap.ushell.demotiles.cdm.newstile",
|
|
1804
|
-
* vizConfig: {
|
|
1805
|
-
* "sap.flp": {
|
|
1806
|
-
* chipConfig: {
|
|
1807
|
-
* chipId: "X-SAP-UI2-CHIP:/UI2/AR_SRVC_NEWS",
|
|
1808
|
-
* bags: {},
|
|
1809
|
-
* configuration: {}
|
|
1810
|
-
* }
|
|
1811
|
-
* },
|
|
1812
|
-
* "sap.platform.runtime": {
|
|
1813
|
-
* includeManifest: true
|
|
1814
|
-
* }
|
|
1815
|
-
* },
|
|
1816
|
-
* url: "#Action-toBookmark?a=b",
|
|
1817
|
-
* title: "My Title",
|
|
1818
|
-
* icon: "sap-icon://world",
|
|
1819
|
-
* subtitle: "My Subtitle",
|
|
1820
|
-
* info: "My Info"
|
|
1821
|
-
* }
|
|
1822
|
-
* </pre>
|
|
1823
|
-
* @param {object} oTargetGroup The group where the bookmark should be added
|
|
1824
|
-
* @param {string} sContentProviderId The contentProviderId or undefined outside the cFLP
|
|
1825
|
-
*
|
|
1826
|
-
* @returns {object} A jQuery.Deferred which resolves with the resulting tile or rejects in case of an error
|
|
1827
|
-
*
|
|
1828
|
-
* @private
|
|
1829
|
-
* @since 1.83.0
|
|
1830
|
-
*/
|
|
1831
|
-
this.addCustomBookmark = function (oBookmarkConfig, oTargetGroup, sContentProviderId) {
|
|
1832
|
-
var oDeferred = new jQuery.Deferred();
|
|
1833
|
-
|
|
1834
|
-
Promise.all([
|
|
1835
|
-
sap.ushell.Container.getServiceAsync("URLParsing"),
|
|
1836
|
-
sap.ushell.Container.getServiceAsync("CommonDataModel")
|
|
1837
|
-
]).then(function (aResults) {
|
|
1838
|
-
var oUrlParsing = aResults[0];
|
|
1839
|
-
var oCdmSiteService = aResults[1];
|
|
1840
|
-
|
|
1841
|
-
jQuery.when(oTargetGroup || this.getDefaultGroup(), oCdmSiteService.getSite())
|
|
1842
|
-
.done(function (oGroup, oSite) {
|
|
1843
|
-
var oIntent = oUrlParsing.parseShellHash(oBookmarkConfig.url);
|
|
1844
|
-
var bIsUrlBookmarkTile = (oIntent === undefined);
|
|
1845
|
-
|
|
1846
|
-
var oTarget = bIsUrlBookmarkTile ? createNewTargetFromUrl(oBookmarkConfig.url) : createNewTargetFromIntent(oIntent);
|
|
1847
|
-
|
|
1848
|
-
// building a grouptile but with vizConfig like a visualization
|
|
1849
|
-
var oTile = {
|
|
1850
|
-
id: oUshellUtils.generateUniqueId([]),
|
|
1851
|
-
vizType: oBookmarkConfig.vizType,
|
|
1852
|
-
title: oBookmarkConfig.title,
|
|
1853
|
-
subTitle: oBookmarkConfig.subtitle,
|
|
1854
|
-
icon: oBookmarkConfig.icon,
|
|
1855
|
-
info: oBookmarkConfig.info,
|
|
1856
|
-
numberUnit: oBookmarkConfig.numberUnit,
|
|
1857
|
-
target: oTarget,
|
|
1858
|
-
indicatorDataSource: {
|
|
1859
|
-
path: oBookmarkConfig.serviceUrl,
|
|
1860
|
-
refresh: oBookmarkConfig.serviceRefreshInterval
|
|
1861
|
-
},
|
|
1862
|
-
vizConfig: oBookmarkConfig.vizConfig,
|
|
1863
|
-
isBookmark: true
|
|
1864
|
-
};
|
|
1865
|
-
|
|
1866
|
-
if (sContentProviderId) {
|
|
1867
|
-
oTile.contentProvider = sContentProviderId;
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
this._resolveTileByVizId(oTile, oSite)
|
|
1871
|
-
.done(function (oNewResolvedTile) {
|
|
1872
|
-
oNewResolvedTile.isLink = false; // currently only bookmark tiles can be created
|
|
1873
|
-
this._mResolvedTiles[oTile.id] = oNewResolvedTile;
|
|
1874
|
-
|
|
1875
|
-
// add tile to the site and save
|
|
1876
|
-
oSite.groups[oGroup.identification.id].payload.tiles.push(oTile);
|
|
1877
|
-
oCdmSiteService.save()
|
|
1878
|
-
.done(function () {
|
|
1879
|
-
oDeferred.resolve(oTile);
|
|
1880
|
-
})
|
|
1881
|
-
.fail(oDeferred.reject);
|
|
1882
|
-
}.bind(this))
|
|
1883
|
-
.fail(function (sErrorMsg) {
|
|
1884
|
-
// Note: do not add error message to that._mFailedResolvedTiles[oTile.id]
|
|
1885
|
-
// as the tile was not created which makes the cache useless
|
|
1886
|
-
oDeferred.reject("Bookmark creation failed because: " + sErrorMsg);
|
|
1887
|
-
});
|
|
1888
|
-
}.bind(this))
|
|
1889
|
-
.fail(oDeferred.reject);
|
|
1890
|
-
}.bind(this));
|
|
1891
|
-
|
|
1892
|
-
return oDeferred.promise();
|
|
1893
|
-
};
|
|
1894
|
-
|
|
1895
|
-
/**
|
|
1896
|
-
* Counts <b>all</b> bookmarks pointing to the given URL from all of the user's groups. You
|
|
1897
|
-
* can use this method to check if a bookmark already exists.
|
|
1898
|
-
* <p>
|
|
1899
|
-
* This is a potentially asynchronous operation in case the user's groups have not yet been
|
|
1900
|
-
* loaded completely!
|
|
1901
|
-
*
|
|
1902
|
-
* @param {string} sUrl
|
|
1903
|
-
* The URL of the bookmarks to be counted, exactly as specified to {@link #addBookmark}.
|
|
1904
|
-
* @returns {object}
|
|
1905
|
-
* A <code>jQuery.Deferred</code> object's promise which informs about success or failure
|
|
1906
|
-
* of this asynchronous operation. In case of success, the count of existing bookmarks
|
|
1907
|
-
* is provided (which might be zero). In case of failure, an error message is passed.
|
|
1908
|
-
*
|
|
1909
|
-
* @see #addBookmark
|
|
1910
|
-
* @private
|
|
1911
|
-
*/
|
|
1912
|
-
this.countBookmarks = function (sUrl, sContentProviderId) {
|
|
1913
|
-
return this._visitBookmarks(sUrl, undefined, undefined, sContentProviderId);
|
|
1914
|
-
};
|
|
1915
|
-
|
|
1916
|
-
/**
|
|
1917
|
-
* Counts <b>all</b> custom bookmarks matching exactly the identification data.
|
|
1918
|
-
* Can be used to check if a bookmark already exists (e.g. before updating).
|
|
1919
|
-
*
|
|
1920
|
-
* @param {object} oIdentifier
|
|
1921
|
-
* An object which is used to find the bookmarks by matching the provided properties.
|
|
1922
|
-
* @param {string} oIdentifier.url
|
|
1923
|
-
* The URL which was used to create the bookmark using {@link #addCustomBookmark}.
|
|
1924
|
-
* @param {string} oIdentifier.vizType
|
|
1925
|
-
* The visualization type (viz type) which was used to create the bookmark using {@link #addCustomBookmark}.
|
|
1926
|
-
*
|
|
1927
|
-
* @returns {Promise<int>} The count of bookmarks matching the identifier.
|
|
1928
|
-
*
|
|
1929
|
-
* @see #addCustomBookmark
|
|
1930
|
-
* @since 1.83.0
|
|
1931
|
-
*
|
|
1932
|
-
* @private
|
|
1933
|
-
*/
|
|
1934
|
-
this.countCustomBookmarks = function (oIdentifier) {
|
|
1935
|
-
if (!oIdentifier.vizType) {
|
|
1936
|
-
return Promise.reject("countCustomBookmarks: Required parameter is missing: oIdentifier.vizType");
|
|
1937
|
-
}
|
|
1938
|
-
|
|
1939
|
-
return new Promise(function (resolve, reject) {
|
|
1940
|
-
this._visitBookmarks(oIdentifier.url, undefined, oIdentifier.vizType, oIdentifier.contentProviderId).done(resolve).fail(reject);
|
|
1941
|
-
}.bind(this));
|
|
1942
|
-
};
|
|
1943
|
-
|
|
1944
|
-
/**
|
|
1945
|
-
* Updates <b>all</b> bookmarks pointing to the given URL in all of the user's groups
|
|
1946
|
-
* with the given new parameters. Parameters which are omitted are not changed in the
|
|
1947
|
-
* existing bookmarks.
|
|
1948
|
-
*
|
|
1949
|
-
* @param {string} sUrl
|
|
1950
|
-
* The URL of the bookmarks to be updated, exactly as specified to {@link #addBookmark}.
|
|
1951
|
-
* In case you need to update the URL itself, pass the old one here and the new one as
|
|
1952
|
-
* <code>oParameters.url</code>!
|
|
1953
|
-
* @param {object} oParameters
|
|
1954
|
-
* The bookmark parameters as documented in {@link #addBookmark}.
|
|
1955
|
-
* <p>
|
|
1956
|
-
* If it is desired to remove the dynamic nature of the bookmark,
|
|
1957
|
-
* set either <code>oParameters.dataSource</code> or <code>oParameters.serviceUrl</code> to null.
|
|
1958
|
-
* <p>
|
|
1959
|
-
* The <code>oParameters.dataSource</code> property always shadows <code>oParameters.serviceUrl</code>.
|
|
1960
|
-
* So if both are provided, the former is used and the later ignored. Trying to update
|
|
1961
|
-
* <code>oParameters.dataSource</code> with <code>oParameters.serviceUrl</code> results
|
|
1962
|
-
* in a warning.
|
|
1963
|
-
* <p>
|
|
1964
|
-
* In essence, note that <code>oParameters.serviceUrl</code> is marked for eventual deprecation.
|
|
1965
|
-
*
|
|
1966
|
-
* @param {string} [sVizType]
|
|
1967
|
-
* (added with 1.83) The visualization type (viz type) which was used to create the bookmark using {@link #addCustomBookmark}.
|
|
1968
|
-
*
|
|
1969
|
-
* @returns {object}
|
|
1970
|
-
* A <code>jQuery.Deferred</code> object's promise which informs about success or failure
|
|
1971
|
-
* of this asynchronous operation. In case of success, the number of updated bookmarks
|
|
1972
|
-
* is provided (which might be zero). In case of failure, an error message is passed.
|
|
1973
|
-
*
|
|
1974
|
-
* @see #addBookmark
|
|
1975
|
-
* @see #countBookmarks
|
|
1976
|
-
* @see #deleteBookmarks
|
|
1977
|
-
*
|
|
1978
|
-
* @since 1.42.0
|
|
1979
|
-
*/
|
|
1980
|
-
this.updateBookmarks = function (sUrl, oParameters, sVizType, sContentProviderId) {
|
|
1981
|
-
var oCdmSiteService = this.oCDMService;
|
|
1982
|
-
|
|
1983
|
-
var mResolvedTiles = this._mResolvedTiles;
|
|
1984
|
-
|
|
1985
|
-
// Visitor function that updates each encountered bookmark tile as necessary.
|
|
1986
|
-
function updateEach (oTile) {
|
|
1987
|
-
return new jQuery.Deferred(function (oDeferred) {
|
|
1988
|
-
var oNewTarget;
|
|
1989
|
-
var bTileViewPropertiesChanged = false;
|
|
1990
|
-
var oChangedTileViewProperties = {};
|
|
1991
|
-
|
|
1992
|
-
if (oParameters.url || oParameters.url === "") {
|
|
1993
|
-
var oIntent = urlParsing.parseShellHash(oParameters.url);
|
|
1994
|
-
if (!oIntent) {
|
|
1995
|
-
// url bookmark tile
|
|
1996
|
-
oNewTarget = createNewTargetFromUrl(oParameters.url);
|
|
1997
|
-
} else {
|
|
1998
|
-
oNewTarget = createNewTargetFromIntent(oIntent);
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
// Check if necessary to propagate change in certain
|
|
2003
|
-
// properties to the view. This check must be done before
|
|
2004
|
-
// oTile is mutated with the effect that it's properties
|
|
2005
|
-
// assume the updated state.
|
|
2006
|
-
if (oTile.icon !== oParameters.icon) {
|
|
2007
|
-
oChangedTileViewProperties.icon = oParameters.icon;
|
|
2008
|
-
bTileViewPropertiesChanged = true;
|
|
2009
|
-
}
|
|
2010
|
-
if (oTile.title !== oParameters.title) {
|
|
2011
|
-
oChangedTileViewProperties.title = oParameters.title;
|
|
2012
|
-
bTileViewPropertiesChanged = true;
|
|
2013
|
-
}
|
|
2014
|
-
if (oTile.subTitle !== oParameters.subtitle) {
|
|
2015
|
-
oChangedTileViewProperties.subtitle = oParameters.subtitle;
|
|
2016
|
-
bTileViewPropertiesChanged = true;
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
if (oParameters.url && sUrl !== oParameters.url) {
|
|
2020
|
-
// target URL is given and was changed, so inform the view
|
|
2021
|
-
oChangedTileViewProperties.targetURL = oParameters.url;
|
|
2022
|
-
bTileViewPropertiesChanged = true;
|
|
2023
|
-
}
|
|
2024
|
-
if (oTile.info !== oParameters.info) {
|
|
2025
|
-
// target URL is given and was changed, so inform the view
|
|
2026
|
-
oChangedTileViewProperties.info = oParameters.info;
|
|
2027
|
-
bTileViewPropertiesChanged = true;
|
|
2028
|
-
}
|
|
2029
|
-
|
|
2030
|
-
// Update tile model - mutates the given oTile reference.
|
|
2031
|
-
updateTileComposition(oTile, oParameters, oNewTarget);
|
|
2032
|
-
|
|
2033
|
-
if (bTileViewPropertiesChanged && mResolvedTiles[oTile.id]) {
|
|
2034
|
-
var oTileComponent = mResolvedTiles[oTile.id].tileComponent;
|
|
2035
|
-
//tileComponent is defined in the getTileView method. In case of the direct start, tileComponent is not defined
|
|
2036
|
-
if (oTileComponent) {
|
|
2037
|
-
oTileComponent.tileSetVisualProperties(oChangedTileViewProperties);
|
|
2038
|
-
}
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
oDeferred.resolve(oTile);
|
|
2042
|
-
}).promise();
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2045
|
-
// When save is successful, return count of updated bookmarks,
|
|
2046
|
-
// otherwise the rejected promise due to the failed save operation is returned.
|
|
2047
|
-
return this._visitBookmarks(sUrl, updateEach, sVizType, sContentProviderId)
|
|
2048
|
-
.then(function (iUpdatedCount) {
|
|
2049
|
-
return oCdmSiteService.save().then(function () {
|
|
2050
|
-
return iUpdatedCount;
|
|
2051
|
-
});
|
|
2052
|
-
});
|
|
2053
|
-
};
|
|
2054
|
-
|
|
2055
|
-
/**
|
|
2056
|
-
* Updates <b>all</b> custom bookmarks matching exactly the identification data.
|
|
2057
|
-
* Only given properties are updated.
|
|
2058
|
-
* {@link #countCustomBookmarks} can be used to check upfront how many bookmarks are going to be affected.
|
|
2059
|
-
* The vizType of the bookmarks <b>cannot be changed!</b>
|
|
2060
|
-
*
|
|
2061
|
-
* @param {object} oIdentifier
|
|
2062
|
-
* An object which is used to find the bookmarks by matching the provided properties.
|
|
2063
|
-
* @param {string} oIdentifier.url
|
|
2064
|
-
* The URL which was used to create the bookmark using {@link #addCustomBookmark}.
|
|
2065
|
-
* @param {string} oIdentifier.vizType
|
|
2066
|
-
* The visualization type (viz type) which was used to create the bookmark using {@link #addCustomBookmark}.
|
|
2067
|
-
*
|
|
2068
|
-
* @param {object} oBookmarkConfig The configuration of the bookmark. See below for the structure.
|
|
2069
|
-
* <pre>
|
|
2070
|
-
* {
|
|
2071
|
-
* vizConfig: {
|
|
2072
|
-
* "sap.platform.runtime": {
|
|
2073
|
-
* includeManifest: true
|
|
2074
|
-
* }
|
|
2075
|
-
* },
|
|
2076
|
-
* url: "#Action-toBookmark?a=b",
|
|
2077
|
-
* title: "My Title",
|
|
2078
|
-
* icon: "sap-icon://world",
|
|
2079
|
-
* subtitle: "My Subtitle",
|
|
2080
|
-
* info: "My Info"
|
|
2081
|
-
* }
|
|
2082
|
-
* </pre>
|
|
2083
|
-
*
|
|
2084
|
-
* @returns {Promise<int>} The count of bookmarks which were updated.
|
|
2085
|
-
*
|
|
2086
|
-
* @see #addCustomBookmark
|
|
2087
|
-
* @see #countCustomBookmarks
|
|
2088
|
-
* @since 1.83.0
|
|
2089
|
-
*
|
|
2090
|
-
* @private
|
|
2091
|
-
*/
|
|
2092
|
-
this.updateCustomBookmarks = function (oIdentifier, oBookmarkConfig) {
|
|
2093
|
-
if (!oIdentifier.vizType) {
|
|
2094
|
-
return Promise.reject("updateCustomBookmarks: Required parameter is missing: oIdentifier.vizType");
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
|
-
if (oBookmarkConfig.title === "") {
|
|
2098
|
-
return Promise.reject("updateCustomBookmarks: The bookmark title cannot be an empty string");
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
|
-
if (oBookmarkConfig.url === "") {
|
|
2102
|
-
return Promise.reject("updateCustomBookmarks: The bookmark url cannot be an empty string");
|
|
2103
|
-
}
|
|
2104
|
-
|
|
2105
|
-
return new Promise(function (resolve, reject) {
|
|
2106
|
-
this.updateBookmarks(oIdentifier.url, oBookmarkConfig, oIdentifier.vizType, oIdentifier.contentProviderId).done(resolve).fail(reject);
|
|
2107
|
-
}.bind(this));
|
|
2108
|
-
};
|
|
2109
|
-
|
|
2110
|
-
/**
|
|
2111
|
-
* Deletes <b>all</b> bookmarks pointing to the given URL from all of the user's groups.
|
|
2112
|
-
*
|
|
2113
|
-
* @param {string} sUrl
|
|
2114
|
-
* The URL of the bookmarks to be deleted, exactly as specified to {@link #addBookmark}.
|
|
2115
|
-
* @param {string} [sVizType]
|
|
2116
|
-
* (added with 1.83) The visualization type (viz type) which was used to create the bookmark using {@link #addCustomBookmark}.
|
|
2117
|
-
*
|
|
2118
|
-
* @returns {object}
|
|
2119
|
-
* A <code>jQuery.Deferred</code> object's promise which informs about success or failure
|
|
2120
|
-
* of this asynchronous operation. In case of success, the number of deleted bookmarks
|
|
2121
|
-
* is provided (which might be zero). In case of failure, an error message is passed.
|
|
2122
|
-
*
|
|
2123
|
-
* @see #addBookmark
|
|
2124
|
-
* @see #countBookmarks
|
|
2125
|
-
* @since 1.42.0
|
|
2126
|
-
*/
|
|
2127
|
-
this.deleteBookmarks = function (sUrl, sVizType, sContentProviderId) {
|
|
2128
|
-
var oCDMService = this.oCDMService;
|
|
2129
|
-
var oIntent = urlParsing.parseShellHash(sUrl);
|
|
2130
|
-
var oReferenceTarget;
|
|
2131
|
-
|
|
2132
|
-
if (oIntent) {
|
|
2133
|
-
// oUrlParser.parseShellHash was successful
|
|
2134
|
-
oReferenceTarget = createNewTargetFromIntent(oIntent);
|
|
2135
|
-
} else {
|
|
2136
|
-
// this is an arbitrary URL as oUrlParser.parseShellHash failed
|
|
2137
|
-
oReferenceTarget = createNewTargetFromUrl(sUrl);
|
|
2138
|
-
}
|
|
2139
|
-
|
|
2140
|
-
return oCDMService.getSite().then(function (oSite) {
|
|
2141
|
-
var oGroups = oSite.groups;
|
|
2142
|
-
|
|
2143
|
-
var iDeletedTiles = Object.keys(oGroups)
|
|
2144
|
-
.map(function (sKey) {
|
|
2145
|
-
var oPayload = oGroups[sKey].payload;
|
|
2146
|
-
var iCountGroupTilesToDelete = 0;
|
|
2147
|
-
|
|
2148
|
-
oPayload.tiles = oPayload.tiles.filter(function (oTile) {
|
|
2149
|
-
if (oTile.isBookmark
|
|
2150
|
-
&& oTile.vizType === sVizType // vizType is only set for custom bookmark tiles.
|
|
2151
|
-
&& (oTile.contentProvider || "") === (sContentProviderId || "")
|
|
2152
|
-
&& isSameTarget(oReferenceTarget, oTile.target)) {
|
|
2153
|
-
++iCountGroupTilesToDelete;
|
|
2154
|
-
return false;
|
|
2155
|
-
}
|
|
2156
|
-
|
|
2157
|
-
return true;
|
|
2158
|
-
});
|
|
2159
|
-
|
|
2160
|
-
return iCountGroupTilesToDelete;
|
|
2161
|
-
})
|
|
2162
|
-
.reduce(function (aggregateSum, groupSum) {
|
|
2163
|
-
aggregateSum += groupSum;
|
|
2164
|
-
|
|
2165
|
-
return aggregateSum;
|
|
2166
|
-
}, 0);
|
|
2167
|
-
|
|
2168
|
-
return oCDMService.save().then(function () {
|
|
2169
|
-
return iDeletedTiles;
|
|
2170
|
-
});
|
|
2171
|
-
});
|
|
2172
|
-
};
|
|
2173
|
-
|
|
2174
|
-
/**
|
|
2175
|
-
* Deletes <b>all</b> custom bookmarks matching exactly the identification data.
|
|
2176
|
-
* {@link #countCustomBookmarks} can be used to check upfront how many bookmarks are going to be affected.
|
|
2177
|
-
*
|
|
2178
|
-
* @param {object} oIdentifier
|
|
2179
|
-
* An object which is used to find the bookmarks by matching the provided properties.
|
|
2180
|
-
* @param {string} oIdentifier.url
|
|
2181
|
-
* The URL which was used to create the bookmark using {@link #addCustomBookmark}.
|
|
2182
|
-
* @param {string} oIdentifier.vizType
|
|
2183
|
-
* The visualization type (viz type) which was used to create the bookmark using {@link #addCustomBookmark}.
|
|
2184
|
-
*
|
|
2185
|
-
* @returns {Promise<int>} The count of bookmarks which were deleted.
|
|
2186
|
-
*
|
|
2187
|
-
* @see #addCustomBookmark
|
|
2188
|
-
* @see #countCustomBookmarks
|
|
2189
|
-
* @since 1.83.0
|
|
2190
|
-
*
|
|
2191
|
-
* @private
|
|
2192
|
-
*/
|
|
2193
|
-
this.deleteCustomBookmarks = function (oIdentifier) {
|
|
2194
|
-
if (!oIdentifier.vizType) {
|
|
2195
|
-
return Promise.reject("deleteCustomBookmarks: Required parameter is missing: oIdentifier.vizType");
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
|
-
return new Promise(function (resolve, reject) {
|
|
2199
|
-
this.deleteBookmarks(oIdentifier.url, oIdentifier.vizType, oIdentifier.contentProviderId).done(resolve).fail(reject);
|
|
2200
|
-
}.bind(this));
|
|
2201
|
-
};
|
|
2202
|
-
|
|
2203
|
-
/**
|
|
2204
|
-
* This method is called to notify that the given tile has been added to some remote
|
|
2205
|
-
* catalog which is not specified further.
|
|
2206
|
-
*
|
|
2207
|
-
* @param {string} sTileId
|
|
2208
|
-
* the ID of the tile that has been added to the catalog (as returned by that OData POST
|
|
2209
|
-
* operation)
|
|
2210
|
-
* @private
|
|
2211
|
-
* @since 1.42.0
|
|
2212
|
-
*/
|
|
2213
|
-
this.onCatalogTileAdded = function (sTileId) {
|
|
2214
|
-
// TODO implement (getCatalogs should relaod on the following call)
|
|
2215
|
-
};
|
|
2216
|
-
|
|
2217
|
-
/**
|
|
2218
|
-
* Callback function which gets triggered once
|
|
2219
|
-
* the end user submits the tile settings dialog.
|
|
2220
|
-
* Updates the visual properties of the tile and
|
|
2221
|
-
* reflects the change to the Common Data Model site.
|
|
2222
|
-
* In addition it triggers saving the changes to
|
|
2223
|
-
* the personalization delta.
|
|
2224
|
-
*
|
|
2225
|
-
* @param {object} oTile
|
|
2226
|
-
* Tile for which the settings dialog got opened
|
|
2227
|
-
* @param {object} oSettingsView
|
|
2228
|
-
* Tile settings dialog view instance containing
|
|
2229
|
-
* the input values of the dialog
|
|
2230
|
-
* @returns {jQuery.Promise}
|
|
2231
|
-
* The promise resolves when the personalization was saved
|
|
2232
|
-
* or if there was nothing to save.
|
|
2233
|
-
* The promise rejects if the prerequisites were not met.
|
|
2234
|
-
*
|
|
2235
|
-
* @private
|
|
2236
|
-
*/
|
|
2237
|
-
this._onTileSettingsSave = function (oTile, oSettingsView) {
|
|
2238
|
-
var oDeferred = new jQuery.Deferred();
|
|
2239
|
-
|
|
2240
|
-
if (!oTile || !oTile.id || !oSettingsView) {
|
|
2241
|
-
return oDeferred.reject().promise();
|
|
2242
|
-
}
|
|
2243
|
-
|
|
2244
|
-
var sNewTitle = oSettingsView.oTitleInput.getValue();
|
|
2245
|
-
var sNewSubtitle = oSettingsView.oSubTitleInput.getValue();
|
|
2246
|
-
var sNewInfo = oSettingsView.oInfoInput.getValue();
|
|
2247
|
-
var sOldTitle = this.getTileTitle(oTile);
|
|
2248
|
-
var sOldInfo = this.getTileInfo(oTile);
|
|
2249
|
-
var sOldSubtitle = this.getTileSubtitle(oTile);
|
|
2250
|
-
|
|
2251
|
-
// Check whether the end user changed the title or subtitle.
|
|
2252
|
-
// If nothing changed, return.
|
|
2253
|
-
if (sOldTitle === sNewTitle &&
|
|
2254
|
-
sOldSubtitle === sNewSubtitle &&
|
|
2255
|
-
sOldInfo === sNewInfo
|
|
2256
|
-
) {
|
|
2257
|
-
return oDeferred.resolve().promise();
|
|
2258
|
-
}
|
|
2259
|
-
|
|
2260
|
-
var oUpdatedVisualTileProperties = {};
|
|
2261
|
-
if (sOldTitle !== sNewTitle) {
|
|
2262
|
-
oUpdatedVisualTileProperties.title = sNewTitle;
|
|
2263
|
-
// Add new properties also to tile for next startup
|
|
2264
|
-
oTile.title = sNewTitle;
|
|
2265
|
-
}
|
|
2266
|
-
if (sOldSubtitle !== sNewSubtitle) {
|
|
2267
|
-
oUpdatedVisualTileProperties.subtitle = sNewSubtitle;
|
|
2268
|
-
// Add new properties also to tile for next startup
|
|
2269
|
-
oTile.subTitle = sNewSubtitle;
|
|
2270
|
-
}
|
|
2271
|
-
if (sOldInfo !== sNewInfo) {
|
|
2272
|
-
oUpdatedVisualTileProperties.info = sNewInfo;
|
|
2273
|
-
// Add new properties also to tile for next startup
|
|
2274
|
-
oTile.info = sNewInfo;
|
|
2275
|
-
}
|
|
2276
|
-
// Update visual tile properties for current session,
|
|
2277
|
-
// otherwise the change will only be visually reflected
|
|
2278
|
-
// after a page reload.
|
|
2279
|
-
//
|
|
2280
|
-
// This is done conditionally, because this process may
|
|
2281
|
-
// not be relevant for some tile types.
|
|
2282
|
-
if (this._mResolvedTiles[oTile.id].tileComponent) {
|
|
2283
|
-
this._mResolvedTiles[oTile.id].tileComponent.tileSetVisualProperties(oUpdatedVisualTileProperties);
|
|
2284
|
-
} else if (this._mResolvedTiles[oTile.id].linkTileControl) {
|
|
2285
|
-
// Update visual link properties for current session,
|
|
2286
|
-
// otherwise the change will only be visually reflected
|
|
2287
|
-
// after a page reload.
|
|
2288
|
-
if (oUpdatedVisualTileProperties.title) {
|
|
2289
|
-
this._mResolvedTiles[oTile.id].linkTileControl.setHeader(oUpdatedVisualTileProperties.title);
|
|
2290
|
-
}
|
|
2291
|
-
if (oUpdatedVisualTileProperties.subtitle) {
|
|
2292
|
-
this._mResolvedTiles[oTile.id].linkTileControl.setSubheader(oUpdatedVisualTileProperties.subtitle);
|
|
2293
|
-
}
|
|
2294
|
-
if ((oUpdatedVisualTileProperties.title) || (oUpdatedVisualTileProperties.subtitle)) {
|
|
2295
|
-
//rerender the link to see the changes immediately
|
|
2296
|
-
this._mResolvedTiles[oTile.id].linkTileControl.rerender();
|
|
2297
|
-
}
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2300
|
-
// Persist personalization changes
|
|
2301
|
-
sap.ushell.Container.getServiceAsync("CommonDataModel")
|
|
2302
|
-
.then(function (oCdmService) {
|
|
2303
|
-
oCdmService.save()
|
|
2304
|
-
.fail(function (sErrorMsg0) {
|
|
2305
|
-
Log.error(sErrorMsg0);
|
|
2306
|
-
oDeferred.reject("Could not save personalization changes: " + sErrorMsg0);
|
|
2307
|
-
})
|
|
2308
|
-
.done(function () {
|
|
2309
|
-
oDeferred.resolve();
|
|
2310
|
-
});
|
|
2311
|
-
});
|
|
2312
|
-
|
|
2313
|
-
return oDeferred.promise();
|
|
2314
|
-
};
|
|
2315
|
-
|
|
2316
|
-
/**
|
|
2317
|
-
* Returns the tile actions for a given tile.
|
|
2318
|
-
*
|
|
2319
|
-
* @param {object} oTile
|
|
2320
|
-
* Tile object
|
|
2321
|
-
* @returns {array}
|
|
2322
|
-
* Tile actions for the given tile
|
|
2323
|
-
*
|
|
2324
|
-
* @public
|
|
2325
|
-
*/
|
|
2326
|
-
this.getTileActions = function (oTile) {
|
|
2327
|
-
var aTileActions = [];
|
|
2328
|
-
|
|
2329
|
-
if (this._isGroupTile(oTile) && !this._isFailedGroupTile(oTile)) {
|
|
2330
|
-
// Create necessary model for dialog to pass actual properties
|
|
2331
|
-
var oModel = new JSONModel({
|
|
2332
|
-
config: {
|
|
2333
|
-
display_title_text: this.getTileTitle(oTile),
|
|
2334
|
-
display_subtitle_text: this.getTileSubtitle(oTile),
|
|
2335
|
-
display_info_text: this.getTileInfo(oTile)
|
|
2336
|
-
}
|
|
2337
|
-
});
|
|
2338
|
-
|
|
2339
|
-
// Get tile settings action
|
|
2340
|
-
var oTileSettingsAction = oUtils.getTileSettingsAction(oModel, this._onTileSettingsSave.bind(this, oTile), this.getTileType(oTile));
|
|
2341
|
-
aTileActions.push(oTileSettingsAction);
|
|
2342
|
-
}
|
|
2343
|
-
return aTileActions;
|
|
2344
|
-
};
|
|
2345
|
-
|
|
2346
|
-
function composeNewBookmarkTile (oParameters, oTarget, sContentProviderId) {
|
|
2347
|
-
var oTile = composeNewTile(oParameters, oTarget);
|
|
2348
|
-
|
|
2349
|
-
oTile.isBookmark = true;
|
|
2350
|
-
if (sContentProviderId) {
|
|
2351
|
-
oTile.contentProvider = sContentProviderId;
|
|
2352
|
-
}
|
|
2353
|
-
|
|
2354
|
-
return oTile;
|
|
2355
|
-
}
|
|
2356
|
-
|
|
2357
|
-
function composeNewTile (oParameters, oTarget) {
|
|
2358
|
-
// TODO Collect all tile ids to pass them as an arry to
|
|
2359
|
-
// generateUniqueId
|
|
2360
|
-
var oTile = {
|
|
2361
|
-
id: oUshellUtils.generateUniqueId([])
|
|
2362
|
-
};
|
|
2363
|
-
|
|
2364
|
-
updateTileComposition(oTile, oParameters, oTarget);
|
|
2365
|
-
|
|
2366
|
-
return oTile;
|
|
2367
|
-
}
|
|
2368
|
-
|
|
2369
|
-
/**
|
|
2370
|
-
* Updates the properties of a bookmark tile during its composition.
|
|
2371
|
-
* @param {object} oTile JSON Object that holds the properties of a bookmark tile.
|
|
2372
|
-
* @param {object} oParameters Properties to merge into the bookmark tile
|
|
2373
|
-
* @param {object} oTarget The navigation target as a JSON object.
|
|
2374
|
-
*
|
|
2375
|
-
* @private
|
|
2376
|
-
*/
|
|
2377
|
-
function updateTileComposition (oTile, oParameters, oTarget) {
|
|
2378
|
-
// Avoid modifying callers reference.
|
|
2379
|
-
oParameters = deepExtend({}, oParameters);
|
|
2380
|
-
|
|
2381
|
-
if (oTarget) {
|
|
2382
|
-
oTile.target = oTarget;
|
|
2383
|
-
}
|
|
2384
|
-
|
|
2385
|
-
if (oParameters.title || oParameters.title === "") {
|
|
2386
|
-
oTile.title = oParameters.title;
|
|
2387
|
-
}
|
|
2388
|
-
|
|
2389
|
-
if (oParameters.icon || oParameters.icon === "") {
|
|
2390
|
-
oTile.icon = oParameters.icon;
|
|
2391
|
-
}
|
|
2392
|
-
|
|
2393
|
-
if (oParameters.subtitle || oParameters.subtitle === "") {
|
|
2394
|
-
oTile.subTitle = oParameters.subtitle;
|
|
2395
|
-
}
|
|
2396
|
-
|
|
2397
|
-
if (oParameters.info || oParameters.info === "") {
|
|
2398
|
-
oTile.info = oParameters.info;
|
|
2399
|
-
}
|
|
2400
|
-
|
|
2401
|
-
if (oParameters.numberUnit || oParameters.numberUnit === "") {
|
|
2402
|
-
oTile.numberUnit = oParameters.numberUnit;
|
|
2403
|
-
}
|
|
2404
|
-
|
|
2405
|
-
if (oParameters.dataSource) {
|
|
2406
|
-
oTile.dataSource = {
|
|
2407
|
-
type: oParameters.dataSource.type,
|
|
2408
|
-
settings: {
|
|
2409
|
-
odataVersion: ObjectPath.get(["dataSource", "settings", "odataVersion"], oParameters)
|
|
2410
|
-
}
|
|
2411
|
-
};
|
|
2412
|
-
}
|
|
2413
|
-
|
|
2414
|
-
if (oParameters.serviceUrl) {
|
|
2415
|
-
oTile.indicatorDataSource = {
|
|
2416
|
-
path: oParameters.serviceUrl
|
|
2417
|
-
};
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
|
-
if (oTile.indicatorDataSource && (oParameters.serviceRefreshInterval || oParameters.serviceRefreshInterval === 0)) {
|
|
2421
|
-
oTile.indicatorDataSource.refresh = oParameters.serviceRefreshInterval;
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
if (oParameters.vizConfig) {
|
|
2425
|
-
oTile.vizConfig = oParameters.vizConfig;
|
|
2426
|
-
}
|
|
2427
|
-
}
|
|
2428
|
-
|
|
2429
|
-
function isSameTarget (oTarget, oOther) {
|
|
2430
|
-
if (oTarget && oOther) {
|
|
2431
|
-
if (oTarget.url) {
|
|
2432
|
-
// url bookmark tile
|
|
2433
|
-
return oTarget.url === oOther.url;
|
|
2434
|
-
}
|
|
2435
|
-
|
|
2436
|
-
return oTarget.semanticObject === oOther.semanticObject
|
|
2437
|
-
&& oTarget.action === oOther.action
|
|
2438
|
-
&& isSameParameters(oTarget.parameters, oOther.parameters)
|
|
2439
|
-
&& oTarget.appSpecificRoute === oOther.appSpecificRoute;
|
|
2440
|
-
}
|
|
2441
|
-
|
|
2442
|
-
return oTarget === oOther;
|
|
2443
|
-
}
|
|
2444
|
-
|
|
2445
|
-
function isSameParameters (aParameters, aOthers) {
|
|
2446
|
-
aParameters = aParameters || [];
|
|
2447
|
-
aOthers = aOthers || [];
|
|
2448
|
-
|
|
2449
|
-
if (aParameters.length === aOthers.length) {
|
|
2450
|
-
var sFirst = transformParameterListToString(aParameters);
|
|
2451
|
-
var sOther = transformParameterListToString(aOthers);
|
|
2452
|
-
return sFirst === sOther;
|
|
2453
|
-
}
|
|
2454
|
-
|
|
2455
|
-
return false;
|
|
2456
|
-
}
|
|
2457
|
-
|
|
2458
|
-
function transformParameterListToString (aList) {
|
|
2459
|
-
return aList
|
|
2460
|
-
.map(function (oParameter) {
|
|
2461
|
-
return oParameter.name + oParameter.value;
|
|
2462
|
-
})
|
|
2463
|
-
.sort()
|
|
2464
|
-
.join();
|
|
2465
|
-
}
|
|
2466
|
-
|
|
2467
|
-
function createNewTargetFromUrl (sUrl) {
|
|
2468
|
-
return { url: sUrl };
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2471
|
-
function createNewTargetFromIntent (oIntent) {
|
|
2472
|
-
var oTarget = {
|
|
2473
|
-
semanticObject: oIntent.semanticObject,
|
|
2474
|
-
action: oIntent.action,
|
|
2475
|
-
parameters: createTileParametersFromIntentParams(oIntent.params)
|
|
2476
|
-
};
|
|
2477
|
-
|
|
2478
|
-
if (oIntent.appSpecificRoute) {
|
|
2479
|
-
// do not loose the inner-app hash (e.g. &/ShoppingCart(12345))
|
|
2480
|
-
// BCP 1670533333
|
|
2481
|
-
oTarget.appSpecificRoute = oIntent.appSpecificRoute;
|
|
2482
|
-
}
|
|
2483
|
-
|
|
2484
|
-
return oTarget;
|
|
2485
|
-
}
|
|
2486
|
-
|
|
2487
|
-
function createTileParametersFromIntentParams (oIntentParams) {
|
|
2488
|
-
return Object.keys(oIntentParams).map(function (sKey) {
|
|
2489
|
-
var sValue = oIntentParams[sKey] && oIntentParams[sKey][0];
|
|
2490
|
-
|
|
2491
|
-
return {
|
|
2492
|
-
name: sKey,
|
|
2493
|
-
// sValue maybe undefined.
|
|
2494
|
-
value: sValue || ""
|
|
2495
|
-
};
|
|
2496
|
-
});
|
|
2497
|
-
}
|
|
2498
|
-
|
|
2499
|
-
this._getSiteData = function () {
|
|
2500
|
-
var oPromise = new Promise(function (fnResolve, fnReject) {
|
|
2501
|
-
sap.ushell.Container.getServiceAsync("CommonDataModel").then(function (oCDMService) {
|
|
2502
|
-
oCDMService.getSite()
|
|
2503
|
-
.done(fnResolve)
|
|
2504
|
-
.fail(fnReject);
|
|
2505
|
-
});
|
|
2506
|
-
});
|
|
2507
|
-
|
|
2508
|
-
return oPromise;
|
|
2509
|
-
};
|
|
2510
|
-
|
|
2511
|
-
this._addDefaultGroup = function (aGroups, oSite) {
|
|
2512
|
-
var oDefaultGroup = oReadHomePageUtils.getDefaultGroup(aGroups);
|
|
2513
|
-
|
|
2514
|
-
if (!oDefaultGroup) {
|
|
2515
|
-
// the default group is not added by an admin but must be automatically
|
|
2516
|
-
// generated when not present already
|
|
2517
|
-
oDefaultGroup = oModifyHomePageUtils.createDefaultGroup(
|
|
2518
|
-
oUshellUtils.generateUniqueId(oReadHomePageUtils.getGroupIdsFromSite(oSite))
|
|
2519
|
-
);
|
|
2520
|
-
|
|
2521
|
-
// Note: for not harming the performance during initial start-up of
|
|
2522
|
-
// the FLP, oCdmSiteService.save() is skipped. This means the default
|
|
2523
|
-
// group is added on EVERY start-up until save() is called in a different use case
|
|
2524
|
-
// e.g. a tile was added.
|
|
2525
|
-
oSite = oModifyHomePageUtils.addGroupToSite(oSite, oDefaultGroup, /*index*/ 0);
|
|
2526
|
-
|
|
2527
|
-
// get groups again as the default group was just added
|
|
2528
|
-
aGroups = oReadHomePageUtils.getGroupsArrayFromSite(oSite);
|
|
2529
|
-
}
|
|
2530
|
-
|
|
2531
|
-
this._oDefaultGroup = oDefaultGroup;
|
|
2532
|
-
return aGroups;
|
|
2533
|
-
};
|
|
2534
|
-
}
|
|
2535
|
-
|
|
2536
|
-
LaunchPageAdapter.prototype = AdapterBase.prototype;
|
|
2537
|
-
|
|
2538
|
-
return LaunchPageAdapter;
|
|
17
|
+
return FlpLaunchPageAdapter; // return private API. See FlpLaunchPageAdapter
|
|
2539
18
|
});
|