Changeset 130 for ether_megapoli/trunk/web/src/com/ether/Controller.java
- Timestamp:
- 08/18/11 12:39:22 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/web/src/com/ether/Controller.java
r129 r130 15 15 import javax.servlet.http.HttpServletRequest; 16 16 import javax.servlet.http.HttpServletResponse; 17 import java.util.ArrayList; 17 18 import java.util.HashMap; 18 19 import java.util.List; … … 28 29 /** *********************************************************** **/ 29 30 /** *********************** VIEWS ***************************** **/ 30 /** *********************************************************** **/ 31 /** 32 * ********************************************************** * 33 */ 31 34 // Default view if methodName is unknown 32 35 public ModelAndView home( final HttpServletRequest request, final HttpServletResponse response ) 33 throws WebException36 throws EtherException 34 37 { 35 38 return new ModelAndView( "index" ); … … 48 51 { 49 52 final List<Plateforme> plateforms = _etherService.getAllPlateforms(); 53 // final List<Plateforme> plateforms = new ArrayList<Plateforme>(); 54 // final Plateforme pf = new Plateforme(); 55 // pf.setPlateformeId( 1 ); 56 // pf.setPlateformeNom( "LHVP" ); 57 // plateforms.add( pf ); 58 // final Plateforme pf2 = new Plateforme(); 59 // pf2.setPlateformeId( 2 ); 60 // pf2.setPlateformeNom( "SIRTA" ); 61 // plateforms.add( pf2 ); 50 62 51 63 final Map<String, Object> model = new HashMap<String, Object>(); 52 64 model.put( "plateforms", getJsonHelper().toJSON( plateforms ) ); 65 model.put( "axeTypes", getJSONAxeTypes() ); 53 66 return model; 54 67 } … … 56 69 /** *********************************************************** **/ 57 70 /** *********************** CALLS ***************************** **/ 58 /** ********************************************************** **/ 71 /** 72 * ********************************************************* * 73 */ 59 74 @ControllerMethod(jsonResult = true) 60 75 public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId ) 61 throws ServiceException, WebException76 throws ServiceException, EtherException 62 77 { 63 78 final List<Parametre> parametersByPlateform = _etherService.getParametersByPlateformId( plateformId ); 79 // final List<Parametre> parametersByPlateform = new ArrayList<Parametre>( 2 ); 80 // final Parametre p1 = new Parametre(); 81 // p1.setParametreId( 1 ); 82 // p1.setParametreNom( "JNO2" ); 83 // parametersByPlateform.add( p1 ); 84 // final Parametre p2 = new Parametre(); 85 // p2.setParametreId( 2 ); 86 // p2.setParametreNom( "CO2" ); 87 // parametersByPlateform.add( p2 ); 64 88 65 89 final JSONObject result = new JSONObject(); 66 90 result.put( ParameterConstants.PARAMETER_PARAMETERS, getJsonHelper().toJSON( parametersByPlateform ) ); 67 91 return result; 92 } 93 94 @ControllerMethod(jsonResult = true) 95 private List<JSONObject> getJSONAxeTypes() 96 { 97 final AxeType[] axeTypes = AxeType.values(); 98 99 final List<JSONObject> jsonAxeTypes = new ArrayList<JSONObject>( axeTypes.length ); 100 101 for( final AxeType axeType : axeTypes ) 102 { 103 final JSONObject jsonAxeType = new JSONObject(); 104 jsonAxeType.put( "text", axeType.name() ); 105 jsonAxeType.put( "value", axeType.name() ); 106 jsonAxeTypes.add( jsonAxeType ); 107 } 108 return jsonAxeTypes; 68 109 } 69 110
Note: See TracChangeset
for help on using the changeset viewer.