%
/******************************************************************************
* 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" contentType="text/html; charset=UTF-8"%>
<%@ page import="com.edeal.frontline.navigation.FlRequest" %>
<%@ page import="com.edeal.frontline.FlContext" %>
<%@ page import="com.edeal.frontline.Utils" %>
<%@ page import="java.util.Vector" %>
<%@ page import="com.edeal.frontline.FieldNotInitializedException" %>
<%@page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
<%@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();
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
// String multivalSeparator = null;
String initAttID = null;
String initAttFileName = null;
String idColName = null;
String fileNameColName = null;
String id = null;
String multivalSeparator = flRequest.getParameter("multivalSeparator");
if (isMultipart) {
//multivalSeparator = (String)flRequest.getAttribute("multivalSeparator");
initAttID = (String)flRequest.getAttribute("initAttID");
initAttFileName = (String)flRequest.getAttribute("initAttFileName");
idColName = (String)flRequest.getAttribute("IDColName");
fileNameColName = (String)flRequest.getAttribute("FileNameColName");
id = (String)flRequest.getAttribute("id");
} else {
// multivalSeparator = flRequest.getParameter("multivalSeparator");
initAttID = flRequest.getParameter("initAttID");
initAttFileName = flRequest.getParameter("initAttFileName");
idColName = flRequest.getParameter("IDColName");
fileNameColName = flRequest.getParameter("FileNameColName");
id = flRequest.getParameter("id");
}
if (multivalSeparator == null) {
multivalSeparator = "|";
}
String attachID = null;
try {
if (Attachment != null) {
attachID = Attachment.getID();
}
} catch (FieldNotInitializedException fnie) {
}
Vector oldID = new Vector();
if (initAttID != null) {
oldID = Utils.explodeList(initAttID, multivalSeparator);
}
Vector oldNames = new Vector();
if (initAttFileName != null) {
oldNames = Utils.explodeList(initAttFileName, multivalSeparator);
}
if (attachID != null && !oldID.contains(attachID)) {
oldID.addElement(attachID);
try {
oldNames.addElement(Attachment.getAttDesc());
} catch (FieldNotInitializedException fnie) {
try {
oldNames.addElement(Attachment.getAttFileName());
} catch (FieldNotInitializedException fnie2) {
}
}
}
if (id != null && oldID.contains(id)) {
int index = oldID.indexOf(id);
Vector ids = new Vector();
Vector names = new Vector();
for (int i = 0; i < oldID.size(); i++) {
if (i != index) {
ids.addElement(oldID.elementAt(i));
names.addElement(oldNames.elementAt(i));
}
}
oldID = ids;
oldNames = names;
}
%>
">