Changeset 278 for ether_megapoli


Ignore:
Timestamp:
12/01/11 21:10:05 (12 years ago)
Author:
vmipsl
Message:

Data protocole, inscription

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  
    1616    } 
    1717 
    18     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 ) 
     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 ) 
    1919    { 
    2020        _lastName = lastName; 
    2121        _firstName = firstName; 
    2222        _email = email; 
    23         _password = pwd; 
    24         _role = UserRole.valueOf( role ); 
    25         _state = UserState.valueOf( state ); 
     23        _password = password; 
     24        _role = role; 
     25        _state = state; 
    2626        _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 ); 
    2833    } 
    2934 
  • ether_megapoli/trunk/persistence/implementation/com/ether/dao/user/UserDAOImpl.java

    r272 r278  
    77import com.ether.user.UserState; 
    88import org.hibernate.criterion.DetachedCriteria; 
     9import org.hibernate.criterion.Order; 
    910import org.hibernate.criterion.Restrictions; 
    1011import org.jetbrains.annotations.NotNull; 
     
    2728 
    2829    @Nullable 
    29     public User getUserById( @NotNull final Integer userId ) 
    30             throws PersistenceException 
    31     { 
    32         final DetachedCriteria criteria = DetachedCriteria.forClass( User.class ) 
    33                 .add( Restrictions.idEq( userId ) ); 
    34  
    35         return selectByCriteria( User.class, criteria ); 
    36     } 
    37  
    38     @Nullable 
    3930    public User getUserByEmail( @NotNull final String userEmail ) 
    4031            throws PersistenceException 
     
    5142    { 
    5243        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" ) ); 
    5456 
    5557        return selectAllByCriteria( User.class, criteria ); 
  • ether_megapoli/trunk/persistence/interface/com/ether/dao/UserDAO.java

    r272 r278  
    1717{ 
    1818    @Nullable 
    19     User getUserById( @NotNull final Integer userId ) 
    20             throws PersistenceException; 
    21  
    22     @Nullable 
    2319    User getUserByEmail( @NotNull final String userEmail ) 
    2420            throws PersistenceException; 
     
    2723    List<User> getUsersByState( @NotNull final UserState userState ) 
    2824            throws PersistenceException; 
     25 
     26    @NotNull 
     27    List<User> getAllUsersByNameOrder() 
     28            throws PersistenceException; 
    2929} 
  • ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java

    r275 r278  
    192192        try 
    193193        { 
    194             return _userDAO.getUserById( userId ); 
     194            return _userDAO.selectByPrimaryKey( userId ); 
    195195        } 
    196196        catch( PersistenceException e ) 
     
    247247    @NotNull 
    248248    @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) 
    249264    public List<User> getUsersByState( @NotNull final UserState userState ) 
    250265            throws ServiceException 
     
    256271        catch( PersistenceException e ) 
    257272        { 
    258             throw new ServiceException( ServiceException.ServiceCode.WAITING_USER_NOT_FOUND, e ); 
     273            throw new ServiceException( ServiceException.ServiceCode.USER_NOT_FOUND, e ); 
    259274        } 
    260275    } 
     
    280295        try 
    281296        { 
     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 ); 
    282316            _userDAO.update( user ); 
    283317        } 
  • ether_megapoli/trunk/service/interface/com/ether/EtherService.java

    r275 r278  
    7575 
    7676    @NotNull 
     77    List<User> getAllUsersByNameOrder() 
     78            throws ServiceException; 
     79 
     80    @NotNull 
    7781    List<User> getUsersByState( @NotNull UserState userState ) 
    7882            throws ServiceException; 
     
    8387    void updateUser( @NotNull final User user ) 
    8488            throws ServiceException; 
     89 
     90    void acceptOrRefuseUser( @NotNull final Integer userId, final boolean isAccepted ) 
     91            throws ServiceException; 
     92 
    8593} 
  • ether_megapoli/trunk/web/WEB-INF/megapoli_dev.properties

    r260 r278  
    1010 
    1111#le serveur mail 
    12 mail.host=megapoli-admin@ipsl.jussieu.fr 
     12mail.host=mailhost.ipsl.jussieu.fr 
    1313mail.webmaster=megapoli-admin@ipsl.jussieu.fr 
    1414url.upload=http://megapoli-dev.ipsl.jussieu.fr:8080/megapoli-dev/InitLogon.do 
  • ether_megapoli/trunk/web/WEB-INF/megapoli_local.properties

    r199 r278  
    1010 
    1111#le serveur mail 
    12 mail.host=vmipsl@ipsl.jussieu.fr 
     12mail.host=mailhost.ipsl.jussieu.fr 
    1313mail.webmaster=vmipsl@ipsl.jussieu.fr 
    1414url.upload=http://localhost:8080/megapoli/InitLogon.do 
  • ether_megapoli/trunk/web/WEB-INF/megapoli_prod.properties

    r211 r278  
    1010 
    1111#le serveur mail 
    12 mail.host=megapoli-admin@ipsl.jussieu.fr 
     12mail.host=mailhost.ipsl.jussieu.fr 
    1313mail.webmaster=megapoli-admin@ipsl.jussieu.fr 
    1414url.upload=http://chewie.private.ipsl.fr:8080/megapoli/InitLogon.do 
  • ether_megapoli/trunk/web/WEB-INF/servlet-context.xml

    r247 r278  
    11<?xml version="1.0" encoding="UTF-8"?> 
    22<beans xmlns="http://www.springframework.org/schema/beans" 
    3         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" 
    4         xsi:schemaLocation=" 
     3       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" 
     4       xsi:schemaLocation=" 
    55       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
    66       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> 
     
    1010    </bean> 
    1111 
    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> 
    3334                <prop key="/backoffice">controllerBackoffice</prop> 
    34                                 <prop key="/visualization">controllerVisualization</prop> 
    35                                 <prop key="/data">controllerData</prop> 
     35                <prop key="/visualization">controllerVisualization</prop> 
     36                <prop key="/data">controllerData</prop> 
    3637                <prop key="/project">controllerEponge</prop> 
    37                         </props> 
    38                 </property> 
    39         </bean> 
     38            </props> 
     39        </property> 
     40    </bean> 
    4041 
    41         <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
    42                 <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> 
    43                 <property name="prefix" value="/" />             
    44                 <property name="suffix" value=".jsp" /> 
    45         </bean> 
     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> 
    4647 
    47         <bean id="myMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver"> 
    48                 <property name="defaultMethodName" value="home"/> 
    49                 <property name="paramName" value="methodName"/> 
    50         </bean> 
     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> 
    5152 
    5253    <bean id="controllerEther" class="com.ether.ControllerEther"> 
     
    5657 
    5758    <bean id="controllerBackoffice" class="com.ether.ControllerBackoffice" parent="controllerEther"> 
    58         <property name="etherService" ref="etherService" /> 
     59        <property name="etherService" ref="etherService"/> 
    5960    </bean> 
    6061 
    61         <bean id="controllerVisualization" class="com.ether.ControllerVisualization" parent="controllerEther"> 
    62                 <property name="etherService" ref="etherService" /> 
    63         </bean> 
     62    <bean id="controllerVisualization" class="com.ether.ControllerVisualization" parent="controllerEther"> 
     63        <property name="etherService" ref="etherService"/> 
     64    </bean> 
    6465 
    6566    <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> 
    6771</beans> 
  • ether_megapoli/trunk/web/backoffice/user.jsp

    r275 r278  
    144144            interfaceTexts["<%=UserRole.COORDINATOR%>"] = "<bean:message key="bo.user.coordinator"/>"; 
    145145 
    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"/>"; 
    147148 
    148149            var interfaceBOUser = new interfaceBOUser( ${jSonWaitingUsers}, ${jSonUsers}, ${jSonUserStates}, ${jSonUserRoles} ); 
  • ether_megapoli/trunk/web/resources/css/TwitterLogin/front.css

    r228 r278  
    127127} 
    128128 
    129 #signin_menu p.forgot, #signin_menu p.complete { 
     129#signin_menu p.forgot, #signin_menu p.complete, #signin_menu p.inscription { 
    130130    clear: both; 
    131131    margin: 5px 0; 
  • ether_megapoli/trunk/web/resources/css/megapoli.css

    r269 r278  
    174174 
    175175.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; 
    176187    display: none; 
    177188} 
     
    361372    background-color: #FFFDF6; 
    362373} 
     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  
    44// 
    55// use jQuery && librairies from TwitterLogin 
     6// isNeededInscription : true if we need the part "inscription for a new user" 
    67//******************************************************** 
    78 
     
    1819        this.urlLogout = param.urlLogout ? param.urlLogout : false; 
    1920        this.classNameToAdd = param.classNameToAdd ? param.classNameToAdd : false; 
     21        this.isNeededInscription = param.isNeededInscription ? param.isNeededInscription : false; 
     22        this.callbackInscription = param.callbackInscription ? param.callbackInscription : false; 
    2023 
    2124        // Texts 
    2225        this.connexionText = param.connexionText ? param.connexionText : loginTexts["app.connexion"]; 
    2326        this.loginText = param.loginText ? param.loginText : loginTexts["data.authentification.login"]; 
    24         this.pwdText = param.pwdText ? param.pwdText : loginTexts["data.authentification.pwd"]; 
     27        this.pwdText = param.pwdText ? param.pwdText : loginTexts["data.authentification.password"]; 
    2528        this.submitText = param.submitText ? param.submitText : loginTexts["data.authentification.sign"]; 
    2629        this.forgotPText = param.forgotPText ? param.forgotPText : loginTexts["data.authentification.pwdForget"]; 
    2730        this.forgotUNPHelpText = param.forgotUNPHelpText ? param.forgotUNPHelpText : loginTexts["data.authentification.loginForget.help"]; 
    2831        this.forgotUNPText = param.forgotUNPText ? param.forgotUNPText : loginTexts["data.authentification.loginForget"]; 
     32        this.inscriptionText = param.inscriptionText ? param.inscriptionText : loginTexts["data.authentification.inscription"]; 
    2933        this.text1 = param.text1 ? param.text1 : loginTexts["app.admin"]; 
    3034        this.errorText = param.errorText ? param.errorText : loginTexts[this.errors]; 
     
    5155        var labelLogin = $( document.createElement( "label" ) ); 
    5256        labelLogin.attr( {for:"login"} ); 
    53         labelLogin.append( this.loginText ); 
     57        labelLogin.html( this.loginText ); 
    5458        var inputLogin = $( document.createElement( "input" ) ); 
    5559        inputLogin.attr( {id:"login", name:"login", tabIndex:"4", type:"text"} ); 
     
    5963        var labelPwd = $( document.createElement( "label" ) ); 
    6064        labelPwd.attr( {for:"pwd"} ); 
    61         labelPwd.append( this.pwdText ); 
     65        labelPwd.html( this.pwdText ); 
    6266        var inputPwd = $( document.createElement( "input" ) ); 
    6367        inputPwd.attr( {id:"pwd", name:"pwd", tabIndex:"5", type:"password"} ); 
     
    7781        var aForgotP = $( document.createElement( "a" ) ); 
    7882        aForgotP.attr( {id:"resend_password_link", href:"mailto:${webmaster}?subject=[MEGAPOLI] login"} ); 
    79         aForgotP.append( this.forgotPText ); 
     83        aForgotP.html( this.forgotPText ); 
    8084        inputForgotP.append( aForgotP ); 
    8185        containerLoginForm.append( inputForgotP ); 
     
    8589        var aForgotUNP = $( document.createElement( "a" ) ); 
    8690        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 ); 
    8892        inputForgotUNP.append( aForgotUNP ); 
    8993        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        } 
    90106 
    91107        var divErrors = $( document.createElement( "div" ) ); 
     
    236252    { 
    237253        this.requestLogout(); 
     254    }, 
     255 
     256    onClickInscription: function() 
     257    { 
     258        this.containerErrors.hide(); 
     259        if( this.callbackInscription ) 
     260            this.callbackInscription(); 
    238261    } 
    239262 
  • ether_megapoli/trunk/web/resources/jsp/backofficeHead.jsp

    r267 r278  
    4646        createLogin: function() 
    4747        { 
    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" } ); 
    4949            buttonLogin.setJSONUser( this.jSONUser ); 
    5050            buttonLogin.display(); 
  • ether_megapoli/trunk/web/resources/jsp/dataProtocol_fr.jsp

    r261 r278  
    1 <div class="title1">Mentions légales</div> 
     1L'accÚs aux données Megapoli (téléchargement, dépÃŽt) est régi par le protocole ci-dessous.<BR/> 
     2Vous 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/> 
     8bloubloubloubloublou.... 
    29 
    310<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> 
    413 
    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%"> 
    1516 
    16     <BR/> 
    17     <div class="title2" style="float:left;">Directeur de la publication :&nbsp;</div> Hervé Le Treut 
    18     <BR/> 
    19     <div class="title2" style="float:left;">Hébergeur :&nbsp;</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  
    22 
    33<script type="text/javascript"> 
    4     var InterfaceTemplate = Class.create( { 
    5  
    6         initialize: function() 
     4var 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 ) 
    797        { 
    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 ) 
    33158        { 
    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 
    39164        { 
    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(); 
    150168        } 
    151  
     169    } 
     170 
     171} ); 
     172 
     173/** ******************************* **/ 
     174/** *********** ACCOUNT *********** **/ 
     175/** ******************************* **/ 
     176function onClickDownloadDataProtocol() 
     177{ 
     178    alert( "downLoad" ); 
     179} 
     180 
     181function 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 
     195function 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 
    152202    } ); 
     203} 
     204 
     205function 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 
     214function 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} 
    153226</script> 
  • ether_megapoli/trunk/web/resources/jsp/mentions_en.jsp

    r261 r278  
    1515 
    1616    <BR/> 
    17     <div class="title2" style="float:left;">Publication director :&nbsp;</div> Hervé Le Treut 
     17    <div class="title2" style="float:left;">Publication director :&nbsp;</div> Cathy Boonne 
    1818    <BR/> 
    19     <div class="title2" style="float:left;">Host :&nbsp;</div> ETHER 
     19    <div class="title2" style="float:left;">Host :&nbsp;</div> CGTD/Ether IPSL 
    2020</div> 
  • ether_megapoli/trunk/web/resources/jsp/mentions_fr.jsp

    r261 r278  
    1515 
    1616    <BR/> 
    17     <div class="title2" style="float:left;">Directeur de la publication :&nbsp;</div> Hervé Le Treut 
     17    <div class="title2" style="float:left;">Directeur de la publication :&nbsp;</div> Cathy Boonne 
    1818    <BR/> 
    19     <div class="title2" style="float:left;">Hébergeur :&nbsp;</div> ETHER 
     19    <div class="title2" style="float:left;">Hébergeur :&nbsp;</div> CGTD/Ether IPSL 
    2020</div> 
  • ether_megapoli/trunk/web/resources/templates/templateBackoffice.jsp

    r269 r278  
    108108    loginTexts["app.connexion"] = '<bean:message key="app.connexion"/>'; 
    109109    loginTexts["data.authentification.login"] = '<bean:message key="data.authentification.login"/>'; 
    110     loginTexts["data.authentification.pwd"] = '<bean:message key="data.authentification.pwd"/>'; 
     110    loginTexts["data.authentification.password"] = '<bean:message key="data.authentification.password"/>'; 
    111111    loginTexts["data.authentification.sign"] = '<bean:message key="data.authentification.sign"/>'; 
    112112    loginTexts["data.authentification.pwdForget"] = '<bean:message key="data.authentification.pwdForget"/>'; 
  • ether_megapoli/trunk/web/resources/templates/templateMegapoli.jsp

    r265 r278  
    11<%@ page language="java" import="com.medias.Context" %> 
     2<%@ page import="com.ether.WebException" %> 
    23<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> 
    34<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> 
     
    2021    <ether:htmlCss cssFile="complexButton"/> 
    2122    <ether:htmlCss cssFile="TwitterLogin/front"/> 
     23    <ether:htmlCss cssFile="jquery-ui-1.8.16.custom/jquery-ui-1.8.16.custom"/> 
    2224    <ether:htmlCss cssFile="ether"/> 
    2325    <ether:htmlCss cssFile="megapoli"/> 
     
    3335    <ether:htmlJs jsFile="apycom.com-4-steel-blue/menu"/> 
    3436    <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"/> 
    3538 
    3639    <ether:htmlResourceJsp jspFile="megapoliHead"/> 
     
    154157    templateTexts["app.mentions"] = '<bean:message key="app.mentions"/>'; 
    155158    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"/>"; 
    156163 
    157164    // Needed texts if you use the library LoginButton.js 
     
    159166    loginTexts["app.connexion"] = '<bean:message key="app.connexion"/>'; 
    160167    loginTexts["data.authentification.login"] = '<bean:message key="data.authentification.login"/>'; 
    161     loginTexts["data.authentification.pwd"] = '<bean:message key="data.authentification.pwd"/>'; 
     168    loginTexts["data.authentification.password"] = '<bean:message key="data.authentification.password"/>'; 
    162169    loginTexts["data.authentification.sign"] = '<bean:message key="data.authentification.sign"/>'; 
    163170    loginTexts["data.authentification.pwdForget"] = '<bean:message key="data.authentification.pwdForget"/>'; 
    164171    loginTexts["data.authentification.loginForget.help"] = '<bean:message key="data.authentification.loginForget.help"/>'; 
    165172    loginTexts["data.authentification.loginForget"] = '<bean:message key="data.authentification.loginForget"/>'; 
     173    loginTexts["data.authentification.inscription"] = '<bean:message key="data.authentification.inscription"/>'; 
    166174    loginTexts["errors.logon.notFound"] = "<bean:message key='errors.logon.notFound' arg0="<%=Context.getWebmaster( request )%>"/>"; 
    167175    loginTexts["errors.logon.failed"] = "<bean:message key='errors.logon.failed' arg0="<%=Context.getWebmaster( request )%>"/>"; 
  • ether_megapoli/trunk/web/src/ApplicationResources.properties

    r267 r278  
    9090data.authentification.loginForget.help=Si vous vous souvenez de votre mot de passe, essayez de vous connecter avec votre email 
    9191data.authentification.pwdForget=Oubli du mot de passe ? 
     92data.authentification.inscription=Nouvelle inscription 
    9293 
    9394data.upload=D\u00E9p\u00F4t de donn\u00E9es 
     
    441442app.mentions=Mentions l\u00E9gales 
    442443app.infos=Informations 
     444app.dataProtocolAccept=Vous devez accepter le protocole d'utilisation des donn\u00E9es pour demander un compte 
     445app.dataProtocolFields=Les champs 'Nom' et 'Email' sont incomplets 
     446app.dataProtocol.account=Votre compte est en attente de validation par l'administrateur. Vous recevrez un email lors de son activation. 
     447app.dataProtocol.alreadyExist=Cette email est d\u00E9j\u00E0 utilis\u00E9 par un compte, veuillez en fournir un autre. 
    443448 
    444449data.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  
    9090data.authentification.loginForget.help=If you remember your password, try logging in with your email 
    9191data.authentification.pwdForget=Forgot your password ? 
     92data.authentification.inscription=New inscription 
    9293 
    9394data.upload=Data upload 
     
    440441app.mentions=Legals 
    441442app.infos=Informations 
     443app.dataProtocolAccept=You have to accept the data protocol to ask for an account 
     444app.dataProtocolFields=Fields 'LastName' and 'Email' must be filled 
     445app.dataProtocol.account=Your account is waiting for administrator validation. You will receive an email when it will be activated. 
     446app.dataProtocol.alreadyExist=This email is already used, you have to give another one 
    442447 
    443448data.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> 
     
    550555bo.field.password=The field password must be filled 
    551556 
    552 bo.user.alreadyExist=This email is already used, you have to give another one 
     557bo.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  
    7878        } 
    7979        else 
    80             throw new WebException( WebException.WebCode.USER_ALREADY_EXISTS, "This email already corresponds to an User", WebException.getBoThrowable() ); 
     80            throw new WebException( WebException.WebCode.USER_ALREADY_EXISTS, "This email already corresponds to an User", WebException.getExceptionThrowable() ); 
    8181 
    8282        return getAllAndWaitingUsers(); 
     
    118118        } 
    119119        else 
    120             throw new WebException( WebException.WebCode.USER_ALREADY_EXISTS, "This email already corresponds to an User", WebException.getBoThrowable() ); 
     120            throw new WebException( WebException.WebCode.USER_ALREADY_EXISTS, "This email already corresponds to an User", WebException.getExceptionThrowable() ); 
    121121 
    122122        return getAllAndWaitingUsers(); 
     
    146146        catch( MessagingException e ) 
    147147        { 
    148             throw new WebException( WebException.WebCode.ERROR_EMAIL_CANNOT_BE_SEND, "The email cannot be send to the user : " + user.getEmail(), WebException.getBoThrowable() ); 
     148            throw new WebException( WebException.WebCode.ERROR_EMAIL_CANNOT_BE_SEND, "The email cannot be send to the user : " + user.getEmail(), WebException.getExceptionThrowable() ); 
    149149        } 
    150150 
  • ether_megapoli/trunk/web/src/com/ether/ControllerEponge.java

    r251 r278  
    33import com.ether.annotation.ControllerMethod; 
    44import com.ether.annotation.ParamName; 
     5import com.ether.user.User; 
     6import com.ether.user.UserRole; 
     7import com.ether.user.UserState; 
    58import com.medias.annuaire.Annuaire; 
    69import com.medias.annuaire.Personne; 
     10import com.medias.mail.Mail; 
     11import com.medias.mail.MailFactory; 
    712import net.sf.json.JSONObject; 
    813import org.apache.commons.logging.Log; 
    914import org.apache.commons.logging.LogFactory; 
    1015import org.jetbrains.annotations.NotNull; 
     16import org.jetbrains.annotations.Nullable; 
     17import org.springframework.beans.factory.annotation.Required; 
    1118 
     19import javax.mail.MessagingException; 
    1220import javax.servlet.http.HttpServletRequest; 
     21import java.util.Date; 
    1322import java.util.HashMap; 
    1423import java.util.Map; 
     
    8998    } 
    9099 
     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 
    91161    private static final Log LOGGER = LogFactory.getLog( ControllerEponge.class ); 
    92162 
    93163    private static final String VIEW_ERRORS = "project/errors"; 
    94164    private static final String VIEW_LOGIN = "project/login"; 
     165 
     166    private EtherService _etherService; 
    95167} 
  • ether_megapoli/trunk/web/src/com/ether/ControllerEther.java

    r275 r278  
    1717import org.jetbrains.annotations.Nullable; 
    1818import org.springframework.beans.factory.annotation.Required; 
    19 import org.springframework.context.i18n.LocaleContextHolder; 
    2019import org.springframework.web.servlet.ModelAndView; 
    2120import org.springframework.web.servlet.mvc.AbstractController; 
     
    146145        response.setStatus( WebHelper.STATUS_CODE_SERVICE_EXCEPTION ); 
    147146 
    148         if( exception.getCause().equals( WebException.getBoThrowable() ) ) 
     147        if( exception.getCause().equals( WebException.getExceptionThrowable() ) ) 
    149148            WebHelper.writeJsonToResponse( response, exception.getLocalizedMessage() ); 
    150149        else 
  • ether_megapoli/trunk/web/src/com/ether/WebException.java

    r275 r278  
    3535    private static String formatBO( final Enum<? extends Code> code, final String message, final Throwable throwable ) 
    3636    { 
    37         if( throwable.equals( BO_THROWABLE ) ) 
     37        if( throwable.equals( EXCEPTION_THROWABLE ) ) 
    3838            return code.name(); 
    3939        else 
     
    4141    } 
    4242 
    43     public static Throwable getBoThrowable() 
     43    public static Throwable getExceptionThrowable() 
    4444    { 
    45         return BO_THROWABLE; 
     45        return EXCEPTION_THROWABLE; 
    4646    } 
    4747 
     
    5656        PARAMETER_IS_NULL, 
    5757        USER_ALREADY_EXISTS, 
     58        ERROR_EMAIL_CANNOT_BE_SEND 
    5859    } 
    5960 
    6061    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" ); 
    6263} 
  • ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-script.jsp

    r265 r278  
    318318 
    319319        $dialog.dialog( 'open' ); 
    320         return false; 
     320//        return false; 
    321321    }, 
    322322 
Note: See TracChangeset for help on using the changeset viewer.