Changeset 816
- Timestamp:
- 03/12/15 12:28:06 (9 years ago)
- Location:
- tapas
- Files:
-
- 1 added
- 24 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
tapas/common/Common.iml
r433 r816 21 21 </library> 22 22 </orderEntry> 23 <orderEntry type="library" name="lib_common" level="project" />23 <orderEntry type="library" exported="" name="lib_common" level="project" /> 24 24 <orderEntry type="library" name="lib_spring" level="project" /> 25 25 <orderEntry type="library" name="lib_hibernate" level="project" /> -
tapas/domain/interface/com/ether/tapas/Location.java
r809 r816 7 7 * @date 19 march 2012 8 8 */ 9 public class Observatory9 public class Location 10 10 { 11 public Integer getId()12 {13 return _id;14 }15 16 public void setId( final Integer id )17 {18 _id = id;19 }20 11 21 12 @NotNull … … 76 67 77 68 78 private Integer _id;79 @NotNull80 69 private String _name; 81 70 @NotNull -
tapas/domain/interface/com/ether/tapas/Observation.java
r445 r816 2 2 3 3 import org.jetbrains.annotations.NotNull; 4 import org.jetbrains.annotations.Nullable; 4 5 5 6 import java.util.Date; … … 22 23 } 23 24 24 @N otNull25 @Nullable 25 26 public Observatory getObservatory() 26 27 { … … 28 29 } 29 30 30 public void setObservatory( @N otNullfinal Observatory observatory )31 public void setObservatory( @Nullable final Observatory observatory ) 31 32 { 32 33 _observatory = observatory; … … 55 56 } 56 57 58 @Nullable 59 public Location getLocation() 60 { 61 return _location; 62 } 63 64 public void setLocation( @Nullable final Location location ) 65 { 66 _location = location; 67 } 68 57 69 @NotNull 58 70 private String _date; 59 @N otNull71 @Nullable 60 72 private Observatory _observatory; 61 73 @NotNull … … 63 75 @NotNull 64 76 private Instrument _instrument; 77 @Nullable 78 private Location _location; 65 79 } -
tapas/domain/interface/com/ether/tapas/Preference.java
r779 r816 72 72 73 73 public void setCo2Extinction( @NotNull final Pair<String, String> co2Extinction ) 74 { 74 { String V1="FALSE"; 75 75 _co2Extinction = co2Extinction; 76 76 } … … 84 84 public void setCh4Extinction( @NotNull final Pair<String, String> ch4Extinction ) 85 85 { 86 _ch4Extinction = ch4Extinction; 86 _ch4Extinction = ch4Extinction; String V1="FALSE"; 87 87 } 88 88 … … 110 110 111 111 @NotNull 112 public Pair<String, String> getOneTransmission() 113 { 114 return _oneTransmission; 115 } 116 117 public void setOneTransmission( @NotNull final Pair<String, String> oneTransmission ) 118 { 119 _oneTransmission = oneTransmission; 120 } 121 122 @NotNull 112 123 private Pair<String, String> _format; 113 124 @NotNull … … 127 138 @NotNull 128 139 private Pair<String, String> _bervCorrection; 140 @NotNull 141 private Pair<String, String> _oneTransmission; 129 142 } -
tapas/domain/interface/com/ether/tapas/Request.java
r401 r816 53 53 } 54 54 55 public int getValid() 56 { 57 return _isValid; 58 } 59 60 public void setValid( final int valid ) 61 { 62 _isValid = valid; 63 } 64 55 65 @NotNull 56 66 private Long _id; 67 private int _isValid; 57 68 @NotNull 58 69 private Preference _preference; -
tapas/service/implementation/com/ether/TapasServiceImpl.java
r783 r816 1 package com.ether; 2 3 import com.ether.dao.ObservatoryDAO; 4 import com.ether.dao.TapasRequestDAO; 5 import com.ether.tapas.Los; 6 import com.ether.tapas.Observatory; 7 import com.ether.tapas.Request; 8 import com.ether.tapas.Tapas; 9 import com.ether.tapas.TapasRequest; 10 import com.ether.user.User; 11 import org.apache.commons.logging.Log; 12 import org.apache.commons.logging.LogFactory; 13 import org.jdom.Attribute; 14 import org.jdom.Document; 15 import org.jdom.Element; 16 import org.jdom.output.Format; 17 import org.jdom.output.XMLOutputter; 18 import org.jetbrains.annotations.NotNull; 19 import org.jetbrains.annotations.Nullable; 20 import org.springframework.beans.factory.annotation.Required; 21 import org.springframework.transaction.annotation.Transactional; 22 23 import java.io.FileOutputStream; 24 import java.io.IOException; 25 import java.text.ParseException; 26 import java.text.SimpleDateFormat; 27 import java.util.ArrayList; 28 import java.util.Calendar; 29 import java.util.Date; 30 import java.util.List; 31 import java.util.Properties; 32 33 //import java.sql.Date; 34 35 /** 36 * @author rboipsl 37 * @date 2 mars 2012 38 */ 39 public class TapasServiceImpl 40 extends BackofficeServiceImpl 41 implements TapasService 42 { 43 @Transactional(readOnly = true) 44 public void createXMLRequest( @NotNull final Tapas fTapas, @NotNull final Properties prop ) 45 throws ServiceException 46 { 47 48 final String servicePath = prop.getProperty( "service_path" ); 49 //final String srcPath = prop.getProperty( "src_path" ); 50 final String dataPath = prop.getProperty( "data_path" ); 51 52 //final String fichier = servicePath + "/" + "request.xml"; 53 final Element tapas = new Element( "tapas" ); 54 final List<Element> listRequest = new ArrayList<Element>( fTapas.getRequests().size() ); 55 56 //On crée un nouveau Document JDOM basé sur la racine que l'on vient de créer 57 final Document document = new Document( tapas ); 58 59 //recuperation valeur id requete (bdd table tapas_request) 60 fTapas.setId( "Ether_TAPAS_" + String.valueOf( getNumRequest() ) ); 61 62 final Attribute id = new Attribute( "Id", fTapas.getId() ); 63 tapas.setAttribute( id ); 64 65 //a terme devient une boucle 66 final List<Request> requests = fTapas.getRequests(); 67 68 for( final Request iRequest : requests ) 69 { 70 71 final Element request = new Element( "request" ); 72 // Id de la request 73 final Attribute idR = new Attribute( "Id", iRequest.getId().toString() ); 74 request.setAttribute( idR ); 75 76 // PREFERENCES 77 final Element preferences = new Element( "preferences" ); 78 79 80 //format 81 final Element format = new Element( "format" ); 82 //final Attribute validF = new Attribute( "valid", iRequest.getPreference().getFormat().getFirstValue() ); 83 final Attribute validF = new Attribute( "valid", "VO,ASCII,FITS,NETCDF" ); 84 format.setAttribute( validF ); 85 format.setText( iRequest.getPreference().getFormat().getSecondValue() ); 86 preferences.addContent( format ); 87 88 89 //rayleighExtinction 90 final Element rayleighExtinction = new Element( "rayleigh_extinction" ); 91 //final Attribute validR = new Attribute( "valid", iRequest.getPreference().getRayleighExtinction().getFirstValue() ); 92 Attribute validR = new Attribute( "valid", "YES,NO" ); 93 rayleighExtinction.setAttribute( validR ); 94 rayleighExtinction.setText( iRequest.getPreference().getRayleighExtinction().getSecondValue() ); 95 preferences.addContent( rayleighExtinction ); 96 97 //h2o 98 final Element h2oe = new Element( "h2o_extinction" ); 99 validR = new Attribute( "valid", "YES,NO" ); 100 h2oe.setAttribute( validR ); 101 h2oe.setText( iRequest.getPreference().getH2oExtinction().getSecondValue() ); 102 preferences.addContent( h2oe ); 103 104 105 //o3 106 final Element o3e = new Element( "o3_extinction" ); 107 validR = new Attribute( "valid", "YES,NO" ); 108 o3e.setAttribute( validR ); 109 o3e.setText( iRequest.getPreference().getO3Extinction().getSecondValue() ); 110 preferences.addContent( o3e ); 111 112 //o2 113 final Element o2e = new Element( "o2_extinction" ); 114 validR = new Attribute( "valid", "YES,NO" ); 115 o2e.setAttribute( validR ); 116 o2e.setText( iRequest.getPreference().getO2Extinction().getSecondValue() ); 117 preferences.addContent( o2e ); 118 119 120 //co2 121 final Element co2e = new Element( "co2_extinction" ); 122 validR = new Attribute( "valid", "YES,NO" ); 123 co2e.setAttribute( validR ); 124 co2e.setText( iRequest.getPreference().getCo2Extinction().getSecondValue() ); 125 preferences.addContent( co2e ); 126 127 //ch4 128 final Element ch4e = new Element( "ch4_extinction" ); 129 validR = new Attribute( "valid", "YES,NO" ); 130 ch4e.setAttribute( validR ); 131 ch4e.setText( iRequest.getPreference().getCh4Extinction().getSecondValue() ); 132 preferences.addContent( ch4e ); 133 134 //no2 135 final Element n2oe = new Element( "n2o_extinction" ); 136 validR = new Attribute( "valid", "YES,NO" ); 137 n2oe.setAttribute( validR ); 138 n2oe.setText( iRequest.getPreference().getN2oExtinction().getSecondValue() ); 139 preferences.addContent( n2oe ); 140 141 142 request.addContent( preferences ); 143 144 // OBSERVATORIES 145 final Element observation = new Element( "observation" ); 146 147 // date mesure 148 final Element mdate = new Element( "date" ); 149 final Calendar calendar = Calendar.getInstance(); 150 151 calendar.setTimeInMillis( Long.valueOf( iRequest.getObservation().getDate() ) ); 152 final String dateFormatFinal=DateHelper.formatDate( calendar.getTime(), DateHelper.DATE_UTC ); 153 154 mdate.setText( dateFormatFinal ); 155 156 // mdate.setText( iRequest.getObservation().getDate() ); 157 observation.addContent( mdate ); 158 159 //observatoire 160 final Element observatory = new Element( "observatory" ); 161 observation.addContent( observatory ); 162 163 //recuperation des coordonnées de l'observatoire 164 final Observatory obs; 165 try 166 { 167 //obs = _observatoryDAO.selectByPrimaryKey( iRequest.getObservation().getObservatory().getId() ); 168 obs = _observatoryDAO.getObservatoryByName( iRequest.getObservation().getObservatory().getName() ); 1 package com.ether; 2 3 import com.ether.dao.ObservatoryDAO; 4 import com.ether.dao.TapasRequestDAO; 5 import com.ether.tapas.Los; 6 import com.ether.tapas.Location; 7 import com.ether.tapas.Observation; 8 import com.ether.tapas.Observatory; 9 import com.ether.tapas.Preference; 10 import com.ether.tapas.Request; 11 import com.ether.tapas.Tapas; 12 import com.ether.tapas.TapasRequest; 13 import com.ether.user.User; 14 import org.apache.commons.logging.Log; 15 import org.apache.commons.logging.LogFactory; 16 import org.jdom.Attribute; 17 import org.jdom.Document; 18 import org.jdom.Element; 19 import org.jdom.output.Format; 20 import org.jdom.output.XMLOutputter; 21 import org.jetbrains.annotations.NotNull; 22 import org.jetbrains.annotations.Nullable; 23 import org.springframework.beans.factory.annotation.Required; 24 import org.springframework.transaction.annotation.Transactional; 25 26 import java.io.FileOutputStream; 27 import java.io.IOException; 28 import java.text.ParseException; 29 import java.text.SimpleDateFormat; 30 import java.util.ArrayList; 31 import java.util.Calendar; 32 import java.util.Date; 33 import java.util.Iterator; 34 import java.util.List; 35 import java.util.Properties; 36 import java.util.StringTokenizer; 37 38 //import java.sql.Date; 39 40 /** 41 * @author rboipsl 42 * @date 2 mars 2012 43 */ 44 public class TapasServiceImpl 45 extends BackofficeServiceImpl 46 implements TapasService 47 { 48 @Transactional(readOnly = true) 49 public void createXMLRequest( @NotNull final Tapas fTapas, @NotNull final Properties prop ) 50 throws ServiceException 51 { 52 final String servicePath = prop.getProperty( "service_path" ); 53 //final String srcPath = prop.getProperty( "src_path" ); 54 final String dataPath = prop.getProperty( "data_path" ); 55 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 84 while ( indice <= iii ) 85 { 86 nRequest = iter.next(); 87 nRequest.setValid( 1 ); 88 89 oneTransmission = nRequest.getPreference().getOneTransmission().getSecondValue(); 90 91 if( oneTransmission.equalsIgnoreCase( "NO" ) ) 92 { 93 nRequest.setValid( -1 ); 94 if( nRequest.getPreference().getH2oExtinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 95 { 96 requests.add( addNewRequest( nRequest, (iii+inr+1), "H2O") ); 97 inr = inr + 1; 98 iter = requests.iterator(); 99 /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 100 { 101 nRequest = iter.next(); 102 }*/ 103 } 104 105 106 if( nRequest.getPreference().getCh4Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 107 { 108 requests.add( addNewRequest( nRequest, (iii+inr+1), "CH4" ) ); 109 inr = inr + 1; 110 iter = requests.iterator(); 111 /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 112 { 113 nRequest = iter.next(); 114 }*/ 115 } 116 117 118 if( nRequest.getPreference().getCo2Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 119 { 120 requests.add( addNewRequest( nRequest, (iii+inr+1), "CO2" ) ); 121 inr = inr + 1; 122 iter = requests.iterator(); 123 /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 124 { 125 nRequest = iter.next(); 126 }*/ 127 } 128 129 130 if( nRequest.getPreference().getN2oExtinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 131 { 132 requests.add( addNewRequest( nRequest, (iii+inr+1), "N2O" ) ); 133 inr = inr + 1; 134 iter = requests.iterator(); 135 /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 136 { 137 nRequest = iter.next(); 138 }*/ 139 } 140 141 142 if( nRequest.getPreference().getO2Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 143 { 144 requests.add( addNewRequest( nRequest, (iii+inr+1), "O2" ) ); 145 iter = requests.iterator(); 146 inr = inr + 1; 147 iter = requests.iterator(); 148 /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 149 { 150 nRequest = iter.next(); 151 }*/ 152 } 153 154 155 if( nRequest.getPreference().getO3Extinction().getSecondValue().equalsIgnoreCase( "Yes" ) ) 156 { 157 requests.add( addNewRequest( nRequest, (iii+inr+1), "O3" ) ); 158 iter = requests.iterator(); 159 inr = inr + 1; 160 iter = requests.iterator(); 161 /*for ( int i=1 ; i <= (iii+inr) ; i++ ) 162 { 163 nRequest = iter.next(); 164 }*/ 165 } 166 } 167 168 iter = requests.iterator(); 169 indice=indice+1; 170 for (int i = 1 ; i < indice ; i++) 171 { 172 nRequest = iter.next(); 173 } 174 } 175 176 177 indice=1; 178 179 //// 180 for( final Request iRequest : requests ) 181 { 182 if (iRequest.getValid() != -1) { 183 184 final Element request = new Element( "request" ); 185 // Id de la request 186 //final Attribute idR = new Attribute( "Id", (Long) iRequest.getId().toString() ); 187 final Attribute idR = new Attribute( "Id", String.valueOf(indice) ); 188 request.setAttribute( idR ); 189 190 // PREFERENCES 191 final Element preferences = new Element( "preferences" ); 192 193 194 //format 195 final Element format = new Element( "format" ); 196 //final Attribute validF = new Attribute( "valid", iRequest.getPreference().getFormat().getFirstValue() ); 197 final Attribute validF = new Attribute( "valid", "VO,ASCII,FITS,NETCDF" ); 198 format.setAttribute( validF ); 199 format.setText( iRequest.getPreference().getFormat().getSecondValue() ); 200 preferences.addContent( format ); 201 202 203 //rayleighExtinction 204 final Element rayleighExtinction = new Element( "rayleigh_extinction" ); 205 //final Attribute validR = new Attribute( "valid", iRequest.getPreference().getRayleighExtinction().getFirstValue() ); 206 Attribute validR = new Attribute( "valid", "YES,NO" ); 207 rayleighExtinction.setAttribute( validR ); 208 rayleighExtinction.setText( iRequest.getPreference().getRayleighExtinction().getSecondValue() ); 209 preferences.addContent( rayleighExtinction ); 210 211 //h2o 212 final Element h2oe = new Element( "h2o_extinction" ); 213 validR = new Attribute( "valid", "YES,NO" ); 214 h2oe.setAttribute( validR ); 215 h2oe.setText( iRequest.getPreference().getH2oExtinction().getSecondValue() ); 216 preferences.addContent( h2oe ); 217 218 219 //o3 220 final Element o3e = new Element( "o3_extinction" ); 221 validR = new Attribute( "valid", "YES,NO" ); 222 o3e.setAttribute( validR ); 223 o3e.setText( iRequest.getPreference().getO3Extinction().getSecondValue() ); 224 preferences.addContent( o3e ); 225 226 //o2 227 final Element o2e = new Element( "o2_extinction" ); 228 validR = new Attribute( "valid", "YES,NO" ); 229 o2e.setAttribute( validR ); 230 o2e.setText( iRequest.getPreference().getO2Extinction().getSecondValue() ); 231 preferences.addContent( o2e ); 232 233 234 //co2 235 final Element co2e = new Element( "co2_extinction" ); 236 validR = new Attribute( "valid", "YES,NO" ); 237 co2e.setAttribute( validR ); 238 co2e.setText( iRequest.getPreference().getCo2Extinction().getSecondValue() ); 239 preferences.addContent( co2e ); 240 241 //ch4 242 final Element ch4e = new Element( "ch4_extinction" ); 243 validR = new Attribute( "valid", "YES,NO" ); 244 ch4e.setAttribute( validR ); 245 ch4e.setText( iRequest.getPreference().getCh4Extinction().getSecondValue() ); 246 preferences.addContent( ch4e ); 247 248 //no2 249 final Element n2oe = new Element( "n2o_extinction" ); 250 validR = new Attribute( "valid", "YES,NO" ); 251 n2oe.setAttribute( validR ); 252 n2oe.setText( iRequest.getPreference().getN2oExtinction().getSecondValue() ); 253 preferences.addContent( n2oe ); 254 255 256 request.addContent( preferences ); 257 258 // OBSERVATORIES 259 final Element observation = new Element( "observation" ); 260 261 // date mesure 262 final Element mdate = new Element( "date" ); 263 final Calendar calendar = Calendar.getInstance(); 264 265 calendar.setTimeInMillis( Long.valueOf( iRequest.getObservation().getDate() ) ); 266 final String dateFormatFinal=DateHelper.formatDate( calendar.getTime(), DateHelper.DATE_UTC ); 267 268 mdate.setText( dateFormatFinal ); 269 270 //mdate.setText( iRequest.getObservation().getDate() ); 271 observation.addContent( mdate ); 272 273 //observatoire ou lieu libre en indiquant alt,lat,lon 274 final Element observatory = new Element( "observatory" ); 275 observation.addContent( observatory ); 276 277 //recuperation des coordonnées de l'observatoire 278 final Observatory obs; 279 try 280 { 281 //obs = _observatoryDAO.selectByPrimaryKey( iRequest.getObservation().getObservatory().getId() ); 282 obs = _observatoryDAO.getObservatoryByName( iRequest.getObservation().getObservatory().getName() ); 283 } 284 catch( PersistenceException e ) 285 { 286 throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e ); 287 } 288 289 ////// a tester //// 290 291 final Element name = new Element( "name" ); 292 293 final Element longitude = new Element( "longitude" ); 294 validR = new Attribute( "min", "-180" ); 295 longitude.setAttribute( validR ); 296 validR = new Attribute( "max", "180" ); 297 longitude.setAttribute( validR ); 298 299 final Element latitude = new Element( "latitude" ); 300 validR = new Attribute( "min", "-90" ); 301 latitude.setAttribute( validR ); 302 validR = new Attribute( "max", "90" ); 303 latitude.setAttribute( validR ); 304 305 final Element altitude = new Element( "altitude" ); 306 validR = new Attribute( "min", "0" ); 307 altitude.setAttribute( validR ); 308 validR = new Attribute( "max", "10000" ); 309 altitude.setAttribute( validR ); 310 311 String shortName=""; 312 313 if (null == obs) 314 { 315 //lieu libre 316 name.setText(iRequest.getObservation().getLocation().getName()); 317 altitude.setText( iRequest.getObservation().getLocation().getAltitude().toString() ); 318 latitude.setText( iRequest.getObservation().getLocation().getLatitude().toString() ); 319 longitude.setText( iRequest.getObservation().getLocation().getLongitude().toString() ); 320 shortName = iRequest.getObservation().getLocation().getName(); 321 } 322 else { 323 //observatoire connu de la bdd tapas 324 name.setText( obs.getName() ); 325 longitude.setText( obs.getLongitude().toString() ); 326 latitude.setText( obs.getLatitude().toString() ); 327 altitude.setText( obs.getAltitude().toString() ); 328 shortName = obs.getShortName().toString(); 329 } 330 331 332 observatory.addContent( name ); 333 observatory.addContent( latitude ); 334 observatory.addContent( longitude ); 335 observatory.addContent( altitude ); 336 337 338 //los addN 339 final Element los = new Element( "los" ); 340 observation.addContent( los ); 341 342 Los temp = iRequest.getObservation().getLos(); 343 if ( !temp.getRaJ2000().equals( "" )) { 344 final Element ra_j2000 = new Element( "ra_j2000" ); 345 ra_j2000.setText( iRequest.getObservation().getLos().getRaJ2000() ); 346 los.addContent( ra_j2000 ); 347 } 348 349 if ( !temp.getDecJ2000().equals( "" )) { 350 final Element dec_j2000 = new Element( "dec_j2000" ); 351 dec_j2000.setText( iRequest.getObservation().getLos().getDecJ2000() ); 352 los.addContent( dec_j2000 ); 353 } 354 355 356 if ( !temp.getZenithAngle().equals("") ) { 357 final Element zenith_angle = new Element( "zenith_angle" ); 358 359 Attribute a1 = new Attribute( "min", "0" ); 360 Attribute a2 = new Attribute( "max", "90" ); 361 362 zenith_angle.setAttribute( a1 ); 363 zenith_angle.setAttribute( a2 ); 364 zenith_angle.setText( temp.getZenithAngle() ); 365 366 los.addContent( zenith_angle ); 367 } 368 369 370 //instrument 371 final Element instrument = new Element( "instrument" ); 372 observation.addContent( instrument ); 373 374 final Element spectral_choice = new Element( "spectral_choice" ); 375 376 377 final String[] tabMess = iRequest.getObservation().getInstrument().getSpectralChoice().getFirstValue().split( "," ); 378 379 String chValid = ""; 380 int i; 381 382 for( i = 0; i <= tabMess.length - 1; i++ ) //final String mess : tabMess ) 383 { 384 if( i == tabMess.length - 1 ) 385 chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ); 386 else chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ) + ","; 387 } 388 389 390 Attribute a3 = new Attribute( "valid", chValid ); 391 392 spectral_choice.setAttribute( a3 ); 393 final String message = EtherHelper.getMessage( "label.spectralUnit." + iRequest.getObservation().getInstrument().getSpectralChoice().getSecondValue(), null ); 394 spectral_choice.setText( message ); 395 instrument.addContent( spectral_choice ); 396 397 final Element spectral_range = new Element( "spectral_range" ); 398 spectral_range.setText( iRequest.getObservation().getInstrument().getSpectralRange() ); 399 instrument.addContent( spectral_range ); 400 401 402 // 403 final Element ilsfChoice = new Element( "ilsf_choice" ); 404 validR = new Attribute( "valid", iRequest.getObservation().getInstrument().getIlsfChoice().getFirstValue() ); 405 ilsfChoice.setAttribute( validR ); 406 //selectInstrumentalFunctions 407 ilsfChoice.setText( String.valueOf( iRequest.getObservation().getInstrument().getIlsfChoice().getSecondValue() ) ); 408 instrument.addContent( ilsfChoice ); 409 410 411 final Element resolvingPower = new Element( "resolving_power" ); 412 validR = new Attribute( "min", "0" ); 413 resolvingPower.setAttribute( validR ); 414 resolvingPower.setText( String.valueOf( iRequest.getObservation().getInstrument().getResolvingPower().getSecondValue() ) ); 415 instrument.addContent( resolvingPower ); 416 417 final Element samplingRatio = new Element( "sampling_ratio" ); 418 validR = new Attribute( "min", "0" ); 419 samplingRatio.setAttribute( validR ); 420 samplingRatio.setText( String.valueOf( iRequest.getObservation().getInstrument().getSamplingRatio().getSecondValue() ) ); 421 instrument.addContent( samplingRatio ); 422 423 //berv correction 424 //final Element bervCorr = new Element( "berv_correction" ); 425 final Element bervCorr = new Element( "apply_berv" ); 426 validR = new Attribute( "valid", "YES,NO" ); 427 bervCorr.setAttribute( validR ); 428 bervCorr.setText( iRequest.getPreference().getBervCorrection().getSecondValue() ); 429 instrument.addContent( bervCorr ); 430 431 432 request.addContent( observation ); 433 434 //atmosphere 435 final Element atmosphere = new Element( "atmosphere" ); 436 request.addContent( atmosphere ); 437 438 //reference 439 final Element reference = new Element( "reference" ); 440 validR = new Attribute( "valid", "0,1,2,3,4,5,6" ); 441 reference.setAttribute( validR ); 442 reference.setText( String.valueOf( iRequest.getAtmosphere().getReference().getSecondValue() ) ); 443 atmosphere.addContent( reference ); 444 445 446 String fileArletty = "", fileECMWF = ""; 447 448 449 fileArletty = dataPath + "/" + createFileName( dateFormatFinal , "arletty", shortName ); 450 fileECMWF = dataPath + "/" + createFileName( dateFormatFinal, "ecmwf", shortName ); 451 452 final Element arlettyFile = new Element( "arletty_file" ); 453 arlettyFile.setText( fileArletty ); 454 atmosphere.addContent( arlettyFile ); 455 456 final Element ecmwfFile = new Element( "ecmwf_file" ); 457 ecmwfFile.setText( fileECMWF ); 458 atmosphere.addContent( ecmwfFile ); 459 460 listRequest.add( request ); 461 462 indice=indice+1; 463 } 464 } 465 466 467 468 ////////// 469 ///////// 470 /*for( final Request iRequest : requests ) 471 { 472 final Element request = new Element( "request" ); 473 // Id de la request 474 final Attribute idR = new Attribute( "Id", iRequest.getId().toString() ); 475 request.setAttribute( idR ); 476 477 // PREFERENCES 478 final Element preferences = new Element( "preferences" ); 479 480 481 //format 482 final Element format = new Element( "format" ); 483 //final Attribute validF = new Attribute( "valid", iRequest.getPreference().getFormat().getFirstValue() ); 484 final Attribute validF = new Attribute( "valid", "VO,ASCII,FITS,NETCDF" ); 485 format.setAttribute( validF ); 486 format.setText( iRequest.getPreference().getFormat().getSecondValue() ); 487 preferences.addContent( format ); 488 489 490 //rayleighExtinction 491 final Element rayleighExtinction = new Element( "rayleigh_extinction" ); 492 //final Attribute validR = new Attribute( "valid", iRequest.getPreference().getRayleighExtinction().getFirstValue() ); 493 Attribute validR = new Attribute( "valid", "YES,NO" ); 494 rayleighExtinction.setAttribute( validR ); 495 rayleighExtinction.setText( iRequest.getPreference().getRayleighExtinction().getSecondValue() ); 496 preferences.addContent( rayleighExtinction ); 497 498 //h2o 499 final Element h2oe = new Element( "h2o_extinction" ); 500 validR = new Attribute( "valid", "YES,NO" ); 501 h2oe.setAttribute( validR ); 502 h2oe.setText( iRequest.getPreference().getH2oExtinction().getSecondValue() ); 503 preferences.addContent( h2oe ); 504 505 506 //o3 507 final Element o3e = new Element( "o3_extinction" ); 508 validR = new Attribute( "valid", "YES,NO" ); 509 o3e.setAttribute( validR ); 510 o3e.setText( iRequest.getPreference().getO3Extinction().getSecondValue() ); 511 preferences.addContent( o3e ); 512 513 //o2 514 final Element o2e = new Element( "o2_extinction" ); 515 validR = new Attribute( "valid", "YES,NO" ); 516 o2e.setAttribute( validR ); 517 o2e.setText( iRequest.getPreference().getO2Extinction().getSecondValue() ); 518 preferences.addContent( o2e ); 519 520 521 //co2 522 final Element co2e = new Element( "co2_extinction" ); 523 validR = new Attribute( "valid", "YES,NO" ); 524 co2e.setAttribute( validR ); 525 co2e.setText( iRequest.getPreference().getCo2Extinction().getSecondValue() ); 526 preferences.addContent( co2e ); 527 528 //ch4 529 final Element ch4e = new Element( "ch4_extinction" ); 530 validR = new Attribute( "valid", "YES,NO" ); 531 ch4e.setAttribute( validR ); 532 ch4e.setText( iRequest.getPreference().getCh4Extinction().getSecondValue() ); 533 preferences.addContent( ch4e ); 534 535 //no2 536 final Element n2oe = new Element( "n2o_extinction" ); 537 validR = new Attribute( "valid", "YES,NO" ); 538 n2oe.setAttribute( validR ); 539 n2oe.setText( iRequest.getPreference().getN2oExtinction().getSecondValue() ); 540 preferences.addContent( n2oe ); 541 542 543 request.addContent( preferences ); 544 545 // OBSERVATORIES 546 final Element observation = new Element( "observation" ); 547 548 // date mesure 549 final Element mdate = new Element( "date" ); 550 final Calendar calendar = Calendar.getInstance(); 551 552 calendar.setTimeInMillis( Long.valueOf( iRequest.getObservation().getDate() ) ); 553 final String dateFormatFinal=DateHelper.formatDate( calendar.getTime(), DateHelper.DATE_UTC ); 554 555 mdate.setText( dateFormatFinal ); 556 557 // mdate.setText( iRequest.getObservation().getDate() ); 558 observation.addContent( mdate ); 559 560 //observatoire ou lieu libre en indiquant alt,lat,lon 561 final Element observatory = new Element( "observatory" ); 562 observation.addContent( observatory ); 563 564 //recuperation des coordonnées de l'observatoire 565 final Observatory obs; 566 try 567 { 568 //obs = _observatoryDAO.selectByPrimaryKey( iRequest.getObservation().getObservatory().getId() ); 569 obs = _observatoryDAO.getObservatoryByName( iRequest.getObservation().getObservatory().getName() ); 570 } 571 catch( PersistenceException e ) 572 { 573 throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e ); 574 } 575 576 ////// a tester //// 577 578 final Element name = new Element( "name" ); 579 580 final Element longitude = new Element( "longitude" ); 581 validR = new Attribute( "min", "-180" ); 582 longitude.setAttribute( validR ); 583 validR = new Attribute( "max", "180" ); 584 longitude.setAttribute( validR ); 585 586 final Element latitude = new Element( "latitude" ); 587 validR = new Attribute( "min", "-90" ); 588 latitude.setAttribute( validR ); 589 validR = new Attribute( "max", "90" ); 590 latitude.setAttribute( validR ); 591 592 final Element altitude = new Element( "altitude" ); 593 validR = new Attribute( "min", "0" ); 594 altitude.setAttribute( validR ); 595 validR = new Attribute( "max", "10000" ); 596 altitude.setAttribute( validR ); 597 598 String shortName=""; 599 600 if (null == obs) 601 { 602 //lieu libre 603 name.setText(iRequest.getObservation().getLocation().getName()); 604 altitude.setText( iRequest.getObservation().getLocation().getAltitude().toString() ); 605 latitude.setText( iRequest.getObservation().getLocation().getLatitude().toString() ); 606 longitude.setText( iRequest.getObservation().getLocation().getLongitude().toString() ); 607 shortName = iRequest.getObservation().getLocation().getName(); 608 } 609 else { 610 //observatoire connu de la bdd tapas 611 name.setText( obs.getName() ); 612 longitude.setText( obs.getLongitude().toString() ); 613 latitude.setText( obs.getLatitude().toString() ); 614 altitude.setText( obs.getAltitude().toString() ); 615 shortName = obs.getShortName().toString(); 616 } 617 618 619 observatory.addContent( name ); 620 observatory.addContent( latitude ); 621 observatory.addContent( longitude ); 622 observatory.addContent( altitude ); 623 624 625 //los addN 626 final Element los = new Element( "los" ); 627 observation.addContent( los ); 628 629 Los temp = iRequest.getObservation().getLos(); 630 if ( !temp.getRaJ2000().equals( "" )) { 631 final Element ra_j2000 = new Element( "ra_j2000" ); 632 ra_j2000.setText( iRequest.getObservation().getLos().getRaJ2000() ); 633 los.addContent( ra_j2000 ); 634 } 635 636 if ( !temp.getDecJ2000().equals( "" )) { 637 final Element dec_j2000 = new Element( "dec_j2000" ); 638 dec_j2000.setText( iRequest.getObservation().getLos().getDecJ2000() ); 639 los.addContent( dec_j2000 ); 640 } 641 642 643 if ( !temp.getZenithAngle().equals("") ) { 644 final Element zenith_angle = new Element( "zenith_angle" ); 645 646 Attribute a1 = new Attribute( "min", "0" ); 647 Attribute a2 = new Attribute( "max", "90" ); 648 649 zenith_angle.setAttribute( a1 ); 650 zenith_angle.setAttribute( a2 ); 651 zenith_angle.setText( temp.getZenithAngle() ); 652 653 los.addContent( zenith_angle ); 654 } 655 656 657 //instrument 658 final Element instrument = new Element( "instrument" ); 659 observation.addContent( instrument ); 660 661 final Element spectral_choice = new Element( "spectral_choice" ); 662 663 664 final String[] tabMess = iRequest.getObservation().getInstrument().getSpectralChoice().getFirstValue().split( "," ); 665 666 String chValid = ""; 667 int i; 668 669 for( i = 0; i <= tabMess.length - 1; i++ ) //final String mess : tabMess ) 670 { 671 if( i == tabMess.length - 1 ) 672 chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ); 673 else chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ) + ","; 674 } 675 676 677 Attribute a3 = new Attribute( "valid", chValid ); 678 679 spectral_choice.setAttribute( a3 ); 680 final String message = EtherHelper.getMessage( "label.spectralUnit." + iRequest.getObservation().getInstrument().getSpectralChoice().getSecondValue(), null ); 681 spectral_choice.setText( message ); 682 instrument.addContent( spectral_choice ); 683 684 final Element spectral_range = new Element( "spectral_range" ); 685 spectral_range.setText( iRequest.getObservation().getInstrument().getSpectralRange() ); 686 instrument.addContent( spectral_range ); 687 688 689 // 690 final Element ilsfChoice = new Element( "ilsf_choice" ); 691 validR = new Attribute( "valid", iRequest.getObservation().getInstrument().getIlsfChoice().getFirstValue() ); 692 ilsfChoice.setAttribute( validR ); 693 //selectInstrumentalFunctions 694 ilsfChoice.setText( String.valueOf( iRequest.getObservation().getInstrument().getIlsfChoice().getSecondValue() ) ); 695 instrument.addContent( ilsfChoice ); 696 697 698 final Element resolvingPower = new Element( "resolving_power" ); 699 validR = new Attribute( "min", "0" ); 700 resolvingPower.setAttribute( validR ); 701 resolvingPower.setText( String.valueOf( iRequest.getObservation().getInstrument().getResolvingPower().getSecondValue() ) ); 702 instrument.addContent( resolvingPower ); 703 704 final Element samplingRatio = new Element( "sampling_ratio" ); 705 validR = new Attribute( "min", "0" ); 706 samplingRatio.setAttribute( validR ); 707 samplingRatio.setText( String.valueOf( iRequest.getObservation().getInstrument().getSamplingRatio().getSecondValue() ) ); 708 instrument.addContent( samplingRatio ); 709 710 //berv correction 711 //final Element bervCorr = new Element( "berv_correction" ); 712 final Element bervCorr = new Element( "apply_berv" ); 713 validR = new Attribute( "valid", "YES,NO" ); 714 bervCorr.setAttribute( validR ); 715 bervCorr.setText( iRequest.getPreference().getBervCorrection().getSecondValue() ); 716 instrument.addContent( bervCorr ); 717 718 719 request.addContent( observation ); 720 721 //atmosphere 722 final Element atmosphere = new Element( "atmosphere" ); 723 request.addContent( atmosphere ); 724 725 //reference 726 final Element reference = new Element( "reference" ); 727 validR = new Attribute( "valid", "0,1,2,3,4,5,6" ); 728 reference.setAttribute( validR ); 729 reference.setText( String.valueOf( iRequest.getAtmosphere().getReference().getSecondValue() ) ); 730 atmosphere.addContent( reference ); 731 732 733 String fileArletty = "", fileECMWF = ""; 734 735 736 fileArletty = dataPath + "/" + createFileName( dateFormatFinal , "arletty", shortName ); 737 fileECMWF = dataPath + "/" + createFileName( dateFormatFinal, "ecmwf", shortName ); 738 739 final Element arlettyFile = new Element( "arletty_file" ); 740 arlettyFile.setText( fileArletty ); 741 atmosphere.addContent( arlettyFile ); 742 743 final Element ecmwfFile = new Element( "ecmwf_file" ); 744 ecmwfFile.setText( fileECMWF ); 745 atmosphere.addContent( ecmwfFile ); 746 747 listRequest.add( request ); 748 }*/ 749 750 751 752 753 ///// 754 /////// 755 756 757 758 tapas.addContent( listRequest ); 759 760 String commandePath = servicePath + "/" + fTapas.getId(); 761 createXMLFile( document, commandePath, prop ); 762 } 763 764 @Transactional(readOnly = true) 765 public void createUserFtpDir( @NotNull final User user, @NotNull final Properties prop ) 766 throws ServiceException 767 { 768 final String usersPath = prop.getProperty( "users_path" ); 769 String commande = "mkdir -p " + usersPath + "/" + user.getEmail(); 770 771 try 772 { 773 EtherHelper.execProcess( commande ); 774 } 775 catch( FormattedException e ) 776 { 777 } 778 779 EtherHelper.pause( 4000 ); 780 781 //commande = "chown -R "+prop.getProperty( "chown_user" )+" "+usersPath+"/"+user.getEmail(); 782 commande = "chmod 777 -R " + usersPath + "/" + user.getEmail(); 783 784 try 785 { 786 EtherHelper.execProcess( commande ); 787 } 788 catch( FormattedException e ) 789 { 790 } 791 792 EtherHelper.pause( 4000 ); 793 } 794 795 public void createXMLFile( final Document document, final String commandePath, final Properties prop ) 796 { 797 try 798 { 799 //creation repertoire commande 800 try 801 { 802 EtherHelper.execProcess( "mkdir -p " + commandePath ); 803 } 804 catch( FormattedException e ) 805 { 806 } 807 808 EtherHelper.pause( 5000 ); 809 810 811 /*try 812 { 813 EtherHelper.execProcess( "chown "+prop.getProperty( "chown_user" )+" "+commandePath); 814 } 815 catch( FormattedException e ) 816 { 817 818 } */ 819 820 final String fichier = commandePath + "/" + "request.xml"; 821 822 //On utilise ici un affichage classique avec getPrettyFormat() 823 final XMLOutputter sortie = new XMLOutputter( Format.getPrettyFormat() ); 824 //Remarquez qu'il suffit simplement de créer une instance de FileOutputStream 825 //avec en argument le nom du fichier pour effectuer la sérialisation. 826 sortie.output( document, new FileOutputStream( fichier ) ); 827 828 /*try 829 { 830 EtherHelper.execProcess( "chmod 755 "+commandePath+"/"+"request.xml" ); 831 } 832 catch( FormattedException e ) 833 { 834 835 } 836 837 EtherHelper.pause(7000); 838 */ 839 } 840 catch( IOException ignored ) 841 { 842 } 843 } 844 845 // liste tous observatoires 846 @Nullable 847 @Transactional(readOnly = true) 848 public List<Observatory> getAllObservatories() 849 throws ServiceException 850 { 851 try 852 { 853 return _observatoryDAO.getAllObservatories(); 169 854 } 170 855 catch( PersistenceException e ) … … 172 857 throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e ); 173 858 } 174 175 176 final Element name = new Element( "name" ); 177 name.setText( obs.getName() ); 178 observatory.addContent( name ); 179 180 final Element longitude = new Element( "longitude" ); 181 validR = new Attribute( "min", "-180" ); 182 longitude.setAttribute( validR ); 183 validR = new Attribute( "max", "180" ); 184 longitude.setAttribute( validR ); 185 longitude.setText( obs.getLongitude().toString() ); 186 observatory.addContent( longitude ); 187 188 final Element latitude = new Element( "latitude" ); 189 validR = new Attribute( "min", "-90" ); 190 latitude.setAttribute( validR ); 191 validR = new Attribute( "max", "90" ); 192 latitude.setAttribute( validR ); 193 latitude.setText( obs.getLatitude().toString() ); 194 observatory.addContent( latitude ); 195 196 final Element altitude = new Element( "altitude" ); 197 validR = new Attribute( "min", "0" ); 198 altitude.setAttribute( validR ); 199 validR = new Attribute( "max", "10000" ); 200 altitude.setAttribute( validR ); 201 altitude.setText( obs.getAltitude().toString() ); 202 observatory.addContent( altitude ); 203 204 205 //los 206 final Element los = new Element( "los" ); 207 observation.addContent( los ); 208 209 Los temp = iRequest.getObservation().getLos(); 210 if ( !temp.getRaJ2000().equals( "" )) { 211 final Element ra_j2000 = new Element( "ra_j2000" ); 212 ra_j2000.setText( iRequest.getObservation().getLos().getRaJ2000() ); 213 los.addContent( ra_j2000 ); 214 } 215 216 if ( !temp.getDecJ2000().equals( "" )) { 217 final Element dec_j2000 = new Element( "dec_j2000" ); 218 dec_j2000.setText( iRequest.getObservation().getLos().getDecJ2000() ); 219 los.addContent( dec_j2000 ); 220 } 221 222 223 if ( !temp.getZenithAngle().equals("") ) { 224 final Element zenith_angle = new Element( "zenith_angle" ); 225 226 Attribute a1 = new Attribute( "min", "0" ); 227 Attribute a2 = new Attribute( "max", "90" ); 228 229 zenith_angle.setAttribute( a1 ); 230 zenith_angle.setAttribute( a2 ); 231 zenith_angle.setText( temp.getZenithAngle() ); 232 233 los.addContent( zenith_angle ); 234 } 235 236 237 //instrument 238 final Element instrument = new Element( "instrument" ); 239 observation.addContent( instrument ); 240 241 final Element spectral_choice = new Element( "spectral_choice" ); 242 243 244 final String[] tabMess = iRequest.getObservation().getInstrument().getSpectralChoice().getFirstValue().split( "," ); 245 246 String chValid = ""; 247 int i; 248 249 for( i = 0; i <= tabMess.length - 1; i++ ) //final String mess : tabMess ) 250 { 251 if( i == tabMess.length - 1 ) 252 chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ); 253 else chValid += EtherHelper.getMessage( "label.spectralUnit." + tabMess[i], null ) + ","; 254 } 255 256 257 Attribute a3 = new Attribute( "valid", chValid ); 258 259 spectral_choice.setAttribute( a3 ); 260 final String message = EtherHelper.getMessage( "label.spectralUnit." + iRequest.getObservation().getInstrument().getSpectralChoice().getSecondValue(), null ); 261 spectral_choice.setText( message ); 262 instrument.addContent( spectral_choice ); 263 264 final Element spectral_range = new Element( "spectral_range" ); 265 spectral_range.setText( iRequest.getObservation().getInstrument().getSpectralRange() ); 266 instrument.addContent( spectral_range ); 267 268 269 // 270 final Element ilsfChoice = new Element( "ilsf_choice" ); 271 validR = new Attribute( "valid", iRequest.getObservation().getInstrument().getIlsfChoice().getFirstValue() ); 272 ilsfChoice.setAttribute( validR ); 273 //selectInstrumentalFunctions 274 ilsfChoice.setText( String.valueOf( iRequest.getObservation().getInstrument().getIlsfChoice().getSecondValue() ) ); 275 instrument.addContent( ilsfChoice ); 276 277 278 final Element resolvingPower = new Element( "resolving_power" ); 279 validR = new Attribute( "min", "0" ); 280 resolvingPower.setAttribute( validR ); 281 resolvingPower.setText( String.valueOf( iRequest.getObservation().getInstrument().getResolvingPower().getSecondValue() ) ); 282 instrument.addContent( resolvingPower ); 283 284 final Element samplingRatio = new Element( "sampling_ratio" ); 285 validR = new Attribute( "min", "0" ); 286 samplingRatio.setAttribute( validR ); 287 samplingRatio.setText( String.valueOf( iRequest.getObservation().getInstrument().getSamplingRatio().getSecondValue() ) ); 288 instrument.addContent( samplingRatio ); 289 290 //berv correction 291 //final Element bervCorr = new Element( "berv_correction" ); 292 final Element bervCorr = new Element( "apply_berv" ); 293 validR = new Attribute( "valid", "YES,NO" ); 294 bervCorr.setAttribute( validR ); 295 bervCorr.setText( iRequest.getPreference().getBervCorrection().getSecondValue() ); 296 instrument.addContent( bervCorr ); 297 298 299 request.addContent( observation ); 300 301 //atmosphere 302 final Element atmosphere = new Element( "atmosphere" ); 303 request.addContent( atmosphere ); 304 305 //reference 306 final Element reference = new Element( "reference" ); 307 validR = new Attribute( "valid", "0,1,2,3,4,5,6" ); 308 reference.setAttribute( validR ); 309 reference.setText( String.valueOf( iRequest.getAtmosphere().getReference().getSecondValue() ) ); 310 atmosphere.addContent( reference ); 311 312 313 String fileArletty = "", fileECMWF = "", shortName = ""; 314 //rajouter annee/mois 315 316 shortName = obs.getShortName(); 317 318 319 fileArletty = dataPath + "/" + createFileName( dateFormatFinal , "arletty", shortName ); 320 fileECMWF = dataPath + "/" + createFileName( dateFormatFinal, "ecmwf", shortName ); 321 322 final Element arlettyFile = new Element( "arletty_file" ); 323 arlettyFile.setText( fileArletty ); 324 atmosphere.addContent( arlettyFile ); 325 326 final Element ecmwfFile = new Element( "ecmwf_file" ); 327 ecmwfFile.setText( fileECMWF ); 328 atmosphere.addContent( ecmwfFile ); 329 330 listRequest.add( request ); 331 } 332 333 tapas.addContent( listRequest ); 334 335 String commandePath = servicePath + "/" + fTapas.getId(); 336 createXMLFile( document, commandePath, prop ); 337 338 859 } 860 861 // recuperation infos observatoire avec l'id 862 @Nullable 863 @Transactional(readOnly = true) 864 public Observatory getObservatoryById( @NotNull final long id ) 865 throws ServiceException 866 { 867 try 868 { 869 return _observatoryDAO.getObservatoryById( id ); 870 } 871 catch( PersistenceException e ) 872 { 873 throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e ); 874 } 875 } 876 877 // recuperation infos observatoire avec le nom 878 @Nullable 879 @Transactional(readOnly = true) 880 public Observatory getObservatoryByName( @NotNull final String name ) 881 throws ServiceException 882 { 883 try 884 { 885 return _observatoryDAO.getObservatoryByName( name ); 886 } 887 catch( PersistenceException e ) 888 { 889 throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e ); 890 } 891 } 892 893 // recuperation infos observatoire avec le nom 894 @Nullable 895 @Transactional(readOnly = true) 896 public Long getNumRequest() 897 throws ServiceException 898 { 899 try 900 { 901 return _tapasRequestDAO.getNumRequest() + 1; 902 } 903 catch( PersistenceException e ) 904 { 905 throw new ServiceException( ServiceException.ServiceCode.REQUEST_NOT_FOUND, e ); 906 } 907 } 908 909 /* public String findMeasureHour( String date ) 910 { 911 String heure; 912 int val; 913 914 915 val = Math.abs( Integer.parseInt( heure ) ); 916 917 return heure; 918 } */ 919 920 public String createFileName( String date, String type, String nomCourt ) 921 { 922 String fileName = ""; 923 924 String annee = date.substring( 0, 4 ); 925 //String mois = String.valueOf( Integer.parseInt(date.substring(5,7))-1); 926 String mois = date.substring( 5, 7 ); 927 String heure = date.substring( 11, 13 ); 928 String jour = date.substring( 8, 10 ); 929 String ind = ""; 930 931 Calendar cal = Calendar.getInstance(); 932 933 try 934 { 935 Date dd = new SimpleDateFormat( "dd/MM/yyyy HH:mm:ss" ).parse( jour + "/" + mois + "/" + annee + " " + heure + ":00:00" ); 936 cal.setTime( dd ); 937 } 938 catch( ParseException e ) 939 { 940 } 941 942 int iheure = cal.get( Calendar.HOUR_OF_DAY );// + 2; 943 944 if( iheure < 3 ) ind = "00"; 945 else if( iheure >= 21 ) 946 { 947 ind = "00"; 948 cal.add( Calendar.DAY_OF_MONTH, +1 ); 949 } 950 else if( Math.abs( 6 - iheure ) < 3 || iheure == 3 ) ind = "06"; 951 else if( Math.abs( 12 - iheure ) < 3 || iheure == 9 ) ind = "12"; 952 else if( Math.abs( 18 - iheure ) < 3 || iheure == 15 ) ind = "18"; 953 954 //+1 sur le mois pour recuperer le numero correct du mois considere 955 if( cal.get( Calendar.MONTH ) + 1 < 10 ) mois = "0" + String.valueOf( cal.get( Calendar.MONTH ) + 1 ); 956 else mois = "" + String.valueOf( cal.get( Calendar.MONTH ) + 1 ); 957 958 if( cal.get( Calendar.DAY_OF_MONTH ) < 10 ) jour = "0" + cal.get( Calendar.DAY_OF_MONTH ); 959 else jour = "" + cal.get( Calendar.DAY_OF_MONTH ); 960 961 annee = "" + cal.get( Calendar.YEAR ); 962 963 //fileName = "/" + annee + "/" + mois + "/" + jour + "/" + nomCourt + "_" + annee + mois + jour + ind; 964 fileName="/"+type+"/" + nomCourt + "_" + annee + mois + jour + ind; 965 966 if( type == "arletty" ) fileName = fileName + ".arl"; 967 else if( type == "ecmwf" ) fileName = fileName + "_qo3.txt"; 968 969 return fileName; 970 } 971 972 public boolean execAppelQSub( final String repCommande, User user, Properties prop ) 973 throws ServiceException 974 { 975 String commande = ""; 976 String commandePath = prop.getProperty( "service_path" ) + "/" + repCommande + "/"; 977 978 //copie run qsub dans repertoire commande 979 commande = "cp " + prop.getProperty( "src_path" ) + "/" + prop.getProperty( "process_name" ) + " " + commandePath; 980 981 try 982 { 983 EtherHelper.execProcess( commande ); 984 } 985 catch( FormattedException e ) 986 { 987 } 988 989 EtherHelper.pause( 7000 ); 990 991 //final String fichier = commandePath+"commande.txt"; 992 993 /*commande="chown -R www:www "+commandePath; 994 995 try 996 { 997 EtherHelper.execProcess( commande ); 998 } 999 catch( FormattedException e ) 1000 { 1001 1002 }*/ 1003 1004 EtherHelper.pause( 7000 ); 1005 1006 commande = "chmod 777 -R " + commandePath; 1007 1008 try 1009 { 1010 EtherHelper.execProcess( commande ); 1011 } 1012 catch( FormattedException e ) 1013 { 1014 } 1015 1016 EtherHelper.pause( 7000 ); 1017 1018 //execution qsub pour la commande en cours 1019 commande = commandePath + "/" + prop.getProperty( "process_name" ) + " -f request.xml" + " -m " + user.getEmail(); 1020 1021 /*PrintWriter out = null; 1022 try 1023 { 1024 out = new PrintWriter(new FileWriter(fichier)); 1025 out.println(commande); 1026 out.close(); 1027 } 1028 catch( IOException e ) 1029 { 1030 e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. 1031 } */ 1032 1033 1034 /*commande = commandePath+"/"+prop.getProperty( "process_name" ); 1035 commande = "cd "+commandePath;*/ 1036 1037 try 1038 { 1039 EtherHelper.execProcess( commande ); 1040 } 1041 catch( FormattedException e ) 1042 { 1043 throw new ServiceException( ServiceException.ServiceCode.ERROR_PROCESS, e ); 1044 } 1045 1046 EtherHelper.pause( 7000 ); 1047 1048 return true; 1049 } 1050 1051 @NotNull 1052 @Transactional(rollbackFor = Exception.class) 1053 public Long insertTapasRequest( @NotNull final User user ) 1054 throws ServiceException 1055 { 1056 try 1057 { 1058 String dd = "1"; 1059 1060 final TapasRequest ntp = new TapasRequest( user.getFirstName(), user.getLastName(), dd, _tapasRequestDAO.getNumRequest() + 1 ); 1061 return _tapasRequestDAO.insert( ntp ); 1062 } 1063 catch( PersistenceException e ) 1064 { 1065 throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 1066 } 1067 } 1068 1069 @Transactional(readOnly = true) 1070 public void updateRequestGasTrace(Request iRequest, Pair<String, String> oldValuesCO2, Pair<String, String> oldValuesO2, Pair<String, String> oldValuesO3, Pair<String, String> oldValuesCH4, Pair<String, String> oldValuesN2O, Pair<String, String> oldValuesH20) 1071 throws ServiceException 1072 { 1073 iRequest.getPreference().setCo2Extinction(oldValuesCO2); 1074 iRequest.getPreference().setO2Extinction(oldValuesO2); 1075 iRequest.getPreference().setO3Extinction(oldValuesO3); 1076 iRequest.getPreference().setCh4Extinction(oldValuesCH4); 1077 iRequest.getPreference().setN2oExtinction(oldValuesN2O); 1078 iRequest.getPreference().setH2oExtinction(oldValuesH20); 1079 } 1080 1081 @Transactional(readOnly = true) 1082 public Request addNewRequest( @NotNull Request iRequest, @NotNull int id, String specie) 1083 throws ServiceException 1084 { 1085 Request cpRequest = new Request(); 1086 cpRequest.setId( new Long(id) ); 1087 1088 cpRequest.setPreference( new Preference() ); 1089 1090 cpRequest.getPreference().setCo2Extinction( new Pair<String, String>("YES,NO","NO") ); 1091 cpRequest.getPreference().setO2Extinction( new Pair<String, String>( "YES,NO", "NO" ) ); 1092 cpRequest.getPreference().setO3Extinction( new Pair<String, String>( "YES,NO", "NO" ) ); 1093 cpRequest.getPreference().setCh4Extinction( new Pair<String, String>( "YES,NO", "NO" ) ); 1094 cpRequest.getPreference().setN2oExtinction( new Pair<String, String>( "YES,NO", "NO" ) ); 1095 cpRequest.getPreference().setH2oExtinction( new Pair<String, String>( "YES,NO", "NO" ) ); 1096 1097 1098 cpRequest.getPreference().setBervCorrection( iRequest.getPreference().getBervCorrection() ); 1099 cpRequest.getPreference().setFormat( iRequest.getPreference().getFormat() ); 1100 cpRequest.getPreference().setRayleighExtinction( iRequest.getPreference().getRayleighExtinction() ); 1101 1102 1103 cpRequest.setAtmosphere( iRequest.getAtmosphere() ); 1104 cpRequest.setObservation( iRequest.getObservation() ); 1105 1106 if ( specie.equalsIgnoreCase("CO2") ) cpRequest.getPreference().setCo2Extinction( new Pair<String, String>( "YES,NO","YES" ) ); 1107 if ( specie.equalsIgnoreCase("O2") ) cpRequest.getPreference().setO2Extinction( new Pair<String, String>( "YES,NO","YES" ) ); 1108 if ( specie.equalsIgnoreCase("O3") ) cpRequest.getPreference().setO3Extinction( new Pair<String, String>( "YES,NO","YES" ) ); 1109 if ( specie.equalsIgnoreCase("CH4") ) cpRequest.getPreference().setCh4Extinction( new Pair<String, String>( "YES,NO","YES" ) ); 1110 if ( specie.equalsIgnoreCase("N2O") ) cpRequest.getPreference().setN2oExtinction( new Pair<String, String>( "YES,NO","YES" ) ); 1111 if ( specie.equalsIgnoreCase("H2O") ) { 1112 cpRequest.getPreference().setH2oExtinction( new Pair<String, String>( "YES,NO","YES" ) ); 1113 } 1114 1115 return cpRequest; 1116 } 1117 1118 @Required 1119 public void setObservatoryDAO( final ObservatoryDAO observatoryDAO ) 1120 { 1121 _observatoryDAO = observatoryDAO; 1122 } 1123 1124 @Required 1125 public void setTapasRequestDAO( final TapasRequestDAO tapasRequestDAO ) 1126 { 1127 _tapasRequestDAO = tapasRequestDAO; 1128 } 1129 1130 private static final Log LOGGER = LogFactory.getLog( TapasServiceImpl.class ); 1131 1132 private ObservatoryDAO _observatoryDAO; 1133 1134 private TapasRequestDAO _tapasRequestDAO; 339 1135 } 340 341 342 @Transactional(readOnly = true)343 public void createUserFtpDir( @NotNull final User user, @NotNull final Properties prop )344 throws ServiceException345 {346 347 final String usersPath = prop.getProperty( "users_path" );348 String commande = "mkdir -p " + usersPath + "/" + user.getEmail();349 350 try351 {352 EtherHelper.execProcess( commande );353 }354 catch( FormattedException e )355 {356 357 }358 359 EtherHelper.pause( 4000 );360 361 //commande = "chown -R "+prop.getProperty( "chown_user" )+" "+usersPath+"/"+user.getEmail();362 commande = "chmod 777 -R " + usersPath + "/" + user.getEmail();363 364 try365 {366 EtherHelper.execProcess( commande );367 }368 catch( FormattedException e )369 {370 371 }372 373 EtherHelper.pause( 4000 );374 375 }376 377 378 public boolean execAppelQSub( final String repCommande, User user, Properties prop )379 throws ServiceException380 {381 String commande = "";382 String commandePath = prop.getProperty( "service_path" ) + "/" + repCommande + "/";383 384 //copie run qsub dans repertoire commande385 commande = "cp " + prop.getProperty( "src_path" ) + "/" + prop.getProperty( "process_name" ) + " " + commandePath;386 387 try388 {389 EtherHelper.execProcess( commande );390 }391 catch( FormattedException e )392 {393 394 }395 396 EtherHelper.pause( 7000 );397 398 //final String fichier = commandePath+"commande.txt";399 400 /*commande="chown -R www:www "+commandePath;401 402 try403 {404 EtherHelper.execProcess( commande );405 }406 catch( FormattedException e )407 {408 409 }*/410 411 EtherHelper.pause( 7000 );412 413 commande = "chmod 777 -R " + commandePath;414 415 try416 {417 EtherHelper.execProcess( commande );418 }419 catch( FormattedException e )420 {421 422 }423 424 EtherHelper.pause( 7000 );425 426 //execution qsub pour la commande en cours427 commande = commandePath + "/" + prop.getProperty( "process_name" ) + " -f request.xml" + " -m " + user.getEmail();428 429 /*PrintWriter out = null;430 try431 {432 out = new PrintWriter(new FileWriter(fichier));433 out.println(commande);434 out.close();435 }436 catch( IOException e )437 {438 e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.439 } */440 441 442 /*commande = commandePath+"/"+prop.getProperty( "process_name" );443 commande = "cd "+commandePath;*/444 445 try446 {447 EtherHelper.execProcess( commande );448 }449 catch( FormattedException e )450 {451 throw new ServiceException( ServiceException.ServiceCode.ERROR_PROCESS, e );452 }453 454 EtherHelper.pause( 7000 );455 456 return true;457 }458 459 460 /* public String findMeasureHour( String date )461 {462 String heure;463 int val;464 465 466 val = Math.abs( Integer.parseInt( heure ) );467 468 return heure;469 } */470 471 public String createFileName( String date, String type, String nomCourt )472 {473 String fileName = "";474 475 String annee = date.substring( 0, 4 );476 //String mois = String.valueOf( Integer.parseInt(date.substring(5,7))-1);477 String mois = date.substring( 5, 7 );478 String heure = date.substring( 11, 13 );479 String jour = date.substring( 8, 10 );480 String ind = "";481 482 Calendar cal = Calendar.getInstance();483 484 try485 {486 Date dd = new SimpleDateFormat( "dd/MM/yyyy HH:mm:ss" ).parse( jour + "/" + mois + "/" + annee + " " + heure + ":00:00" );487 cal.setTime( dd );488 }489 catch( ParseException e )490 {491 492 }493 494 int iheure = cal.get( Calendar.HOUR_OF_DAY );// + 2;495 496 if( iheure < 3 ) ind = "00";497 else if( iheure >= 21 )498 {499 ind = "00";500 cal.add( Calendar.DAY_OF_MONTH, +1 );501 }502 else if( Math.abs( 6 - iheure ) < 3 || iheure == 3 ) ind = "06";503 else if( Math.abs( 12 - iheure ) < 3 || iheure == 9 ) ind = "12";504 else if( Math.abs( 18 - iheure ) < 3 || iheure == 15 ) ind = "18";505 506 //+1 sur le mois pour recuperer le numero correct du mois considere507 if( cal.get( Calendar.MONTH ) + 1 < 10 ) mois = "0" + String.valueOf( cal.get( Calendar.MONTH ) + 1 );508 else mois = "" + String.valueOf( cal.get( Calendar.MONTH ) + 1 );509 510 if( cal.get( Calendar.DAY_OF_MONTH ) < 10 ) jour = "0" + cal.get( Calendar.DAY_OF_MONTH );511 else jour = "" + cal.get( Calendar.DAY_OF_MONTH );512 513 annee = "" + cal.get( Calendar.YEAR );514 515 //fileName = "/" + annee + "/" + mois + "/" + jour + "/" + nomCourt + "_" + annee + mois + jour + ind;516 fileName="/"+type+"/" + nomCourt + "_" + annee + mois + jour + ind;517 518 if( type == "arletty" ) fileName = fileName + ".arl";519 else if( type == "ecmwf" ) fileName = fileName + "_qo3.txt";520 521 return fileName;522 }523 524 525 526 public void createXMLFile( final Document document, final String commandePath, final Properties prop )527 {528 try529 {530 //creation repertoire commande531 try532 {533 EtherHelper.execProcess( "mkdir -p " + commandePath );534 }535 catch( FormattedException e )536 {537 538 }539 540 EtherHelper.pause( 5000 );541 542 543 /*try544 {545 EtherHelper.execProcess( "chown "+prop.getProperty( "chown_user" )+" "+commandePath);546 }547 catch( FormattedException e )548 {549 550 } */551 552 final String fichier = commandePath + "/" + "request.xml";553 554 //On utilise ici un affichage classique avec getPrettyFormat()555 final XMLOutputter sortie = new XMLOutputter( Format.getPrettyFormat() );556 //Remarquez qu'il suffit simplement de créer une instance de FileOutputStream557 //avec en argument le nom du fichier pour effectuer la sérialisation.558 sortie.output( document, new FileOutputStream( fichier ) );559 560 /*try561 {562 EtherHelper.execProcess( "chmod 755 "+commandePath+"/"+"request.xml" );563 }564 catch( FormattedException e )565 {566 567 }568 569 EtherHelper.pause(7000);570 */571 572 }573 catch( IOException ignored )574 {575 }576 }577 578 // liste tous observatoires579 @Nullable580 @Transactional(readOnly = true)581 public List<Observatory> getAllObservatories()582 throws ServiceException583 {584 try585 {586 return _observatoryDAO.getAllObservatories();587 }588 catch( PersistenceException e )589 {590 throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e );591 }592 }593 594 // recuperation infos observatoire avec le nom595 @Nullable596 @Transactional(readOnly = true)597 public Long getNumRequest()598 throws ServiceException599 {600 try601 {602 return _tapasRequestDAO.getNumRequest() + 1;603 }604 catch( PersistenceException e )605 {606 throw new ServiceException( ServiceException.ServiceCode.REQUEST_NOT_FOUND, e );607 }608 }609 610 611 @NotNull612 @Transactional(rollbackFor = Exception.class)613 public Long insertTapasRequest( @NotNull final User user )614 throws ServiceException615 {616 617 try618 {619 String dd = "1";620 621 final TapasRequest ntp = new TapasRequest( user.getFirstName(), user.getLastName(), dd, _tapasRequestDAO.getNumRequest() + 1 );622 return _tapasRequestDAO.insert( ntp );623 }624 catch( PersistenceException e )625 {626 throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e );627 }628 }629 630 631 // recuperation infos observatoire avec l'id632 @Nullable633 @Transactional(readOnly = true)634 public Observatory getObservatoryById( @NotNull final long id )635 throws ServiceException636 {637 try638 {639 return _observatoryDAO.getObservatoryById( id );640 }641 catch( PersistenceException e )642 {643 throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e );644 }645 }646 647 648 // recuperation infos observatoire avec le nom649 @Nullable650 @Transactional(readOnly = true)651 public Observatory getObservatoryByName( @NotNull final String name )652 throws ServiceException653 {654 try655 {656 return _observatoryDAO.getObservatoryByName( name );657 }658 catch( PersistenceException e )659 {660 throw new ServiceException( ServiceException.ServiceCode.OBSERVATORY_NOT_FOUND, e );661 }662 }663 664 665 @Required666 public void setObservatoryDAO( final ObservatoryDAO observatoryDAO )667 {668 _observatoryDAO = observatoryDAO;669 }670 671 @Required672 public void setTapasRequestDAO( final TapasRequestDAO tapasRequestDAO )673 {674 _tapasRequestDAO = tapasRequestDAO;675 }676 677 private static final Log LOGGER = LogFactory.getLog( TapasServiceImpl.class );678 679 private ObservatoryDAO _observatoryDAO;680 681 private TapasRequestDAO _tapasRequestDAO;682 } -
tapas/web/init_en.jsp
r783 r816 26 26 27 27 TAPAS is a free on-line service for the astronomical community, allowing the user to access a simulated atmospheric transmission for the specific observing conditions 28 (description available in <a href="resources/doc/Bertaux_tapas_2014_aa.pdf" target="_blankk"><u>Bertaux <i> et al.</i>, 2014</u></a>). It can be accessed through the ETHER data base makes use of:<br>28 (description available in <a class="containerLabel3" href="resources/doc/Bertaux_tapas_2014_aa.pdf" target="_blank"><i>Bertaux et al., 2014</i></a>). It can be accessed through the ETHER data base makes use of:<br> 29 29 <ul type=circle> 30 30 <li>the latest available version of spectroscopic HITRAN data base … … 118 118 119 119 <br><br> 120 <table cellpadding=4 cellspacing= 6 align="center" bgcolor="white" width="700" height="60">120 <table cellpadding=4 cellspacing=2 align="center" bgcolor="white" width="700" height="60" class="logos"> 121 121 122 122 <tr> 123 <td><a target="_blank" href="http://www.cnes.fr"><img border="1" width= 70 src="resources/images/logo_cnes.png"></a></td>123 <td><a target="_blank" href="http://www.cnes.fr"><img border="1" width=60 src="resources/images/logo_cnes.png"></a></td> 124 124 <td><a target="_blank" href="http://www.cnrs.fr"><img border="1" width=70 src="resources/images/logo_cnrs.jpg"></a></td> 125 125 <td><a target="_blank" href="http://www.ipsl.fr"><img width=100 src="resources/images/logo_ipsl.png"></a></td> -
tapas/web/init_fr.jsp
r783 r816 118 118 119 119 <br> 120 <table cellpadding=4 cellspacing=6 align="center" bgcolor="white" width="700" height="60"> 121 120 <table cellpadding=4 cellspacing=2 align="center" bgcolor="white" width="700" height="60" class="logos"> 122 121 <tr> 123 <td><a target="_blank" href="http://www.cnes.fr"><img border="1" width= 70 src="resources/images/logo_cnes.png"></a></td>122 <td><a target="_blank" href="http://www.cnes.fr"><img border="1" width=60 src="resources/images/logo_cnes.png"></a></td> 124 123 <td><a target="_blank" href="http://www.cnrs.fr"><img border="1" width=70 src="resources/images/logo_cnrs.jpg"></a></td> 125 124 <td><a target="_blank" href="http://www.ipsl.fr"><img width=100 src="resources/images/logo_ipsl.png"></a></td> -
tapas/web/project/formTapas.jsp
r784 r816 80 80 tapasTexts["label.spectralUnit"] = "<spring:message code="label.spectralUnit"/>"; 81 81 tapasTexts["label.spectralRange"] = "<spring:message code="label.spectralRange"/>"; 82 tapasTexts["label.locality"] = "<spring:message code="label.locality"/>"; 83 tapasTexts["label.altitude"] = "<spring:message code="label.altitude"/>"; 84 tapasTexts["label.latitude"] = "<spring:message code="label.latitude"/>"; 85 tapasTexts["label.longitude"] = "<spring:message code="label.longitude"/>"; 82 86 tapasTexts["label.to"] = "<spring:message code="label.to"/>"; 83 87 tapasTexts["label.observatory"] = "<spring:message code="label.observatory"/>"; … … 88 92 tapasTexts["label.climato"] = "<spring:message code="label.climato"/>"; 89 93 tapasTexts["label.datemesure"] = "<spring:message code="label.datemesure"/>"; 94 tapasTexts["label.cpydatemesure"] = "<spring:message code="label.cpydatemesure"/>"; 90 95 tapasTexts["label.berv"] = "<spring:message code="label.berv"/>"; 96 tapasTexts["label.onetransmission"] = "<spring:message code="label.onetransmission"/>"; 91 97 92 98 tapasTexts["label.format"] = "<spring:message code="label.format"/>"; … … 104 110 tapasTexts["label.datemesure"] = "<spring:message code="label.datemesure"/>"; 105 111 112 tapasTexts["label.locality"] = "<spring:message code="label.locality"/>"; 113 tapasTexts["label.altitude"] = "<spring:message code="label.altitude"/>"; 114 tapasTexts["label.latitude"] = "<spring:message code="label.latitude"/>"; 115 tapasTexts["label.longitude"] = "<spring:message code="label.longitude"/>"; 116 106 117 tapasTexts["text.validnum"] = "<spring:message code="text.validnum"/>"; 107 118 tapasTexts["text.badvalue"] = "<spring:message code="text.badvalue"/>"; … … 117 128 tapasTexts["language"] = "<spring:message code="language"/>"; 118 129 130 tapasTexts["text.errcpydate"] = "<spring:message code="text.errcpydate"/>"; 131 132 tapasTexts["text.selectlocation"] = "<spring:message code="text.selectlocation"/>"; 133 119 134 var interfaceTapas = new InterfaceTapas( ${jSonFileFormats}, ${jSonYesNos}, ${jSonObservatories}, ${jSonSpectralUnits}, ${jSonInstrumentalFunctions}, ${jSonClimatoReferences} ); 120 135 -
tapas/web/project/formTapas_script.jsp
r784 r816 3 3 4 4 5 var InterfaceTapas = Class.create( { 5 var InterfaceTapas; 6 InterfaceTapas = Class.create( { 6 7 initialize: function( jsonFileFormats, jsonYesNos, jsonObservatories, jsonSpectralUnits, jsonInstrumentalFunctions, jsonClimatoReferences ) 7 8 { … … 26 27 this.select_irextinctionList = new Object(); 27 28 this.select_ibervCList = new Object(); 29 this.select_iOneTransmissionList = new Object(); 28 30 29 31 this.jSonObservatories = jsonObservatories || false; … … 35 37 this.jSonClimatoReferences = jsonClimatoReferences || null; 36 38 this.selectClimatoReferencesList = new Object(); 39 this.dateTemp = "zz"; 37 40 this.nbRequest = 1; 38 41 this.tabActive = false; 39 42 this.numRequest = 1; 40 43 41 this.language = tapasTexts["language"] ; 42 this.browser="Firefox"; 43 44 if (navigator.userAgent.indexOf('Firefox') != -1 && parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf('Firefox') + 8)) >= 3.6){ 45 this.browser="Firefox"; 46 } 47 else if (navigator.userAgent.indexOf('Chrome') != -1 && parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf('Chrome') + 7).split(' ')[0]) >= 15){ 48 this.browser="Chrome"; 49 } 50 else if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Version') != -1 && parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf('Version') + 8).split(' ')[0]) >= 5){ 51 this.browser="Safari"; 44 45 this.language = tapasTexts["language"]; 46 this.browser = "Firefox"; 47 48 if( navigator.userAgent.indexOf( 'Firefox' ) != -1 && parseFloat( navigator.userAgent.substring( navigator.userAgent.indexOf( 'Firefox' ) + 8 ) ) >= 3.6 ) 49 { 50 this.browser = "Firefox"; 51 } 52 else if( navigator.userAgent.indexOf( 'Chrome' ) != -1 && parseFloat( navigator.userAgent.substring( navigator.userAgent.indexOf( 'Chrome' ) + 7 ).split( ' ' )[0] ) >= 15 ) 53 { 54 this.browser = "Chrome"; 55 } 56 else if( navigator.userAgent.indexOf( 'Safari' ) != -1 && navigator.userAgent.indexOf( 'Version' ) != -1 && parseFloat( navigator.userAgent.substring( navigator.userAgent.indexOf( 'Version' ) + 8 ).split( ' ' )[0] ) >= 5 ) 57 { 58 this.browser = "Safari"; 52 59 } 53 60 54 61 // Buttons 55 var submitButton = new Button( {value:tapasTexts["label.submitButton"], parent:this.containerCenter, id:"button_submit", className: " red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} );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 )} ); 56 63 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 )} ); 57 64 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 )} ); … … 59 66 60 67 this.createForm(); 68 61 69 this.tabActive = this.createTab(); 62 70 this.divE = $( document.createElement( "div" ) ); … … 76 84 param.className = "loading-classic"; 77 85 this.loadingRequest = new Loading( param ); 86 87 var nbr=1; 88 89 $( '#select_iobservatory_'+this.nbRequest ).bind( 'focus', ["1"], jQuery.proxy(this.locationChoice,this)); 90 78 91 //this.loadingRequest.display(); 79 92 }, … … 89 102 90 103 91 createCalendar: function( containerCalendar, texte, inputDateId, currentDate, isTrToCreate )104 createCalendar: function( containerCalendar, texte, texte2, inputDateId, inputDateId2, currentDate, isTrToCreate ) 92 105 { 93 106 if( isTrToCreate ) … … 97 110 var td1 = $( document.createElement( "td" ) ); 98 111 var td2 = $( document.createElement( "td" ) ); 112 var td3 = $( document.createElement( "td" ) ); 113 var td4 = $( document.createElement( "td" ) ); 99 114 var inputDate = $( document.createElement( "input" ) ); 100 115 inputDate.attr( {id:inputDateId, size:"17"} ); 116 117 var inputDate2 = $( document.createElement( "input" ) ); 118 inputDate2.attr( {id:inputDateId2, size:"17"} ); 101 119 102 120 td1.html( texte ); … … 104 122 tr.append( td1 ); 105 123 106 td2.attr( {colspan: 4} );124 td2.attr( {colspan:3} ); 107 125 td2.append( inputDate ); 108 126 tr.append( td2 ); 109 127 containerCalendar.append( tr ); 128 129 td3.html( texte2 ); 130 td3.attr( { class:"containerLabel" } ); 131 td3.attr( {colspan:2} ); 132 tr.append( td3 ); 133 134 td4.attr( {colspan:5} ); 135 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)); 139 tr.append( td4 ); 140 containerCalendar.append( tr ); 141 110 142 } 111 143 … … 178 210 createTr: function( texte, inputId, container, textesup, event, champ, ctnb, info ) 179 211 { 180 181 212 var tr = $( document.createElement( "tr" ) ); 182 213 var td1 = $( document.createElement( "td" ) ); … … 185 216 var input = $( document.createElement( "input" ) ); 186 217 187 input.attr( {id: inputId, class:"containerText" +ctnb, size:11} );188 189 190 if (event.length > 0) input.bind( event, [this, champ], this.angleChoice );218 input.attr( {id: inputId, class:"containerText" + ctnb, size:11} ); 219 220 221 if( event.length > 0 ) input.bind( event, [this, champ], this.angleChoice ); 191 222 192 223 … … 198 229 td2.append( input ); 199 230 231 td2.attr( {colspan:2} ); 232 200 233 tr.append( td2 ); 201 234 tr.append( td3 ); 202 235 container.append( tr ); 203 236 204 var re1 = new RegExp("isr_"); 205 var re2 = new RegExp("irp_"); 206 207 if (info && (inputId.match(re1) || inputId.match(re2))) { 237 238 239 var re1 = new RegExp( "isr_" ); 240 var re2 = new RegExp( "irp_" ); 241 242 if( info && (inputId.match( re1 ) || inputId.match( re2 )) ) 243 { 208 244 209 245 var img = $( document.createElement( "img" ) ); 210 246 var a = $( document.createElement( "a" ) ); 211 247 var div = $( document.createElement( "div" ) ); 212 img.attr("src","resources/images/info.png"); 213 img.attr("width","19"); 214 a.attr("style","cursor:pointer"); 215 216 img.bind("click",[inputId,450,100,this],this.onClickInfos); 217 a.append(img); 218 div.append(a); 219 248 img.attr( "src", "resources/images/info.png" ); 249 img.attr( "width", "19" ); 250 a.attr( "style", "cursor:pointer" ); 251 252 img.bind( "click", [inputId,450,100,this], this.onClickInfos ); 253 a.append( img ); 254 div.append( a ); 220 255 221 256 td1.append( a ); … … 223 258 tr.append( div ); 224 259 225 } 226 else if (info) { 260 if (inputId.match( re2 )) { 261 input.css("backgroundColor", "#bfafd6"); 262 input.attr('disabled','disabled'); 263 } 264 265 } 266 else if( info ) 267 { 227 268 var img = $( document.createElement( "img" ) ); 228 269 var a = $( document.createElement( "a" ) ); 229 img.attr( "src","resources/images/info.png");230 img.attr( "width","19");231 a.attr( "style","cursor:pointer");232 img.bind( "click",[inputId,450,100,this],this.onClickInfos);233 a.append( img);234 td1.append( a);270 img.attr( "src", "resources/images/info.png" ); 271 img.attr( "width", "19" ); 272 a.attr( "style", "cursor:pointer" ); 273 img.bind( "click", [inputId,450,100,this], this.onClickInfos ); 274 a.append( img ); 275 td1.append( a ); 235 276 td1.append( texte ); 236 277 237 278 } 279 280 238 281 }, 239 282 … … 241 284 createTrTxt: function( texte, container ) 242 285 { 243 var tr = $( document.createElement( "tr" ) ); 244 var td1 = $( document.createElement( "td" ) ); 245 246 td1.html( texte ); 247 td1.attr( {class:"containerLabelT", colspan:4} ); 248 249 tr.append( td1 ); 250 container.append( tr ); 251 252 253 }, 254 286 287 var tr = $( document.createElement( "tr" ) ); 288 var td1 = $( document.createElement( "td" ) ); 289 290 td1.html( texte ); 291 td1.attr( {class:"containerLabelT", colspan:4} ); 292 293 tr.append( td1 ); 294 container.append( tr ); 295 296 }, 255 297 256 298 … … 267 309 var input2 = $( document.createElement( "input" ) ); 268 310 269 270 311 input1.attr( {id: inputId1,class:"containerText",size:11} ); 271 312 input2.attr( {id: inputId2,class:"containerText",size:11} ); 272 273 313 274 314 td3.html( texte2 ); … … 276 316 var img = $( document.createElement( "img" ) ); 277 317 var a = $( document.createElement( "a" ) ); 278 img.attr( "src","resources/images/info.png");279 img.attr( "width","19");280 a.attr( "style","cursor:pointer");281 img.bind( "click",["spectral_range",450,100,this],this.onClickInfos);282 a.append( img);283 td1.append( a);284 318 img.attr( "src", "resources/images/info.png" ); 319 img.attr( "width", "19" ); 320 a.attr( "style", "cursor:pointer" ); 321 img.bind( "click", ["spectral_range",450,100,this], this.onClickInfos ); 322 a.append( img ); 323 td1.append( a ); 324 td1.append( texte1 ); 285 325 286 326 //img.onclick(this.onClickInfos("spectral_range",1200,440)); 287 327 288 328 td1.attr( {class:"containerLabel"} ); 289 td3.attr( {class:"containerLabel 3"} );329 td3.attr( {class:"containerLabel4"} ); 290 330 td5.attr( {class:"containerLabel2"} ); 291 331 … … 293 333 //td2.html( texte2 ); 294 334 td4.append( input2 ); 335 td4.attr( {colspan:2} ); 336 td5.attr( {colspan:2} ); 295 337 296 338 tr.append( td1 ); … … 304 346 305 347 306 307 createTrList: function( texte, inputId, index, container, type, info ) 348 createTr3Input: function( texte1, texte2, texte3, texte4, inputId1, inputId2, inputId3, inputId4, container, textesup, textesup2 ) 349 { 350 var tr = $( document.createElement( "tr" ) ); 351 var td1 = $( document.createElement( "td" ) ); 352 var td2 = $( document.createElement( "td" ) ); 353 var td3 = $( document.createElement( "td" ) ); 354 var td4 = $( document.createElement( "td" ) ); 355 var td5 = $( document.createElement( "td" ) ); 356 var td6 = $( document.createElement( "td" ) ); 357 var td7 = $( document.createElement( "td" ) ); 358 var td8 = $( document.createElement( "td" ) ); 359 var td9 = $( document.createElement( "td" ) ); 360 361 362 var input1 = $( document.createElement( "input" ) ); 363 var input2 = $( document.createElement( "input" ) ); 364 var input3 = $( document.createElement( "input" ) ); 365 var input4 = $( document.createElement( "input" ) ); 366 367 368 input1.attr( {id: inputId1,class:"containerText",size:14} ); 369 input2.attr( {id: inputId2,class:"containerText",size:4} ); 370 input3.attr( {id: inputId3,class:"containerText",size:4} ); 371 input4.attr( {id: inputId4,class:"containerText",size:4} ); 372 373 input1.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 374 input2.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 375 input3.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 376 input4.bind( "change", ["2"], jQuery.proxy(this.locationChoice,this)); 377 378 td3.html( texte2 ); 379 td5.html( texte3 ); 380 td7.html( texte4 ); 381 td9.html( textesup ); 382 383 384 385 var img = $( document.createElement( "img" ) ); 386 var a = $( document.createElement( "a" ) ); 387 img.attr( "src", "resources/images/info.png" ); 388 img.attr( "width", "19" ); 389 a.attr( "style", "cursor:pointer" ); 390 img.bind( "click", ["spectral_range",450,100,this], this.onClickInfos ); 391 a.append( img ); 392 td1.append( a ); 393 td1.append( texte1 ); 394 395 //img.onclick(this.onClickInfos("spectral_range",1200,440)); 396 397 td1.attr( {class:"containerLabel"} ); 398 td3.attr( {class:"containerLabel4"} ); 399 td5.attr( {class:"containerLabel2"} ); 400 td7.attr( {class:"containerLabel2"} ); 401 td9.attr( {class:"containerLabel2"} ); 402 403 404 405 td2.append( input1 ); 406 td4.append( input2 ); 407 td6.append( input3 ); 408 td8.append( input4 ); 409 td4.append( textesup2 ); 410 411 td2.attr( {colspan:2} ); 412 413 tr.append( td1 ); 414 tr.append( td2 ); 415 tr.append( td3 ); 416 tr.append( td4 ); 417 tr.append( td5 ); 418 tr.append( td6 ); 419 tr.append( td7 ); 420 tr.append( td8 ); 421 tr.append( td9 ); 422 423 container.append( tr ); 424 }, 425 426 427 createTrList: function( texte, inputId, index, container, type, info, event ) 308 428 { 309 429 var tr = $( document.createElement( "tr" ) ); … … 312 432 var td3 = $( document.createElement( "td" ) ); 313 433 var input = $( document.createElement( "input" ) ); 314 var champ ="";434 var champ = ""; 315 435 316 436 var div = $( document.createElement( "div" ) ); 317 437 318 319 438 input.attr( {id: inputId} ); 320 439 321 // alert(inputId);322 if( 'format' == type ){440 if( 'format' == type ) 441 { 323 442 this.displaySelect( td2, inputId, index, this.jSonFileFormats, this.selectFileFormatsList, false, null ); 324 443 info = true; 325 444 champ = "iformat_"; 326 327 445 } 328 446 else … … 338 456 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ico2eList, false, "yesNos" ); 339 457 else if( (/^(ich4e_[1-9]+)$/.test( inputId ) ) ) 340 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ich4eList, false, "yesNos" );458 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ich4eList, false, "yesNos" ); 341 459 else if( (/^(in2oe_[1-9]+)$/.test( inputId ) ) ) 342 460 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_in2oeList, false, "yesNos" ); 343 else if( (/^(irextinction_[1-9]+)$/.test( inputId ) ) ) { 461 else if( (/^(iOneTransmission_[1-9]+)$/.test( inputId ) ) ) 462 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_iOneTransmissionList, false, "yesNos" ); 463 else if( (/^(irextinction_[1-9]+)$/.test( inputId ) ) ) 464 { 344 465 345 466 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_irextinctionList, false, "yesNos" ); 346 467 info = true; 347 champ=inputId; 348 } 349 else if( (/^(ibervC_[1-9]+)$/.test( inputId ) ) ) { 468 champ = inputId; 469 } 470 else if( (/^(ibervC_[1-9]+)$/.test( inputId ) ) ) 471 { 350 472 this.displaySelect( td2, inputId, index, this.jSonYesNos, this.select_ibervCList, false, "yesNos" ); 351 473 info = true; 352 champ=inputId; 353 } 354 } 355 else if( 'observatories' == type ) { 356 474 champ = inputId; 475 476 } 477 } 478 else if( 'observatories' == type ) 479 { 357 480 this.displaySelect1( td2, inputId, index, this.jSonObservatories, this.selectObservatoriesList, true, "observatories" ); 358 481 //this.displaySelect( td2, inputId, index, this.jSonObservatories, this.selectObservatoriesList, true, "observatories" ); 359 360 champ="iobservatory_"; 361 } 362 else if( 'spectralUnit' == type ) { 482 champ = "iobservatory_"; 483 //input.bind( 'click', [this, 'select_iobservatory_1'], this.locationChoice ); 484 } 485 else if( 'spectralUnit' == type ) 486 { 363 487 this.displaySelect( td2, inputId, index, this.jSonSpectralUnits, this.selectSpectralUnitsList, true, "spectralUnits" ); 364 488 info = true; … … 366 490 champ = "ispectral_choice_"; 367 491 } 368 else if( 'ilsf' == type ) { 492 else if( 'ilsf' == type ) 493 { 369 494 this.displaySelect( td2, inputId, index, this.jSonInstrumentalFunctions, this.selectInstrumentalFunctionsList, false, "instrumentalFunctions" ); 370 495 info = true; 371 496 champ = "ifunction_"; 372 497 } 373 else if( 'climatoReference' == type ) { 498 else if( 'climatoReference' == type ) 499 { 374 500 this.displaySelect( td2, inputId, index, this.jSonClimatoReferences, this.selectClimatoReferencesList, false, "climatoReferences" ); 375 501 info = true; … … 377 503 } 378 504 505 506 379 507 td1.attr( {class:"containerLabel"} ); 380 508 tr.append( td1 ); 381 509 382 510 383 if (info) { 511 512 513 if( info ) 514 { 384 515 var img = $( document.createElement( "img" ) ); 385 516 var a = $( document.createElement( "a" ) ); 386 img.attr("src","resources/images/info.png"); 387 img.attr("width","19"); 388 a.attr("style","cursor:pointer"); 389 390 img.bind("click",[champ,450,100,this],this.onClickInfos); 391 a.append(img); 392 div.append(a); 393 394 395 td2.attr( {colspan:5} ); 517 img.attr( "src", "resources/images/info.png" ); 518 img.attr( "width", "19" ); 519 a.attr( "style", "cursor:pointer" ); 520 img.bind( "click", [champ,450,100,this], this.onClickInfos ); 521 a.append( img ); 522 div.append( a ); 523 524 525 td2.attr( {colspan:10} ); 396 526 td1.append( a ); 397 527 td1.append( texte ); … … 400 530 401 531 } 402 else { 532 else 533 { 403 534 td1.append( texte ); 404 535 td2.attr( {colspan:3} ); … … 406 537 } 407 538 container.append( tr ); 539 408 540 }, 409 541 … … 439 571 440 572 // EVENTS ******************************************************** 441 onClickInfos: function(param) 442 { 443 444 var parametre=param.data[0]; 445 var width=param.data[1]; 446 var height=param.data[2]; 447 var context=param.data[3]; 448 449 if ("spectral_range" == parametre) { 450 width=600; 451 height=120; 573 onClickInfos: function( param ) 574 { 575 576 var parametre = param.data[0]; 577 var width = param.data[1]; 578 var height = param.data[2]; 579 var context = param.data[3]; 580 581 if( "spectral_range" == parametre ) 582 { 583 width = 600; 584 height = 120; 452 585 var titre = "Définition de l'intervalle spectral pour le calcul."; 453 586 var pageInfo = "resources/doc/infosSpectralRange_fr.txt"; 454 587 455 if( "fr" != context.language ) { 588 if( "fr" != context.language ) 589 { 456 590 titre = "Definition of spectral interval for the computation."; 457 591 pageInfo = "resources/doc/infosSpectralRange_en.txt"; 458 width=600; 459 height=100; 460 } 461 462 } 463 464 if ("ispectral_choice_" == parametre) { 592 width = 600; 593 height = 100; 594 } 595 596 } 597 598 if( "ispectral_choice_" == parametre ) 599 { 465 600 var titre = "Unité spectrale"; 466 601 var pageInfo = "resources/doc/infosSpectralUnit_fr.txt"; 467 width=600; 468 height=450; 469 if( "fr" != context.language ) { 602 width = 600; 603 height = 450; 604 if( "fr" != context.language ) 605 { 470 606 titre = "Spectral unit"; 471 607 pageInfo = "resources/doc/infosSpectralUnit_en.txt"; 472 width=500; 473 height=450; 474 } 475 } 476 477 var re = new RegExp("irp_"); 478 if (parametre.match(re)) { 608 width = 500; 609 height = 450; 610 } 611 } 612 613 var re = new RegExp( "irp_" ); 614 if( parametre.match( re ) ) 615 { 479 616 var titre = "Résolution"; 480 617 var pageInfo = "resources/doc/infosResolution_fr.txt"; 481 width=600; 482 height=200; 483 if( "fr" != context.language ) { 618 width = 600; 619 height = 200; 620 if( "fr" != context.language ) 621 { 484 622 titre = "Resolution power"; 485 623 pageInfo = "resources/doc/infosResolution_en.txt"; 486 width=500; 487 height=200; 488 } 489 } 490 491 var re = new RegExp("isr_"); 492 if (parametre.match(re)) { 624 width = 500; 625 height = 200; 626 } 627 } 628 629 var re = new RegExp( "isr_" ); 630 if( parametre.match( re ) ) 631 { 493 632 var titre = "Taux d'échantillonnage"; 494 633 var pageInfo = "resources/doc/infosSamplingRatio_fr.txt"; 495 width=600; 496 height=100; 497 if( "fr" != context.language ) { 634 width = 600; 635 height = 100; 636 if( "fr" != context.language ) 637 { 498 638 titre = "Sampling ratio"; 499 639 pageInfo = "resources/doc/infosSamplingRatio_en.txt"; 500 width=500; 501 height=100; 502 } 503 } 504 505 var re = new RegExp("ibervC_"); 506 if (parametre.match(re)) { 640 width = 500; 641 height = 100; 642 } 643 } 644 645 var re = new RegExp( "ibervC_" ); 646 if( parametre.match( re ) ) 647 { 507 648 var titre = "Correction BERV"; 508 649 var pageInfo = "resources/doc/infosBERV_fr.txt"; 509 width=950; 510 height=700; 511 if( "fr" != context.language ) { 650 width = 950; 651 height = 700; 652 if( "fr" != context.language ) 653 { 512 654 titre = "BERV correction"; 513 655 pageInfo = "resources/doc/infosBERV_en.txt"; 514 width=950; 515 height=680; 516 } 517 } 518 519 var re = new RegExp("ira_"); 520 if (parametre.match(re)) { 656 width = 950; 657 height = 680; 658 } 659 } 660 661 var re = new RegExp( "ira_" ); 662 if( parametre.match( re ) ) 663 { 521 664 var titre = "LOS Ascension Droite"; 522 665 var pageInfo = "resources/doc/infosLOSRA_fr.txt"; 523 width=600; 524 height=150; 525 if( "fr" != context.language ) { 666 width = 600; 667 height = 150; 668 if( "fr" != context.language ) 669 { 526 670 titre = "LOS Right Ascension"; 527 671 pageInfo = "resources/doc/infosLOSRA_en.txt"; 528 width=500; 529 height=150; 530 } 531 } 532 533 var re = new RegExp("ide_"); 534 if (parametre.match(re)) { 672 width = 500; 673 height = 150; 674 } 675 } 676 677 var re = new RegExp( "ide_" ); 678 if( parametre.match( re ) ) 679 { 535 680 var titre = "LOS Déclinaison"; 536 681 var pageInfo = "resources/doc/infosLOSD_fr.txt"; 537 width=600; 538 height=100; 539 if( "fr" != context.language ) { 682 width = 600; 683 height = 100; 684 if( "fr" != context.language ) 685 { 540 686 titre = "LOS Declination"; 541 687 pageInfo = "resources/doc/infosLOSD_en.txt"; 542 width=600; 543 height=100; 544 } 545 } 546 547 var re = new RegExp("iza_"); 548 if (parametre.match(re)) { 688 width = 600; 689 height = 100; 690 } 691 } 692 693 var re = new RegExp( "iza_" ); 694 if( parametre.match( re ) ) 695 { 549 696 var titre = "Angle zénithal"; 550 697 var pageInfo = "resources/doc/infosZenithalAngle_fr.txt"; 551 width=600; 552 height=100; 553 if( "fr" != context.language ) { 698 width = 600; 699 height = 100; 700 if( "fr" != context.language ) 701 { 554 702 titre = "Zenithal angle"; 555 703 pageInfo = "resources/doc/infosZenithalAngle_en.txt"; 556 width=600; 557 height=100; 558 } 559 } 560 561 var re = new RegExp("isr_"); 562 if (parametre.match(re)) { 704 width = 600; 705 height = 100; 706 } 707 } 708 709 var re = new RegExp( "isr_" ); 710 if( parametre.match( re ) ) 711 { 563 712 var titre = "Taux d'échantillonnage"; 564 713 var pageInfo = "resources/doc/infosSamplingRatio_fr.txt"; 565 width=600; 566 height=150; 567 if( "fr" != context.language ) { 714 width = 600; 715 height = 150; 716 if( "fr" != context.language ) 717 { 568 718 titre = "Sampling Ratio"; 569 719 pageInfo = "resources/doc/infosSamplingRatio_en.txt"; 570 width=500; 571 height=150; 572 } 573 } 574 575 var re = new RegExp("irextinction_"); 576 if (parametre.match(re)) { 720 width = 500; 721 height = 150; 722 } 723 } 724 725 var re = new RegExp( "irextinction_" ); 726 if( parametre.match( re ) ) 727 { 577 728 var titre = "Sélection des composants atmosphériques"; 578 729 var pageInfo = "resources/doc/infosSpecies_fr.txt"; 579 width=600; 580 height=350; 581 if( "fr" != context.language ) { 730 width = 600; 731 height = 350; 732 if( "fr" != context.language ) 733 { 582 734 titre = "Selection of atmospheric constituents"; 583 735 pageInfo = "resources/doc/infosSpecies_en.txt"; 584 width=600; 585 height=360; 586 } 587 } 588 589 if ("icr_" == parametre) { 736 width = 600; 737 height = 360; 738 } 739 } 740 741 if( "icr_" == parametre ) 742 { 590 743 var titre = "Modèle atmosphérique"; 591 744 var pageInfo = "resources/doc/infosAtmosphericModel_fr.txt"; 592 width=600; 593 height=400; 594 if( "fr" != context.language ) { 745 width = 600; 746 height = 400; 747 if( "fr" != context.language ) 748 { 595 749 titre = "Atmospheric model"; 596 750 pageInfo = "resources/doc/infosAtmosphericModel_en.txt"; 597 width=500; 598 height=400; 599 } 600 } 601 602 if ("iobservatory_" == parametre) { 751 width = 500; 752 height = 400; 753 } 754 } 755 756 if( "iobservatory_" == parametre ) 757 { 603 758 var titre = "Observatoire"; 604 759 var pageInfo = "resources/doc/infosObservatory_fr.txt"; 605 width=600; 606 height=100; 607 if( "fr" != context.language ) { 760 width = 600; 761 height = 100; 762 if( "fr" != context.language ) 763 { 608 764 titre = "Observatory"; 609 765 pageInfo = "resources/doc/infosObservatory_en.txt"; 610 width=500; 611 height=100; 612 } 613 } 614 615 if ("iformat_" == parametre) { 766 width = 500; 767 height = 100; 768 } 769 } 770 771 if( "iformat_" == parametre ) 772 { 616 773 var titre = "Format fichier"; 617 774 var pageInfo = "resources/doc/infosFileFomat_fr.txt"; 618 width=600; 619 height=100; 620 if( "fr" != context.language ) { 775 width = 600; 776 height = 100; 777 if( "fr" != context.language ) 778 { 621 779 titre = "File format"; 622 780 pageInfo = "resources/doc/infosFileFomat_en.txt"; 623 width=500; 624 height=80; 625 } 626 } 627 628 if ("ifunction_" == parametre) { 781 width = 500; 782 height = 80; 783 } 784 } 785 786 if( "ifunction_" == parametre ) 787 { 629 788 var titre = "Fonction instrumentale"; 630 789 var pageInfo = "resources/doc/infosInstrumentalFunction_fr.txt"; 631 width=600; 632 height=230; 633 if( "fr" != context.language ) { 790 width = 600; 791 height = 230; 792 if( "fr" != context.language ) 793 { 634 794 titre = "Instrumental function"; 635 795 pageInfo = "resources/doc/infosInstrumentalFunction_en.txt"; 636 width =500;637 height =240;796 width = 500; 797 height = 240; 638 798 } 639 799 } … … 642 802 var $dialog = $( '<div></div>' ) 643 803 .load( pageInfo ) 644 645 autoOpen: false,646 title:titre,647 height:height,648 width:width649 } );804 .dialog( { 805 autoOpen: false, 806 title:titre, 807 height:height, 808 width:width 809 } ); 650 810 651 811 $dialog.dialog( 'open' ); … … 697 857 $( "#tab_request" + numCurrent ).remove(); 698 858 AnyTime.noPicker( "iobservation_date_" + numCurrent ); 859 AnyTime.noPicker( "iobservation_cpydate_" + numCurrent ); 699 860 AnyTime.noPicker( "ira_" + numCurrent ); 700 861 … … 760 921 this.select_in2oeList[i] = null; 761 922 923 this.select_iOneTransmissionList[z] = this.select_iOneTransmissionList[i]; 924 this.select_iOneTransmissionList[i] = null; 925 762 926 this.select_ibervCList[z] = this.select_ibervCList[i]; 763 927 this.select_ibervCList[i] = null; … … 765 929 // Supression du calendrier puis re-création en insérant l'ancienne date 766 930 var oldDate = this.calendarConverter.parse( $( "#iobservation_date_" + i ).val() ); 767 //var oldDate = $( "#iobservation_date_" + i ).val();768 769 931 AnyTime.noPicker( "iobservation_date_" + i ); 932 933 if (!isEmpty($( "#iobservation_cpydate_" + i ).val())) { 934 var oldDate2 = this.calendarConverter.parse( $( "#iobservation_cpydate_" + i ).val() ); 935 AnyTime.noPicker( "iobservation_cpydate_" + i ); 936 } 937 770 938 //this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], "iobservation_date_" + z, oldDate, false ); 771 939 772 940 $( "#iobservation_date_" + i ).attr( {id:"iobservation_date_" + z} ); 773 this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], "iobservation_date_" + z, oldDate, false ); 774 //this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], "iobservation_date_" + z, false, false ); 941 $( "#iobservation_cpydate_" + i ).attr( {id:"iobservation_cpydate_" + z} ); 942 this.createCalendar( $( "#tabObservation_" + z ), tapasTexts["label.datemesure"], tapasTexts["label.cpydatemesure"], "iobservation_date_" + z, "iobservation_cpydate_" + z, oldDate, false ); 943 944 775 945 776 946 // Idem pour les heures !!! … … 778 948 // var oldTime = this.timeConverter.parse( $( "#ira_" + i ).val() ); 779 949 /*var oldTime = $( "#ira_" + i ).val(); 780 AnyTime.noPicker( "ira_" + i );781 this.createTime( $( "#tabObservation_" + z ), tapasTexts["label.ira"], "ira_" + z, oldTime, false,"j2000" );782 $( "#ira_" + i ).attr( {id:"ira_" + z} );*/950 AnyTime.noPicker( "ira_" + i ); 951 this.createTime( $( "#tabObservation_" + z ), tapasTexts["label.ira"], "ira_" + z, oldTime, false,"j2000" ); 952 $( "#ira_" + i ).attr( {id:"ira_" + z} );*/ 783 953 } 784 954 } … … 828 998 paramSelect.parent = container; 829 999 var select = new Select( paramSelect ); 1000 1001 1002 //select.add( "tt", "bob " + tapasTexts["text.select"] + " --",this.ifunctionChoice); 1003 830 1004 if( nullValueIsNeeded ) 831 1005 select.add( "-1", "-- " + tapasTexts["text.select"] + " --" ); … … 841 1015 break; 842 1016 case "instrumentalFunctions" : 1017 select.add( jsonElement.value, tapasTexts[jsonElement.text],jQuery.proxy(this.ifunctionChoice,this) ); // passe le gros this 1018 break; 843 1019 case "climatoReferences" : 844 1020 case "yesNos" : … … 847 1023 default: 848 1024 select.add( jsonElement.value, jsonElement.text ); 1025 849 1026 break; 850 1027 } … … 857 1034 { 858 1035 859 $( "#select_iobservatory_" +this.nbRequest ).autocomplete( {1036 $( "#select_iobservatory_" + this.nbRequest ).autocomplete( { 860 1037 source: this.listObs, 861 appendTo: "#regionContent" +this.nbRequest,1038 appendTo: "#regionContent" + this.nbRequest, 862 1039 minLength: 0, 863 1040 autoFocus: true, … … 880 1057 displaySelect1: function( container, id, index, jsonList, selectList, nullValueIsNeeded, contentManage ) 881 1058 { 882 //alert("ok");883 1059 var iselect = $( document.createElement( "select" ) ); 884 var option = document.createElement( "option");1060 var option = document.createElement( "option" ); 885 1061 886 1062 var paramSelect = new Object(); … … 888 1064 paramSelect.parent = container; 889 1065 890 var observatoryArray =new Array();891 this.listObs =new Array();1066 var observatoryArray = new Array(); 1067 this.listObs = new Array(); 892 1068 893 1069 894 1070 //var bob =$('<div id="region" class="containerField"><div class="containerTitle"><div class="containerTitleText">Region</div><div class="containerTitleClose"><img src="img/close.png"></div></div><div class="containerRegion"><input id="regionTags" size="23"/></div><div id="regionContent"></div></div> '); 895 var bob =$('<div class="containerField"><input id="select_'+id+'" size="42"/></div><div id="regionContent'+this.nbRequest+'" class="regionContent"></div> '); 896 897 //alert('<div class=containerField><input id=select_'+id+' size=23/></div><div id=regionContent></div> '); 898 899 //var select = new Select( paramSelect ); 900 //iselect.options.add("1","1"); 901 //if( nullValueIsNeeded ) Select1 1071 var bob = $( '<div class="containerField"><input id="select_' + id + '" size="42"/></div><div id="regionContent' + this.nbRequest + '" class="regionContent"></div> ' ); 902 1072 903 1073 var option = new Option(); 904 1074 option.text = "-- " + tapasTexts["text.select"] + " --"; 905 1075 option.value = "-1"; 906 iselect.append( option ); 1076 907 1077 908 1078 jQuery.each( jsonList, jQuery.proxy( function ( i, jsonElement ) 909 1079 { 910 //ajouter fonction 911 912 /*var option = new Option(); 913 option.text = jsonElement.name; 914 option.value = jsonElement.id;*/ 915 //observatoryArray.push(jsonElement.name); 916 this.listObs.push(jsonElement.name); 917 //console.log(option.value+"-"+option.text); 918 //iselect.append(option); 919 1080 //ajouter fonction 1081 1082 /*var option = new Option(); 1083 option.text = jsonElement.name; 1084 option.value = jsonElement.id;*/ 1085 //observatoryArray.push(jsonElement.name); 1086 this.listObs.push( jsonElement.name ); 1087 //console.log(option.value+"-"+option.text); 1088 //iselect.append(option); 920 1089 921 1090 }, this ) ); … … 923 1092 /*selectList[index] = select;*/ 924 1093 //container.append(iselect); 925 container.append(bob); 926 selectList[index]="select_"+id; 1094 1095 container.append( bob ); 1096 selectList[index] = "select_" + id; 1097 927 1098 928 1099 }, … … 937 1108 createForm: function() 938 1109 { 939 940 941 1110 942 1111 var divAll = $( document.createElement( "div" ) ); … … 981 1150 divAll.append( divObservation ); 982 1151 983 984 1152 divAtmosphere.append( tabAtmosphere ); 985 1153 //divAtmosphere.addClass("divAtmosphere"); … … 995 1163 //this.tabInput = new Array(3); 996 1164 997 this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, this.nbRequest, tabPreference, 'format' ); 998 this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 999 this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1000 this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1001 this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1002 this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1003 this.createTrList( tapasTexts["label.ech4"], "ich4e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1004 this.createTrList( tapasTexts["label.en2o"], "in2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1005 this.createTrList( tapasTexts["label.berv"], "ibervC_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1006 1007 this.createTrList( tapasTexts["label.observatory"], "iobservatory_" + this.nbRequest, this.nbRequest, tabObservation, 'observatories',true ); 1008 this.createCalendar( tabObservation, tapasTexts["label.datemesure"], "iobservation_date_" + this.nbRequest, false, true ); 1165 this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, this.nbRequest, tabPreference, 'format',false,"" ); 1166 this.createTrList( tapasTexts["label.berv"], "ibervC_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1167 this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1168 this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1169 this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1170 this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1171 this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1172 this.createTrList( tapasTexts["label.ech4"], "ich4e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1173 this.createTrList( tapasTexts["label.en2o"], "in2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1174 this.createTrList( tapasTexts["label.onetransmission"], "iOneTransmission_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno',false,"" ); 1175 1176 1177 1178 this.createTrList( tapasTexts["label.observatory"], "iobservatory_" + this.nbRequest, this.nbRequest, tabObservation, 'observatories', true, "" ); 1179 this.createTrTxt( tapasTexts["label.or"], tabObservation ); 1180 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]"," m" ); 1181 1182 this.createCalendar( tabObservation, tapasTexts["label.datemesure"], tapasTexts["label.cpydatemesure"], "iobservation_date_" + this.nbRequest, "iobservation_cpydate_" + this.nbRequest, false, true ); 1183 1009 1184 1010 1185 //unite 1011 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice_" + this.nbRequest, this.nbRequest, tabObservation, 'spectralUnit' );1186 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice_" + this.nbRequest, this.nbRequest, tabObservation, 'spectralUnit', false, "" ); 1012 1187 this.createTr2Input( tapasTexts["label.spectralRange"], tapasTexts["label.to"], "iminspectral_ranger_" + this.nbRequest, "imaxspectral_ranger_" + this.nbRequest, tabObservation, "[350,2500] nm" ); 1013 1188 1014 1189 //fonction instrumentale 1015 this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, this.nbRequest, tabObservation, "ilsf" 1190 this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, this.nbRequest, tabObservation, "ilsf", false, "select"); 1016 1191 //reference climato 1017 1192 //this.createTrList( tapasTexts["label.climato"], "icr", tabAtmosphere, "climatoReference" ); 1018 this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, this.nbRequest, tabObservation, "climatoReference" ); 1019 1020 1021 this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "", "", "","",true ); 1022 this.createTr( tapasTexts["label.ratio"], "isr_" + this.nbRequest, tabObservation, "", "","","",true ); 1023 1024 1025 this.createTr( tapasTexts["label.ira"], "ira_" + this.nbRequest,tabObservation,"hh:mm:ss (J2000)","keypress","ra","2",true ); 1193 this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, this.nbRequest, tabObservation, "climatoReference", false, ""); 1194 1195 this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "", "", "", "", true ); 1196 this.createTr( tapasTexts["label.ratio"], "isr_" + this.nbRequest, tabObservation, "", "", "", "", true ); 1197 1198 this.createTr( tapasTexts["label.ira"], "ira_" + this.nbRequest, tabObservation, "hh:mm:ss (J2000)", "keypress", "ra", "2", true ); 1026 1199 //this.createTime( tabObservation, tapasTexts["label.ira"], "ira_" + this.nbRequest, false, true,"hh:mm:ss (J2000)" ); 1027 this.createTr( tapasTexts["label.ide"], "ide_" + this.nbRequest, tabObservation, "deg:':''", "keypress","de","2",true );1200 this.createTr( tapasTexts["label.ide"], "ide_" + this.nbRequest, tabObservation, "deg:':''", "keypress", "de", "2", true ); 1028 1201 this.createTrTxt( tapasTexts["label.or"], tabObservation ); 1029 this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] °", "keypress","za","2",true );1202 this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] °", "keypress", "za", "2", true ); 1030 1203 1031 1204 this.createAutoCompleteMenuForRegions(); 1032 1205 1033 1206 this.initRequestFields(); 1207 1208 1209 1210 1034 1211 //jQuery.proxy permet d'envoyer le contexte this courant 1035 1212 … … 1037 1214 1038 1215 1216 1039 1217 createTapasObject: function() 1040 1218 { 1041 1219 1042 1220 var requests = new Array(); 1221 var i = 1; 1222 1223 1043 1224 1044 1225 for( var i = 1; i <= this.nbRequest; i++ ) … … 1085 1266 preference.bervCorrection.secondValue = this.select_ibervCList[i].getValue(); 1086 1267 1268 preference.oneTransmission = new Object(); 1269 preference.oneTransmission.firstValue = this.select_iOneTransmissionList[i].getValuesInString(); 1270 preference.oneTransmission.secondValue = this.select_iOneTransmissionList[i].getValue(); 1271 1087 1272 1088 1273 // OBSERVATION … … 1091 1276 //observatory.id = this.selectObservatoriesList[i].getValue(); 1092 1277 //observatory.id = 2; 1093 observatory.name = $("#select_iobservatory_"+i).val(); 1278 observatory.name = $( "#select_iobservatory_" + i ).val(); 1279 1280 1281 var location = new Object(); 1282 location.name = $( "#ilocality_" + i ).val(); 1283 location.longitude = $( "#ilongitude_" + i ).val(); 1284 location.latitude = $( "#ilatitude_" + i ).val(); 1285 location.altitude = $( "#ialtitude_" + i ).val(); 1286 location.shortName = $( "#ilocality_" + i ).val(); 1094 1287 1095 1288 // Los … … 1097 1290 1098 1291 //if ($( "#iza_" + i ).val().toString() != null) 1099 1292 los.zenithAngle = $( "#iza_" + i ).val(); 1100 1293 //else { 1101 1102 1294 los.raJ2000 = $( "#ira_" + i ).val(); 1295 los.decJ2000 = $( "#ide_" + i ).val(); 1103 1296 //} 1104 1297 … … 1131 1324 1132 1325 var observation = new Object(); 1133 observation.date = this.calendarConverter.parse( $( "#iobservation_date_" + i ).val() ).getTime(); 1326 1327 if (!isEmpty($( "#iobservation_cpydate_" + i ).val()) && isDate($("#iobservation_cpydate_" + i ).val()) ) 1328 { 1329 observation.date = this.calendarConverter.parse( $( "#iobservation_cpydate_" + i ).val() ).getTime(); 1330 } 1331 else 1332 { 1333 observation.date = this.calendarConverter.parse( $( "#iobservation_date_" + i ).val() ).getTime(); 1334 } 1134 1335 1135 1336 1136 1337 observation.observatory = observatory; 1338 1339 observation.location = location; 1137 1340 1138 1341 observation.los = los; … … 1165 1368 validFields: function() 1166 1369 { 1370 1167 1371 for( var i = 1; i <= this.nbRequest; i++ ) 1168 1372 { 1169 1373 1170 1374 var chaine = tapasTexts["text.erreur.saisie"] + " " + i + "<br>"; 1171 var testOk1=false; 1172 var testOk2=false; 1173 var testOk3=false; 1375 var testOk1 = false; 1376 var testOk2 = false; 1377 var testOk3 = false; 1378 1379 testOk1 = isDate( $( "#iobservation_cpydate_" + this.nbRequest ).val() ) || isEmpty( $( "#iobservation_cpydate_" + this.nbRequest ).val() ); 1380 if( !testOk1 ) 1381 { 1382 this.divE.hide(); 1383 this.divE.html( chaine + " : " + tapasTexts["text.errcpydate"] ); 1384 this.divE.show(); 1385 return false; 1386 } 1387 1388 1174 1389 //var testOk = isSup( this.selectObservatoriesList[i].getValue(), 0 ); 1175 var testOk = isEmpty($( "#select_iobservatory_" + i ).val()) || this.listObs.indexOf($( "#select_iobservatory_" + i ).val())<0; 1176 //alert(testOk); 1177 if( testOk ) 1178 { 1179 this.divE.html( chaine + tapasTexts["label.observatory"] + " : " + tapasTexts["text.toselect"] ); 1390 var testOk = isEmpty( $( "#select_iobservatory_" + i ).val() ) || this.listObs.indexOf( $( "#select_iobservatory_" + i ).val() ) < 0; 1391 testOk2 = !isEmpty( $( "#ilocality_" + i ).val() ) && isValidNum( $( "#ialtitude_" + i ).val() ) && isValidNum( $( "#ilatitude_" + i ).val() ) && isValidNum( $( "#ilongitude_" + i ).val() ) 1392 1393 if( testOk && !testOk2) 1394 { 1395 this.divE.hide(); 1396 this.divE.html( chaine + " " + tapasTexts["text.selectlocation"] ); 1180 1397 this.divE.show(); 1181 1398 return false; … … 1199 1416 1200 1417 /*testOk = isDeg( $( "#ide_" + i ).val() ); 1201 if( !testOk )1202 {1203 1204 1205 1206 } */1418 if( !testOk ) 1419 { 1420 this.divE.html( chaine + tapasTexts["label.ide"] + " : " + tapasTexts["text.badvalue"] ); 1421 this.divE.show(); 1422 return false; 1423 } */ 1207 1424 1208 1425 1209 1426 testOk = isBetween( $( "#iza_" + i ).val(), 0, 90 ); 1210 testOk1 = isValidNum( $( "#iza_" + i ).val() );1211 testOk2 = isDeg( $( "#ide_" + i ).val() );1212 testOk3 = isHourDeg( $( "#ira_" + i ).val() );1427 testOk1 = isValidNum( $( "#iza_" + i ).val() ); 1428 testOk2 = isDeg( $( "#ide_" + i ).val() ); 1429 testOk3 = isHourDeg( $( "#ira_" + i ).val() ); 1213 1430 if( !((testOk && testOk1) || (testOk2 && testOk3)) ) 1214 1431 { 1215 if 1432 if( !(testOk && testOk1) ) 1216 1433 this.divE.html( chaine + "LOS : " + tapasTexts["text.badvalue"] ); 1217 1434 else … … 1222 1439 1223 1440 /*testOk = isBetween( $( "#iza_" + i ).val(), 0, 90 ); 1224 if( !testOk ) 1225 { 1226 this.divE.html( chaine + tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 1227 this.divE.show(); 1228 return false; 1229 } */ 1441 if( !testOk ) 1442 { 1443 this.divE.html( chaine + tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 1444 this.divE.show(); 1445 return false; 1446 } */ 1447 1230 1448 1231 1449 testOk = isValidNum( $( "#irp_" + i ).val() ); 1232 if( !testOk ) 1233 { 1234 this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 1235 this.divE.show(); 1236 return false; 1237 } 1238 1239 testOk = isSup( $( "#irp_" + i ).val(), 1 ); 1240 if( !testOk ) 1241 { 1242 this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 1243 this.divE.show(); 1244 return false; 1245 } 1450 testOk2 = isSupS( this.selectInstrumentalFunctionsList[i].getValue() , -1 ); 1451 1452 1453 if (testOk2) 1454 { 1455 if( !testOk ) 1456 { 1457 this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 1458 this.divE.show(); 1459 return false; 1460 } 1461 1462 testOk = isSup( $( "#irp_" + i ).val(), 1 ); 1463 if( !testOk ) 1464 { 1465 this.divE.html( chaine + tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 1466 this.divE.show(); 1467 return false; 1468 } 1469 } 1470 1246 1471 1247 1472 testOk = isValidNum( $( "#isr_" + i ).val() ); … … 1264 1489 return true; 1265 1490 }, 1491 1492 1266 1493 1267 1494 updateButtons: function() … … 1279 1506 1280 1507 1281 angleChoice: function(params) 1282 { 1508 1509 angleChoice: function( params ) 1510 { 1511 1283 1512 var context = params.data[0]; 1284 1513 var champ = params.data[1]; 1285 //alert(context.nbRequest);1286 1514 var indice = context.nbRequest; 1287 if (champ == "za") { 1288 //$( "#iza_"+indice ).val($( "#iza_"+indice ).val().replace(/^\s+|\s+$/g,"")); 1289 //alert($( "#iza_"+indice ).val($( "#iza_"+indice ).val().replace(/^\s+|\s+$/g,"")).length); 1290 //if ($( "#iza_"+indice ).val($( "#iza_"+indice ).val().replace(/^\s+|\s+$/g,"")).length >0 ) { 1291 $( "#ira_"+indice ).val(""); 1292 $( "#ide_"+indice ).val(""); 1515 if( champ == "za" ) 1516 { 1517 $( "#ira_" + indice ).val( "" ); 1518 $( "#ide_" + indice ).val( "" ); 1293 1519 //} 1294 1520 } 1521 else 1522 { 1523 $( "#iza_" + indice ).val( "" ); 1524 } 1525 1526 }, 1527 1528 1529 ifunctionChoice: function() 1530 { 1531 //this.selectInstrumentalFunctionsList[indice].select(this.selectInstrumentalFunctionsList[indice-1].getValue(),false); 1532 //var context = params.data[0]; 1533 //var champ = params.data[1]; 1534 var valeur = this.selectInstrumentalFunctionsList[this.nbRequest].getValue(); 1535 1536 if ( valeur == -1 ) { 1537 $( "#irp_" + this.nbRequest ).val(""); 1538 $( "#irp_" + this.nbRequest ).css("backgroundColor", "#bfafd6"); 1539 $( "#irp_" + this.nbRequest ).attr('disabled','disabled'); 1540 } 1295 1541 else { 1296 $( "#iza_"+indice ).val(""); 1297 } 1298 1299 1300 }, 1301 1302 1303 1304 /*this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, this.nbRequest, tabPreference, 'format' ); 1305 this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1306 this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1307 this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1308 this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1309 this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1310 1311 this.createTrList( tapasTexts["label.observatory"], "iobservatory_" + this.nbRequest, this.nbRequest, tabObservation, 'observatories' ); 1312 this.createCalendar( tabObservation, tapasTexts["label.datemesure"], "iobservation_date_" + this.nbRequest, false, true ); 1313 1314 //unite 1315 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice_" + this.nbRequest, this.nbRequest, tabObservation, 'spectralUnit' ); 1316 this.createTr2Input( tapasTexts["label.spectralRange"], tapasTexts["label.to"], "iminspectral_ranger_" + this.nbRequest, "imaxspectral_ranger_" + this.nbRequest, tabObservation, "[350,2500] nm" ); 1317 1318 //fonction instrumentale 1319 this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, this.nbRequest, tabObservation, "ilsf" ); 1320 //reference climato 1321 //this.createTrList( tapasTexts["label.climato"], "icr", tabAtmosphere, "climatoReference" ); 1322 this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, this.nbRequest, tabObservation, "climatoReference" ); 1323 1324 1325 this.createTr( tapasTexts["label.ira"], "ira_" + this.nbRequest,tabObservation,"hh:mm:ss (J2000)","keypress","ra","2" ); 1326 //this.createTime( tabObservation, tapasTexts["label.ira"], "ira_" + this.nbRequest, false, true,"hh:mm:ss (J2000)" ); 1327 this.createTr( tapasTexts["label.ide"], "ide_" + this.nbRequest, tabObservation, "deg:':''","keypress","de","2" ); 1328 1329 this.createTrTxt( "or", tabObservation ); 1330 this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] °","keypress","za","2" ); 1331 1332 this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "", "", "","" ); 1333 this.createTr( tapasTexts["label.ratio"], "isr_" + this.nbRequest, tabObservation, "", "","","" ); 1334 */ 1542 $( "#irp_" + this.nbRequest ).css("backgroundColor", "#FFFFFF"); 1543 $( "#irp_" + this.nbRequest ).removeAttr('disabled'); 1544 } 1545 1546 1547 //var indice = context.nbRequest; 1548 1549 }, 1550 1551 1552 locationChoice: function(ind) 1553 { 1554 var option = ind.data[0].toString(); 1555 1556 if ("1" == option) 1557 { 1558 $( '#ilocality_' + this.nbRequest).val(""); 1559 $( '#ialtitude_' + this.nbRequest).val(""); 1560 $( '#ilatitude_' + this.nbRequest).val(""); 1561 $( '#ilongitude_' + this.nbRequest).val(""); 1562 } 1563 else 1564 { 1565 $( '#select_iobservatory_' + this.nbRequest).val(""); 1566 } 1567 }, 1568 1569 1570 1571 checkDate: function() 1572 { 1573 var testOk1 = isDate( $( "#iobservation_cpydate_" + this.nbRequest ).val() ) || isEmpty( $( "#iobservation_cpydate_" + this.nbRequest ).val()) ; 1574 if( !testOk1 ) 1575 { 1576 alert( tapasTexts["text.errcpydate"] ); 1577 return false; 1578 } 1579 return true; 1580 }, 1581 1582 1583 1584 emptyCpyDate: function() 1585 { 1586 if ( this.dateTemp != $( "#iobservation_cpydate_" + this.nbRequest ).val("") ) { 1587 $( "#iobservation_cpydate_" + this.nbRequest ).val(""); 1588 } 1589 return true; 1590 }, 1591 1592 1593 tempDate: function() 1594 { 1595 this.dateTemp = "1234"; 1596 return true; 1597 }, 1598 1599 /*this.createTrList( tapasTexts["label.format"], "iformat_" + this.nbRequest, this.nbRequest, tabPreference, 'format' ); 1600 this.createTrList( tapasTexts["label.era"], "irextinction_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1601 this.createTrList( tapasTexts["label.eh2o"], "ih2oe_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1602 this.createTrList( tapasTexts["label.eo3"], "io3e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1603 this.createTrList( tapasTexts["label.eo2"], "io2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1604 this.createTrList( tapasTexts["label.eco2"], "ico2e_" + this.nbRequest, this.nbRequest, tabPreference, 'yesno' ); 1605 1606 this.createTrList( tapasTexts["label.observatory"], "iobservatory_" + this.nbRequest, this.nbRequest, tabObservation, 'observatories' ); 1607 this.createCalendar( tabObservation, tapasTexts["label.datemesure"], "iobservation_date_" + this.nbRequest, false, true ); 1608 1609 //unite 1610 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice_" + this.nbRequest, this.nbRequest, tabObservation, 'spectralUnit' ); 1611 this.createTr2Input( tapasTexts["label.spectralRange"], tapasTexts["label.to"], "iminspectral_ranger_" + this.nbRequest, "imaxspectral_ranger_" + this.nbRequest, tabObservation, "[350,2500] nm" ); 1612 1613 //fonction instrumentale 1614 this.createTrList( tapasTexts["label.ifunction"], "ifunction_" + this.nbRequest, this.nbRequest, tabObservation, "ilsf" ); 1615 //reference climato 1616 //this.createTrList( tapasTexts["label.climato"], "icr", tabAtmosphere, "climatoReference" ); 1617 this.createTrList( tapasTexts["label.climato"], "icr_" + this.nbRequest, this.nbRequest, tabObservation, "climatoReference" ); 1618 1619 1620 this.createTr( tapasTexts["label.ira"], "ira_" + this.nbRequest,tabObservation,"hh:mm:ss (J2000)","keypress","ra","2" ); 1621 //this.createTime( tabObservation, tapasTexts["label.ira"], "ira_" + this.nbRequest, false, true,"hh:mm:ss (J2000)" ); 1622 this.createTr( tapasTexts["label.ide"], "ide_" + this.nbRequest, tabObservation, "deg:':''","keypress","de","2" ); 1623 1624 this.createTrTxt( "or", tabObservation ); 1625 this.createTr( tapasTexts["label.iza"], "iza_" + this.nbRequest, tabObservation, "[0,90] °","keypress","za","2" ); 1626 1627 this.createTr( tapasTexts["label.resolution"], "irp_" + this.nbRequest, tabObservation, "", "", "","" ); 1628 this.createTr( tapasTexts["label.ratio"], "isr_" + this.nbRequest, tabObservation, "", "","","" ); 1629 */ 1335 1630 1336 1631 1337 1632 initRequestFields: function() 1338 1633 { 1339 if (this.nbRequest > 1 && this.nbRequest <=9) { 1634 if( this.nbRequest > 1 && this.nbRequest <= 9 ) 1635 { 1340 1636 var indice = this.nbRequest; 1341 1637 var indice0 = indice - 1; 1342 1638 1343 this.selectObservatoriesList[indice].select(this.selectObservatoriesList[indice-1].getValue(),false);1344 $( "#iobservation_date_" + indice ).val( $( "#iobservation_date_" + indice0 ).val() );1345 this.selectSpectralUnitsList[indice].select(this.selectSpectralUnitsList[indice-1].getValue(),false);1346 1347 1348 this.selectInstrumentalFunctionsList[indice].select( this.selectInstrumentalFunctionsList[indice-1].getValue(),false);1349 this.selectClimatoReferencesList[indice].select( this.selectClimatoReferencesList[indice-1].getValue(),false);1350 1351 this.selectFileFormatsList[indice].select( this.selectFileFormatsList[indice-1].getValue(),false);1352 this.select_irextinctionList[indice].select( this.select_irextinctionList[indice-1].getValue(),false);1353 this.select_ih2oeList[indice].select( this.select_ih2oeList[indice-1].getValue(),false);1354 this.select_io3eList[indice].select( this.select_io3eList[indice-1].getValue(),false);1355 this.select_io2eList[indice].select( this.select_io2eList[indice-1].getValue(),false);1356 this.select_ico2eList[indice].select( this.select_ico2eList[indice-1].getValue(),false);1357 this.select_ich4eList[indice].select( this.select_ich4eList[indice-1].getValue(),false);1358 this.select_in2oeList[indice].select( this.select_in2oeList[indice-1].getValue(),false);1359 this.select_i bervCList[indice].select(this.select_ibervCList[indice-1].getValue(),false);1360 1361 $( "#iminspectral_ranger_" + indice ).val($( "#iminspectral_ranger_" + indice0 ).val() ); 1362 $( "#im axspectral_ranger_" + indice ).val($( "#imaxspectral_ranger_" + indice0 ).val() );1363 1364 $( "#irp_" + indice ).val($( "#irp_" + indice0 ).val() ); 1365 $( "#i sr_" + indice ).val($( "#isr_" + indice0 ).val() );1366 $( "#i ra_" + indice ).val($( "#ira_" + indice0 ).val() );1367 $( "#i de_" + indice ).val($( "#ide_" + indice0 ).val() );1368 $( "#i za_" + indice ).val($( "#iza_" + indice0 ).val() );1369 1370 1371 1372 // $( "#iobservatory_date_" + indice ).val( $( "#iobservatory_date_" + indice0 ).val() );1373 // $( "#iobservatory_date_" + indice ).val( this.calendarConverter.format( currentDate ) );1639 //this.selectObservatoriesList[indice].select( this.selectObservatoriesList[indice - 1].getValue(), false ); 1640 $( "#iobservation_date_" + indice ).val( $( "#iobservation_date_" + indice0 ).val() ); 1641 $( "#iobservation_cpydate_" + indice ).val( $( "#iobservation_cpydate_" + indice0 ).val() ); 1642 this.selectSpectralUnitsList[indice].select( this.selectSpectralUnitsList[indice - 1].getValue(), false ); 1643 1644 this.selectInstrumentalFunctionsList[indice].select( this.selectInstrumentalFunctionsList[indice - 1].getValue(), false ); 1645 this.selectClimatoReferencesList[indice].select( this.selectClimatoReferencesList[indice - 1].getValue(), false ); 1646 1647 this.selectFileFormatsList[indice].select( this.selectFileFormatsList[indice - 1].getValue(), false ); 1648 this.select_irextinctionList[indice].select( this.select_irextinctionList[indice - 1].getValue(), false ); 1649 this.select_ih2oeList[indice].select( this.select_ih2oeList[indice - 1].getValue(), false ); 1650 this.select_io3eList[indice].select( this.select_io3eList[indice - 1].getValue(), false ); 1651 this.select_io2eList[indice].select( this.select_io2eList[indice - 1].getValue(), false ); 1652 this.select_ico2eList[indice].select( this.select_ico2eList[indice - 1].getValue(), false ); 1653 this.select_ich4eList[indice].select( this.select_ich4eList[indice - 1].getValue(), false ); 1654 this.select_in2oeList[indice].select( this.select_in2oeList[indice - 1].getValue(), false ); 1655 this.select_iOneTransmissionList[indice].select( this.select_iOneTransmissionList[indice - 1].getValue(), false ); 1656 this.select_ibervCList[indice].select( this.select_ibervCList[indice - 1].getValue(), false ); 1657 1658 $( "#iminspectral_ranger_" + indice ).val( $( "#iminspectral_ranger_" + indice0 ).val() ); 1659 $( "#imaxspectral_ranger_" + indice ).val( $( "#imaxspectral_ranger_" + indice0 ).val() ); 1660 1661 $( "#irp_" + indice ).val( $( "#irp_" + indice0 ).val() ); 1662 $( "#isr_" + indice ).val( $( "#isr_" + indice0 ).val() ); 1663 $( "#ira_" + indice ).val( $( "#ira_" + indice0 ).val() ); 1664 $( "#ide_" + indice ).val( $( "#ide_" + indice0 ).val() ); 1665 $( "#iza_" + indice ).val( $( "#iza_" + indice0 ).val() ); 1666 1667 1668 // $( "#iobservatory_date_" + indice ).val( $( "#iobservatory_date_" + indice0 ).val() ); 1669 // $( "#iobservatory_date_" + indice ).val( this.calendarConverter.format( currentDate ) ); 1374 1670 1375 1671 //$( "#iobservatory_date_" + indice ).val( this.calendarConverter.format( this.calendarConverter.parse( $( "#iobservation_date_" + indice0 ).val() ).getTime() ) ); 1376 1672 // this.selectSpectralUnitsList[z] = this.selectSpectralUnitsList[i]; 1377 1673 /*this.selectSpectralUnitsList[i] = null; 1378 $( "#iminspectral_ranger_" + i ).attr( {id:"iminspectral_ranger_" + z} );1379 $( "#imaxspectral_ranger_" + i ).attr( {id:"imaxspectral_ranger_" + z} );*/1674 $( "#iminspectral_ranger_" + i ).attr( {id:"iminspectral_ranger_" + z} ); 1675 $( "#imaxspectral_ranger_" + i ).attr( {id:"imaxspectral_ranger_" + z} );*/ 1380 1676 1381 1677 //$( "#irp_"+indice ).val($( "#irp_"+(indice-1)).val() ); -
tapas/web/resources/css/TwitterLogin/front.css
r529 r816 18 18 19 19 #topnav { 20 /*padding: 10px 0px 12px;*/20 /*padding: 10px 0px 12px;*/ 21 21 font-size: 11px; 22 22 line-height: 23px; … … 44 44 #topnav a.signin, #topnav a.signin:hover { 45 45 *background-position: 0 3px !important; 46 //color: #bfafd6;46 color: #bfafd6; 47 47 } 48 48 … … 62 62 -moz-border-radius-topleft: 4px; 63 63 -moz-border-radius-topright: 4px; 64 background: # ff7c25!important;64 background: #59427b !important; 65 65 color: black !important; 66 66 outline: none; … … 77 77 a.signin.menu-open span { 78 78 background-image: url("images/toggle_up_dark.png"); 79 color: black;79 color: white ; 80 80 } 81 81 … … 86 86 -webkit-border-bottom-right-radius: 4px; 87 87 display: none; 88 background-color: # ff7c25;88 background-color: #59427b; 89 89 position: absolute; 90 90 width: 210px; 91 91 z-index: 100; 92 border: 0 transparent;92 border: 1 ; 93 93 text-align: left; 94 94 padding: 16px; … … 98 98 margin-right: 0px; 99 99 margin-right: -1px; 100 color: black;100 color: white; 101 101 font-size: 11px; 102 102 } … … 106 106 -moz-border-radius: 4px; 107 107 -webkit-border-radius: 4px; 108 border: 1px solid # d45400;108 border: 1px solid #825fb7; 109 109 font-size: 13px; 110 110 margin: 0 0 5px; … … 138 138 } */ 139 139 140 #signin_menu a{ 141 color:#c0afd6; 142 } 143 140 144 #signin_menu a:hover{ 141 145 color:white; … … 145 149 -moz-border-radius: 4px; 146 150 -webkit-border-radius: 4px; 147 background: # d45400url('images/bg-btn-blue.png') repeat-x scroll 0 0;148 border: 1px solid # d45400;151 background: #825fb7 url('images/bg-btn-blue.png') repeat-x scroll 0 0; 152 border: 1px solid #825fb7; 149 153 color: #ffffff; 150 //text-shadow: 0 -1px 0 #39d;151 154 padding: 4px 10px 5px; 152 155 font-size: 11px; 153 156 margin: 0 5px 0 0; 154 157 font-weight: bold; 158 border-radius:8px; 155 159 } 156 160 … … 163 167 background-position: 0 -5px; 164 168 cursor: pointer; 165 color: #d45400; 169 color: #59427b; 170 border-radius:8px; 166 171 } 167 172 … … 188 193 -webkit-border-radius: 4px; 189 194 border-radius: 4px; 190 background-color: #d45400;195 background-color: black; 191 196 color: white; 192 197 text-align: left; -
tapas/web/resources/css/apycom.com-4-blue-violet/menu.css
r492 r816 37 37 } 38 38 div#menu ul.menu { 39 padding-right: 10px;39 padding-right: 461px; 40 40 background: url(images/right.png) no-repeat right 0; 41 41 _background-image: url(images/right.gif); -
tapas/web/resources/css/apycom.com-8-orange-red/menu.css
r767 r816 23 23 div#menu { 24 24 height: 50px; 25 padding-left: 42 5px;26 margin-right: 0px;25 padding-left: 427px; 26 margin-right: -39px; 27 27 margin-top:10px; 28 28 background:url(images/nav-bg.png) repeat-x; -
tapas/web/resources/css/button.css
r529 r816 62 62 background-color: #F0FFF0; 63 63 color: #529214; 64 border-radius:8px; 64 65 } 65 66 … … 83 84 /* DISABLE */ 84 85 button.disable, button.disable:hover { 86 border-radius:8px; 85 87 background-color: #CCCCCC; 86 88 border: 1px solid #dedede; … … 139 141 /* RED BUTTON */ 140 142 button.red_button { 141 background-color: # d45400;143 background-color: #8a68bb; 142 144 height: 40px; 143 145 float: right; … … 146 148 } 147 149 150 151 148 152 .red_button_text { 149 color: black;153 color: white; 150 154 font-size: 11px; 151 155 font-weight: bold; 156 152 157 } 153 158 154 159 .red_button_text:hover { 155 color : # d45400;160 color : #bfafd6; 156 161 font-size: 11px; 157 162 font-weight: bold; … … 159 164 160 165 button.red_button:hover { 161 background-color: # ff7c25;166 background-color: #bfafd6; 162 167 163 168 } 169 170 /* */ 171 button.tapas1 { 172 background-color: #bfafd6; 173 height: 40px; 174 float: right; 175 margin-right: 0; 176 border: 0; 177 border-radius:8px; 178 } 179 180 181 182 .tapas1_text { 183 color: white; 184 font-size: 11px; 185 font-weight: bold; 186 } 187 188 .tapas1:hover { 189 color : #bfafd6; 190 font-size: 11px; 191 font-weight: bold; 192 } 193 194 button.tapas1:hover { 195 background-color: #bfafd6; 196 197 } 198 199 -
tapas/web/resources/css/complexButton.css
r383 r816 9 9 10 10 .complexButton_left { 11 background-image: url("../images/elements/button_left_ 3.png");11 background-image: url("../images/elements/button_left_violet.png"); 12 12 background-repeat: no-repeat; 13 13 background-position: top left; … … 32 32 33 33 .complexButton_middle, .complexButton_middle_gray { 34 background-image: url("../images/elements/button_middle_ 3.png"); /*background-image: url("../images/elements/button_middle.png");*/34 background-image: url("../images/elements/button_middle_violet.png"); /*background-image: url("../images/elements/button_middle.png");*/ 35 35 background-repeat: repeat-x; 36 36 height: 39px; … … 44 44 .complexButton_lonely_middle { 45 45 -moz-border-radius: 6px; 46 background-image: url("../images/elements/button_middle_ 3.png");46 background-image: url("../images/elements/button_middle_violet.png"); 47 47 background-repeat: repeat-x; 48 48 height: 40px; … … 62 62 63 63 .complexButton_right { 64 background-image: url("../images/elements/button_right_ 3.png");64 background-image: url("../images/elements/button_right_violet.png"); 65 65 background-repeat: no-repeat; 66 66 background-position: top right; … … 76 76 -webkit-border-radius: 0 4px 4px 0; 77 77 78 background-image: url("../images/elements/button_middle_ gray.png"); /*background-image: url("../images/elements/button_middle.png");*/78 background-image: url("../images/elements/button_middle_violet.png"); /*background-image: url("../images/elements/button_middle.png");*/ 79 79 background-repeat: repeat-x; 80 80 height: 39px; -
tapas/web/resources/css/mainEther.css
r529 r816 8 8 font-size: 13px; 9 9 line-height: 1.7em; /*color: #333333;*/ 10 color: black;10 color: #e7e6eb; 11 11 font-family: Trebuchet MS, Arial, san-serif; 12 12 } … … 20 20 a img { 21 21 border-width: 0; 22 text-decoration:none; 22 23 } 23 24 24 25 a { 25 26 text-decoration:none; 26 color: black;27 color: #574176 ; 27 28 text-align:center; 28 //line-height: 35px;29 29 } 30 30 … … 33 33 color: black; 34 34 text-align:center; 35 //line-height: 35px;36 35 } 37 36 … … 40 39 color: black; 41 40 text-align:center; 42 line-height: 35px;43 41 } 44 42 -
tapas/web/resources/css/tapas.css
r779 r816 25 25 .tab_class { 26 26 float: right; 27 background: #ff7c25; 28 //color: #d45400; 29 color: white; 27 background: #bfafd6; 28 color: #e7e6eb; 30 29 margin-left: 11px; 31 30 margin-right: -10px; … … 35 34 margin-top: 3px; 36 35 height: 19px; 37 / / -moz-box-shadow : 0 0 5 px rgba ( 0, 0, 0, 0.3 ); 38 / / -webkit-box-shadow : 0 0 5 px rgba ( 0, 0, 0, 0.3 ); 39 / / box-shadow : 0 0 4 px rgba ( 0, 0, 0, 0.3 ); 36 border-radius: 8px 8px 0px 0px; 40 37 } 41 38 42 39 .tab_class.activated { 43 background: # d45400;44 color: black;40 background: #8260b1; 41 color: white; 45 42 46 43 } … … 51 48 52 49 .cfs1 { 53 border: 2px solid black;50 border: 2px solid #e7e6eb; 54 51 -moz-border-radius: 8px; 55 52 -webkit-border-radius: 8px; 56 53 border-radius: 8px; 57 54 padding-right: 40px; 58 padding-left: 30px; 59 margin-left: -10px; 60 padding-bottom: 11px; 61 width:650px; 55 padding-left: 21px; 56 height: 467px; 57 margin-left: -26px; 58 margin-top: -23px; 59 padding-bottom: 13px; 60 width:676px; 62 61 } 63 62 64 63 .cfs2 { 65 border: 2px solid black;64 border: 2px solid #e7e6eb; 66 65 -moz-border-radius: 8px; 67 66 -webkit-border-radius: 8px; … … 70 69 padding-bottom: 30px; 71 70 margin-right: 0px;*/ 72 margin-left: -67px; 71 margin-left: -72px; 72 height: 327px; 73 margin-top: -23px; 73 74 /*padding-left: 20px;*/ 74 75 width : 249px; … … 77 78 78 79 .cfs3 { 79 border: 2px solid black;80 border: 2px solid #bfafd6; 80 81 -moz-border-radius: 8px; 81 82 -webkit-border-radius: 8px; 82 83 border-radius: 8px; 83 84 padding-right: 45px; 84 padding-left: 30px;85 margin-left: 1 8px;86 margin-top: 11px;85 padding-left: 60px; 86 margin-left: 10px; 87 margin-top: 2px; 87 88 padding-bottom: 30px; 88 89 width:900px; … … 93 94 float: left; 94 95 width: 1070px; 95 height: 4 00px;96 height: 467px; 96 97 97 98 } … … 168 169 .containerLabel { 169 170 font-size: 12px; 170 color: black;171 color: #e7e6eb; 171 172 font-weight: bold; 172 173 / / margin-bottom : 10 px; … … 177 178 .containerLabelT { 178 179 font-size: 12px; 179 color: black;180 color: #e7e6eb; 180 181 font-weight: bold; 181 182 / / margin-bottom : 10 px; … … 186 187 .containerLabel2 { 187 188 font-size: 12px; 188 color: black;189 color: #e7e6eb; 189 190 font-weight: bold; 190 191 / / margin-bottom : 10 px; … … 192 193 } 193 194 195 194 196 .containerLabel3 { 195 197 font-size: 12px; 196 color: black; 197 font-weight: bold; 198 text-align: center; 199 } 200 201 .containerLabel3 { 202 font-size: 12px; 203 color: black; 198 color: white; 204 199 font-weight: bold; 205 200 text-align: justify; 201 } 202 203 .containerLabel3 a { 204 font-size: 12px; 205 color: white; 206 font-weight: bold; 207 text-align: justify; 208 text-decoration:underline; 209 } 210 211 .containerLabel4 { 212 font-size: 12px; 213 color: white; 214 font-weight: bold; 215 text-align: right; 216 } 217 218 .containerLabel4 a { 219 font-size: 12px; 220 color: white; 221 font-weight: bold; 222 text-align: right; 223 text-decoration:underline; 206 224 } 207 225 … … 218 236 219 237 .containerTitle { 220 font-size: 1 6px;221 color: # d45400;238 font-size: 14px; 239 color: #59427b; 222 240 font-weight: bold; 223 241 float: left; 224 242 margin-top: 9px; 225 padding-left: 80px; 243 padding-left: 19px; 244 font-family: Comic Sans MS; 245 } 246 247 .containerTitle2 { 248 font-size: 18px; 249 color: #59427b; 250 font-weight: bold; 251 float: left; 252 margin-top: 0px; 253 padding-left: 40px; 226 254 } 227 255 … … 231 259 float: left; 232 260 margin-bottom: 10px; 233 margin-right: 20px; 234 //padding-left: 30px; 261 margin-left: 31px; 235 262 width: 120px; 236 top: -22px;237 position: relative;263 top: 54px; 264 position: absolute; 238 265 } 239 266 240 267 .containerUserLogout { 241 float: left; 268 float: left; bottom 242 269 margin-right: 5px; 243 270 } … … 290 317 -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); 291 318 box-shadow: 0 0 4px rgba(0, 0, 0, 0.3); 292 background: -moz-linear-gradient(# d45400, #d45400) repeat scroll 0 0 transparent;293 background: -ms-linear-gradient(# d45400, #d45400) repeat scroll 0 0 transparent; /*For IE10*/294 background: -webkit-linear-gradient(# d45400, #d45400) repeat scroll 0 0 transparent; /*For IE10*/295 filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = '# d45400', endColorstr = 'black'); /*For IE7-8-9*/296 float: left; 297 position: relative; 298 width: 141px;299 height: 26px;300 color: black;319 background: -moz-linear-gradient(#8A68BB, #8A68BB) repeat scroll 0 0 transparent; 320 background: -ms-linear-gradient(#8A68BB, #8A68BB) repeat scroll 0 0 transparent; /*For IE10*/ 321 background: -webkit-linear-gradient(#8260b1, #8260b1) repeat scroll 0 0 transparent; /*For IE10*/ 322 filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = '#59427b', endColorstr = 'white'); /*For IE7-8-9*/ 323 float: left; 324 position: relative; 325 width: 98px; 326 height: 32px; 327 color: white; 301 328 font-weight: bold; 302 329 padding-left: 10px; 303 330 padding-top: 4px; 304 top: 18px;331 top: 9px; 305 332 margin-right: 600px; 306 333 text-decoration: underline; 307 308 } 334 text-align:justify; 335 margin-bottom:-8px; 336 border-radius: 8px 8px 8px 8px ; 337 338 } 339 309 340 310 341 .containerField { 342 color: #e7e6eb; 343 font-weight: bold; 344 font-size: 14px; 345 346 347 } 348 349 .containerField2 { 311 350 color: black; 312 351 font-weight: bold; … … 316 355 .containerFieldO { 317 356 font-size: 32px; 318 color: #999999;357 color: white; 319 358 padding-left: 0px; 320 359 font-weight: bold; … … 325 364 -moz-border-radius-topright: 0; 326 365 -webkit-border-radius: 0; /*#E8EFF3*//* #618EAC*/ 327 background: -moz-linear-gradient(#d45400, #ff7c25); 328 background: -webkit-linear-gradient(#d45400, #ff7c25); 329 background: -ms-linear-gradient(#d45400, #ff7c25) repeat scroll 0 0 transparent; /*For IE10*/ 330 filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = '#333333', endColorstr = '#d45400'); /*For IE7-8-9*/ 366 border-radius: 8px 0px 8px 8px; 367 background: -moz-linear-gradient(#8a68bb, #8a68bb); 368 background: -webkit-linear-gradient(#8a68bb, #8a68bb); 369 background: -ms-linear-gradient(#8a68bb, #8a68bb) repeat scroll 0 0 transparent; /*For IE10*/ 370 filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = '#333333', endColorstr = '#59427b'); /*For IE7-8-9*/ 331 371 min-height: 400px; 332 372 text-align: justify; 333 373 position: relative; 334 top: -32px;374 top: 6px; 335 375 padding: 10px; 336 376 width: 1028px; 377 color:white; 337 378 } 338 379 339 380 .containerBottom { 340 background: #d45400; 341 background: -moz-linear-gradient(left center, #FF7C25, #d45400); /*background: -webkit-linear-gradient(#333333, #d45400);*/ 342 background: -ms-linear-gradient(#333333, #d45400) repeat scroll 0 0 transparent; /*For IE10*/ 343 filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = '#333333', endColorstr = '#d45400'); /*For IE7-8-9*/ 381 background: -moz-linear-gradient(left center, #c0afd6, #8A68BB); /*background: -webkit-linear-gradient(#333333, #d45400);*/ 382 background: -ms-linear-gradient(#c0afd6, #8A68BB) repeat scroll 0 0 transparent; /*For IE10*/ 383 filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 0, startColorstr = '#8a68bb', endColorstr = '#59427b'); /*For IE7-8-9*/ 344 384 color: #FFFFFF; 345 385 height: 26px; 346 386 padding-right: 10px; 347 387 position: relative; 348 top: -32px; 349 width: 1040px; 388 top: 0px; 389 width: 1039px; 390 border-radius: 8px 8px 8px 8px; 350 391 } 351 392 … … 355 396 356 397 .containerErrors, #errors { 357 background: black;398 background: white; 358 399 -moz-border-radius: 4px 4px 4px 4px; 359 400 -webkit-border-radius: 4px 4px 4px 4px; 360 border: 1px solid # d45400;361 color: # d45400;401 border: 1px solid #cc0000; 402 color: #cc0000; 362 403 padding: 10px; 363 404 margin: 10px; 405 border-radius: 8px 8px 8px 8px ; 364 406 } 365 407 … … 370 412 border: 2px solid #cc0000 ; 371 413 color: #cc0000; 372 //padding-right: 284px; 373 //padding-bottom:60px; 414 border-radius: 8px 8px 8px 8px ; 374 415 padding:10px; 375 margin-left: 776px; 376 //margin-right: 0px; 377 margin-top: -121px; 416 margin-left: 727px; 417 margin-top: -137px; 378 418 text-align: left; 379 419 font-weight: bold; 380 420 float: left; 381 background: black;421 background: #e7e6eb; 382 422 } 383 423 Spectral unit : must be selected … … 416 456 -moz-border-radius: 4px 4px 4px 4px; 417 457 -webkit-border-radius: 4px 4px 4px 4px; 418 border: 1px solid # d45400;419 color: #d45400;458 border: 1px solid #59427b; 459 color: white; 420 460 padding: 10px; 421 461 margin: 10px; … … 490 530 margin: 18px auto 12px; 491 531 position: relative; 532 border-radius: 8px 8px 8px 8px; 492 533 } 493 534 … … 553 594 554 595 } 596 597 598 .logos { 599 border-radius: 8px 8px 8px 8px; 600 } -
tapas/web/resources/js/classesForJQuery/LoginButton.js
r779 r816 122 122 if( this.jSONUser ) 123 123 { 124 var textLogin = this.jSONUser.name + " " + this.jSONUser.firstName + " (" + loginTexts[this.jSONUser.role] + ")"; 124 //var textLogin = this.jSONUser.name + " " + this.jSONUser.firstName + " (" + loginTexts[this.jSONUser.role] + ")"; 125 var textLogin = this.jSONUser.name + " " + this.jSONUser.firstName ; 125 126 126 127 var loginButton = new ComplexButton( {value:textLogin, parent:this.parent, id:"button_login", classNameToAdd: this.classNameToAdd} ); -
tapas/web/resources/js/tools/controls.js
r529 r816 44 44 } 45 45 46 47 48 function isDate( val ) 49 { 50 //return (/^(([0-2]*[0-9][0-9])\.([0-2]*[0-9][0-9])\.([0-2]*[0-9][0-9])\.([0-2]*[0-9][0-9]))$/.test(val)); 51 //if( !(/^([0-2]?[0-9]):([0-5]+[0-9]+):([0-5]+[0-9]+)*$/.test( val )) || isEmpty( val.toString() ) ) 52 53 if( !(/^([1-2]+[0-9]+[0-9]+[0-9]+)-([0-1]+[1-9]+)-([0-3]+[0-9]+) ([0-2]?[0-9]):([0-5]+[0-9]+):([0-5]+[0-9]+)*$/.test( val )) ) 54 return false; 55 else 56 { 57 58 var tab = val.split( " " ); 59 var tab2 = tab[0].split( "-" ); 60 61 if( tab2[1] > 12 ) return false; 62 63 if( tab2[1] == 2 && tab2[2] > 29 ) return false; 64 65 if( tab2[2] > 31 ) return false; 66 67 68 tab = val.split( ":" ); 69 70 if( tab[0] > 24 ) return false; 71 72 return true; 73 } 74 75 //return (/^(([0-9]*[0-9]+):([0-9]+[0-9]+):([0-9]+[0-9]+))$/.test(val)); 76 } 46 77 47 78 … … 99 130 } 100 131 132 function isSupS( number, limit ) 133 { 134 return ( number > limit ); 135 } 136 101 137 function isDiff( val, badvalue ) 102 138 { -
tapas/web/resources/tapas.properties
r809 r816 5 5 src_path=/home_local/workspaces/tapas/ 6 6 data_path=/home_local/workspaces/ 7 -
tapas/web/resources/templates/templateBackoffice.jsp
r767 r816 67 67 <%-- ****************** LOGO ****************** --%> 68 68 <div id="logo" class="containerLogo"> 69 <a href="#"><img src="resources/images/logo_tapas.gif" height=" 110px" width="110px"></a>69 <a href="#"><img src="resources/images/logo_tapas.gif" height="60px" width="60px"></a> 70 70 </div> 71 71 -
tapas/web/resources/templates/templateEther.jsp
r784 r816 16 16 <link rel="shortcut icon" type="image/x-icon" href="resources/images/logo_tapas.gif"/> 17 17 18 <ether:htmlCss cssFile="apycom.com- 8-orange-red/menu"/>18 <ether:htmlCss cssFile="apycom.com-4-blue-violet/menu"/> 19 19 <ether:htmlCss cssFile="jquery-ui-1.8.16.custom/jquery-ui-1.8.16.custom"/> 20 20 <ether:htmlCss cssFile="button"/> … … 55 55 <div id="title_tools" class="containerTapas"> 56 56 <div id="title" class="containerTitle"> <spring:message code="app.fulltitle"/></div> 57 <div id="title" class="containerTitle2"><a href="http://www.pole-ether.fr" target="_blank"><img src="resources/images/logo_ether.jpg" height="40px" width="40px"></a></div> 57 58 58 59 <div id="tools" align="right"> … … 64 65 <%-- ****************** LOGO ****************** --%> 65 66 <div id="logo" class="containerLogo"> 66 <a href="#"><img src="resources/images/logo_tapas.gif" height=" 130px" width="130px"></a>67 <a href="#"><img src="resources/images/logo_tapas.gif" height="70px" width="70px"></a> 67 68 </div> 68 69 … … 74 75 75 76 <ul class="menu"> 76 < li><a href="http://ether.ipsl.jussieu.fr" class="parent" target="_blank"><img width=50 height="50" src="resources/images/logo_ether.jpg"></a></li>77 <!--<li><a href="http://ether.ipsl.jussieu.fr" class="parent" target="_blank"><img width=25 height="25" src="resources/images/logo_ether.jpg"></a></li>--> 77 78 78 <li><a href="#" onClick="openHome();" class="parent"><span><spring:message code="title.home"/></span></a> 79 <li><a href="#" onClick="openHome();" class="parent"><span><spring:message code="title.home"/></span></a></li> 79 80 80 </li> 81 <li id="liamenu"><a href="data?methodName=viewForm" id="amenu" class="parent"><span><spring:message code="title.form"/></span></a> 81 <li id="liamenu"><a href="data?methodName=viewForm" id="amenu" class="parent"><span><spring:message code="title.form"/></span></a></li> 82 82 83 84 </li>85 83 <li><a href="#" onclick="openLegals();"><span><spring:message code="title.legals"/></span></a></li> 86 84 … … 89 87 90 88 <%-- ****************** TITLE CONTENT ****************** --%> 89 91 90 <div id="titleContent" class="containerTitleContent"><tiles:insert attribute="bodytitle"/> 92 91 -
tapas/web/src/json/json-context.xml
r767 r816 34 34 <map> 35 35 <entry key="observatory" value="com.ether.tapas.Observatory"/> 36 <entry key="location" value="com.ether.tapas.Location"/> 36 37 <entry key="los" value="com.ether.tapas.Los"/> 37 38 <entry key="instrument" value="com.ether.tapas.Instrument"/> -
tapas/web/src/messages_en.properties
r783 r816 20 20 label.climato=Atmospheric model 21 21 label.datemesure=Date measurement 22 label.cpydatemesure=or Copy date 22 23 label.berv=BERV correction 24 label.onetransmission=In one transmission 23 25 24 26 label.format=File format … … 32 34 33 35 text.validnum=shoud be numeric 34 text.select=Select35 36 text.NONE=None 36 37 text.badvalue=bad value … … 38 39 text.erreur.saisie=Error form request 39 40 41 text.selectlocation=Enter a location correclty (an observatory or a locality with altitude, latitude and longitude) 40 42 41 43 text.errcpydate=Wrong date format 42 44 43 45 app.title=Tapas … … 89 91 label.climatoReference.SUBARCTIC_WINTER=Subarctic winter 90 92 label.climatoReference.US_STANDARD_1976=Standard US 1976 93 94 label.locality=Locality 95 label.altitude=Alt 96 label.latitude=Lat 97 label.longitude=Lon 98 91 99 92 100 ################################################################ -
tapas/web/src/messages_fr.properties
r783 r816 18 18 label.climato=ModÚle atmosphérique 19 19 label.datemesure=Date de mesure 20 label.cpydatemesure=ou Copy date 20 21 label.berv=Correction BERV 21 22 label.onetransmission=En une transmission 22 23 23 24 label.format=Format fichier … … 36 37 37 38 39 38 40 text.validnum=doit être numérique 39 41 text.select=Sélectionnez … … 43 45 text.erreur.saisie=Erreur saisie requête 44 46 47 text.selectlocation=Indiquer un lieu correctement (observatoire ou lieu en indiquant altitude,latitude et longitude) 48 49 text.errcpydate=Mauvais format de date 45 50 46 51 app.title=Tapas … … 92 97 label.climatoReference.US_STANDARD_1976=Standard US 1976 93 98 99 label.locality=Lieu 100 label.altitude=Alt 101 label.latitude=Lat 102 label.longitude=Lon 94 103 95 104 ################################################################ … … 151 160 #bo.user.waitinglist.help=(an email will be sent to the user with your choice (accept or refuse)) 152 161 bo.user.list=List of users 153 bo.noUser=No user 162 bo.noUser=No usertext.selectlocation=Enter a location 154 163 bo.user.lastName=Lastname 155 164 bo.user.firstName=Firstname
Note: See TracChangeset
for help on using the changeset viewer.