%
/******************************************************************************
* 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 session="true" import="com.edeal.frontline.*,java.util.*"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="com.edeal.frontline.FlLocale" %>
<%@ page import="com.edeal.frontline.FieldNotInitializedException" %>
<%@ page import="java.util.TimeZone" %>
<%@ page import="java.util.GregorianCalendar" %>
<%@ page import="com.edeal.frontline.InteractionBean" %>
<%@ page import="java.util.Hashtable" %>
<%@ page import="com.edeal.frontline.ActorBean" %>
<%@ page import="com.edeal.frontline.CorrespondentBean" %>
<%@ page import="com.edeal.frontline.navigation.FlRequest" %>
<%@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 id = null;
try {
id = Interaction.getIntID();
}catch (FieldNotInitializedException e){}
if (id == null) {
Interaction = (InteractionBean) session.getAttribute("Interaction");
pageContext.setAttribute("Interaction", Interaction);
}
String fromDate = Utils.getRequestParameter(request,"fromDate",false);
Date baseDate = new Date();
if (fromDate != null) {
baseDate = Utils.formatDateFromWeb(session,fromDate);
Interaction.setIntDate(baseDate);
}else {
try {
baseDate = Interaction.getIntDate();
}catch (FieldNotInitializedException e){}
}
try {
id = Interaction.getIntID();
}catch (FieldNotInitializedException e){}
String op = Utils.getRequestParameter(request,"op",false);
if ( op != null && op.equals("removeActor") ){
String actID = Utils.getRequestParameter(request,"actID",false);
try {
Vector vectAct = Interaction.getIntActID();
if (vectAct.contains(actID)) vectAct.remove(actID);
Interaction.setIntActID(vectAct);
}catch (FieldNotInitializedException e){}
}else if ( op != null && op.equals("addActor") ){
String actID = Utils.getRequestParameter(request,"actID",false);
try {
Vector vectAct = Interaction.getIntActID();
if (!vectAct.contains(actID)) vectAct.addElement(actID);
Interaction.setIntActID(vectAct);
}catch (FieldNotInitializedException e){}
}else if ( op != null && op.equals("removeCor") ){
String corID = Utils.getRequestParameter(request,"corID",false);
try {
Vector vectCor = Interaction.getIntCorID();
if (vectCor.contains(corID)) vectCor.remove(corID);
Interaction.setIntCorID(vectCor);
}catch (FieldNotInitializedException e){}
}else if ( op != null && op.equals("addPerson") ){
String perID = Utils.getRequestParameter(request,"perID",false);
Vector vectCor = new Vector();
try {
vectCor = Interaction.getIntCorID();
}catch (FieldNotInitializedException e){}
String[] keys = {"CorPerID"};
String[] values = {perID};
String corID = CorrespondentBean.getCorrespondentIDBy(context, keys, values);
if (!vectCor.contains(corID)) {
vectCor.addElement(corID);
Interaction.setIntCorID(vectCor);
}
}
String actorID = (String)session.getAttribute("actorID");
try {
Vector vectActor = Interaction.getIntActID();
}catch (FieldNotInitializedException e){
Vector vectActor = new Vector();
vectActor.addElement(actorID);
Interaction.setIntActID(vectActor);
}
session.setAttribute("Interaction",Interaction);
%>