Changeset 404
- Timestamp:
- 03/08/12 17:40:01 (12 years ago)
- Location:
- tapas
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/common/implementation/com/ether/Context.java
r384 r404 56 56 * Désigne l'adresse mail du webmaster 57 57 */ 58 public static String getWebmaster( HttpServletRequest request )58 public static String getWebmaster( final HttpServletRequest request ) 59 59 { 60 String webmaster = (String) request.getSession().getServletContext().getAttribute( "APP_WEBMASTER" ); 61 return webmaster; 60 return (String) request.getSession().getServletContext().getAttribute( "APP_WEBMASTER" ); 62 61 } 63 62 … … 67 66 * @return le nom de la racine. 68 67 */ 69 public static String getWebroot( HttpServletRequest request )68 public static String getWebroot( final HttpServletRequest request ) 70 69 { 71 String path = request.getSession().getServletContext().getRealPath( "" );70 final String path = request.getSession().getServletContext().getRealPath( "" ); 72 71 return path.substring( path.lastIndexOf( "/" ) + 1 ); 73 72 } … … 79 78 * @return l'uri de la page courante 80 79 */ 81 public static String getPageURI( HttpServletRequest request )80 public static String getPageURI( final HttpServletRequest request ) 82 81 { 83 82 return request.getRequestURI().substring( request.getRequestURI().indexOf( '/' ) + 1 ); … … 92 91 * @return 93 92 */ 94 public static String getRelativePageURI( HttpServletRequest request )93 public static String getRelativePageURI( final HttpServletRequest request ) 95 94 { 96 95 String pageUri = getPageURI( request ); … … 103 102 104 103 105 public static String getRelativePath( HttpServletRequest request )104 public static String getRelativePath( final HttpServletRequest request ) 106 105 { 107 106 String uri = getPageURI( request ); … … 119 118 * @return la langue courante. 120 119 */ 121 public static String getLangue( HttpServletRequest request )120 public static String getLangue( final HttpServletRequest request ) 122 121 { 123 122 String lang = (String) request.getSession().getAttribute( "lang" ); -
tapas/web/resources/templates/templateEther.jsp
r400 r404 1 <%@ page import="com.ether.Context" %>2 1 <%@ page contentType="text/html;charset=UTF-8" language="java" %> 3 2 <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> … … 16 15 17 16 <ether:htmlCss cssFile="apycom.com-5-red/menu"/> 18 <%--<ether:htmlCss cssFile="TwitterLogin/front"/>--%>19 17 <ether:htmlCss cssFile="jquery-ui-1.8.16.custom/jquery-ui-1.8.16.custom"/> 20 18 <ether:htmlCss cssFile="button"/> 21 <%--<ether:htmlCss cssFile="complexButton"/>--%>22 19 <ether:htmlCss cssFile="mainEther"/> 23 20 <ether:htmlCss cssFile="tapas"/> … … 28 25 <ether:htmlJs jsFile="classesForJQuery/etherHelper"/> 29 26 <ether:htmlJs jsFile="classesForJQuery/Button"/> 30 <ether:htmlJs jsFile="classesForJQuery/LoginButton"/>31 27 <ether:htmlJs jsFile="apycom.com-5-red/menu"/> 32 <%--<ether:htmlJs jsFile="TwitterLogin/javascripts/jquery.tipsy"/>--%>33 <%--<ether:htmlJs jsFile="jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min"/>--%>34 28 35 29 <jsp:include page="templateEther_script.jsp"/> … … 120 114 <%-- ****************** BOTTOM ****************** --%> 121 115 <div id="containerBottom" class="containerTapas containerBottom" align="right"> 122 © 201 0-2011<a href="http://ether.ipsl.jussieu.fr" target="help">ETHER </a>/ CNRS116 © 2012 <a href="http://ether.ipsl.jussieu.fr" target="help">ETHER </a>/ CNRS 123 117 </div> 124 118 </div> … … 134 128 templateTexts["label.mail"] = '<spring:message code="label.mail"/>'; 135 129 templateTexts["label.map"] = '<spring:message code="label.map"/>'; 136 templateTexts["label.atmosphere.chemistry"] = '<spring:message code="label.atmosphere.chemistry"/>';137 templateTexts["label.activities"] = '<spring:message code="label.activities"/>';138 templateTexts["label.data.services"] = '<spring:message code="label.data.services"/>';139 templateTexts["label.community"] = '<spring:message code="label.community"/>';140 templateTexts["label.pole.presentation"] = '<spring:message code="label.pole.presentation"/>';141 templateTexts["label.users.committee"] = '<spring:message code="label.users.committee"/>';142 templateTexts["label.laboratories"] = '<spring:message code="label.laboratories"/>';143 templateTexts["label.workshops"] = '<spring:message code="label.workshops"/>';144 templateTexts["label.ether.letter"] = '<spring:message code="label.ether.letters"/>';145 templateTexts["label.informations"] = '<spring:message code="label.informations"/>';146 130 147 // templateTexts["app.en"] = '<bean:message key="app.en"/>';148 // templateTexts["app.fr"] = '<bean:message key="app.fr"/>';149 <%--templateTexts["data.upload.metadata.contact.mail"] = '<bean:message key="data.upload.metadata.contact.mail"/>';--%>150 <%--templateTexts["data.access.extract.short"] = '<bean:message key="data.access.extract.short"/>';--%>151 <%--templateTexts["data.upload.short"] = '<bean:message key="data.upload.short"/>';--%>152 <%--templateTexts["app.backoffice"] = '<bean:message key="app.backoffice"/>';--%>153 <%--templateTexts["app.backoffice.help"] = '<bean:message key="app.backoffice.help"/>';--%>154 155 <%--templateTexts["app.credits"] = '<bean:message key="app.credits"/>';--%>156 <%--templateTexts["app.mentions"] = '<bean:message key="app.mentions"/>';--%>157 <%--templateTexts["app.infos"] = '<bean:message key="app.infos"/>';--%>158 <%--templateTexts["login.dataProtocolAccept"] = "<bean:message key="login.dataProtocolAccept"/>";--%>159 <%--templateTexts["login.dataProtocolFields"] = "<bean:message key="login.dataProtocolFields"/>";--%>160 <%--templateTexts["login.dataProtocol.account"] = "<bean:message key="login.dataProtocol.account"/>";--%>161 <%--templateTexts["<%=WebException.WebCode.USER_ALREADY_EXISTS%>"] = "<bean:message key="login.dataProtocol.alreadyExist"/>";--%>162 163 <%--// Needed texts if you use the library LoginButton.js--%>164 <%--var loginTexts = $A( "" );--%>165 <%--loginTexts["app.connexion"] = '<bean:message key="app.connexion"/>';--%>166 <%--loginTexts["login"] = '<bean:message key="login"/>';--%>167 <%--loginTexts["login.password"] = '<bean:message key="login.password"/>';--%>168 <%--loginTexts["login.sign"] = '<bean:message key="login.sign"/>';--%>169 <%--loginTexts["login.pwdForget"] = '<bean:message key="login.pwdForget"/>';--%>170 <%--loginTexts["login.loginForget"] = '<bean:message key="login.loginForget"/>';--%>171 <%--loginTexts["login.loginForget.help"] = '<bean:message key="login.loginForget.help"/>';--%>172 <%--loginTexts["login.inscription"] = '<bean:message key="login.inscription"/>';--%>173 <%--loginTexts["login.error.notFound"] = "<bean:message key='login.error.notFound'/>";--%>174 <%--loginTexts["login.error.wrongPassword"] = "<bean:message key='login.error.wrongPassword'/>";--%>175 <%--loginTexts["login.error.failed"] = "<bean:message key='login.error.failed' arg0="<%=Context.getWebmaster( request )%>"/>";--%>176 <%--loginTexts["login.error.notAccepted"] = "<bean:message key='login.error.notAccepted'/>";--%>177 <%--loginTexts["login.text"] = "<bean:message key="login.text"/>";--%>178 131 179 132 var interfaceTemplate = new InterfaceTemplate(); -
tapas/web/resources/templates/templateEther_script.jsp
r396 r404 13 13 /** *********** VARIABLES *********** **/ 14 14 this.isLanguageFr = <%=Context.getLangue(request).equals( "fr" )%>; 15 this.webmaster = "<%=Context.getWebmaster(request)%>";16 <%--this.jSONUser = <%=Context.getJSONUser( request )%> ? <%=Context.getJSONUser( request )%> : false;--%>15 // TODO : vérifier cette adresse de webmaster !!!! 16 this.webmaster = "rboipsl@ipsl.jussieu.fr"; 17 17 18 18 /** ************ CREATE ************ **/ 19 // this.createLogin();20 19 this.createTools(); 21 this.updateLoginOrLogout();22 20 }, 23 21 … … 36 34 }, 37 35 38 createLogin: function()39 {40 this.loginModule = new LoginButton( {parent:this.containerLogin, urlLogin:"project?methodName=login", urlLogout:"project?methodName=logout", isNeededInscription:true, callbackInscription:jQuery.proxy( this.onClickInscription, this ), anotherOnClickLogin:this.updateLoginOrLogout, anotherOnClickLogout:this.updateLoginOrLogout } );41 this.loginModule.setJSONUser( this.jSONUser );42 this.loginModule.display();43 setLoginModule( this.loginModule );44 },45 46 36 // REQUESTS ******************************************************** 47 37 … … 57 47 this.webmaster = "<%=Context.getWebmaster(request)%>"; 58 48 59 alert( "<%=request.getQueryString()%>||<%=Context.getRelativePath( request )%>||<%=Context.getRelativePageURI(request)%>");49 alert( "<%=request.getQueryString()%>||<%=Context.getRelativePath( request )%>||<%=Context.getRelativePageURI(request)%>" ); 60 50 61 51 this.relativePageUri = <%=request.getQueryString() != null%> ? "<%=Context.getRelativePath( request )%>?<%=request.getQueryString()%>" : "<%=Context.getRelativePageURI(request)%>"; … … 71 61 { 72 62 document.location.href = "mailto:" + this.webmaster + "?subject=[TAPAS]"; 73 },74 75 onClickInscription: function()76 {77 var dataProtocol = "resources/jsp/dataProtocol_fr.jsp";78 if( !this.isLanguageFr )79 dataProtocol = "resources/jsp/dataProtocol_en.jsp";80 81 var $dialog = $( '<div></div>' )82 .load( dataProtocol )83 .dialog( {84 autoOpen: false,85 title: loginTexts["login.inscription"],86 height: 800,87 width: 75088 } );89 $dialog.dialog( 'open' );90 91 // TODO : see with $dialog.ready() to manage buttons92 },93 94 updateLoginOrLogout: function()95 {96 <%--if( "<%=UserRole.ADMINISTRATOR%>" == getJSONUserRole() )--%>97 <%--$( "#button_bo" ).show();--%>98 <%--else--%>99 <%--$( "#button_bo" ).hide();--%>100 63 } 101 64 102 65 } ); 103 66 104 /** ******************************* **/105 /** *********** ACCOUNT *********** **/106 /** ******************************* **/107 function onClickAcceptDataProtocol()108 {109 if( '' == $( "#lastName" ).val() || '' == $( "#email" ).val() || '' == $( "#password" ).val() )110 {111 showErrorAccount( null, templateTexts["login.dataProtocolFields"] );112 return;113 }114 115 if( $( "#checkboxUser" ).attr( 'checked' ) )116 createAccount();117 else118 showErrorAccount( null, templateTexts["login.dataProtocolAccept"] );119 }120 121 function createAccount()122 {123 var parametersUrl = "name=" + $( "#lastName" ).val() + "&firstName=" + $( "#firstName" ).val() + "&email=" + $( "#email" ).val() + "&pwd=" + $( "#password" ).val();124 var request = $.ajax( {125 url: "project?methodName=createAccount&" + parametersUrl,126 success:handleCreateAccount,127 error: showErrorAccount128 } );129 }130 131 function handleCreateAccount()132 {133 $( "#infosAccount" ).hide();134 $( "#infosAccount" ).removeClass( "containerErrors" );135 $( "#infosAccount" ).addClass( "containerInfos" );136 $( "#infosAccount" ).html( templateTexts["login.dataProtocol.account"] );137 $( "#infosAccount" ).show();138 }139 140 function showErrorAccount( result, text )141 {142 $( "#infosAccount" ).hide();143 $( "#infosAccount" ).removeClass( "containerInfos" );144 $( "#infosAccount" ).addClass( "containerErrors" );145 if( null != result )146 $( "#infosAccount" ).html( templateTexts[result.responseText] );147 else148 $( "#infosAccount" ).html( text );149 150 $( "#infosAccount" ).show();151 }152 67 </script> -
tapas/web/src/messages_en.properties
r402 r404 16 16 error.ERROR_JSON_TAPAS_IS_NULL=Error to create the form 17 17 18 label.atmosphere.chemistry=Atmosphere chemistry19 label.activities=Activities20 label.data.services=Data/Services21 label.community=Community22 label.pole.presentation=Pole presentation23 label.users.committee=Users committee24 label.laboratories=Laboratories25 label.workshops=Workshops26 label.ether.letters=Ether letters27 label.informations=Informations28 29 label.balloons=Balloons30 label.satellites=Satellites31 label.campaigns=Campaigns32 label.models=Models33 label.meteo=Meteo34 label.links=Links35 36 home.title.part1=Centre for Atmospheric Chemistry37 home.title.part2=Products and Services38 home.news=N E W S39 home.main.activities=ETHER MAIN ACTIVITIES40 home.data=DATA41 home.databases=DATABASES42 home.services=SERVICES43 44 logo.mimosa.alt=Potential vorticity, temperature analysis and forecasts45 logo.reprobus.alt=Chemistry Transport Model in Polar Winters46 logo.iasi.alt=Infrared Atmospheric Sounding Interferometer47 logo.tropico.alt=TRO-pico campaign48 logo.geisa.alt=Spectroscopic data49 logo.mozaic.alt=Measurements of OZone, water vapour, carbon monoxide and nitrogen oxides by in-services AIrbus airCraft50 logo.eccad.alt=Emissions data and ancillary data for emissions calculation51 logo.megapoli.alt=Megacities: Emissions, urban, regional and Global Atmospheric POLlution and climate effects, and Integrated tools for assessment and mitigation52 logo.balloons.alt=Balloon experiments53 logo.satellites.alt=Available data in ETHER54 logo.campaigns.alt=Campaigns55 logo.models.alt=Models56 logo.meteo.alt=Meteo57 logo.ramces.alt=Atmospheric Network for the Measurement of Greenhouse Compounds58 logo.kinetics.alt=Chemical Kinetics Database59 logo.links.alt=Links60 61 62 18 label.submitButton=RUN -
tapas/web/src/messages_fr.properties
r402 r404 16 16 error.ERROR_JSON_TAPAS_IS_NULL=Erreur de création du formulaire Tapas 17 17 18 label.atmosphere.chemistry=Chimie de l'atmosphÚre19 label.activities=Activités20 label.data.services=Données/Services21 label.community=Communauté22 label.pole.presentation=Présentation du pÎle23 label.users.committee=Comité utilisateurs24 label.laboratories=Laboratoires25 label.workshops=Colloques/Ateliers26 label.ether.letters=Lettres Ether27 label.informations=Informations28 29 label.balloons=Ballons30 label.satellites=Satellites31 label.campaigns=Campagnes32 label.models=ModÚles33 label.meteo=Météo34 label.links=Liens35 36 home.title.part1=Centre de Produits et Services37 home.title.part2=de la Chimie de l'AtmosphÚre38 home.news=A C T U A L I T E S39 home.main.activities=PRINCIPALES ACTIVITES D'ETHER40 home.data=DONNEES41 home.databases=BASES DE DONNEES42 home.services=SERVICES43 44 logo.mimosa.alt=Potential vorticity, temperature analysis and forecasts45 logo.reprobus.alt=Chemistry Transport Model in Polar Winters46 logo.iasi.alt=Infrared Atmospheric Sounding Interferometer47 logo.tropico.alt=TRO-pico campaign48 logo.geisa.alt=Spectroscopic data49 logo.mozaic.alt=Measurements of OZone, water vapour, carbon monoxide and nitrogen oxides by in-services AIrbus airCraft50 logo.eccad.alt=Emissions data and ancillary data for emissions calculation51 logo.megapoli.alt=Megacities: Emissions, urban, regional and Global Atmospheric POLlution and climate effects, and Integrated tools for assessment and mitigation52 logo.balloons.alt=Ballons53 logo.satellites.alt=Données disponibles dans ETHER54 logo.campaigns.alt=Campagnes55 logo.models.alt=ModÚles56 logo.meteo.alt=Météo57 logo.ramces.alt=Réseau atmosphérique de Mesure des Composés à Effet de Serre58 logo.kinetics.alt=Chemical Kinetics Database59 logo.links.alt=Liens60 61 62 18 label.submitButton=COURIR 63
Note: See TracChangeset
for help on using the changeset viewer.