Changeset 667 for ether_statistics/web
- Timestamp:
- 11/15/12 11:01:02 (12 years ago)
- Location:
- ether_statistics/web
- Files:
-
- 7 added
- 7 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_statistics/web/WEB-INF/xml/uploadFiles.xsl
r569 r667 11 11 <!-- Début : on cherche le jeu désigné par le path "target" --> 12 12 <xsl:template match="/hierarchie"> 13 <xsl:text><![CDATA[< %@ page import="com.medias.Context" contentType="text/html; charset=UTF-8"%>13 <xsl:text><![CDATA[<![CDATA[<%@ page import="com.medias.Context" contentType="text/html; charset=UTF-8"%> 14 14 <%@ page import="com.medias.xml.hierarchie.Hierarchie"%> 15 <%@ page import="com.ether. user.UserRole" %>16 15 <%@ page import="com.ether.account.UserRole" %> 16 17 17 <%@ page language="java" contentType="text/html; charset=UTF-8"%> 18 18 <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles"%> … … 21 21 <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic"%> 22 22 23 <div id="level1">]]> </xsl:text>23 <div id="level1">]]>]]></xsl:text> 24 24 <xsl:apply-templates select="level[@name=substring-before($target,'/')]"> 25 25 <xsl:with-param name="new_path" select="substring-after($target,'/')"/> -
ether_statistics/web/WEB-INF/xml/uploadTree.xsl
r569 r667 10 10 <!-- On commence par écrire l'en-tête de la jsp --> 11 11 <xsl:template match="/hierarchie"> 12 <xsl:text><![CDATA[< %@ page import="com.medias.Context" contentType="text/html; charset=UTF-8"%>12 <xsl:text><![CDATA[<![CDATA[<%@ page import="com.medias.Context" contentType="text/html; charset=UTF-8"%> 13 13 <%@ page import="com.medias.xml.hierarchie.Hierarchie"%> 14 <%@ page import="com.ether. user.UserRole" %>14 <%@ page import="com.ether.account.UserRole" %> 15 15 16 16 <%@ page language="java" contentType="text/html; charset=UTF-8"%> … … 20 20 <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic"%> 21 21 22 ]]> </xsl:text>22 ]]>]]></xsl:text> 23 23 <xsl:apply-templates select="*"/> 24 24 <xsl:text><![CDATA[<br><br>]]></xsl:text> -
ether_statistics/web/init.jsp
r586 r667 1 1 <%--This redirect is used to allow messages sources in the index page--%> 2 <jsp:forward page=" data?methodName=view"/>2 <jsp:forward page="statistic?methodName=view"/> -
ether_statistics/web/project/credits_en.jsp
r596 r667 4 4 5 5 <div class="containerCredits"> 6 <div class="title2">Web site Megapoli</div>6 <div class="title2">Web site Statistics</div> 7 7 This web site design was created by the CGTD IPSL. 8 8 <BR/><BR/> -
ether_statistics/web/project/credits_fr.jsp
r596 r667 4 4 5 5 <div class="containerCredits"> 6 <div class="title2">Site web Megapoli</div>6 <div class="title2">Site web de Statistiques</div> 7 7 Le design de ce site a été conçu et réalisé par le CGTD IPSL. 8 8 <BR/><BR/> -
ether_statistics/web/project/statistics-script.jsp
r663 r667 9 9 /** *********** CONTAINERS *********** **/ 10 10 this.parent = $( "#containerMiddle" ); 11 this.containerMenu = $( "#menu Circle" );11 this.containerMenu = $( "#menuLogo" ); 12 12 this.containerErrors = $( "#errors" ); 13 13 … … 15 15 this.language = '<spring:message code="language"/>'; 16 16 this.webmaster = "<%=WebHelper.getProperty(request, "mail.webmaster")%>"; 17 this.projectsPath = "resources/images/"; 17 this.jSONUser = <%=WebHelper.getJSONUser( request )%> ? <%=WebHelper.getJSONUser( request )%> : false; 18 this.logoSizeSmall = 30; 19 this.logoSizeBig = 50; 20 18 21 this.projectsArray = [ 19 22 {id:"ETHER", img:"logo_Ether_50.jpg", top:"-16px", left:"125px"}, … … 34 37 {id:"ARLETTY", img:"logo_arletty_50.jpg", top:"-79px", left:"161.667px"} 35 38 ]; 36 this.widthInitLogin = $( "#login_bg" ).width();37 39 this.widthInitMentionsOrCredits = $( "#mentions" ).width(); 38 40 … … 40 42 this.yArray = [0, 10, 30, 50, 100]; 41 43 42 43 44 this.bindButtons(); 44 this.createDraggableSlides(); 45 this.createMenuCircle(); 45 this.createMenuLogo(); 46 46 47 47 $( document ).ready( jQuery.proxy( function() … … 49 49 $( ".containerToDrag" ).draggable(); 50 50 // Menu 51 this.animateMenuCircle(); 52 this.bindMenuCircle(); 53 // Slides 54 // this.onClickHelp(); 55 this.selectedLogo = $( "#ETHER" )[0]; 56 this.isSelectedLogoEther = true; 57 this.onClickLogo(); 58 59 this.changeRightSlide(); 51 this.animateMenuLogos(); 52 this.bindMenuLogos(); 53 this.createRightSlide(); 54 55 if( !this.jSONUser ) 56 this.onClickHelp(); 57 else 58 this.handleLogin(); 60 59 }, this ) ); 61 60 }, … … 67 66 $( "#home_button" ).bind( "dblclick", this.onClickHome ); 68 67 $( "#language_button" ).bind( "dblclick", jQuery.proxy( this.onClickLanguage, this ) ); 69 $( "#mail_button" ).bind( "dblclick", this.onClickMail ); 70 $( "#login_button" ).bind( "dblclick", jQuery.proxy( this.onClickLogin, this ) ); 68 $( "#mail_button" ).bind( "dblclick", jQuery.proxy( this.onClickMail, this ) ); 71 69 $( "#help" ).bind( "click", jQuery.proxy( this.onClickHelp, this ) ); 72 70 $( "#credits" ).bind( "dblclick", jQuery.proxy( this.onClickCredits, this ) ); 73 71 $( "#mentions" ).bind( "dblclick", jQuery.proxy( this.onClickMentions, this ) ); 74 }, 75 76 createMenuCircle: function() 77 { 78 var menuSize = this.containerMenu.width(); 79 var nbLogosForSize = (this.projectsArray.length / 2) + 1; 80 var divLogoSize = menuSize / nbLogosForSize; 81 this.logoSize = divLogoSize - 5; 82 72 $( "#login_button" ).bind( "click", jQuery.proxy( this.onClickLogin, this ) ); 73 $( "#logout_button" ).bind( "dblclick", jQuery.proxy( this.onClickLogout, this ) ); 74 }, 75 76 createMenuLogo: function() 77 { 83 78 var initTop = this.projectsArray[0].top; 84 79 var initLeft = this.projectsArray[0].left; … … 89 84 divLogo.addClass( "divLogo containerToDrag" ); 90 85 divLogo.attr( {id:logo.id, style:"position:absolute; top:" + initTop + "; left:" + initLeft} ); 91 divLogo.html( '<img id="img_' + logo.id + '"src=" ' + this.projectsPath + '' + logo.img + '" width="' + this.logoSize + 'px" height="' + this.logoSize+ 'px"/>' );92 $( "#menuCircle" ).append( divLogo );86 divLogo.html( '<img id="img_' + logo.id + '"src="resources/images/' + logo.img + '" width="' + this.logoSizeSmall + 'px" height="' + this.logoSizeSmall + 'px"/>' ); 87 this.containerMenu.append( divLogo ); 93 88 }, this ) ); 94 89 }, 95 90 96 create DraggableSlides: function()91 createAllSlides: function() 97 92 { 98 93 this.leftTopSlide = new DragSlide( {id:"leftTop", parent:this.parent, width:"170", height:"200", top:"140px", left:"53px", … … 110 105 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 111 106 112 this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"200", height:"300", top:"180px", left:"698px", 107 this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"200", height:"270", top:"210px", left:"698px", 108 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 109 110 this.rightLoginSlide = new DragSlide( {id:"loginRight", parent:this.parent, width:"200", height:"25", top:"170px", left:"697px", 111 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 112 }, 113 114 createRightSlide: function() 115 { 116 this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"200", height:"270", top:"210px", left:"698px", 113 117 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 114 118 }, … … 122 126 { 123 127 location.reload(); 124 } 128 }, 129 error: jQuery.proxy( this.showErrors, [this] ) 130 } ); 131 }, 132 133 requestLogin: function() 134 { 135 var login = $( "#loginValue" ).val(); 136 var pwd = $( "#pwdValue" ).val(); 137 $.ajax( { 138 url: "project?methodName=login&login=" + login + "&pwd=" + pwd, 139 dataType: 'json', // Info needed since jquery.1.7 !! 140 success:jQuery.proxy( this.handleLogin, this ), 141 error: jQuery.proxy( this.showErrors, [this, "489px", "566px"] ) 142 } ); 143 }, 144 145 requestLogout: function() 146 { 147 $.ajax( { 148 url: "project?methodName=logout", 149 dataType: 'json', // Info needed since jquery.1.7 !! 150 success:jQuery.proxy( this.handleLogout, this ), 151 error: jQuery.proxy( this.showErrors, [this] ) 125 152 } ); 126 153 }, … … 134 161 url: "statistic?methodName=searchMainStatisticsByProject&name=" + this.selectedLogo.id, 135 162 success:jQuery.proxy( this.handleDataByLogo, this ), 136 error: jQuery.proxy( this.show Errors, [this])137 } ); 138 }, 139 140 // HANDLES ******************************************************** = retours ajax163 error: jQuery.proxy( this.showLoginError, this ) 164 } ); 165 }, 166 167 // HANDLES ******************************************************** 141 168 handleDataByLogo: function( result ) 142 169 { … … 147 174 }, 148 175 176 handleLogin: function( result ) 177 { 178 this.containerErrors.empty(); 179 this.containerErrors.css( "visibility", "hidden" ); 180 181 if( result ) 182 this.jSONUser = result.jSONUser; 183 184 $( "#loginValue" ).empty(); 185 $( "#pwdValue" ).empty(); 186 $( "#login_text" ).css( "visibility", "hidden" ); 187 $( "#login" ).animate( { 188 top:'47px', 189 left:'126px' 190 }, 2000, function() 191 { 192 } ); 193 194 $( "#login_bg" ).animate( { 195 opacity: 1, 196 height:'60px', 197 width:'67px' 198 }, 2000, function() 199 { 200 } ); 201 202 $( "#login_img" ).animate( { 203 top:'25px', 204 left: '16px', 205 width: '0', 206 height: '0' 207 }, 2000, jQuery.proxy( function() 208 { 209 // Slides 210 this.parent.empty(); 211 this.createAllSlides(); 212 this.changeRightSlide(); 213 214 // User 215 if( this.jSONUser.name ) 216 this.rightLoginSlide.setTitle( this.jSONUser.name ); 217 else 218 this.rightLoginSlide.setTitle( '<spring:message code="label.unknown"/>' ); 219 $( "#logout_button" ).css( "visibility", "visible" ); 220 221 // Logo 222 this.selectedLogo = $( "#ETHER" )[0]; 223 this.isSelectedLogoEther = true; 224 this.onClickLogo(); 225 }, this ) ); 226 }, 227 228 handleLogout: function() 229 { 230 this.jSONUser = false; 231 this.parent.empty(); 232 this.createRightSlide(); 233 this.onClickHelp(); 234 235 $( "#logout_button" ).css( "visibility", "hidden" ); 236 $( "#login" ).css( { zIndex:1 } ).animate( { 237 top:'79px', 238 left:'88px' 239 }, 2000, function() 240 { 241 } ); 242 243 $( "#login_bg" ).animate( { 244 opacity: 0.85, 245 height:'500px', 246 width:'500px' 247 }, 2000, function() 248 { 249 $( "#login_text" ).css( "visibility", "visible" ); 250 } ); 251 252 $( "#login_img" ).animate( { 253 top:'103px', 254 left: '148px', 255 width: '30px', 256 height: '30px' 257 }, 2000, function() 258 { 259 } ); 260 }, 261 149 262 // EVENTS ******************************************************** 150 263 onClickHome: function() … … 161 274 { 162 275 document.location.href = "mailto:" + this.webmaster + "?subject=[STATISTICS]"; 163 },164 165 onClickLogin: function()166 {167 if( this.widthInitLogin == $( "#login_bg" ).width() )168 this.enlargeLogin();169 else170 this.reduceLogin();171 276 }, 172 277 … … 191 296 this.rightSlide.setTitle( '<spring:message code="label.help"/>' ); 192 297 this.rightSlide.setContent( "<spring:message code='label.help.content'/>" ); 193 var backHelpButton = new Button( {value:"<spring:message code="label.display.actions"/>", parent:this.rightSlide.getDivContent(), className: "small positive back_button", onClick:jQuery.proxy( this.changeRightSlide, this )} ); 194 }, 195 196 onClickButtonLogin: function() 197 { 198 // TODO reduce cloud 199 298 if( this.jSONUser ) 299 var backHelpButton = new Button( {value:"<spring:message code="label.display.actions"/>", parent:this.rightSlide.getDivContent(), className: "small positive back_button", onClick:jQuery.proxy( this.changeRightSlide, this )} ); 300 }, 301 302 onClickLogin: function() 303 { 304 this.containerErrors.empty(); 305 this.containerErrors.css( "visibility", "hidden" ); 306 this.requestLogin(); 307 }, 308 309 onClickLogout: function() 310 { 311 this.requestLogout(); 200 312 }, 201 313 … … 203 315 { 204 316 this.isSelectedLogoEther = (this.selectedLogo == $( "#ETHER" )[0]); 205 this.requestDataByLogo(); 317 318 if( this.jSONUser ) 319 this.requestDataByLogo(); 320 else 321 { 322 this.showErrors( "<spring:message code="error.connection.need"/>" ); 323 this.containerErrors.css( {top:"489px", left:"566px"} ); 324 this.containerErrors.css( "visibility", "visible" ); 325 } 206 326 }, 207 327 … … 221 341 { 222 342 var context = this[0] ? this[0] : this; 223 var text = this[1]; 343 var topValue = this[1] ? this[1] : false; 344 var leftValue = this[2] ? this[2] : false; 224 345 context.containerErrors.show(); 225 // if( text ) 226 // context.containerErrors.html( interfaceTexts[result.responseText] + " " + text ); 227 // else if( interfaceTexts[result.responseText] ) 228 // context.containerErrors.html( interfaceTexts[result.responseText] ); 229 if( result.responseText ) 346 if( result.responseText && interfaceTexts[result.responseText] ) 347 context.containerErrors.html( interfaceTexts[result.responseText] ); 348 else if( result.responseText ) 230 349 context.containerErrors.html( result.responseText ); 231 350 else 232 351 context.containerErrors.html( result ); 233 }, 234 235 reduceLogin: function() 236 { 237 $( "#login" ).css( { zIndex:0 } ); 238 $( "#login_text" ).css( "visibility", "hidden" ); 239 $( "#login_bg" ).animate( { 240 opacity: 1, 241 height:'60px', 242 width:'78px', 243 zIndex:'0' 244 }, 2000, function() 245 { 246 } ); 247 248 $( "#login_button" ).animate( { 249 top:'16px', 250 left: '20px' 251 }, 2000, function() 252 { 253 } ); 254 }, 255 256 enlargeLogin: function() 257 { 258 $( "#login" ).css( { zIndex:1 } ); 259 $( "#login_bg" ).animate( { 260 opacity: 0.45, 261 height:'500px', 262 width:'500px' 263 }, 2000, function() 264 { 265 $( "#login_text" ).css( "visibility", "visible" ); 266 } ); 267 268 $( "#login_button" ).animate( { 269 top:'82px', 270 left: '155px' 271 }, 2000, function() 272 { 273 } ); 352 if( topValue && leftValue ) 353 context.containerErrors.css( {top: topValue, left: leftValue} ); 354 context.containerErrors.css( "visibility", "visible" ); 355 }, 356 357 showLoginError: function( result ) 358 { 359 this.onClickLogout(); 360 this.onClickLogo(); 274 361 }, 275 362 … … 287 374 opacity: 1, 288 375 height:'42px', 289 width: '59px',376 width:this.widthInitMentionsOrCredits + 'px', 290 377 zIndex:'0' 291 378 }, 2000, function() … … 317 404 }, 318 405 319 animateMenu Circle: function()406 animateMenuLogos: function() 320 407 { 321 408 jQuery.each( this.projectsArray, jQuery.proxy( function( i, logo ) … … 330 417 }, 331 418 332 bindMenuCircle: function() 333 { 419 bindMenuLogos: function() 420 { 421 var gap = (this.logoSizeBig - this.logoSizeSmall) / 2; 422 var logoSizeBig = this.logoSizeBig + "px"; 423 var logoSizeSmall = this.logoSizeSmall + "px"; 334 424 var gridimage; 335 $( '.divLogo' ).mouseover( 336 function() 337 { 338 gridimage = $( this ).find( 'img' ); //Define target as a variable 339 gridimage.stop().animate( {width: 50, height:50}, 150 ); 340 } ).mouseout( 341 jQuery.proxy( function( element ) 342 { 343 this.selectedLogo = element.currentTarget; 344 gridimage.stop().animate( {width: this.logoSize, height:this.logoSize}, 150 ); 345 }, this ) ).dblclick( 346 jQuery.proxy( function() 347 { 348 this.onClickLogo(); 349 }, this ) ); 425 426 $( '.divLogo' ).mouseover( function( element ) 427 { 428 gridimage = $( this ).find( 'img' ); //Define target as a variable 429 gridimage.stop().animate( { 430 width: logoSizeBig, 431 height: logoSizeBig 432 }, 150 ); 433 $( this ).animate( { 434 top: "-=10px", 435 left: "-=10px" 436 }, 150 ); 437 } ); 438 439 $( '.divLogo' ).mouseout( function( element ) 440 { 441 $( this ).animate( { 442 top: "+=10px", 443 left: "+=10px" 444 }, 150 ); 445 gridimage.stop().animate( { 446 width: logoSizeSmall, 447 height:logoSizeSmall 448 }, 150 ); 449 } ); 450 451 $( '.divLogo' ).dblclick( jQuery.proxy( function( element ) 452 { 453 this.selectedLogo = element.currentTarget; 454 this.onClickLogo(); 455 }, this ) ); 350 456 }, 351 457 … … 379 485 new Button( {value:"<spring:message code="statistics.data.download"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDownloadEvolution, this )} ); 380 486 new Button( {value:"<spring:message code="statistics.map.distribution"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayMapDistribution, this )} ); 381 new Button( {value:"<spring:message code="label. export"/>", parent:this.rightSlide.getDivContent(), className: "blue export_button print-preview", onClick:jQuery.proxy( this.onClickPrint, this )} );487 new Button( {value:"<spring:message code="label.print"/>", parent:this.rightSlide.getDivContent(), className: "blue export_button print-preview", onClick:jQuery.proxy( this.onClickPrint, this )} ); 382 488 }, 383 489 … … 547 653 this.changeMiddleSlideForMap(); 548 654 } 655 549 656 } ); 550 657 -
ether_statistics/web/project/statistics.jsp
r663 r667 22 22 <ether:htmlCss cssFile="printContent"/> 23 23 24 <ether:htmlJs jsFile="library/jquery-1.8.2 "/>24 <ether:htmlJs jsFile="library/jquery-1.8.2.min"/> 25 25 <ether:htmlJs jsFile="library/jquery-ui-1.9.0.custom"/> 26 26 <ether:htmlJs jsFile="library/jquery.class"/> … … 50 50 51 51 <div id="login" class="containerToDrag"> 52 <img id="login_bg" src='resources/images/cloud.png' width=" 88px" height="71px"/>53 <img id="login_ button" src='resources/images/Milky/Chat.png' width="30px" height="30px"/>52 <img id="login_bg" src='resources/images/cloud.png' width="500px" height="500px"/> 53 <img id="login_img" src='resources/images/Milky/Chat.png' width="30px" height="30px"/> 54 54 55 55 <div id="login_text"> 56 56 <div id="login_text_title"><spring:message code="label.connection"/></div> 57 57 <div id="login_text_content"> 58 <spring:message code="label. firstname"/> : <inputtype="text" size="30"><BR/><BR/>59 <spring:message code="label. lastname"/> : <inputtype="text" size="30"><BR/><BR/><BR/>58 <spring:message code="label.login"/> : <input id="loginValue" type="text" size="30"><BR/><BR/> 59 <spring:message code="label.pwd"/> : <input id="pwdValue" type="text" size="30"><BR/><BR/><BR/> 60 60 61 61 <div style="float:right"> 62 <button ><spring:message code="label.connection"/></button>62 <button id="login_button"><spring:message code="label.connection"/></button> 63 63 </div> 64 64 </div> 65 65 </div> 66 <div id="login_user"></div> 67 <img id="logout_button" src='resources/images/utils/man_logout_small.png' width="25px" height="25px"/> 66 68 </div> 67 69 … … 94 96 </div> 95 97 96 <div class="menuCircle" id="menuCircle"></div>98 <div id="menuLogo" class="menuLogo"></div> 97 99 98 100 <div id="containerMiddle"></div> 99 101 100 <div id="errors" ></div>102 <div id="errors" class="containerToDrag"></div> 101 103 102 104 <script type="text/javascript"> 103 var texts = $A( "" ); 105 var interfaceTexts = $A( "" ); 106 interfaceTexts["ERROR_PASSWORD"] = "<spring:message code='ERROR_PASSWORD'/>"; 107 interfaceTexts["ERROR_LOGIN_NOT_FOUND"] = "<spring:message code='ERROR_LOGIN_NOT_FOUND'/>"; 108 interfaceTexts["ERROR_ENCRYPT_PASSWORD"] = "<spring:message code='ERROR_ENCRYPT_PASSWORD'/>"; 104 109 105 110 new InterfaceStatistics(); -
ether_statistics/web/resources/css/statistics.css
r654 r667 75 75 } 76 76 77 .menu Circle{77 .menuLogo { 78 78 position: relative; 79 79 float: right; … … 82 82 } 83 83 84 .containerErrors, #errors { 84 #errors { 85 position: absolute; 85 86 background: #FEF1EC; 86 87 -moz-border-radius: 4px 4px 4px 4px; … … 91 92 margin: 10px; 92 93 float: right; 93 display:none;94 }95 96 .containerErrors {97 94 display: none; 95 z-index: 2; 98 96 } 99 97 … … 194 192 195 193 #login { 196 position: relative;194 position: absolute; 197 195 float: left; 198 margin-right: 10px; 199 top: 41px; 200 left: 4px; 196 top: 79px; 197 left: 88px; 201 198 } 202 199 203 200 #login_bg { 204 201 position: absolute; 205 top: 0; 206 left: 0; 207 } 208 209 #login_button { 210 position: absolute; 211 top: 21px; 212 left: 25px; 202 } 203 204 #login_img { 205 position: relative; 206 top: 103px; 207 left: 148px; 208 } 209 210 #logout_button { 211 position: relative; 212 top: 17px; 213 left: 18px; 214 visibility: hidden; 213 215 } 214 216 215 217 #login_text, #credits_text, #mentions_text { 216 visibility: hidden;217 218 position: absolute; 218 219 } 219 220 220 221 #login_text_title { 221 position: absolute;222 top: 76px;223 left: 1 71px;222 position: relative; 223 top: 81px; 224 left: 186px; 224 225 font-weight: bold; 225 226 } 226 227 227 228 #login_text_content { 228 position: absolute;229 top: 1 63px;230 left: 80px;229 position: relative; 230 top: 143px; 231 left: 96px; 231 232 width: 273px; 233 } 234 235 #login_user { 236 position: relative; 237 color: #65981E; 238 font-size: 9px; 239 font-weight: bold; 240 top: 6px; 241 left: 39px; 242 } 243 244 #loginRight { 245 color: white; 246 } 247 248 #loginRight .containerStatisticsTitle { 249 text-align: center; 232 250 } 233 251 -
ether_statistics/web/src/com/ether/ControllerEponge.java
r574 r667 1 1 package com.ether; 2 2 3 import com.ether.account.Account; 3 4 import com.ether.annotation.ControllerMethod; 4 5 import com.ether.annotation.ParamName; 5 import com.ether.user.User;6 6 import net.sf.json.JSONObject; 7 7 import org.apache.commons.logging.Log; 8 8 import org.apache.commons.logging.LogFactory; 9 9 import org.jetbrains.annotations.NotNull; 10 import org.springframework.mail.javamail.JavaMailSenderImpl;11 import org.springframework.mail.javamail.MimeMessageHelper;12 10 13 import javax.mail.MessagingException;14 import javax.mail.internet.MimeMessage;15 11 import javax.servlet.http.HttpServletRequest; 12 import java.security.DigestException; 13 import java.security.NoSuchAlgorithmException; 16 14 import java.util.HashMap; 17 15 import java.util.Map; … … 56 54 @ParamName(ParameterConstants.PARAMETER_PWD) final String password, 57 55 @NotNull final HttpServletRequest request ) 58 throws ServiceException56 throws WebException 59 57 { 60 58 final JSONObject jSONUser = new JSONObject(); … … 65 63 try 66 64 { 67 // final User user = getTapasService().getUserByEmail( login ); 68 // final String encryptedPassword = EtherHelper.encryptPassword( password ); 69 // if( user == null ) 70 // result.put( "errors", "login.error.notFound" ); 71 // else if( !encryptedPassword.equals( user.getPassword() ) ) 72 // result.put( "errors", "login.error.wrongPassword" ); 73 // else 74 // { 75 // request.getSession().setAttribute( "SES_USER", user ); 76 // jSONUser.put( "name", user.getLastName() ); 77 // jSONUser.put( "firstName", user.getFirstName() ); 78 // jSONUser.put( "role", user.getRole().name() ); 79 // } 65 final Account account = getEtherService().getAccountByLogin( login ); 66 final String encryptedPassword = EtherHelper.encryptPassword( password ); 67 if( account == null ) 68 throw new WebException( WebException.WebCode.ERROR_LOGIN_NOT_FOUND, "No login found", WebException.getExceptionThrowable() ); 69 else if( !encryptedPassword.equals( account.getPassword() ) ) 70 throw new WebException( WebException.WebCode.ERROR_PASSWORD, "Wrong password", WebException.getExceptionThrowable() ); 71 else 72 { 73 request.getSession().setAttribute( "SES_ACCOUNT", account ); 74 jSONUser.put( "name", account.getName() ); 75 jSONUser.put( "role", account.getRole() ); 76 } 80 77 } 81 catch( Exception e )78 catch( DigestException e ) 82 79 { 83 result.put( "errors", "login.error.failed" ); 80 throw new WebException( WebException.WebCode.ERROR_ENCRYPT_PASSWORD, "Error to encrypt password", WebException.getExceptionThrowable() ); 81 } 82 catch( NoSuchAlgorithmException e ) 83 { 84 throw new WebException( WebException.WebCode.ERROR_ENCRYPT_PASSWORD, "Error to encrypt password", WebException.getExceptionThrowable() ); 85 } 86 catch( ServiceException e ) 87 { 88 throw new WebException( WebException.WebCode.ERROR_LOGIN_NOT_FOUND, "Error no login found", WebException.getExceptionThrowable() ); 84 89 } 85 90 } … … 92 97 @ControllerMethod(requestMandatory = true, jsonResult = true) 93 98 public JSONObject logout( @NotNull final HttpServletRequest request ) 94 throws ServiceException99 throws WebException 95 100 { 96 request.getSession().setAttribute( "SES_ USER", null );101 request.getSession().setAttribute( "SES_ACCOUNT", null ); 97 102 request.getSession().invalidate(); 98 103 … … 100 105 } 101 106 102 103 // @ControllerMethod(jsonResult = true)104 // public JSONObject createAccount( @NotNull @ParamName(ParameterConstants.PARAMETER_NAME) final String lastName,105 // @Nullable @ParamName(ParameterConstants.PARAMETER_FIRST_NAME) final String firstName,106 // @NotNull @ParamName(ParameterConstants.PARAMETER_EMAIL) final String email,107 // @NotNull @ParamName(ParameterConstants.PARAMETER_PWD) final String password,108 // @Nullable @ParamName(ParameterConstants.PARAMETER_LABORATORY) final String laboratory,109 // @Nullable @ParamName(ParameterConstants.PARAMETER_COUNTRY) final String country )110 // throws ServiceException, WebException111 // {112 // try113 // {114 // final User existingUser = getTapasService().getUserByEmail( email );115 // if( null == existingUser )116 // {117 // final Date creationDate = new Date();118 //119 // final String encryptedPassword = EtherHelper.encryptPassword( password );120 // final User user = new User( lastName, firstName, email, encryptedPassword, UserRole.USER, false, laboratory, country, creationDate );121 //122 // getTapasService().createUser( user );123 //124 // // Send email to administrator to inform there is a new account125 // sendEmailToAdministratorAndUser( user );126 // }127 // else128 // throw new WebException( WebException.WebCode.USER_ALREADY_EXISTS, "This email already corresponds to an User", WebException.getExceptionThrowable() );129 // }130 // catch( DigestException e )131 // {132 // throw new WebException( WebException.WebCode.ERROR_ENCRYPT_PASSWORD, "This password cannot be encrypted" );133 // }134 // catch( NoSuchAlgorithmException e )135 // {136 // throw new WebException( WebException.WebCode.ERROR_ENCRYPT_PASSWORD, "This password cannot be encrypted" );137 // }138 //139 // return new JSONObject();140 // }141 142 /**143 * This method create and send an email to :144 * - the administrator to inform there is a new created account145 * - the user to inform his account is created146 *147 * @param user148 * @throws WebException149 */150 private void sendEmailToAdministratorAndUser( @NotNull final User user )151 throws WebException152 {153 try154 {155 final String host = getProperty( "mail.host" );156 final String webMaster = getProperty( "mail.webmaster" );157 final JavaMailSenderImpl sender = new JavaMailSenderImpl();158 sender.setHost( host );159 160 final MimeMessage message = sender.createMimeMessage();161 final MimeMessageHelper helper = new MimeMessageHelper( message );162 163 // Mail Admin164 final String subjectAdmin = "[TAPAS] Nouveau compte utilisateur";165 final String contentAdmin = "Nouvelle création de compte : \n\n" +166 " - Nom : " + user.getLastName() + '\n' +167 " - Prénom : " + user.getFirstName() + '\n' +168 " - Email : " + user.getEmail() + "\n\n" +169 "Le serveur de mail masqué";170 171 helper.setFrom( webMaster );172 helper.setTo( webMaster );173 helper.setSubject( subjectAdmin );174 helper.setText( contentAdmin );175 sender.send( message );176 177 // Mail User178 final String subjectUser = "[TAPAS] New account";179 final String contentUser = "Dear " + user.getLastName() + "\n\n" +180 "Your account on TAPAS is now created. You can access to the website with your email as login and your password.\n\n" +181 "The TAPAS Administrator";182 183 helper.setFrom( webMaster );184 helper.setTo( user.getEmail() );185 helper.setSubject( subjectUser );186 helper.setText( contentUser );187 sender.send( message );188 }189 catch( MessagingException e )190 {191 throw new WebException( WebException.WebCode.ERROR_EMAIL_CANNOT_BE_SEND, "The email cannot be send to the TAPAS administrator or USER" );192 }193 }194 195 // @ControllerMethod(downloadFile = DOWNLOAD_DATA_PROTOCOL_EN)196 // public void downloadFileDataProtocolEn()197 // {198 // }199 //200 // @ControllerMethod(downloadFile = DOWNLOAD_DATA_PROTOCOL_FR)201 // public void downloadFileDataProtocolFr()202 // {203 // }204 //205 107 private static final Log LOGGER = LogFactory.getLog( ControllerEponge.class ); 206 207 108 private static final String VIEW_INIT = "init"; 208 private static final String VIEW_DATA_PROTOCOL_EN = "project/home_dataProtocol_en";209 // TODO : mettre les bons fichiers de Dataprotocol210 private static final String DOWNLOAD_DATA_PROTOCOL_EN = "bib.txt";211 private static final String DOWNLOAD_DATA_PROTOCOL_FR = "bib.txt";212 109 } -
ether_statistics/web/src/com/ether/ControllerEther.java
r574 r667 1 1 package com.ether; 2 2 3 import com.ether.account.Account; 3 4 import com.ether.annotation.ControllerMethod; 4 5 import com.ether.annotation.Mandatory; 5 6 import com.ether.annotation.ParamName; 6 7 import com.ether.annotation.UseJSON; 7 import com.ether.user.User;8 8 import net.sf.json.JSON; 9 9 import net.sf.json.JSONArray; … … 113 113 // Parse parameters 114 114 final Object[] params = buildParams( methodDescription, request ); 115 final String defaultView = ( null != methodDescription.getDefaultView() && !"".equals( methodDescription.getDefaultView() ) ) ? methodDescription.getDefaultView() : methodDescription.getView();116 117 115 118 116 if( methodDescription.isRequestMandatory() ) 119 117 params[params.length - 1] = request; //params = parametre de la methode du Controller 120 118 121 122 119 if( methodDescription.isLoginMandatory() ) 123 120 { 124 final User user = (User) request.getSession().getAttribute( "SES_USER" ); 125 if( null == user ) 126 return new ModelAndView( defaultView, "errors", "login.error.unknown" ); 121 final Account account = (Account) request.getSession().getAttribute( "SES_ACCOUNT" ); 122 if( null == account ) 123 { 124 sendSerializedException( response, new WebException( WebException.WebCode.ERROR_LOGIN_NOT_FOUND, "No login found", WebException.getExceptionThrowable() ) ); 125 return null; 126 } 127 127 } 128 128 … … 135 135 // params[params.length - 1] = user; 136 136 // } 137 //138 if( methodDescription.isBackofficeMethod() )139 {140 final User user = (User) request.getSession().getAttribute( "SES_USER" );141 if( null == user )142 {143 return new ModelAndView( defaultView, "errors", "login.error.unknown" );144 }145 else if( null != user && !user.isAccessToBO() )146 {147 return new ModelAndView( defaultView, "errors", "login.error.bo.notAccepted" );148 }149 }150 137 151 138 final Object result; … … 177 164 return null; 178 165 } 179 // else if( null != methodDescription.getDownloadFile() && !"".equals( methodDescription.getDownloadFile() ) )180 // {181 // final String fileName = methodDescription.getDownloadFile();182 // final String downloadPath = getProperty( "downloadPath" );183 // WebHelper.downloadFileToResponse( fileName, downloadPath, response );184 // return null;185 // }186 166 else 187 167 { … … 190 170 } 191 171 } 192 catch( Throwablee )193 { 194 throw new WebException( e );172 catch( IOException e ) 173 { 174 throw new WebException( WebException.WebCode.IO_EXCEPTION_ERROR, e ); 195 175 } 196 176 } -
ether_statistics/web/src/com/ether/ControllerStatistics.java
r657 r667 30 30 throws ServiceException 31 31 { 32 return new ModelAndView( VIEW_ ERRORS);32 return new ModelAndView( VIEW_INIT ); 33 33 } 34 34 … … 37 37 throws ServiceException 38 38 { 39 // final Calendar cal = Calendar.getInstance();40 // final Date today = cal.getTime();41 // cal.set( 1900, Calendar.JANUARY, 1 );42 // final Date begin = cal.getTime();43 // cal.set( Calendar.DST_OFFSET, 40001 );44 // final Date bob = cal.getTime();45 39 return new HashMap<String, Object>(); 46 40 } … … 56 50 * @throws ServiceException 57 51 */ 58 @ControllerMethod(jsonResult = true )52 @ControllerMethod(jsonResult = true, loginMandatory = true) 59 53 public JSONObject searchMainStatisticsByProject( @Mandatory @ParamName(ParameterConstants.PARAMETER_NAME) final String projectName ) 60 54 throws ServiceException … … 70 64 private static final Log LOGGER = LogFactory.getLog( ControllerStatistics.class ); 71 65 66 private static final String VIEW_INIT = "init"; 72 67 private static final String VIEW_STATISTICS = "project/statistics"; 73 private static final String VIEW_VISUALIZATION_PARAMETER_BY_PLATEFORM = "visualization/visu_parameter_by_pf";74 private static final String VIEW_DOWNLOAD_OK = "data/access/extract3";75 private static final String VIEW_WORK = "project/inWork";76 public static final String VIEW_ERRORS = "project/errors";77 78 private static final String FORMAT_DEFAULT = "NASA-AMES";79 private static final String COMPRESSION_DEFAULT = "None";80 68 } -
ether_statistics/web/src/com/ether/WebException.java
r574 r667 41 41 ERROR_NO_REQUEST_HANDLING_METHOD, 42 42 ERROR_NUMBER_OF_PARAM_TYPES_NOT_EQUAL_TO_PARAM_ANNOTATIONS, 43 USER_ALREADY_EXISTS,44 43 ERROR_ENCRYPT_PASSWORD, 45 ERROR_EMAIL_CANNOT_BE_SEND, 46 ERROR_XML_CREATION, 47 ERROR_NO_OBSERVATORY_FOUND, 48 ERROR_NO_USER_FOUND, 44 ERROR_PASSWORD, 45 ERROR_LOGIN_NOT_FOUND, 49 46 ERROR_TO_READ_FILE_PROPERTIES, 50 ERROR_TO_REMOVE_USER, 51 ERROR_USERS_CREATION 47 IO_EXCEPTION_ERROR 52 48 } 53 49 -
ether_statistics/web/src/com/ether/WebHelper.java
r587 r667 2 2 3 3 import com.ether.WebException.WebCode; 4 import com.ether. user.User;4 import com.ether.account.Account; 5 5 import net.sf.json.JSONObject; 6 6 import org.apache.commons.logging.Log; … … 86 86 final JSONObject jSONPeople = new JSONObject(); 87 87 88 final User user = (User) request.getSession().getAttribute( "SES_USER" );89 if( null == user)88 final Account account = (Account) request.getSession().getAttribute( "SES_ACCOUNT" ); 89 if( null == account ) 90 90 return null; 91 91 92 jSONPeople.put( "name", user.getLastName() ); 93 jSONPeople.put( "firstName", user.getFirstName() ); 94 jSONPeople.put( "role", user.getRole() ); 92 jSONPeople.put( "name", account.getName() ); 93 jSONPeople.put( "role", account.getRole() ); 95 94 return jSONPeople; 96 95 } -
ether_statistics/web/src/messages_en.properties
r654 r667 8 8 label.firstname=First name 9 9 label.lastname=Last name 10 label.login=Login 11 label.pwd=Password 10 12 label.help=Help 11 label.help.content=All slides and objects on this site are <B>draggable</B>. You can move them to arrange your own desktop.<BR/>To do some actions such as log inor select a logo, please use the <B>double click</B> !13 label.help.content=All slides and objects on this site are <B>draggable</B>. You can move them to arrange your own desktop.<BR/>To do some actions such as logout or select a logo, please use the <B>double click</B> ! 12 14 label.display.actions=Display actions 13 15 label.actions=Actions 14 16 label.mentions=Mentions 15 17 label.credits=Credits 16 label.export=Export PDF 18 label.print=Print 19 label.unknown=Unknown 17 20 18 21 statistics.online=Online since … … 40 43 statistics.distribution.download=Downloads distribution 41 44 statistics.map.distribution=Geographic distribution 45 46 error.connection.need=Please connect to access to statistics 47 error.login.failed=Error to connect 48 ERROR_LOGIN_NOT_FOUND=Error : unknown login 49 ERROR_PASSWORD=Error : wrong password 50 ERROR_ENCRYPT_PASSWORD=Error : password can't be encrypted -
ether_statistics/web/src/messages_fr.properties
r654 r667 8 8 label.firstname=Prénom 9 9 label.lastname=Nom 10 label.login=Login 11 label.pwd=Mot de passe 10 12 label.help=Aide 11 label.help.content=Tous les objets de ce site sont <B>déplacables</B>, vous pouvez donc ainsi arranger leur positionnement à votre convenance. <BR/>Pour effectuer des actions telles login ou sélection d\'un projet via son logo, veuillez utiliser le <B>double click</B> !13 label.help.content=Tous les objets de ce site sont <B>déplacables</B>, vous pouvez donc ainsi arranger leur positionnement à votre convenance. <BR/>Pour effectuer des actions telles déconnexion ou sélection d\'un projet via son logo, veuillez utiliser le <B>double click</B> ! 12 14 label.display.actions=Afficher les actions 13 15 label.actions=Actions 14 16 label.mentions=Mentions 15 17 label.credits=Crédits 16 label.export=Export PDF 18 label.print=Imprimer 19 label.unknown=Inconnu 17 20 18 21 statistics.online=En ligne depuis le … … 40 43 statistics.distribution.download=Répartition des téléchargements 41 44 statistics.map.distribution=Répartition géographique 45 46 error.connection.need=Veuillez tout d'abord vous connecter 47 error.login.failed=Erreur de connexion 48 ERROR_LOGIN_NOT_FOUND=Erreur : login inconnu 49 ERROR_PASSWORD=Erreur : mot de passe incorrect 50 ERROR_ENCRYPT_PASSWORD=Erreur d'encryptage du mot de passe -
ether_statistics/web/src/statistics.properties
r580 r667 1 1 mail.host=mailhost.ipsl.jussieu.fr 2 2 mail.webmaster=vmipsl@ipsl.jussieu.fr 3 downloadPath=/home_local/4 service_path=/home_local/workspaces/5 src_path=/home_local/workspaces/statistics/6 data_path=/home_local/workspaces/7
Note: See TracChangeset
for help on using the changeset viewer.