if (hasHeader.equals("Yes") || (hasHeader.equals("No"))) {
readline = ral.readLine();
String[] sFileFieldName = readline.split(tabDelimiter);
for (int k = 0; k < sFileFieldName.length; k++) {
v.add(new DDNameValue(sFileFieldName[k], sFileFieldName[k]));
}
}
dyn.setHeadervector(v);
dyn.setFilePath(path);
Collection importEntityList = new ArrayList();
Collection importIndividualList = new ArrayList();
Collection mapImport = new ArrayList();
mapImport.add(new DDNameValue("1", "--- Select ---"));
mapImport.add(new DDNameValue("2", "First Name"));
mapImport.add(new DDNameValue("3", "Middle Name"));
mapImport.add(new DDNameValue("4", "Last Name"));
mapImport.add(new DDNameValue("5", "Entity Name"));
mapImport.add(new DDNameValue("6", "ExternalID (Entity)"));
mapImport.add(new DDNameValue("6", "ExternalID (Individual)"));
mapImport.add(new DDNameValue("7", "Street1"));
mapImport.add(new DDNameValue("8", "Street2"));
mapImport.add(new DDNameValue("9", "City"));
mapImport.add(new DDNameValue("10", "State"));
mapImport.add(new DDNameValue("11", "Zipcode"));
mapImport.add(new DDNameValue("12", "Country"));
mapImport.add(new DDNameValue("13", "Title"));
mapImport.add(new DDNameValue("14", "Source (Individual)"));
mapImport.add(new DDNameValue("14", "Source (Entity)"));
mapImport.add(new DDNameValue("15", "Home Phone"));
mapImport.add(new DDNameValue("16", "Fax Phone"));
mapImport.add(new DDNameValue("17", "Main Phone"));
mapImport.add(new DDNameValue("18", "Mobile Phone"));
mapImport.add(new DDNameValue("19", "Other Phone"));
mapImport.add(new DDNameValue("20", "Pager Phone"));
mapImport.add(new DDNameValue("21", "Work Phone"));
mapImport.add(new DDNameValue("22", "Email"));
mapImport.add(new DDNameValue("23", "Website"));
mapImport.add(new DDNameValue("24", "Account Manager"));
mapImport.add(new DDNameValue("25", "Account Team"));
CustomField remote = cfh.create();
remote.setDataSource(dataSource);
Collection entityCustomFieldList = remote.getCustomFieldImportData("entity");
Collection individualCustomFieldList = remote.getCustomFieldImportData("individual");
if (entityCustomFieldList != null) {
Vector entityCustomField = new Vector(entityCustomFieldList);
if (entityCustomField != null) {
for (Enumeration e = entityCustomField.elements(); e.hasMoreElements();) {
HashMap hm = (HashMap) e.nextElement();
String title = hm.get("name").toString() + "(Entity)";
String listID = hm.get("customfieldid").toString();
String type = hm.get("fieldtype").toString();
mapImport.add(new DDNameValue(listID, title));
importEntityList.add(new DDNameValue(title, listID + "*" + type));
}
dyn.setCustomEntityList(importEntityList);
}
}
if (individualCustomFieldList != null) {
Vector indivdualCustomField = new Vector(individualCustomFieldList);
if (indivdualCustomField != null) {
for (Enumeration e = indivdualCustomField.elements(); e.hasMoreElements();) {
HashMap hm = (HashMap) e.nextElement();
String title = hm.get("name").toString() + "(Individual)";
String listID = hm.get("customfieldid").toString();
String type = hm.get("fieldtype").toString();
mapImport.add(new DDNameValue(listID, title));
importIndividualList.add(new DDNameValue(title, listID + "*" + type));
}
dyn.setCustomIndividualList(importIndividualList);
}
}
request.setAttribute("mapImport", mapImport);