Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Problems:

  1. Having HANA XS Engine. ( As Fiori Launchpad plugin not available need for custom Launchpad type app required)
  2. Single entry point was not available for all user or all same role based apps (Landing Page for role based user)
  3. Provide group of tiles on basis of user role.
  4. Getting details of logged in user.
  5. Session management was difficult (Options for Login and Logout).


Below is my way to Design Custom Launchpad and solve my problems.

Solution:

  1. Designed UI like Launchpad using unified Shell and other components.
  2. Managed user role on backend using custom table and on basis of user role group of tiles are available on custom Launchpad.
  3. Most important session management done by CSRF token (Debugged HANA XS session and applied same).

UI Design for Custom Launchpad:


Steps to design Custom Launchpad like UI

  • Index.html (same as standard one)

  • Provide Home Icon, User Icon with Username, Logoff Icon, Center Text and Notification Icon (for centralized notification for user if required).
  • Component.js page specify only root view.
  • Without routing with only root view.

Application view with Shell only:

  • For Routing use SAP Standard routing file :
  1. MyRouting.js

(https://help.sap.com/saphelp_uiaddon10/helpdata/en/68/8f36bd758e4ce2b4e682eef4dc794e/content.htm?ori...)

  • Specify routing in component.js and initiate routing

  • Specify target control “idAppControl”.
  • For simple application specify targetAggregation  “curtainContent” and hide master view .( hide curtainPaneContent)
  • And for Split application use both curtainContent and curtainPaneContent. For Master Details targerAggregation will be curtainPaneContent and for Item details targetAggregation will be curtainContent.
  • Specify tile group in Home.view.xml (on basis of user role tiles will be displayed)

  • Getting list of tile by calling XSJS services on initialization of Home view.
  • This view is not Master & Item view (not a split app) so hide master view.
  • So view will be displayed in full page.
  • setShowCurtainPane(false) used to hide master view.

  • Page will be like

  • Now when you click tile Leave App it will route to Leave app view as below
  • Routing will be same as did for home page.

Session Management (Get Logged on User, Login and Logout):


  • For Fiori Standard Login Page specify Authentication method in .XSaccess file in Launch pad package.

  • So when you access Launchpad it will direct to Fiori Launch pad

  • So when you specify correct credential it will direct to Custom Launchpad (or Landing Page).
  • When we login at the time in backend unique CSRF token is generated and all session management is done using same CSRF token.
  • Now getting logged in User details
  • Using CSRF Token we can get logged in User details as shown below.

  • When we call get username it will first get current CSRF token and using that CSRF token it is getting logged in user name. as shown in below Debugging :

  • Get Username from calling getUSername and bind it with Custom Launchpad user section.
  • In Custom Launchpad package .XSaccess authentication method is specified so in between if you try to access any view and if session is not started or session is destroyed it will direct to Fiori standard login page.
  • Logout or terminate session :

  • By pressing on logout icon from Launchpad it will call logout function.
  • And logout function will get current CSRF Token and terminate session.
  • As shown in below debugging :

  • And again it will direct to Fiori standard login Page.

Getting group of Tiles on Basis User role:


  • After getting name of user get role of user and on basis of that display group of tiles on Launchpad.
  • In my case I created custom table and role based apps is specified.
  • So at time of initialization I get group of tiles from custom tables using XSJS service and bind with tile container.
  • And also give specific package privilege to user on depending their role.
  • Like as shown in below.

  • And if user do not have assigned privilege to Launchpad or try to direct access to not assigned app it will direct below page.

I hope this will helpful. 🙂

Will update code on github soon.

Happy Coding .. 🙂 Have a nice day (y)

Regards,

Kalpan

2 Comments