Changeset 353 for ether_2012/trunk/web/src/com
- Timestamp:
- 01/18/12 17:11:58 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_2012/trunk/web/src/com/ether/Controller.java
r330 r353 2 2 3 3 import com.ether.annotation.ControllerMethod; 4 import com.ether.annotation.Mandatory;5 import com.ether.annotation.ParamName;6 import net.sf.json.JSONObject;7 4 import org.apache.commons.logging.Log; 8 5 import org.apache.commons.logging.LogFactory; 9 import org.jetbrains.annotations.NotNull;10 import org.springframework.beans.factory.annotation.Required;11 import org.springframework.web.servlet.ModelAndView;12 6 13 import javax.servlet.http.HttpServletRequest;14 import javax.servlet.http.HttpServletResponse;15 7 import java.util.HashMap; 16 import java.util.List;17 8 import java.util.Map; 18 9 … … 26 17 /** *********************************************************** **/ 27 18 /** *********************** VIEWS ***************************** **/ 28 /** 29 * ********************************************************** * 30 */ 31 // Default view if url's methodName is unknown 32 @ControllerMethod(view = "init") 19 /** *********************************************************** **/ 20 @ControllerMethod(view = VIEW_INIT) 33 21 public Map<String, Object> home() 34 22 throws WebException 35 {36 return new HashMap<String, Object>();37 }38 39 @ControllerMethod(view = VIEW_VISUALIZATION)40 public Map<String, Object> view()41 throws ServiceException42 23 { 43 24 return new HashMap<String, Object>(); 44 25 } 45 26 46 @ControllerMethod(view = VIEW_ VISUALIZATION_PLATEFORM)47 public Map<String, Object> view AllPlateforms()48 throws ServiceException27 @ControllerMethod(view = VIEW_ACTIVITIES) 28 public Map<String, Object> viewSlideContent() 29 throws WebException 49 30 { 50 final List<Plateform> plateforms = _etherService.getAllPlateforms(); 51 52 final Map<String, Object> model = new HashMap<String, Object>(); 53 model.put( "plateforms", getJsonHelper().toJSON( plateforms ) ); 54 return model; 55 } 56 57 /** *********************************************************** **/ 58 /** *********************** CALLS ***************************** **/ 59 /** 60 * ********************************************************** * 61 */ 62 @ControllerMethod(jsonResult = true) 63 public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId ) 64 throws ServiceException, WebException 65 { 66 // final List<Parameter> parameters = new ArrayList<Parameter>( 3 ); 67 // parameters.add( new Parameter( Long.valueOf( 1 ), "parameter1" ) ); 68 // parameters.add( new Parameter( Long.valueOf( 2 ), "parameter2" ) ); 69 // parameters.add( new Parameter( Long.valueOf( 3 ), "parameter3" ) ); 70 71 final List<Parameter> parameters = _etherService.getAllParametersByPlateformId( plateformId ); 72 final JSONObject result = new JSONObject(); 73 result.put( "parameters", getJsonHelper().toJSON( parameters ) ); 74 return result; 75 } 76 77 @Required 78 public void setEtherService( @NotNull final EtherService etherService ) 79 { 80 _etherService = etherService; 31 return new HashMap<String, Object>(); 81 32 } 82 33 83 34 private static final Log LOGGER = LogFactory.getLog( Controller.class ); 84 35 85 private static final String VIEW_VISUALIZATION = "visualization/visu"; 86 private static final String VIEW_VISUALIZATION_PLATEFORM = "visualization/visu_plateform"; 87 88 private EtherService _etherService; 36 private static final String VIEW_INIT = "init"; 37 private static final String VIEW_ACTIVITIES = "project/slideActivities"; 89 38 }
Note: See TracChangeset
for help on using the changeset viewer.