Changeset 534
- Timestamp:
- 02/16/11 18:57:31 (2 years ago)
- Location:
- raptor-web/trunk/src/main
- Files:
-
- 5 edited
- 1 moved
-
java/uk/ac/cardiff/raptorweb/engine/ChartProcessor.java (modified) (6 diffs)
-
java/uk/ac/cardiff/raptorweb/service/impl/StartServiceImpl.java (modified) (1 diff)
-
webapp/WEB-INF/config/web-setup.xml (modified) (1 diff)
-
webapp/WEB-INF/flows/reports/graphicalReports.xhtml (modified) (4 diffs)
-
webapp/WEB-INF/flows/reports/reports-flow.xml (modified) (1 diff)
-
webapp/WEB-INF/flows/reports/setupRaptorWeb.xhtml (moved) (moved from raptor-web/trunk/src/main/webapp/WEB-INF/flows/reports/setupRaptorWeb.jspx) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
raptor-web/trunk/src/main/java/uk/ac/cardiff/raptorweb/engine/ChartProcessor.java
r533 r534 61 61 private Resource baseDirectory; 62 62 63 /* allows chart name flip flop, to stop the browser from rendering an image from cache*/ 64 boolean flipFlopChartName; 65 63 66 /* allows for selection of graph type */ 64 67 public enum GraphType { … … 200 203 201 204 //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); 203 206 204 207 File chartLocation = new File(getRootDirectory(user) + "/raptor-graphs-main"+endingFilename+".svg"); … … 209 212 try { 210 213 int padding = 5; 214 log.debug("Writing PNG to {}",chartLocationPNG); 211 215 ImageIO.write(ChartProcessorHelper.buildChartDropShadow(chart.createBufferedImage(width - (padding * 2), height - (padding * 2)), padding), "png", new FileOutputStream(chartLocationPNG)); 212 216 } catch (IOException e) { … … 230 234 chartmodel.setRelativeChartLocation(getRelativePath(chartLocationPNG)); 231 235 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; 232 252 } 233 253 … … 248 268 249 269 // 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)); 253 277 254 278 } … … 274 298 domainAxis.setUpperMargin(0.0); 275 299 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)); 278 302 279 303 } -
raptor-web/trunk/src/main/java/uk/ac/cardiff/raptorweb/service/impl/StartServiceImpl.java
r533 r534 225 225 } 226 226 if (numberOfAuthenticationsPerIntervalNumberModel != null) { 227 RaptorJFreeChartModel jfreeChart = getChartProcessor().constructJFreeGraph(GraphPresentation.FRONT,GraphType.AREA,numberOfAuthenticationsPerIntervalNumberModel,1270,3 00,(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"))); 228 228 startstats.setHeadlineGraph(jfreeChart); 229 229 } -
raptor-web/trunk/src/main/webapp/WEB-INF/config/web-setup.xml
r527 r534 84 84 <ref local="SystemStatsJobDetail" /> 85 85 </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"/> 88 88 </bean> 89 89 -
raptor-web/trunk/src/main/webapp/WEB-INF/flows/reports/graphicalReports.xhtml
r531 r534 12 12 13 13 <ui:define name="content"> 14 <a4j:include viewId="working-panel.xhtml" />14 <a4j:include viewId="working-panel.xhtml" /> 15 15 <rich:layout> 16 16 17 17 <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;" /> 19 20 20 21 <rich:simpleTogglePanel switchType="client" label="Control Panel" … … 45 46 value="#{unit.statisticalUnitInformation.statisticParameters.unitName}" 46 47 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"> 50 49 <f:setPropertyActionListener value="#{unit}" 51 50 target="#{flowScope.websession.graphmodel.selectedStatisticalUnit}" /> … … 136 135 <f:facet name="footer"> 137 136 <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"> 141 138 <!-- added the support here, as the command button needs to submit the form properties, which it only does 142 139 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" /> 144 143 145 144 </a4j:commandButton> … … 197 196 <rich:columns 198 197 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"> 200 200 <f:facet name="header"> 201 201 <h:outputText value="#{columns}" /> -
raptor-web/trunk/src/main/webapp/WEB-INF/flows/reports/reports-flow.xml
r523 r534 81 81 82 82 83 <view-state id="setupRaptorWeb" view="setupRaptorWeb. jspx">83 <view-state id="setupRaptorWeb" view="setupRaptorWeb.xhtml"> 84 84 <!-- used to help with the setup configuration --> 85 85 <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" 4 4 xmlns:ui="http://java.sun.com/jsf/facelets" 5 5 xmlns:h="http://java.sun.com/jsf/html" 6 6 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"> 9 12 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"> 11 17 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"> 17 19 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:outputText56 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> 66 68 67 69 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> 74 76 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> 83 86 84 </tr:panelFormLayout> 87 <rich:separator /> 88 <rich:spacer height="10px" /> 85 89 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:outputDocument92 value="Organisation Name: #{setupService.attachedCapabilities.muaMetadata.organisationName}" />93 <tr:outputDocument94 value="Contact: #{setupService.attachedCapabilities.muaMetadata.contactEmail}" />95 <tr:outputDocument96 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" /> 98 102 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> 101 119 102 120 103 121 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> 117 123 124 <rich:tab name="preferencesSetup" label="User Preferences" /> 118 125 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> 157 128 158 129 … … 161 132 162 133 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.
