Package org.supercsv.io

Examples of org.supercsv.io.ICsvMapWriter


    private CsvPreference preference = CsvPreference.STANDARD_PREFERENCE;

    public void marshal(Exchange exchange, Object object, OutputStream outputStream) throws Exception {
        OutputStreamWriter out = new OutputStreamWriter(outputStream);
        if (object instanceof Map) {
            ICsvMapWriter writer = new CsvMapWriter(out, preference);
            Map<String, ? extends Object> map = (Map<String, ? extends Object>) object;

            Set<String> keys = map.keySet();
            String[] headers = new String[keys.size()];
            keys.toArray(headers);
            writer.writeHeader(headers);
            writer.write(map, headers);
        }
        else if (object != null) {
            ICsvBeanWriter writer = new CsvBeanWriter(out, preference);
            PropertyDescriptor[] properties = BeanUtils.getPropertyDescriptors(object.getClass());
            int size = properties.length;
            String[] headers = new String[size];
            for (int i = 0; i < size; i++) {
                headers[i] = properties[i].getName();
            }
            writer.writeHeader(headers);
            writer.write(object, headers);
        }
        out.close();
    }
View Full Code Here


                for (final Object e : items) {
                    writer.write(e, nameMapping, cellProcessorInstances);
                }
            }
        } else if (delegateWriter instanceof ICsvMapWriter) {
            final ICsvMapWriter writer = (ICsvMapWriter) delegateWriter;
            if (cellProcessorInstances.length == 0) {
                for (final Object e : items) {
                    writer.write((Map<String, ?>) e, nameMapping);
                }
            } else {
                for (final Object e : items) {
                    writer.write((Map<String, ?>) e, nameMapping, cellProcessorInstances);
                }
            }
        } else if (delegateWriter instanceof ICsvListWriter) {
            final ICsvListWriter writer = (ICsvListWriter) delegateWriter;
            if (cellProcessorInstances.length == 0) {
                for (final Object e : items) {
                    writer.write((List<?>) e);
                }
            } else {
                for (final Object e : items) {
                    writer.write((List<?>) e, cellProcessorInstances);
                }
            }
        }
        delegateWriter.flush();
    }
View Full Code Here

                for (final Object e : items) {
                    writer.write(e, nameMapping, cellProcessorInstances);
                }
            }
        } else if (delegateWriter instanceof ICsvMapWriter) {
            final ICsvMapWriter writer = (ICsvMapWriter) delegateWriter;
            if (cellProcessorInstances.length == 0) {
                for (final Object e : items) {
                    writer.write((Map<String, ?>) e, nameMapping);
                }
            } else {
                for (final Object e : items) {
                    writer.write((Map<String, ?>) e, nameMapping, cellProcessorInstances);
                }
            }
        } else if (delegateWriter instanceof ICsvListWriter) {
            final ICsvListWriter writer = (ICsvListWriter) delegateWriter;
            if (cellProcessorInstances.length == 0) {
                for (final Object e : items) {
                    writer.write((List<?>) e);
                }
            } else {
                for (final Object e : items) {
                    writer.write((List<?>) e, cellProcessorInstances);
                }
            }
        }
        delegateWriter.flush();
    }
View Full Code Here

                for (final Object e : items) {
                    writer.write(e, nameMapping, cellProcessorInstances);
                }
            }
        } else if (delegateWriter instanceof ICsvMapWriter) {
            final ICsvMapWriter writer = (ICsvMapWriter) delegateWriter;
            if (cellProcessorInstances.length == 0) {
                for (final Object e : items) {
                    writer.write((Map<String, ?>) e, nameMapping);
                }
            } else {
                for (final Object e : items) {
                    writer.write((Map<String, ?>) e, nameMapping, cellProcessorInstances);
                }
            }
        } else if (delegateWriter instanceof ICsvListWriter) {
            final ICsvListWriter writer = (ICsvListWriter) delegateWriter;
            if (cellProcessorInstances.length == 0) {
                for (final Object e : items) {
                    writer.write((List<?>) e);
                }
            } else {
                for (final Object e : items) {
                    writer.write((List<?>) e, cellProcessorInstances);
                }
            }
        }
        delegateWriter.flush();
    }
View Full Code Here

                for (final Object e : items) {
                    writer.write(e, nameMapping, cellProcessorInstances);
                }
            }
        } else if (delegateWriter instanceof ICsvMapWriter) {
            final ICsvMapWriter writer = (ICsvMapWriter) delegateWriter;
            if (cellProcessorInstances.length == 0) {
                for (final Object e : items) {
                    writer.write((Map<String, ?>) e, nameMapping);
                }
            } else {
                for (final Object e : items) {
                    writer.write((Map<String, ?>) e, nameMapping, cellProcessorInstances);
                }
            }
        } else if (delegateWriter instanceof ICsvListWriter) {
            final ICsvListWriter writer = (ICsvListWriter) delegateWriter;
            if (cellProcessorInstances.length == 0) {
                for (final Object e : items) {
                    writer.write((List<?>) e);
                }
            } else {
                for (final Object e : items) {
                    writer.write((List<?>) e, cellProcessorInstances);
                }
            }
        }
        delegateWriter.flush();
    }
View Full Code Here

    private InputStream getDownloadContent(boolean isTemplate) throws Exception {
        UserUtil.permissionCheck("view_task");
        String fileName = getText("entity.task.label") + ".csv";
        fileName = new String(fileName.getBytes(), "ISO8859-1");
        File file = new File(fileName);
        ICsvMapWriter writer = new CsvMapWriter(new FileWriter(file),
                CsvPreference.EXCEL_PREFERENCE);
        try {
            final String[] header = new String[] { getText("entity.id.label"),
                    getText("entity.subject.label"),
                    getText("entity.status_id.label"),
                    getText("entity.status_name.label"),
                    getText("entity.start_date.label"),
                    getText("task.due_date.label"),
                    getText("entity.related_object.label"),
                    getText("entity.related_record_id.label"),
                    getText("entity.contact_id.label"),
                    getText("entity.contact_name.label"),
                    getText("entity.priority_id.label"),
                    getText("entity.priority_name.label"),
                    getText("entity.description.label"),
                    getText("entity.notes.label"),
                    getText("entity.assigned_to_id.label"),
                    getText("entity.assigned_to_name.label") };
            writer.writeHeader(header);
            if (!isTemplate) {
                String[] ids = seleteIDs.split(",");
                for (int i = 0; i < ids.length; i++) {
                    String id = ids[i];
                    Task task = baseService.getEntityById(Task.class,
                            Integer.parseInt(id));
                    final HashMap<String, ? super Object> data1 = new HashMap<String, Object>();
                    data1.put(header[0], task.getId());
                    data1.put(header[1],
                            CommonUtil.fromNullToEmpty(task.getSubject()));
                    TaskStatus taskStatus = task.getStatus();
                    if (taskStatus != null) {
                        data1.put(header[2], taskStatus.getId());
                    } else {
                        data1.put(header[2], "");
                    }
                    data1.put(header[3], CommonUtil.getOptionLabel(taskStatus));
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            Constant.DATE_TIME_FORMAT);
                    Date startDate = task.getStart_date();
                    if (startDate != null) {
                        data1.put(header[4], dateFormat.format(startDate));
                    } else {
                        data1.put(header[4], "");
                    }
                    Date due_date = task.getDue_date();
                    if (due_date != null) {
                        data1.put(header[5], dateFormat.format(due_date));
                    } else {
                        data1.put(header[5], "");
                    }
                    data1.put(header[6], CommonUtil.fromNullToEmpty(task
                            .getRelated_object()));
                    if (task.getRelated_record() != null) {
                        data1.put(header[7], task.getRelated_record());
                    } else {
                        data1.put(header[7], "");
                    }
                    if (task.getContact() != null) {
                        data1.put(header[8], task.getContact().getId());
                        data1.put(header[9], task.getContact().getName());
                    } else {
                        data1.put(header[8], "");
                        data1.put(header[9], "");
                    }
                    TaskPriority taskPriority = task.getPriority();
                    if (taskPriority != null) {
                        data1.put(header[10], taskPriority.getId());
                    } else {
                        data1.put(header[10], "");
                    }
                    data1.put(header[11],
                            CommonUtil.getOptionLabel(taskPriority));
                    data1.put(header[12],
                            CommonUtil.fromNullToEmpty(task.getDescription()));
                    data1.put(header[13],
                            CommonUtil.fromNullToEmpty(task.getNotes()));
                    if (task.getAssigned_to() != null) {
                        data1.put(header[14], task.getAssigned_to().getId());
                        data1.put(header[15], task.getAssigned_to().getName());
                    } else {
                        data1.put(header[14], "");
                        data1.put(header[15], "");
                    }
                    writer.write(data1, header);
                }
            }
        } catch (Exception e) {
            throw e;
        } finally {
            writer.close();
        }

        InputStream in = new FileInputStream(file);
        this.setFileName(fileName);
        return in;
View Full Code Here

    private InputStream getDownloadContent(boolean isTemplate) throws Exception {
        UserUtil.permissionCheck("view_opportunity");
        String fileName = getText("entity.opportunity.label") + ".csv";
        fileName = new String(fileName.getBytes(), "ISO8859-1");
        File file = new File(fileName);
        ICsvMapWriter writer = new CsvMapWriter(new FileWriter(file),
                CsvPreference.EXCEL_PREFERENCE);
        try {
            final String[] header = new String[] { getText("entity.id.label"),
                    getText("entity.name.label"),
                    getText("entity.account_id.label"),
                    getText("entity.account_name.label"),
                    getText("entity.currency_id.label"),
                    getText("entity.currency_name.label"),
                    getText("opportunity.expect_close_date.label"),
                    getText("opportunity.opportunity_amount.label"),
                    getText("entity.type_id.label"),
                    getText("entity.type_name.label"),
                    getText("entity.salesStage_id.label"),
                    getText("entity.salesStage_name.label"),
                    getText("entity.leadSource_id.label"),
                    getText("entity.leadSource_name.label"),
                    getText("opportunity.probability.label"),
                    getText("entity.campaign_id.label"),
                    getText("entity.campaign_name.label"),
                    getText("opportunity.next_step.label"),
                    getText("entity.notes.label"),
                    getText("entity.assigned_to_id.label"),
                    getText("entity.assigned_to_name.label") };
            writer.writeHeader(header);
            if (!isTemplate) {
                String[] ids = seleteIDs.split(",");
                for (int i = 0; i < ids.length; i++) {
                    String id = ids[i];
                    Opportunity opportunity = baseService.getEntityById(
                            Opportunity.class, Integer.parseInt(id));
                    final HashMap<String, ? super Object> data1 = new HashMap<String, Object>();
                    data1.put(header[0], opportunity.getId());
                    data1.put(header[1],
                            CommonUtil.fromNullToEmpty(opportunity.getName()));
                    if (opportunity.getAccount() != null) {
                        data1.put(header[2], opportunity.getAccount().getId());
                        data1.put(header[3], opportunity.getAccount().getName());
                    } else {
                        data1.put(header[2], "");
                        data1.put(header[3], "");
                    }
                    if (opportunity.getCurrency() != null) {
                        data1.put(header[4], opportunity.getCurrency().getId());
                        data1.put(header[5], opportunity.getCurrency()
                                .getName());
                    } else {
                        data1.put(header[4], "");
                        data1.put(header[5], "");
                    }
                    Date expectCloseDate = opportunity.getExpect_close_date();
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            Constant.DATE_EDIT_FORMAT);
                    if (expectCloseDate != null) {
                        data1.put(header[6], dateFormat.format(expectCloseDate));
                    } else {
                        data1.put(header[6], "");
                    }
                    data1.put(header[7], CommonUtil.fromNullToEmpty(opportunity
                            .getOpportunity_amount()));
                    OpportunityType opportunityType = opportunity.getType();
                    if (opportunityType != null) {
                        data1.put(header[8], opportunityType.getId());
                    } else {
                        data1.put(header[8], "");
                    }
                    data1.put(header[9],
                            CommonUtil.getOptionLabel(opportunityType));
                    SalesStage salesStage = opportunity.getSales_stage();
                    if (salesStage != null) {
                        data1.put(header[10], salesStage.getId());
                    } else {
                        data1.put(header[10], "");
                    }
                    data1.put(header[11], CommonUtil.getOptionLabel(salesStage));
                    LeadSource leadSource = opportunity.getLead_source();
                    if (leadSource != null) {
                        data1.put(header[12], leadSource.getId());
                    } else {
                        data1.put(header[12], "");
                    }
                    data1.put(header[13], CommonUtil.getOptionLabel(leadSource));
                    data1.put(header[14], opportunity.getProbability());

                    if (opportunity.getCampaign() != null) {
                        data1.put(header[15], opportunity.getCampaign().getId());
                        data1.put(header[16], opportunity.getCampaign()
                                .getName());
                    } else {
                        data1.put(header[15], "");
                        data1.put(header[16], "");
                    }
                    data1.put(header[17], CommonUtil
                            .fromNullToEmpty(opportunity.getNext_step()));
                    data1.put(header[18],
                            CommonUtil.fromNullToEmpty(opportunity.getNotes()));
                    if (opportunity.getAssigned_to() != null) {
                        data1.put(header[19], opportunity.getAssigned_to()
                                .getId());
                        data1.put(header[20], opportunity.getAssigned_to()
                                .getName());
                    } else {
                        data1.put(header[21], "");
                        data1.put(header[22], "");
                    }
                    writer.write(data1, header);
                }
            }
        } catch (Exception e) {
            throw e;
        } finally {
            writer.close();
        }

        InputStream in = new FileInputStream(file);
        this.setFileName(fileName);
        return in;
View Full Code Here

    private InputStream getDownloadContent(boolean isTemplate) throws Exception {
        UserUtil.permissionCheck("view_case");
        String fileName = getText("entity.caseInstance.label") + ".csv";
        fileName = new String(fileName.getBytes(), "ISO8859-1");
        File file = new File(fileName);
        ICsvMapWriter writer = new CsvMapWriter(new FileWriter(file),
                CsvPreference.EXCEL_PREFERENCE);
        try {
            final String[] header = new String[] { getText("entity.id.label"),
                    getText("entity.priority_id.label"),
                    getText("entity.priority_name.label"),
                    getText("entity.status_id.label"),
                    getText("entity.status_name.label"),
                    getText("case.type_id.label"),
                    getText("case.type_name.label"),
                    getText("case.origin_id.label"),
                    getText("case.origin_name.label"),
                    getText("case.reason_id.label"),
                    getText("case.reason_name.label"),
                    getText("entity.subject.label"),
                    getText("entity.notes.label"),
                    getText("case.resolution.label"),
                    getText("entity.assigned_to_id.label"),
                    getText("entity.assigned_to_name.label") };
            writer.writeHeader(header);
            if (!isTemplate) {
                String[] ids = seleteIDs.split(",");
                for (int i = 0; i < ids.length; i++) {
                    String id = ids[i];
                    CaseInstance caseInstance = baseService.getEntityById(
                            CaseInstance.class, Integer.parseInt(id));
                    final HashMap<String, ? super Object> data1 = new HashMap<String, Object>();
                    data1.put(header[0], caseInstance.getId());
                    CasePriority casePriority = caseInstance.getPriority();
                    if (casePriority != null) {
                        data1.put(header[1], casePriority.getId());
                    } else {
                        data1.put(header[1], "");
                    }
                    data1.put(header[2],
                            CommonUtil.getOptionLabel(casePriority));
                    CaseStatus caseStatus = caseInstance.getStatus();
                    if (caseStatus != null) {
                        data1.put(header[3], caseStatus.getId());
                    } else {
                        data1.put(header[3], "");
                    }
                    data1.put(header[4], CommonUtil.getOptionLabel(caseStatus));
                    CaseType caseType = caseInstance.getType();
                    if (caseType != null) {
                        data1.put(header[5], caseType.getId());
                    } else {
                        data1.put(header[5], "");
                    }
                    data1.put(header[6], CommonUtil.getOptionLabel(caseType));
                    CaseOrigin caseOrigin = caseInstance.getOrigin();
                    if (caseOrigin != null) {
                        data1.put(header[7], caseOrigin.getId());
                    } else {
                        data1.put(header[7], "");
                    }
                    data1.put(header[8], CommonUtil.getOptionLabel(caseOrigin));
                    CaseReason caseReason = caseInstance.getReason();
                    if (caseReason != null) {
                        data1.put(header[9], caseReason.getId());
                    } else {
                        data1.put(header[9], "");
                    }
                    data1.put(header[10], CommonUtil.getOptionLabel(caseReason));
                    data1.put(header[11], CommonUtil
                            .fromNullToEmpty(caseInstance.getSubject()));
                    data1.put(header[12],
                            CommonUtil.fromNullToEmpty(caseInstance.getNotes()));
                    data1.put(header[13], CommonUtil
                            .fromNullToEmpty(caseInstance.getResolution()));
                    if (caseInstance.getAssigned_to() != null) {
                        data1.put(header[14], caseInstance.getAssigned_to()
                                .getId());
                        data1.put(header[15], caseInstance.getAssigned_to()
                                .getName());
                    } else {
                        data1.put(header[14], "");
                        data1.put(header[15], "");
                    }
                    writer.write(data1, header);
                }
            }
        } catch (Exception e) {
            throw e;
        } finally {
            writer.close();
        }

        InputStream in = new FileInputStream(file);
        this.setFileName(fileName);
        return in;
View Full Code Here

    private InputStream getDownloadContent(boolean isTemplate) throws Exception {
        UserUtil.permissionCheck("view_meeting");
        String fileName = getText("entity.meeting.label") + ".csv";
        fileName = new String(fileName.getBytes(), "ISO8859-1");
        File file = new File(fileName);
        ICsvMapWriter writer = new CsvMapWriter(new FileWriter(file),
                CsvPreference.EXCEL_PREFERENCE);
        try {
            final String[] header = new String[] { getText("entity.id.label"),
                    getText("entity.subject.label"),
                    getText("entity.status_id.label"),
                    getText("entity.status_name.label"),
                    getText("entity.start_date.label"),
                    getText("entity.end_date.label"),
                    getText("entity.related_object.label"),
                    getText("entity.related_record_id.label"),
                    getText("meeting.location.label"),
                    getText("entity.reminder_email.label"),
                    getText("entity.reminder_option_email_id.label"),
                    getText("entity.reminder_option_email_name.label"),
                    getText("entity.notes.label"),
                    getText("entity.assigned_to_id.label"),
                    getText("entity.assigned_to_name.label") };
            writer.writeHeader(header);
            if (!isTemplate) {
                String[] ids = seleteIDs.split(",");
                for (int i = 0; i < ids.length; i++) {
                    String id = ids[i];
                    Meeting meeting = baseService.getEntityById(Meeting.class,
                            Integer.parseInt(id));
                    final HashMap<String, ? super Object> data1 = new HashMap<String, Object>();
                    data1.put(header[0], meeting.getId());
                    data1.put(header[1],
                            CommonUtil.fromNullToEmpty(meeting.getSubject()));
                    MeetingStatus meetingStatus = meeting.getStatus();
                    if (meetingStatus != null) {
                        data1.put(header[2], meetingStatus.getId());
                    } else {
                        data1.put(header[2], "");
                    }
                    data1.put(header[3],
                            CommonUtil.getOptionLabel(meetingStatus));
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            Constant.DATE_TIME_FORMAT);
                    Date startDate = meeting.getStart_date();
                    if (startDate != null) {
                        data1.put(header[4], dateFormat.format(startDate));
                    } else {
                        data1.put(header[4], "");
                    }
                    Date endDate = meeting.getEnd_date();
                    if (endDate != null) {
                        data1.put(header[5], dateFormat.format(endDate));
                    } else {
                        data1.put(header[5], "");
                    }
                    data1.put(header[6], CommonUtil.fromNullToEmpty(meeting
                            .getRelated_object()));
                    if (meeting.getRelated_record() == null) {
                        data1.put(header[7], "");
                    } else {
                        data1.put(header[7],
                                String.valueOf(meeting.getRelated_record()));
                    }
                    data1.put(header[8],
                            CommonUtil.fromNullToEmpty(meeting.getLocation()));
                    data1.put(header[9], meeting.isReminder_email());
                    ReminderOption reminderOptionEmail = meeting
                            .getReminder_option_email();
                    if (reminderOptionEmail != null) {
                        data1.put(header[10], reminderOptionEmail.getId());
                    } else {
                        data1.put(header[10], "");
                    }
                    data1.put(header[11],
                            CommonUtil.getOptionLabel(reminderOptionEmail));
                    data1.put(header[12],
                            CommonUtil.fromNullToEmpty(meeting.getNotes()));
                    if (meeting.getAssigned_to() != null) {
                        data1.put(header[13], meeting.getAssigned_to().getId());
                        data1.put(header[14], meeting.getAssigned_to()
                                .getName());
                    } else {
                        data1.put(header[13], "");
                        data1.put(header[14], "");
                    }
                    writer.write(data1, header);
                }
            }
        } catch (Exception e) {
            throw e;
        } finally {
            writer.close();
        }

        InputStream in = new FileInputStream(file);
        this.setFileName(fileName);
        return in;
View Full Code Here

    private InputStream getDownloadContent(boolean isTemplate) throws Exception {
        UserUtil.permissionCheck("view_campaign");
        String fileName = getText("entity.campaign.label") + ".csv";
        fileName = new String(fileName.getBytes(), "ISO8859-1");
        File file = new File(fileName);
        ICsvMapWriter writer = new CsvMapWriter(new FileWriter(file),
                CsvPreference.EXCEL_PREFERENCE);
        try {
            final String[] header = new String[] {
                    getText("entity.id.label"),
                    getText("entity.name.label"),
                    getText("entity.status_id.label"),
                    getText("entity.status_name.label"),
                    getText("entity.type_id.label"),
                    getText("entity.type_name.label"),
                    getText("entity.start_date.label"),
                    getText("entity.end_date.label"),
                    getText("entity.currency_id.label"),
                    getText("entity.currency_name.label"),
                    getText("campaign.impressions.label"),
                    getText("campaign.budget.label"),
                    getText("campaign.expected_cost.label"),
                    getText("campaign.actual_cost.label"),
                    getText("campaign.expected_revenue.label"),
                    getText("campaign.expected_respone.label"),
                    getText("campaign.objective.label"),
                    getText("entity.notes.label"),
                    getText("entity.assigned_to.label") + " "
                            + getText("entity.id.label"),
                    getText("entity.assigned_to.label") + " "
                            + getText("entity.name.label") };
            writer.writeHeader(header);
            if (!isTemplate) {
                String[] ids = seleteIDs.split(",");
                for (int i = 0; i < ids.length; i++) {
                    String id = ids[i];
                    Campaign campaign = baseService.getEntityById(
                            Campaign.class, Integer.parseInt(id));
                    final HashMap<String, ? super Object> data1 = new HashMap<String, Object>();
                    data1.put(header[0], campaign.getId());
                    data1.put(header[1],
                            CommonUtil.fromNullToEmpty(campaign.getName()));
                    CampaignStatus campaignStatus = campaign.getStatus();
                    if (campaignStatus != null) {
                        data1.put(header[2], campaignStatus.getId());
                    } else {
                        data1.put(header[2], "");
                    }
                    data1.put(header[3],
                            CommonUtil.getOptionLabel(campaignStatus));
                    CampaignType campaignType = campaign.getType();
                    if (campaignType != null) {
                        data1.put(header[4], campaignType.getId());
                    } else {
                        data1.put(header[4], "");
                    }
                    data1.put(header[5],
                            CommonUtil.getOptionLabel(campaignType));
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            Constant.DATE_EDIT_FORMAT);
                    Date startDate = campaign.getStart_date();
                    if (startDate != null) {
                        data1.put(header[6], dateFormat.format(startDate));
                    } else {
                        data1.put(header[6], "");
                    }
                    Date endDate = campaign.getEnd_date();
                    if (endDate != null) {
                        data1.put(header[7], dateFormat.format(endDate));
                    } else {
                        data1.put(header[7], "");
                    }
                    if (campaign.getCurrency() != null) {
                        data1.put(header[8], campaign.getCurrency().getId());
                        data1.put(header[9], campaign.getCurrency().getName());
                    } else {
                        data1.put(header[8], "");
                        data1.put(header[9], "");
                    }
                    data1.put(header[10], campaign.getImpressions());
                    data1.put(header[11], campaign.getBudget());
                    data1.put(header[12], campaign.getExpected_cost());
                    data1.put(header[13], campaign.getActual_cost());
                    data1.put(header[14], campaign.getExpected_revenue());
                    data1.put(header[15], campaign.getExpected_respone());
                    data1.put(header[16],
                            CommonUtil.fromNullToEmpty(campaign.getObjective()));
                    data1.put(header[17],
                            CommonUtil.fromNullToEmpty(campaign.getNotes()));
                    if (campaign.getAssigned_to() != null) {
                        data1.put(header[18], campaign.getAssigned_to().getId());
                        data1.put(header[19], campaign.getAssigned_to()
                                .getName());
                    } else {
                        data1.put(header[18], "");
                        data1.put(header[19], "");
                    }
                    writer.write(data1, header);
                }
            }
        } catch (Exception e) {
            throw e;
        } finally {
            writer.close();
        }

        InputStream in = new FileInputStream(file);
        this.setFileName(fileName);
        return in;
View Full Code Here

TOP

Related Classes of org.supercsv.io.ICsvMapWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.