Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only

Customization example - Read only columns for specific group of users 

Thu January 07, 2021 09:45 AM

How to set Gantt View columns as read only fields in Graphical Scheduling

Maximo Scheduler is a highly customizable software product, there are a number of application and system level properties that can be used to modify system behavior.  However, it is not unusual to find specific use cases that might require customization in the application code to fully satisfy client needs.

 Maximo Scheduler Gantt View is a dynamic software component built on top of a JavaScript API that consumes data provided by a number of service endpoints. The data provided by these service endpoints is used to render the Gantt layout, control the Gantt actions and behaviors and display schedule/work list records.

 In this article, we'll address one specific use case, providing instructions on how to display Gantt View columns as read only fields in Graphical Scheduling.

 A few columns in Graphical Scheduling are editable by default. In some cases, clients might need to restrict access to a privileged group of users who should be able to modify these columns. To illustrate this use case, we’ll consider the following example: 

  • A certain client would like to prevent one specific group of users (TECHNICIAN) from making changes to the columns Start Date and End Date.

 The Gantt UI settings is essentially a JSON object that holds a number of properties used to configure the Gantt API. In Maximo Scheduler application code, there is a Java class file named ILogGanttModelToTreeGridUIBuilder that is used to build this JSON data structure.

 In this class, there is method named getTreeGridUI(Future<MXGanttModel>, UIOptions, BaseTreeGridMiniAppBean) which is where most of the application logic used to build the UI settings for the Gantt View takes place.

Now, observe the following code snippet extracted from this method mentioned above:

In this for loop, we iterate over all SKDPROPERTY (database table) records in order to determine which and how the Gantt View columns should be displayed.

 A bit further inside this same for loop, you’ll find the following code snippet.


The Start Date and End Date columns are always editable. In order to set them as read only, you’ll need to add the following code lines, after the code snippet displayed above.


It is possible to implement a more complex set of restrictions, based on user groups or permissions. E.g. Use custom SIGOPTION to determine if a user that belongs to a certain user group should be able to edit Start/End Dates.

Written by Senior Software Engineer, Silvino Vieira de Vasconcelos Neto

Note:  You will need to extend the class shown above and replace it with your own.  This is the first step for customize the view,  extend view class overide method getLayoutUI , you may need to extend another class depending of the view work view is  ILogGanttModelToTreeGridUIBuilder.
As with all customization, overriding methods in this way there is a risk with future ifixes.



#AssetandFacilitiesManagement
#Maximo
#MaximoScheduler

Statistics
0 Favorited
9 Views
0 Files
0 Shares
0 Downloads