Changeset 825


Ignore:
Timestamp:
07/31/15 16:26:38 (9 years ago)
Author:
rboipsl
Message:

changement logo
champs locality/lieu desactives
+modif sur tapas.css et bas page frontend
+ ajout textes info xml et one transmission

Location:
tapas
Files:
6 added
13 edited
3 copied

Legend:

Unmodified
Added
Removed
  • tapas/Tapas.iml

    r419 r825  
    44    <facet type="hibernate" name="Hibernate"> 
    55      <configuration> 
    6         <datasource-map /> 
     6        <datasource-map> 
     7          <unit-entry name="hibernate-domain.cfg.xml" /> 
     8        </datasource-map> 
    79        <deploymentDescriptor name="hibernate.cfg.xml" url="file://$MODULE_DIR$/persistence/implementation/hibernate-domain.cfg.xml" /> 
    810      </configuration> 
  • tapas/common/Common.iml

    r816 r825  
    2121      </library> 
    2222    </orderEntry> 
    23     <orderEntry type="library" exported="" name="lib_common" level="project" /> 
     23    <orderEntry type="library" name="lib_common" level="project" /> 
    2424    <orderEntry type="library" name="lib_spring" level="project" /> 
    2525    <orderEntry type="library" name="lib_hibernate" level="project" /> 
  • tapas/domain/interface/com/ether/tapas/FileRequest.java

    r816 r825  
    77 * @date 08 march 2012 
    88 */ 
    9 public class Request 
     9public class FileRequest 
    1010{ 
     11 
    1112    @NotNull 
    1213    public Long getId() 
     
    2122 
    2223    @NotNull 
    23     public Preference getPreference() 
     24    public String getName() 
    2425    { 
    25         return _preference; 
     26        return _cxml; 
    2627    } 
    2728 
    28     public void setPreference( @NotNull final Preference preference ) 
     29    public void setName( @NotNull final String cxml ) 
    2930    { 
    30         _preference = preference; 
    31     } 
    32  
    33     @NotNull 
    34     public Observation getObservation() 
    35     { 
    36         return _observation; 
    37     } 
    38  
    39     public void setObservation( @NotNull final Observation observation ) 
    40     { 
    41         _observation = observation; 
    42     } 
    43  
    44     @NotNull 
    45     public Atmosphere getAtmosphere() 
    46     { 
    47         return _atmosphere; 
    48     } 
    49  
    50     public void setAtmosphere( @NotNull final Atmosphere atmosphere ) 
    51     { 
    52         _atmosphere = atmosphere; 
    53     } 
    54  
    55     public int getValid() 
    56     { 
    57         return _isValid; 
    58     } 
    59  
    60     public void setValid( final int valid ) 
    61     { 
    62         _isValid = valid; 
     31        _cxml = cxml; 
    6332    } 
    6433 
    6534    @NotNull 
    6635    private Long _id; 
    67     private int _isValid; 
    6836    @NotNull 
    69     private Preference _preference; 
    70     @NotNull 
    71     private Observation _observation; 
    72     @NotNull 
    73     private Atmosphere _atmosphere; 
     37    private String _cxml; 
     38 
     39 
    7440} 
  • tapas/domain/interface/com/ether/tapas/Request.java

    r816 r825  
    99public class Request 
    1010{ 
    11     @NotNull 
     11 
    1212    public Long getId() 
    1313    { 
     
    2020    } 
    2121 
    22     @NotNull 
     22 
    2323    public Preference getPreference() 
    2424    { 
     
    2626    } 
    2727 
    28     public void setPreference( @NotNull final Preference preference ) 
     28    public void setPreference( final Preference preference ) 
    2929    { 
    3030        _preference = preference; 
    3131    } 
    3232 
    33     @NotNull 
     33 
    3434    public Observation getObservation() 
    3535    { 
     
    3737    } 
    3838 
    39     public void setObservation( @NotNull final Observation observation ) 
     39    public void setObservation( final Observation observation ) 
    4040    { 
    4141        _observation = observation; 
    4242    } 
    4343 
    44     @NotNull 
     44 
    4545    public Atmosphere getAtmosphere() 
    4646    { 
     
    4848    } 
    4949 
    50     public void setAtmosphere( @NotNull final Atmosphere atmosphere ) 
     50    public void setAtmosphere( final Atmosphere atmosphere ) 
    5151    { 
    5252        _atmosphere = atmosphere; 
     
    6363    } 
    6464 
    65     @NotNull 
     65    public String getcXml() 
     66    { 
     67        return _cXml; 
     68    } 
     69 
     70    public void setcXml( final String cXml ) 
     71    { 
     72        _cXml = cXml; 
     73    } 
     74 
     75 
    6676    private Long _id; 
    6777    private int _isValid; 
    68     @NotNull 
     78 
    6979    private Preference _preference; 
    70     @NotNull 
     80 
    7181    private Observation _observation; 
    72     @NotNull 
     82 
    7383    private Atmosphere _atmosphere; 
     84 
     85    private String _cXml; 
    7486} 
  • tapas/domain/interface/com/ether/tapas/Tapas.java

    r400 r825  
    1111public class Tapas 
    1212{ 
     13 
    1314    @NotNull 
    1415    public String getId() 
     
    1718    } 
    1819 
     20 
    1921    public void setId( @NotNull final String id ) 
    2022    { 
     
    2224    } 
    2325 
    24     @NotNull 
     26 
    2527    public List<Request> getRequests() 
    2628    { 
    2729        return _requests; 
    2830    } 
     31 
    2932 
    3033    public void setRequests( @NotNull final List<Request> requests ) 
     
    3336    } 
    3437 
     38 
    3539    @NotNull 
    3640    private String _id; 
    37     @NotNull 
     41 
    3842    private List<Request> _requests; 
     43 
     44 
     45 
    3946} 
  • tapas/service/implementation/com/ether/TapasServiceImpl.java

    r817 r825  
    5454            final String dataPath = prop.getProperty( "data_path" ); 
    5555 
    56             //final String fichier = servicePath + "/" + "request.xml"; 
    57             final Element tapas = new Element( "tapas" ); 
    58             final List<Element> listRequest = new ArrayList<Element>( fTapas.getRequests().size() ); 
    59  
    60             //On crée un nouveau Document JDOM basé sur la racine que l'on vient de créer 
    61             final Document document = new Document( tapas ); 
    62  
    63             //recuperation valeur id requete (bdd table tapas_request) 
    64             fTapas.setId( "Ether_TAPAS_" + String.valueOf( getNumRequest() ) ); 
    65  
    66             final Attribute id = new Attribute( "Id", fTapas.getId() ); 
    67             tapas.setAttribute( id ); 
    68  
    69             //a terme devient une boucle 
    70             final List<Request> requests = fTapas.getRequests(); 
    71             Request xRequest, nRequest; 
    72  
    73             String iname; 
    74  
    75             Iterator<Request> iter = requests.iterator(); 
    76  
    77             int iii = requests.size(); 
    78             int inr = 0; 
    79             int indice = 1; 
    80             //Request xRequest = iter.next(); 
    81             String oneTransmission; 
    82  
    83             while ( indice <= iii ) 
    84             { 
    85                nRequest = iter.next(); 
    86                nRequest.setValid( 1 ); 
    87  
    88                oneTransmission = nRequest.getPreference().getOneTransmission().getSecondValue(); 
    89  
    90                if( oneTransmission.equalsIgnoreCase( "NO" ) ) 
    91                 { 
    92                     nRequest.setValid( -1 ); 
    93                     if( nRequest.getPreference().getH2oExtinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
     56 
     57            final String xmlStringContent = fTapas.getRequests().get( 0 ).getcXml(); 
     58 
     59            if (xmlStringContent == null) 
     60            { 
     61                //if ( fTapas.getRequests().get( 1 ).getcXml() ) 
     62                //{ 
     63 
     64                //final String fichier = servicePath + "/" + "request.xml"; 
     65                final Element tapas = new Element( "tapas" ); 
     66                final List<Element> listRequest = new ArrayList<Element>( fTapas.getRequests().size() ); 
     67 
     68                //On crée un nouveau Document JDOM basé sur la racine que l'on vient de créer 
     69                final Document document = new Document( tapas ); 
     70 
     71                //recuperation valeur id requete (bdd table tapas_request) 
     72                fTapas.setId( "Ether_TAPAS_" + String.valueOf( getNumRequest() ) ); 
     73 
     74                final Attribute id = new Attribute( "Id", fTapas.getId() ); 
     75                tapas.setAttribute( id ); 
     76 
     77                //a terme devient une boucle 
     78                final List<Request> requests = fTapas.getRequests(); 
     79                Request nRequest; 
     80 
     81                String iname; 
     82 
     83                Iterator<Request> iter = requests.iterator(); 
     84 
     85                int iii = requests.size(); 
     86                int inr = 0; 
     87                int indice = 1; 
     88 
     89                String oneTransmission; 
     90 
     91                while ( indice <= iii ) 
     92                { 
     93                   nRequest = iter.next(); 
     94                   nRequest.setValid( 1 ); 
     95 
     96                   oneTransmission = nRequest.getPreference().getOneTransmission().getSecondValue(); 
     97 
     98                   if( oneTransmission.equalsIgnoreCase( "NO" ) ) 
    9499                    { 
    95                         requests.add( addNewRequest( nRequest, (iii+inr+1), "H2O") ); 
    96                         inr = inr + 1; 
    97                         iter = requests.iterator(); 
    98                         /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
    99                         { 
    100                             nRequest = iter.next(); 
    101                         }*/ 
     100                        nRequest.setValid( -1 ); 
     101                        if( nRequest.getPreference().getH2oExtinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
     102                        { 
     103                            requests.add( addNewRequest( nRequest, (iii+inr+1), "H2O") ); 
     104                            inr = inr + 1; 
     105                            iter = requests.iterator(); 
     106                            /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
     107                            { 
     108                                nRequest = iter.next(); 
     109                            }*/ 
     110                        } 
     111 
     112 
     113                        if( nRequest.getPreference().getCh4Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
     114                        { 
     115                            requests.add( addNewRequest( nRequest, (iii+inr+1), "CH4" ) ); 
     116                            inr = inr + 1; 
     117                            iter = requests.iterator(); 
     118                            /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
     119                            { 
     120                                nRequest = iter.next(); 
     121                            }*/ 
     122                        } 
     123 
     124 
     125                        if( nRequest.getPreference().getCo2Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
     126                        { 
     127                            requests.add( addNewRequest( nRequest, (iii+inr+1), "CO2" ) ); 
     128                            inr = inr + 1; 
     129                            iter = requests.iterator(); 
     130                            /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
     131                            { 
     132                                nRequest = iter.next(); 
     133                            }*/ 
     134                        } 
     135 
     136 
     137                        if( nRequest.getPreference().getN2oExtinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
     138                        { 
     139                            requests.add( addNewRequest( nRequest, (iii+inr+1), "N2O" ) ); 
     140                            inr = inr + 1; 
     141                            iter = requests.iterator(); 
     142                            /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
     143                            { 
     144                                nRequest = iter.next(); 
     145                            }*/ 
     146                        } 
     147 
     148 
     149                        if( nRequest.getPreference().getO2Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
     150                        { 
     151                            requests.add( addNewRequest( nRequest, (iii+inr+1), "O2" ) ); 
     152                            iter = requests.iterator(); 
     153                            inr = inr + 1; 
     154                            iter = requests.iterator(); 
     155                            /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
     156                            { 
     157                                nRequest = iter.next(); 
     158                            }*/ 
     159                        } 
     160 
     161 
     162                        if( nRequest.getPreference().getO3Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
     163                        { 
     164                            requests.add( addNewRequest( nRequest, (iii+inr+1), "O3" ) ); 
     165                            iter = requests.iterator(); 
     166                            inr = inr + 1; 
     167                            iter = requests.iterator(); 
     168                            /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
     169                            { 
     170                                nRequest = iter.next(); 
     171                            }*/ 
     172                        } 
    102173                    } 
    103174 
    104  
    105                     if( nRequest.getPreference().getCh4Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
     175                    iter = requests.iterator(); 
     176                    indice=indice+1; 
     177                    for (int i = 1 ; i < indice ; i++) 
    106178                    { 
    107                         requests.add( addNewRequest( nRequest, (iii+inr+1), "CH4" ) ); 
    108                         inr = inr + 1; 
    109                         iter = requests.iterator(); 
    110                         /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
    111                         { 
    112                             nRequest = iter.next(); 
    113                         }*/ 
     179                        nRequest = iter.next(); 
    114180                    } 
    115  
    116  
    117                     if( nRequest.getPreference().getCo2Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
     181                } 
     182 
     183 
     184                indice=1; 
     185 
     186                //// 
     187                for( final Request iRequest : requests ) 
     188                { 
     189                    if (iRequest.getValid() != -1) 
    118190                    { 
    119                         requests.add( addNewRequest( nRequest, (iii+inr+1), "CO2" ) ); 
    120                         inr = inr + 1; 
    121                         iter = requests.iterator(); 
    122                         /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
    123                         { 
    124                             nRequest = iter.next(); 
    125                         }*/ 
     191                        final Element request = new Element( "request" ); 
     192                        // Id de la request 
     193                        //final Attribute idR = new Attribute( "Id", (Long) iRequest.getId().toString() ); 
     194                        final Attribute idR = new Attribute( "Id", String.valueOf(indice) ); 
     195                        request.setAttribute( idR ); 
     196 
     197                        // PREFERENCES 
     198                        final Element preferences = new Element( "preferences" ); 
     199 
     200 
     201                        //format 
     202                        final Element format = new Element( "format" ); 
     203                        //final Attribute validF = new Attribute( "valid", iRequest.getPreference().getFormat().getFirstValue() ); 
     204                        final Attribute validF = new Attribute( "valid", "VO,ASCII,FITS,NETCDF" ); 
     205                        format.setAttribute( validF ); 
     206                        format.setText( iRequest.getPreference().getFormat().getSecondValue() ); 
     207                        preferences.addContent( format ); 
     208 
     209 
     210                        //rayleighExtinction 
     211                        final Element rayleighExtinction = new Element( "rayleigh_extinction" ); 
     212                        //final Attribute validR = new Attribute( "valid", iRequest.getPreference().getRayleighExtinction().getFirstValue() ); 
     213                        Attribute validR = new Attribute( "valid", "YES,NO" ); 
     214                        rayleighExtinction.setAttribute( validR ); 
     215                        rayleighExtinction.setText( iRequest.getPreference().getRayleighExtinction().getSecondValue() ); 
     216                        preferences.addContent( rayleighExtinction ); 
     217 
     218                        //h2o 
     219                        final Element h2oe = new Element( "h2o_extinction" ); 
     220                        validR = new Attribute( "valid", "YES,NO" ); 
     221                        h2oe.setAttribute( validR ); 
     222                        h2oe.setText( iRequest.getPreference().getH2oExtinction().getSecondValue() ); 
     223                        preferences.addContent( h2oe ); 
     224 
     225 
     226                        //o3 
     227                        final Element o3e = new Element( "o3_extinction" ); 
     228                        validR = new Attribute( "valid", "YES,NO" ); 
     229                        o3e.setAttribute( validR ); 
     230                        o3e.setText( iRequest.getPreference().getO3Extinction().getSecondValue() ); 
     231                        preferences.addContent( o3e ); 
     232 
     233                        //o2 
     234                        final Element o2e = new Element( "o2_extinction" ); 
     235                        validR = new Attribute( "valid", "YES,NO" ); 
     236                        o2e.setAttribute( validR ); 
     237                        o2e.setText( iRequest.getPreference().getO2Extinction().getSecondValue() ); 
     238                        preferences.addContent( o2e ); 
     239 
     240 
     241                        //co2 
     242                        final Element co2e = new Element( "co2_extinction" ); 
     243                        validR = new Attribute( "valid", "YES,NO" ); 
     244                        co2e.setAttribute( validR ); 
     245                        co2e.setText( iRequest.getPreference().getCo2Extinction().getSecondValue() ); 
     246                        preferences.addContent( co2e ); 
     247 
     248                        //ch4 
     249                        final Element ch4e = new Element( "ch4_extinction" ); 
     250                        validR = new Attribute( "valid", "YES,NO" ); 
     251                        ch4e.setAttribute( validR ); 
     252                        ch4e.setText( iRequest.getPreference().getCh4Extinction().getSecondValue() ); 
     253                        preferences.addContent( ch4e ); 
     254 
     255                        //no2 
     256                        final Element n2oe = new Element( "n2o_extinction" ); 
     257                        validR = new Attribute( "valid", "YES,NO" ); 
     258                        n2oe.setAttribute( validR ); 
     259                        n2oe.setText( iRequest.getPreference().getN2oExtinction().getSecondValue() ); 
     260                        preferences.addContent( n2oe ); 
     261 
     262 
     263                        request.addContent( preferences ); 
     264 
     265                        // OBSERVATORIES 
     266                        final Element observation = new Element( "observation" ); 
     267 
     268                        // date mesure 
     269                        final Element mdate = new Element( "date" ); 
     270                        final Calendar calendar = Calendar.getInstance(); 
     271 
     272                        calendar.setTimeInMillis( Long.valueOf( iRequest.getObservation().getDate() ) ); 
     273                        final String dateFormatFinal=DateHelper.formatDate( calendar.getTime(), DateHelper.DATE_UTC ); 
     274 
     275                        mdate.setText( dateFormatFinal ); 
     276 
     277                        //mdate.setText( iRequest.getObservation().getDate() ); 
     278                        observation.addContent( mdate ); 
     279 
     280                        //observatoire ou lieu libre en indiquant alt,lat,lon 
     281                        final Element observatory = new Element( "observatory" ); 
     282                        observation.addContent( observatory ); 
     283 
     284                        //recuperation des coordonnées de l'observatoire 
     285                        final Observatory obs; 
     286                        try 
     287                        { 
     288                            //obs = _observatoryDAO.selectByPrimaryKey( iRequest.getObservation().getObservatory().getId() ); 
     289                            obs = _observatoryDAO.getObservatoryByName( iRequest.getObservation().getObservatory().getName() ); 
     290                        } 
     291                        catch( PersistenceException e ) 
     292                        { 
     293                            throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e ); 
     294                        } 
     295 
     296                        ////// a tester //// 
     297 
     298                        final Element name = new Element( "name" ); 
     299 
     300                        final Element longitude = new Element( "longitude" ); 
     301                        validR = new Attribute( "min", "-180" ); 
     302                        longitude.setAttribute( validR ); 
     303                        validR = new Attribute( "max", "180" ); 
     304                        longitude.setAttribute( validR ); 
     305 
     306                        final Element latitude = new Element( "latitude" ); 
     307                        validR = new Attribute( "min", "-90" ); 
     308                        latitude.setAttribute( validR ); 
     309                        validR = new Attribute( "max", "90" ); 
     310                        latitude.setAttribute( validR ); 
     311 
     312                        final Element altitude = new Element( "altitude" ); 
     313                        validR = new Attribute( "min", "0" ); 
     314                        altitude.setAttribute( validR ); 
     315                        validR = new Attribute( "max", "10000" ); 
     316                        altitude.setAttribute( validR ); 
     317 
     318                        String shortName=""; 
     319 
     320                         if (null == obs) 
     321                        { 
     322                            //lieu libre 
     323                            name.setText(iRequest.getObservation().getLocation().getName()); 
     324                            altitude.setText( iRequest.getObservation().getLocation().getAltitude().toString() ); 
     325                            latitude.setText( iRequest.getObservation().getLocation().getLatitude().toString() ); 
     326                            longitude.setText( iRequest.getObservation().getLocation().getLongitude().toString() ); 
     327                            shortName = iRequest.getObservation().getLocation().getName(); 
     328                        } 
     329                        else { 
     330                            //observatoire connu de la bdd tapas 
     331                            name.setText( obs.getName() ); 
     332                            longitude.setText( obs.getLongitude().toString() ); 
     333                            latitude.setText( obs.getLatitude().toString() ); 
     334                            altitude.setText( obs.getAltitude().toString() ); 
     335                            shortName = obs.getShortName().toString(); 
     336                        } 
     337 
     338 
     339                        observatory.addContent( name ); 
     340                        observatory.addContent( latitude ); 
     341                        observatory.addContent( longitude ); 
     342                        observatory.addContent( altitude ); 
     343 
     344 
     345                        //los           addN 
     346                        final Element los = new Element( "los" ); 
     347                        observation.addContent( los ); 
     348 
     349                        Los temp = iRequest.getObservation().getLos(); 
     350                        if ( !temp.getRaJ2000().equals( "" )) { 
     351                            final Element ra_j2000 = new Element( "ra_j2000" ); 
     352                            ra_j2000.setText( iRequest.getObservation().getLos().getRaJ2000() ); 
     353                            los.addContent( ra_j2000 ); 
     354                        } 
     355 
     356                        if ( !temp.getDecJ2000().equals( "" )) { 
     357                            final Element dec_j2000 = new Element( "dec_j2000" ); 
     358                            dec_j2000.setText( iRequest.getObservation().getLos().getDecJ2000() ); 
     359                            los.addContent( dec_j2000 ); 
     360                        } 
     361 
     362 
     363                        if ( !temp.getZenithAngle().equals("") ) { 
     364                            final Element zenith_angle = new Element( "zenith_angle" ); 
     365 
     366                            Attribute a1 = new Attribute( "min", "0" ); 
     367                            Attribute a2 = new Attribute( "max", "90" ); 
     368 
     369                            zenith_angle.setAttribute( a1 ); 
     370                            zenith_angle.setAttribute( a2 ); 
     371                            zenith_angle.setText( temp.getZenithAngle() ); 
     372 
     373                            los.addContent( zenith_angle ); 
     374                        } 
     375 
     376 
     377                        //instrument 
     378                        final Element instrument = new Element( "instrument" ); 
     379                        observation.addContent( instrument ); 
     380 
     381                        final Element spectral_choice = new Element( "spectral_choice" ); 
     382 
     383 
     384                        final String[] tabMess = iRequest.getObservation().getInstrument().getSpectralChoice().getFirstValue().split( "," ); 
     385 
     386                        String chValid = ""; 
     387                        int i; 
     388 
     389                        for( i = 0; i <= tabMess.length - 1; i++ ) //final String mess : tabMess ) 
     390                        { 
     391                            if( i == tabMess.length - 1 ) 
     392                                chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ); 
     393                            else chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ) + ","; 
     394                        } 
     395 
     396 
     397                        Attribute a3 = new Attribute( "valid", chValid ); 
     398 
     399                        spectral_choice.setAttribute( a3 ); 
     400                        final String message = EtherHelper.getMessage( "label.spectralUnit." + iRequest.getObservation().getInstrument().getSpectralChoice().getSecondValue(), null ); 
     401                        spectral_choice.setText( message ); 
     402                        instrument.addContent( spectral_choice ); 
     403 
     404                        final Element spectral_range = new Element( "spectral_range" ); 
     405                        spectral_range.setText( iRequest.getObservation().getInstrument().getSpectralRange() ); 
     406                        instrument.addContent( spectral_range ); 
     407 
     408 
     409                        // 
     410                        final Element ilsfChoice = new Element( "ilsf_choice" ); 
     411                        validR = new Attribute( "valid", iRequest.getObservation().getInstrument().getIlsfChoice().getFirstValue() ); 
     412                        ilsfChoice.setAttribute( validR ); 
     413                        //selectInstrumentalFunctions 
     414                        ilsfChoice.setText( String.valueOf( iRequest.getObservation().getInstrument().getIlsfChoice().getSecondValue() ) ); 
     415                        instrument.addContent( ilsfChoice ); 
     416 
     417 
     418                        final Element resolvingPower = new Element( "resolving_power" ); 
     419                        validR = new Attribute( "min", "0" ); 
     420                        resolvingPower.setAttribute( validR ); 
     421                        resolvingPower.setText( String.valueOf( iRequest.getObservation().getInstrument().getResolvingPower().getSecondValue() ) ); 
     422                        instrument.addContent( resolvingPower ); 
     423 
     424                        final Element samplingRatio = new Element( "sampling_ratio" ); 
     425                        validR = new Attribute( "min", "0" ); 
     426                        samplingRatio.setAttribute( validR ); 
     427                        samplingRatio.setText( String.valueOf( iRequest.getObservation().getInstrument().getSamplingRatio().getSecondValue() ) ); 
     428                        instrument.addContent( samplingRatio ); 
     429 
     430                        //berv correction 
     431                        //final Element bervCorr = new Element( "berv_correction" ); 
     432                        final Element bervCorr = new Element( "apply_berv" ); 
     433                        validR = new Attribute( "valid", "YES,NO" ); 
     434                        bervCorr.setAttribute( validR ); 
     435                        bervCorr.setText( iRequest.getPreference().getBervCorrection().getSecondValue() ); 
     436                        instrument.addContent( bervCorr ); 
     437 
     438 
     439                        request.addContent( observation ); 
     440 
     441                        //atmosphere 
     442                        final Element atmosphere = new Element( "atmosphere" ); 
     443                        request.addContent( atmosphere ); 
     444 
     445                        //reference 
     446                        final Element reference = new Element( "reference" ); 
     447                        validR = new Attribute( "valid", "0,1,2,3,4,5,6" ); 
     448                        reference.setAttribute( validR ); 
     449                        reference.setText( String.valueOf( iRequest.getAtmosphere().getReference().getSecondValue() ) ); 
     450                        atmosphere.addContent( reference ); 
     451 
     452 
     453                        String fileArletty = "", fileECMWF = ""; 
     454 
     455 
     456                        fileArletty = dataPath + "/" + createFileName( dateFormatFinal , "arletty", shortName ); 
     457                        fileECMWF = dataPath + "/" + createFileName( dateFormatFinal, "ecmwf", shortName ); 
     458 
     459                        final Element arlettyFile = new Element( "arletty_file" ); 
     460                        arlettyFile.setText( fileArletty ); 
     461                        atmosphere.addContent( arlettyFile ); 
     462 
     463                        final Element ecmwfFile = new Element( "ecmwf_file" ); 
     464                        ecmwfFile.setText( fileECMWF ); 
     465                        atmosphere.addContent( ecmwfFile ); 
     466 
     467                        listRequest.add( request ); 
     468 
     469                        indice=indice+1; 
    126470                    } 
    127  
    128  
    129                     if( nRequest.getPreference().getN2oExtinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
    130                     { 
    131                         requests.add( addNewRequest( nRequest, (iii+inr+1), "N2O" ) ); 
    132                         inr = inr + 1; 
    133                         iter = requests.iterator(); 
    134                         /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
    135                         { 
    136                             nRequest = iter.next(); 
    137                         }*/ 
    138                     } 
    139  
    140  
    141                     if( nRequest.getPreference().getO2Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
    142                     { 
    143                         requests.add( addNewRequest( nRequest, (iii+inr+1), "O2" ) ); 
    144                         iter = requests.iterator(); 
    145                         inr = inr + 1; 
    146                         iter = requests.iterator(); 
    147                         /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
    148                         { 
    149                             nRequest = iter.next(); 
    150                         }*/ 
    151                     } 
    152  
    153  
    154                     if( nRequest.getPreference().getO3Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 
    155                     { 
    156                         requests.add( addNewRequest( nRequest, (iii+inr+1), "O3" ) ); 
    157                         iter = requests.iterator(); 
    158                         inr = inr + 1; 
    159                         iter = requests.iterator(); 
    160                         /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 
    161                         { 
    162                             nRequest = iter.next(); 
    163                         }*/ 
    164                     } 
    165                 } 
    166  
    167                 iter = requests.iterator(); 
    168                 indice=indice+1; 
    169                 for (int i = 1 ; i < indice ; i++) 
    170                 { 
    171                     nRequest = iter.next(); 
    172                 } 
    173             } 
    174  
    175  
    176             indice=1; 
    177  
    178             //// 
    179             for( final Request iRequest : requests ) 
    180             { 
    181                 if (iRequest.getValid() != -1) { 
    182  
    183                     final Element request = new Element( "request" ); 
    184                     // Id de la request 
    185                     //final Attribute idR = new Attribute( "Id", (Long) iRequest.getId().toString() ); 
    186                     final Attribute idR = new Attribute( "Id", String.valueOf(indice) ); 
    187                     request.setAttribute( idR ); 
    188  
    189                     // PREFERENCES 
    190                     final Element preferences = new Element( "preferences" ); 
    191  
    192  
    193                     //format 
    194                     final Element format = new Element( "format" ); 
    195                     //final Attribute validF = new Attribute( "valid", iRequest.getPreference().getFormat().getFirstValue() ); 
    196                     final Attribute validF = new Attribute( "valid", "VO,ASCII,FITS,NETCDF" ); 
    197                     format.setAttribute( validF ); 
    198                     format.setText( iRequest.getPreference().getFormat().getSecondValue() ); 
    199                     preferences.addContent( format ); 
    200  
    201  
    202                     //rayleighExtinction 
    203                     final Element rayleighExtinction = new Element( "rayleigh_extinction" ); 
    204                     //final Attribute validR = new Attribute( "valid", iRequest.getPreference().getRayleighExtinction().getFirstValue() ); 
    205                     Attribute validR = new Attribute( "valid", "YES,NO" ); 
    206                     rayleighExtinction.setAttribute( validR ); 
    207                     rayleighExtinction.setText( iRequest.getPreference().getRayleighExtinction().getSecondValue() ); 
    208                     preferences.addContent( rayleighExtinction ); 
    209  
    210                     //h2o 
    211                     final Element h2oe = new Element( "h2o_extinction" ); 
    212                     validR = new Attribute( "valid", "YES,NO" ); 
    213                     h2oe.setAttribute( validR ); 
    214                     h2oe.setText( iRequest.getPreference().getH2oExtinction().getSecondValue() ); 
    215                     preferences.addContent( h2oe ); 
    216  
    217  
    218                     //o3 
    219                     final Element o3e = new Element( "o3_extinction" ); 
    220                     validR = new Attribute( "valid", "YES,NO" ); 
    221                     o3e.setAttribute( validR ); 
    222                     o3e.setText( iRequest.getPreference().getO3Extinction().getSecondValue() ); 
    223                     preferences.addContent( o3e ); 
    224  
    225                     //o2 
    226                     final Element o2e = new Element( "o2_extinction" ); 
    227                     validR = new Attribute( "valid", "YES,NO" ); 
    228                     o2e.setAttribute( validR ); 
    229                     o2e.setText( iRequest.getPreference().getO2Extinction().getSecondValue() ); 
    230                     preferences.addContent( o2e ); 
    231  
    232  
    233                     //co2 
    234                     final Element co2e = new Element( "co2_extinction" ); 
    235                     validR = new Attribute( "valid", "YES,NO" ); 
    236                     co2e.setAttribute( validR ); 
    237                     co2e.setText( iRequest.getPreference().getCo2Extinction().getSecondValue() ); 
    238                     preferences.addContent( co2e ); 
    239  
    240                     //ch4 
    241                     final Element ch4e = new Element( "ch4_extinction" ); 
    242                     validR = new Attribute( "valid", "YES,NO" ); 
    243                     ch4e.setAttribute( validR ); 
    244                     ch4e.setText( iRequest.getPreference().getCh4Extinction().getSecondValue() ); 
    245                     preferences.addContent( ch4e ); 
    246  
    247                     //no2 
    248                     final Element n2oe = new Element( "n2o_extinction" ); 
    249                     validR = new Attribute( "valid", "YES,NO" ); 
    250                     n2oe.setAttribute( validR ); 
    251                     n2oe.setText( iRequest.getPreference().getN2oExtinction().getSecondValue() ); 
    252                     preferences.addContent( n2oe ); 
    253  
    254  
    255                     request.addContent( preferences ); 
    256  
    257                     // OBSERVATORIES 
    258                     final Element observation = new Element( "observation" ); 
    259  
    260                     // date mesure 
    261                     final Element mdate = new Element( "date" ); 
    262                     final Calendar calendar = Calendar.getInstance(); 
    263  
    264                     calendar.setTimeInMillis( Long.valueOf( iRequest.getObservation().getDate() ) ); 
    265                     final String dateFormatFinal=DateHelper.formatDate( calendar.getTime(), DateHelper.DATE_UTC ); 
    266  
    267                     mdate.setText( dateFormatFinal ); 
    268  
    269                     //mdate.setText( iRequest.getObservation().getDate() ); 
    270                     observation.addContent( mdate ); 
    271  
    272                     //observatoire ou lieu libre en indiquant alt,lat,lon 
    273                     final Element observatory = new Element( "observatory" ); 
    274                     observation.addContent( observatory ); 
    275  
    276                     //recuperation des coordonnées de l'observatoire 
    277                     final Observatory obs; 
    278                     try 
    279                     { 
    280                         //obs = _observatoryDAO.selectByPrimaryKey( iRequest.getObservation().getObservatory().getId() ); 
    281                         obs = _observatoryDAO.getObservatoryByName( iRequest.getObservation().getObservatory().getName() ); 
    282                     } 
    283                     catch( PersistenceException e ) 
    284                     { 
    285                         throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e ); 
    286                     } 
    287  
    288                     ////// a tester //// 
    289  
    290                     final Element name = new Element( "name" ); 
    291  
    292                     final Element longitude = new Element( "longitude" ); 
    293                     validR = new Attribute( "min", "-180" ); 
    294                     longitude.setAttribute( validR ); 
    295                     validR = new Attribute( "max", "180" ); 
    296                     longitude.setAttribute( validR ); 
    297  
    298                     final Element latitude = new Element( "latitude" ); 
    299                     validR = new Attribute( "min", "-90" ); 
    300                     latitude.setAttribute( validR ); 
    301                     validR = new Attribute( "max", "90" ); 
    302                     latitude.setAttribute( validR ); 
    303  
    304                     final Element altitude = new Element( "altitude" ); 
    305                     validR = new Attribute( "min", "0" ); 
    306                     altitude.setAttribute( validR ); 
    307                     validR = new Attribute( "max", "10000" ); 
    308                     altitude.setAttribute( validR ); 
    309  
    310                     String shortName=""; 
    311  
    312                      if (null == obs) 
    313                     { 
    314                         //lieu libre 
    315                         name.setText(iRequest.getObservation().getLocation().getName()); 
    316                         altitude.setText( iRequest.getObservation().getLocation().getAltitude().toString() ); 
    317                         latitude.setText( iRequest.getObservation().getLocation().getLatitude().toString() ); 
    318                         longitude.setText( iRequest.getObservation().getLocation().getLongitude().toString() ); 
    319                         shortName = iRequest.getObservation().getLocation().getName(); 
    320                     } 
    321                     else { 
    322                         //observatoire connu de la bdd tapas 
    323                         name.setText( obs.getName() ); 
    324                         longitude.setText( obs.getLongitude().toString() ); 
    325                         latitude.setText( obs.getLatitude().toString() ); 
    326                         altitude.setText( obs.getAltitude().toString() ); 
    327                         shortName = obs.getShortName().toString(); 
    328                     } 
    329  
    330  
    331                     observatory.addContent( name ); 
    332                     observatory.addContent( latitude ); 
    333                     observatory.addContent( longitude ); 
    334                     observatory.addContent( altitude ); 
    335  
    336  
    337                     //los           addN 
    338                     final Element los = new Element( "los" ); 
    339                     observation.addContent( los ); 
    340  
    341                     Los temp = iRequest.getObservation().getLos(); 
    342                     if ( !temp.getRaJ2000().equals( "" )) { 
    343                         final Element ra_j2000 = new Element( "ra_j2000" ); 
    344                         ra_j2000.setText( iRequest.getObservation().getLos().getRaJ2000() ); 
    345                         los.addContent( ra_j2000 ); 
    346                     } 
    347  
    348                     if ( !temp.getDecJ2000().equals( "" )) { 
    349                         final Element dec_j2000 = new Element( "dec_j2000" ); 
    350                         dec_j2000.setText( iRequest.getObservation().getLos().getDecJ2000() ); 
    351                         los.addContent( dec_j2000 ); 
    352                     } 
    353  
    354  
    355                     if ( !temp.getZenithAngle().equals("") ) { 
    356                         final Element zenith_angle = new Element( "zenith_angle" ); 
    357  
    358                         Attribute a1 = new Attribute( "min", "0" ); 
    359                         Attribute a2 = new Attribute( "max", "90" ); 
    360  
    361                         zenith_angle.setAttribute( a1 ); 
    362                         zenith_angle.setAttribute( a2 ); 
    363                         zenith_angle.setText( temp.getZenithAngle() ); 
    364  
    365                         los.addContent( zenith_angle ); 
    366                     } 
    367  
    368  
    369                     //instrument 
    370                     final Element instrument = new Element( "instrument" ); 
    371                     observation.addContent( instrument ); 
    372  
    373                     final Element spectral_choice = new Element( "spectral_choice" ); 
    374  
    375  
    376                     final String[] tabMess = iRequest.getObservation().getInstrument().getSpectralChoice().getFirstValue().split( "," ); 
    377  
    378                     String chValid = ""; 
    379                     int i; 
    380  
    381                     for( i = 0; i <= tabMess.length - 1; i++ ) //final String mess : tabMess ) 
    382                     { 
    383                         if( i == tabMess.length - 1 ) 
    384                             chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ); 
    385                         else chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ) + ","; 
    386                     } 
    387  
    388  
    389                     Attribute a3 = new Attribute( "valid", chValid ); 
    390  
    391                     spectral_choice.setAttribute( a3 ); 
    392                     final String message = EtherHelper.getMessage( "label.spectralUnit." + iRequest.getObservation().getInstrument().getSpectralChoice().getSecondValue(), null ); 
    393                     spectral_choice.setText( message ); 
    394                     instrument.addContent( spectral_choice ); 
    395  
    396                     final Element spectral_range = new Element( "spectral_range" ); 
    397                     spectral_range.setText( iRequest.getObservation().getInstrument().getSpectralRange() ); 
    398                     instrument.addContent( spectral_range ); 
    399  
    400  
    401                     // 
    402                     final Element ilsfChoice = new Element( "ilsf_choice" ); 
    403                     validR = new Attribute( "valid", iRequest.getObservation().getInstrument().getIlsfChoice().getFirstValue() ); 
    404                     ilsfChoice.setAttribute( validR ); 
    405                     //selectInstrumentalFunctions 
    406                     ilsfChoice.setText( String.valueOf( iRequest.getObservation().getInstrument().getIlsfChoice().getSecondValue() ) ); 
    407                     instrument.addContent( ilsfChoice ); 
    408  
    409  
    410                     final Element resolvingPower = new Element( "resolving_power" ); 
    411                     validR = new Attribute( "min", "0" ); 
    412                     resolvingPower.setAttribute( validR ); 
    413                     resolvingPower.setText( String.valueOf( iRequest.getObservation().getInstrument().getResolvingPower().getSecondValue() ) ); 
    414                     instrument.addContent( resolvingPower ); 
    415  
    416                     final Element samplingRatio = new Element( "sampling_ratio" ); 
    417                     validR = new Attribute( "min", "0" ); 
    418                     samplingRatio.setAttribute( validR ); 
    419                     samplingRatio.setText( String.valueOf( iRequest.getObservation().getInstrument().getSamplingRatio().getSecondValue() ) ); 
    420                     instrument.addContent( samplingRatio ); 
    421  
    422                     //berv correction 
    423                     //final Element bervCorr = new Element( "berv_correction" ); 
    424                     final Element bervCorr = new Element( "apply_berv" ); 
    425                     validR = new Attribute( "valid", "YES,NO" ); 
    426                     bervCorr.setAttribute( validR ); 
    427                     bervCorr.setText( iRequest.getPreference().getBervCorrection().getSecondValue() ); 
    428                     instrument.addContent( bervCorr ); 
    429  
    430  
    431                     request.addContent( observation ); 
    432  
    433                     //atmosphere 
    434                     final Element atmosphere = new Element( "atmosphere" ); 
    435                     request.addContent( atmosphere ); 
    436  
    437                     //reference 
    438                     final Element reference = new Element( "reference" ); 
    439                     validR = new Attribute( "valid", "0,1,2,3,4,5,6" ); 
    440                     reference.setAttribute( validR ); 
    441                     reference.setText( String.valueOf( iRequest.getAtmosphere().getReference().getSecondValue() ) ); 
    442                     atmosphere.addContent( reference ); 
    443  
    444  
    445                     String fileArletty = "", fileECMWF = ""; 
    446  
    447  
    448                     fileArletty = dataPath + "/" + createFileName( dateFormatFinal , "arletty", shortName ); 
    449                     fileECMWF = dataPath + "/" + createFileName( dateFormatFinal, "ecmwf", shortName ); 
    450  
    451                     final Element arlettyFile = new Element( "arletty_file" ); 
    452                     arlettyFile.setText( fileArletty ); 
    453                     atmosphere.addContent( arlettyFile ); 
    454  
    455                     final Element ecmwfFile = new Element( "ecmwf_file" ); 
    456                     ecmwfFile.setText( fileECMWF ); 
    457                     atmosphere.addContent( ecmwfFile ); 
    458  
    459                     listRequest.add( request ); 
    460  
    461                     indice=indice+1; 
    462                 } 
    463             } 
    464  
    465  
    466  
    467             ////////// 
    468             ///////// 
    469             /*for( final Request iRequest : requests ) 
    470             { 
    471                 final Element request = new Element( "request" ); 
    472                 // Id de la request 
    473                 final Attribute idR = new Attribute( "Id", iRequest.getId().toString() ); 
    474                 request.setAttribute( idR ); 
    475  
    476                 // PREFERENCES 
    477                 final Element preferences = new Element( "preferences" ); 
    478  
    479  
    480                 //format 
    481                 final Element format = new Element( "format" ); 
    482                 //final Attribute validF = new Attribute( "valid", iRequest.getPreference().getFormat().getFirstValue() ); 
    483                 final Attribute validF = new Attribute( "valid", "VO,ASCII,FITS,NETCDF" ); 
    484                 format.setAttribute( validF ); 
    485                 format.setText( iRequest.getPreference().getFormat().getSecondValue() ); 
    486                 preferences.addContent( format ); 
    487  
    488  
    489                 //rayleighExtinction 
    490                 final Element rayleighExtinction = new Element( "rayleigh_extinction" ); 
    491                 //final Attribute validR = new Attribute( "valid", iRequest.getPreference().getRayleighExtinction().getFirstValue() ); 
    492                 Attribute validR = new Attribute( "valid", "YES,NO" ); 
    493                 rayleighExtinction.setAttribute( validR ); 
    494                 rayleighExtinction.setText( iRequest.getPreference().getRayleighExtinction().getSecondValue() ); 
    495                 preferences.addContent( rayleighExtinction ); 
    496  
    497                 //h2o 
    498                 final Element h2oe = new Element( "h2o_extinction" ); 
    499                 validR = new Attribute( "valid", "YES,NO" ); 
    500                 h2oe.setAttribute( validR ); 
    501                 h2oe.setText( iRequest.getPreference().getH2oExtinction().getSecondValue() ); 
    502                 preferences.addContent( h2oe ); 
    503  
    504  
    505                 //o3 
    506                 final Element o3e = new Element( "o3_extinction" ); 
    507                 validR = new Attribute( "valid", "YES,NO" ); 
    508                 o3e.setAttribute( validR ); 
    509                 o3e.setText( iRequest.getPreference().getO3Extinction().getSecondValue() ); 
    510                 preferences.addContent( o3e ); 
    511  
    512                 //o2 
    513                 final Element o2e = new Element( "o2_extinction" ); 
    514                 validR = new Attribute( "valid", "YES,NO" ); 
    515                 o2e.setAttribute( validR ); 
    516                 o2e.setText( iRequest.getPreference().getO2Extinction().getSecondValue() ); 
    517                 preferences.addContent( o2e ); 
    518  
    519  
    520                 //co2 
    521                 final Element co2e = new Element( "co2_extinction" ); 
    522                 validR = new Attribute( "valid", "YES,NO" ); 
    523                 co2e.setAttribute( validR ); 
    524                 co2e.setText( iRequest.getPreference().getCo2Extinction().getSecondValue() ); 
    525                 preferences.addContent( co2e ); 
    526  
    527                 //ch4 
    528                 final Element ch4e = new Element( "ch4_extinction" ); 
    529                 validR = new Attribute( "valid", "YES,NO" ); 
    530                 ch4e.setAttribute( validR ); 
    531                 ch4e.setText( iRequest.getPreference().getCh4Extinction().getSecondValue() ); 
    532                 preferences.addContent( ch4e ); 
    533  
    534                 //no2 
    535                 final Element n2oe = new Element( "n2o_extinction" ); 
    536                 validR = new Attribute( "valid", "YES,NO" ); 
    537                 n2oe.setAttribute( validR ); 
    538                 n2oe.setText( iRequest.getPreference().getN2oExtinction().getSecondValue() ); 
    539                 preferences.addContent( n2oe ); 
    540  
    541  
    542                 request.addContent( preferences ); 
    543  
    544                 // OBSERVATORIES 
    545                 final Element observation = new Element( "observation" ); 
    546  
    547                 // date mesure 
    548                 final Element mdate = new Element( "date" ); 
    549                 final Calendar calendar = Calendar.getInstance(); 
    550  
    551                 calendar.setTimeInMillis( Long.valueOf( iRequest.getObservation().getDate() ) ); 
    552                 final String dateFormatFinal=DateHelper.formatDate( calendar.getTime(), DateHelper.DATE_UTC ); 
    553  
    554                 mdate.setText( dateFormatFinal ); 
    555  
    556     //            mdate.setText( iRequest.getObservation().getDate() ); 
    557                 observation.addContent( mdate ); 
    558  
    559                 //observatoire ou lieu libre en indiquant alt,lat,lon 
    560                 final Element observatory = new Element( "observatory" ); 
    561                 observation.addContent( observatory ); 
    562  
    563                 //recuperation des coordonnées de l'observatoire 
    564                 final Observatory obs; 
    565                 try 
    566                 { 
    567                     //obs = _observatoryDAO.selectByPrimaryKey( iRequest.getObservation().getObservatory().getId() ); 
    568                     obs = _observatoryDAO.getObservatoryByName( iRequest.getObservation().getObservatory().getName() ); 
    569                 } 
    570                 catch( PersistenceException e ) 
    571                 { 
    572                     throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e ); 
    573                 } 
    574  
    575                 ////// a tester //// 
    576  
    577                 final Element name = new Element( "name" ); 
    578  
    579                 final Element longitude = new Element( "longitude" ); 
    580                 validR = new Attribute( "min", "-180" ); 
    581                 longitude.setAttribute( validR ); 
    582                 validR = new Attribute( "max", "180" ); 
    583                 longitude.setAttribute( validR ); 
    584  
    585                 final Element latitude = new Element( "latitude" ); 
    586                 validR = new Attribute( "min", "-90" ); 
    587                 latitude.setAttribute( validR ); 
    588                 validR = new Attribute( "max", "90" ); 
    589                 latitude.setAttribute( validR ); 
    590  
    591                 final Element altitude = new Element( "altitude" ); 
    592                 validR = new Attribute( "min", "0" ); 
    593                 altitude.setAttribute( validR ); 
    594                 validR = new Attribute( "max", "10000" ); 
    595                 altitude.setAttribute( validR ); 
    596  
    597                 String shortName=""; 
    598  
    599                 if (null == obs) 
    600                 { 
    601                     //lieu libre 
    602                     name.setText(iRequest.getObservation().getLocation().getName()); 
    603                     altitude.setText( iRequest.getObservation().getLocation().getAltitude().toString() ); 
    604                     latitude.setText( iRequest.getObservation().getLocation().getLatitude().toString() ); 
    605                     longitude.setText( iRequest.getObservation().getLocation().getLongitude().toString() ); 
    606                     shortName = iRequest.getObservation().getLocation().getName(); 
    607                 } 
    608                 else { 
    609                     //observatoire connu de la bdd tapas 
    610                     name.setText( obs.getName() ); 
    611                     longitude.setText( obs.getLongitude().toString() ); 
    612                     latitude.setText( obs.getLatitude().toString() ); 
    613                     altitude.setText( obs.getAltitude().toString() ); 
    614                     shortName = obs.getShortName().toString(); 
    615                 } 
    616  
    617  
    618                 observatory.addContent( name ); 
    619                 observatory.addContent( latitude ); 
    620                 observatory.addContent( longitude ); 
    621                 observatory.addContent( altitude ); 
    622  
    623  
    624                 //los           addN 
    625                 final Element los = new Element( "los" ); 
    626                 observation.addContent( los ); 
    627  
    628                 Los temp = iRequest.getObservation().getLos(); 
    629                 if ( !temp.getRaJ2000().equals( "" )) { 
    630                     final Element ra_j2000 = new Element( "ra_j2000" ); 
    631                     ra_j2000.setText( iRequest.getObservation().getLos().getRaJ2000() ); 
    632                     los.addContent( ra_j2000 ); 
    633                 } 
    634  
    635                 if ( !temp.getDecJ2000().equals( "" )) { 
    636                     final Element dec_j2000 = new Element( "dec_j2000" ); 
    637                     dec_j2000.setText( iRequest.getObservation().getLos().getDecJ2000() ); 
    638                     los.addContent( dec_j2000 ); 
    639                 } 
    640  
    641  
    642                 if ( !temp.getZenithAngle().equals("") ) { 
    643                     final Element zenith_angle = new Element( "zenith_angle" ); 
    644  
    645                     Attribute a1 = new Attribute( "min", "0" ); 
    646                     Attribute a2 = new Attribute( "max", "90" ); 
    647  
    648                     zenith_angle.setAttribute( a1 ); 
    649                     zenith_angle.setAttribute( a2 ); 
    650                     zenith_angle.setText( temp.getZenithAngle() ); 
    651  
    652                     los.addContent( zenith_angle ); 
    653                 } 
    654  
    655  
    656                 //instrument 
    657                 final Element instrument = new Element( "instrument" ); 
    658                 observation.addContent( instrument ); 
    659  
    660                 final Element spectral_choice = new Element( "spectral_choice" ); 
    661  
    662  
    663                 final String[] tabMess = iRequest.getObservation().getInstrument().getSpectralChoice().getFirstValue().split( "," ); 
    664  
    665                 String chValid = ""; 
    666                 int i; 
    667  
    668                 for( i = 0; i <= tabMess.length - 1; i++ ) //final String mess : tabMess ) 
    669                 { 
    670                     if( i == tabMess.length - 1 ) 
    671                         chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ); 
    672                     else chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ) + ","; 
    673                 } 
    674  
    675  
    676                 Attribute a3 = new Attribute( "valid", chValid ); 
    677  
    678                 spectral_choice.setAttribute( a3 ); 
    679                 final String message = EtherHelper.getMessage( "label.spectralUnit." + iRequest.getObservation().getInstrument().getSpectralChoice().getSecondValue(), null ); 
    680                 spectral_choice.setText( message ); 
    681                 instrument.addContent( spectral_choice ); 
    682  
    683                 final Element spectral_range = new Element( "spectral_range" ); 
    684                 spectral_range.setText( iRequest.getObservation().getInstrument().getSpectralRange() ); 
    685                 instrument.addContent( spectral_range ); 
    686  
    687  
    688                 // 
    689                 final Element ilsfChoice = new Element( "ilsf_choice" ); 
    690                 validR = new Attribute( "valid", iRequest.getObservation().getInstrument().getIlsfChoice().getFirstValue() ); 
    691                 ilsfChoice.setAttribute( validR ); 
    692                 //selectInstrumentalFunctions 
    693                 ilsfChoice.setText( String.valueOf( iRequest.getObservation().getInstrument().getIlsfChoice().getSecondValue() ) ); 
    694                 instrument.addContent( ilsfChoice ); 
    695  
    696  
    697                 final Element resolvingPower = new Element( "resolving_power" ); 
    698                 validR = new Attribute( "min", "0" ); 
    699                 resolvingPower.setAttribute( validR ); 
    700                 resolvingPower.setText( String.valueOf( iRequest.getObservation().getInstrument().getResolvingPower().getSecondValue() ) ); 
    701                 instrument.addContent( resolvingPower ); 
    702  
    703                 final Element samplingRatio = new Element( "sampling_ratio" ); 
    704                 validR = new Attribute( "min", "0" ); 
    705                 samplingRatio.setAttribute( validR ); 
    706                 samplingRatio.setText( String.valueOf( iRequest.getObservation().getInstrument().getSamplingRatio().getSecondValue() ) ); 
    707                 instrument.addContent( samplingRatio ); 
    708  
    709                 //berv correction 
    710                 //final Element bervCorr = new Element( "berv_correction" ); 
    711                 final Element bervCorr = new Element( "apply_berv" ); 
    712                 validR = new Attribute( "valid", "YES,NO" ); 
    713                 bervCorr.setAttribute( validR ); 
    714                 bervCorr.setText( iRequest.getPreference().getBervCorrection().getSecondValue() ); 
    715                 instrument.addContent( bervCorr ); 
    716  
    717  
    718                 request.addContent( observation ); 
    719  
    720                 //atmosphere 
    721                 final Element atmosphere = new Element( "atmosphere" ); 
    722                 request.addContent( atmosphere ); 
    723  
    724                 //reference 
    725                 final Element reference = new Element( "reference" ); 
    726                 validR = new Attribute( "valid", "0,1,2,3,4,5,6" ); 
    727                 reference.setAttribute( validR ); 
    728                 reference.setText( String.valueOf( iRequest.getAtmosphere().getReference().getSecondValue() ) ); 
    729                 atmosphere.addContent( reference ); 
    730  
    731  
    732                 String fileArletty = "", fileECMWF = ""; 
    733  
    734  
    735                 fileArletty = dataPath + "/" + createFileName( dateFormatFinal , "arletty", shortName ); 
    736                 fileECMWF = dataPath + "/" + createFileName( dateFormatFinal, "ecmwf", shortName ); 
    737  
    738                 final Element arlettyFile = new Element( "arletty_file" ); 
    739                 arlettyFile.setText( fileArletty ); 
    740                 atmosphere.addContent( arlettyFile ); 
    741  
    742                 final Element ecmwfFile = new Element( "ecmwf_file" ); 
    743                 ecmwfFile.setText( fileECMWF ); 
    744                 atmosphere.addContent( ecmwfFile ); 
    745  
    746                 listRequest.add( request ); 
    747             }*/ 
    748  
    749  
    750  
    751  
    752             ///// 
    753             /////// 
    754  
    755  
    756  
    757             tapas.addContent( listRequest ); 
    758  
    759             String commandePath = servicePath + "/" + fTapas.getId(); 
    760             createXMLFile( document, commandePath, prop ); 
     471                } 
     472 
     473                tapas.addContent( listRequest ); 
     474 
     475                String commandePath = servicePath + "/" + fTapas.getId(); 
     476                createXMLFile( document, commandePath, prop ); 
     477            } 
     478            else 
     479            { 
     480                fTapas.setId( "Ether_TAPAS_" + String.valueOf( getNumRequest() ) ); 
     481                String commandePath = servicePath + "/" + fTapas.getId(); 
     482                createXMLTextArea( xmlStringContent, commandePath, prop ); 
     483            } 
    761484        } 
    762485 
     
    1063786            { 
    1064787                throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 
     788            } 
     789        } 
     790 
     791        public void createXMLTextArea( final String xmlContent, final String commandePath, final Properties prop ) 
     792        { 
     793            try 
     794            { 
     795                //creation repertoire commande 
     796                try 
     797                { 
     798                    EtherHelper.execProcess( "mkdir -p " + commandePath ); 
     799                } 
     800                catch( FormattedException e ) 
     801                { 
     802                } 
     803 
     804                EtherHelper.pause( 5000 ); 
     805 
     806 
     807                final String fichier = commandePath + "/" + "request.xml"; 
     808                //Remarquez qu'il suffit simplement de créer une instance de FileOutputStream 
     809 
     810                FileOutputStream xmlTextArea = new FileOutputStream( fichier ); 
     811                //avec en argument le nom du fichier pour effectuer la sérialisation. 
     812                byte[] bString = xmlContent.getBytes(); 
     813                xmlTextArea.write(bString); 
     814 
     815                /*try 
     816                { 
     817                    EtherHelper.execProcess( "chmod 755 "+commandePath+"/"+"request.xml" ); 
     818                } 
     819                catch( FormattedException e ) 
     820                { 
     821 
     822                } 
     823 
     824                EtherHelper.pause(7000); 
     825                */ 
     826            } 
     827            catch( IOException ignored ) 
     828            { 
    1065829            } 
    1066830        } 
  • tapas/web/project/formTapas.jsp

    r816 r825  
    1010<%@ taglib prefix="ether" tagdir="/WEB-INF/tags" %> 
    1111 
     12 
     13 
    1214<tiles:insert page="/resources/templates/templateEther.jsp" flush="true"> 
    1315 
     
    1618        <ether:htmlCss cssFile="calendar/anytime"/> 
    1719        <ether:htmlCss cssFile="jquery-ui-1.8.16.custom/jquery-ui-1.8.16.custom"/> 
    18  
    1920    </tiles:put> 
    2021 
     
    7172            tapasTexts["<%=YesNo.YES%>"] = "<spring:message code="app.YES"/>"; 
    7273            tapasTexts["<%=YesNo.NO%>"] = "<spring:message code="app.NO"/>"; 
    73  
    7474 
    7575            tapasTexts["confirm"] = "<spring:message code="label.confirm"/>"; 
     
    129129 
    130130            tapasTexts["text.errcpydate"] = "<spring:message code="text.errcpydate"/>"; 
     131            tapasTexts["text.errcxml"] = "<spring:message code="text.errcxml"/>"; 
    131132 
    132133            tapasTexts["text.selectlocation"] = "<spring:message code="text.selectlocation"/>"; 
     134 
    133135 
    134136            var interfaceTapas = new InterfaceTapas( ${jSonFileFormats}, ${jSonYesNos}, ${jSonObservatories}, ${jSonSpectralUnits}, ${jSonInstrumentalFunctions}, ${jSonClimatoReferences} ); 
     
    139141 
    140142</tiles:insert> 
     143 
     144 
  • tapas/web/project/formTapas_script.jsp

    r817 r825  
    4141        this.tabActive = false; 
    4242        this.numRequest = 1; 
     43        this.optionForm = 1; 
    4344 
    4445 
     
    5960        } 
    6061 
     62 
    6163        // Buttons 
    62         var submitButton = new Button( {value:tapasTexts["label.submitButton"], parent:this.containerCenter, id:"button_submit", className: "tapas1", classNameText:"tapas1_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 
     64        //var submitButton = new Button( {value:tapasTexts["label.submitButton"], parent:this.containerCenter, id:"button_submit", className: "tapas1", classNameText:"tapas1_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 
     65        this.execButton = new Button( {value:tapasTexts["label.submitButton"], parent:this.containerCenter, id:"button_submit", className: "tapas1", classNameText:"tapas1_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 
    6366        this.addRequestButton = new Button( {title:tapasTexts["label.title.add"],value:tapasTexts["label.addButton"], parent:this.containerCenter, id:"button_add", className: "positive", onClick:jQuery.proxy( this.onClickAdd, this )} ); 
    6467        this.delRequestButton = new Button( {title:tapasTexts["label.title.del"],value:tapasTexts["label.delButton"], parent:this.containerCenter, id:"button_del", className: "negative", onClick:jQuery.proxy( this.onClickDel, this )} ); 
    6568        this.delRequestButton.disable(); 
     69        this.execButton.enable(); 
     70        //this.addRequestButton.disable(); 
     71        this.optionButton = new Button( {title:"",value:"XML", parent:this.containerCenter, id:"button_opt", className: "option", onClick:jQuery.proxy( this.onClickOption, this )} ); 
     72 
     73        this.divX = $( document.createElement( "div" ) ); 
     74        this.divX.attr( {id:"divX", class:"xmlInfos"} ); 
     75        this.containerForm.append( this.divX ); 
     76 
     77        var img = $( document.createElement( "img" ) ); 
     78            var a = $( document.createElement( "a" ) ); 
     79 
     80            img.attr( "src", "resources/images/info.png" ); 
     81            img.attr( "width", "19" ); 
     82            a.attr( "style", "cursor:pointer" ); 
     83 
     84            img.bind( "click", ["xmlInfos",450,100,this], this.onClickInfos ); 
     85            a.append( img ); 
     86            this.divX.append( a ); 
     87 
     88 
     89 
    6690 
    6791        this.createForm(); 
    6892 
    6993        this.tabActive = this.createTab(); 
     94 
    7095        this.divE = $( document.createElement( "div" ) ); 
    7196        this.divE.attr( {id:"divErrors", class:"errorsForm"} ); 
     
    85110        this.loadingRequest = new Loading( param ); 
    86111 
    87         var nbr=1; 
    88  
    89         $( '#select_iobservatory_'+this.nbRequest ).bind( 'focus', ["1"], jQuery.proxy(this.locationChoice,this)); 
     112        var nbr = 1; 
     113 
     114        $( '#select_iobservatory_' + this.nbRequest ).bind( 'focus', ["1"], jQuery.proxy( this.locationChoice, this ) ); 
    90115 
    91116        //this.loadingRequest.display(); 
     
    134159            td4.attr( {colspan:5} ); 
    135160            td4.append( inputDate2 ); 
    136             inputDate2.bind( "change", jQuery.proxy(this.checkDate,this)); 
    137             inputDate.bind( "focusin", jQuery.proxy(this.tempDate,this)); 
    138             inputDate.bind( "focusout", jQuery.proxy(this.emptyCpyDate,this)); 
     161            inputDate2.bind( "change", jQuery.proxy( this.checkDate, this ) ); 
     162            inputDate.bind( "focusin", jQuery.proxy( this.tempDate, this ) ); 
     163            inputDate.bind( "focusout", jQuery.proxy( this.emptyCpyDate, this ) ); 
    139164            tr.append( td4 ); 
    140165            containerCalendar.append( tr ); 
     
    208233 
    209234 
     235    createTrUploadFile: function( inputId, container, info ) 
     236    { 
     237        var tr = $( document.createElement( "tr" ) ); 
     238        var td1 = $( document.createElement( "td" ) ); 
     239        var input = $( document.createElement( "textarea") ); 
     240 
     241        input.attr( {id: inputId, class:"containerArea"} ); 
     242 
     243        td1.append( input ); 
     244 
     245        tr.append( td1 ); 
     246        container.append( tr ); 
     247 
     248 
     249        if( info ) 
     250        { 
     251            tapasTexts["label.delButton"] 
     252            //td1.append( texte ); 
     253 
     254        } 
     255 
     256    }, 
     257 
     258 
    210259    createTr: function( texte, inputId, container, textesup, event, champ, ctnb, info ) 
    211260    { 
     
    234283        tr.append( td3 ); 
    235284        container.append( tr ); 
    236  
    237285 
    238286 
     
    258306            tr.append( div ); 
    259307 
    260             if (inputId.match( re2 )) { 
    261                 input.css("backgroundColor", "#bfafd6"); 
    262                 input.attr('disabled','disabled'); 
     308            if( inputId.match( re2 ) ) 
     309            { 
     310                input.css( "backgroundColor", "#bfafd6" ); 
     311                input.attr( 'disabled', 'disabled' ); 
    263312            } 
    264313 
     
    376425        input4.attr( {disabled: true} ); 
    377426 
    378         input1.css("backgroundColor", "#bfafd6"); 
    379         input2.css("backgroundColor", "#bfafd6"); 
    380         input3.css("backgroundColor", "#bfafd6"); 
    381         input4.css("backgroundColor", "#bfafd6"); 
    382  
    383         input1.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 
    384         input2.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 
    385         input3.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 
    386         input4.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 
     427        input1.css( "backgroundColor", "#bfafd6" ); 
     428        input2.css( "backgroundColor", "#bfafd6" ); 
     429        input3.css( "backgroundColor", "#bfafd6" ); 
     430        input4.css( "backgroundColor", "#bfafd6" ); 
     431 
     432        input1.bind( "change", ["2"], jQuery.proxy( this.locationChoice, this ) ); 
     433        input2.bind( "change", ["2"], jQuery.proxy( this.locationChoice, this ) ); 
     434        input3.bind( "change", ["2"], jQuery.proxy( this.locationChoice, this ) ); 
     435        input4.bind( "change", ["2"], jQuery.proxy( this.locationChoice, this ) ); 
    387436 
    388437        td3.html( texte2 ); 
     
    392441 
    393442 
    394  
    395443        /* 
    396         var img = $( document.createElement( "img" ) ); 
    397         var a = $( document.createElement( "a" ) ); 
    398         img.attr( "src", "resources/images/info.png" ); 
    399         img.attr( "width", "19" ); 
    400         a.attr( "style", "cursor:pointer" ); 
    401         img.bind( "click", ["spectral_range",450,100,this], this.onClickInfos ); 
    402         a.append( img ); 
    403         td1.append( a );*/ 
     444         var img = $( document.createElement( "img" ) ); 
     445         var a = $( document.createElement( "a" ) ); 
     446         img.attr( "src", "resources/images/info.png" ); 
     447         img.attr( "width", "19" ); 
     448         a.attr( "style", "cursor:pointer" ); 
     449         img.bind( "click", ["spectral_range",450,100,this], this.onClickInfos ); 
     450         a.append( img ); 
     451         td1.append( a );*/ 
    404452        td1.append( texte1 ); 
    405453 
     
    412460        td7.attr( {class:"containerLabel2"} ); 
    413461        td9.attr( {class:"containerLabel2"} ); 
    414  
    415462 
    416463 
     
    468515                this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ico2eList, false, "yesNos" ); 
    469516            else if( (/^(ich4e_[1-9]+)$/.test( inputId )  ) ) 
    470                     this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ich4eList, false, "yesNos" ); 
     517                this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ich4eList, false, "yesNos" ); 
    471518            else if( (/^(in2oe_[1-9]+)$/.test( inputId )  ) ) 
    472519                this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_in2oeList, false, "yesNos" ); 
    473520            else if( (/^(iOneTransmission_[1-9]+)$/.test( inputId )  ) ) 
     521            { 
    474522                this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_iOneTransmissionList, false, "yesNos" ); 
     523                info = true; 
     524                champ = inputId; 
     525            } 
    475526            else if( (/^(irextinction_[1-9]+)$/.test( inputId )  ) ) 
    476527            { 
     
    516567 
    517568 
    518  
    519569        td1.attr( {class:"containerLabel"} ); 
    520570        tr.append( td1 ); 
    521  
    522  
    523571 
    524572 
     
    556604    requestCreateXML: function() 
    557605    { 
    558         var tapasForm = this.createTapasObject(); 
     606        if (this.optionForm == 1) 
     607                var tapasForm = this.createTapasObject(); 
     608        else 
     609                var tapasForm = this.createFileRequestObject(); 
     610 
    559611        //passage de javascript a json grace au jquery 
    560612        var jsonTapasForm = $.toJSON( tapasForm ); 
    561  
    562613 
    563614        if( jsonTapasForm ) 
     
    568619            } ); 
    569620 
    570     }, 
     621 
     622    }, 
     623 
     624 
     625/* 
     626    requestCreateUploadFileRequest: function() 
     627    { 
     628        var tapasUploadFile = this.createFileRequestObject(); 
     629        var jsonTapasUploadFile = $.toJSON( tapasUploadFile ); 
     630 
     631        if( jsonTapasUploadFile ) 
     632            $.ajax( { 
     633                            contentType: 'multipart/form-data', 
     634                            dataType: 'html', 
     635                            url: "data?methodName=uploadFile&jsonTapas=" + jsonTapasUploadFile, 
     636                            type: 'POST'//, 
     637            } ); 
     638    }, 
     639*/ 
    571640 
    572641 
     
    575644    { 
    576645        this.loadingRequest.hide(); 
    577         //this.loadingRequest.display(); 
     646        this.execButton.enable(); 
     647        this.optionButton.enable(); 
    578648 
    579649        var res = jQuery.parseJSON( result ).result; 
     
    748818                width = 600; 
    749819                height = 360; 
     820            } 
     821        } 
     822 
     823 
     824        var re = new RegExp( "xmlInfos" ); 
     825        if( parametre.match( re ) ) 
     826        { 
     827            var titre = "Requ&ecirc;te XML"; 
     828            var pageInfo = "resources/doc/infosXml_fr.txt"; 
     829            width = 600; 
     830            height = 450; 
     831            if( "fr" != context.language ) 
     832            { 
     833                titre = "XML request"; 
     834                pageInfo = "resources/doc/infosXml_en.txt"; 
     835                width = 600; 
     836                height = 450; 
     837            } 
     838        } 
     839 
     840        var re = new RegExp( "iOneTransmission_" ); 
     841        if( parametre.match( re ) ) 
     842        { 
     843            var titre = "S&eacute;lection des composants atmosph&eacute;riques"; 
     844            var pageInfo = "resources/doc/infosTransmission_fr.txt"; 
     845            width = 600; 
     846            height = 200; 
     847            if( "fr" != context.language ) 
     848            { 
     849                titre = "Selection of atmospheric constituents"; 
     850                pageInfo = "resources/doc/infosTransmission_en.txt"; 
     851                width = 600; 
     852                height = 200; 
    750853            } 
    751854        } 
     
    827930    onClickSubmit: function() 
    828931    { 
     932        var test = 12; 
    829933        if( this.validFields() ) 
    830934        { 
     
    833937            { 
    834938                this.loadingRequest.display(); 
     939                this.execButton.disable(); 
     940                this.optionButton.disable(); 
    835941                this.requestCreateXML(); 
    836942            } 
     
    854960 
    855961        this.updateButtons(); 
     962    }, 
     963 
     964 
     965    onClickOption: function() 
     966    { 
     967 
     968        if (this.optionForm == 1) 
     969        { 
     970            $( ".divObservation" ).hide(); 
     971            $( ".divPreference" ).hide(); 
     972            $( ".divUploadFile").show(); 
     973            $( "#button_opt" ).html('FORM') ; 
     974            this.optionForm=0; 
     975            this.addRequestButton.disable(); 
     976            this.delRequestButton.disable() 
     977            this.displayRequests(1); 
     978            $( "#tab_request" + this.numRequest ).html( "Request 1" ); 
     979            this.divE.hide(); 
     980        } 
     981        else 
     982        { 
     983            $( ".divObservation" ).show(); 
     984            $( ".divPreference" ).show(); 
     985            $( ".divUploadFile").hide(); 
     986            $( "#button_opt" ).html('XML') ; 
     987            this.optionForm=1; 
     988            this.addRequestButton.enable(); 
     989            if (this.nbRequest > 1) this.delRequestButton.enable(); 
     990            this.displayRequests(0); 
     991            $( "#icxml_"+this.numRequest ).val(""); 
     992            this.divE.hide(); 
     993            $( "#tab_request" + this.numRequest ).html( "Request " + this.numRequest ); 
     994        } 
     995 
    856996    }, 
    857997 
     
    9431083                    AnyTime.noPicker( "iobservation_date_" + i ); 
    9441084 
    945                     if (!isEmpty($( "#iobservation_cpydate_" + i ).val())) { 
     1085                    if( !isEmpty( $( "#iobservation_cpydate_" + i ).val() ) ) 
     1086                    { 
    9461087                        var oldDate2 = this.calendarConverter.parse( $( "#iobservation_cpydate_" + i ).val() ); 
    9471088                        AnyTime.noPicker( "iobservation_cpydate_" + i ); 
     
    9531094                    $( "#iobservation_cpydate_" + i ).attr( {id:"iobservation_cpydate_" + z} ); 
    9541095                    this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], tapasTexts["label.cpydatemesure"], "iobservation_date_" + z, "iobservation_cpydate_" + z, oldDate, false ); 
    955  
    9561096 
    9571097 
     
    9821122 
    9831123 
     1124    displayRequests: function(flag) 
     1125    { 
     1126 
     1127        var numr = this.nbRequest; 
     1128 
     1129        if (numr > 1) 
     1130        { 
     1131            for( var numCurrent = 1; numCurrent <= this.nbRequest; numCurrent++ ) 
     1132                if (numCurrent != this.numRequest) 
     1133                { 
     1134                    if (flag == 1) $( "#tab_request"+numCurrent.toString() ).hide(); 
     1135                    else  $( "#tab_request"+numCurrent.toString() ).show(); 
     1136                } 
     1137        } 
     1138 
     1139    }, 
     1140 
     1141 
    9841142    onClickTab: function( event ) 
    9851143    { 
     
    10271185                    break; 
    10281186                case "instrumentalFunctions" : 
    1029                     select.add( jsonElement.value, tapasTexts[jsonElement.text],jQuery.proxy(this.ifunctionChoice,this) );     // passe le gros this 
     1187                    select.add( jsonElement.value, tapasTexts[jsonElement.text], jQuery.proxy( this.ifunctionChoice, this ) );     // passe le gros this 
    10301188                    break; 
    10311189                case "climatoReferences" : 
     
    11201278    createForm: function() 
    11211279    { 
    1122  
    11231280        var divAll = $( document.createElement( "div" ) ); 
    11241281        divAll.attr( {id:"all_" + this.nbRequest, class:"divAll"} ); 
    1125  
    11261282 
    11271283        //Creation div 
     
    11351291        tabObservation.attr( {id:"tabObservation_" + this.nbRequest, cellspacing:3} ); 
    11361292 
     1293        //Creation div 
     1294        var divUploadFile = $( document.createElement( "div" ) ); 
     1295        var tabUploadFile = $( document.createElement( "table" ) ); 
     1296        tabUploadFile.attr( {cellspacing:3} ); 
     1297 
    11371298 
    11381299        var divAtmosphere = $( document.createElement( "div" ) ); 
    11391300        var tabAtmosphere = $( document.createElement( "table" ) ); 
    1140  
    11411301 
    11421302        var fieldSetObservation = $( document.createElement( "fieldset" ) ); 
     
    11581318        legendPreference.addClass( "containerField" ); 
    11591319 
     1320        var fieldSetUploadFile = $( document.createElement( "fieldset" ) ); 
     1321        fieldSetUploadFile.addClass( "cfs4" ); 
     1322        divUploadFile.append( fieldSetUploadFile ); 
     1323 
     1324        var legendUploadFile = $( document.createElement( "legend" ) ); 
     1325        //legendUploadFile.html( tapasTexts["label.preferences"] ); 
     1326        //fieldSetPreference.append( legendPreference ); 
     1327        //legendPreference.addClass( "containerField" ); 
     1328 
    11601329        fieldSetObservation.append( tabObservation ); 
    11611330        divObservation.addClass( "divObservation" ); 
     
    11711340        divAll.append( divPreference ); 
    11721341 
     1342        fieldSetUploadFile.append( tabUploadFile ); 
     1343        divUploadFile.addClass( "divUploadFile" ); 
     1344        divAll.append( divUploadFile ); 
     1345 
    11731346        this.containerForm.append( divAll ); 
    11741347        this.containerForm.append( this.divE ); 
    11751348        //this.tabInput = new Array(3); 
    11761349 
    1177         this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, this.nbRequest, tabPreference, 'format',false,"" ); 
    1178         this.createTrList( tapasTexts["label.berv"], "ibervC_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 
    1179         this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 
    1180         this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 
    1181         this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 
    1182         this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 
    1183         this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 
    1184         this.createTrList( tapasTexts["label.ech4"], "ich4e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 
    1185         this.createTrList( tapasTexts["label.en2o"], "in2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 
    1186         this.createTrList( tapasTexts["label.onetransmission"], "iOneTransmission_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 
    1187  
     1350        this.createTrUploadFile( "icxml_"+this.nbRequest, tabUploadFile, false ); 
     1351 
     1352        this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, this.nbRequest, tabPreference, 'format', false, "" ); 
     1353        this.createTrList( tapasTexts["label.berv"], "ibervC_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno', false, "" ); 
     1354        this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno', false, "" ); 
     1355        this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno', false, "" ); 
     1356        this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno', false, "" ); 
     1357        this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno', false, "" ); 
     1358        this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno', false, "" ); 
     1359        this.createTrList( tapasTexts["label.ech4"], "ich4e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno', false, "" ); 
     1360        this.createTrList( tapasTexts["label.en2o"], "in2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno', false, "" ); 
     1361        this.createTrList( tapasTexts["label.onetransmission"], "iOneTransmission_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno', false, "" ); 
    11881362 
    11891363 
    11901364        this.createTrList( tapasTexts["label.observatory"], "iobservatory_" + this.nbRequest, this.nbRequest, tabObservation, 'observatories', true, "" ); 
    11911365        this.createTrTxt( tapasTexts["label.or"], tabObservation ); 
    1192         this.createTr3Input( tapasTexts["label.locality"], tapasTexts["label.altitude"], tapasTexts["label.latitude"],tapasTexts["label.longitude"],"ilocality_" + this.nbRequest, "ialtitude_" + this.nbRequest, "ilatitude_" + this.nbRequest, "ilongitude_" + this.nbRequest , tabObservation, "[decimal]"," <b>m</b>" ); 
     1366        this.createTr3Input( tapasTexts["label.locality"], tapasTexts["label.altitude"], tapasTexts["label.latitude"], tapasTexts["label.longitude"], "ilocality_" + this.nbRequest, "ialtitude_" + this.nbRequest, "ilatitude_" + this.nbRequest, "ilongitude_" + this.nbRequest, tabObservation, "[decimal]", " <b>m</b>" ); 
    11931367 
    11941368        this.createCalendar( tabObservation, tapasTexts["label.datemesure"], tapasTexts["label.cpydatemesure"], "iobservation_date_" + this.nbRequest, "iobservation_cpydate_" + this.nbRequest, false, true ); 
     
    12001374 
    12011375        //fonction instrumentale 
    1202         this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, this.nbRequest, tabObservation, "ilsf", false, "select"); 
     1376        this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, this.nbRequest, tabObservation, "ilsf", false, "select" ); 
    12031377        //reference climato 
    12041378        //this.createTrList( tapasTexts["label.climato"], "icr", tabAtmosphere, "climatoReference" ); 
    1205         this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, this.nbRequest, tabObservation, "climatoReference", false, ""); 
     1379        this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, this.nbRequest, tabObservation, "climatoReference", false, "" ); 
    12061380 
    12071381        this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "", "", "", "", true ); 
     
    12141388        this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] &deg;", "keypress", "za", "2", true ); 
    12151389 
     1390 
    12161391        this.createAutoCompleteMenuForRegions(); 
    12171392 
    12181393        this.initRequestFields(); 
    12191394 
    1220  
    1221  
    1222  
     1395        $( ".divUploadFile").hide(); 
     1396 
     1397        //divAll.attr("style", "visibility: hidden"); 
    12231398        //jQuery.proxy permet d'envoyer le contexte this courant 
    12241399 
     
    12261401 
    12271402 
    1228  
    1229     createTapasObject: function() 
     1403    createFileRequestObject: function() 
    12301404    { 
    12311405 
     
    12331407        var i = 1; 
    12341408 
    1235  
     1409        /*for( var i = 1; i <= this.nbRequest; i++ ) 
     1410        { */ 
     1411 
     1412            // REQUEST 
     1413            var fileRequest = new Object(); 
     1414            fileRequest.id = 1; 
     1415            fileRequest.cXml = $( "#icxml_"+this.nbRequest).val(); 
     1416 
     1417            requests[0] = fileRequest; 
     1418        //} 
     1419 
     1420        // TAPAS 
     1421        var tapas = new Object(); 
     1422        tapas.requests = requests; 
     1423        return tapas; 
     1424    }, 
     1425 
     1426 
     1427 
     1428    createTapasObject: function() 
     1429    { 
     1430 
     1431        var requests = new Array(); 
     1432        var i = 1; 
    12361433 
    12371434        for( var i = 1; i <= this.nbRequest; i++ ) 
     
    13371534            var observation = new Object(); 
    13381535 
    1339             if (!isEmpty($( "#iobservation_cpydate_" + i ).val()) && isDate($("#iobservation_cpydate_" + i ).val()) ) 
     1536            if( !isEmpty( $( "#iobservation_cpydate_" + i ).val() ) && isDate( $( "#iobservation_cpydate_" + i ).val() ) ) 
    13401537            { 
    13411538                observation.date = this.calendarConverter.parse( $( "#iobservation_cpydate_" + i ).val() ).getTime(); 
     
    13451542                observation.date = this.calendarConverter.parse( $( "#iobservation_date_" + i ).val() ).getTime(); 
    13461543            } 
     1544 
     1545 
     1546            /*observation.uploadRequest = new Object(); 
     1547             observation.uploadRequest.firstValue = "0"; 
     1548             observation.uploadRequest.secondValue = $( "#icxml_" + i ).val();*/ 
    13471549 
    13481550 
     
    13531555            observation.los = los; 
    13541556            observation.instrument = instrument; 
     1557 
    13551558 
    13561559            // ATMOSPHERE 
     
    13691572            request.atmosphere = atmosphere; 
    13701573 
     1574            //request.cXml = ($( "#icxml_" + i ).val()).toString(); 
     1575 
    13711576            requests[i - 1] = request; 
    13721577        } 
     
    13781583    }, 
    13791584 
     1585 
    13801586    validFields: function() 
    13811587    { 
    13821588 
    1383         for( var i = 1; i <= this.nbRequest; i++ ) 
    1384         { 
    1385  
    1386             var chaine = tapasTexts["text.erreur.saisie"] + " " + i + "<br>"; 
    1387             var testOk1 = false; 
    1388             var testOk2 = false; 
    1389             var testOk3 = false; 
    1390  
    1391             testOk1 = isDate( $( "#iobservation_cpydate_" + this.nbRequest ).val() ) || isEmpty( $( "#iobservation_cpydate_" + this.nbRequest ).val() ); 
    1392             if( !testOk1 ) 
     1589        if ( this.optionForm == 0) { 
     1590            var cxml = ($( "#icxml_"+this.numRequest).val()).toString(); 
     1591            if (isEmpty(cxml)) 
    13931592            { 
    13941593                this.divE.hide(); 
    1395                 this.divE.html( chaine + " : " + tapasTexts["text.errcpydate"] ); 
     1594                this.divE.html( tapasTexts["text.errcxml"] ); 
    13961595                this.divE.show(); 
    13971596                return false; 
    13981597            } 
    1399  
    1400  
    1401             //var testOk = isSup( this.selectObservatoriesList[i].getValue(), 0 ); 
    1402             var testOk = isEmpty( $( "#select_iobservatory_" + i ).val() ) || this.listObs.indexOf( $( "#select_iobservatory_" + i ).val() ) < 0; 
    1403             testOk2 = !isEmpty( $( "#ilocality_" + i ).val() ) && isValidNum( $( "#ialtitude_" + i ).val() ) && isValidNum( $( "#ilatitude_" + i ).val() ) && isValidNum( $( "#ilongitude_" + i ).val() ) 
    1404  
    1405             if( testOk && !testOk2) 
     1598            else 
    14061599            { 
    14071600                this.divE.hide(); 
    1408                 this.divE.html( chaine + " " + tapasTexts["text.selectlocation"] ); 
    1409                 this.divE.show(); 
    1410                 return false; 
    1411             } 
    1412  
    1413             testOk = isDiff( this.selectSpectralUnitsList[i].getValue(), -1 ); 
    1414             if( !testOk ) 
    1415             { 
    1416                 this.divE.html( chaine + tapasTexts["label.spectralUnit"] + " : " + tapasTexts["text.toselect"] ); 
    1417                 this.divE.show(); 
    1418                 return false; 
    1419             } 
    1420  
    1421             testOk = isValidRange( $( "#iminspectral_ranger_" + i ).val(), $( "#imaxspectral_ranger_" + i ).val(), this.selectSpectralUnitsList[i].getValue() ); 
    1422             if( !testOk ) 
    1423             { 
    1424                 this.divE.html( chaine + tapasTexts["label.spectralRange"] + " : " + tapasTexts["text.badvalue"] ); 
    1425                 this.divE.show(); 
    1426                 return false; 
    1427             } 
    1428  
    1429             /*testOk = isDeg( $( "#ide_" + i ).val() ); 
    1430              if( !testOk ) 
    1431              { 
    1432              this.divE.html( chaine + tapasTexts["label.ide"] + " : " + tapasTexts["text.badvalue"] ); 
    1433              this.divE.show(); 
    1434              return false; 
    1435              } */ 
    1436  
    1437  
    1438             testOk = isBetween( $( "#iza_" + i ).val(), 0, 90 ); 
    1439             testOk1 = isValidNum( $( "#iza_" + i ).val() ); 
    1440             testOk2 = isDeg( $( "#ide_" + i ).val() ); 
    1441             testOk3 = isHourDeg( $( "#ira_" + i ).val() ); 
    1442             if( !((testOk && testOk1) || (testOk2 && testOk3)) ) 
    1443             { 
    1444                 if( !(testOk && testOk1) ) 
    1445                     this.divE.html( chaine + "LOS : " + tapasTexts["text.badvalue"] ); 
    1446                 else 
    1447                     this.divE.html( chaine + tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 
    1448                 this.divE.show(); 
    1449                 return false; 
    1450             } 
    1451  
    1452             /*testOk = isBetween( $( "#iza_" + i ).val(), 0, 90 ); 
    1453              if( !testOk ) 
    1454              { 
    1455              this.divE.html( chaine + tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 
    1456              this.divE.show(); 
    1457              return false; 
    1458              } */ 
    1459  
    1460  
    1461             testOk = isValidNum( $( "#irp_" + i ).val() ); 
    1462             testOk2 = isSupS( this.selectInstrumentalFunctionsList[i].getValue() , -1 ); 
    1463  
    1464  
    1465             if (testOk2) 
    1466             { 
    1467                 if( !testOk ) 
    1468                 { 
    1469                     this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 
    1470                     this.divE.show(); 
    1471                     return false; 
    1472                 } 
    1473  
    1474                 testOk = isSup( $( "#irp_" + i ).val(), 1 ); 
    1475                 if( !testOk ) 
    1476                 { 
    1477                     this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 
    1478                     this.divE.show(); 
    1479                     return false; 
    1480                 } 
    1481             } 
    1482  
    1483  
    1484             testOk = isValidNum( $( "#isr_" + i ).val() ); 
    1485             if( !testOk ) 
    1486             { 
    1487                 this.divE.html( chaine + tapasTexts["label.ratio"] + " : " + tapasTexts["text.badvalue"] ); 
    1488                 this.divE.show(); 
    1489                 return false; 
    1490             } 
    1491  
    1492             testOk = isSup( $( "#isr_" + i ).val(), 1 ); 
    1493             if( !testOk ) 
    1494             { 
    1495                 this.divE.html( chaine + tapasTexts["label.ratio"] + " : " + tapasTexts["text.badvalue"] ); 
    1496                 this.divE.show(); 
    1497                 return false; 
     1601                return true; 
     1602            } 
     1603 
     1604        } 
     1605        else 
     1606        { 
     1607            for( var i = 1; i <= this.nbRequest; i++ ) 
     1608            { 
     1609                    var chaine = tapasTexts["text.erreur.saisie"] + " " + i + "<br>"; 
     1610                    var testOk1 = false; 
     1611                    var testOk2 = false; 
     1612                    var testOk3 = false; 
     1613 
     1614                    testOk1 = isDate( $( "#iobservation_cpydate_" + i ).val() ) || isEmpty( $( "#iobservation_cpydate_" + i ).val() ); 
     1615                    if( !testOk1 ) 
     1616                    { 
     1617                        this.divE.hide(); 
     1618                        this.divE.html( chaine + " : " + tapasTexts["text.errcpydate"] ); 
     1619                        this.divE.show(); 
     1620                        return false; 
     1621                    } 
     1622 
     1623 
     1624                    //var testOk = isSup( this.selectObservatoriesList[i].getValue(), 0 ); 
     1625                    var testOk = isEmpty( $( "#select_iobservatory_" + i ).val() ) || this.listObs.indexOf( $( "#select_iobservatory_" + i ).val() ) < 0; 
     1626                    testOk2 = !isEmpty( $( "#ilocality_" + i ).val() ) && isValidNum( $( "#ialtitude_" + i ).val() ) && isValidNum( $( "#ilatitude_" + i ).val() ) && isValidNum( $( "#ilongitude_" + i ).val() ) 
     1627 
     1628                    if( testOk && !testOk2 ) 
     1629                    { 
     1630                        this.divE.hide(); 
     1631                        this.divE.html( chaine + " " + tapasTexts["text.selectlocation"] ); 
     1632                        this.divE.show(); 
     1633                        return false; 
     1634                    } 
     1635 
     1636                    testOk = isDiff( this.selectSpectralUnitsList[i].getValue(), -1 ); 
     1637                    if( !testOk ) 
     1638                    { 
     1639                        this.divE.html( chaine + tapasTexts["label.spectralUnit"] + " : " + tapasTexts["text.toselect"] ); 
     1640                        this.divE.show(); 
     1641                        return false; 
     1642                    } 
     1643 
     1644                    testOk = isValidRange( $( "#iminspectral_ranger_" + i ).val(), $( "#imaxspectral_ranger_" + i ).val(), this.selectSpectralUnitsList[i].getValue() ); 
     1645                    if( !testOk ) 
     1646                    { 
     1647                        this.divE.html( chaine + tapasTexts["label.spectralRange"] + " : " + tapasTexts["text.badvalue"] ); 
     1648                        this.divE.show(); 
     1649                        return false; 
     1650                    } 
     1651 
     1652                    /*testOk = isDeg( $( "#ide_" + i ).val() ); 
     1653                     if( !testOk ) 
     1654                     { 
     1655                     this.divE.html( chaine + tapasTexts["label.ide"] + " : " + tapasTexts["text.badvalue"] ); 
     1656                     this.divE.show(); 
     1657                     return false; 
     1658                     } */ 
     1659 
     1660 
     1661                    testOk = isBetween( $( "#iza_" + i ).val(), 0, 90 ); 
     1662                    testOk1 = isValidNum( $( "#iza_" + i ).val() ); 
     1663                    testOk2 = isDeg( $( "#ide_" + i ).val() ); 
     1664                    testOk3 = isHourDeg( $( "#ira_" + i ).val() ); 
     1665                    if( !((testOk && testOk1) || (testOk2 && testOk3)) ) 
     1666                    { 
     1667                        if( !(testOk && testOk1) ) 
     1668                            this.divE.html( chaine + "LOS : " + tapasTexts["text.badvalue"] ); 
     1669                        else 
     1670                            this.divE.html( chaine + tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 
     1671                        this.divE.show(); 
     1672                        return false; 
     1673                    } 
     1674 
     1675                    /*testOk = isBetween( $( "#iza_" + i ).val(), 0, 90 ); 
     1676                     if( !testOk ) 
     1677                     { 
     1678                     this.divE.html( chaine + tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 
     1679                     this.divE.show(); 
     1680                     return false; 
     1681                     } */ 
     1682 
     1683 
     1684                    testOk = isValidNum( $( "#irp_" + i ).val() ); 
     1685                    testOk2 = isSupS( this.selectInstrumentalFunctionsList[i].getValue(), -1 ); 
     1686 
     1687 
     1688                    if( testOk2 ) 
     1689                    { 
     1690                        if( !testOk ) 
     1691                        { 
     1692                            this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 
     1693                            this.divE.show(); 
     1694                            return false; 
     1695                        } 
     1696 
     1697                        testOk = isSup( $( "#irp_" + i ).val(), 1 ); 
     1698                        if( !testOk ) 
     1699                        { 
     1700                            this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 
     1701                            this.divE.show(); 
     1702                            return false; 
     1703                        } 
     1704                    } 
     1705 
     1706 
     1707                    testOk = isValidNum( $( "#isr_" + i ).val() ); 
     1708                    if( !testOk ) 
     1709                    { 
     1710                        this.divE.html( chaine + tapasTexts["label.ratio"] + " : " + tapasTexts["text.badvalue"] ); 
     1711                        this.divE.show(); 
     1712                        return false; 
     1713                    } 
     1714 
     1715                    testOk = isSup( $( "#isr_" + i ).val(), 1 ); 
     1716                    if( !testOk ) 
     1717                    { 
     1718                        this.divE.html( chaine + tapasTexts["label.ratio"] + " : " + tapasTexts["text.badvalue"] ); 
     1719                        this.divE.show(); 
     1720                        return false; 
     1721                    } 
     1722 
    14981723            } 
    14991724        } 
     
    15461771        var valeur = this.selectInstrumentalFunctionsList[this.nbRequest].getValue(); 
    15471772 
    1548         if ( valeur == -1 ) { 
    1549             $( "#irp_" + this.nbRequest ).val(""); 
    1550             $( "#irp_" + this.nbRequest ).css("backgroundColor", "#bfafd6"); 
    1551             $( "#irp_" + this.nbRequest ).attr('disabled','disabled'); 
    1552         } 
    1553         else { 
    1554             $( "#irp_" + this.nbRequest ).css("backgroundColor", "#FFFFFF"); 
    1555             $( "#irp_" + this.nbRequest ).removeAttr('disabled'); 
     1773        if( valeur == -1 ) 
     1774        { 
     1775            $( "#irp_" + this.nbRequest ).val( "" ); 
     1776            $( "#irp_" + this.nbRequest ).css( "backgroundColor", "#bfafd6" ); 
     1777            $( "#irp_" + this.nbRequest ).attr( 'disabled', 'disabled' ); 
     1778        } 
     1779        else 
     1780        { 
     1781            $( "#irp_" + this.nbRequest ).css( "backgroundColor", "#FFFFFF" ); 
     1782            $( "#irp_" + this.nbRequest ).removeAttr( 'disabled' ); 
    15561783        } 
    15571784 
     
    15621789 
    15631790 
    1564     locationChoice: function(ind) 
     1791    locationChoice: function( ind ) 
    15651792    { 
    15661793        var option = ind.data[0].toString(); 
    15671794 
    1568         if ("1" == option) 
    1569         { 
    1570             $( '#ilocality_' + this.nbRequest).val(""); 
    1571             $( '#ialtitude_' + this.nbRequest).val(""); 
    1572             $( '#ilatitude_' + this.nbRequest).val(""); 
    1573             $( '#ilongitude_' + this.nbRequest).val(""); 
     1795        if( "1" == option ) 
     1796        { 
     1797            $( '#ilocality_' + this.nbRequest ).val( "" ); 
     1798            $( '#ialtitude_' + this.nbRequest ).val( "" ); 
     1799            $( '#ilatitude_' + this.nbRequest ).val( "" ); 
     1800            $( '#ilongitude_' + this.nbRequest ).val( "" ); 
    15741801        } 
    15751802        else 
    15761803        { 
    1577             $( '#select_iobservatory_' + this.nbRequest).val(""); 
     1804            $( '#select_iobservatory_' + this.nbRequest ).val( "" ); 
    15781805        } 
    15791806    }, 
     
    15831810    checkDate: function() 
    15841811    { 
    1585         var testOk1 = isDate( $( "#iobservation_cpydate_" + this.nbRequest ).val() ) || isEmpty( $( "#iobservation_cpydate_" + this.nbRequest ).val()) ; 
     1812        var testOk1 = isDate( $( "#iobservation_cpydate_" + this.nbRequest ).val() ) || isEmpty( $( "#iobservation_cpydate_" + this.nbRequest ).val() ); 
    15861813        if( !testOk1 ) 
    15871814        { 
     
    15961823    emptyCpyDate: function() 
    15971824    { 
    1598         if ( this.dateTemp != $( "#iobservation_cpydate_" + this.nbRequest ).val("") ) { 
    1599             $( "#iobservation_cpydate_" + this.nbRequest ).val(""); 
     1825        if( this.dateTemp != $( "#iobservation_cpydate_" + this.nbRequest ).val( "" ) ) 
     1826        { 
     1827            $( "#iobservation_cpydate_" + this.nbRequest ).val( "" ); 
    16001828        } 
    16011829        return true; 
  • tapas/web/resources/css/button.css

    r817 r825  
    7171} 
    7272 
     73/* POSITIVE */ 
     74button.option { 
     75    background-color: #F0FFF0; 
     76    color: #686868; 
     77    border-radius:8px; 
     78} 
     79 
     80button.option:hover { 
     81    //background-color: #E6EFC2; 
     82    border: 1px solid #ff5600; 
     83    color: #ff5600; 
     84} 
     85 
    7386/* NEGATIVE */ 
    7487button.negative { 
  • tapas/web/resources/css/tapas.css

    r819 r825  
    1616/** ********************** CONTAINER ******************** **/ 
    1717/** ***************************************************** **/ 
    18 button.positive, button.negative { 
     18button.positive, button.negative, button.option { 
    1919 
    2020    float: right; 
     
    5454    padding-right: 40px; 
    5555    padding-left: 21px; 
    56     height: 467px; 
     56    height: 479px; 
    5757    margin-left: -26px; 
    5858    margin-top: -23px; 
     
    9090} 
    9191 
     92 
     93 
     94.cfs4 { 
     95    border: 2px solid #E7E6EB; 
     96    border-radius: 8px 8px 8px 8px; 
     97    height: 443px; 
     98    margin-left: -1px; 
     99    margin-top: -1px; 
     100    padding-bottom: 13px; 
     101    padding-left: 21px; 
     102    padding-right: 40px; 
     103    width: 954px; 
     104} 
     105 
    92106.containerForm { 
    93107 
     
    154168    background-color: white; 
    155169    border-radius: 6px 6px 6px 6px; 
    156  
    157  
     170} 
     171 
     172.containerArea { 
     173    font-size: 12px; 
     174    color: #00cc00; 
     175    padding-left: 0px; 
     176    background-color: black; 
     177    border-radius: 6px 6px 12px 6px; 
     178    height:435px; 
     179    width:940px; 
     180    resize:none; 
    158181} 
    159182 
     
    410433 
    411434.errorsForm { 
    412  
    413     -moz-border-radius: 8px; 
    414     -webkit-border-radius: 8px; 
    415     border: 2px solid #cc0000 ; 
    416     color: #cc0000; 
    417     border-radius: 8px 8px 8px 8px ; 
    418     padding:10px; 
    419     margin-left: 727px; 
     435    background: none repeat scroll 0 0 #E7E6EB; 
     436    border: 2px solid #CC0000; 
     437    border-radius: 8px 8px 8px 8px; 
     438    color: #CC0000; 
     439    float: left; 
     440    font-weight: bold; 
     441    margin-left: 1052px; 
     442    margin-right: -232px; 
    420443    margin-top: -137px; 
     444    padding: 10px; 
    421445    text-align: left; 
    422     font-weight: bold; 
    423     float: left; 
    424     background: #e7e6eb; 
    425 } 
    426 Spectral unit : must be selected 
    427 Observatory : must be selected 
     446} 
     447 
     448 
     449.xmlInfos { 
     450   float: left; 
     451    font-weight: bold; 
     452    margin-left: 749px; 
     453    margin-right: -232px; 
     454    margin-top: 455px; 
     455    padding: 10px; 
     456    text-align: left; 
     457    position:absolute; 
     458} 
     459 
     460 
     461 
     462/*Spectral unit : must be selected 
     463Observatory : must be selected   */ 
    428464 
    429465.cfs3 { 
     
    572608    background-image: url(../../resources/icons/transparent_loading.gif); 
    573609    height: 37px; 
    574      margin-top: 462px; 
     610    //margin-top: 462px; 
    575611    //margin-top: 1046px; 
    576612    //margin-left: 21px; 
  • tapas/web/resources/doc/infosTransmission_fr.txt

    r809 r825  
    1 L'utilisateur peut définir le calcul de transmission en fonction de la liste des composants suivants : Rayleigh extinction, O2, ozone, H2O, CO2, CH4, N2O. 
    2 La transmission totale est le résultat de la multiplication de toutes les transmissions sélectionnées.  <br> 
    3 Prochainement, les composants NO2 et NO3 issus d'une climatologie établie à partir des mesures de l'instrument GOMOS / ENVISAT seront également disponibles.<br> 
    4 L'utilisateur peut également sélectionner séparément chaque composant, pour une meilleure identification des lignes observées. Ceci est particuliÚrement 
    5 utile pour obtenir la transmission du H2O séparément car la quantité d'H2O est hautement variable et peut être ajustée en utiisant la loi de la transmission : 
    6 T= T(H2O)**X, où X est le facteur ajusté aux conditions locales d'humidité. Une telle formule doit être appliquée, en principe, uniquement avec la résolution 
    7 la plus élevée possible, l'utilisateur peut lui-même ensuite convoluer par le biais du profil spectral instrumental du spectromÚtre. Ceci est plus précis que d'appliquer 
    8 la loi de la transmission convoluée. 
     1Concerne les 6 gaz H2O, O3, O2, CO2, CH4, N2O.<br> 
     2Quand "En une transmission" est positionné à "Yes", il n'y aura qu'un seul fichier résultat (une seule requête).<br> 
     3Quand "En une transmission" est positionné à "Non", il y aura autant de fichier résultat que de gaz positionné à "Oui". 
     4Dans ce cas chaque fichier résultat prendra en compte une seule extinction de gaz. 
  • tapas/web/resources/templates/templateBackoffice.jsp

    r817 r825  
    55<%@ taglib prefix="ether" tagdir="/WEB-INF/tags" %> 
    66<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 
     7 
     8 
    79 
    810<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
     
    1416 
    1517    <title><tiles:getAsString name="title"/></title> 
     18 
     19 
    1620    <link rel="shortcut icon" href=""> 
    1721 
  • tapas/web/src/com/ether/Controller.java

    r784 r825  
    55import com.ether.annotation.ParamName; 
    66import com.ether.annotation.UseJSON; 
     7 
     8import com.ether.tapas.FileRequest; 
    79import com.ether.tapas.Observatory; 
    810import com.ether.tapas.Tapas; 
     
    1214import org.apache.commons.logging.LogFactory; 
    1315import org.jetbrains.annotations.NotNull; 
     16//import org.springframework.web.bind.annotation.RequestMapping; 
     17//import org.springframework.web.bind.annotation.RequestMethod; 
    1418 
    1519import java.io.File; 
     
    2125import java.util.List; 
    2226import java.util.Properties; 
     27 
     28import java.io.BufferedOutputStream; 
     29import java.io.File; 
     30import java.io.FileOutputStream; 
     31 
     32//import org.springframework.web.bind.annotation.RequestMapping; 
     33//import org.springframework.web.bind.annotation.RequestMethod; 
     34//import org.springframework.web.bind.*; 
     35 
     36 
     37//import org.springframework.web.bind.annotation.ResponseBody; 
     38//import org.springframework.web.bind.annotation.RequestMapping; 
     39//import org.springframework.web.bind.annotation.RequestMethod; 
     40//import org.springframework.web.bind.annotation.RequestParam; 
     41//import org.springframework.web.multipart.MultipartFile; 
    2342 
    2443/** 
     
    81100    { 
    82101 
     102        String test="12444"; 
     103 
    83104        if( null == javaTapas ) 
    84105            throw new WebException( WebException.WebCode.ERROR_JSON_TAPAS_IS_NULL, "Serialization error : jsonTapas is null", WebException.getExceptionThrowable() ); 
    85106 
    86107        final Properties prop = new Properties(); 
    87         final File propertiesFile = new File(WebHelper.PROPERTIES_FILE_PATH + WebHelper.PROPERTIES_FILE); 
    88         try 
    89         { 
    90             final InputStream is = new FileInputStream(propertiesFile); 
     108        final File propertiesFile = new File( WebHelper.PROPERTIES_FILE_PATH + WebHelper.PROPERTIES_FILE ); 
     109        try 
     110        { 
     111            final InputStream is = new FileInputStream( propertiesFile ); 
    91112            prop.load( is ); 
    92113        } 
     
    103124        try 
    104125        { 
     126            javaTapas.setId( test ); 
    105127            getTapasService().createXMLRequest( javaTapas, prop ); 
    106128        } 
     
    110132        } 
    111133 
    112         // creation fichier requete xml 
     134        // creation lien ftp 
    113135        try 
    114136        { 
     
    145167        return result; 
    146168    } 
     169 
     170 
    147171 
    148172    private List<JSONObject> getJSONFileFormat() 
     
    162186    } 
    163187 
     188 
     189 
    164190    private List<JSONObject> getJSONYesNo() 
    165191    { 
     
    177203        return jsonYesNos; 
    178204    } 
     205 
     206 
    179207 
    180208    private List<JSONObject> getJSONSpectralUnit() 
     
    235263    private static final String VIEW_INDEX = "init_en"; 
    236264    private static final String VIEW_FORM_TAPAS = "project/formTapas"; 
     265    private static final String VIEW_UPLOAD = "project/upload"; 
    237266} 
  • tapas/web/src/messages_en.properties

    r816 r825  
    3838text.toselect=must be selected 
    3939text.erreur.saisie=Error form request 
     40text.errcxml=XML code is empty 
    4041 
    4142text.selectlocation=Enter a location correclty (an observatory or a locality with altitude, latitude and longitude) 
     
    182183bo.user.emailNotSend=The email to the user cannot be sent, the email seems not valid : 
    183184 
     185text.xml=Le code requête XML doit strictement respecter les tags. Seules les valeurs entre les tags peuvent être modifiées 
     186Exemple de requete XML que vous devez entrez : 
     187<?xml version="1.0" encoding="UTF-8"?> 
     188<tapas Id="Ether_TAPAS_999"> 
     189  <request Id="1"> 
     190    <preferences> 
     191      <format valid="VO,ASCII,FITS,NETCDF">FITS</format> 
     192      <rayleigh_extinction valid="YES,NO">YES</rayleigh_extinction> 
     193      <h2o_extinction valid="YES,NO">NO</h2o_extinction> 
     194      <o3_extinction valid="YES,NO">YES</o3_extinction> 
     195      <o2_extinction valid="YES,NO">YES</o2_extinction> 
     196      <co2_extinction valid="YES,NO">YES</co2_extinction> 
     197      <ch4_extinction valid="YES,NO">YES</ch4_extinction> 
     198      <n2o_extinction valid="YES,NO">YES</n2o_extinction> 
     199    </preferences> 
     200    <observation> 
     201      <date>2013-11-17T00:41:00.000Z</date> 
     202      <observatory> 
     203        <name>La Palma Roque de los Muchachos Canarias Spain</name> 
     204        <longitude min="-180" max="180">-17.882</longitude> 
     205        <latitude min="-90" max="90">28.76</latitude> 
     206        <altitude min="0" max="10000">2326.0</altitude> 
     207      </observatory> 
     208      <los> 
     209        <ra_j2000>03:42:55</ra_j2000> 
     210        <dec_j2000>47:47:15</dec_j2000> 
     211      </los> 
     212      <instrument> 
     213        <spectral_choice valid="Vacuum Wavelength (nm),Standard Wavelength (nm),Wavenumber (cm-1)">Standard Wavelength (nm)</spectral_choice> 
     214        <spectral_range>350 1000</spectral_range> 
     215        <ilsf_choice valid="-1,createTapa0,1">1</ilsf_choice> 
     216        <resolving_power min="0">115000</resolving_power> 
     217        <sampling_ratio min="0">10</sampling_ratio> 
     218        <appli_berv valid="YES,NO">YES</appli_berv> 
     219      </instrument> 
     220    </observation> 
     221    <atmosphere> 
     222      <reference valid="0,1,2,3,4,5,6">0</reference> 
     223      <arletty_file>/data/tapas///arletty/canr_2013111700.arl</arletty_file> 
     224      <ecmwf_file>/data/tapas///ecmwf/canr_2013111700_qo3.txt</ecmwf_file> 
     225    </atmosphere> 
     226  </request> 
     227</tapas> 
  • tapas/web/src/messages_fr.properties

    r816 r825  
    4444text.toselect=à sélectionner 
    4545text.erreur.saisie=Erreur saisie requête 
     46text.errcxml=code XML vide 
     47text.xml=Le code requête XML doit strictement respecter les tags. Seules les valeurs entre les tags peuvent être modifiées. Exemple de requete XML que vous devez entrez : <?xml version="1.0" encoding="UTF-8"?> 
     48<tapas Id="Ether_TAPAS_999"> 
     49  <request Id="1"> 
     50    <preferences> 
     51      <format valid="VO,ASCII,FITS,NETCDF">FITS</format> 
     52      <rayleigh_extinction valid="YES,NO">YES</rayleigh_extinction> 
     53      <h2o_extinction valid="YES,NO">NO</h2o_extinction> 
     54      <o3_extinction valid="YES,NO">YES</o3_extinction> 
     55      <o2_extinction valid="YES,NO">YES</o2_extinction> 
     56      <co2_extinction valid="YES,NO">YES</co2_extinction> 
     57      <ch4_extinction valid="YES,NO">YES</ch4_extinction> 
     58      <n2o_extinction valid="YES,NO">YES</n2o_extinction> 
     59    </preferences> 
     60    <observation> 
     61      <date>2013-11-17T00:41:00.000Z</date> 
     62      <observatory> 
     63        <name>La Palma Roque de los Muchachos Canarias Spain</name> 
     64        <longitude min="-180" max="180">-17.882</longitude> 
     65        <latitude min="-90" max="90">28.76</latitude> 
     66        <altitude min="0" max="10000">2326.0</altitude> 
     67      </observatory> 
     68      <los> 
     69        <ra_j2000>03:42:55</ra_j2000> 
     70        <dec_j2000>47:47:15</dec_j2000> 
     71      </los> 
     72      <instrument> 
     73        <spectral_choice valid="Vacuum Wavelength (nm),Standard Wavelength (nm),Wavenumber (cm-1)">Standard Wavelength (nm)</spectral_choice> 
     74        <spectral_range>350 1000</spectral_range> 
     75        <ilsf_choice valid="-1,createTapa0,1">1</ilsf_choice> 
     76        <resolving_power min="0">115000</resolving_power> 
     77        <sampling_ratio min="0">10</sampling_ratio> 
     78        <appli_berv valid="YES,NO">YES</appli_berv> 
     79      </instrument> 
     80    </observation> 
     81    <atmosphere> 
     82      <reference valid="0,1,2,3,4,5,6">0</reference> 
     83      <arletty_file>/data/tapas///arletty/canr_2013111700.arl</arletty_file> 
     84      <ecmwf_file>/data/tapas///ecmwf/canr_2013111700_qo3.txt</ecmwf_file> 
     85    </atmosphere> 
     86  </request> 
     87</tapas> 
    4688 
    4789text.selectlocation=Indiquer un lieu correctement (observatoire ou lieu en indiquant altitude,latitude et longitude) 
     
    76118error.ERROR_JSON_TAPAS_IS_NULL=Erreur de création du formulaire Tapas 
    77119 
     120 
    78121label.submitButton=EXECUTER 
    79122label.addButton=+ 
    80123label.delButton=x 
     124label.optionForm=Form 
    81125label.title.add=AJOUTER UNE NOUVELLE REQUETE 
    82126label.title.del=SUPPRIMER LA REQUETE COURANTE 
Note: See TracChangeset for help on using the changeset viewer.