Class ViewsService
java.lang.Object
fr.paris.lutece.plugins.profiles.service.views.ViewsService
- All Implemented Interfaces:
IViewsService
ViewService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProfileForView(String strViewKey, String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add a profile for a viewbooleancheckExistView(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a view already exists or notCreation of an instance of ViewvoidcreateDashboard(String strViewKey, fr.paris.lutece.portal.service.dashboard.IDashboardComponent dashboard, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a dashboard for a viewvoiddoMoveDashboard(fr.paris.lutece.portal.service.dashboard.IDashboardComponent dashboard, int nOldColumn, int nOldOrder, boolean bCreate, String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Moves the dashboard.voiddoReorderColumn(String strViewKey, int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin) Reorders column's dashboardfindAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a List of Views objectsfindByPrimaryKey(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns an instance of a profile whose identifier is specified in parameterfindColumns(fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds all columnsfr.paris.lutece.portal.service.dashboard.IDashboardComponentfindDashboard(String strDashboardName, String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the dashboardList<fr.paris.lutece.portal.service.dashboard.IDashboardComponent>findDashboards(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the list of dashboards from a given view keyList<fr.paris.lutece.portal.service.dashboard.IDashboardComponent>findDashboardsByFilter(fr.paris.lutece.portal.business.dashboard.DashboardFilter filter, String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Loads the data of all the IDashboardComponentintfindMaxOrder(int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds the max order for the column.intfindMaxOrder(fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds the max order for all columns.findViewForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the view from a profilefindViewsByFilter(ViewFilter vFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find Views by filtergetAllSetDashboards(String strViewKey, fr.paris.lutece.portal.business.user.AdminUser user, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of dashboards of the given viewList<fr.paris.lutece.portal.service.dashboard.IDashboardComponent>getDashboardComponents(String strViewKey, int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the dashboard componentfr.paris.lutece.util.html.ItemNavigatorgetItemNavigator(ViewFilter vFilter, View view, fr.paris.lutece.util.url.UrlItem url) Get the item navigatorgetListActions(fr.paris.lutece.portal.business.user.AdminUser user, View view, String strPermission, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of actionsfr.paris.lutece.util.ReferenceListReturns list with available columnfr.paris.lutece.util.ReferenceListgetListAvailableOrders(int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin) Orders reference list for the given columngetMapAvailableOrders(fr.paris.lutece.portal.service.plugin.Plugin plugin) Builds all refList order for all columnsList<fr.paris.lutece.portal.service.dashboard.IDashboardComponent>getNotSetDashboards(String strViewKey, fr.paris.lutece.portal.business.user.AdminUser user, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of dashboards that are not setgetOrderedColumnsStatus(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Builds the map to with column id as key, andtrueas value if column is well ordered,falseotherwise.getProfilesListForView(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of profiles associated to the viewfr.paris.lutece.util.ReferenceListgetViewsList(fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of ViewsbooleanCheck if the given profile has a view or notvoidRemove the View whose identifier is specified in parametervoidremoveDashboard(String strViewKey, String strDashboardName, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a dashboard of a viewvoidremoveDashboards(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete all dashboards of a viewvoidremoveProfileFromView(String strViewKey, String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a view from a profilevoidremoveProfiles(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a profile from a viewUpdate of the view which is specified in parametervoidupdateDashboard(String strViewKey, fr.paris.lutece.portal.service.dashboard.IDashboardComponent dashboard, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update a dashboard
-
Constructor Details
-
ViewsService
public ViewsService()
-
-
Method Details
-
getListActions
public List<ViewAction> getListActions(fr.paris.lutece.portal.business.user.AdminUser user, View view, String strPermission, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of actions- Specified by:
getListActionsin interfaceIViewsService- Parameters:
user- the current userview- the viewstrPermission- the permission namelocale- Localeplugin- Plugin- Returns:
- the list of actions
-
getAllSetDashboards
public Map<String,List<fr.paris.lutece.portal.service.dashboard.IDashboardComponent>> getAllSetDashboards(String strViewKey, fr.paris.lutece.portal.business.user.AdminUser user, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of dashboards of the given view- Specified by:
getAllSetDashboardsin interfaceIViewsService- Parameters:
strViewKey- the view keyuser- the current userplugin- Plugin- Returns:
- the list of dashboards
-
getNotSetDashboards
public List<fr.paris.lutece.portal.service.dashboard.IDashboardComponent> getNotSetDashboards(String strViewKey, fr.paris.lutece.portal.business.user.AdminUser user, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of dashboards that are not set- Specified by:
getNotSetDashboardsin interfaceIViewsService- Parameters:
strViewKey- the view keyuser- the admin userplugin- Plugin- Returns:
- the list of dashboards
-
getMapAvailableOrders
public Map<String,fr.paris.lutece.util.ReferenceList> getMapAvailableOrders(fr.paris.lutece.portal.service.plugin.Plugin plugin) Builds all refList order for all columns- Specified by:
getMapAvailableOrdersin interfaceIViewsService- Parameters:
plugin- Plugin- Returns:
- the map with column id as key
-
getListAvailableOrders
public fr.paris.lutece.util.ReferenceList getListAvailableOrders(int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin) Orders reference list for the given column- Specified by:
getListAvailableOrdersin interfaceIViewsService- Parameters:
nColumn- columnplugin- Plugin- Returns:
- the refList
-
getListAvailableColumns
public fr.paris.lutece.util.ReferenceList getListAvailableColumns()Returns list with available column- Specified by:
getListAvailableColumnsin interfaceIViewsService- Returns:
- all available columns
-
doMoveDashboard
public void doMoveDashboard(fr.paris.lutece.portal.service.dashboard.IDashboardComponent dashboard, int nOldColumn, int nOldOrder, boolean bCreate, String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Moves the dashboard.- Specified by:
doMoveDashboardin interfaceIViewsService- Parameters:
dashboard- to move, with new valuesnOldColumn- previous column idnOldOrder- previous orderbCreate-trueif this is a new dashboard,falseotherwise.strViewKey- the view keyplugin- the plugin
-
getDashboardComponents
public List<fr.paris.lutece.portal.service.dashboard.IDashboardComponent> getDashboardComponents(String strViewKey, int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the dashboard component- Specified by:
getDashboardComponentsin interfaceIViewsService- Parameters:
strViewKey- the view keynColumn- the column idplugin- the plugins- Returns:
- all dashboards for this column
-
doReorderColumn
public void doReorderColumn(String strViewKey, int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin) Reorders column's dashboard- Specified by:
doReorderColumnin interfaceIViewsService- Parameters:
strViewKey- the view keynColumn- the column to reorderplugin- the plugin
-
getOrderedColumnsStatus
public Map<String,Boolean> getOrderedColumnsStatus(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Builds the map to with column id as key, andtrueas value if column is well ordered,falseotherwise.- Specified by:
getOrderedColumnsStatusin interfaceIViewsService- Parameters:
strViewKey- the view keyplugin- the plugin- Returns:
- the map
-
create
Creation of an instance of View- Specified by:
createin interfaceIViewsService- Parameters:
view- The instance of the View which contains the informations to storeplugin- Plugin- Returns:
- The instance of View which has been created with its primary key.
-
update
Update of the view which is specified in parameter- Specified by:
updatein interfaceIViewsService- Parameters:
view- The instance of the view which contains the new data to storeplugin- Plugin- Returns:
- The instance of the view which has been updated
-
remove
Remove the View whose identifier is specified in parameter- Specified by:
removein interfaceIViewsService- Parameters:
strViewKey- The View object to removeplugin- Plugin
-
findByPrimaryKey
public View findByPrimaryKey(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns an instance of a profile whose identifier is specified in parameter- Specified by:
findByPrimaryKeyin interfaceIViewsService- Parameters:
strViewKey- The key of the Viewplugin- Plugin- Returns:
- An instance of View
-
findAll
Returns a List of Views objects- Specified by:
findAllin interfaceIViewsService- Parameters:
plugin- Plugin- Returns:
- A List of Views
-
findViewsByFilter
public List<View> findViewsByFilter(ViewFilter vFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find Views by filter- Specified by:
findViewsByFilterin interfaceIViewsService- Parameters:
vFilter- the Filterplugin- Plugin- Returns:
- List of Views
-
checkExistView
public boolean checkExistView(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if a view already exists or not- Specified by:
checkExistViewin interfaceIViewsService- Parameters:
strViewKey- The view keyplugin- Plugin- Returns:
- true if it already exists, false otherwise
-
getViewsList
public fr.paris.lutece.util.ReferenceList getViewsList(fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of Views- Specified by:
getViewsListin interfaceIViewsService- Parameters:
plugin- Plugin- Returns:
- the list of Views
-
getProfilesListForView
public List<Profile> getProfilesListForView(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of profiles associated to the view- Specified by:
getProfilesListForViewin interfaceIViewsService- Parameters:
strViewKey- The view Keyplugin- Plugin- Returns:
- The list of profile
-
findViewForProfile
public View findViewForProfile(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the view from a profile- Specified by:
findViewForProfilein interfaceIViewsService- Parameters:
strProfileKey- the profile keyplugin- Plugin- Returns:
- the view associated to the profile
-
hasView
Check if the given profile has a view or not- Specified by:
hasViewin interfaceIViewsService- Parameters:
strProfileKey- the profile keyplugin- Plugin- Returns:
- true if the profile has the view, false otherwise
-
addProfileForView
public void addProfileForView(String strViewKey, String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add a profile for a view- Specified by:
addProfileForViewin interfaceIViewsService- Parameters:
strViewKey- The view KeystrProfileKey- The profile Keyplugin- Plugin
-
removeProfiles
Remove a profile from a view- Specified by:
removeProfilesin interfaceIViewsService- Parameters:
strViewKey- The view Keyplugin- Plugin
-
removeProfileFromView
public void removeProfileFromView(String strViewKey, String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a view from a profile- Specified by:
removeProfileFromViewin interfaceIViewsService- Parameters:
strViewKey- the view keystrProfileKey- the profile keyplugin- Plugin
-
findDashboards
public List<fr.paris.lutece.portal.service.dashboard.IDashboardComponent> findDashboards(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the list of dashboards from a given view key- Specified by:
findDashboardsin interfaceIViewsService- Parameters:
strViewKey- the view keyplugin- Plugin- Returns:
- a list of
IDashboardComponent
-
findDashboard
public fr.paris.lutece.portal.service.dashboard.IDashboardComponent findDashboard(String strDashboardName, String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the dashboard- Specified by:
findDashboardin interfaceIViewsService- Parameters:
strDashboardName- the dashboard namestrViewKey- the view keyplugin- Plugin- Returns:
- the dashboard
-
createDashboard
public void createDashboard(String strViewKey, fr.paris.lutece.portal.service.dashboard.IDashboardComponent dashboard, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a dashboard for a view- Specified by:
createDashboardin interfaceIViewsService- Parameters:
strViewKey- the view keydashboard- the dashboardplugin- Plugin
-
removeDashboards
public void removeDashboards(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete all dashboards of a view- Specified by:
removeDashboardsin interfaceIViewsService- Parameters:
strViewKey- the view keyplugin- Plugin
-
removeDashboard
public void removeDashboard(String strViewKey, String strDashboardName, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a dashboard of a view- Specified by:
removeDashboardin interfaceIViewsService- Parameters:
strViewKey- the view keystrDashboardName- the dashboard nameplugin- Plugin
-
updateDashboard
public void updateDashboard(String strViewKey, fr.paris.lutece.portal.service.dashboard.IDashboardComponent dashboard, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update a dashboard- Specified by:
updateDashboardin interfaceIViewsService- Parameters:
strViewKey- the view keydashboard- the dashboardplugin- Plugin
-
findDashboardsByFilter
public List<fr.paris.lutece.portal.service.dashboard.IDashboardComponent> findDashboardsByFilter(fr.paris.lutece.portal.business.dashboard.DashboardFilter filter, String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Loads the data of all the IDashboardComponent- Specified by:
findDashboardsByFilterin interfaceIViewsService- Parameters:
filter- the filterstrViewKey- the view keyplugin- Plugin- Returns:
- the list which contains the data of all the IDashboardComponent
-
findMaxOrder
public int findMaxOrder(fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds the max order for all columns.- Specified by:
findMaxOrderin interfaceIViewsService- Parameters:
plugin- Plugin- Returns:
- the max order
-
findMaxOrder
public int findMaxOrder(int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds the max order for the column.- Specified by:
findMaxOrderin interfaceIViewsService- Parameters:
nColumn- the columnplugin- Plugin- Returns:
- the max order
-
findColumns
Finds all columns- Specified by:
findColumnsin interfaceIViewsService- Parameters:
plugin- Plugin- Returns:
- the list of columns