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("grdexp_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
    • 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)
    • setDataGridExporter

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

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

      public void setFileName(String fileName)
      Sets a file name.
      Parameters:
      fileName - a file name
    • withFileName

      public <T> T withFileName(String fileName)
      Sets a file name.
      Parameters:
      fileName - a file name
      Returns:
      builder
    • 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)
    • createExportSelectedAction

      protected Action createExportSelectedAction()
    • createExportAllAction

      protected Action createExportAllAction()
    • createCurrentPageAction

      protected Action createCurrentPageAction()
    • isDataLoaderExist

      protected boolean isDataLoaderExist(ListDataComponent<?> target)