<%@ page language="java" contentType="text/plain;charset=UTF-8"%> <%@page session="true" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="java.util.Vector" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.Utils" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String typ = (String)flRequest.getAttribute("typ"); String salesModel = context.getContextParameter("SalesModel"); Vector results = (Vector)flRequest.getAttribute("results"); String imageStr = ""; if (results == null) { results = new Vector(); } int size = results.size(); %> var toAdd = ""; <% if (size == 0) { %> toAdd = "
"; <% } else if ("per".equals(typ)) { %> toAdd = '
'; toAdd += ''; toAdd += ''; <% if (!"B2C".equals(salesModel)) { %> toAdd += ''; <% } %> toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; <% for (int cnt = 0; cnt < size; ++cnt) { Hashtable row = (Hashtable)results.elementAt(cnt); StringBuffer name = new StringBuffer(); try { name.append(row.get("PerCivID:Val") + " "); } catch (Exception e) { } String tmpFstName = (String)row.get("PerFstName"); if (tmpFstName != null) { name.append(Utils.formatToJavascript(tmpFstName)+ " "); } String tmpName = (String)row.get("PerName"); if (tmpName != null && !"".equals(tmpName)) { name.append(Utils.formatToJavascript(tmpName)); } String mailAddr = (String)row.get("PerMail"); if (mailAddr == null) { mailAddr = ""; } String perID = (String)row.get("PerID"); if (perID == null) { perID = ""; } StringBuffer mail = new StringBuffer(); if (!"".equals(mailAddr)) { mail.append("(\\'"); mail.append(Utils.formatToJavascript(name.toString())); mail.append(" <" + mailAddr + ">\\');"); } String stdNumber = (String)row.get("PerEntID:EntPhone"); if (stdNumber == null) { stdNumber = ""; } StringBuffer doCallStd = new StringBuffer(); if (!"".equals(stdNumber)) { doCallStd.append("javascript:doCall(\\'"); doCallStd.append(stdNumber); doCallStd.append("\\', \\'Enterprise\\', \\'"); doCallStd.append((String)row.get("PerEntID")); doCallStd.append("\\');"); } String directNumber = (String)row.get("PerPhone"); if (directNumber == null) { directNumber = ""; } StringBuffer doCallDirect = new StringBuffer(); if (!"".equals(directNumber)) { doCallDirect.append("javascript:doCall(\\'"); doCallDirect.append(directNumber); doCallDirect.append("\\', \\'Person\\', \\'"); doCallDirect.append((String)row.get("PerID")); doCallDirect.append("\\');"); } String mobileNumber = (String)row.get("PerMobile"); if (mobileNumber == null) { mobileNumber = ""; } StringBuffer doCallMobile = new StringBuffer(); if (!"".equals(mobileNumber)) { doCallMobile.append("javascript:doCall(\\'"); doCallMobile.append(mobileNumber); doCallMobile.append("\\', \\'Person\\', \\'"); doCallMobile.append((String)row.get("PerID")); doCallMobile.append("\\');"); } String lignCssClass = (cnt%2 == 0) ? "even" : "odd" ; %> toAdd += ' bean\">'; <% String read_person ="javascript:read_person(\\'"; read_person +=row.get("PerID"); read_person +="\\');"; String read_enterprise ="javascript:read_enterprise(\\'"; read_enterprise +=row.get("PerEntID"); read_enterprise +="\\');"; %> toAdd += ''; <% if (!"B2C".equals(salesModel)) { %> toAdd += ''; <% } %> toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; <% } %> toAdd += '
\"><%= Utils.formatToJavascript(Utils.formatToWeb(name.toString(), false)) %>\"><%= Utils.formatToJavascript(Utils.formatToWeb(row.get("PerEntID:EntCorpName"), false)) %>\"><%= "".equals(mailAddr) ? "" : imageStr %>\"><%= "".equals(mailAddr) ? "" : imageStr %>\"><%= "".equals(mailAddr) ? "" : imageStr %>\"><%= "".equals(stdNumber) ? "" : stdNumber %>\"><%= "".equals(directNumber) ? "" : directNumber %>\"><%= "".equals(mobileNumber) ? "" : mobileNumber %>\"><%= "".equals(mailAddr) ? "" : mailAddr %>
'; <% } else if ("jou".equals(typ)) { %> toAdd += '
'; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; <% for (int cnt = 0; cnt < size; ++cnt) { Hashtable row = (Hashtable)results.elementAt(cnt); StringBuffer name = new StringBuffer(); try { name.append(row.get("JouCivID:Val") + " "); } catch (Exception e) { } String tmpName = (String)row.get("JouName"); if (tmpName != null && !"".equals(tmpName)) { name.append(Utils.formatToJavascript(tmpName) + " "); } tmpName = (String)row.get("JouFstName"); if (tmpName != null) { name.append(Utils.formatToJavascript(tmpName)); } String mailAddr = (String)row.get("JouPerMail"); if (mailAddr == null) { mailAddr = ""; } StringBuffer mail = new StringBuffer(); if (!"".equals(mailAddr)) { mail.append("(\\'"); mail.append(Utils.formatToJavascript(name.toString())); mail.append(" <" + mailAddr + ">\\');"); } String stdNumber = (String)row.get("JouProPhone"); if (stdNumber == null) { stdNumber = ""; } StringBuffer doCallStd = new StringBuffer(); if (!"".equals(stdNumber)) { doCallStd.append("javascript:doCall(\\'"); doCallStd.append(stdNumber); doCallStd.append("\\', \\'Journalist\\', \\'"); doCallStd.append((String)row.get("JouID")); doCallStd.append("\\');"); } String directNumber = (String)row.get("JouPerPhone"); if (directNumber == null) { directNumber = ""; } StringBuffer doCallDirect = new StringBuffer(); if (!"".equals(directNumber)) { doCallDirect.append("javascript:doCall(\\'"); doCallDirect.append(directNumber); doCallDirect.append("\\', \\'Journalist\\', \\'"); doCallDirect.append((String)row.get("JouID")); doCallDirect.append("\\');"); } String mobileNumber = (String)row.get("JouPerMobile"); if (mobileNumber == null) { mobileNumber = ""; } StringBuffer doCallMobile = new StringBuffer(); if (!"".equals(mobileNumber)) { doCallMobile.append("javascript:doCall(\\'"); doCallMobile.append(mobileNumber); doCallMobile.append("\\', \\'Journalist\\', \\'"); doCallMobile.append((String)row.get("JouID")); doCallMobile.append("\\');"); } String lignCssClass = (cnt%2 == 0) ? "even" : "odd" ; String read_journalist ="javascript:read_journalist(\\'"; read_journalist +=row.get("JouID"); read_journalist +="\\');"; %> toAdd += ' bean\">'; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; <% } %> toAdd += '
\"><%= Utils.formatToJavascript(Utils.formatToWeb(name.toString(), false)) %>\"><%= "".equals(mailAddr) ? "" : imageStr %>\"><%= "".equals(mailAddr) ? "" : imageStr %>\"><%= "".equals(mailAddr) ? "" : imageStr %>\"><%= "".equals(stdNumber) ? "" : stdNumber %>\"><%= "".equals(directNumber) ? "" : directNumber %>\"><%= "".equals(mobileNumber) ? "" : mobileNumber %>" %>\"><%= "".equals(mailAddr) ? "" : mailAddr %>
'; <% } else if ("act".equals(typ)){ %> toAdd += '
'; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; <% int realCnt = 0; for (int cnt = 0; cnt < size; ++cnt) { Hashtable row = (Hashtable)results.elementAt(cnt); StringBuffer name = new StringBuffer(); try { name.append(row.get("ActCivID:Val") + " "); } catch (Exception e) { } String tmpName = (String)row.get("ActName"); if ("Anonymous".equals(tmpName) || "System".equals(tmpName)) { continue; } if (tmpName != null && !"".equals(tmpName)) { name.append(Utils.formatToWeb(tmpName,false) + " "); } tmpName = (String)row.get("ActFstName"); if (tmpName != null) { name.append(Utils.formatToWeb(tmpName,false)); } String mailAddr = (String)row.get("ActMail"); if (mailAddr == null) { mailAddr = ""; } StringBuffer mail = new StringBuffer(); if (!"".equals(mailAddr)) { mail.append("(\\'"); mail.append(Utils.formatToJavascript(name.toString())); mail.append(" <" + mailAddr + ">\\');"); } String stdNumber = (String)row.get("ActSitID:SitPhone"); if (stdNumber == null) { stdNumber = ""; } StringBuffer doCallStd = new StringBuffer(); if (!"".equals(stdNumber)) { doCallStd.append("javascript:doCall(\\'"); doCallStd.append(stdNumber); doCallStd.append("\\', \\'Actor\\', \\'"); doCallStd.append((String)row.get("ActID")); doCallStd.append("\\');"); } String directNumber = (String)row.get("ActPhone"); if (directNumber == null) { directNumber = ""; } StringBuffer doCallDirect = new StringBuffer(); if (!"".equals(directNumber)) { doCallDirect.append("javascript:doCall(\\'"); doCallDirect.append(directNumber); doCallDirect.append("\\', \\'Actor\\', \\'"); doCallDirect.append((String)row.get("ActID")); doCallDirect.append("\\');"); } String mobileNumber = (String)row.get("ActMobile"); if (mobileNumber == null) { mobileNumber = ""; } StringBuffer doCallMobile = new StringBuffer(); if (!"".equals(mobileNumber)) { doCallMobile.append("javascript:doCall(\\'"); doCallMobile.append(mobileNumber); doCallMobile.append("\\', \\'Actor\\', \\'"); doCallMobile.append((String)row.get("ActID")); doCallMobile.append("\\');"); } String lignCssClass = (cnt%2 == 0) ? "even" : "odd" ; String read_actor ="javascript:read_actor(\\'"; read_actor +=row.get("ActID"); read_actor +="\\');"; String read_site ="javascript:read_site(\\'"; read_site +=row.get("ActSitID"); read_site +="\\');"; %> toAdd += ' bean\">'; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; toAdd += ''; <% realCnt++; } %> toAdd += '
\"><%= Utils.formatToJavascript(name.toString()) %>\"><%= Utils.formatToJavascript((String) row.get("ActSitID:SitName")) %>\"><%= "".equals(mailAddr) ? "" : imageStr %>\"><%= "".equals(mailAddr) ? "" : imageStr %>\"><%= "".equals(mailAddr) ? "" : imageStr %>\"><%= "".equals(stdNumber) ? "" : stdNumber %>\"><%= "".equals(directNumber) ? "" : directNumber %>\"><%= "".equals(mobileNumber) ? "" : mobileNumber %>" %>\"><%= "".equals(mailAddr) ? "" : mailAddr %>
'; <% } %> document.getElementById('list').innerHTML = toAdd;