Blogs / SAP / SAP BusinessObjects / SAP Lumira Designer / Implementing Commentary in SAP Lumira Designer

Implementing Commentary in SAP Lumira Designer

Apr 3, 2018

SHARE

Among the numerous new features that SAP Lumira Designer 2.1 offers, Application level commentary has been a highly awaited add-on. Available as a technical component, this feature allows the users to collaborate by entering comments into the application at runtime.
 

Prerequisites

This blog is a follow up to our overview blog on the Commentary feature published earlier and focuses entirely on the technical aspects of implementing the Commentary feature. Hence, requires the reader to possess basic knowledge of SAP Lumira Designer including scripting. It is also assumed that:

  1. Installation and Database configuration of BI Commentary Application on CMC has already been done
  2. User security implementation on BI Platform has been set up

Implementation

Once configured, we are now ready to leverage the power of Commentary in our SAP Lumira Designer application. It begins with adding the ‘Comments’ technical component to the outline of the application.

Implementing Commentary in SAP Lumira Designer


A comment has the following parameters associated with it:

ContentComments entered by the user
PrivacySpecifies whether the content entered by the user should be private to the owner (Private) or should be visible to all the authorized users of the application(Global). The ability to delete/update comments created by other users is dependent on the object/folder level security settings defined on the BI platform.
Context TypeThis defines the part of the application that the comment is tied to
1. No Context – General comments tied to the comments component.
2. Context – Comments are tied to the filters applied to a specific list of dimensions in the data source.
3. Dimension – Comments are tied to a dimension in the table.
4. Member – Comments appear against a particular member of the dimension.
5. Data cell – Comments are tied to a particular data cell in the table.
DatasourceSpecifies the datasource that the comments are tied to. Not a pertinent parameter for comments of type ‘No Context’.
Context
Specifies the data cell to which the comments are tied. Not a pertinent parameter for comments of type ‘No Context’.

Comments without context

These comments are not linked to any part of the dashboard. In addition to the ‘Comments’ technical component, we require

  • Feed list – to populate the comments
  • Text area – to get the inputs from the user

Adding comments

The comment entered by the user in the text area is used as the content of the comment created. The context type is specified as NONE and the privacy properties is specified based on user selection. The following code is used to add comments without context:

Implementing Commentary in SAP Lumira Designer

Adding comments works both locally and on the BI platform; Comments added in local mode get added to the local repository, the comments in BIP mode get stored in the audit/pre-configured commentary database.
 

Updating comments

The comment ID selected from the feed list is retrieved and is updated with the content from the Text area. The corresponding feed list is reloaded with the updated comments. The following piece of code would do the trick:

Implementing Commentary in SAP Lumira Designer

Delete comments

The comment ID selected from the feed list is retrieved and is deleted. The corresponding feed list is reloaded to exclude obsolete comments.

Implementing Commentary in SAP Lumira Designer

Sorting the comments

Comments could be sorted by adding two parameters – ‘sortBy’ and ‘Order’ to getComments() before populating the feed lists. The comments could be sorted in

  • Ascending (or)
  • Descending

Based on

  • Last Modified date (or)
  • Created date
Implementing Commentary in SAP Lumira Designer

By default, the comments are sorted in ascending order based on last modified date.

Changing the Privacy

The same piece of code can be reused for creation, update and deletion of public and global comments. The only distinction between the two privacy settings is the Boolean value passed to the “isPublic” parameter.

  • ‘true’ corresponds to Global comments – Users will be able to view/modify/ delete the comments created by other users in the application (Dependent again on the BI platform user rights).
  • ‘False’ corresponds to Private comments – Users will be able to view/modify/ delete the comments created by them.
Implementing Commentary in SAP Lumira Designer

Comments in a Crosstab

Comments can be added to different areas in the crosstab by adding parameters ‘context’ and ‘context type’ to the comments during creation. Comments can be added to the following area of the crosstab:

  1. Dimension
  2. Dimension Member
  3. Data cell
Implementing Commentary in SAP Lumira Designer

To add comments to the crosstab, we need the technical component ‘Context menu’ in addition to the components used in the above example.
 

Setting up the context menu

Each application has a ‘Context menu’ component by default in the technical component section. Add a custom menu entry called ‘Comments’ to the context menu. In the scripting section corresponding to the menu entry,

  • we store the selection type and selection from the context menu in global variables (of type String and Result set selection by string respectively)
  • open up the commentary panel
  • load all the comments corresponding to the context into the feeding panels

The global variables (selection type and selection) are used while creating and accessing the comments.

Implementing Commentary in SAP Lumira Designer


Adding/Updating/Deleting the comments

The only addition to the existing scripts is the addition of ‘context’ and ‘context type’ as follows:

Implementing Commentary in SAP Lumira Designer


Similar alterations to Update and Delete are to be made

Implementing Commentary in SAP Lumira Designer


Make sure that the crosstab has ‘comments visible’ property set to true

Implementing Commentary in SAP Lumira Designer

In Runtime, the cells with comments will be highlighted as follows and hovering over the cell will show the latest comment in that cell.

Implementing Commentary in SAP Lumira Designer

The behavior in runtime is as follows:

Implementing Commentary in SAP Lumira Designer

Comments on a set of filters

To set comments on a list of filters, we need to have ‘datasource’ parameter in addition to context, context type and privacy.
 

Computing the context

Whenever a filter is applied to the data source, the context parameter is calculated and all the comments tied to the context parameter are repopulated in the feed. The context parameter is structured in the following format:

{ “dimesion1”: [“member1”,”member2”,”member3”],

“dimesion2”: [“memberA”,”memberB”,”memberC”]}

The following script will compute the context and this has to triggered every time a new filter is applied on the datasource. The computed context is stored in a global variable for future usage.

Implementing Commentary in SAP Lumira Designer

In the ‘On Result set changed’ event of the datasource, the context is computed and all the pertaining comments are loaded into the feed lists

Implementing Commentary in SAP Lumira Designer

Add/Update/Delete

The context type is to be changed to DATA and the context is to be mapped to the global variable containing the recomputed context.

Implementing Commentary in SAP Lumira Designer
Implementing Commentary in SAP Lumira Designer

Exporting to PDF

  • Add the technical component ‘Export to PDF’ to the layout
  • Enable the following properties in the export to PDF component
Implementing Commentary in SAP Lumira Designer
  • To view the comments in a crosstab in the exported document, enable the following property through scripting
Implementing Commentary in SAP Lumira Designer

  • Add the crosstab that has to be exported along with its comments to the components tab of the PDF component.
Implementing Commentary in SAP Lumira Designer
  • Use EXPORT_PDF.exportReport() to export contents of the crosstab along with comments. The comments show up in the appendix section of the exported PDF document.
Implementing Commentary in SAP Lumira Designer

Usage in composites

Comments can be shared between applications by implementing commenting functionality in a composite. This way, both the applications will access the same technical component for creation/deletion/update.

  • Use comments of context type “None” if all the comments created in both applications are to be shown in both applications.
  • Use comments of context type “context” and use App ID as context to access comments created in the application of the specified App ID alone.
Implementing Commentary in SAP Lumira Designer


Watch out for this space for a detailed blog on inter-application commentary.

Please reach out to us here for Visual BI’s SAP Lumira Service Offerings and learn more about Visual BI’s Self-Service BI offerings here.


Corporate HQ:
5920 Windhaven Pkwy, Plano, TX 75093

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com


Copyright © Visual BI Solutions Inc.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This!

Share this with your friends and colleagues!