Changeset 278 for ether_megapoli
- Timestamp:
- 12/01/11 21:10:05 (12 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 1 added
- 26 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/domain/interface/com/ether/user/User.java
r274 r278 16 16 } 17 17 18 public User( @NotNull final String lastName, @Nullable final String firstName, @NotNull final String email, @NotNull final String p wd, @Nullable final String role, @NotNull final String state, final Boolean hasAccessToBO, @NotNull final Date date )18 public User( @NotNull final String lastName, @Nullable final String firstName, @NotNull final String email, @NotNull final String password, @Nullable final UserRole role, @NotNull final UserState state, final boolean hasAccessToBO, @NotNull final Date creationDate ) 19 19 { 20 20 _lastName = lastName; 21 21 _firstName = firstName; 22 22 _email = email; 23 _password = p wd;24 _role = UserRole.valueOf( role );25 _state = UserState.valueOf( state );23 _password = password; 24 _role = role; 25 _state = state; 26 26 _accessToBO = hasAccessToBO; 27 _creationDate = date; 27 _creationDate = creationDate; 28 } 29 30 public User( @NotNull final String lastName, @Nullable final String firstName, @NotNull final String email, @NotNull final String pwd, @Nullable final String role, @NotNull final String state, final Boolean hasAccessToBO, @NotNull final Date date ) 31 { 32 this( lastName, firstName, email, pwd, UserRole.valueOf( role ), UserState.valueOf( state ), hasAccessToBO, date ); 28 33 } 29 34 -
ether_megapoli/trunk/persistence/implementation/com/ether/dao/user/UserDAOImpl.java
r272 r278 7 7 import com.ether.user.UserState; 8 8 import org.hibernate.criterion.DetachedCriteria; 9 import org.hibernate.criterion.Order; 9 10 import org.hibernate.criterion.Restrictions; 10 11 import org.jetbrains.annotations.NotNull; … … 27 28 28 29 @Nullable 29 public User getUserById( @NotNull final Integer userId )30 throws PersistenceException31 {32 final DetachedCriteria criteria = DetachedCriteria.forClass( User.class )33 .add( Restrictions.idEq( userId ) );34 35 return selectByCriteria( User.class, criteria );36 }37 38 @Nullable39 30 public User getUserByEmail( @NotNull final String userEmail ) 40 31 throws PersistenceException … … 51 42 { 52 43 final DetachedCriteria criteria = DetachedCriteria.forClass( User.class ) 53 .add( Restrictions.eq( "state", userState ) ); 44 .add( Restrictions.eq( "state", userState ) ) 45 .addOrder( Order.asc( "lastName" ) ); 46 47 return selectAllByCriteria( User.class, criteria ); 48 } 49 50 @NotNull 51 public List<User> getAllUsersByNameOrder() 52 throws PersistenceException 53 { 54 final DetachedCriteria criteria = DetachedCriteria.forClass( User.class ) 55 .addOrder( Order.asc( "lastName" ) ); 54 56 55 57 return selectAllByCriteria( User.class, criteria ); -
ether_megapoli/trunk/persistence/interface/com/ether/dao/UserDAO.java
r272 r278 17 17 { 18 18 @Nullable 19 User getUserById( @NotNull final Integer userId )20 throws PersistenceException;21 22 @Nullable23 19 User getUserByEmail( @NotNull final String userEmail ) 24 20 throws PersistenceException; … … 27 23 List<User> getUsersByState( @NotNull final UserState userState ) 28 24 throws PersistenceException; 25 26 @NotNull 27 List<User> getAllUsersByNameOrder() 28 throws PersistenceException; 29 29 } -
ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java
r275 r278 192 192 try 193 193 { 194 return _userDAO. getUserById( userId );194 return _userDAO.selectByPrimaryKey( userId ); 195 195 } 196 196 catch( PersistenceException e ) … … 247 247 @NotNull 248 248 @Transactional(readOnly = true) 249 public List<User> getAllUsersByNameOrder() 250 throws ServiceException 251 { 252 try 253 { 254 return _userDAO.getAllUsersByNameOrder(); 255 } 256 catch( PersistenceException e ) 257 { 258 throw new ServiceException( ServiceException.ServiceCode.USER_NOT_FOUND, e ); 259 } 260 } 261 262 @NotNull 263 @Transactional(readOnly = true) 249 264 public List<User> getUsersByState( @NotNull final UserState userState ) 250 265 throws ServiceException … … 256 271 catch( PersistenceException e ) 257 272 { 258 throw new ServiceException( ServiceException.ServiceCode. WAITING_USER_NOT_FOUND, e );273 throw new ServiceException( ServiceException.ServiceCode.USER_NOT_FOUND, e ); 259 274 } 260 275 } … … 280 295 try 281 296 { 297 _userDAO.update( user ); 298 } 299 catch( PersistenceException e ) 300 { 301 throw new ServiceException( ServiceException.ServiceCode.PERSISTENCE, e ); 302 } 303 } 304 305 @Transactional(rollbackFor = Exception.class) 306 public void acceptOrRefuseUser( @NotNull final Integer userId, final boolean isAccepted ) 307 throws ServiceException 308 { 309 try 310 { 311 final User user = _userDAO.selectByPrimaryKey( userId ); 312 if( isAccepted ) 313 user.setState( UserState.ACCEPTED ); 314 else 315 user.setState( UserState.REFUSED ); 282 316 _userDAO.update( user ); 283 317 } -
ether_megapoli/trunk/service/interface/com/ether/EtherService.java
r275 r278 75 75 76 76 @NotNull 77 List<User> getAllUsersByNameOrder() 78 throws ServiceException; 79 80 @NotNull 77 81 List<User> getUsersByState( @NotNull UserState userState ) 78 82 throws ServiceException; … … 83 87 void updateUser( @NotNull final User user ) 84 88 throws ServiceException; 89 90 void acceptOrRefuseUser( @NotNull final Integer userId, final boolean isAccepted ) 91 throws ServiceException; 92 85 93 } -
ether_megapoli/trunk/web/WEB-INF/megapoli_dev.properties
r260 r278 10 10 11 11 #le serveur mail 12 mail.host=m egapoli-admin@ipsl.jussieu.fr12 mail.host=mailhost.ipsl.jussieu.fr 13 13 mail.webmaster=megapoli-admin@ipsl.jussieu.fr 14 14 url.upload=http://megapoli-dev.ipsl.jussieu.fr:8080/megapoli-dev/InitLogon.do -
ether_megapoli/trunk/web/WEB-INF/megapoli_local.properties
r199 r278 10 10 11 11 #le serveur mail 12 mail.host= vmipsl@ipsl.jussieu.fr12 mail.host=mailhost.ipsl.jussieu.fr 13 13 mail.webmaster=vmipsl@ipsl.jussieu.fr 14 14 url.upload=http://localhost:8080/megapoli/InitLogon.do -
ether_megapoli/trunk/web/WEB-INF/megapoli_prod.properties
r211 r278 10 10 11 11 #le serveur mail 12 mail.host=m egapoli-admin@ipsl.jussieu.fr12 mail.host=mailhost.ipsl.jussieu.fr 13 13 mail.webmaster=megapoli-admin@ipsl.jussieu.fr 14 14 url.upload=http://chewie.private.ipsl.fr:8080/megapoli/InitLogon.do -
ether_megapoli/trunk/web/WEB-INF/servlet-context.xml
r247 r278 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 4 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" 4 xsi:schemaLocation=" 5 5 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 6 6 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> … … 10 10 </bean> 11 11 12 <bean id="openSessionInViewInterceptor" class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor"> 13 <property name="sessionFactory"> 14 <ref bean="sessionFactory" /> 15 </property> 16 <property name="singleSession" value="true"/> 17 <property name="flushModeName"> 18 <value>FLUSH_AUTO</value> 19 </property> 20 </bean> 21 22 <!-- Mappings --> 23 <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 24 <property name="interceptors"> 25 <list> 26 <ref bean="loginInterceptor"/> 27 <ref bean="openSessionInViewInterceptor"/> 28 </list> 29 </property> 30 31 <property name="mappings"> 32 <props> 12 <bean id="openSessionInViewInterceptor" 13 class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor"> 14 <property name="sessionFactory"> 15 <ref bean="sessionFactory"/> 16 </property> 17 <property name="singleSession" value="true"/> 18 <property name="flushModeName"> 19 <value>FLUSH_AUTO</value> 20 </property> 21 </bean> 22 23 <!-- Mappings --> 24 <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 25 <property name="interceptors"> 26 <list> 27 <ref bean="loginInterceptor"/> 28 <ref bean="openSessionInViewInterceptor"/> 29 </list> 30 </property> 31 32 <property name="mappings"> 33 <props> 33 34 <prop key="/backoffice">controllerBackoffice</prop> 34 35 35 <prop key="/visualization">controllerVisualization</prop> 36 <prop key="/data">controllerData</prop> 36 37 <prop key="/project">controllerEponge</prop> 37 38 39 38 </props> 39 </property> 40 </bean> 40 41 41 42 <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>43 <property name="prefix" value="/" /> 44 <property name="suffix" value=".jsp"/>45 42 <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 43 <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> 44 <property name="prefix" value="/"/> 45 <property name="suffix" value=".jsp"/> 46 </bean> 46 47 47 48 49 50 48 <bean id="myMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver"> 49 <property name="defaultMethodName" value="home"/> 50 <property name="paramName" value="methodName"/> 51 </bean> 51 52 52 53 <bean id="controllerEther" class="com.ether.ControllerEther"> … … 56 57 57 58 <bean id="controllerBackoffice" class="com.ether.ControllerBackoffice" parent="controllerEther"> 58 <property name="etherService" ref="etherService" 59 <property name="etherService" ref="etherService"/> 59 60 </bean> 60 61 61 62 <property name="etherService" ref="etherService"/>63 62 <bean id="controllerVisualization" class="com.ether.ControllerVisualization" parent="controllerEther"> 63 <property name="etherService" ref="etherService"/> 64 </bean> 64 65 65 66 <bean id="controllerData" class="com.ether.ControllerData" parent="controllerEther"></bean> 66 <bean id="controllerEponge" class="com.ether.ControllerEponge" parent="controllerEther"></bean> 67 68 <bean id="controllerEponge" class="com.ether.ControllerEponge" parent="controllerEther"> 69 <property name="etherService" ref="etherService"/> 70 </bean> 67 71 </beans> -
ether_megapoli/trunk/web/backoffice/user.jsp
r275 r278 144 144 interfaceTexts["<%=UserRole.COORDINATOR%>"] = "<bean:message key="bo.user.coordinator"/>"; 145 145 146 interfaceTexts["<%=WebException.WebCode.USER_ALREADY_EXISTS%>"] = "<bean:message key="bo.user.alreadyExist"/>"; 146 interfaceTexts["<%=WebException.WebCode.USER_ALREADY_EXISTS%>"] = "<bean:message key="app.dataProtocol.alreadyExist"/>"; 147 interfaceTexts["<%=WebException.WebCode.ERROR_EMAIL_CANNOT_BE_SEND%>"] = "<bean:message key="bo.user.emailNotSend"/>"; 147 148 148 149 var interfaceBOUser = new interfaceBOUser( ${jSonWaitingUsers}, ${jSonUsers}, ${jSonUserStates}, ${jSonUserRoles} ); -
ether_megapoli/trunk/web/resources/css/TwitterLogin/front.css
r228 r278 127 127 } 128 128 129 #signin_menu p.forgot, #signin_menu p.complete {129 #signin_menu p.forgot, #signin_menu p.complete, #signin_menu p.inscription { 130 130 clear: both; 131 131 margin: 5px 0; -
ether_megapoli/trunk/web/resources/css/megapoli.css
r269 r278 174 174 175 175 .containerErrors { 176 display: none; 177 } 178 179 .containerInfos { 180 background: url("images/ui-bg_glass_95_fef1ec_1x400.png") repeat-x scroll 50% 50% #F0FFF0; 181 -moz-border-radius: 4px 4px 4px 4px; 182 -webkit-border-radius: 4px 4px 4px 4px; 183 border: 1px solid #529214; 184 color: #529214; 185 padding: 10px; 186 margin: 10px; 176 187 display: none; 177 188 } … … 361 372 background-color: #FFFDF6; 362 373 } 374 375 .dataProtocolButton { 376 margin-left: 51px; 377 } 378 379 .dataProtocolDownloadButton { 380 float: right; 381 } 382 383 .dataProtocolCheckbox, .dataProtocolCheckboxText { 384 float: left; 385 margin-left: 3px; 386 margin-top: 7px; 387 } 388 389 .dataProtocolCheckboxText { 390 margin-top: 4px; 391 } -
ether_megapoli/trunk/web/resources/js/classesForJQuery/LoginButton.js
r269 r278 4 4 // 5 5 // use jQuery && librairies from TwitterLogin 6 // isNeededInscription : true if we need the part "inscription for a new user" 6 7 //******************************************************** 7 8 … … 18 19 this.urlLogout = param.urlLogout ? param.urlLogout : false; 19 20 this.classNameToAdd = param.classNameToAdd ? param.classNameToAdd : false; 21 this.isNeededInscription = param.isNeededInscription ? param.isNeededInscription : false; 22 this.callbackInscription = param.callbackInscription ? param.callbackInscription : false; 20 23 21 24 // Texts 22 25 this.connexionText = param.connexionText ? param.connexionText : loginTexts["app.connexion"]; 23 26 this.loginText = param.loginText ? param.loginText : loginTexts["data.authentification.login"]; 24 this.pwdText = param.pwdText ? param.pwdText : loginTexts["data.authentification.p wd"];27 this.pwdText = param.pwdText ? param.pwdText : loginTexts["data.authentification.password"]; 25 28 this.submitText = param.submitText ? param.submitText : loginTexts["data.authentification.sign"]; 26 29 this.forgotPText = param.forgotPText ? param.forgotPText : loginTexts["data.authentification.pwdForget"]; 27 30 this.forgotUNPHelpText = param.forgotUNPHelpText ? param.forgotUNPHelpText : loginTexts["data.authentification.loginForget.help"]; 28 31 this.forgotUNPText = param.forgotUNPText ? param.forgotUNPText : loginTexts["data.authentification.loginForget"]; 32 this.inscriptionText = param.inscriptionText ? param.inscriptionText : loginTexts["data.authentification.inscription"]; 29 33 this.text1 = param.text1 ? param.text1 : loginTexts["app.admin"]; 30 34 this.errorText = param.errorText ? param.errorText : loginTexts[this.errors]; … … 51 55 var labelLogin = $( document.createElement( "label" ) ); 52 56 labelLogin.attr( {for:"login"} ); 53 labelLogin. append( this.loginText );57 labelLogin.html( this.loginText ); 54 58 var inputLogin = $( document.createElement( "input" ) ); 55 59 inputLogin.attr( {id:"login", name:"login", tabIndex:"4", type:"text"} ); … … 59 63 var labelPwd = $( document.createElement( "label" ) ); 60 64 labelPwd.attr( {for:"pwd"} ); 61 labelPwd. append( this.pwdText );65 labelPwd.html( this.pwdText ); 62 66 var inputPwd = $( document.createElement( "input" ) ); 63 67 inputPwd.attr( {id:"pwd", name:"pwd", tabIndex:"5", type:"password"} ); … … 77 81 var aForgotP = $( document.createElement( "a" ) ); 78 82 aForgotP.attr( {id:"resend_password_link", href:"mailto:${webmaster}?subject=[MEGAPOLI] login"} ); 79 aForgotP. append( this.forgotPText );83 aForgotP.html( this.forgotPText ); 80 84 inputForgotP.append( aForgotP ); 81 85 containerLoginForm.append( inputForgotP ); … … 85 89 var aForgotUNP = $( document.createElement( "a" ) ); 86 90 aForgotUNP.attr( {id:"forgot_username_link", href:"mailto:${webmaster}?subject=[MEGAPOLI] password", title:this.forgotUNPHelpText} ); 87 aForgotUNP. append( this.forgotUNPText );91 aForgotUNP.html( this.forgotUNPText ); 88 92 inputForgotUNP.append( aForgotUNP ); 89 93 containerLoginForm.append( inputForgotUNP ); 94 95 if( this.isNeededInscription ) 96 { 97 var inputInscription = $( document.createElement( "p" ) ); 98 inputInscription.addClass( "inscription" ); 99 var aInscription = $( document.createElement( "a" ) ); 100 aInscription.attr( {id:"inscription_link", href:"#"} ); 101 aInscription.html( this.inscriptionText ); 102 aInscription.bind( "click", jQuery.proxy( this.onClickInscription, this ) ); 103 inputInscription.append( aInscription ); 104 containerLoginForm.append( inputInscription ); 105 } 90 106 91 107 var divErrors = $( document.createElement( "div" ) ); … … 236 252 { 237 253 this.requestLogout(); 254 }, 255 256 onClickInscription: function() 257 { 258 this.containerErrors.hide(); 259 if( this.callbackInscription ) 260 this.callbackInscription(); 238 261 } 239 262 -
ether_megapoli/trunk/web/resources/jsp/backofficeHead.jsp
r267 r278 46 46 createLogin: function() 47 47 { 48 var buttonLogin = new LoginButton( { parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout", classNameToAdd:"gray" } );48 var buttonLogin = new LoginButton( { parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout", classNameToAdd:"gray" } ); 49 49 buttonLogin.setJSONUser( this.jSONUser ); 50 50 buttonLogin.display(); -
ether_megapoli/trunk/web/resources/jsp/dataProtocol_fr.jsp
r261 r278 1 <div class="title1">Mentions légales</div> 1 L'accÚs aux données Megapoli (téléchargement, dépÎt) est régi par le protocole ci-dessous.<BR/> 2 Vous devez donc l'accepter pour demander un compte utilisateur, un email vous sera ensuite envoyé afin de vous informer de la décision de l'administrateur. 3 <BR/><BR/> 4 5 6 <div class="title1">Protocole d'utilisation des données</div> 7 <BR/> 8 bloubloubloubloublou.... 2 9 3 10 <BR/> 11 <button class="dataProtocolDownloadButton"><a href="/SendFileToClient.do?path=dataProtocol.pdf">Téléchargement</a></button> 12 <a href="SendFileToClient.do?path=dataProtocol_fr.pdf">Téléchargement</a> 4 13 5 <div class="containerSlideContent2"> 6 <div class="title2">IPSL - Institut Pierre Simon Laplace</div> 7 Université Pierre et Marie Curie<BR/> 8 4 place Jussieu<BR/> 9 Tour 55-45, 2e étage<BR/> 10 Boîte 101<BR/> 11 75252 Paris Cedex 05<BR/> 12 France<BR/> 13 Tel : 01 44 27 61 68<BR/> 14 Fax : 01 44 27 39 02<BR/> 14 <BR/><BR/> 15 <hr width="50%"> 15 16 16 <BR/> 17 <div class="title2" style="float:left;">Directeur de la publication : </div> Hervé Le Treut 18 <BR/> 19 <div class="title2" style="float:left;">Hébergeur : </div> ETHER 20 </div> 17 <div class="title1">Demande de compte</div> 18 <BR/> 19 20 <table class="roundTable" border="1"> 21 <tr> 22 <td><label for="lastName">Nom</label></td> 23 <td><input id="lastName" name="lastName" type="text" size="30"></td> 24 </tr> 25 <tr> 26 <td><label for="firstName">Prénom</label></td> 27 <td><input id="firstName" name="firstName" type="text" size="30"></td> 28 </tr> 29 <tr> 30 <td><label for="email">Email</label></td> 31 <td><input id="email" name="email" type="text" size="30"></td> 32 </tr> 33 <tr> 34 <td> 35 <input id="checkboxUser" type="checkbox" class="dataProtocolCheckbox"> 36 37 <div class="dataProtocolCheckboxText">J'accepte le protocole</div> 38 </td> 39 <td> 40 <button onclick="javascript:onClickAcceptDataProtocol()" class="dataProtocolButton">Demande</button> 41 </td> 42 </tr> 43 </table> 44 45 <div id="infosAccount"></div> 46 -
ether_megapoli/trunk/web/resources/jsp/megapoliHead.jsp
r269 r278 2 2 3 3 <script type="text/javascript"> 4 var InterfaceTemplate = Class.create( { 5 6 initialize: function() 4 var InterfaceTemplate = Class.create( { 5 6 initialize: function() 7 { 8 /** *********** CONTAINERS *********** **/ 9 this.containerTitle = $( "#title" ); 10 this.containerTools = $( "#tools" ); 11 this.containerLogin = $( "#loginModule" ); 12 this.containerMenuData = $( "#menuData" ); 13 14 /** *********** VARIABLES *********** **/ 15 this.isLanguageFr = <%=Context.getLangue(request).equals( "fr" )%>; 16 this.path = "<%=request.getContextPath()%>"; 17 setPath( this.path ); 18 this.webmaster = "<%=Context.getWebmaster(request)%>"; 19 this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>"; 20 this.jSONUser = <%=Context.getJSONUser( request )%> ? <%=Context.getJSONUser( request )%> : false; 21 this.screenWidthLimit = 1336; 22 23 /** ************ CREATE ************ **/ 24 this.createTitle(); 25 this.createTools(); 26 this.createLogin(); 27 this.createMenuData(); 28 jQuery.proxy( this.createLeftSlides(), this ); 29 }, 30 31 // CREATES ******************************************************** 32 createTitle: function() 33 { 34 this.containerTitle.addClass( "containerTitle" ); 35 this.containerTitle.html( templateTexts["app.fulltitle"] ); 36 }, 37 38 createTools: function() 39 { 40 var mailButton = new Button( {value:templateTexts["data.upload.metadata.contact.mail"], parent:this.containerTools, id:"button_mail", className: "blue_button", classNameText:"blue_button_text", onClick:jQuery.proxy( this.onClickMail, this )} ); 41 42 var valueLanguage = templateTexts["app.fr"]; 43 if( this.isLanguageFr ) 44 valueLanguage = templateTexts["app.en"]; 45 46 var languageButton = new Button( {value:valueLanguage, parent:this.containerTools, id:"button_language", className: "blue_button", classNameText:"blue_button_text", onClick:jQuery.proxy( this.onClickLanguage, this )} ); 47 var homeButton = new Button( {value:templateTexts["app.home"], parent:this.containerTools, id:"button_home", className: "blue_button", classNameText:"blue_button_text", onClick:this.onClickHome} ); 48 49 var divSmallLogoEther = $( document.createElement( "div" ) ); 50 divSmallLogoEther.attr( {id:"smallLogoEther", class:"containerSmallLogoEther"} ); 51 divSmallLogoEther.append( '<a href="http://ether.ipsl.jussieu.fr" target="help"><img src="resources/images/logo_Ether.jpg" width="40px" height="40px"/></a>' ); 52 this.containerTools.append( divSmallLogoEther ); 53 54 this.updateLogoEther(); 55 }, 56 57 createLogin: function() 58 { 59 this.loginModule = new LoginButton( {parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout", isNeededInscription:true, callbackInscription:jQuery.proxy( this.onClickInscription, this ) } ); 60 this.loginModule.setJSONUser( this.jSONUser ); 61 this.loginModule.display(); 62 setLoginModule( this.loginModule ); 63 }, 64 65 createMenuData: function() 66 { 67 this.containerMenuData.empty(); 68 69 var ulData = $( document.createElement( "ul" ) ); 70 this.containerMenuData.append( ulData ); 71 72 var liExtract = $( document.createElement( "li" ) ); 73 var aExtract = $( document.createElement( "a" ) ); 74 aExtract.attr( {onclick:'javascript:neededLogin("/DataAccess.do")'} ); 75 aExtract.html( "<span>" + templateTexts["data.access.extract.short"] + "</span>" ); 76 liExtract.append( aExtract ); 77 ulData.append( liExtract ); 78 var liDownload = $( document.createElement( "li" ) ); 79 var aDownload = $( document.createElement( "a" ) ); 80 aDownload.attr( {onclick:'javascript:neededLogin("/PrepareTree.do")'} ); 81 aDownload.html( "<span>" + templateTexts["data.upload.short"] + "</span>" ); 82 liDownload.append( aDownload ); 83 ulData.append( liDownload ); 84 }, 85 86 createLeftSlides: function() 87 { 88 var contentSlideCredits = "resources/jsp/credits_fr.jsp"; 89 var contentSlideMentions = "resources/jsp/mentions_fr.jsp"; 90 var contentSlideInfos = "resources/jsp/informations_fr.jsp"; 91 92 var contentButtonCredits = "<button class='big_blue_button' title='" + templateTexts["app.credits"] + "'><div class='big_blue_button_text'>C</div></button>"; 93 var contentButtonMentions = "<button class='big_blue_button' title='" + templateTexts["app.mentions"] + "'><div class='big_blue_button_text'>M</div></button>"; 94 var contentButtonInfos = "<button class='big_blue_button' title='" + templateTexts["app.infos"] + "'><div class='big_blue_button_text'>I</div></button>"; 95 96 if( !this.isLanguageFr ) 7 97 { 8 /** *********** CONTAINERS *********** **/ 9 this.containerTitle = $( "#title" ); 10 this.containerTools = $( "#tools" ); 11 this.containerLogin = $( "#loginModule" ); 12 this.containerMenuData = $( "#menuData" ); 13 14 /** *********** VARIABLES *********** **/ 15 this.isLanguageFr = <%=Context.getLangue(request).equals( "fr" )%>; 16 this.path = "<%=request.getContextPath()%>"; 17 setPath( this.path ); 18 this.webmaster = "<%=Context.getWebmaster(request)%>"; 19 this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>"; 20 this.jSONUser = <%=Context.getJSONUser( request )%> ? <%=Context.getJSONUser( request )%> : false; 21 this.screenWidthLimit = 1336; 22 23 /** ************ CREATE ************ **/ 24 this.createTitle(); 25 this.createTools(); 26 this.createLogin(); 27 this.createMenuData(); 28 jQuery.proxy( this.createLeftSlides(), this ); 29 }, 30 31 // CREATES ******************************************************** 32 createTitle: function() 98 contentSlideCredits = "resources/jsp/credits_en.jsp"; 99 contentSlideMentions = "resources/jsp/mentions_en.jsp"; 100 contentSlideInfos = "resources/jsp/informations_en.jsp"; 101 } 102 var divSlideCredits = new Slide( { contentId:"slideContentCredits", buttonId: "slideCredits", parent:$( "#creditSlide" ), isIndexToChange:true, 103 contentButton:contentButtonCredits , contentPageSlide:contentSlideCredits} ); 104 105 var divSlideMentions = new Slide( { contentId:"slideContentMentions", buttonId: "slideMentions", parent:$( "#mentionSlide" ),specificButtonClass:"containerSlideButtonMentions", isIndexToChange:true, 106 contentButton:contentButtonMentions, contentPageSlide:contentSlideMentions} ); 107 108 var divSlideInfos = new Slide( { contentId:"slideContentInfos", buttonId: "slideInfos", parent:$( "#infoSlide" ), specificButtonClass:"containerSlideButtonInfos", isIndexToChange:true, 109 contentButton:contentButtonInfos, contentPageSlide:contentSlideInfos} ); 110 }, 111 112 // REQUESTS ******************************************************** 113 114 // EVENTS ******************************************************** 115 onClickHome: function() 116 { 117 document.location.href = "index.jsp"; 118 }, 119 120 onClickLanguage: function() 121 { 122 if( this.isLanguageFr ) 123 document.location.href = this.path + "/English.do?requestUri=" + this.relativePageUri; 124 else 125 document.location.href = this.path + "/French.do?requestUri=" + this.relativePageUri; 126 }, 127 128 onClickMail: function() 129 { 130 document.location.href = "mailto:" + this.webmaster + "?subject=[MEGAPOLI]"; 131 }, 132 133 onClickInscription: function() 134 { 135 var dataProtocol = "resources/jsp/dataProtocol_fr.jsp"; 136 if( !this.isLanguageFr ) 137 dataProtocol = "resources/jsp/dataProtocol_en.jsp"; 138 139 var $dialog = $( '<div></div>' ) 140 .load( dataProtocol ) 141 .dialog( { 142 autoOpen: false, 143 title: loginTexts["data.authentification.inscription"], 144 height: 700, 145 width: 600 146 } ); 147 $dialog.dialog( 'open' ); 148 149 // TODO : see with $dialog.ready() to manage buttons 150 }, 151 152 /** 153 * This method display a small Ether logo if the screen is too small to contain the big one 154 */ 155 updateLogoEther: function() 156 { 157 if( this.screenWidthLimit > innerWidth ) 33 158 { 34 this.containerTitle.addClass( "containerTitle");35 this.containerTitle.html( templateTexts["app.fulltitle"]);36 },37 38 createTools: function()159 $( "#logoEther" ).hide(); 160 $( "#linkLogoEther" ).hide(); 161 $( "#smallLogoEther" ).show(); 162 } 163 else 39 164 { 40 var mailButton = new Button( {value:templateTexts["data.upload.metadata.contact.mail"], parent:this.containerTools, id:"button_mail", className: "blue_button", classNameText:"blue_button_text", onClick:jQuery.proxy( this.onClickMail, this )} ); 41 42 var valueLanguage = templateTexts["app.fr"]; 43 if( this.isLanguageFr ) 44 valueLanguage = templateTexts["app.en"]; 45 46 var languageButton = new Button( {value:valueLanguage, parent:this.containerTools, id:"button_language", className: "blue_button", classNameText:"blue_button_text", onClick:jQuery.proxy( this.onClickLanguage, this )} ); 47 var homeButton = new Button( {value:templateTexts["app.home"], parent:this.containerTools, id:"button_home", className: "blue_button", classNameText:"blue_button_text", onClick:this.onClickHome} ); 48 49 var divSmallLogoEther = $( document.createElement( "div" ) ); 50 divSmallLogoEther.attr( {id:"smallLogoEther", class:"containerSmallLogoEther"} ); 51 divSmallLogoEther.append( '<a href="http://ether.ipsl.jussieu.fr" target="help"><img src="resources/images/logo_Ether.jpg" width="40px" height="40px"/></a>' ); 52 this.containerTools.append( divSmallLogoEther ); 53 54 this.updateLogoEther(); 55 }, 56 57 createLogin: function() 58 { 59 this.loginModule = new LoginButton( {parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout" } ); 60 this.loginModule.setJSONUser( this.jSONUser ); 61 this.loginModule.display(); 62 setLoginModule( this.loginModule ); 63 }, 64 65 createMenuData: function() 66 { 67 this.containerMenuData.empty(); 68 69 var ulData = $( document.createElement( "ul" ) ); 70 this.containerMenuData.append( ulData ); 71 72 var liExtract = $( document.createElement( "li" ) ); 73 var aExtract = $( document.createElement( "a" ) ); 74 aExtract.attr( {onclick:'javascript:neededLogin("/DataAccess.do")'} ); 75 aExtract.html( "<span>" + templateTexts["data.access.extract.short"] + "</span>" ); 76 liExtract.append( aExtract ); 77 ulData.append( liExtract ); 78 var liDownload = $( document.createElement( "li" ) ); 79 var aDownload = $( document.createElement( "a" ) ); 80 aDownload.attr( {onclick:'javascript:neededLogin("/PrepareTree.do")'} ); 81 aDownload.html( "<span>" + templateTexts["data.upload.short"] + "</span>" ); 82 liDownload.append( aDownload ); 83 ulData.append( liDownload ); 84 }, 85 86 createLeftSlides: function() 87 { 88 var contentSlideCredits = "resources/jsp/credits_fr.jsp"; 89 var contentSlideMentions = "resources/jsp/mentions_fr.jsp"; 90 var contentSlideInfos = "resources/jsp/informations_fr.jsp"; 91 92 var contentButtonCredits = "<button class='big_blue_button' title='" + templateTexts["app.credits"] + "'><div class='big_blue_button_text'>C</div></button>"; 93 var contentButtonMentions = "<button class='big_blue_button' title='" + templateTexts["app.mentions"] + "'><div class='big_blue_button_text'>M</div></button>"; 94 var contentButtonInfos = "<button class='big_blue_button' title='" + templateTexts["app.infos"] + "'><div class='big_blue_button_text'>I</div></button>"; 95 96 if( !this.isLanguageFr ) 97 { 98 contentSlideCredits = "resources/jsp/credits_en.jsp"; 99 contentSlideMentions = "resources/jsp/mentions_en.jsp"; 100 contentSlideInfos = "resources/jsp/informations_en.jsp"; 101 } 102 var divSlideCredits = new Slide( { contentId:"slideContentCredits", buttonId: "slideCredits", parent:$( "#creditSlide" ), isIndexToChange:true, 103 contentButton:contentButtonCredits , contentPageSlide:contentSlideCredits} ); 104 105 var divSlideMentions = new Slide( { contentId:"slideContentMentions", buttonId: "slideMentions", parent:$( "#mentionSlide" ),specificButtonClass:"containerSlideButtonMentions", isIndexToChange:true, 106 contentButton:contentButtonMentions, contentPageSlide:contentSlideMentions} ); 107 108 var divSlideInfos = new Slide( { contentId:"slideContentInfos", buttonId: "slideInfos", parent:$( "#infoSlide" ), specificButtonClass:"containerSlideButtonInfos", isIndexToChange:true, 109 contentButton:contentButtonInfos, contentPageSlide:contentSlideInfos} ); 110 }, 111 112 // REQUESTS ******************************************************** 113 114 // EVENTS ******************************************************** 115 onClickHome: function() 116 { 117 document.location.href = "index.jsp"; 118 }, 119 120 onClickLanguage: function() 121 { 122 if( this.isLanguageFr ) 123 document.location.href = this.path + "/English.do?requestUri=" + this.relativePageUri; 124 else 125 document.location.href = this.path + "/French.do?requestUri=" + this.relativePageUri; 126 }, 127 128 onClickMail: function() 129 { 130 document.location.href = "mailto:" + this.webmaster + "?subject=[MEGAPOLI]"; 131 }, 132 133 /** 134 * This method display a small Ether logo if the screen is too small to contain the big one 135 */ 136 updateLogoEther: function() 137 { 138 if( this.screenWidthLimit > innerWidth ) 139 { 140 $( "#logoEther" ).hide(); 141 $( "#linkLogoEther" ).hide(); 142 $( "#smallLogoEther" ).show(); 143 } 144 else 145 { 146 $( "#logoEther" ).show(); 147 $( "#linkLogoEther" ).show(); 148 $( "#smallLogoEther" ).hide(); 149 } 165 $( "#logoEther" ).show(); 166 $( "#linkLogoEther" ).show(); 167 $( "#smallLogoEther" ).hide(); 150 168 } 151 169 } 170 171 } ); 172 173 /** ******************************* **/ 174 /** *********** ACCOUNT *********** **/ 175 /** ******************************* **/ 176 function onClickDownloadDataProtocol() 177 { 178 alert( "downLoad" ); 179 } 180 181 function onClickAcceptDataProtocol() 182 { 183 if( '' == $( "#lastName" ).val() || '' == $( "#email" ).val() ) 184 { 185 showErrorAccount( null, templateTexts["app.dataProtocolFields"] ); 186 return; 187 } 188 189 if( $( "#checkboxUser" ).attr( 'checked' ) ) 190 createAccount(); 191 else 192 showErrorAccount( null, templateTexts["app.dataProtocolAccept"] ); 193 } 194 195 function createAccount() 196 { 197 var parametersUrl = "name=" + $( "#lastName" ).val() + "&firstName=" + $( "#firstName" ).val() + "&email=" + $( "#email" ).val(); 198 var request = $.ajax( { 199 url: "project?methodName=createAccount&" + parametersUrl, 200 success:handleCreateAccount, 201 error: showErrorAccount 152 202 } ); 203 } 204 205 function handleCreateAccount() 206 { 207 $( "#infosAccount" ).hide(); 208 $( "#infosAccount" ).removeClass( "containerErrors" ); 209 $( "#infosAccount" ).addClass( "containerInfos" ); 210 $( "#infosAccount" ).html( templateTexts["app.dataProtocol.account"] ); 211 $( "#infosAccount" ).show(); 212 } 213 214 function showErrorAccount( result, text ) 215 { 216 $( "#infosAccount" ).hide(); 217 $( "#infosAccount" ).removeClass( "containerInfos" ); 218 $( "#infosAccount" ).addClass( "containerErrors" ); 219 if( null != result ) 220 $( "#infosAccount" ).html( templateTexts[result.responseText] ); 221 else 222 $( "#infosAccount" ).html( text ); 223 224 $( "#infosAccount" ).show(); 225 } 153 226 </script> -
ether_megapoli/trunk/web/resources/jsp/mentions_en.jsp
r261 r278 15 15 16 16 <BR/> 17 <div class="title2" style="float:left;">Publication director : </div> Hervé Le Treut17 <div class="title2" style="float:left;">Publication director : </div> Cathy Boonne 18 18 <BR/> 19 <div class="title2" style="float:left;">Host : </div> ETHER19 <div class="title2" style="float:left;">Host : </div> CGTD/Ether IPSL 20 20 </div> -
ether_megapoli/trunk/web/resources/jsp/mentions_fr.jsp
r261 r278 15 15 16 16 <BR/> 17 <div class="title2" style="float:left;">Directeur de la publication : </div> Hervé Le Treut17 <div class="title2" style="float:left;">Directeur de la publication : </div> Cathy Boonne 18 18 <BR/> 19 <div class="title2" style="float:left;">Hébergeur : </div> ETHER19 <div class="title2" style="float:left;">Hébergeur : </div> CGTD/Ether IPSL 20 20 </div> -
ether_megapoli/trunk/web/resources/templates/templateBackoffice.jsp
r269 r278 108 108 loginTexts["app.connexion"] = '<bean:message key="app.connexion"/>'; 109 109 loginTexts["data.authentification.login"] = '<bean:message key="data.authentification.login"/>'; 110 loginTexts["data.authentification.p wd"] = '<bean:message key="data.authentification.pwd"/>';110 loginTexts["data.authentification.password"] = '<bean:message key="data.authentification.password"/>'; 111 111 loginTexts["data.authentification.sign"] = '<bean:message key="data.authentification.sign"/>'; 112 112 loginTexts["data.authentification.pwdForget"] = '<bean:message key="data.authentification.pwdForget"/>'; -
ether_megapoli/trunk/web/resources/templates/templateMegapoli.jsp
r265 r278 1 1 <%@ page language="java" import="com.medias.Context" %> 2 <%@ page import="com.ether.WebException" %> 2 3 <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> 3 4 <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> … … 20 21 <ether:htmlCss cssFile="complexButton"/> 21 22 <ether:htmlCss cssFile="TwitterLogin/front"/> 23 <ether:htmlCss cssFile="jquery-ui-1.8.16.custom/jquery-ui-1.8.16.custom"/> 22 24 <ether:htmlCss cssFile="ether"/> 23 25 <ether:htmlCss cssFile="megapoli"/> … … 33 35 <ether:htmlJs jsFile="apycom.com-4-steel-blue/menu"/> 34 36 <ether:htmlJs jsFile="TwitterLogin/javascripts/jquery.tipsy"/> 37 <ether:htmlJs jsFile="jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min"/> 35 38 36 39 <ether:htmlResourceJsp jspFile="megapoliHead"/> … … 154 157 templateTexts["app.mentions"] = '<bean:message key="app.mentions"/>'; 155 158 templateTexts["app.infos"] = '<bean:message key="app.infos"/>'; 159 templateTexts["app.dataProtocolAccept"] = "<bean:message key="app.dataProtocolAccept"/>"; 160 templateTexts["app.dataProtocolFields"] = "<bean:message key="app.dataProtocolFields"/>"; 161 templateTexts["app.dataProtocol.account"] = "<bean:message key="app.dataProtocol.account"/>"; 162 templateTexts["<%=WebException.WebCode.USER_ALREADY_EXISTS%>"] = "<bean:message key="app.dataProtocol.alreadyExist"/>"; 156 163 157 164 // Needed texts if you use the library LoginButton.js … … 159 166 loginTexts["app.connexion"] = '<bean:message key="app.connexion"/>'; 160 167 loginTexts["data.authentification.login"] = '<bean:message key="data.authentification.login"/>'; 161 loginTexts["data.authentification.p wd"] = '<bean:message key="data.authentification.pwd"/>';168 loginTexts["data.authentification.password"] = '<bean:message key="data.authentification.password"/>'; 162 169 loginTexts["data.authentification.sign"] = '<bean:message key="data.authentification.sign"/>'; 163 170 loginTexts["data.authentification.pwdForget"] = '<bean:message key="data.authentification.pwdForget"/>'; 164 171 loginTexts["data.authentification.loginForget.help"] = '<bean:message key="data.authentification.loginForget.help"/>'; 165 172 loginTexts["data.authentification.loginForget"] = '<bean:message key="data.authentification.loginForget"/>'; 173 loginTexts["data.authentification.inscription"] = '<bean:message key="data.authentification.inscription"/>'; 166 174 loginTexts["errors.logon.notFound"] = "<bean:message key='errors.logon.notFound' arg0="<%=Context.getWebmaster( request )%>"/>"; 167 175 loginTexts["errors.logon.failed"] = "<bean:message key='errors.logon.failed' arg0="<%=Context.getWebmaster( request )%>"/>"; -
ether_megapoli/trunk/web/src/ApplicationResources.properties
r267 r278 90 90 data.authentification.loginForget.help=Si vous vous souvenez de votre mot de passe, essayez de vous connecter avec votre email 91 91 data.authentification.pwdForget=Oubli du mot de passe ? 92 data.authentification.inscription=Nouvelle inscription 92 93 93 94 data.upload=D\u00E9p\u00F4t de donn\u00E9es … … 441 442 app.mentions=Mentions l\u00E9gales 442 443 app.infos=Informations 444 app.dataProtocolAccept=Vous devez accepter le protocole d'utilisation des donn\u00E9es pour demander un compte 445 app.dataProtocolFields=Les champs 'Nom' et 'Email' sont incomplets 446 app.dataProtocol.account=Votre compte est en attente de validation par l'administrateur. Vous recevrez un email lors de son activation. 447 app.dataProtocol.alreadyExist=Cette email est d\u00E9j\u00E0 utilis\u00E9 par un compte, veuillez en fournir un autre. 443 448 444 449 data.visualization.general.text=Dans cette zone, vous pouvez visualiser en ligne les donn\u00E9es disponibles. Plusieurs types de visualisations vous sont propos\u00E9s :<ul><li>un param\u00E8tre pour un site</li><li>un param\u00E8tre pour plusieurs sites</li><li>diff\u00E9rents param\u00E8tre pour un site</li><li>des visualisations en 2D</li></ul> -
ether_megapoli/trunk/web/src/ApplicationResources_en.properties
r275 r278 90 90 data.authentification.loginForget.help=If you remember your password, try logging in with your email 91 91 data.authentification.pwdForget=Forgot your password ? 92 data.authentification.inscription=New inscription 92 93 93 94 data.upload=Data upload … … 440 441 app.mentions=Legals 441 442 app.infos=Informations 443 app.dataProtocolAccept=You have to accept the data protocol to ask for an account 444 app.dataProtocolFields=Fields 'LastName' and 'Email' must be filled 445 app.dataProtocol.account=Your account is waiting for administrator validation. You will receive an email when it will be activated. 446 app.dataProtocol.alreadyExist=This email is already used, you have to give another one 442 447 443 448 data.visualization.general.text=In this area you can visualize available data with the following types of visualization : <ul><li>one parameter by plateform</li><li>one parameter by many plateforms</li><li>differents parameters by plateform</li><li>2D visualizations</li></ul> … … 550 555 bo.field.password=The field password must be filled 551 556 552 bo.user. alreadyExist=This email is already used, you have to give another one557 bo.user.emailNotSend=The email to the user cannot be sent, the email seems not valid : -
ether_megapoli/trunk/web/src/com/ether/ControllerBackoffice.java
r277 r278 78 78 } 79 79 else 80 throw new WebException( WebException.WebCode.USER_ALREADY_EXISTS, "This email already corresponds to an User", WebException.get BoThrowable() );80 throw new WebException( WebException.WebCode.USER_ALREADY_EXISTS, "This email already corresponds to an User", WebException.getExceptionThrowable() ); 81 81 82 82 return getAllAndWaitingUsers(); … … 118 118 } 119 119 else 120 throw new WebException( WebException.WebCode.USER_ALREADY_EXISTS, "This email already corresponds to an User", WebException.get BoThrowable() );120 throw new WebException( WebException.WebCode.USER_ALREADY_EXISTS, "This email already corresponds to an User", WebException.getExceptionThrowable() ); 121 121 122 122 return getAllAndWaitingUsers(); … … 146 146 catch( MessagingException e ) 147 147 { 148 throw new WebException( WebException.WebCode.ERROR_EMAIL_CANNOT_BE_SEND, "The email cannot be send to the user : " + user.getEmail(), WebException.get BoThrowable() );148 throw new WebException( WebException.WebCode.ERROR_EMAIL_CANNOT_BE_SEND, "The email cannot be send to the user : " + user.getEmail(), WebException.getExceptionThrowable() ); 149 149 } 150 150 -
ether_megapoli/trunk/web/src/com/ether/ControllerEponge.java
r251 r278 3 3 import com.ether.annotation.ControllerMethod; 4 4 import com.ether.annotation.ParamName; 5 import com.ether.user.User; 6 import com.ether.user.UserRole; 7 import com.ether.user.UserState; 5 8 import com.medias.annuaire.Annuaire; 6 9 import com.medias.annuaire.Personne; 10 import com.medias.mail.Mail; 11 import com.medias.mail.MailFactory; 7 12 import net.sf.json.JSONObject; 8 13 import org.apache.commons.logging.Log; 9 14 import org.apache.commons.logging.LogFactory; 10 15 import org.jetbrains.annotations.NotNull; 16 import org.jetbrains.annotations.Nullable; 17 import org.springframework.beans.factory.annotation.Required; 11 18 19 import javax.mail.MessagingException; 12 20 import javax.servlet.http.HttpServletRequest; 21 import java.util.Date; 13 22 import java.util.HashMap; 14 23 import java.util.Map; … … 89 98 } 90 99 100 @ControllerMethod(jsonResult = true) 101 public JSONObject createAccount( @NotNull @ParamName(ParameterConstants.PARAMETER_NAME) final String lastName, 102 @Nullable @ParamName(ParameterConstants.PARAMETER_FIRST_NAME) final String firstName, 103 @NotNull @ParamName(ParameterConstants.PARAMETER_EMAIL) final String email ) 104 throws ServiceException, WebException 105 { 106 final User existingUser = _etherService.getUserByEmail( email ); 107 if( null == existingUser ) 108 { 109 final Date creationDate = new Date(); 110 // TODO : encrypt password 111 final String password = "boum"; 112 final User user = new User( lastName, firstName, email, password, UserRole.COORDINATOR, UserState.WAITING, false, creationDate ); 113 114 _etherService.createUser( user ); 115 116 // Send email to administrator to inform there is a new account 117 sendEmailToAdministrator( user ); 118 } 119 else 120 throw new WebException( WebException.WebCode.USER_ALREADY_EXISTS, "This email already corresponds to an User", WebException.getExceptionThrowable() ); 121 122 return new JSONObject(); 123 } 124 125 /** 126 * This method create and send an email to the administrator to inform there is a new account to validate 127 * 128 * @param user 129 * @throws WebException 130 */ 131 private void sendEmailToAdministrator( @NotNull final User user ) 132 throws WebException 133 { 134 try 135 { 136 final MailFactory mailFactory = (MailFactory) getServletContext().getAttribute( "APP_MAILFACTORY" ); 137 final String from = (String) getServletContext().getAttribute( "APP_WEBMASTER" ); 138 final String subject = "[MEGAPOLI] Nouvelle demande de compte utilisateur"; 139 final String content = "Hello Matthias,\n\nUne nouvelle demande de compte vient d'arriver.\n\n" + 140 " - Nom : " + user.getLastName() + '\n' + 141 " - Prénom : " + user.getFirstName() + '\n' + 142 " - Email : " + user.getEmail() + "\n\n" + 143 "Tu peux accepter ou refuser son inscription via le BO : http://ether.ipsl.jussieu.fr/megapoli/backoffice?methodName=view\n\n" + 144 "Bonne soirée,\nLe serveur masqué"; 145 146 final Mail mail = new Mail( from, from, null, content, subject ); 147 mailFactory.sendMail( mail ); 148 } 149 catch( MessagingException e ) 150 { 151 throw new WebException( WebException.WebCode.ERROR_EMAIL_CANNOT_BE_SEND, "The email cannot be send to the megapoli administrator" ); 152 } 153 } 154 155 @Required 156 public void setEtherService( final EtherService etherService ) 157 { 158 _etherService = etherService; 159 } 160 91 161 private static final Log LOGGER = LogFactory.getLog( ControllerEponge.class ); 92 162 93 163 private static final String VIEW_ERRORS = "project/errors"; 94 164 private static final String VIEW_LOGIN = "project/login"; 165 166 private EtherService _etherService; 95 167 } -
ether_megapoli/trunk/web/src/com/ether/ControllerEther.java
r275 r278 17 17 import org.jetbrains.annotations.Nullable; 18 18 import org.springframework.beans.factory.annotation.Required; 19 import org.springframework.context.i18n.LocaleContextHolder;20 19 import org.springframework.web.servlet.ModelAndView; 21 20 import org.springframework.web.servlet.mvc.AbstractController; … … 146 145 response.setStatus( WebHelper.STATUS_CODE_SERVICE_EXCEPTION ); 147 146 148 if( exception.getCause().equals( WebException.get BoThrowable() ) )147 if( exception.getCause().equals( WebException.getExceptionThrowable() ) ) 149 148 WebHelper.writeJsonToResponse( response, exception.getLocalizedMessage() ); 150 149 else -
ether_megapoli/trunk/web/src/com/ether/WebException.java
r275 r278 35 35 private static String formatBO( final Enum<? extends Code> code, final String message, final Throwable throwable ) 36 36 { 37 if( throwable.equals( BO_THROWABLE ) )37 if( throwable.equals( EXCEPTION_THROWABLE ) ) 38 38 return code.name(); 39 39 else … … 41 41 } 42 42 43 public static Throwable get BoThrowable()43 public static Throwable getExceptionThrowable() 44 44 { 45 return BO_THROWABLE;45 return EXCEPTION_THROWABLE; 46 46 } 47 47 … … 56 56 PARAMETER_IS_NULL, 57 57 USER_ALREADY_EXISTS, 58 ERROR_EMAIL_CANNOT_BE_SEND 58 59 } 59 60 60 61 private static final Throwable DEFAULT_THROWABLE = null; 61 private static final Throwable BO_THROWABLE = new Throwable( "BO_THROWABLE" );62 private static final Throwable EXCEPTION_THROWABLE = new Throwable( "EXCEPTION_THROWABLE" ); 62 63 } -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-script.jsp
r265 r278 318 318 319 319 $dialog.dialog( 'open' ); 320 return false;320 // return false; 321 321 }, 322 322
Note: See TracChangeset
for help on using the changeset viewer.