Changeset 244 for ether_megapoli/trunk
- Timestamp:
- 11/09/11 16:34:14 (13 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java
r220 r244 73 73 } 74 74 75 @N ullable75 @NotNull 76 76 @Transactional(readOnly = true) 77 77 public List<Parametre> getParametersByPlateformId( @NotNull final Integer plateformId ) -
ether_megapoli/trunk/service/interface/com/ether/EtherService.java
r220 r244 28 28 throws ServiceException; 29 29 30 @N ullable30 @NotNull 31 31 List<Parametre> getParametersByPlateformId( @NotNull final Integer plateformId ) 32 32 throws ServiceException; -
ether_megapoli/trunk/web/src/com/ether/Controller.java
r234 r244 90 90 throws ServiceException, EtherException 91 91 { 92 final List<Parametre> parametersByPlateform = _etherService.getParametersByPlateformId( plateformId ); 92 final List<Parametre> fullParametersByPlateform = _etherService.getParametersByPlateformId( plateformId ); 93 final List<List<Parametre>> parametersByPlateform = manageMenusForParameterList( fullParametersByPlateform ); 93 94 94 95 final JSONObject result = new JSONObject(); 95 96 result.put( ParameterConstants.PARAMETER_PARAMETERS, getJsonHelper().toJSON( parametersByPlateform ) ); 96 97 return result; 98 } 99 100 /** 101 * This method manage the sub-menus for the list of parameters (to avoid multiple "Particle Concentration" by example) 102 * The fullParameters must be ordered with parameterName ascendant 103 * 104 * @param fullParameters 105 * @return 106 */ 107 @NotNull 108 private List<List<Parametre>> manageMenusForParameterList( @NotNull final List<Parametre> fullParameters ) 109 { 110 final List<List<Parametre>> parameterListWithMenu = new ArrayList<List<Parametre>>(); 111 112 int i = 0; 113 while( i < fullParameters.size() ) 114 { 115 final Parametre fullParameter = fullParameters.get( i ); 116 final int firstIndex = fullParameters.indexOf( fullParameter ); 117 final int lastIndex = fullParameters.lastIndexOf( fullParameter ); 118 final List<Parametre> parameters = fullParameters.subList( firstIndex, lastIndex + 1 ); 119 parameterListWithMenu.add( parameters ); 120 i += parameters.size(); 121 } 122 123 return parameterListWithMenu; 97 124 } 98 125
Note: See TracChangeset
for help on using the changeset viewer.