/** {@inheritDoc} */ public List<Map<String, String>> getExportGroups(final String language) { final List<DataGroup> dataGroups = dataDescriptorResolver.getGroups(); final Set<Map<String, String>> out = new TreeSet<Map<String, String>>( new Comparator<Map<String, String>>() { @Override public int compare(final Map<String, String> o1, final Map<String, String> o2) { int comp = o1.get("label").compareToIgnoreCase(o2.get("label")); if (comp == 0) { comp = o1.get("name").compareToIgnoreCase(o2.get("name")); } return comp; } }); for (final DataGroup dataGroup : dataGroups) { if (StringUtils.isBlank(dataGroup.getQualifier()) || federationFacade.isManageable(dataGroup.getQualifier(), ShopDTO.class)) { final Map<String, String> grp = new HashMap<String, String>(); grp.put("name", dataGroup.getName()); final I18NModel model = new FailoverStringI18NModel(dataGroup.getDisplayName(), dataGroup.getName()); grp.put("label", model.getValue(language)); out.add(grp); } } return new ArrayList<Map<String, String>>(out); }
private void doDataExport(final JobContext context) throws IOException { final Map<String, ExportDescriptor> descriptorObjects = dataDescriptorResolver.getByGroup( (String) context.getAttribute(JobContextKeys.EXPORT_DESCRIPTOR_GROUP)); // remove export file override if we have multiple exports final String exportFile = descriptorObjects.size() != 1 ? null : (String) context.getAttribute(JobContextKeys.EXPORT_FILE); for (final Map.Entry<String, ExportDescriptor> descriptorObjectEntry : descriptorObjects.entrySet()) { final String descriptor = descriptorObjectEntry.getKey(); final ExportDescriptor descriptorObject = descriptorObjectEntry.getValue(); final JobContext dataJob = new JobContextDecoratorImpl( context, new HashMap<String, Object>() { { put(JobContextKeys.EXPORT_DESCRIPTOR, descriptorObject); put(JobContextKeys.EXPORT_DESCRIPTOR_NAME, descriptor); put(JobContextKeys.EXPORT_FILE, exportFile); } }); if ("IMAGE".equals(descriptorObject.getEntityType())) { getNewBulkExportImagesService().doExport(dataJob); } else if ("org.yes.cart.payment.persistence.entity.CustomerOrderPayment" .equals(descriptorObject.getEntityType())) { getNewBulkPaymentExportService().doExport(dataJob); } else { getNewBulkExportService().doExport(dataJob); } } }