%
/******************************************************************************
* Copyright (c) 2000-2008 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.*,com.edeal.frontline.custom.*,org.w3c.dom.Node,java.util.*"%>
<%@ page import="com.edeal.frontline.navigation.FlRequest" %>
<%@ page import="com.edeal.frontline.FieldNotInitializedException" %>
<%@ page import="com.edeal.frontline.AccessDeniedException" %>
<%@ page import="com.edeal.frontline.PopulationEntryBean" %>
<%@ page import="com.edeal.frontline.ObjectsBean" %>
<%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %>
<%
//Recuperation du context
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 lngID = FlLocale.getInstance(session).getLanguageID();
String popID = flRequest.getRequestParameterOrAttribute("popID");
String objsql = flRequest.getRequestParameterOrAttribute("objsql");
String fieldID = flRequest.getRequestParameterOrAttribute("fieldID");
PopulationBean Popbean = new PopulationBean(popID,context);
String paramObjectID = null;
Vector paramObjectIDs = new Vector();
String paramObject = null;
String paramobjsql = null;
Vector VectObject = new Vector();
Vector VectObjectShadow = new Vector();
Vector objects = new Vector();
ObjectsBean objetBean =null;
String _Label_=null;
//si la langue dans fllocal est null alors français pas defaut
if(lngID == null) {
try {
lngID = dico.getRefIdByCode("Lng", "Val", "fr_FR");
} catch (Exception ex) {
}
}
//Recuperation des paramétres
//recuperer la liste des objets à faire
if (Popbean.isPopIsPer()){
paramObject ="Person";
try {
_Label_ = Utils.getMessage(session, paramObject, paramObject);
paramObjectID= dico.getTable("sql",_Label_).getID();
paramObjectIDs.addElement(paramObjectID);
ObjectsBean objBean = new ObjectsBean(paramObjectID,context);
paramobjsql=objBean.getObjSql();
paramObject = objBean.getObjDisplay();
logger.warn("dans le try catch le paramObject is " + paramObject);
} catch (FieldNotInitializedException e) {
}
VectObject.addElement((String)paramObject);
VectObjectShadow.addElement(paramobjsql + "|PpePerID");
}
if (Popbean.isPopIsJou()) {
paramObject ="Journalist";
try {
_Label_ = Utils.getMessage(session, paramObject, paramObject);
paramObjectID= dico.getTable("sql",_Label_).getID();
paramObjectIDs.addElement(paramObjectID);
ObjectsBean objBean = new ObjectsBean(paramObjectID,context);
paramobjsql=objBean.getObjSql();
paramObject = objBean.getObjDisplay();
logger.warn("dans le try catch le paramObject is " + paramObject);
} catch (FieldNotInitializedException e){
}
VectObject.addElement(paramObject);
VectObjectShadow.addElement(paramobjsql + "|PpeJouID");
}
if (Popbean.isPopIsEnt()) {
paramObject ="Enterprise";
try {
_Label_ = Utils.getMessage(session, paramObject, paramObject);
paramObjectID= dico.getTable("sql",_Label_).getID();
paramObjectIDs.addElement(paramObjectID);
ObjectsBean objBean = new ObjectsBean(paramObjectID,context);
paramobjsql=objBean.getObjSql();
paramObject = objBean.getObjDisplay();
logger.warn("dans le try catch le paramObject is " + paramObject);
} catch (FieldNotInitializedException e){
}
VectObject.addElement(paramObject);
VectObjectShadow.addElement(paramobjsql+"|PpeEntID");
}
if (Popbean.isPopIsSup()) {
paramObject ="Support";
try {
_Label_ = Utils.getMessage(session, paramObject, paramObject);
paramObjectID= dico.getTable("sql",_Label_).getID();
paramObjectIDs.addElement(paramObjectID);
ObjectsBean objBean = new ObjectsBean(paramObjectID,context);
paramobjsql = objBean.getObjSql();
paramObject = objBean.getObjDisplay();
logger.warn("dans le try catch le paramObject is " + paramObject);
}catch (FieldNotInitializedException e){}
VectObject.addElement(paramObject);
VectObjectShadow.addElement(paramobjsql+"|PpeSupID");
}
if (Popbean.isPopIsSil()){
paramObject ="Silhouette";
try {
_Label_ = Utils.getMessage(session, paramObject, paramObject);
paramObjectID= dico.getTable("sql",_Label_).getID();
paramObjectIDs.addElement(paramObjectID);
ObjectsBean objBean = new ObjectsBean(paramObjectID,context);
paramobjsql = objBean.getObjSql();
paramObject = objBean.getObjDisplay();
} catch (FieldNotInitializedException e) {
}
VectObject.addElement((String)paramObject);
VectObjectShadow.addElement(paramobjsql+"|PpeSilID");
}
try {
paramObjectID = Popbean.getPopObj1();
if (paramObjectID != null){
paramObjectIDs.addElement(paramObjectID);
ObjectsBean objBean = new ObjectsBean(paramObjectID,context);
paramobjsql=objBean.getObjSql();
paramObject = objBean.getObjDisplay();
VectObject.addElement(paramObject);
VectObjectShadow.addElement(paramobjsql + "|PpeFob1");
}
}catch (FieldNotInitializedException e){
}
try {
paramObjectID = Popbean.getPopObj2();
if (paramObjectID != null){
paramObjectIDs.addElement(paramObjectID);
ObjectsBean objBean = new ObjectsBean(paramObjectID,context);
paramobjsql = objBean.getObjSql();
paramObject = objBean.getObjDisplay();
VectObject.addElement(paramObject);
VectObjectShadow.addElement(paramobjsql + "|PpeFob2");
}
} catch (FieldNotInitializedException e){
}
try {
paramObjectID = Popbean.getPopObj3();
if (paramObjectID != null){
paramObjectIDs.addElement(paramObjectID);
ObjectsBean objBean = new ObjectsBean(paramObjectID,context);
paramobjsql = objBean.getObjSql();
paramObject = objBean.getObjDisplay();
VectObject.addElement(paramObject);
VectObjectShadow.addElement(paramobjsql + "|PpeFob3");
}
} catch (FieldNotInitializedException e) {
}
try {
paramObjectID = Popbean.getPopObj4();
if (paramObjectID != null){
paramObjectIDs.addElement(paramObjectID);
ObjectsBean objBean = new ObjectsBean(paramObjectID,context);
paramobjsql = objBean.getObjSql();
paramObject = objBean.getObjDisplay();
VectObject.addElement(paramObject);
VectObjectShadow.addElement(paramobjsql + "|PpeFob4");
}
} catch (FieldNotInitializedException e) {
}
try {
paramObjectID = Popbean.getPopObj5();
if (paramObjectID != null){
paramObjectIDs.addElement(paramObjectID);
ObjectsBean objBean = new ObjectsBean(paramObjectID,context);
paramobjsql = objBean.getObjSql();
paramObject = objBean.getObjDisplay();
VectObject.addElement(paramObject);
VectObjectShadow.addElement(paramobjsql + "|PpeFob5");
}
} catch (FieldNotInitializedException e) {
}
//Récupèration du type du field choisi
FieldBean fld = null;
String fldType = null;
boolean isControledByRef = false;
boolean isControledByFob = false;
boolean isMultipleValues = false;
boolean isBoolean = false;
boolean isDate = false;
boolean isDecimal = false;
boolean isInteger = false;
boolean isNumeric = false;
boolean isText = false;
if (fieldID != null){
fld = dico.getFieldByID(fieldID);
try { fldType = dico.getRefCode("FldFltID", fld.getFldFltID()); } catch (FieldNotInitializedException ex) {};
try { isControledByRef = (fld.getFldTabID() != null); } catch (FieldNotInitializedException ex) {};
try { isControledByFob = (fld.getFldFobID() != null); } catch (FieldNotInitializedException ex) {};
if("BIT".equals(fldType)) {
isBoolean = true;
} else if("DATE".equals(fldType) || "TIME".equals(fldType) || "TIMESTAMP".equals(fldType)) {
isDate = true;
} else if("FLOAT|DOUBLE".equals(fldType) || "REAL".equals(fldType)) {
isDecimal = true;
isNumeric = true;
} else if("INTEGER".equals(fldType) || "BIGINT".equals(fldType) || "SMALLINT".equals(fldType) || "DECIMAL|NUMERIC".equals(fldType) || "TINYINT".equals(fldType)) {
isInteger = true;
isNumeric = true;
} else if("CHAR|VARCHAR|LONGVARCHAR|CLOB".equals(fldType)) {
isText = true;
}
if(fld.isFldMultival()) {
isMultipleValues = true;
}
}
String sfwID = flRequest.getParameter("SfwID");
//savoir si c'est un champs fob/mulivalué ou pas
String fldSql = null;
if (isControledByFob || isMultipleValues) {
if (fieldID != null) {
FieldBean fldBean = dico.getFieldByID(fieldID);
try {
fldSql = fldBean.getFldSql();
} catch (FieldNotInitializedException e){
logger.error("Error Field can not be intialized");
}
}
}
%>
e-DEAL CRM