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:


Launchpad1.png

Steps to design Custom Launchpad like UI

  • Index.html (same as standard one)

/wp-content/uploads/2016/05/index_941796.png

/wp-content/uploads/2016/05/view_941797.png

  • 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.

basic component.png

Application view with Shell only:

Basic view.png

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

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

  • Specify routing in component.js and initiate routing

/wp-content/uploads/2016/05/component1_941803.png

  • 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)

Home.png

  • 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.

Home controller.png

  • Page will be like

ctc app.png

  • 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.

Launchpad2.png

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


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

/wp-content/uploads/2016/05/authentication_941808.png

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

Launchpad login.png

  • 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.

/wp-content/uploads/2016/05/get_user_941810.png

  • 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 :

/wp-content/uploads/2016/05/debug_941811.png

  • 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 :

/wp-content/uploads/2016/05/logoyt_941812.png

  • 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 :

/wp-content/uploads/2016/05/logout_debug_941813.png

  • 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.

/wp-content/uploads/2016/05/privilege_941814.png

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

no access.png

I hope this will helpful. 🙂

Will update code on github soon.

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

Regards,

Kalpan

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply