int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
LiteratureForm literatureform = new LiteratureForm();
MarketingFacadeHome home = (MarketingFacadeHome)CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome", "MarketingFacade");
MarketingFacade remote = (MarketingFacade)home.create();
remote.setDataSource(dataSource);
LiteratureDetails literatureDetails = remote.getLiteratureDetails(activityid,individualId);
literatureform.setAssignedtoid("" + literatureDetails.getAssignedtoid());
literatureform.setDeliverymethodid("" + literatureDetails.getDeliveryid());
literatureform.setEntityid("" + literatureDetails.getEntityid());
literatureform.setIndividualid("" + literatureDetails.getIndividualid());
literatureform.setStatusid("" + literatureDetails.getStatusid());
literatureform.setDetail(literatureDetails.getDetail());
literatureform.setLiteraturename(literatureDetails.getLiteratureName());
literatureform.setLiteratureid(literatureDetails.getLiteratureId());
literatureform.setTitle(literatureDetails.getTitle());
literatureform.setAssignedtoname(literatureDetails.getAssignedtoname());
literatureform.setIndividualname(literatureDetails.getIndividualname());
literatureform.setEntityname(literatureDetails.getEntityname());
Vector literaturenamevec = new Vector();
String strLiteratureid = (String)literatureDetails.getLiteratureId();
String strLiteraturename = (String)literatureDetails.getLiteratureName();
String strnames = "";
if (strLiteratureid != null && !strLiteratureid.equals(""))
{
StringTokenizer stid = new StringTokenizer(strLiteratureid,",");
StringTokenizer stName = new StringTokenizer(strLiteraturename,",");
String strId = "";
String strName = "";
while(stid.hasMoreTokens())
{
strId = stid.nextToken();
strName = stName.nextToken();
if (!strId.equals("")){
int id = Integer.parseInt(strId);
literaturenamevec.add(new DDNameValue(id,strName));
}
}
}
literatureform.setLiteraturenamevec(literaturenamevec);
literatureform.setNames(strnames);
if (literatureDetails.getDuebydate() != null)
{
Timestamp date = (Timestamp)literatureDetails.getDuebydate();
String strMonth = "" + (date.getMonth() + 1);
String strDay = "" + date.getDate();
String strYear = "" + (date.getYear() + 1900);
String strHours = "" + date.getHours();
String strMins = "" + date.getMinutes();
int hhmm[] = new int[2];
hhmm[0] = Integer.parseInt(strHours.trim());
hhmm[1] = Integer.parseInt(strMins.trim());
String strTime = CVUtility.convertTime24HrsFormatToStr(hhmm);
literatureform.setDuebymonth(strMonth);
literatureform.setDuebyday(strDay);
literatureform.setDuebyyear(strYear);
literatureform.setDuebytime(strTime);
literatureform.setSelduebytime(strTime);
}
Vector deliverymethodlist = remote.getAllDeliveryMethod();
request.setAttribute("deliverymethodlist", deliverymethodlist);
Vector activitystatuslist = remote.getAllActivityStatus();
request.setAttribute("activitystatuslist", activitystatuslist);
form = (ActionForm)literatureform;
// set request