Changeset 440 for tapas/web/src
- Timestamp:
- 03/26/12 17:00:15 (12 years ago)
- Location:
- tapas/web/src/com/ether
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/web/src/com/ether/Controller.java
r420 r440 7 7 import com.ether.tapas.Observatory; 8 8 import com.ether.tapas.Tapas; 9 import com.ether.user.User; 9 10 import com.ether.user.UserRole; 10 11 import net.sf.json.JSONObject; 11 12 import org.apache.commons.logging.Log; 12 13 import org.apache.commons.logging.LogFactory; 14 import org.jetbrains.annotations.NotNull; 13 15 14 16 import java.util.ArrayList; … … 33 35 throws WebException 34 36 { 35 36 37 try 37 38 { … … 58 59 /** *********************** CALLS ***************************** **/ 59 60 /** *********************************************************** **/ 60 @ControllerMethod(jsonResult = true )61 public JSONObject createUserRequest( @ParamName("jsonTapas") @Mandatory @UseJSON final Tapas javaTapas )61 @ControllerMethod(jsonResult = true, userMandatory = true) 62 public JSONObject createUserRequest( @ParamName("jsonTapas") @Mandatory @UseJSON final Tapas javaTapas, @NotNull final User user ) // TODO rajouter parametre USER 62 63 throws WebException 63 64 { … … 65 66 throw new WebException( WebException.WebCode.ERROR_JSON_TAPAS_IS_NULL, "Serialization error : jsonTapas is null", WebException.getExceptionThrowable() ); 66 67 68 //TODO recuperer le USER via ControllerEther 69 67 70 //appel a createxml 68 getTapasService().createXMLRequest( javaTapas ); 71 getTapasService().createXMLRequest( javaTapas ); // en 2ieme parametre 72 73 //appel a runtime 74 //mettre une methode dans tapas service pour appel au shell system 75 69 76 70 77 final JSONObject result = new JSONObject(); -
tapas/web/src/com/ether/ControllerEther.java
r423 r440 120 120 final String defaultView = ( null != methodDescription.getDefaultView() && !"".equals( methodDescription.getDefaultView() ) ) ? methodDescription.getDefaultView() : methodDescription.getView(); 121 121 122 122 123 if( methodDescription.isRequestMandatory() ) 123 params[params.length - 1] = request; 124 params[params.length - 1] = request; //params = parametre de la methode du Controller 125 124 126 125 127 if( methodDescription.isLoginMandatory() ) … … 128 130 if( null == user ) 129 131 return new ModelAndView( defaultView, "errors", "login.error.unknown" ); 132 } 133 134 if (methodDescription.isUserMandatory()) { 135 final User user = (User) request.getSession().getAttribute( "SES_USER" ); 136 137 if( null == user ) 138 return new ModelAndView( defaultView, "errors", "login.error.unknown" ); 139 else 140 params[params.length - 1] = user; 141 130 142 } 131 143
Note: See TracChangeset
for help on using the changeset viewer.