Mar 6, 2018 6:11:29 PM seb leridon avatar   892

Create a component for MyDashboard

!!! TOC !!!

Summary of MyDashboard Features

The MyDashboard plugin is used to manage front office dashboards. These dashboards are specific to each user, and can only be displayed if the user is logged in. To date, there is no dashboard for anonymous users.

Users can view their dashboards by going to the following page: jsp / site / Portal.jsp & page = mydashboard

In this page, the user has a link allowing him to access a feature allowing him to choose which dashboards he wishes to display, and in what order.

It is also possible to add to a page of the site a MyDashboard portlet that will display all the dashboards of the user. Create a new dashboard

To create a new dashboard, just create a class extending the MyDashboardComponent class, and implementing the following three methods:

MyDashboardComponent methods to implement

/ **
 * Get dashboard data for the current user
 * @param request HttpServletRequest
 * @return HTML content to insert into a dash board area
 * /
public String getDashboardData (HttpServletRequest request);

/ **
 * Get the id of the dashboard component. The id of the dashboard component
 * must be unique for each dashboard component, and be less than 50
 * characters long.
 * @return The id of the dashboard component
 * /
public String getComponentId ();

/ **
 * Get the description of the component
 * @param local The local to display the description in
 * @return The description of the component
 * /
public String getComponentDescription (Local locale);

The public method String getComponentId () is used to set the dashboard type identifier. This identifier must be a unique key to identify the type of each dashboard.

The public method String getComponentDescription (Local Locale) is used to generate a description of the dashboard, used in particular to allow users which dashboards they want to display

The public method String getDashboardData (HttpServletRequest request) is used to generate the contents of the dashboard.

Because the dashboard list is retrieved by dependency injection with Spring, every implementation of the MyDashboardComponent class must be declared as a bean to Spring services.