java.lang.Object
fr.paris.lutece.plugins.profiles.service.views.ViewsService
All Implemented Interfaces:
IViewsService

@ApplicationScoped public class ViewsService extends Object implements IViewsService
ViewService
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addProfileForView(String strViewKey, String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Add a profile for a view
    boolean
    checkExistView(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Check if a view already exists or not
    create(View view, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Creation of an instance of View
    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
    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.
    void
    doReorderColumn(String strViewKey, int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Reorders column's dashboard
    findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns a List of Views objects
    findByPrimaryKey(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns an instance of a profile whose identifier is specified in parameter
    findColumns(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Finds all columns
    fr.paris.lutece.portal.service.dashboard.IDashboardComponent
    findDashboard(String strDashboardName, String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load the dashboard
    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
    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
    int
    findMaxOrder(int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Finds the max order for the column.
    int
    findMaxOrder(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 profile
    findViewsByFilter(ViewFilter vFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Find Views by filter
    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
    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
    fr.paris.lutece.util.html.ItemNavigator
    getItemNavigator(ViewFilter vFilter, View view, fr.paris.lutece.util.url.UrlItem url)
    Get the item navigator
    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
    fr.paris.lutece.util.ReferenceList
    Returns list with available column
    fr.paris.lutece.util.ReferenceList
    getListAvailableOrders(int nColumn, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Orders reference list for the given column
    Map<String,fr.paris.lutece.util.ReferenceList>
    getMapAvailableOrders(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Builds all refList order for all columns
    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
    getOrderedColumnsStatus(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Builds the map to with column id as key, and true as value if column is well ordered, false otherwise.
    getProfilesListForView(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Get the list of profiles associated to the view
    fr.paris.lutece.util.ReferenceList
    getViewsList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Get the list of Views
    boolean
    hasView(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Check if the given profile has a view or not
    void
    remove(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove the View whose identifier is specified in parameter
    void
    removeDashboard(String strViewKey, String strDashboardName, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Delete a dashboard of a view
    void
    removeDashboards(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Delete all dashboards of a view
    void
    removeProfileFromView(String strViewKey, String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove a view from a profile
    void
    removeProfiles(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Remove a profile from a view
    update(View view, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Update of the view which is specified in parameter
    void
    updateDashboard(String strViewKey, fr.paris.lutece.portal.service.dashboard.IDashboardComponent dashboard, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Update a dashboard

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ViewsService

      public ViewsService()
  • Method Details

    • getItemNavigator

      public fr.paris.lutece.util.html.ItemNavigator getItemNavigator(ViewFilter vFilter, View view, fr.paris.lutece.util.url.UrlItem url)
      Get the item navigator
      Specified by:
      getItemNavigator in interface IViewsService
      Parameters:
      vFilter - the view filter
      view - the view
      url - the url
      Returns:
      the item navigator
    • 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:
      getListActions in interface IViewsService
      Parameters:
      user - the current user
      view - the view
      strPermission - the permission name
      locale - Locale
      plugin - 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:
      getAllSetDashboards in interface IViewsService
      Parameters:
      strViewKey - the view key
      user - the current user
      plugin - 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:
      getNotSetDashboards in interface IViewsService
      Parameters:
      strViewKey - the view key
      user - the admin user
      plugin - 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:
      getMapAvailableOrders in interface IViewsService
      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:
      getListAvailableOrders in interface IViewsService
      Parameters:
      nColumn - column
      plugin - Plugin
      Returns:
      the refList
    • getListAvailableColumns

      public fr.paris.lutece.util.ReferenceList getListAvailableColumns()
      Returns list with available column
      Specified by:
      getListAvailableColumns in interface IViewsService
      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:
      doMoveDashboard in interface IViewsService
      Parameters:
      dashboard - to move, with new values
      nOldColumn - previous column id
      nOldOrder - previous order
      bCreate - true if this is a new dashboard, false otherwise.
      strViewKey - the view key
      plugin - 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:
      getDashboardComponents in interface IViewsService
      Parameters:
      strViewKey - the view key
      nColumn - the column id
      plugin - 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:
      doReorderColumn in interface IViewsService
      Parameters:
      strViewKey - the view key
      nColumn - the column to reorder
      plugin - 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, and true as value if column is well ordered, false otherwise.
      Specified by:
      getOrderedColumnsStatus in interface IViewsService
      Parameters:
      strViewKey - the view key
      plugin - the plugin
      Returns:
      the map
    • create

      public View create(View view, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Creation of an instance of View
      Specified by:
      create in interface IViewsService
      Parameters:
      view - The instance of the View which contains the informations to store
      plugin - Plugin
      Returns:
      The instance of View which has been created with its primary key.
    • update

      public View update(View view, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update of the view which is specified in parameter
      Specified by:
      update in interface IViewsService
      Parameters:
      view - The instance of the view which contains the new data to store
      plugin - Plugin
      Returns:
      The instance of the view which has been updated
    • remove

      public void remove(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove the View whose identifier is specified in parameter
      Specified by:
      remove in interface IViewsService
      Parameters:
      strViewKey - The View object to remove
      plugin - 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:
      findByPrimaryKey in interface IViewsService
      Parameters:
      strViewKey - The key of the View
      plugin - Plugin
      Returns:
      An instance of View
    • findAll

      public List<View> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns a List of Views objects
      Specified by:
      findAll in interface IViewsService
      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:
      findViewsByFilter in interface IViewsService
      Parameters:
      vFilter - the Filter
      plugin - 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:
      checkExistView in interface IViewsService
      Parameters:
      strViewKey - The view key
      plugin - 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:
      getViewsList in interface IViewsService
      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:
      getProfilesListForView in interface IViewsService
      Parameters:
      strViewKey - The view Key
      plugin - 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:
      findViewForProfile in interface IViewsService
      Parameters:
      strProfileKey - the profile key
      plugin - Plugin
      Returns:
      the view associated to the profile
    • hasView

      public boolean hasView(String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Check if the given profile has a view or not
      Specified by:
      hasView in interface IViewsService
      Parameters:
      strProfileKey - the profile key
      plugin - 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:
      addProfileForView in interface IViewsService
      Parameters:
      strViewKey - The view Key
      strProfileKey - The profile Key
      plugin - Plugin
    • removeProfiles

      public void removeProfiles(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove a profile from a view
      Specified by:
      removeProfiles in interface IViewsService
      Parameters:
      strViewKey - The view Key
      plugin - 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:
      removeProfileFromView in interface IViewsService
      Parameters:
      strViewKey - the view key
      strProfileKey - the profile key
      plugin - 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:
      findDashboards in interface IViewsService
      Parameters:
      strViewKey - the view key
      plugin - 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:
      findDashboard in interface IViewsService
      Parameters:
      strDashboardName - the dashboard name
      strViewKey - the view key
      plugin - 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:
      createDashboard in interface IViewsService
      Parameters:
      strViewKey - the view key
      dashboard - the dashboard
      plugin - Plugin
    • removeDashboards

      public void removeDashboards(String strViewKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete all dashboards of a view
      Specified by:
      removeDashboards in interface IViewsService
      Parameters:
      strViewKey - the view key
      plugin - 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:
      removeDashboard in interface IViewsService
      Parameters:
      strViewKey - the view key
      strDashboardName - the dashboard name
      plugin - 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:
      updateDashboard in interface IViewsService
      Parameters:
      strViewKey - the view key
      dashboard - the dashboard
      plugin - 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:
      findDashboardsByFilter in interface IViewsService
      Parameters:
      filter - the filter
      strViewKey - the view key
      plugin - 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:
      findMaxOrder in interface IViewsService
      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:
      findMaxOrder in interface IViewsService
      Parameters:
      nColumn - the column
      plugin - Plugin
      Returns:
      the max order
    • findColumns

      public List<Integer> findColumns(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Finds all columns
      Specified by:
      findColumns in interface IViewsService
      Parameters:
      plugin - Plugin
      Returns:
      the list of columns