Class DefaultExcelExportService

  • All Implemented Interfaces:
    ExcelExportService

    public class DefaultExcelExportService
    extends java.lang.Object
    implements ExcelExportService
    Service for exporting data to excel workbook
    • Constructor Detail

      • DefaultExcelExportService

        public DefaultExcelExportService()
    • Method Detail

      • exportTemplate

        public org.apache.poi.ss.usermodel.Workbook exportTemplate​(java.lang.String typeCode)
        Description copied from interface: ExcelExportService
        Exports a template excel workbook. Its purpose is to provide an empty excel file that a user can fill with data, and then re-import. The template contains sheets for the typeCode and all of it's non-abstract sub-types, with all the metadata (like the available attributes).
        Specified by:
        exportTemplate in interface ExcelExportService
        Parameters:
        typeCode - the type for which the template workbook will be created
        Returns:
        the template workbook
      • exportData

        public org.apache.poi.ss.usermodel.Workbook exportData​(java.util.List<ItemModel> selectedItems,
                                                               java.util.List<SelectedAttribute> selectedAttributes)
        Description copied from interface: ExcelExportService
        Exports data to excel workbook
        Specified by:
        exportData in interface ExcelExportService
        Parameters:
        selectedItems - list of items which will be exported
        selectedAttributes - list of selected attributes which have metadata necessary for reimporting the data
        Returns:
        sheet
      • refreshSelectedItems

        protected java.util.List<ItemModel> refreshSelectedItems​(java.util.List<ItemModel> selectedItems)
      • exportData

        public org.apache.poi.ss.usermodel.Workbook exportData​(java.lang.String typeCode,
                                                               java.util.List<SelectedAttribute> selectedAttributes)
        Description copied from interface: ExcelExportService
        Exports data to excel workbook for given type
        Specified by:
        exportData in interface ExcelExportService
        Parameters:
        typeCode - type to export
        selectedAttributes - list of selected attributes which have metadata necessary for reimporting the data
        Returns:
        sheet
      • exportData

        protected org.apache.poi.ss.usermodel.Workbook exportData​(java.util.Map<java.lang.String,​java.util.Set<ItemModel>> itemsByType,
                                                                  java.util.List<SelectedAttribute> selectedAttributes)
      • applyTypePredicates

        protected java.util.Map<java.lang.String,​java.util.Set<ItemModel>> applyTypePredicates​(java.util.Map<java.lang.String,​java.util.Set<ItemModel>> itemsByType)
      • signWorkbookFile

        protected void signWorkbookFile​(org.apache.poi.ss.usermodel.Workbook workbook)
      • loadExcelTemplate

        protected java.io.InputStream loadExcelTemplate()
      • addHeader

        protected void addHeader​(org.apache.poi.ss.usermodel.Sheet sheet,
                                 java.util.Set<SelectedAttribute> selectedAttributes)
      • addValues

        protected void addValues​(java.util.Map<java.lang.String,​java.util.Set<ItemModel>> itemsByType,
                                 java.lang.String type,
                                 java.util.Set<SelectedAttribute> selectedAttributes,
                                 org.apache.poi.ss.usermodel.Sheet sheet)
      • setExcelExportDivider

        public void setExcelExportDivider​(ExcelExportDivider excelExportDivider)
      • getTemplatePath

        public java.lang.String getTemplatePath()
      • setTemplatePath

        public void setTemplatePath​(java.lang.String templatePath)
      • setExcelTranslatorRegistry

        public void setExcelTranslatorRegistry​(ExcelTranslatorRegistry excelTranslatorRegistry)
      • getExcelTemplateService

        @Deprecated(since="1808",
                    forRemoval=true)
        public ExcelTemplateService getExcelTemplateService()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 1808.
      • setExcelTemplateService

        @Deprecated(since="1808",
                    forRemoval=true)
        public void setExcelTemplateService​(ExcelTemplateService excelTemplateService)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 1808.
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • setCommonI18NService

        public void setCommonI18NService​(CommonI18NService commonI18NService)
      • setModelService

        public void setModelService​(ModelService modelService)
      • setExcelSheetService

        public void setExcelSheetService​(ExcelSheetService excelSheetService)
      • setExcelWorkbookService

        public void setExcelWorkbookService​(ExcelWorkbookService excelWorkbookService)
      • setExcelCellService

        public void setExcelCellService​(ExcelCellService excelCellService)
      • setExcelHeaderService

        public void setExcelHeaderService​(ExcelHeaderService excelHeaderService)
      • setI18NService

        public void setI18NService​(I18NService i18NService)
      • setSessionService

        public void setSessionService​(SessionService sessionService)
      • setUserService

        public void setUserService​(UserService userService)
      • setBackofficeVariantsService

        public void setBackofficeVariantsService​(BackofficeVariantsService backofficeVariantsService)