- Timestamp:
- 04/02/12 16:23:01 (12 years ago)
- Location:
- tapas/web
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/web/project/formTapas_script.jsp
r444 r445 88 88 td1.html( texte1 ); 89 89 td3.html( texte2 ); 90 td2.append( input1);91 td3.append( input2);92 93 tr.append( td1);94 tr.append( td2);95 tr.append( td3);96 tr.append( td4);97 container.append( tr);90 td2.append( input1 ); 91 td3.append( input2 ); 92 93 tr.append( td1 ); 94 tr.append( td2 ); 95 tr.append( td3 ); 96 tr.append( td4 ); 97 container.append( tr ); 98 98 }, 99 99 … … 143 143 handleCreateXML: function( result ) 144 144 { 145 var bob = jQuery.parseJSON( result ).result; 146 alert( bob ); 145 try 146 { 147 var bob = jQuery.parseJSON( result ).result; 148 alert( "OK " + bob ); 149 } 150 catch( err ) 151 { 152 document.location.reload(); 153 } 147 154 }, 148 155 … … 270 277 //this.tabInput = new Array(3); 271 278 this.createTrList( "File format", "iformat", tabPreference, 'format' ); 272 this.createTrList( "Rayleigh extinction", "irextinction", tabPreference, 'yesno' );279 this.createTrList( "Rayleigh extinction", "irextinction", tabPreference, 'yesno' ); 273 280 this.createTrList( "H20 extinction", "ih2oe", tabPreference, 'yesno' ); 274 281 this.createTrList( "O3 extinction", "io3e", tabPreference, 'yesno' ); … … 305 312 306 313 // Ajout du calendrier APRES la création du formulaire 307 this.createCalendar( tabObservation, "Date measurement");314 this.createCalendar( tabObservation, "Date measurement" ); 308 315 309 316 //jQuery.proxy permet d'envoyer le contexte this courant … … 322 329 //toutes les valeurs possibles 323 330 preference.format.firstValue = this.selectFormats.getValues(); 324 325 331 //la valeur selectionnee 326 332 preference.format.secondValue = this.selectFormats.getValue(); 327 333 328 334 preference.rayleighExtinction = new Object 329 preference.rayleighExtinction.firstValue="YES,NO"; 330 preference.rayleighExtinction.secondValue=$( "#select_irextinction" ).val(); 331 335 preference.rayleighExtinction.firstValue = "YES,NO"; 336 preference.rayleighExtinction.secondValue = $( "#select_irextinction" ).val(); 332 337 333 338 preference.h2oExtinction = new Object(); 334 preference.h2oExtinction.firstValue="YES,NO"; 335 preference.h2oExtinction.secondValue=$( "#select_ih2oe" ).val(); 336 339 preference.h2oExtinction.firstValue = "YES,NO"; 340 preference.h2oExtinction.secondValue = $( "#select_ih2oe" ).val(); 337 341 338 342 preference.o3Extinction = new Object(); 339 preference.o3Extinction.firstValue ="";340 preference.o3Extinction.secondValue ="";343 preference.o3Extinction.firstValue = ""; 344 preference.o3Extinction.secondValue = ""; 341 345 342 346 preference.o2Extinction = new Object(); 343 preference.o2Extinction.firstValue ="";344 preference.o2Extinction.secondValue ="";347 preference.o2Extinction.firstValue = ""; 348 preference.o2Extinction.secondValue = ""; 345 349 346 350 preference.co2Extinction = new Object(); 347 preference.co2Extinction.firstValue ="";348 preference.co2Extinction.secondValue ="";351 preference.co2Extinction.firstValue = ""; 352 preference.co2Extinction.secondValue = ""; 349 353 350 354 351 355 // OBSERVATION 352 356 var observatory = new Object(); 353 354 357 observatory.name = ""; 355 356 357 observatory.longitude = ""; 358 observatory.latitude = ""; 359 observatory.altitude = ""; 360 358 observatory.longitude = 1; 359 observatory.latitude = 2; 360 observatory.altitude = 3; 361 361 362 362 // Los 363 363 var los = new Object(); 364 365 366 364 los.raJ2000 = ""; 367 365 los.decJ2000 = ""; 368 369 366 los.zenithAngle = new Object(); 370 367 los.zenithAngle.min = "0"; 371 368 los.zenithAngle.max = "90"; 372 los.zenithAngle.value = ""; 373 374 369 los.zenithAngle.value = "2"; 375 370 376 371 // Instrument 377 372 var instrument = new Object(); 378 379 373 instrument.spectralChoice = new Object(); 380 374 instrument.spectralChoice.firstValue = this.selectSpectralUnits.getValues(); 381 375 instrument.spectralChoice.secondValue = this.selectSpectralUnits.getValue(); 382 383 376 instrument.spectralRange = ""; 384 377 … … 395 388 instrument.samplingRatio.secondValue = ""; 396 389 397 398 var observation = new Object(); 399 observation.date = this.calendarConverter.parse( $( "#iobservation_date" ).val() ); 400 observation.observatory = observatory; 401 390 var observation = new Object(); 391 observation.date = this.calendarConverter.parse( $( "#iobservation_date" ).val() ); 392 observation.observatory = observatory; 402 393 observation.los = los; 403 394 observation.instrument = instrument; … … 406 397 // ATMOSPHERE 407 398 var atmosphere = new Object(); 408 409 399 atmosphere.reference = new Object(); 410 400 atmosphere.reference.firstValue = this.selectClimatoReferences.getValues(); -
tapas/web/src/com/ether/Controller.java
r444 r445 70 70 * @throws WebException 71 71 */ 72 @ControllerMethod(jsonResult = true, userMandatory = true )72 @ControllerMethod(jsonResult = true, userMandatory = true, defaultView = VIEW_INDEX) 73 73 public JSONObject createUserRequest( @ParamName("jsonTapas") @Mandatory @UseJSON final Tapas javaTapas, @NotNull final User user ) // TODO rajouter parametre USER 74 74 throws WebException 75 75 { 76 String toto ="lmml";76 String toto = "lmml"; 77 77 78 78 if( null == javaTapas ) -
tapas/web/src/com/ether/ControllerEther.java
r440 r445 66 66 { 67 67 final String webInfPath = getServletContext().getRealPath( "WEB-INF" ); 68 return WebHelper.getProperty( webInfPath , property );68 return WebHelper.getProperty( webInfPath + "/classes/", WebHelper.PROPERTIES_FILE, property ); 69 69 } 70 70 catch( IOException e ) … … 72 72 throw new WebException( WebException.WebCode.ERROR_TO_READ_FILE_PROPERTIES, e ); 73 73 } 74 } 75 76 /** 77 * This method return the text from the files messages**.properties 78 * 79 * @param code 80 * @return 81 */ 82 public String getMessage( @NotNull final String code ) 83 { 84 final String webInfPath = getServletContext().getRealPath( "WEB-INF" ); 85 return WebHelper.getMessage( webInfPath, code ); 74 86 } 75 87 … … 85 97 86 98 request.setCharacterEncoding( UTF8Charset.getEncoding() ); 99 // String message = getMessage( "bo.fulltitle" ); 87 100 88 101 // Get method to call … … 132 145 } 133 146 134 if (methodDescription.isUserMandatory()) { 147 if( methodDescription.isUserMandatory() ) 148 { 135 149 final User user = (User) request.getSession().getAttribute( "SES_USER" ); 136 137 150 if( null == user ) 138 151 return new ModelAndView( defaultView, "errors", "login.error.unknown" ); 139 152 else 140 153 params[params.length - 1] = user; 141 142 154 } 143 155 -
tapas/web/src/com/ether/WebHelper.java
r423 r445 8 8 import org.jetbrains.annotations.NotNull; 9 9 import org.jetbrains.annotations.Nullable; 10 import org.springframework.context.MessageSource; 11 import org.springframework.context.support.ClassPathXmlApplicationContext; 10 12 11 13 import javax.servlet.ServletOutputStream; … … 106 108 { 107 109 final String webInfPath = request.getSession().getServletContext().getRealPath( "WEB-INF" ); 108 return getProperty( webInfPath , property );110 return getProperty( webInfPath + "/classes/", PROPERTIES_FILE, property ); 109 111 } 110 112 catch( IOException e ) … … 115 117 116 118 /** 117 * Returns the property writed in theproperties file119 * Returns the property writed in a properties file 118 120 * 119 * @param webInfPath120 * @param property121 * @ return121 * @param pathFile 122 * @param fileName 123 * @param property @return 122 124 * @throws IOException 123 125 */ 124 public static String getProperty( @NotNull final String webInfPath, @NotNull final String property )126 public static String getProperty( @NotNull final String pathFile, final String fileName, @NotNull final String property ) 125 127 throws IOException 126 128 { 127 129 final Properties prop = new Properties(); 128 prop.load( new FileInputStream( webInfPath + "/classes/" + PROPERTIES_FILE) );130 prop.load( new FileInputStream( pathFile + fileName ) ); 129 131 return prop.getProperty( property ); 130 132 } 131 133 132 private static final Log LOGGER = LogFactory.getLog( WebHelper.class ); 134 /** 135 * This method return the text from the files messages**.properties 136 * 137 * @param code 138 * @return 139 */ 140 public static String getMessage( @NotNull final String webInfPath, @NotNull final String code ) 141 { 142 final MessageSource resources = new ClassPathXmlApplicationContext( webInfPath + "/classes/servlet-context.xml" ); 143 final String message = resources.getMessage( code, null, "Default", null ); 144 return message; 145 } 133 146 134 147 public static final int STATUS_CODE_SERVICE_EXCEPTION = 500; 148 public static final String PROPERTIES_FILE = "tapas.properties"; 149 150 private static final Log LOGGER = LogFactory.getLog( WebHelper.class ); 135 151 private static final String CONTENT_TYPE_TEXT_JSON = "text/javascript;charset=" + UTF8Charset.getEncoding(); 136 private static final String PROPERTIES_FILE = "tapas.properties";137 152 }
Note: See TracChangeset
for help on using the changeset viewer.