source: tapas/web/src/com/ether/Controller.java @ 414

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

login application
servlet data
ControllerEponge?

File size: 1.8 KB
Line 
1package com.ether;
2
3import com.ether.annotation.ControllerMethod;
4import com.ether.annotation.Mandatory;
5import com.ether.annotation.ParamName;
6import com.ether.annotation.UseJSON;
7import com.ether.tapas.Tapas;
8import net.sf.json.JSONObject;
9import org.apache.commons.logging.Log;
10import org.apache.commons.logging.LogFactory;
11
12import java.util.HashMap;
13import java.util.Map;
14
15/**
16 * @author vmipsl
17 * @date 02 march 2012
18 */
19public class Controller
20        extends ControllerEther
21{
22
23    /** *********************************************************** **/
24    /** *********************** VIEWS ***************************** **/
25    /** *********************************************************** **/
26    @ControllerMethod(view = VIEW_FORM_TAPAS)
27    public Map<String, Object> viewForm()
28            throws WebException
29    {
30        return new HashMap<String, Object>();
31    }
32
33    /** *********************************************************** **/
34    /** *********************** CALLS ***************************** **/
35    /** *********************************************************** **/
36    @ControllerMethod(jsonResult = true)
37    public JSONObject createUserRequest( @ParamName("jsonTapas") @Mandatory @UseJSON final Tapas javaTapas )
38            throws WebException
39    {
40        if( null == javaTapas )
41            throw new WebException( WebException.WebCode.ERROR_JSON_TAPAS_IS_NULL, "Serialization error : jsonTapas is null", WebException.getExceptionThrowable() );
42
43        //appel a createxml
44        getTapasService().createXMLRequest( javaTapas );
45
46        final JSONObject result = new JSONObject();
47        result.put( "result", "SUCCESS" );
48        return result;
49    }
50
51    private static final Log LOGGER = LogFactory.getLog( Controller.class );
52
53    private static final String VIEW_FORM_TAPAS = "project/formTapas";
54}
Note: See TracBrowser for help on using the repository browser.