Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\netbusiness\outboundlog\export.jsp
<% /****************************************************************************** * Copyright (c) 2000-2004 e-Deal * * e-Deal S.A. * 55 rue Brillat Savarin * 75013 Paris * France * * T: +33 (0)1 53 80 80 30 * F: +33 (0)1 73 01 69 77 * http://www.e-deal.com * * La diffusion de ce code source sous quelque forme que ce soit sans * l'autorisation de E-DEAL est interdite. * * Vous êtes autorisés à modifier ce code source uniquement pour votre usage * propre et sous réserve que les mentions de copyright demeurent intactes. * * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour * responsable des dommages pouvant résulter de l'utilisation de ce code * source. * * ******************************************************************************/ %><%@ page language="java"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.grid.GridData" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.InBoundLogBean" %> <%@ page import="java.util.Vector"%> <%@ page import="com.edeal.frontline.FlContext"%> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.PersonBean" %> <%@ page import="com.edeal.frontline.SilhouetteBean" %> <%@ page import="java.util.Hashtable" %> <%@ page import="java.util.Date" %> <%@ page import="com.edeal.frontline.OutBoundLogBean" %> <%@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(); response.setHeader("Content-Disposition", "attachment;filename=logs.xls"); Vector vectQuery = new Vector(); String pID = Utils.getRequestParameter(context, request, "id"); String beginDate = flRequest.getSearchCriteria("beginDate") ; String endDate = flRequest.getSearchCriteria("endDate") ; if (beginDate != null) vectQuery.addElement("OblDate >= " + Utils.formatToSQL(context, Utils.formatFromWeb(beginDate))); if (endDate != null) vectQuery.addElement("OblDate <= " + Utils.formatToSQL(context, Utils.formatFromWeb(endDate))); if(pID != null) { vectQuery.addElement("IblVisitorID = " + Utils.formatToSQL(context, pID)); } Vector objs = null; String[] fields = {"OblID", "OblOriID", "OblBrowser", "OblOdrID:OdrNam", "OblRemoteIP", "OblTyvID", "OblVisitorID", "OblWopID", "OblOri", "OblCookie", "OblDate", "OblOriID:OriName", "OblWopID:WopNam"}; String[] orderBy = {"OblDate DESC"}; if(vectQuery.size() > 0) { String[][] query = {{null}}; query[0] = (String[])vectQuery.toArray(new String[1]); objs = OutBoundLogBean.listSummary(session, fields, query, orderBy); } else { objs = OutBoundLogBean.listSummary(session, fields, orderBy); } boolean hasEntries = objs.size() > 0; DataDictionary dico = context.getDataDictionary(); String personID = Utils.getTableID(context, "Person"); Hashtable vis = new Hashtable(); if(hasEntries) { Vector silID = new Vector(); Vector perID = new Vector(); for(int i = 0; i < objs.size(); i++) { Hashtable row = (Hashtable)objs.elementAt(i); String visType = (String)row.get("OblTyvID"); String visID = (String)row.get("OblVisitorID"); if(personID.equals(visType) && !perID.contains(visID)) { perID.addElement(visID); } else if(visType != null && !silID.contains(visID)) { silID.addElement(visID); } } if(perID.size() > 0) { String[] perFields = {"PerID", "PerFstName", "PerName"}; String[][] query = new String[perID.size()][1]; for(int i = 0; i < perID.size(); i++) { query[i][0] = "PerID = " + Utils.formatToSQL(context, (String)perID.elementAt(i)); } Vector per = PersonBean.listSummary(session, perFields, query); for(int i = 0; i < per.size(); i++) { Hashtable row = (Hashtable)per.elementAt(i); String visName = ""; visName += row.get("PerFstName") == null ? "" : (String)row.get("PerFstName") + " "; visName += row.get("PerName") == null ? "" : (String)row.get("PerName"); String[] visNfo = {visName.trim(), "Person"}; vis.put((String)row.get("PerID"), visNfo); } } if(silID.size() > 0) { String[] silFields = {"SilID", "SilFstName", "SilName"}; String[][] query = new String[silID.size()][1]; for(int i = 0; i < silID.size(); i++) { query[i][0] = "SilID = " + Utils.formatToSQL(context, (String)silID.elementAt(i)); } Vector sil = SilhouetteBean.listSummary(session, silFields, query); for(int i = 0; i < sil.size(); i++) { Hashtable row = (Hashtable)sil.elementAt(i); String visName = ""; visName += row.get("SilFstName") == null ? "" : (String)row.get("SilFstName") + " "; visName += row.get("SilName") == null ? "" : (String)row.get("SilName"); String[] visNfo = {visName.trim(), "Silhouette"}; vis.put((String)row.get("SilID"), visNfo); } } } String[][] labels = {{"F2019", "Date"}, {"F000F", "Heure"}, {"F0025", "Porte"}, {"F202A", "Origine"}, {"F0015", "Origine connue"}, {"F0017", "Opération web"}, {"F0018", "Visiteur"}, {"F001B", "Type de visiteur"}, {"F001C", "Cookie"}, {"F0019", "Adresse IP"}, {"F001A", "Navigateur"}}; for(int i = 0; i < labels.length; i++) { out.write((i == 0 ? "" : "\t") + Utils.getMessage(session, labels[i][0], labels[i][1])); } out.write("\n"); for(int i = 0; i < objs.size(); i++) { Hashtable obj = (Hashtable)objs.elementAt(i); String[] visNfo = null; String visID = (String)obj.get("OblVisitorID"); if(visID != null) { visNfo = (String[])vis.get(visID); } out.write(Utils.formatToWebDate(session, (Date)obj.get("OblDate"), true) + "\t"); out.write(Utils.formatToWebTime(session, (Date)obj.get("OblDate"), true) + "\t"); out.write((obj.get("OblOdrID:OdrNam") == null ? "" : (String)obj.get("OblOdrID:OdrNam")) + "\t"); out.write((obj.get("OblOri") == null ? "" : (String)obj.get("OblOri")) + "\t"); out.write((obj.get("OblOriID:OriName") == null ? "" : (String)obj.get("OblOriID:OriName")) + "\t"); out.write((obj.get("OblWopID:WopNam") == null ? "" : obj.get("OblWopID:WopNam")) + "\t"); if(visNfo != null) { out.write((visNfo[0] == null ? "" : visNfo[0]) + "\t"); out.write((visNfo[1] == null ? "" : visNfo[1]) + "\t"); } else { out.write("\t\t"); } out.write((obj.get("OblCookie") == null ? "" : (String)obj.get("OblCookie")) + "\t"); out.write((obj.get("OblRemoteIP") == null ? "" : (String)obj.get("OblRemoteIP")) + "\t"); out.write((obj.get("OblBrowser") == null ? "" : (String)obj.get("OblBrowser")) + "\n"); } %> <% /****************************************************************************** * CVS Log File - This is no longer maintained! * * Revision 1.1 2004/07/23 18:20:04 brian * Initial Revision * *****************************************************************************/ %>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de