Changeset 442 for tapas/web/src


Ignore:
Timestamp:
03/26/12 17:49:46 (12 years ago)
Author:
vmipsl
Message:

Spectral units

Location:
tapas/web/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tapas/web/src/com/ether/Controller.java

    r440 r442  
    88import com.ether.tapas.Tapas; 
    99import com.ether.user.User; 
    10 import com.ether.user.UserRole; 
    1110import net.sf.json.JSONObject; 
    1211import org.apache.commons.logging.Log; 
     
    1514 
    1615import java.util.ArrayList; 
    17 import java.util.HashMap; 
    1816import java.util.List; 
    19 import java.util.Map; 
    2017 
    2118/** 
     
    3027    /** *********************** VIEWS ***************************** **/ 
    3128    /** *********************************************************** **/ 
     29    /** 
     30     * View for the form 
     31     * 
     32     * @return 
     33     * @throws WebException 
     34     */ 
    3235    //@ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = true, defaultView = VIEW_INDEX) 
    3336    @ControllerMethod(view = VIEW_FORM_TAPAS, loginMandatory = false, defaultView = VIEW_INDEX) 
     
    4346            jsonObject.put( "jSonYesNos", getJSONYesNo() ); 
    4447            jsonObject.put( "jSonObservatories", allObservatories ); 
     48            jsonObject.put( "jSonSpectralUnits", getJSONSpectralUnit() ); 
    4549            return jsonObject; 
    4650        } 
     
    5357 
    5458 
    55  
    56  
    57  
    5859    /** *********************************************************** **/ 
    5960    /** *********************** CALLS ***************************** **/ 
    6061    /** *********************************************************** **/ 
     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     */ 
    6170    @ControllerMethod(jsonResult = true, userMandatory = true) 
    6271    public JSONObject createUserRequest( @ParamName("jsonTapas") @Mandatory @UseJSON final Tapas javaTapas, @NotNull final User user ) // TODO rajouter parametre USER 
     
    8998        { 
    9099            final JSONObject jsonFileFormat = new JSONObject(); 
    91             jsonFileFormat .put( "text", fileFormat.name() ); 
    92             jsonFileFormat .put( "value", fileFormat.name() ); 
    93             jsonFileFormats.add( jsonFileFormat  ); 
     100            jsonFileFormat.put( "text", fileFormat.name() ); 
     101            jsonFileFormat.put( "value", fileFormat.name() ); 
     102            jsonFileFormats.add( jsonFileFormat ); 
    94103        } 
    95104        return jsonFileFormats; 
     
    105114        { 
    106115            final JSONObject jsonYesNo = new JSONObject(); 
    107             jsonYesNo .put( "text", yesNo.name() ); 
    108             jsonYesNo .put( "value", yesNo.name() ); 
     116            jsonYesNo.put( "text", yesNo.name() ); 
     117            jsonYesNo.put( "value", yesNo.name() ); 
    109118            jsonYesNos.add( jsonYesNo ); 
    110119        } 
    111120        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; 
    112137    } 
    113138 
  • tapas/web/src/messages_en.properties

    r416 r442  
    2424 
    2525label.submitButton=RUN 
     26 
     27label.spectralUnit.NM_STANDARD=Standard Wavelength (nm) 
     28label.spectralUnit.NM_VACUUM=Vacuum Wavelength (nm) 
     29label.spectralUnit.CM=Wavenumber (cm-1) 
    2630 
    2731################################################################ 
     
    108112 
    109113bo.user.emailNotSend=The email to the user cannot be sent, the email seems not valid : 
     114 
  • tapas/web/src/messages_fr.properties

    r416 r442  
    2424 
    2525label.submitButton=COURIR 
     26 
     27label.spectralUnit.NM_STANDARD=Standard Wavelength (nm) 
     28label.spectralUnit.NM_VACUUM=Vacuum Wavelength (nm) 
     29label.spectralUnit.CM=Wavenumber (cm-1) 
    2630 
    2731################################################################ 
Note: See TracChangeset for help on using the changeset viewer.