%
/******************************************************************************
* 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.*,com.edeal.frontline.navigation.FlRequest,com.edeal.frontline.custom.*,org.w3c.dom.Node,java.util.*"%>
<%@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 pID = flRequest.getRequestParameterOrAttribute("id");
String popIDToReplace = flRequest.getRequestParameterOrAttribute("PopIDToReplace");
String pPopName = flRequest.getRequestParameterOrAttribute("PopName");
String pFstPopID = flRequest.getRequestParameterOrAttribute("FstPopID");
String pScdPopID = flRequest.getRequestParameterOrAttribute("ScdPopID");
String pMethod = flRequest.getRequestParameterOrAttribute("op");
String pCompareFields = flRequest.getRequestParameterOrAttribute("$$compareFields");
String errorMsg = null;
// population A
String popAobj1=null,popAobj2=null,popAobj3=null,popAobj4=null,popAobj5=null;
// population B
String popBobj1=null,popBobj2=null,popBobj3=null,popBobj4=null,popBobj5=null;
//comparer les deux populations
PopulationBean popBeanA = new PopulationBean(pFstPopID, session);
PopulationBean popBeanB = new PopulationBean(pScdPopID, session);
//population resultat
PopulationBean popBeanResult=null;
if(popIDToReplace != null){
popBeanResult = new PopulationBean(popIDToReplace, session);
}
//recuperation des champs PopObj1-5 de chaque population
try {
popAobj1 = popBeanA.getPopObj1();
} catch (FieldNotInitializedException ex1) {popAobj1="";}
try {
popAobj2 = popBeanA.getPopObj2();
} catch (FieldNotInitializedException ex2) {popAobj2="";}
try {
popAobj3 = popBeanA.getPopObj3();
} catch (FieldNotInitializedException ex3) {popAobj3="";}
try {
popAobj4 = popBeanA.getPopObj4();
} catch (FieldNotInitializedException ex4) {popAobj4="";}
try {
popAobj5 = popBeanA.getPopObj5();
} catch (FieldNotInitializedException ex5) {popAobj5="";}
// les objects de population B
try {
popBobj1 = popBeanB.getPopObj1();
} catch (FieldNotInitializedException ex1) {popBobj1="";}
try {
popBobj2 = popBeanB.getPopObj2();
} catch (FieldNotInitializedException ex2) {popBobj2="";}
try {
popBobj3 = popBeanB.getPopObj3();
} catch (FieldNotInitializedException ex3) {popBobj3="";}
try {
popBobj4 = popBeanB.getPopObj4();
} catch (FieldNotInitializedException ex4) {popBobj4="";}
try {
popBobj5 = popBeanB.getPopObj5();
} catch (FieldNotInitializedException ex5) {popBobj5="";}
if(popBeanResult != null){
// population to replace R
String popRobj1=null,popRobj2=null,popRobj3=null,popRobj4=null,popRobj5=null;
// les objets de la population result
try {
popRobj1 = popBeanResult.getPopObj1();
} catch (FieldNotInitializedException ex1) {popRobj1="";}
try {
popRobj2 = popBeanResult.getPopObj2();
} catch (FieldNotInitializedException ex2) {popRobj2="";}
try {
popRobj3 = popBeanResult.getPopObj3();
} catch (FieldNotInitializedException ex3) {popRobj3="";}
try {
popRobj4 = popBeanResult.getPopObj4();
} catch (FieldNotInitializedException ex4) {popRobj4="";}
try {
popRobj5 = popBeanResult.getPopObj5();
} catch (FieldNotInitializedException ex5) {popRobj5="";}
try{
if((popBeanA.isPopIsEnt() !=popBeanB.isPopIsEnt() || popBeanA.isPopIsEnt() !=popBeanResult.isPopIsEnt() )
||(popBeanA.isPopIsPer() !=popBeanB.isPopIsPer() || popBeanA.isPopIsPer() !=popBeanResult.isPopIsPer())
||(popBeanA.isPopIsJou() !=popBeanB.isPopIsJou() || popBeanA.isPopIsJou() !=popBeanResult.isPopIsJou())
||(popBeanA.isPopIsSil() !=popBeanB.isPopIsSil() || popBeanA.isPopIsSil() !=popBeanResult.isPopIsSil())
||(popBeanA.isPopIsSup() !=popBeanB.isPopIsSup() || popBeanA.isPopIsSup() !=popBeanResult.isPopIsSup())){
errorMsg = Utils.getMessage(session, "L65C2", "les populations ne sont pas egaux");
}else errorMsg=null;
if(!popAobj1.equals(popBobj1) || !popBobj1.equals(popRobj1)
||!popAobj2.equals(popBobj2) || !popBobj2.equals(popRobj2)
||!popAobj3.equals(popBobj3) || !popBobj3.equals(popRobj3)
||!popAobj4.equals(popBobj4) || !popBobj4.equals(popRobj4)
||!popAobj5.equals(popBobj5) || !popBobj5.equals(popRobj5)){
errorMsg = Utils.getMessage(session, "L65C2", "les populations ne sont pas egaux");
}else errorMsg=null;
}catch (FieldNotInitializedException ex){}
}else{
try{
if(popBeanA.isPopIsEnt() !=popBeanB.isPopIsEnt()
||popBeanA.isPopIsPer() !=popBeanB.isPopIsPer()
|| popBeanA.isPopIsJou() !=popBeanB.isPopIsJou()
|| popBeanA.isPopIsSil() !=popBeanB.isPopIsSil()
|| popBeanA.isPopIsSup() !=popBeanB.isPopIsSup() ){
errorMsg = Utils.getMessage(session, "L65C2", "les populations ne sont pas egaux");
}else errorMsg=null;
if(!popAobj1.equals(popBobj1)
|| !popAobj2.equals(popBobj2)
|| !popAobj3.equals(popBobj3)
|| !popAobj4.equals(popBobj4)
|| !popAobj5.equals(popBobj5)){
errorMsg = Utils.getMessage(session, "L65C2", "les populations ne sont pas egaux");
}else errorMsg=null;
}catch (FieldNotInitializedException ex){}
}
%>
<%if (errorMsg == null){ %>