Changeset 442
- Timestamp:
- 03/26/12 17:49:46 (12 years ago)
- Location:
- tapas
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/domain/interface/com/ether/SpectralUnit.java
r440 r442 1 1 package com.ether; 2 3 import java.lang.reflect.Field;4 2 5 3 /** … … 9 7 public enum SpectralUnit 10 8 { 11 NM, 9 NM_VACUUM, 10 NM_STANDARD, 12 11 CM 13 12 -
tapas/web/project/formTapas.jsp
r440 r442 1 1 <%@ page import="com.ether.WebException" %> 2 <%@ page import="com.ether.SpectralUnit" %> 2 3 <%@ page contentType="text/html;charset=UTF-8" language="java" %> 3 4 <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> … … 29 30 <tiles:put name="body" type="string"> 30 31 31 <div id="formulaire"> 32 33 </div> 32 <div id="formulaire"></div> 34 33 35 34 <div id="errors"></div> … … 39 38 tapasTexts["label.submitButton"] = '<spring:message code="label.submitButton"/>'; 40 39 tapasTexts["<%=WebException.WebCode.ERROR_JSON_TAPAS_IS_NULL%>"] = "<spring:message code="error.ERROR_JSON_TAPAS_IS_NULL"/>"; 40 tapasTexts["<%=SpectralUnit.NM_STANDARD%>"] = "<spring:message code="label.spectralUnit.NM_STANDARD"/>"; 41 tapasTexts["<%=SpectralUnit.NM_VACUUM%>"] = "<spring:message code="label.spectralUnit.NM_VACUUM"/>"; 42 tapasTexts["<%=SpectralUnit.CM%>"] = "<spring:message code="label.spectralUnit.CM"/>"; 41 43 42 //var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonObservatories},${jSonSelectUnits}); 43 var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonObservatories}); 44 var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonObservatories}, ${jSonSpectralUnits}); 44 45 </script> 45 46 -
tapas/web/project/formTapas_script.jsp
r441 r442 2 2 var InterfaceTapas = Class.create( { 3 3 4 initialize: function( jsonFileFormats, jsonYesNos, jsonObservatories )4 initialize: function( jsonFileFormats, jsonYesNos, jsonObservatories, jSonSpectralUnits ) 5 5 { 6 6 /** *********** CONTAINERS *********** **/ … … 11 11 this.jsonYesNos = jsonYesNos || null; 12 12 this.jSonObservatories = jsonObservatories || null; 13 //this.jSonSelectUnits = jsonSelectUnits || null;13 this.jSonSpectralUnits = jSonSpectralUnits || null; 14 14 15 15 this.containerErrors.hide(); … … 103 103 this.createTr( "LOS declension", "ide", tabObservation ); 104 104 this.createTr( "Zenith angle", "iza", tabObservation ); 105 // this.createTrList("Spectral unit", "ispectral_choice", tabObservation, 'spectralUnit');105 this.createTrList( "Spectral unit", "ispectral_choice", tabObservation, 'spectralUnit' ); 106 106 this.createTr( "Spectral range", "ispectral_ranger", tabObservation ); 107 107 … … 207 207 //ajouter select vide avec add 208 208 this.selectSpectralUnits.add( "-1", "-- Select unit --" ); 209 jQuery.each( this.jSonSpectralUnit , jQuery.proxy( function ( i, jsonSpectralUnit )209 jQuery.each( this.jSonSpectralUnits, jQuery.proxy( function ( i, jsonSpectralUnit ) 210 210 { 211 this.selectSpectralUnits.add( jsonSpectralUnit. id, jsonSpectralUnit.name);211 this.selectSpectralUnits.add( jsonSpectralUnit.value, tapasTexts[jsonSpectralUnit.value] ); 212 212 }, this ) ); 213 213 this.selectSpectralUnits.selectFirst( true ); … … 238 238 239 239 preference.rayleighExtinction = new Object(); 240 ; 240 241 241 preference.h2oExtinction = pair; 242 242 preference.o3Extinction = pair; -
tapas/web/src/com/ether/Controller.java
r440 r442 8 8 import com.ether.tapas.Tapas; 9 9 import com.ether.user.User; 10 import com.ether.user.UserRole;11 10 import net.sf.json.JSONObject; 12 11 import org.apache.commons.logging.Log; … … 15 14 16 15 import java.util.ArrayList; 17 import java.util.HashMap;18 16 import java.util.List; 19 import java.util.Map;20 17 21 18 /** … … 30 27 /** *********************** VIEWS ***************************** **/ 31 28 /** *********************************************************** **/ 29 /** 30 * View for the form 31 * 32 * @return 33 * @throws WebException 34 */ 32 35 //@ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = true, defaultView = VIEW_INDEX) 33 36 @ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = false, defaultView = VIEW_INDEX) … … 43 46 jsonObject.put( "jSonYesNos", getJSONYesNo() ); 44 47 jsonObject.put( "jSonObservatories", allObservatories ); 48 jsonObject.put( "jSonSpectralUnits", getJSONSpectralUnit() ); 45 49 return jsonObject; 46 50 } … … 53 57 54 58 55 56 57 58 59 /** *********************************************************** **/ 59 60 /** *********************** CALLS ***************************** **/ 60 61 /** *********************************************************** **/ 62 /** 63 * This method create a XML file filled with the javaTapas fields 64 * 65 * @param javaTapas 66 * @param user 67 * @return 68 * @throws WebException 69 */ 61 70 @ControllerMethod(jsonResult = true, userMandatory = true) 62 71 public JSONObject createUserRequest( @ParamName("jsonTapas") @Mandatory @UseJSON final Tapas javaTapas, @NotNull final User user ) // TODO rajouter parametre USER … … 89 98 { 90 99 final JSONObject jsonFileFormat = new JSONObject(); 91 jsonFileFormat 92 jsonFileFormat 93 jsonFileFormats.add( jsonFileFormat 100 jsonFileFormat.put( "text", fileFormat.name() ); 101 jsonFileFormat.put( "value", fileFormat.name() ); 102 jsonFileFormats.add( jsonFileFormat ); 94 103 } 95 104 return jsonFileFormats; … … 105 114 { 106 115 final JSONObject jsonYesNo = new JSONObject(); 107 jsonYesNo 108 jsonYesNo 116 jsonYesNo.put( "text", yesNo.name() ); 117 jsonYesNo.put( "value", yesNo.name() ); 109 118 jsonYesNos.add( jsonYesNo ); 110 119 } 111 120 return jsonYesNos; 121 } 122 123 private List<JSONObject> getJSONSpectralUnit() 124 { 125 final SpectralUnit[] spectralUnits = SpectralUnit.values(); 126 127 final List<JSONObject> jsonSpectralUnits = new ArrayList<JSONObject>( spectralUnits.length ); 128 129 for( final SpectralUnit spectralUnit : spectralUnits ) 130 { 131 final JSONObject jsonSpectralUnit = new JSONObject(); 132 jsonSpectralUnit.put( "text", spectralUnit.name() ); 133 jsonSpectralUnit.put( "value", spectralUnit.name() ); 134 jsonSpectralUnits.add( jsonSpectralUnit ); 135 } 136 return jsonSpectralUnits; 112 137 } 113 138 -
tapas/web/src/messages_en.properties
r416 r442 24 24 25 25 label.submitButton=RUN 26 27 label.spectralUnit.NM_STANDARD=Standard Wavelength (nm) 28 label.spectralUnit.NM_VACUUM=Vacuum Wavelength (nm) 29 label.spectralUnit.CM=Wavenumber (cm-1) 26 30 27 31 ################################################################ … … 108 112 109 113 bo.user.emailNotSend=The email to the user cannot be sent, the email seems not valid : 114 -
tapas/web/src/messages_fr.properties
r416 r442 24 24 25 25 label.submitButton=COURIR 26 27 label.spectralUnit.NM_STANDARD=Standard Wavelength (nm) 28 label.spectralUnit.NM_VACUUM=Vacuum Wavelength (nm) 29 label.spectralUnit.CM=Wavenumber (cm-1) 26 30 27 31 ################################################################
Note: See TracChangeset
for help on using the changeset viewer.