Class TableExporter

java.lang.Object
org.kuali.rice.krad.uif.layout.collections.TableExporter

public class TableExporter extends Object
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Constructor Details

    • TableExporter

      public TableExporter()
  • Method Details

    • buildExportTableData

      public static String buildExportTableData(CollectionGroup collectionGroup, Object model, String formatType)
      Generates formatted table data based on the posted view results and format type.
      Parameters:
      collectionGroup - collection group instance that should be exported
      model - top level object containing the data
      formatType - format which the table should be generated in
      Returns:
      generated table data
    • findIgnoredColumns

      protected static List<Integer> findIgnoredColumns(TableLayoutManager layoutManager, CollectionGroup collectionGroup)
      Helper function to determine whether if column should be displayed. Used to help extract columns used in screen format such as action or select that is not needed for export.
      Parameters:
      layoutManager - The layout manager.
      collectionGroup - The collection group.
      Returns:
      Index numbers for all columns that should be ignored.
    • buildExportTableRow

      protected static String buildExportTableRow(List<String> columnData, Map<String,String> tableFormatOptions, List<Integer> ignoredColumns)
      Helper method used to build formatted table row data for export.
      Parameters:
      columnData - Formatted column data.
      tableFormatOptions - Format options: startRow and endRow are added to the row, startColumn and endColumn are added to each column.
      ignoredColumns - Index numbers of columns to ignore.
      Returns:
      Formatted table data for one row.
    • getExportTableFormatOptions

      protected static Map<String,String> getExportTableFormatOptions(String formatType)
      Identify table formatting elements based on formatType. Defaults to txt format if not found
      Parameters:
      formatType - The format type: csv, xls, or xml.
      Returns:
      The format options for to use with the indicated format type.