Ignore:
Timestamp:
03/01/12 15:39:49 (12 years ago)
Author:
vmipsl
Message:

clean

File:
1 edited

Legend:

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

    r382 r384  
    22 
    33import com.ether.annotation.ControllerMethod; 
    4 import com.ether.annotation.Mandatory; 
    5 import com.ether.annotation.ParamName; 
    6 import net.sf.json.JSONObject; 
    74import org.apache.commons.logging.Log; 
    85import org.apache.commons.logging.LogFactory; 
     
    118 
    129import java.util.HashMap; 
    13 import java.util.List; 
    1410import java.util.Map; 
    1511 
     
    2319    /** *********************************************************** **/ 
    2420    /** *********************** VIEWS ***************************** **/ 
    25     /** 
    26      * ********************************************************** * 
    27      */ 
    28     // Default view if url's methodName is unknown 
    29     @ControllerMethod(view = "init") 
     21    /** *********************************************************** **/ 
     22    @ControllerMethod(view = VIEW_INIT) 
    3023    public Map<String, Object> home() 
    3124            throws WebException 
     
    3427    } 
    3528 
    36     @ControllerMethod(view = VIEW_VISUALIZATION) 
    37     public Map<String, Object> view() 
    38             throws WebException 
    39     { 
    40         return new HashMap<String, Object>(); 
    41     } 
    42  
    43     @ControllerMethod(view = VIEW_VISUALIZATION_PLATEFORM) 
    44     public Map<String, Object> viewAllPlateforms() 
    45             throws WebException 
    46     { 
    47         try 
    48         { 
    49             final List<Plateform> plateforms = _etherService.getAllPlateforms(); 
    50  
    51             final Map<String, Object> model = new HashMap<String, Object>(); 
    52             model.put( "plateforms", getJsonHelper().toJSON( plateforms ) ); 
    53             return model; 
    54         } 
    55         catch( ServiceException e ) 
    56         { 
    57             throw new WebException( WebException.WebCode.PLATEFORM_NOT_FOUND, e ); 
    58         } 
    59     } 
    60  
    6129    /** *********************************************************** **/ 
    6230    /** *********************** CALLS ***************************** **/ 
    63     /** 
    64      * ********************************************************** * 
    65      */ 
    66     @ControllerMethod(jsonResult = true) 
    67     public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId ) 
    68             throws WebException 
    69     { 
    70         try 
    71         { 
     31    /** *********************************************************** **/ 
    7232 
    73 //        final List<Parameter> parameters = new ArrayList<Parameter>( 3 ); 
    74 //        parameters.add( new Parameter( Long.valueOf( 1 ), "parameter1" ) ); 
    75 //        parameters.add( new Parameter( Long.valueOf( 2 ), "parameter2" ) ); 
    76 //        parameters.add( new Parameter( Long.valueOf( 3 ), "parameter3" ) ); 
    7733 
    78             final List<Parameter> parameters = _etherService.getAllParametersByPlateformId( plateformId ); 
    79             final JSONObject result = new JSONObject(); 
    80             result.put( "parameters", getJsonHelper().toJSON( parameters ) ); 
    81             return result; 
    82         } 
    83         catch( ServiceException e ) 
    84         { 
    85             throw new WebException( WebException.WebCode.PARAMETER_NOT_FOUND, e ); 
    86         } 
    87     } 
    8834 
    8935    @Required 
    90     public void setEtherService( @NotNull final EtherService etherService ) 
     36    public void setTapasService( @NotNull final TapasService tapasService ) 
    9137    { 
    92         _etherService = etherService; 
     38        _tapasService = tapasService; 
    9339    } 
    9440 
    9541    private static final Log LOGGER = LogFactory.getLog( Controller.class ); 
    9642 
    97     private static final String VIEW_VISUALIZATION = "visualization/visu"; 
    98     private static final String VIEW_VISUALIZATION_PLATEFORM = "visualization/visu_plateform"; 
     43    private static final String VIEW_INIT = "init"; 
    9944 
    100     private EtherService _etherService; 
     45    private TapasService _tapasService; 
    10146} 
Note: See TracChangeset for help on using the changeset viewer.