Ignore:
Timestamp:
04/26/10 19:12:49 (14 years ago)
Author:
cbipsl
Message:

maj eccad V3.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/presentation/bean/CritereBean.java

    r68 r70  
    11package org.medias.eccad.presentation.bean; 
    22 
     3import java.util.ArrayList; 
    34import java.util.List; 
    45 
     
    1213import javax.faces.model.SelectItem; 
    1314import javax.faces.validator.ValidatorException; 
    14 //import javax.servlet.http.HttpSession; 
    15  
    16  
    17 import org.medias.eccad.helpers.LoggerPerso; 
     15 
    1816import org.medias.eccad.metier.ServiceMetier; 
    1917import org.medias.eccad.modele.Produit; 
     
    3634        private List<SelectItem> liste_catparametre; 
    3735        private Long catparametre; 
    38  
     36         
     37        private List<SelectItem> liste_sector; 
     38        private Long sector; 
     39 
     40        private List<SelectItem> liste_rcp; 
     41        private Long rcp; 
     42         
    3943        private List<SelectItem> liste_grille; 
    4044        private Long grille; 
    4145 
     46        private List<SelectItem> liste_alt; 
     47        private String alt; 
     48 
     49        private List<SelectItem> liste_day; 
     50        private String day; 
     51         
     52        private List<SelectItem> liste_month; 
     53        private String month; 
     54         
     55        private List<SelectItem> liste_year; 
     56        private Integer year; 
     57         
    4258        private ServiceMetier smp; 
    43          
    44         private String ipcc_selection; 
    4559         
    4660        //private String produit_header; 
     
    5973        private UISelectOne  produitUI; 
    6074        private UISelectOne  parametreUI; 
     75        private UISelectOne  sectorUI; 
     76        private UISelectOne  rcpUI; 
     77        private UISelectOne  grilleUI; 
     78        private UISelectOne  altUI; 
     79        private UISelectOne  dayUI; 
     80        private UISelectOne  monthUI; 
     81        private UISelectOne  yearUI; 
    6182         
    6283        // date 
    6384        private String begDate; 
    6485        private String endDate; 
     86        private String date; 
     87        private String deltaDate; 
    6588         
    6689        private String begDateSauv; 
     
    7396        private UIInput uiEndDateSauv; 
    7497         
    75         private boolean prod_change; 
    76  
    7798        private Produit produitbean; 
    7899        private UIOutput produit_temp; 
     
    83104         */ 
    84105        public CritereBean() throws DeconnectionException { 
    85                  
    86106                smp = new ServiceMetier(); 
    87                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "creation"); 
    88107                majcatParam(); 
    89108                majParam(); 
    90109                majProduit(); 
     110                majSector(); 
     111                majRcp(); 
    91112                majDate(); 
    92113                majHeader(); 
    93114                majProduitTemp(); 
    94                 LoggerPerso.log(this.getClass(), LoggerPerso.DEBUG, "size liste parametre fin " + liste_parametre.size()); 
    95                 prod_change = false; 
    96115                northbc = 90; 
    97116                southbc = -90; 
     
    106125         */ 
    107126        public void catParametreChangement(ValueChangeEvent even) throws DeconnectionException { 
    108                  
    109  
    110                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "fonction ::  catParametreChangement"); 
    111                  
    112                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, ""); 
    113                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "catParametre changement :: " + even.getNewValue() + " :: old :: " + catparametre); 
    114127                catparametre = (Long) even.getNewValue(); 
    115                 majParam();              
     128                majParam(); 
    116129                majProduit(); 
     130                majSector(); 
     131                majRcp(); 
    117132                majDate(); 
    118133                majHeader(); 
    119134                majProduitTemp(); 
    120                 prod_change=true; 
    121135        } 
    122136         
    123137        public void parametreChangement(ValueChangeEvent even) throws DeconnectionException { 
    124                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "parametreChangement"); 
    125                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "parametre changement :: " + even.getNewValue() + " :: old :: " + parametre); 
    126138                parametre = (Long) even.getNewValue(); 
    127139                majProduit(); 
     140                majSector(); 
     141                majRcp(); 
    128142                majDate(); 
    129143                majHeader(); 
    130144                majProduitTemp(); 
    131                 prod_change=true; 
    132145        } 
    133146 
     
    137150         */ 
    138151        public void produitChangement(ValueChangeEvent even) { 
    139                  
    140  
    141                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "fonction ::  produitChangement"); 
    142                  
    143                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "produit changement avant :: " + produit + " event " + even.getNewValue() + " uiselect " + produitUI.getValue()); 
    144                 if (prod_change) { 
    145                         LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "produit changement non réalisé :: " + produit); 
    146                         prod_change = false; 
    147                         //return; 
    148                 } 
    149                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "produit changement ok :: " + produit); 
    150152                produit = (Long) even.getNewValue(); 
    151153                if (produit != null) { 
     
    155157                        produitbean = new Produit(-1, "none", null, null); 
    156158                } 
     159                majSector(); 
     160                majRcp(); 
    157161                majDate();       
    158162                majHeader(); 
     
    160164        } 
    161165 
    162          
    163         /** 
    164          * met à jour la liste des catï¿œgories de parametres (initialisation de la liste) 
     166        /** 
     167         * Activé lors du changement du secteur 
     168         * @param even la nouvelle valeur du secteur 
     169         */ 
     170        public void secteurChangement(ValueChangeEvent even) { 
     171                sector = (Long) even.getNewValue(); 
     172                majRcp(); 
     173                majDate(); 
     174        } 
     175 
     176        /** 
     177         * Activé lors du changement du RCP 
     178         * @param even la nouvelle valeur du RCP 
     179         */ 
     180        public void rcpChangement(ValueChangeEvent even) { 
     181                rcp = (Long) even.getNewValue(); 
     182                majSector(); 
     183                majDate(); 
     184        } 
     185         
     186        private boolean identInList(Long identifiant,List<SelectItem> list) { 
     187                if (identifiant == null) { 
     188                        return false; 
     189                } 
     190                Long idCurrent; 
     191                for (int num = 0; num < list.size(); num++) { 
     192                        idCurrent = (Long)list.get(num).getValue(); 
     193                        if (idCurrent.longValue() == identifiant.longValue()) 
     194                                return true; 
     195                } 
     196                return false; 
     197        } 
     198         
     199        /** 
     200         * met à jour la liste des catégories de parametres (initialisation de la liste) 
    165201         * 
    166202         */ 
    167203        public void majcatParam() { 
    168  
    169204                controleSession(); 
    170                  
    171                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "fonction ::  majcatParam"); 
    172                  
    173                  
    174                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "-8-*catparametre maj :: "); 
    175205                liste_catparametre = smp.getListCatParametre(); 
    176                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "------*SIZE catparametre maj :: "+liste_catparametre.size()); 
    177206                if (liste_catparametre.size() > 0) { 
    178207                        catparametre= (Long) liste_catparametre.get(0).getValue(); 
     
    188217         */ 
    189218        public void majParam() { 
    190                  
    191                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "fonction :: majParam"); 
    192                  
    193219                controleSession(); 
    194                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "parametre maj Catparam :: " + catparametre); 
    195220                if (catparametre == null) { 
    196221                        liste_parametre = null; 
     
    198223                        return; 
    199224                } 
    200                  
    201                  
     225 
    202226                liste_parametre = smp.getListParamByCatParam(catparametre.intValue()); 
    203                 LoggerPerso.log(this.getClass(), LoggerPerso.DEBUG, "liste parametre valeur 0>>>>>>" + liste_parametre.get(0).getValue()); 
    204227                if (liste_parametre.size() > 0) { 
    205                         LoggerPerso.log(this.getClass(), LoggerPerso.DEBUG, "liste parametre > 0"); 
    206                         parametre= (Long) liste_parametre.get(0).getValue(); 
     228                        if (!identInList(parametre, liste_parametre)) { 
     229                                parametre= (Long) liste_parametre.get(0).getValue(); 
     230                        } 
    207231                        if (parametreUI != null) 
    208                                 parametreUI.setValue(new Long(parametre)); 
    209                          
     232                                parametreUI.setValue(parametre); 
    210233                } 
    211234                else 
     
    214237        } 
    215238         
     239        /** 
     240         * met à jour la liste des secteurs (initialisation de la liste) 
     241         * 
     242         */ 
     243        public void majSector() { 
     244                controleSession(); 
     245                if (catparametre == null) { 
     246                        liste_sector = null; 
     247                        sector = null; 
     248                        return; 
     249                } 
     250                liste_sector = smp.getListSectorByParam(parametre.intValue(),produit.intValue(),(rcp==null?0:rcp.intValue())); 
     251                if (liste_sector.size() > 0) { 
     252                        if (!identInList(sector, liste_sector)) { 
     253                                sector= (Long) liste_sector.get(0).getValue(); 
     254                        } 
     255                        if (sectorUI != null) 
     256                                sectorUI.setValue(sector); 
     257                } 
     258                else { 
     259                        sector = new Long(0); 
     260                } 
     261        } 
     262         
     263        /** 
     264         * met à jour la liste des rcp 
     265         * 
     266         */ 
     267        public void majRcp() { 
     268                controleSession(); 
     269                if (catparametre == null) { 
     270                        liste_rcp = null; 
     271                        rcp = null; 
     272                        return; 
     273                } 
     274                liste_rcp = smp.getListRcpByParam(parametre.intValue(),produit.intValue(),(sector==null?0:sector.intValue())); 
     275                if (liste_rcp.size() > 0) { 
     276                        if (!identInList(rcp, liste_rcp)) { 
     277                                rcp= (Long) liste_rcp.get(0).getValue(); 
     278                        } 
     279                        if (rcpUI != null) 
     280                                rcpUI.setValue(rcp);                     
     281                } 
     282                else { 
     283                        rcp = new Long(0); 
     284                } 
     285        } 
    216286         
    217287        /** 
     
    220290         */ 
    221291        public void majProduit() throws DeconnectionException { 
    222                  
    223                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "fonction ::  majProduit"); 
    224                  
    225292                controleSession(); 
    226                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "produit maj param :: " + parametre); 
    227293                if (parametre == null) { 
    228294                        liste_produit = null; 
     
    231297                } 
    232298                liste_produit = smp.getListProduit(parametre.intValue()); 
    233                 if (liste_produit.size() > 0) {  
    234                         produit = (Long) liste_produit.get(0).getValue(); 
     299                if (liste_produit.size() > 0) { 
     300                        if (!identInList(produit, liste_produit)) { 
     301                                produit = (Long) liste_produit.get(0).getValue(); 
     302                        } 
    235303                        if (produitUI != null) 
    236                                 produitUI.setValue(new Long(produit)); 
     304                                produitUI.setValue(produit); 
    237305                        produitbean = smp.getProduitById(produit.intValue()); 
    238306                } 
     
    245313         * 
    246314         */ 
    247         public void majGrille() { 
    248                 LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "produit maj grille :: " + grille); 
     315        public void majGrille(String dateGrille) { 
    249316                if (produit == null) { 
    250317                        liste_grille = null; 
     
    252319                        return; 
    253320                } 
    254                  
    255                 liste_grille = smp.getListGrille(produit.intValue(),parametre.intValue(), begDate, endDate); 
    256                 if (liste_grille.size() > 0) 
    257                         grille = (Long) liste_grille.get(0).getValue(); 
    258                 else 
     321                liste_grille = smp.getListGrille(produit.longValue(),parametre.longValue(),(sector==null?0:sector.longValue()),(rcp==null?0:rcp.longValue()), begDate, endDate, deltaDate, produitbean, alt); 
     322                if (liste_grille.size() > 0) { 
     323                        if (dateGrille == null) { 
     324                                grille = (Long) liste_grille.get(0).getValue(); 
     325                                if (grilleUI != null) 
     326                                        grilleUI.setValue(grille); 
     327                                date = liste_grille.get(0).getLabel(); 
     328                                if (date.length() == 7) { 
     329                                        date += "-01"; 
     330                                } else if (date.length() == 4) { 
     331                                        date += "-01-01"; 
     332                                } 
     333                        } else { 
     334                                String dateLabel; 
     335                                for (int num = 0; num < liste_grille.size(); num++) { 
     336                                        dateLabel = liste_grille.get(num).getLabel(); 
     337                                        if (dateLabel.length() == 7) { 
     338                                                dateLabel += "-01"; 
     339                                        } else if (dateLabel.length() == 4) { 
     340                                                dateLabel += "-01-01"; 
     341                                        } 
     342                                        if (dateLabel.equals(dateGrille)) { 
     343                                                grille = (Long)liste_grille.get(num).getValue(); 
     344                                                if (grilleUI != null) 
     345                                                        grilleUI.setValue(grille); 
     346                                                date = dateLabel;  
     347                                                break; 
     348                                        } 
     349                                } 
     350                        } 
     351                } else { 
    259352                        grille = null; 
    260         } 
    261          
     353                } 
     354//System.out.println("majGrille, nouvelle date="+date+", alt="+alt+", grille="+grille+", day="+day+", month="+month+", year="+year); 
     355        } 
     356 
     357        /** 
     358         * Met à jour la liste des altitudes dans le cas où on a un secteur "Aviation" 
     359         * 
     360         */ 
     361        public void majAlt(String secteur) { 
     362                if (produit == null || !secteur.equals("Aviation")) { 
     363                        liste_alt = null; 
     364                        alt = null; 
     365                        return; 
     366                } 
     367                liste_alt = smp.getListAlt(sector.longValue(),begDate); 
     368                if (liste_alt.size() > 0) { 
     369                        alt = (String) liste_alt.get(0).getValue(); 
     370                        if (altUI != null) 
     371                                altUI.setValue(alt); 
     372                } else { 
     373                        alt = null; 
     374                } 
     375//System.out.println("majAlt, date="+date+", nouveau alt="+alt+", grille="+grille+", day="+day+", month="+month+", year="+year); 
     376        } 
     377         
     378        /** 
     379         * Met à jour la liste des jours/mois/années pour la période sélectionnée 
     380         * 
     381         */ 
     382        public void majDayMonthYear(String traducteur) { 
     383                if (produit == null) { 
     384                        liste_day = null; 
     385                        liste_month = null; 
     386                        liste_year = null; 
     387                        day = null; 
     388                        month = null; 
     389                        year = null; 
     390                        return; 
     391                } 
     392                 
     393                liste_day = new ArrayList<SelectItem>(); 
     394                liste_month = new ArrayList<SelectItem>(); 
     395                liste_year = new ArrayList<SelectItem>(); 
     396                if (traducteur.equals("traducteur_temporel")) { 
     397                        String dateGrille, jourGrille, moisGrille, anneeGrille, moisPrec = "", anneePrec = ""; 
     398                        // On parcourt la liste des dates des grilles 
     399                        for (int num = 0; num < liste_grille.size(); num++) { 
     400                                dateGrille = liste_grille.get(num).getLabel(); 
     401                                // On récupÚre le mois et l'année (AAAA-MM-JJ) suivant la date (AAAA-MM ou AAAA-MM-JJ) 
     402                                if (dateGrille.length() == 7) { 
     403                                        jourGrille = dateGrille+"-01"; 
     404                                        moisGrille = dateGrille; 
     405                                } else if (dateGrille.length() == 4) { 
     406                                        jourGrille = dateGrille+"-01-01"; 
     407                                        moisGrille = dateGrille+"-01"; 
     408                                } else { 
     409                                        jourGrille = dateGrille; 
     410                                        moisGrille = dateGrille.substring(0,7); 
     411                                } 
     412                                anneeGrille = dateGrille.substring(0,4); 
     413                                // On ajoute le jour/ mois / année à la liste si celui-ci n'est pas déjà présent 
     414                                liste_day.add(new SelectItem(jourGrille,jourGrille)); 
     415                                if (!moisGrille.equals(moisPrec)) { 
     416                                        liste_month.add(new SelectItem(moisGrille, moisGrille)); 
     417                                } 
     418                                if (!anneeGrille.equals(anneePrec)) { 
     419                                        liste_year.add(new SelectItem(new Integer(anneeGrille), anneeGrille)); 
     420                                } 
     421                                moisPrec = moisGrille; 
     422                                anneePrec = anneeGrille; 
     423                        } 
     424 
     425                        if (liste_day.size() > 0) { 
     426                                day = date; 
     427                                if (dayUI != null) 
     428                                        dayUI.setValue(day); 
     429                        } else { 
     430                                day = null; 
     431                        } 
     432                        if (liste_month.size() > 0) { 
     433                                month = date.substring(0,7); 
     434                                if (monthUI != null) 
     435                                        monthUI.setValue(month); 
     436                        } else { 
     437                                month = null; 
     438                        } 
     439                        if (liste_year.size() > 0) { 
     440                                year = new Integer(date.substring(0,4)); 
     441                                if (yearUI != null) 
     442                                        yearUI.setValue(year); 
     443                        } else { 
     444                                year = null; 
     445                        } 
     446                } 
     447//System.out.println("majDayMonthYear, date="+date+", alt="+alt+", grille="+grille+", day="+day+", month="+month+", year="+year); 
     448        } 
    262449         
    263450        /** 
     
    276463        private void majDate() { 
    277464                if (produit == null) { 
    278                         LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "maj date produit null"); 
    279465                        begDate = null; 
    280466                        endDate = null; 
     
    288474                        if (uiEndDate != null){ 
    289475                                uiEndDate.setValue(endDate); 
    290                                 } 
     476                        } 
    291477                        if (uiEndDateSauv != null){ 
    292478                                uiEndDateSauv.setValue(endDate); 
    293479                                setEndDateSauv(endDate); 
    294                                 } 
    295                         return; 
    296                 } 
    297  
    298                 if (produitbean != null) { 
    299                         LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "majDATE::nom::"+ produitbean.getNom() + "::date::" + produitbean.getBeginDate()); 
    300                         LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "majDATE::nom::"+ produitbean.getNom() + "::date::" + produitbean.getEndDate()); 
    301                         begDate = produitbean.getBeginDate().toString(); 
    302                         endDate = produitbean.getEndDate().toString(); 
    303  
     480                        } 
     481                        return; 
     482                } 
     483 
     484                ArrayList<String> dates = smp.getDates(produit.longValue(),parametre.longValue(),(sector==null?0:sector.longValue()),(rcp==null?0:rcp.longValue()),produitbean.getNom()); 
     485//              if (produitbean != null) { 
     486                if (dates.size() == 3) { 
     487//                      begDate = produitbean.getBeginDate().toString(); 
     488//                      endDate = produitbean.getEndDate().toString(); 
     489                        begDate = dates.get(0); 
     490                        endDate = dates.get(1); 
     491                        deltaDate = dates.get(2); 
    304492                        begDateSauv = begDate; 
    305493                        endDateSauv = endDate; 
    306                                                  
    307494                } 
    308495                else { 
    309496                        begDate = null; 
    310497                        endDate = null; 
     498                        deltaDate = null; 
    311499                        begDateSauv = null; 
    312500                        endDateSauv = null; 
     
    315503                if (uiBegDate != null){ 
    316504                        uiBegDate.setValue(begDate); 
    317                         LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "majDATE::nom::"+ produitbean.getNom() + "::begDate::" +begDate); 
    318                          
    319505                } 
    320506                if (uiBegDateSauv != null){ 
     
    326512                if (uiEndDateSauv != null){ 
    327513                        uiEndDateSauv.setValue(endDateSauv); 
    328                         LoggerPerso.log(CritereBean.class, LoggerPerso.DEBUG, "majDATE::nom::"+ produitbean.getNom() + "::endDateSauv::" +endDateSauv); 
    329                          
    330514                } 
    331515        } 
     
    348532        } 
    349533         
    350          
    351534        /* 
    352535         * GETTER & SETTER + VALIDATOR 
     
    356539        } 
    357540 
    358  
    359541        public void setGrille(Long grille) { 
    360542                this.grille = grille; 
    361543        } 
    362544 
    363  
    364545        public List<SelectItem> getListe_grille() { 
    365546                return liste_grille; 
    366547        } 
    367548 
    368  
    369549        public void setListe_grille(List<SelectItem> liste_grille) { 
    370550                this.liste_grille = liste_grille; 
     
    375555        } 
    376556 
    377  
    378557        public void setProduit(Long produit) { 
    379558                this.produit = produit; 
    380559        } 
    381560 
    382  
    383561        public List<SelectItem> getListe_produit() { 
    384562                return liste_produit; 
     
    405583        } 
    406584         
    407          
    408         ///////////// 
    409585        public UIInput getUiBegDateSauv() { 
    410586                return uiBegDateSauv; 
     
    422598                this.uiEndDateSauv = uiEndDateSauv; 
    423599        } 
    424         //////////// 
    425          
    426          
    427600 
    428601        public int getOid() { 
     
    438611        } 
    439612 
    440  
    441613        public void setListe_catparametre(List<SelectItem> liste_catParametre) { 
    442614                this.liste_catparametre = liste_catParametre; 
    443615        } 
    444          
    445  
    446616 
    447617        public Long getCatParametre() throws DeconnectionException { 
     
    450620        } 
    451621 
    452  
    453622        public void setCatParametre(Long catParametre) { 
    454623                this.catparametre = catParametre; 
     
    459628        } 
    460629 
    461  
    462630        public void setListe_parametre(List<SelectItem> liste_parametre) { 
    463631                this.liste_parametre = liste_parametre; 
    464632        } 
    465633         
    466  
    467  
    468634        public Long getParametre() throws DeconnectionException { 
    469635                controleSession(); 
     
    471637        } 
    472638 
    473  
    474639        public void setParametre(Long parametre) { 
    475640                this.parametre = parametre; 
    476641        } 
    477642 
     643        public List<SelectItem> getListe_sector() { 
     644                return liste_sector; 
     645        } 
     646 
     647        public List<SelectItem> getListe_rcp() { 
     648                return liste_rcp; 
     649        } 
     650         
     651        public void setListe_sector(List<SelectItem> liste_sector) { 
     652                this.liste_sector = liste_sector; 
     653        } 
     654         
     655        public void setListe_rcp(List<SelectItem> liste_rcp) { 
     656                this.liste_rcp= liste_rcp; 
     657        } 
     658         
     659        public Long getSector() throws DeconnectionException { 
     660                return sector; 
     661        } 
     662 
     663        public Long getRcp() throws DeconnectionException { 
     664                return rcp; 
     665        } 
     666         
     667        public void setSector(Long sector) { 
     668                this.sector = sector; 
     669        } 
     670 
     671        public void setRcp(Long rcp) { 
     672                this.rcp = rcp; 
     673        } 
     674         
    478675        public String getBegDate() { 
    479676                return begDate; 
     
    539736        } 
    540737 
    541  
    542  
    543738        public UIInput getEastbcInput() { 
    544739                return eastbcInput; 
    545740        } 
    546741 
    547  
    548  
    549742        public void setEastbcInput(UIInput eastbcInput) { 
    550743                this.eastbcInput = eastbcInput; 
    551744        } 
    552745 
    553  
    554  
    555746        public UIInput getNorthbcInput() { 
    556747                return northbcInput; 
    557748        } 
    558749 
    559  
    560  
    561750        public void setNorthbcInput(UIInput northbcInput) { 
    562751                this.northbcInput = northbcInput; 
    563752        } 
    564753 
    565  
    566  
    567754        public UIInput getSouthbcInput() { 
    568755                return southbcInput; 
    569756        } 
    570757 
    571  
    572  
    573758        public void setSouthbcInput(UIInput southbcInput) { 
    574759                this.southbcInput = southbcInput; 
    575760        } 
    576761 
    577  
    578  
    579762        public UIInput getWestbcInput() { 
    580763                return westbcInput; 
    581764        } 
    582765 
    583  
    584  
    585766        public void setWestbcInput(UIInput westbcInput) { 
    586767                this.westbcInput = westbcInput; 
    587768        } 
    588  
    589769         
    590770        public void validateDate(FacesContext contexte, UIComponent composant, Object objet) throws ValidatorException { 
     
    612792                if (uiBegDate.getValue().toString().compareTo(uiEndDate.getValue().toString()) > 0) { 
    613793                        estValide = false; 
    614                         errMsg = new FacesMessage("begin date must be smaller than end date"); 
    615                 } 
    616                 if ((uiBegDate.getValue().toString().compareTo(uiEndDateSauv.getValue().toString()) > 0) && estValide) { 
     794                        errMsg = new FacesMessage("Begin date must be lower or equal than End date"); 
     795                } 
     796                else if (uiBegDateSauv.getValue().toString().compareTo(uiBegDate.getValue().toString()) > 0) { 
    617797                        estValide = false; 
    618                         errMsg = new FacesMessage(uiEndDateSauv.getValue().toString()+" - "+ uiBegDate.getValue().toString()); 
    619                         //errMsg = new FacesMessage("no data in this Date selection"); 
    620                 } 
    621                  
     798                        errMsg = new FacesMessage("Begin date must be greater or equal than "+uiBegDateSauv.getValue().toString()); 
     799                } 
     800                else if (uiEndDate.getValue().toString().compareTo(uiEndDateSauv.getValue().toString()) > 0) { 
     801                        estValide = false; 
     802                        errMsg = new FacesMessage("End date must be lower or equal than "+uiEndDateSauv.getValue().toString()); 
     803                } 
    622804                if (!estValide) 
    623805                        throw new ValidatorException(errMsg); 
    624                  
    625806        } 
    626807         
     
    634815         
    635816        /** 
    636          * Valide la date 
     817         * Valide la zone de sélection 
    637818         * @param contexte 
    638819         * @param composant 
     
    675856        } 
    676857 
    677  
    678  
    679858        public ServiceMetier getSmp() { 
    680859                return smp; 
     
    687866        public void setProduitUI(UISelectOne produitUI) { 
    688867                this.produitUI = produitUI; 
    689                 ////system.out.println("\n\n\n" + produitUI.getValue()); 
    690868        } 
    691869 
     
    697875        public void setParametreUI(UISelectOne parametreUI) { 
    698876                this.parametreUI = parametreUI; 
    699                 ////system.out.println("\n\n\n" + produitUI.getValue()); 
    700         } 
    701          
    702          
     877        } 
     878         
     879        public UISelectOne getSectorUI() { 
     880                return sectorUI; 
     881        } 
     882 
     883        public UISelectOne getRcpUI() { 
     884                return rcpUI; 
     885        } 
     886         
     887        public void setSectorUI(UISelectOne sectorUI) { 
     888                this.sectorUI = sectorUI; 
     889        } 
     890         
     891        public void setRcpUI(UISelectOne rcpUI) { 
     892                this.rcpUI = rcpUI; 
     893        } 
     894 
    703895/*      public String getProduit_header() { 
    704896                return produit_header; 
     
    732924                this.produit_temp = produit_temp; 
    733925        } 
     926 
     927        public String getDate() { 
     928                return date; 
     929        } 
     930 
     931        public void setDate(String date) { 
     932                this.date = date; 
     933        } 
     934 
     935        public List<SelectItem> getListe_month() { 
     936                return liste_month; 
     937        } 
     938 
     939        public void setListe_month(List<SelectItem> listeMonth) { 
     940                liste_month = listeMonth; 
     941        } 
     942 
     943        public String getMonth() { 
     944                return month; 
     945        } 
     946 
     947        public void setMonth(String month) { 
     948                this.month = month; 
     949        } 
     950 
     951        public List<SelectItem> getListe_year() { 
     952                return liste_year; 
     953        } 
     954 
     955        public void setListe_year(List<SelectItem> listeYear) { 
     956                liste_year = listeYear; 
     957        } 
     958 
     959        public Integer getYear() { 
     960                return year; 
     961        } 
     962 
     963        public void setYear(Integer year) { 
     964                this.year = year; 
     965        } 
     966 
     967        public List<SelectItem> getListe_day() { 
     968                return liste_day; 
     969        } 
     970 
     971        public void setListe_day(List<SelectItem> listeDay) { 
     972                liste_day = listeDay; 
     973        } 
     974 
     975        public String getDay() { 
     976                return day; 
     977        } 
     978 
     979        public void setDay(String day) { 
     980                this.day = day; 
     981        } 
     982 
     983        public UISelectOne getDayUI() { 
     984                return dayUI; 
     985        } 
     986 
     987        public void setDayUI(UISelectOne dayUI) { 
     988                this.dayUI = dayUI; 
     989        } 
     990 
     991        public UISelectOne getMonthUI() { 
     992                return monthUI; 
     993        } 
     994 
     995        public void setMonthUI(UISelectOne monthUI) { 
     996                this.monthUI = monthUI; 
     997        } 
     998 
     999        public UISelectOne getYearUI() { 
     1000                return yearUI; 
     1001        } 
     1002 
     1003        public void setYearUI(UISelectOne yearUI) { 
     1004                this.yearUI = yearUI; 
     1005        } 
     1006 
     1007        public UISelectOne getGrilleUI() { 
     1008                return grilleUI; 
     1009        } 
     1010 
     1011        public void setGrilleUI(UISelectOne grilleUI) { 
     1012                this.grilleUI = grilleUI; 
     1013        } 
     1014 
     1015        public List<SelectItem> getListe_alt() { 
     1016                return liste_alt; 
     1017        } 
     1018 
     1019        public void setListe_alt(List<SelectItem> listeAlt) { 
     1020                liste_alt = listeAlt; 
     1021        } 
     1022 
     1023        public String getAlt() { 
     1024                return alt; 
     1025        } 
     1026 
     1027        public void setAlt(String alt) { 
     1028                this.alt = alt; 
     1029        } 
     1030 
     1031        public UISelectOne getAltUI() { 
     1032                return altUI; 
     1033        } 
     1034 
     1035        public void setAltUI(UISelectOne altUI) { 
     1036                this.altUI = altUI; 
     1037        } 
     1038 
     1039        public String getDeltaDate() { 
     1040                return deltaDate; 
     1041        } 
     1042 
     1043        public void setDeltaDate(String deltaDate) { 
     1044                this.deltaDate = deltaDate; 
     1045        } 
    7341046} 
Note: See TracChangeset for help on using the changeset viewer.