Class ExportAction

All Implemented Interfaces:
ExecutableAction, SecuredAction, TargetAction<ListDataComponent<Object>>, Action, HasShortcutCombination, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
ExcelExportAction, JsonExportAction

@ActionType("export") public class ExportAction extends ListDataComponentAction<ExportAction,Object> implements org.springframework.context.ApplicationContextAware
Base action for export table content with defined exporter. dataGridExporter is required for this action

Should be defined for a list component (Table, DataGrid, etc.).

  • Field Details

    • ID

      public static final String ID
      See Also:
    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • messages

      protected Messages messages
    • downloader

      protected Downloader downloader
    • dialogs

      protected Dialogs dialogs
    • actions

      protected Actions actions
    • dataGridExporter

      protected DataGridExporter dataGridExporter
  • Constructor Details

    • ExportAction

      public ExportAction()
    • ExportAction

      public ExportAction(String id)
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
    • setMessages

      @Autowired public void setMessages(Messages messages)
    • setDownloader

      @Autowired public void setDownloader(Downloader downloader)
    • setDialogs

      @Autowired public void setDialogs(Dialogs dialogs)
    • setActions

      @Autowired public void setActions(Actions actions)
    • setDataGridExporter

      public void setDataGridExporter(DataGridExporter dataGridExporter)
      Sets the dataGrid exporter instance
    • withExporter

      public <T> T withExporter(Class<T> exporterClass)
    • addColumnValueProvider

      public void addColumnValueProvider(String columnId, Function<DataGridExporter.ColumnValueContext,Object> columnValueProvider)
      Adds a function to get value from the column.
      Parameters:
      columnId - column id
      columnValueProvider - column value provider function
    • removeColumnValueProvider

      public void removeColumnValueProvider(String columnId)
      Removes an column value provider function by column id.
      Parameters:
      columnId - column id
    • getColumnValueProvider

      @Nullable public Function<DataGridExporter.ColumnValueContext,Object> getColumnValueProvider(String columnId)
      Parameters:
      columnId - column id
      Returns:
      column value provider function for the column id
    • execute

      public void execute()
      Description copied from interface: ExecutableAction
      Executes the Action
      Specified by:
      execute in interface ExecutableAction
    • doExport

      protected void doExport(ExportMode exportMode)
    • getMessage

      protected String getMessage(String id)
    • isExportAllEnabled

      protected boolean isExportAllEnabled()
    • createExportSelectedAction

      protected Action createExportSelectedAction()
    • createExportAllAction

      protected Action createExportAllAction()
    • createCurrentPageAction

      protected Action createCurrentPageAction()