Changeset 654 for ether_statistics/web


Ignore:
Timestamp:
10/31/12 15:13:40 (12 years ago)
Author:
vmipsl
Message:

statistics

Location:
ether_statistics/web
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • ether_statistics/web/WEB-INF/servlet-context.xml

    r575 r654  
    3737        <property name="mappings"> 
    3838            <props> 
    39                 <prop key="/data">controllerStatistics</prop> 
     39                <prop key="/statistic">controllerStatistics</prop> 
    4040                <prop key="/project">controllerEponge</prop> 
    4141            </props> 
  • ether_statistics/web/WEB-INF/web.xml

    r575 r654  
    4747    <servlet-mapping> 
    4848        <servlet-name>eponge</servlet-name> 
    49         <url-pattern>/data</url-pattern> 
     49        <url-pattern>/statistic</url-pattern> 
    5050    </servlet-mapping> 
    5151 
  • ether_statistics/web/index.jsp

    r586 r654  
    11<%--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/statistics-script.jsp

    r596 r654  
    1010        this.parent = $( "#containerMiddle" ); 
    1111        this.containerMenu = $( "#menuCircle" ); 
     12        this.containerErrors = $( "#errors" ); 
    1213 
    1314        /** *********** VARIABLES *********** **/ 
     
    3637        this.widthInitMentionsOrCredits = $( "#mentions" ).width(); 
    3738 
     39        this.xArray = ["2010-10", "2010-11", "2010-12", "2011-01", "2011-02"]; 
     40        this.yArray = [0, 10, 30, 50, 100]; 
     41 
     42 
    3843        this.bindButtons(); 
    3944        this.createDraggableSlides(); 
     
    4752            this.bindMenuCircle(); 
    4853            // Slides 
    49             this.onClickHelp(); 
     54//            this.onClickHelp(); 
    5055            this.selectedLogo = $( "#ETHER" )[0]; 
     56            this.isSelectedLogoEther = true; 
    5157            this.onClickLogo(); 
    52 //            this.hideHelp(); 
     58 
     59            this.changeRightSlide(); 
    5360        }, this ) ); 
    5461    }, 
     
    102109        this.middleSlide = new DragSlide( {id:"middle", parent:this.parent, width:"430", height:"430", top:"140px", left:"245px", 
    103110            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
    104         this.middleSlide.setTitle( '<spring:message code="statistics.evolution"/>' ); 
    105111 
    106112        this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"200", height:"300", top:"180px", left:"698px", 
    107113            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
    108  
    109         var linechart = $( document.createElement( "div" ) ); 
    110         linechart.addClass( "ui-widget ui-widget-content ui-corner-all statisticsEther" ); 
    111         linechart.attr( {id:"wijlinechart"} ); 
    112         this.middleSlide.getDivContent().append( linechart ); 
    113  
    114         var barchart = $( document.createElement( "div" ) ); 
    115         barchart.addClass( "ui-widget ui-widget-content ui-corner-all statisticsEther" ); 
    116         barchart.attr( {id:"wijbarchart"} ); 
    117         this.middleSlide.getDivContent().append( barchart ); 
    118  
    119         this.createLinechart(); 
    120 //        this.createBarchart(); 
    121114    }, 
    122115 
     
    133126    }, 
    134127 
     128    requestDataByLogo: function() 
     129    { 
     130        if( !this.selectedLogo && !this.selectedLogo.id ) 
     131            return; 
     132 
     133        $.ajax( { 
     134            url: "statistic?methodName=searchMainStatisticsByProject&name=" + this.selectedLogo.id, 
     135            success:jQuery.proxy( this.handleDataByLogo, this ), 
     136            error: jQuery.proxy( this.showErrors, [this] ) 
     137        } ); 
     138    }, 
     139 
    135140    // HANDLES ******************************************************** = retours ajax 
    136     handleCreateXML: function( result ) 
    137     { 
    138         this.loadingRequest.hide(); 
    139         //this.loadingRequest.display(); 
    140  
    141         var res = jQuery.parseJSON( result ).result; 
    142         alert( res ); 
    143     }, 
    144  
     141    handleDataByLogo: function( result ) 
     142    { 
     143        this.changeLeftTopSlide(); 
     144        this.changeLeftMiddleSlide(); 
     145        this.changeLeftBottomSlide(); 
     146        this.displayVisitEvolution(); 
     147    }, 
    145148 
    146149    // EVENTS ******************************************************** 
     
    199202    onClickLogo: function() 
    200203    { 
    201         if( !this.selectedLogo ) 
    202             return; 
    203  
    204         this.changeLeftTopSlide(); 
    205         this.changeLeftMiddleSlide(); 
    206         this.changeLeftBottomSlide(); 
     204        this.isSelectedLogoEther = (this.selectedLogo == $( "#ETHER" )[0]); 
     205        this.requestDataByLogo(); 
     206    }, 
     207 
     208    onClickExport: function() 
     209    { 
     210        $( "#containerMiddle" ).printPreview(); 
     211//        $("#containerMiddle").jqprint(); 
     212 
     213//        var printContent =$( "#containerMiddle" ); 
     214//        var windowUrl = 'about:blank'; 
     215//        var windowName = 'Print'; 
     216//        var printWindow = window.open( windowUrl, windowName, 'left=50000,top=50000,width=0,height=0' ); 
     217//        printWindow.document.write( "slkdfjlsdkfjsdlf" ); 
     218//        printWindow.document.close(); 
     219//        printWindow.focus(); 
     220//        printWindow.print(); 
     221//        printWindow.close(); 
     222// 
     223        // TODO export PDF 
    207224    }, 
    208225 
    209226    // OTHERS ******************************************************** 
     227    showErrors: function( result ) 
     228    { 
     229        var context = this[0] ? this[0] : this; 
     230        var text = this[1]; 
     231        context.containerErrors.show(); 
     232//        if( text ) 
     233//            context.containerErrors.html( interfaceTexts[result.responseText] + " " + text ); 
     234//        else if( interfaceTexts[result.responseText] ) 
     235//            context.containerErrors.html( interfaceTexts[result.responseText] ); 
     236        if( result.responseText ) 
     237            context.containerErrors.html( result.responseText ); 
     238        else 
     239            context.containerErrors.html( result ); 
     240    }, 
     241 
    210242    reduceLogin: function() 
    211243    { 
     
    325357    }, 
    326358 
    327 //    hideHelp: function() 
    328 //    { 
    329 //        this.rightSlide.getDivContent().animate( 
    330 //        { 
    331 //            opacity: 0 
    332 //        }, 10000, jQuery.proxy( function() 
    333 //        { 
    334 //            this.changeRightSlide(); 
    335 //            this.rightSlide.getDivContent().attr( {style:"opacity:1"} ); 
    336 //        }, this ) ); 
    337 //    }, 
    338 // 
    339359    changeLeftTopSlide: function() 
    340360    { 
    341         this.leftTopSlide.setTitle( this.selectedLogo.id + ' <spring:message code="title"/>' ); 
     361        this.leftTopSlide.setTitle( '<spring:message code="title"/> : ' + this.selectedLogo.id ); 
    342362        this.leftTopSlide.setContent( 
    343363                "<spring:message code="statistics.online"/> : 2006/05/08<BR/>" + 
    344                         "<span class='text1'><spring:message code="statistics.since"/> : 2009/05/08<BR/></span>" + 
     364                        "<span class='text1'><spring:message code="statistics.since"/> : 2009/05/08<BR/><BR/></span>" + 
    345365                        "<spring:message code="statistics.user.registered"/> : 1500<BR/>" + 
    346                         "<spring:message code="statistics.user.connected"/> : 17<BR/>" + 
    347                         "<spring:message code="statistics.visit"/> : 150<BR/>" + 
    348                         "<spring:message code="statistics.email"/> : 15<BR/>" ); 
     366                        "<spring:message code="statistics.visit"/> : 150<BR/>" ); 
    349367    }, 
    350368 
     
    362380    { 
    363381        this.rightSlide.setTitle( '<spring:message code="label.actions"/>' ); 
    364         this.rightSlide.setContent( "pouif" ); 
    365     }, 
     382        this.rightSlide.getDivContent().empty(); 
     383        new Button( {value:"<spring:message code="statistics.visit"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayVisitEvolution, this )} ); 
     384        new Button( {value:"<spring:message code="statistics.user.registered"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayRegisteredUserEvolution, this )} ); 
     385        new Button( {value:"<spring:message code="statistics.user.connected"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayConnectedUserEvolution, this )} ); 
     386        new Button( {value:"<spring:message code="statistics.data.download"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayDownloadEvolution, this )} ); 
     387        new Button( {value:"<spring:message code="statistics.map.distribution"/>", parent:this.rightSlide.getDivContent(), className: "positive action_button", onClick:jQuery.proxy( this.displayMapDistribution, this )} ); 
     388        new Button( {value:"<spring:message code="label.export"/>", parent:this.rightSlide.getDivContent(), className: "blue export_button", onClick:jQuery.proxy( this.onClickExport, this )} ); 
     389    }, 
     390 
     391    changeMiddleSlide: function( titleEvolution, titleDistribution ) 
     392    { 
     393        if( this.isSelectedLogoEther ) 
     394            this.middleSlide.setTitle( '<spring:message code="statistics.evolution.distribution"/> : ' + this.selectedLogo.id ); 
     395        else 
     396            this.middleSlide.setTitle( '<spring:message code="statistics.evolution"/> : ' + this.selectedLogo.id ); 
     397        this.middleSlide.getDivContent().empty(); 
     398 
     399        var linechart = $( document.createElement( "div" ) ); 
     400        linechart.addClass( "ui-widget ui-widget-content ui-corner-all statisticsEther" ); 
     401        linechart.attr( {id:"wijlinechart"} ); 
     402        this.middleSlide.getDivContent().append( linechart ); 
     403 
     404        var donut = $( document.createElement( "div" ) ); 
     405        donut.addClass( "ui-widget ui-widget-content ui-corner-all statisticsEther" ); 
     406        donut.attr( {id:"wijpiechart"} ); 
     407        this.middleSlide.getDivContent().append( donut ); 
     408 
     409        this.createLinechart( titleEvolution ); 
     410        if( this.isSelectedLogoEther ) 
     411            this.createDonut( titleDistribution ); 
     412    }, 
     413 
     414    changeMiddleSlideForMap: function() 
     415    { 
     416        this.middleSlide.setTitle( '<spring:message code="statistics.map.distribution"/> : ' + this.selectedLogo.id ); 
     417        this.middleSlide.getDivContent().empty(); 
     418    }, 
     419 
    366420 
    367421    // STATISTICS ******************************************************** 
    368     createBarchart: function() 
    369     { 
    370         $( "#wijbarchart" ).wijbarchart( { 
    371             axis: { 
    372                 y: { 
    373                     text: "Total Hardware" 
    374                 }, 
    375                 x: { 
    376                     text: "", 
    377                     labels: { 
    378                         style: { 
    379                             rotation: -45 
    380                         } 
    381                     } 
    382                 } 
    383             }, 
     422    createDonut: function( title ) 
     423    { 
     424        $( "#wijpiechart" ).wijpiechart( { 
     425            height: 210, 
     426            width: 400, 
     427            radius: 140, 
     428            legend: { visible: true }, 
    384429            hint: { 
    385430                content: function () 
    386431                { 
    387                     return this.data.label + '\n ' + this.y + ''; 
     432                    return this.data.label + " : " + Globalize.format( this.value / this.total, "p2" ); 
    388433                } 
    389434            }, 
    390435            header: { 
    391                 text: "Console Wars" 
     436                text: title 
    392437            }, 
    393438            seriesList: [ 
    394439                { 
    395                     label: "US", 
     440                    label: "MacBook Pro", 
    396441                    legendEntry: true, 
    397                     data: { x: ['PS3', 'XBOX360', 'Wii'], y: [12.35, 21.50, 30.56] } 
     442                    data: 46.78, 
     443                    offset: 0 
     444                }, 
     445                { 
     446                    label: "iMac", 
     447                    legendEntry: true, 
     448                    data: 23.18, 
     449                    offset: 0 
     450                }, 
     451                { 
     452                    label: "MacBook", 
     453                    legendEntry: true, 
     454                    data: 20.25, 
     455                    offset: 0 
     456                }, 
     457                { 
     458                    label: "Mac Pro", 
     459                    legendEntry: true, 
     460                    data: 5.41, 
     461                    offset: 0 
     462                }, 
     463                { 
     464                    label: "Mac mini", 
     465                    legendEntry: true, 
     466                    data: 3.44, 
     467                    offset: 0 
    398468                } 
    399469            ], 
    400470            seriesStyles: [ 
    401471                { 
    402                     fill: "#8ede43", stroke: "#7fc73c", opacity: 0.8 
    403                 } 
    404             ], 
    405             seriesHoverStyles: [ 
    406                 { 
    407                     "stroke-width": "1.5", opacity: 1 
     472                    fill: "180-rgb(195,255,0)-rgb(175,229,0)", stroke: "rgb(175,229,0)", "stroke-width": 1.5 
     473                }, 
     474                { 
     475                    fill: "90-rgb(142,222,67)-rgb(127,199,60)", stroke: "rgb(127,199,60)", "stroke-width": 1.5 
     476                }, 
     477                { 
     478                    fill: "90-rgb(106,171,167)-rgb(95,153,150)", stroke: "rgb(95,153,150)", "stroke-width": 1.5 
     479                }, 
     480                { 
     481                    fill: "90-rgb(70,106,133)-rgb(62,95,119)", stroke: "rgb(62,95,119)", "stroke-width": 1.5 
     482                }, 
     483                { 
     484                    fill: "90-rgb(166,166,166)-rgb(149,149,149)", stroke: "rgb(149,149,149)", "stroke-width": 1.5 
    408485                } 
    409486            ] 
     
    411488    }, 
    412489 
    413     createLinechart: function() 
    414     { 
    415         var xArray = ["2010-10", "2010-11", "2010-12", "2011-01", "2011-02"]; 
    416         var yArray = [0, 10, 30, 50, 100]; 
     490    createLinechart: function( title ) 
     491    { 
    417492        $( "#wijlinechart" ).wijlinechart( { 
    418493            height: 200, 
     
    425500            showChartLabels: false, 
    426501            header: { 
    427                 text: "<spring:message code="statistics.evolution.visit"/>" 
     502                text: title 
    428503            }, 
    429504            hint: { 
     
    440515            seriesList: [ 
    441516                { 
    442                     label: "<spring:message code="statistics.visit"/>", 
     517                    label: "", 
    443518                    legendEntry: true, 
    444519                    data: { 
    445                         x: xArray, 
    446                         y: yArray 
     520                        x: this.xArray, 
     521                        y: this.yArray 
    447522                    }, 
    448523                    markers: { 
     
    453528            ] 
    454529        } ); 
     530    }, 
     531 
     532    displayVisitEvolution: function() 
     533    { 
     534        this.changeMiddleSlide( '<spring:message code="statistics.evolution.visit"/>', '<spring:message code="statistics.distribution.visit"/>' ); 
     535    }, 
     536 
     537    displayRegisteredUserEvolution: function() 
     538    { 
     539        this.changeMiddleSlide( '<spring:message code="statistics.evolution.user.registered"/>', '<spring:message code="statistics.distribution.user.registered"/>' ); 
     540    }, 
     541 
     542    displayConnectedUserEvolution: function() 
     543    { 
     544        this.changeMiddleSlide( '<spring:message code="statistics.evolution.user.connected"/>', '<spring:message code="statistics.distribution.user.connected"/>' ); 
     545    }, 
     546 
     547    displayDownloadEvolution: function() 
     548    { 
     549        this.changeMiddleSlide( '<spring:message code="statistics.evolution.download"/>', '<spring:message code="statistics.distribution.download"/>' ); 
     550    }, 
     551 
     552    displayMapDistribution: function() 
     553    { 
     554        this.changeMiddleSlideForMap(); 
    455555    } 
    456556 
  • ether_statistics/web/project/statistics.jsp

    r596 r654  
    3636    <ether:htmlJsp jspFile="statistics-script"/> 
    3737 
     38    <%--<ether:htmlCss cssFile="etimbo-jquery-print-preview-plugin/960"/>--%> 
     39    <%--<ether:htmlCss cssFile="etimbo-jquery-print-preview-plugin/screen"/>--%> 
     40    <ether:htmlCss cssFile="etimbo-jquery-print-preview-plugin/print"/> 
     41    <ether:htmlCss cssFile="etimbo-jquery-print-preview-plugin/print-preview"/> 
     42    <%--<script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>--%> 
     43    <ether:htmlJs jsFile="etimbo-jquery-print-preview-plugin/src/jquery.print-preview"/> 
    3844</HEAD> 
    3945 
     
    4147 
    4248<div class="pageWrapper"> 
     49 
     50    <div id="aside" class="grid_3 push_1"> 
     51    </div> 
    4352 
    4453    <%-- ****************** TITLE & TOOLS ****************** --%> 
     
    8089        <div id="credits" class="containerToDrag"> 
    8190            <img id="credits_bg" src='resources/images/cloud.png' width="59px" height="42px"/> 
     91 
    8292            <div id="credits_title"><spring:message code="label.credits"/></div> 
    8393            <div id="credits_text"></div> 
     
    8696        <div id="mentions" class="containerToDrag"> 
    8797            <img id="mentions_bg" src='resources/images/cloud.png' width="59px" height="42px"/> 
     98 
    8899            <div id="mentions_title"><spring:message code="label.mentions"/></div> 
    89100            <div id="mentions_text"></div> 
     
    96107    <div id="containerMiddle"></div> 
    97108 
     109    <div id="errors"></div> 
     110 
    98111    <script type="text/javascript"> 
    99112        var texts = $A( "" ); 
  • ether_statistics/web/resources/css/statistics.css

    r596 r654  
    9090    padding: 10px; 
    9191    margin: 10px; 
     92    float: right; 
     93    display:none; 
    9294} 
    9395 
     
    262264    margin-top: 35px; 
    263265} 
     266 
     267.action_button { 
     268    width: 95%; 
     269    margin: 3px; 
     270} 
     271 
     272.export_button { 
     273    float: right; 
     274    margin: 20px 6px 0 0; 
     275} 
  • ether_statistics/web/src/messages_en.properties

    r596 r654  
    99label.lastname=Last name 
    1010label.help=Help 
    11 label.help.content=All slides and objects on this site are draggable. You can move them to arrange your own desktop.<BR/>To do some actions such as login or select a logo, please use the double click ! 
     11label.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 login or select a logo, please use the <B>double click</B> ! 
    1212label.display.actions=Display actions 
    1313label.actions=Actions 
    1414label.mentions=Mentions 
    1515label.credits=Credits 
     16label.export=Export PDF 
    1617 
    1718statistics.online=Online since 
     
    2930 
    3031statistics.evolution=Statistics evolution 
     32statistics.evolution.distribution=Statistics evolution and distribution 
    3133statistics.evolution.visit=Visited pages evolution 
    32 statistics.evolution.user.registered=Visited pages evolution 
    33 statistics.evolution.user.connected=Visited pages evolution 
    34 statistics.evolution.download=Visited pages evolution 
     34statistics.distribution.visit=Visited pages distribution 
     35statistics.evolution.user.registered=Registered users evolution 
     36statistics.distribution.user.registered=Registered users distribution 
     37statistics.evolution.user.connected=Connected users evolution 
     38statistics.distribution.user.connected=Connected users distribution 
     39statistics.evolution.download=Downloads evolution 
     40statistics.distribution.download=Downloads distribution 
    3541statistics.map.distribution=Geographic distribution 
  • ether_statistics/web/src/messages_fr.properties

    r596 r654  
    99label.lastname=Nom 
    1010label.help=Aide 
    11 label.help.content=Tous les objets de ce site sont déplacables, 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 double click ! 
     11label.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> ! 
    1212label.display.actions=Afficher les actions 
    1313label.actions=Actions 
    1414label.mentions=Mentions 
    1515label.credits=Crédits 
     16label.export=Export PDF 
    1617 
    1718statistics.online=En ligne depuis le 
     
    2930 
    3031statistics.evolution=Evolution des statistiques 
     32statistics.evolution.distribution=Evolution et répartition des statistiques 
    3133statistics.evolution.visit=Evolution des pages visitées 
     34statistics.distribution.visit=Répartition des pages visitées 
    3235statistics.evolution.user.registered=Evolution des utilisateurs enregistrés 
     36statistics.distribution.user.registered=Répartition des utilisateurs enregistrés 
    3337statistics.evolution.user.connected=Evolution des utilisateurs connectés 
     38statistics.distribution.user.connected=Répartition des utilisateurs connectés 
    3439statistics.evolution.download=Evolution des téléchargements 
     40statistics.distribution.download=Répartition des téléchargements 
    3541statistics.map.distribution=Répartition géographique 
Note: See TracChangeset for help on using the changeset viewer.