Class DefaultExcelExportService
java.lang.Object
com.hybris.backoffice.excel.exporting.DefaultExcelExportService
- All Implemented Interfaces:
ExcelExportService
Service for exporting data to excel workbook
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddHeader(org.apache.poi.ss.usermodel.Sheet sheet, Set<SelectedAttribute> selectedAttributes) protected voidaddValues(Map<String, Set<ItemModel>> itemsByType, String type, Set<SelectedAttribute> selectedAttributes, org.apache.poi.ss.usermodel.Sheet sheet) protected List<SelectedAttribute>applyAttributePredicates(List<SelectedAttribute> selectedAttributes) applyTypePredicates(Map<String, Set<ItemModel>> itemsByType) org.apache.poi.ss.usermodel.WorkbookexportData(String typeCode, List<SelectedAttribute> selectedAttributes) Exports data to excel workbook for given typeorg.apache.poi.ss.usermodel.WorkbookexportData(List<ItemModel> selectedItems, List<SelectedAttribute> selectedAttributes) Exports data to excel workbookprotected org.apache.poi.ss.usermodel.WorkbookexportData(Map<String, Set<ItemModel>> itemsByType, List<SelectedAttribute> selectedAttributes) org.apache.poi.ss.usermodel.WorkbookexportTemplate(String typeCode) Exports a template excel workbook.protected List<SelectedAttribute>filterByPermissions(List<SelectedAttribute> selectedAttributes) Deprecated, for removal: This API element is subject to removal in a future version.filterByPermissions(Map<String, Set<ItemModel>> itemsByType) Deprecated, for removal: This API element is subject to removal in a future version.since 1811, type permission checking is now achieved by injecting intosetAttributePredicates(Set)thePermissionCrudTypePredicateDeprecated, for removal: This API element is subject to removal in a future version.since 6.7 please usegetExcelExportDivider()Deprecated, for removal: This API element is subject to removal in a future version.since 1808.protected ObjectgetItemAttribute(ItemModel item, SelectedAttribute selectedAttribute) Deprecated, for removal: This API element is subject to removal in a future version.since 1811 - not used anymore, the logic responsible for permission checking is now extracted toPermissionCrudTypePredicateandPermissionCrudAttributePredicateprotected InputStreamrefreshSelectedItems(List<ItemModel> selectedItems) voidsetAttributePredicates(Set<ExcelExportAttributePredicate> attributePredicates) voidsetBackofficeVariantsService(BackofficeVariantsService backofficeVariantsService) voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetDivider(DefaultExcelExportDivider divider) Deprecated, for removal: This API element is subject to removal in a future version.since 6.7 please usesetExcelExportDivider(ExcelExportDivider)voidsetExcelCellService(ExcelCellService excelCellService) voidsetExcelExportDivider(ExcelExportDivider excelExportDivider) voidsetExcelHeaderService(ExcelHeaderService excelHeaderService) voidsetExcelSheetService(ExcelSheetService excelSheetService) voidsetExcelTemplateService(ExcelTemplateService excelTemplateService) Deprecated, for removal: This API element is subject to removal in a future version.since 1808.voidsetExcelTranslatorRegistry(ExcelTranslatorRegistry excelTranslatorRegistry) voidsetExcelWorkbookService(ExcelWorkbookService excelWorkbookService) voidsetI18NService(I18NService i18NService) voidsetModelService(ModelService modelService) voidsetPermissionCRUDService(PermissionCRUDService permissionCRUDService) Deprecated, for removal: This API element is subject to removal in a future version.since 1811 - not used anymore, the logic responsible for permission checking is now extracted toPermissionCrudTypePredicateandPermissionCrudAttributePredicatevoidsetSessionService(SessionService sessionService) voidsetTemplatePath(String templatePath) voidsetTypePredicates(Set<ExcelExportTypePredicate> typePredicates) voidsetTypeService(TypeService typeService) voidsetUserService(UserService userService) protected voidsignWorkbookFile(org.apache.poi.ss.usermodel.Workbook workbook)
-
Constructor Details
-
DefaultExcelExportService
public DefaultExcelExportService()
-
-
Method Details
-
exportTemplate
Description copied from interface:ExcelExportServiceExports 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 thetypeCodeand all of it's non-abstract sub-types, with all the metadata (like the available attributes).- Specified by:
exportTemplatein interfaceExcelExportService- 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(List<ItemModel> selectedItems, List<SelectedAttribute> selectedAttributes) Description copied from interface:ExcelExportServiceExports data to excel workbook- Specified by:
exportDatain interfaceExcelExportService- Parameters:
selectedItems- list of items which will be exportedselectedAttributes- list of selected attributes which have metadata necessary for reimporting the data- Returns:
- sheet
-
refreshSelectedItems
-
exportData
public org.apache.poi.ss.usermodel.Workbook exportData(String typeCode, List<SelectedAttribute> selectedAttributes) Description copied from interface:ExcelExportServiceExports data to excel workbook for given type- Specified by:
exportDatain interfaceExcelExportService- Parameters:
typeCode- type to exportselectedAttributes- list of selected attributes which have metadata necessary for reimporting the data- Returns:
- sheet
-
exportData
-
applyTypePredicates
-
applyAttributePredicates
protected List<SelectedAttribute> applyAttributePredicates(List<SelectedAttribute> selectedAttributes) -
signWorkbookFile
protected void signWorkbookFile(org.apache.poi.ss.usermodel.Workbook workbook) -
filterByPermissions
@Deprecated(since="1811", forRemoval=true) protected List<SelectedAttribute> filterByPermissions(List<SelectedAttribute> selectedAttributes) Deprecated, for removal: This API element is subject to removal in a future version.since 1811, attribute permission checking is now achieved by injecting intosetAttributePredicates(Set)thePermissionCrudAttributePredicate- See Also:
-
filterByPermissions
@Deprecated(since="1811", forRemoval=true) protected Map<String,Set<ItemModel>> filterByPermissions(Map<String, Set<ItemModel>> itemsByType) Deprecated, for removal: This API element is subject to removal in a future version.since 1811, type permission checking is now achieved by injecting intosetAttributePredicates(Set)thePermissionCrudTypePredicate- See Also:
-
loadExcelTemplate
-
addHeader
protected void addHeader(org.apache.poi.ss.usermodel.Sheet sheet, Set<SelectedAttribute> selectedAttributes) -
addValues
-
getItemAttribute
-
getDivider
Deprecated, for removal: This API element is subject to removal in a future version.since 6.7 please usegetExcelExportDivider() -
setDivider
Deprecated, for removal: This API element is subject to removal in a future version.since 6.7 please usesetExcelExportDivider(ExcelExportDivider) -
getExcelExportDivider
-
setExcelExportDivider
-
getTemplatePath
-
setTemplatePath
-
getExcelTranslatorRegistry
-
setExcelTranslatorRegistry
-
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. -
getTypeService
-
setTypeService
-
getCommonI18NService
-
setCommonI18NService
-
getPermissionCRUDService
Deprecated, for removal: This API element is subject to removal in a future version.since 1811 - not used anymore, the logic responsible for permission checking is now extracted toPermissionCrudTypePredicateandPermissionCrudAttributePredicate -
setPermissionCRUDService
@Deprecated(since="1811", forRemoval=true) public void setPermissionCRUDService(PermissionCRUDService permissionCRUDService) Deprecated, for removal: This API element is subject to removal in a future version.since 1811 - not used anymore, the logic responsible for permission checking is now extracted toPermissionCrudTypePredicateandPermissionCrudAttributePredicate -
getModelService
-
setModelService
-
getExcelSheetService
-
setExcelSheetService
-
getExcelWorkbookService
-
setExcelWorkbookService
-
getExcelCellService
-
setExcelCellService
-
getExcelHeaderService
-
setExcelHeaderService
-
getI18NService
-
setI18NService
-
getSessionService
-
setSessionService
-
getUserService
-
setUserService
-
getBackofficeVariantsService
-
setBackofficeVariantsService
-
getAttributePredicates
-
setAttributePredicates
-
getTypePredicates
-
setTypePredicates
-
setAttributePredicates(Set)thePermissionCrudAttributePredicate