throw new ServletException(e);
}
for (int i = 0; i < rawMarketingList.size(); i++) {
HashMap currentList = (HashMap)rawMarketingList.get(i);
marketingListCollection.add(new LabelValueBean((String)currentList.get("title"), ((Number)currentList.get("listid")).toString()));
}
for (int i = 0; i < entityVOs.size(); i++) {
// build up the collections with the unique values from each VO.
EntityVO entity = (EntityVO)entityVOs.get(i);
LabelValueBean currentName = new LabelValueBean(entity.getName(), String.valueOf(i));
boolean flag = false;
for (int j = 0; !flag && (j < nameCollection.size()); j++) {
if (((LabelValueBean)nameCollection.get(j)).getLabel().equals(currentName.getLabel())) {
flag = true;
}
}
if (!flag) {
nameCollection.add(currentName);
}
LabelValueBean currentId = new LabelValueBean(String.valueOf(entity.getContactID()), String.valueOf(entity.getContactID()));
idCollection.add(currentId);
String currentId2String = entity.getExternalID();
LabelValueBean currentId2 = new LabelValueBean(currentId2String, String.valueOf(i));
boolean flag2 = false;
for (int j = 0; !flag2 && (j < id2Collection.size()); j++) {
String id2CollectionLabel = ((LabelValueBean)id2Collection.get(j)).getLabel();
if ((currentId2String == null) || // if string is null for some reason
(currentId2String.length() == 0) || // if the length == 0
(id2CollectionLabel.equals(currentId2String))) // if it is equal to an existing one
{
flag2 = true; // Don't add it.
}
}
if (!flag2) {
id2Collection.add(currentId2);
}
LabelValueBean currentAccountManager = new LabelValueBean(entity.getAcctMgrName(), String.valueOf(entity.getAccManager()));
if (!accountManagerCollection.contains(currentAccountManager) &&
!(currentAccountManager.getValue().equals("0") || currentAccountManager.getLabel().equals(""))) {
accountManagerCollection.add(currentAccountManager);
}
LabelValueBean currentAccountTeam = new LabelValueBean(entity.getAcctTeamName(), String.valueOf(entity.getAccTeam()));
if (!accountTeamCollection.contains(currentAccountTeam) &&
!(currentAccountTeam.getValue().equals("0") || currentAccountTeam.getLabel().equals(""))) {
accountTeamCollection.add(currentAccountTeam);
}
LabelValueBean currentSource = new LabelValueBean(entity.getSourceName(), String.valueOf(entity.getSource()));
if (!sourceCollection.contains(currentSource) &&
!(currentSource.getValue().equals("") || currentSource.getLabel().equals(""))) {
sourceCollection.add(currentSource);
}
} // end for(int i = 0; i < entityVOs.size(); i++)
// populate bean from AddressVO
for (int i=0; i < addressVOs.size(); i++) {
AddressVO address = (AddressVO)addressVOs.get(i);
StringBuffer addressLabel = new StringBuffer();
// I know, bad programmer, HTML stuff shouldn't be here.
// I blame the guy who designed the prototype.
// Anyway its only two little <br> tags, it won't hurt anyone.
// Plus it will make the other screen look "nice."
addressLabel.append(address.getStreet1()+"<br>");
addressLabel.append(address.getStreet2()+"<br>");
addressLabel.append(address.getCity()+", ");
addressLabel.append(address.getStateName()+", ");
addressLabel.append(address.getZip()+", ");
addressLabel.append(address.getCountryName());
LabelValueBean currentAddress = new LabelValueBean(addressLabel.toString(), String.valueOf(address.getAddressID()));
addressCollection.add(currentAddress);
} // end for (int i=0; i < addressVOs.size(); i++)
// populate bean with all MOC vos
for (int i = 0; i < methodOfContactVOs.size(); i++) {
MethodOfContactVO moc = (MethodOfContactVO)methodOfContactVOs.get(i);
StringBuffer mocLabel = new StringBuffer();
mocLabel.append(moc.getMocTypeName());
mocLabel.append(": ");
mocLabel.append(moc.getContent());
LabelValueBean currentMOC = new LabelValueBean(mocLabel.toString(), String.valueOf(moc.getMocID()));
methodOfContactCollection.add(currentMOC);
} // end for (int i = 0; i < methodOfContactVOs.size(); i++)
// populate bean with all related Individual vos
for (int i = 0; i < individualVOs.size(); i++) {
IndividualVO individual = (IndividualVO)individualVOs.get(i);
StringBuffer individualLabel = new StringBuffer();
individualLabel.append(individual.getFirstName());
individualLabel.append(" ");
individualLabel.append(individual.getLastName());
LabelValueBean currentIndividual = new LabelValueBean(individualLabel.toString(), String.valueOf(individual.getContactID()));
individualNameCollection.add(currentIndividual);
} // end for (int i = 0; i < individualVOs.size(); i++)
mergeEntityDetails.set("nameCollection", nameCollection);
mergeEntityDetails.set("idCollection", idCollection);