Class DashboardService
java.lang.Object
fr.paris.lutece.portal.service.dashboard.DashboardService
Dashboard Service
-
Method Summary
Modifier and TypeMethodDescriptionvoiddoMoveDashboard(IDashboardComponent dashboard, int nOldColumn, int nOldOrder, boolean bCreate) Moves the dashboard.voiddoReorderColumn(int nColumn) Reorders column's dashboardvoiddoSaveLayout(Map<Integer, List<String>> mapZones, Collection<String> collectionUnset) Saves a whole layout of the dashboards: for each zone, its dashboards in their order, and the dashboards taken off the homepage.All known dashboards as declared in SpringContextgetAllSetDashboards(AdminUser user) Finds all dashboard with column and order set.intReturns the column count, withPROPERTY_COLUMN_COUNT.getDashboardComponents(int nColumn) getDashboardData(AdminUser user, int nZone, jakarta.servlet.http.HttpServletRequest request) Gets Data from all components of the zonegetDashboardData(List<IDashboardComponent> listDashboards, AdminUser user, int nZone, jakarta.servlet.http.HttpServletRequest request) Gets Data from all components of the zonegetDashboards(AdminUser user, jakarta.servlet.http.HttpServletRequest request) Get the list of dashboard from pluginsstatic DashboardServiceDeprecated, for removal: This API element is subject to removal in a future version.Returns list with available columngetListAvailableOrders(int nColumn) Orders reference list for the given columnBuilds all refList order for all columnsReturns all dashboards with no column/order setBuilds the map to with column id as key, andtrueas value if column is well ordered,falseotherwise.intReturns the zone count of the admin homepage, withPROPERTY_ZONE_COUNT.voidregisterDashboardComponent(DashboardComponentEntry entry, Plugin plugin) Register a Dashboard Component
-
Method Details
-
getInstance
Deprecated, for removal: This API element is subject to removal in a future version.Use@Injectto obtain theDashboardServiceinstance. This method will be removed in future versions.Returns the unique instance of theDashboardServiceservice.This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with
@Injectto obtain theDashboardServiceinstance instead.- Returns:
- The unique instance of
DashboardService.
-
getColumnCount
public int getColumnCount()Returns the column count, withPROPERTY_COLUMN_COUNT. Default isCONSTANTE_DEFAULT_COLUMN_COUNT- Returns:
- the column count
-
getZoneCount
public int getZoneCount()Returns the zone count of the admin homepage, withPROPERTY_ZONE_COUNT. Default isCONSTANTE_DEFAULT_ZONE_COUNT- Returns:
- the zone count
-
getAllDashboardComponents
All known dashboards as declared in SpringContext- Returns:
- dashboards list
-
getDashboardComponents
- Parameters:
nColumn- the column id- Returns:
- all dashboards for this column
-
registerDashboardComponent
Register a Dashboard Component- Parameters:
entry- The DashboardComponent entry defined in the plugin's XML fileplugin- The plugin
-
doMoveDashboard
public void doMoveDashboard(IDashboardComponent dashboard, int nOldColumn, int nOldOrder, boolean bCreate) Moves the dashboard.- Parameters:
dashboard- to move, with new valuesnOldColumn- previous column idnOldOrder- previous orderbCreate-trueif this is a new dashboard,falseotherwise.
-
doSaveLayout
Saves a whole layout of the dashboards: for each zone, its dashboards in their order, and the dashboards taken off the homepage. The orders of a zone start at 1 and follow the given list; the dashboards of that zone left out of the list (those the user has no right to see) keep their place after them. A name that matches no declared dashboard is ignored.- Parameters:
mapZones- the dashboard names of each zone, in their order, with the zone number as keycollectionUnset- the names of the dashboards taken off the homepage
-
getNotSetDashboards
Returns all dashboards with no column/order set- Returns:
- all dashboards with no column/order set
-
getAllSetDashboards
Finds all dashboard with column and order set.- Parameters:
user- the current user- Returns:
- a map where key is the column id, and value is the column's dashboard list.
-
getDashboardData
public String getDashboardData(AdminUser user, int nZone, jakarta.servlet.http.HttpServletRequest request) Gets Data from all components of the zone- Parameters:
user- The usernZone- The dasboard zonerequest- HttpServletRequest- Returns:
- Data of all components of the zone
-
getDashboards
public List<IDashboardComponent> getDashboards(AdminUser user, jakarta.servlet.http.HttpServletRequest request) Get the list of dashboard from plugins- Parameters:
user- the current userrequest- HttpServletRequest- Returns:
- the list of dashboards
-
getDashboardData
public String getDashboardData(List<IDashboardComponent> listDashboards, AdminUser user, int nZone, jakarta.servlet.http.HttpServletRequest request) Gets Data from all components of the zone- Parameters:
listDashboards- the list of dashboardsuser- The usernZone- The dasboard zonerequest- HttpServletRequest- Returns:
- Data of all components of the zone
-
doReorderColumn
public void doReorderColumn(int nColumn) Reorders column's dashboard- Parameters:
nColumn- the column to reorder
-
getOrderedColumnsStatus
Builds the map to with column id as key, andtrueas value if column is well ordered,falseotherwise.- Returns:
- the map
-
getListAvailableColumns
Returns list with available column- Returns:
- all available columns
-
getMapAvailableOrders
Builds all refList order for all columns- Returns:
- the map with column id as key
-
getListAvailableOrders
Orders reference list for the given column- Parameters:
nColumn- column- Returns:
- the refList
-
@Injectto obtain theDashboardServiceinstance.