source: ether_statistics/web/src/com/ether/ControllerStatistics.java @ 657

Last change on this file since 657 was 657, checked in by vmipsl, 12 years ago

statistics

File size: 3.1 KB
Line 
1package com.ether;
2
3import com.ether.annotation.ControllerMethod;
4import com.ether.annotation.Mandatory;
5import com.ether.annotation.ParamName;
6import net.sf.json.JSONObject;
7import org.apache.commons.logging.Log;
8import org.apache.commons.logging.LogFactory;
9import org.springframework.web.servlet.ModelAndView;
10
11import javax.servlet.http.HttpServletRequest;
12import javax.servlet.http.HttpServletResponse;
13import java.util.HashMap;
14import java.util.Map;
15
16/**
17 * @author vmipsl
18 * @date 17 feb 2011
19 */
20public class ControllerStatistics
21        extends ControllerEther
22{
23    /** *********************************************************** **/
24    /** *********************** VIEWS ***************************** **/
25    /** *********************************************************** **/
26    /**
27     * Default view if methodName is unknown
28     */
29    public ModelAndView home( final HttpServletRequest request, final HttpServletResponse response )
30            throws ServiceException
31    {
32        return new ModelAndView( VIEW_ERRORS );
33    }
34
35    @ControllerMethod(view = VIEW_STATISTICS)
36    public Map<String, Object> view()
37            throws ServiceException
38    {
39//        final Calendar cal = Calendar.getInstance();
40//        final Date today = cal.getTime();
41//        cal.set( 1900, Calendar.JANUARY, 1 );
42//        final Date begin = cal.getTime();
43//        cal.set( Calendar.DST_OFFSET, 40001 );
44//        final Date bob = cal.getTime();
45        return new HashMap<String, Object>();
46    }
47
48    /** *********************************************************** **/
49    /** *********************** CALLS ***************************** **/
50    /** *********************************************************** **/
51    /**
52     * Search main statistics for the selected project
53     *
54     * @param projectName
55     * @return
56     * @throws ServiceException
57     */
58    @ControllerMethod(jsonResult = true)
59    public JSONObject searchMainStatisticsByProject( @Mandatory @ParamName(ParameterConstants.PARAMETER_NAME) final String projectName )
60            throws ServiceException
61    {
62//        final List<Parametre> fullParametersByPlateform = getEtherService().getParametersByPlateformId( plateformId );
63//        final List<List<Parametre>> parametersByPlateform = getEtherService().manageMenusForParameterList( fullParametersByPlateform );
64
65        final JSONObject result = new JSONObject();
66//        result.put( ParameterConstants.PARAMETER_PARAMETERS, getJsonHelper().toJSON( parametersByPlateform ) );
67        return result;
68    }
69
70    private static final Log LOGGER = LogFactory.getLog( ControllerStatistics.class );
71
72    private static final String VIEW_STATISTICS = "project/statistics";
73    private static final String VIEW_VISUALIZATION_PARAMETER_BY_PLATEFORM = "visualization/visu_parameter_by_pf";
74    private static final String VIEW_DOWNLOAD_OK = "data/access/extract3";
75    private static final String VIEW_WORK = "project/inWork";
76    public static final String VIEW_ERRORS = "project/errors";
77
78    private static final String FORMAT_DEFAULT = "NASA-AMES";
79    private static final String COMPRESSION_DEFAULT = "None";
80}
Note: See TracBrowser for help on using the repository browser.