Changeset 534


Ignore:
Timestamp:
02/16/11 18:57:31 (2 years ago)
Author:
philsmart
Message:
 
Location:
raptor-web/trunk/src/main
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • raptor-web/trunk/src/main/java/uk/ac/cardiff/raptorweb/engine/ChartProcessor.java

    r533 r534  
    6161    private Resource baseDirectory; 
    6262 
     63    /* allows chart name flip flop, to stop the browser from rendering an image from cache*/ 
     64    boolean flipFlopChartName; 
     65 
    6366    /* allows for selection of graph type */ 
    6467    public enum GraphType { 
     
    200203 
    201204        //must create a random number, if the image url does not change, the browser uses the cached image 
    202         int ran = ((int)(Math.random()*10)); 
     205        int ran = getRandomChartFileExtension(100); 
    203206 
    204207        File chartLocation = new File(getRootDirectory(user) + "/raptor-graphs-main"+endingFilename+".svg"); 
     
    209212            try { 
    210213                int padding = 5; 
     214                log.debug("Writing PNG to {}",chartLocationPNG); 
    211215                ImageIO.write(ChartProcessorHelper.buildChartDropShadow(chart.createBufferedImage(width - (padding * 2), height - (padding * 2)), padding), "png", new FileOutputStream(chartLocationPNG)); 
    212216            } catch (IOException e) { 
     
    230234        chartmodel.setRelativeChartLocation(getRelativePath(chartLocationPNG)); 
    231235        return chartmodel; 
     236    } 
     237 
     238    private int getRandomFlipFlopChartFileExtension(){ 
     239        if (flipFlopChartName){ 
     240            flipFlopChartName=false; 
     241            return 0; 
     242        } 
     243        else { 
     244            flipFlopChartName=true; 
     245            return 1; 
     246        } 
     247    } 
     248 
     249    private int getRandomChartFileExtension(int upperLimit){ 
     250        int ran = ((int)(Math.random()*upperLimit)); 
     251        return ran; 
    232252    } 
    233253 
     
    248268 
    249269        // axis 
    250         CategoryAxis rangeAxis = (CategoryAxis) plot.getDomainAxis(); 
    251         rangeAxis.setUpperMargin(0.0); 
    252         rangeAxis.setLowerMargin(0.0); 
     270        CategoryAxis domainAxis = (CategoryAxis) plot.getDomainAxis(); 
     271        domainAxis.setUpperMargin(0.0); 
     272        domainAxis.setLowerMargin(0.0); 
     273        domainAxis.setUpperMargin(0.0); 
     274        domainAxis.setLowerMargin(0.0); 
     275        domainAxis.setLabelFont(new Font("SansSerif",Font.PLAIN,10)); 
     276        domainAxis.setTickLabelFont(new Font("SansSerif",Font.PLAIN,10)); 
    253277 
    254278    } 
     
    274298        domainAxis.setUpperMargin(0.0); 
    275299        domainAxis.setLowerMargin(0.0); 
    276         domainAxis.setLabelFont(new Font("SansSerif",Font.PLAIN,0)); 
    277         domainAxis.setTickLabelFont(new Font("SansSerif",Font.PLAIN,0)); 
     300        domainAxis.setLabelFont(new Font("SansSerif",Font.PLAIN,7)); 
     301        domainAxis.setTickLabelFont(new Font("SansSerif",Font.PLAIN,7)); 
    278302 
    279303    } 
  • raptor-web/trunk/src/main/java/uk/ac/cardiff/raptorweb/service/impl/StartServiceImpl.java

    r533 r534  
    225225            } 
    226226            if (numberOfAuthenticationsPerIntervalNumberModel != null) { 
    227                 RaptorJFreeChartModel jfreeChart = getChartProcessor().constructJFreeGraph(GraphPresentation.FRONT,GraphType.AREA,numberOfAuthenticationsPerIntervalNumberModel,1270,300,(chosenStartTime.toString("ddMMyyyHH-mm")+"-"+currentDateTime.toString("ddMMyyyHH-mm"))); 
     227                RaptorJFreeChartModel jfreeChart = getChartProcessor().constructJFreeGraph(GraphPresentation.FRONT,GraphType.AREA,numberOfAuthenticationsPerIntervalNumberModel,1270,350,(chosenStartTime.toString("ddMMyyyHH-mm")+"-"+currentDateTime.toString("ddMMyyyHH-mm"))); 
    228228                startstats.setHeadlineGraph(jfreeChart); 
    229229            } 
  • raptor-web/trunk/src/main/webapp/WEB-INF/config/web-setup.xml

    r527 r534  
    8484                        <ref local="SystemStatsJobDetail" /> 
    8585                </property> 
    86                 <property name="startDelay" value="500"/> 
    87                 <property name="repeatInterval" value="3000000"/> 
     86                <property name="startDelay" value="5000"/> 
     87                <property name="repeatInterval" value="600000"/> 
    8888        </bean> 
    8989 
  • raptor-web/trunk/src/main/webapp/WEB-INF/flows/reports/graphicalReports.xhtml

    r531 r534  
    1212 
    1313        <ui:define name="content"> 
    14            <a4j:include viewId="working-panel.xhtml" /> 
     14                <a4j:include viewId="working-panel.xhtml" /> 
    1515                <rich:layout> 
    1616 
    1717                        <rich:layoutPanel position="top"> 
    18  
     18                                <a4j:status id="stateStatus" startText="Working..." 
     19                                startStyle="background-color:#ADDFFF;  font-weight:bold;  position: absolute;  right: 5px;  top: 1px;  width: 80px;" /> 
    1920 
    2021                                <rich:simpleTogglePanel switchType="client" label="Control Panel" 
     
    4546                                                                                        value="#{unit.statisticalUnitInformation.statisticParameters.unitName}" 
    4647                                                                                        action="invokeStatisticalUnit" 
    47                                                                                         reRender="chartForm,graphImage,optionsPanel,ControlPanelForm" 
    48                                                                                         onclick="#{rich:component('workingPanel')}.show();" 
    49                                             oncomplete="#{rich:component('workingPanel')}.hide();"> 
     48                                                                                        reRender="chartForm,graphImage,optionsPanel,ControlPanelForm"> 
    5049                                                                                        <f:setPropertyActionListener value="#{unit}" 
    5150                                                                                                target="#{flowScope.websession.graphmodel.selectedStatisticalUnit}" /> 
     
    136135                                                                                <f:facet name="footer"> 
    137136                                                                                        <h:panelGroup style="display:block; text-align:center"> 
    138                                                                                                 <a4j:commandButton ajaxSingle="false" value="update" 
    139                                                                                                         reRender="chartForm, ControlPanelForm" 
    140                                                                                                         onclick="#{rich:component('workingPanel')}.show();"> 
     137                                                                                                <a4j:commandButton ajaxSingle="false" value="update"> 
    141138                                                                                                        <!--  added the support here, as the command button needs to submit the form properties, which it only does 
    142139                                                                                                        with ajaxSingle="false", then invoke the action, which only happens when ajaxSingle="true" --> 
    143                                                                                                         <a4j:support ajaxSingle="true" event="oncomplete" oncomplete ="#{rich:component('workingPanel')}.hide();" action="updateMUAStatistic" reRender="optionsPanelForm,controlPanelForm, chartForm" /> 
     140                                                                                                        <a4j:support ajaxSingle="true" event="oncomplete" 
     141                                                                                                                action="updateMUAStatistic" 
     142                                                                                                                reRender="optionsPanelForm,controlPanelForm, chartForm" /> 
    144143 
    145144                                                                                                </a4j:commandButton> 
     
    197196                                                                <rich:columns 
    198197                                                                        value="#{flowScope.websession.graphmodel.currentTableGraph.series}" 
    199                                                                         var="columns" index="index" id="column#{index}"> 
     198                                                                        var="columns" index="index" id="column#{index}" 
     199                                                                        filterBy="#{columns}" filterEvent="onkeyup"> 
    200200                                                                        <f:facet name="header"> 
    201201                                                                                <h:outputText value="#{columns}" /> 
  • raptor-web/trunk/src/main/webapp/WEB-INF/flows/reports/reports-flow.xml

    r523 r534  
    8181 
    8282 
    83         <view-state id="setupRaptorWeb" view="setupRaptorWeb.jspx"> 
     83        <view-state id="setupRaptorWeb" view="setupRaptorWeb.xhtml"> 
    8484                <!-- used to help with the setup configuration --> 
    8585                <transition on="graphTrans" to="graphicalReports" /> 
  • raptor-web/trunk/src/main/webapp/WEB-INF/flows/reports/setupRaptorWeb.xhtml

    r533 r534  
    1 <?xml version="1.0" encoding="ISO-8859-1"?> 
    2  
    3 <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0" 
     1<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     3<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
    44        xmlns:ui="http://java.sun.com/jsf/facelets" 
    55        xmlns:h="http://java.sun.com/jsf/html" 
    66        xmlns:f="http://java.sun.com/jsf/core" 
    7         xmlns:tr="http://myfaces.apache.org/trinidad" 
    8         xmlns:c="http://java.sun.com/jstl/core"> 
     7        xmlns:c="http://java.sun.com/jstl/core" 
     8        xmlns:sf="http://www.springframework.org/tags/faces" 
     9        xmlns:a4j="http://richfaces.org/a4j" 
     10        xmlns:rich="http://richfaces.org/rich" 
     11        template="/templates/raptor/full.xhtml"> 
    912 
    10         <ui:composition template="/templates/raptor/full.xhtml"> 
     13        <ui:define name="content"> 
     14                <a4j:form id="setupForm"> 
     15                        <rich:tabPanel id="setupTabPanel" height="450" selectedTab="graph" 
     16                                switchType="client"> 
    1117 
    12                 <ui:define name="content"> 
    13                         <tr:form id="mainForm"> 
    14                                 <tr:panelTabbed position="above"> 
    15                                         <tr:showDetailItem text="Aggregator Setup"> 
    16                                                 <tr:panelHeader text="Aggregators" /> 
     18                                <rich:tab name="aggregatorSetup" label="Aggregator Setup"> 
    1719 
    18                                                 <tr:panelFormLayout rows="6" labelWidth="5%"> 
    19                                                         <br /> 
    20                                                         <tr:table value="#{setupService.attached}" bandingInterval="2" 
    21                                                                 banding="row" var="attached" width="90%"> 
    22                                                                 <tr:column> 
    23                                                                         <f:facet name="header"> 
    24                                                                                 <tr:outputText value="Aggregator Location" /> 
    25                                                                         </f:facet> 
    26                                                                         <tr:outputText value="#{attached.serviceEndpoint}" /> 
    27                                                                 </tr:column> 
    28                                                                 <tr:column align="center"> 
    29                                                                         <f:facet name="header"> 
    30                                                                                 <tr:outputText value="Attached" /> 
    31                                                                         </f:facet> 
    32                                                                         <tr:outputText value="#{attached.isAttached}" /> 
    33                                                                 </tr:column> 
    34                                                                 <tr:column align="center"> 
    35                                                                         <f:facet name="header"> 
    36                                                                                 <tr:outputText value="Actions" /> 
    37                                                                         </f:facet> 
    38                                                                         <tr:commandLink text="Attach" action="attachMUA"> 
    39                                                                                 <f:setPropertyActionListener value="#{attached}" 
    40                                                                                         target="#{flowScope.websession.setupmodel.selectedEndpoint}" /> 
    41                                                                         </tr:commandLink> 
    42                                                                 </tr:column> 
    43                                                                 <tr:column> 
    44                                                                         <f:facet name="header"> 
    45                                                                                 <tr:outputText value="Statistical Capabilities" /> 
    46                                                                         </f:facet> 
    47                                                                         <tr:commandLink action="getAggregatorCapabilities" 
    48                                                                                 text="Check Now" 
    49                                                                                 rendered="#{empty flowScope.websession.setupmodel.selectEndpointCapabilities.statisticalServices}"> 
    50                                                                                 <f:setPropertyActionListener value="#{attached}" 
    51                                                                                         target="#{flowScope.websession.setupmodel.selectedEndpoint}" /> 
    52                                                                         </tr:commandLink> 
    53                                                                         <tr:panelList rows="2" 
    54                                                                                 rendered="#{flowScope.websession.setupmodel.selectEndpointCapabilities.error}"> 
    55                                                                                 <tr:outputText 
    56                                                                                         value="ERROR: #{flowScope.websession.setupmodel.selectEndpointCapabilities.errorMessage}" 
    57                                                                                         text="#{flowScope.websession.setupmodel.selectEndpointCapabilities.errorMessage}" /> 
    58                                                                         </tr:panelList> 
    59                                                                         <tr:panelList rows="10" 
    60                                                                                 rendered="#{not empty flowScope.websession.setupmodel.selectEndpointCapabilities.statisticalServices}"> 
    61                                                                                 <c:forEach var="item" 
    62                                                                                         items="#{flowScope.websession.setupmodel.selectEndpointCapabilities.statisticalServices}"> 
    63                                                                                         <tr:outputText value="* #{item.statisticParameters.unitName}" 
    64                                                                                                 text="#{item.statisticParameters.unitName}" /> 
    65                                                                                 </c:forEach> 
     20                                        <h:panelGrid> 
     21                                                <rich:spacer height="15px" /> 
     22                                                <rich:spacer width="30%" /> 
     23                                                <rich:dataTable value="#{setupService.attached}" 
     24                                                        bandingInterval="2" banding="row" var="attached" width="90%"> 
     25                                                        <rich:column> 
     26                                                                <f:facet name="header"> 
     27                                                                        <h:outputText value="Aggregator Location" /> 
     28                                                                </f:facet> 
     29                                                                <h:outputText value="#{attached.serviceEndpoint}" /> 
     30                                                        </rich:column> 
     31                                                        <rich:column align="center"> 
     32                                                                <f:facet name="header"> 
     33                                                                        <h:outputText value="Attached" /> 
     34                                                                </f:facet> 
     35                                                                <h:outputText value="#{attached.isAttached}" /> 
     36                                                        </rich:column> 
     37                                                        <rich:column align="center"> 
     38                                                                <f:facet name="header"> 
     39                                                                        <h:outputText value="Actions" /> 
     40                                                                </f:facet> 
     41                                                                <h:commandLink value="Attach" action="attachMUA"> 
     42                                                                        <f:setPropertyActionListener value="#{attached}" 
     43                                                                                target="#{flowScope.websession.setupmodel.selectedEndpoint}" /> 
     44                                                                </h:commandLink> 
     45                                                        </rich:column> 
     46                                                        <rich:column> 
     47                                                                <f:facet name="header"> 
     48                                                                        <h:outputText value="Statistical Capabilities" /> 
     49                                                                </f:facet> 
     50                                                                <h:commandLink action="getAggregatorCapabilities" 
     51                                                                        value="Check Now" 
     52                                                                        rendered="#{empty flowScope.websession.setupmodel.selectEndpointCapabilities.statisticalServices}" 
     53                                                                        reRender="setupForm"> 
     54                                                                        <f:setPropertyActionListener value="#{attached}" 
     55                                                                                target="#{flowScope.websession.setupmodel.selectedEndpoint}" /> 
     56                                                                </h:commandLink> 
     57                                                                <h:panelGrid columns="1" 
     58                                                                        rendered="#{flowScope.websession.setupmodel.selectEndpointCapabilities.error}"> 
     59                                                                        <h:outputText 
     60                                                                                value="ERROR: #{flowScope.websession.setupmodel.selectEndpointCapabilities.errorMessage}" /> 
     61                                                                </h:panelGrid> 
     62                                                                <h:panelGrid columns="2" 
     63                                                                        rendered="#{not empty flowScope.websession.setupmodel.selectEndpointCapabilities.statisticalServices}"> 
     64                                                                        <c:forEach var="item" 
     65                                                                                items="#{flowScope.websession.setupmodel.selectEndpointCapabilities.statisticalServices}"> 
     66                                                                                <h:outputText value="#{item.statisticParameters.unitName}" /> 
     67                                                                        </c:forEach> 
    6668 
    6769 
    68                                                                         </tr:panelList> 
    69                                                                 </tr:column> 
    70                                                                 <tr:column align="center"> 
    71                                                                         <f:facet name="header"> 
    72                                                                                 <tr:outputText value="Online" /> 
    73                                                                         </f:facet> 
     70                                                                </h:panelGrid> 
     71                                                        </rich:column> 
     72                                                        <rich:column align="center"> 
     73                                                                <f:facet name="header"> 
     74                                                                        <h:outputText value="Online" /> 
     75                                                                </f:facet> 
    7476 
    75                                                                         <center><tr:image source="/image/red-circle.gif" 
    76                                                                                 shortDesc="help" 
    77                                                                                 rendered="#{flowScope.websession.setupmodel.selectEndpointCapabilities.error}" /> 
    78                                                                         <tr:image source="/image/green-circle.png" shortDesc="help" 
    79                                                                                 rendered="#{!flowScope.websession.setupmodel.selectEndpointCapabilities.error}" /> 
    80                                                                         </center> 
    81                                                                 </tr:column> 
    82                                                         </tr:table> 
     77                                                                <center><h:graphicImage value="/image/red-circle.gif" 
     78                                                                        rendered="#{flowScope.websession.setupmodel.selectEndpointCapabilities.error}" /> 
     79                                                                <h:graphicImage value="/image/green-circle.png" shortDesc="help" 
     80                                                                        rendered="#{!flowScope.websession.setupmodel.selectEndpointCapabilities.error}" /> 
     81                                                                </center> 
     82                                                        </rich:column> 
     83                                                </rich:dataTable> 
     84                                                <rich:spacer height="15px" /> 
     85                                        </h:panelGrid> 
    8386 
    84                                                 </tr:panelFormLayout> 
     87                                        <rich:separator /> 
     88                                        <rich:spacer height="10px" /> 
    8589 
    86                                                 <tr:separator /> 
    87                                                 <tr:spacer height="10px" /> 
    88                                                 <tr:panelHeader text="Currently Attached Aggregator" /> 
    89                                                 <tr:spacer height="5px" /> 
    90                                                 <tr:panelFormLayout rows="3"> 
    91                                                         <tr:outputDocument 
    92                                                                 value="Organisation Name: #{setupService.attachedCapabilities.muaMetadata.organisationName}" /> 
    93                                                         <tr:outputDocument 
    94                                                                 value="Contact: #{setupService.attachedCapabilities.muaMetadata.contactEmail}" /> 
    95                                                         <tr:outputDocument 
    96                                                                 value="Endpoint: #{setupService.currentlyAttached.serviceEndpoint}" /> 
    97                                                 </tr:panelFormLayout> 
     90                                        <rich:spacer height="5px" /> 
     91                                        <h:panelGrid columns="1"> 
     92                                                <h:outputText 
     93                                                        value="Organisation Name: #{setupService.attachedCapabilities.muaMetadata.organisationName}" /> 
     94                                                <h:outputText 
     95                                                        value="Contact: #{setupService.attachedCapabilities.muaMetadata.contactEmail}" /> 
     96                                                <h:outputText 
     97                                                        value="Endpoint: #{setupService.currentlyAttached.serviceEndpoint}" /> 
     98                                        </h:panelGrid> 
     99                                        <rich:spacer height="15px" /> 
     100                                        <rich:separator /> 
     101                                        <rich:spacer height="15px" /> 
    98102 
    99                                                 <tr:separator /> 
    100                                                 <tr:spacer height="15px" /> 
     103 
     104                                        <rich:spacer height="7px" /> 
     105                    <rich:spacer width="15px" /> 
     106                                        <h:panelGrid columns="2" rendered="#{setupService.hasAttached}"> 
     107                                                <h:graphicImage style="cursor: pointer" value="/image/arrow.png"> 
     108                                                </h:graphicImage> 
     109 
     110                                                <h:commandLink style="cursor: pointer" value="Delete All Entries" 
     111                                                        action="deleteAllEntriesFromAttachedMUA" /> 
     112 
     113                                                <h:graphicImage style="cursor: pointer" 
     114                                                        value="/image/arrow.png"> 
     115                                                </h:graphicImage> 
     116                                                <h:commandLink style="cursor: pointer" 
     117                                                        value="Delete All Entries In Range" /> 
     118                                        </h:panelGrid> 
    101119 
    102120 
    103121 
    104                                                 <tr:panelGroupLayout layout="horizontal"> 
    105                                                         <tr:panelHeader text="Aggregator Maintenance" /> 
    106                                                         <tr:statusIndicator> 
    107                                                                 <f:facet name="busy"> 
    108                                                                         <tr:outputText value="Processing Request, Please Wait..." /> 
    109                                                                 </f:facet> 
    110                                                                 <f:facet name="ready"> 
    111                                                                         <tr:outputText value="#{flowScope.websession.setupmodel.processingResult}" /> 
    112                                                                 </f:facet> 
    113                                                         </tr:statusIndicator> 
    114                                                         <tr:spacer width="5px" /> 
    115                                                         <tr:statusIndicator /> 
    116                                                 </tr:panelGroupLayout> 
     122                                </rich:tab> 
    117123 
     124                                <rich:tab name="preferencesSetup" label="User Preferences" /> 
    118125 
    119  
    120                                                 <tr:spacer height="7px" /> 
    121  
    122                                                 <tr:panelFormLayout rows="2" 
    123                                                         rendered="#{setupService.hasAttached}"> 
    124  
    125                                                         <tr:panelGroupLayout layout="horizontal"> 
    126                                                                 <tr:spacer width="15px" /> 
    127                                                                 <tr:image inlineStyle="cursor: pointer" shortDesc="Task Option" 
    128                                                                         source="/image/arrow.png"> 
    129                                                                 </tr:image> 
    130                                                                 <tr:spacer width="15px" /> 
    131                                                                 <tr:commandLink inlineStyle="cursor: pointer" 
    132                                                                         text="Delete All Entries" 
    133                                                                         action="deleteAllEntriesFromAttachedMUA" partialSubmit="true" /> 
    134                                                                 <tr:spacer width="10px" /> 
    135                                                         </tr:panelGroupLayout> 
    136  
    137                                                         <tr:panelGroupLayout layout="horizontal"> 
    138                                                                 <tr:spacer width="15px" /> 
    139                                                                 <tr:image inlineStyle="cursor: pointer" shortDesc="Task Option" 
    140                                                                         source="/image/arrow.png"> 
    141                                                                 </tr:image> 
    142                                                                 <tr:spacer width="15px" /> 
    143                                                                 <tr:commandLink inlineStyle="cursor: pointer" 
    144                                                                         text="Delete All Entries In Range" /> 
    145                                                         </tr:panelGroupLayout> 
    146  
    147                                                 </tr:panelFormLayout> 
    148  
    149  
    150                                         </tr:showDetailItem> 
    151                                         <tr:showDetailItem text="Preferences"> 
    152                                                 <tr:panelHeader text="User Preferences" /> 
    153  
    154                                         </tr:showDetailItem> 
    155                                 </tr:panelTabbed> 
    156                         </tr:form> 
     126                        </rich:tabPanel> 
     127                </a4j:form> 
    157128 
    158129 
     
    161132 
    162133 
    163                 </ui:define> 
    164         </ui:composition> 
    165 </jsp:root> 
     134        </ui:define> 
     135</ui:composition> 
Note: See TracChangeset for help on using the changeset viewer.