Index: hci/trunk/eneraptor-web-app/target/test-reports/TESTS-TestSuites.xml
===================================================================
--- hci/trunk/eneraptor-web-app/target/test-reports/TESTS-TestSuites.xml	(revision 0)
+++ hci/trunk/eneraptor-web-app/target/test-reports/TESTS-TestSuites.xml	(revision 42)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuites>
+  <testsuite errors="0" failures="0" hostname="Alex-Laptop" id="0" name="BasicTests" package="com.eneraptor.hci" tests="1" time="0.152" timestamp="2010-12-27T10:08:39">
+      <properties />
+
+      <testcase classname="com.eneraptor.hci.BasicTests" name="testSomething" time="0.151" />
+
+      <system-out><![CDATA[--Output from testSomething--
+]]></system-out>
+
+      <system-err><![CDATA[--Output from testSomething--
+]]></system-err>
+
+  </testsuite>
+  <testsuite errors="0" failures="0" hostname="Alex-Laptop" id="1" name="ErptrTagLibTests" package="com.eneraptor.hci" tests="1" time="0.692" timestamp="2010-12-27T10:08:26">
+      <properties />
+
+      <testcase classname="com.eneraptor.hci.ErptrTagLibTests" name="testSomething" time="0.607" />
+
+      <system-out><![CDATA[--Output from testSomething--
+]]></system-out>
+
+      <system-err><![CDATA[--Output from testSomething--
+]]></system-err>
+
+  </testsuite>
+  <testsuite errors="0" failures="0" hostname="Alex-Laptop" id="2" name="InternalConfigControllerTests" package="com.eneraptor.hci" tests="1" time="0.181" timestamp="2010-12-27T10:08:27">
+      <properties />
+
+      <testcase classname="com.eneraptor.hci.InternalConfigControllerTests" name="testSomething" time="0.176" />
+
+      <system-out><![CDATA[--Output from testSomething--
+]]></system-out>
+
+      <system-err><![CDATA[--Output from testSomething--
+]]></system-err>
+
+  </testsuite>
+  <testsuite errors="0" failures="0" hostname="Alex-Laptop" id="3" name="InternalConfigTests" package="com.eneraptor.hci" tests="1" time="0.018" timestamp="2010-12-27T10:08:27">
+      <properties />
+
+      <testcase classname="com.eneraptor.hci.InternalConfigTests" name="testConstructor" time="0.013" />
+
+      <system-out><![CDATA[--Output from testConstructor--
+]]></system-out>
+
+      <system-err><![CDATA[--Output from testConstructor--
+]]></system-err>
+
+  </testsuite>
+  <testsuite errors="1" failures="0" hostname="Alex-Laptop" id="4" name="MainMenuServiceTests" package="com.eneraptor.hci" tests="1" time="0.026" timestamp="2010-12-27T10:08:27">
+      <properties />
+
+      <testcase classname="com.eneraptor.hci.MainMenuServiceTests" name="testSomething" time="0.021">
+          <error message="Cannot invoke method getMainMenu() on null object" type="java.lang.NullPointerException">java.lang.NullPointerException: Cannot invoke method getMainMenu() on null object
+	at com.eneraptor.hci.MainMenuServiceTests.testSomething(MainMenuServiceTests.groovy:19)
+</error>
+
+      </testcase>
+
+      <system-out><![CDATA[--Output from testSomething--
+]]></system-out>
+
+      <system-err><![CDATA[--Output from testSomething--
+]]></system-err>
+
+  </testsuite>
+  <testsuite errors="0" failures="0" hostname="Alex-Laptop" id="5" name="MenuProviderControllerTests" package="com.eneraptor.hci" tests="1" time="0.019" timestamp="2010-12-27T10:08:27">
+      <properties />
+
+      <testcase classname="com.eneraptor.hci.MenuProviderControllerTests" name="testSomething" time="0.016" />
+
+      <system-out><![CDATA[--Output from testSomething--
+]]></system-out>
+
+      <system-err><![CDATA[--Output from testSomething--
+]]></system-err>
+
+  </testsuite>
+</testsuites>
Index: hci/trunk/eneraptor-web-app/target/eneraptor-web-app-0.2.war
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: hci/trunk/eneraptor-web-app/web-app/img/sum.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: hci/trunk/eneraptor-web-app/web-app/img/sum.png
===================================================================
--- hci/trunk/eneraptor-web-app/web-app/img/sum.png	(revision 0)
+++ hci/trunk/eneraptor-web-app/web-app/img/sum.png	(revision 42)

Property changes on: hci/trunk/eneraptor-web-app/web-app/img/sum.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: hci/trunk/eneraptor-web-app/web-app/img/avg.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: hci/trunk/eneraptor-web-app/web-app/img/avg.png
===================================================================
--- hci/trunk/eneraptor-web-app/web-app/img/avg.png	(revision 0)
+++ hci/trunk/eneraptor-web-app/web-app/img/avg.png	(revision 42)

Property changes on: hci/trunk/eneraptor-web-app/web-app/img/avg.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: hci/trunk/eneraptor-web-app/web-app/img/logo_predlog.psd
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: hci/trunk/eneraptor-web-app/web-app/img/logo_predlog.psd
===================================================================
--- hci/trunk/eneraptor-web-app/web-app/img/logo_predlog.psd	(revision 0)
+++ hci/trunk/eneraptor-web-app/web-app/img/logo_predlog.psd	(revision 42)

Property changes on: hci/trunk/eneraptor-web-app/web-app/img/logo_predlog.psd
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: hci/trunk/eneraptor-web-app/web-app/img/min.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: hci/trunk/eneraptor-web-app/web-app/img/min.png
===================================================================
--- hci/trunk/eneraptor-web-app/web-app/img/min.png	(revision 0)
+++ hci/trunk/eneraptor-web-app/web-app/img/min.png	(revision 42)

Property changes on: hci/trunk/eneraptor-web-app/web-app/img/min.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: hci/trunk/eneraptor-web-app/web-app/img/max.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: hci/trunk/eneraptor-web-app/web-app/img/max.png
===================================================================
--- hci/trunk/eneraptor-web-app/web-app/img/max.png	(revision 0)
+++ hci/trunk/eneraptor-web-app/web-app/img/max.png	(revision 42)

Property changes on: hci/trunk/eneraptor-web-app/web-app/img/max.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: hci/trunk/eneraptor-web-app/web-app/img/logo_enh.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: hci/trunk/eneraptor-web-app/web-app/img/logo_enh.jpg
===================================================================
--- hci/trunk/eneraptor-web-app/web-app/img/logo_enh.jpg	(revision 0)
+++ hci/trunk/eneraptor-web-app/web-app/img/logo_enh.jpg	(revision 42)

Property changes on: hci/trunk/eneraptor-web-app/web-app/img/logo_enh.jpg
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: hci/trunk/eneraptor-web-app/web-app/img/logo_enh.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: hci/trunk/eneraptor-web-app/web-app/img/logo_enh.png
===================================================================
--- hci/trunk/eneraptor-web-app/web-app/img/logo_enh.png	(revision 0)
+++ hci/trunk/eneraptor-web-app/web-app/img/logo_enh.png	(revision 42)

Property changes on: hci/trunk/eneraptor-web-app/web-app/img/logo_enh.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: hci/trunk/eneraptor-web-app/web-app/css/style.css
===================================================================
--- hci/trunk/eneraptor-web-app/web-app/css/style.css	(revision 41)
+++ hci/trunk/eneraptor-web-app/web-app/css/style.css	(revision 42)
@@ -408,7 +408,17 @@
 .sysLog-main{background:transparent url(../img/icons/eye.png) no-repeat left;}
 .sysLog-browse{background:transparent url(../img/icons/magnifier.png) no-repeat left;}
 .sysLog-graph{background:transparent url(../img/icons/chart_curve.png) no-repeat left;}
+.sysLog-export{background:transparent url(../img/icons/disk_multiple.png) no-repeat left;}
+.sysLog-clear{background:transparent url(../img/icons/bin.png) no-repeat left;}
 
+.statistics-main{background:transparent url(../img/icons/eye.png) no-repeat left;}
+.statistics-graphs{background:transparent url(../img/icons/chart_curve.png) no-repeat left;}
+.statistics-reports{background:transparent url(../img/icons/report.png) no-repeat left;}
+
+.actions-main{background:transparent url(../img/icons/eye.png) no-repeat left;}
+.actions-view{background:transparent url(../img/icons/script.png) no-repeat left;}
+.actions-add{background:transparent url(../img/icons/script_add.png) no-repeat left;}
+
 .config-main{background:transparent url(../img/icons/eye.png) no-repeat left;}
 .config-hci{background:transparent url(../img/icons/application.png) no-repeat left;}
 .config-logic{background:transparent url(../img/icons/cog.png) no-repeat left;}
Index: hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/StatisticsController.groovy
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/StatisticsController.groovy	(revision 41)
+++ hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/StatisticsController.groovy	(revision 42)
@@ -1,7 +1,123 @@
+
 package com.eneraptor.hci
 
+import groovy.sql.Sql
+
 class StatisticsController {
-
+
+	def dataSource
+	
     def main = { }
+	
+	def graphs = {
+	
+		List savedGraphs = new ArrayList()
+		
+		savedGraphs = EneGraph.list()
+			
+		[savedGraphs: savedGraphs]
+			
+	}
+	
+	def reports = { }
+	
+	def newGraph = {
+		
+		List graphTypes = ["min","max","avg","sum"]
+		List graphTypesFriendly = ["Minimum value","Maximum value","Average value","Cumulative"]
+		
+		List devices = new ArrayList()
+		List devicesFriendly = new ArrayList()
+		
+		DeviceInfo.list().each {
+			devices << it.deviceId
+			devicesFriendly << it.friendlyName
+		}
+		
+		[graphTypes:graphTypes,graphTypesFriendly:graphTypesFriendly, devices:devices, devicesFriendly:devicesFriendly]
+		
+	}
+	
+	def newGraphDo = {
+		
+		String errors = ""
+		Date chosenTimeFrameStart = null
+		Date chosenTimeFrameEnd = null
+		
+		if(params['timeFrameType'] == "day") {
+			chosenTimeFrameStart = params['dayMainTimeFrameStart']
+			chosenTimeFrameEnd = params['dayMainTimeFrameEnd']
+		} else if(params['timeFrameType'] == "month") {
+			chosenTimeFrameStart = params['monthMainTimeFrameStart']
+			chosenTimeFrameEnd = params['monthMainTimeFrameEnd']
+		} else if(params['timeFrameType'] == "year") {
+			chosenTimeFrameStart = params['yearMainTimeFrameStart']
+			chosenTimeFrameEnd = params['yearMainTimeFrameEnd']
+		} else if(params['timeFrameType'] == "custom") {
+			chosenTimeFrameStart = params['customMainTimeFrameStart']
+			chosenTimeFrameEnd = params['customMainTimeFrameEnd']
+		} else {
+			errors += "<p>Time frame type invalid!</p>"
+		}
+		
+		def newEneGraph = new EneGraph(
+			name: params['graphName'],
+			type: params['graphType'],
+			timeFrameType: params['timeFrameType'],
+			timeFrameStart: chosenTimeFrameStart,
+			timeFrameEnd: chosenTimeFrameEnd,
+			innerSections: params['customMainTimeFrameInnerSections'],
+			advHoursTimeFrameStart: params['advHoursStart'],
+			advHoursTimeFrameEnd: params['advHoursEnd'],
+			advDayTimeFrameStart: params['advDayStart'],
+			advDayTimeFrameEnd: params['advDayEnd'],
+			advMonthTimeFrameStart: params['advMonthStart'],
+			advMonthTimeFrameEnd: params['advMonthEnd'],
+			deviceId: params['deviceId']
+		)
+		
+		if(!newEneGraph.validate()) {
+			errors += "<p>Graph could not be created - there were some input errors. Please check if all input values are valid.</p>"
+			flash['errors'] = errors
+			redirect(action:'newGraph')
+		} else {
+			if(newEneGraph.save()){
+				flash['confirms'] = "<p>Graph created succesfully!</p>"
+				redirect(action:'newGraph')
+			} else {
+				flash['errors'] = "<p>There was an error while saving graph.</p>"
+				redirect(action:'newGraph')
+			}
+		}
+		
+		return true
+		
+	}
+	
+	def showGraph = {
+		
+		def graphToShow = EneGraph.get(params['graphId'])
+		
+		List data = new ArrayList()
+		def results
+		def db_sql = new Sql(dataSource)
+		
+		if(graphToShow.timeFrameType == "day") {
+			db_sql.eachRow "select date_trunc('day',ld.date_recieved) dt, " + graphToShow['type'] + "(to_number(ld.reported_data,'9999999999D99999')) vl from logged_data as ld where (date_trunc('day',ld.date_recieved) >= '" + graphToShow.timeFrameStart + "' and date_trunc('day',ld.date_recieved) <= '" + graphToShow.timeFrameEnd + "') group by date_trunc('day',ld.date_recieved) order by date_trunc('day',ld.date_recieved) asc", {
+				data << [it.dt.getTime(), it.vl]
+			}
+		} else if (graphToShow.timeFrameType == "month") {
+			db_sql.eachRow "select date_trunc('month',ld.date_recieved) dt, " + graphToShow['type'] + "(to_number(ld.reported_data,'9999999999D99999')) vl from logged_data as ld where (date_trunc('month',ld.date_recieved) >= '" + graphToShow.timeFrameStart + "' and date_trunc('month',ld.date_recieved) <= '" + graphToShow.timeFrameEnd + "') group by date_trunc('month',ld.date_recieved) order by date_trunc('month',ld.date_recieved) asc", {
+				data << [it.dt.getTime(), it.vl]
+			}
+		} else if (graphToShow.timeFrameType == "year") {
+			db_sql.eachRow "select date_trunc('year',ld.date_recieved) dt, " + graphToShow['type'] + "(to_number(ld.reported_data,'9999999999D99999')) vl from logged_data as ld where (date_trunc('year',ld.date_recieved) >= '" + graphToShow.timeFrameStart + "' and date_trunc('year',ld.date_recieved) <= '" + graphToShow.timeFrameEnd + "') group by date_trunc('year',ld.date_recieved) order by date_trunc('year',ld.date_recieved) asc", {
+				data << [it.dt.getTime(), it.vl]
+			}
+		}
+		
+		[data:data]
+		
+	}
 	
 }
Index: hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ActionsController.groovy
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ActionsController.groovy	(revision 41)
+++ hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/ActionsController.groovy	(revision 42)
@@ -3,5 +3,9 @@
 class ActionsController {
 
     def main = { }
+	
+	def view = { }
+	
+	def add = { }
 	
 }
Index: hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/SysLogController.groovy
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/SysLogController.groovy	(revision 41)
+++ hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/SysLogController.groovy	(revision 42)
@@ -40,7 +40,43 @@
 		
 		flash['warnings'] = null
 		
-		def entries = LoggedData.list()
+		List devicesForCheckBox = new ArrayList()
+		DeviceInfo.findAllByInputDeviceOrOutputDevice(true,true).each {
+			devicesForCheckBox << it
+		}
+		
+		def entries = new ArrayList()
+		
+		List checkedDevices = new ArrayList()
+		devicesForCheckBox.each {
+			if(params['cb_' + it.deviceId]) {
+				checkedDevices << it.deviceId
+			}
+		}
+		
+		if(params['fromDate'] && params['tillDate']) {
+			if(params['all_cb']) {
+				def c = LoggedData.createCriteria()
+				entries = c {
+					and {
+						between("dateRecieved",params['fromDate'],params['tillDate'])
+					}
+					order("dateRecieved","asc")
+				}
+			} else {
+				if(checkedDevices.size > 0) {
+					def c = LoggedData.createCriteria()
+					entries = c {
+						and {
+							between("dateRecieved",params['fromDate'],params['tillDate'])
+							'in'("deviceId",checkedDevices)
+						}
+						order("dateRecieved","asc")
+					}
+				}
+			}
+		}
+
 		Map devices = new HashMap()
 		Map icons   = new HashMap()
 		List unknownDevices = new ArrayList()
@@ -62,7 +98,7 @@
 			flash['warnings'] += "<p>There was found at least one log entry for a device with id <b>${it}</b>, which is <b>unknown</b> to HCI. You should <b>add this device</b> by <b>" + g.link(controller: 'config', action: 'addDevice', params: ['deviceId' : it], "clicking here") + "</b>.</p>"
 		}
 		
-		[data: entries, devices: devices, icons: icons]
+		[data: entries, devices: devices, icons: icons, devicesForCheckBox:devicesForCheckBox]
 		
 	}
 	
@@ -122,5 +158,147 @@
 		[data: data, devices: devices, params:params]
 		
 	}
+	
+	def export = {
+		
+		List devicesForCheckBox = new ArrayList()
+		DeviceInfo.findAllByInputDeviceOrOutputDevice(true,true).each {
+			devicesForCheckBox << it
+		}
+		
+		[devicesForCheckBox: devicesForCheckBox]
+		
+	}
+	
+	def exportDo = {
+		
+		List devicesForCheckBox = new ArrayList()
+		DeviceInfo.findAllByInputDeviceOrOutputDevice(true,true).each {
+			devicesForCheckBox << it
+		}
+		
+		List checkedDevices = new ArrayList()
+		devicesForCheckBox.each {
+			if(params['cb_' + it.deviceId]) {
+				checkedDevices << it.deviceId
+			}
+		}
+		
+		List entries = new ArrayList()
+		def cont = ""
+		
+		if(params['all_cb']) {
+			def c = LoggedData.createCriteria()
+			entries = c {
+				and {
+					between("dateRecieved",params['fromDate'],params['tillDate'])
+				}
+				order("dateRecieved","asc")
+			}
+		} else {
+			if(checkedDevices.size > 0) {
+				def c = LoggedData.createCriteria()
+				entries = c {
+					and {
+						between("dateRecieved",params['fromDate'],params['tillDate'])
+						'in'("deviceId",checkedDevices)
+					}
+					order("dateRecieved","asc")
+				}
+			}
+		}
+		
+		if(entries.size == 0) {
+			flash['errors'] = "<p>Nothing to export!</p><p>There are no log entries for selected devices in the time interval specified.</p>"
+			redirect(action:'export')
+		}
+		else if(params['format'] == "Plain text (.txt)") {
+			entries.each {
+				cont += it.dateRecieved.toString() + " " + it.deviceId + " " + it.reportedData + "\n"
+			}
+			render(text: cont,contentType:"text/plain",encoding:"UTF-8")
+		} else if(params['format'] == "PostgreSQL script (.sql)") {
+			entries.each {
+				cont += "INSERT INTO logged_data(id, \"version\", date_recieved, device_id, reported_data) VALUES (nextval('hibernate_sequence'), 0, '" + it.dateRecieved.toString() + "', '" + it.deviceId + "', '" + it.reportedData + "');\n";
+			}
+			render(text: cont,contentType:"text/plain",encoding:"UTF-8")
+		} else {
+			cont += "<log>\n"
+			entries.each {
+				cont += "\t<entry>\n"
+				cont += "\t\t<device>" + it.deviceId + "</device>\n"
+				cont += "\t\t<time>" + it.dateRecieved.toString() + "</time>\n"
+				cont += "\t\t<data>\n"
+				cont += "\t\t\t" + it.reportedData + "\n"
+				cont += "\t\t</data>\n"
+				cont += "\t</entry>\n"
+			}
+			cont += "</log>"
+			render(text: cont,contentType:"text/xml",encoding:"UTF-8")
+		}
+	}
+	
+	def clear = {
+		
+		List devicesForCheckBox = new ArrayList()
+		DeviceInfo.findAllByInputDeviceOrOutputDevice(true,true).each {
+			devicesForCheckBox << it
+		}
+		
+		[devicesForCheckBox: devicesForCheckBox]
+		
+	}
+	
+	def clearDo = {
+		
+		List devicesForCheckBox = new ArrayList()
+		DeviceInfo.findAllByInputDeviceOrOutputDevice(true,true).each {
+			devicesForCheckBox << it
+		}
+		
+		List checkedDevices = new ArrayList()
+		devicesForCheckBox.each {
+			if(params['cb_' + it.deviceId]) {
+				checkedDevices << it.deviceId
+			}
+		}
+		
+		List entries = new ArrayList()
+		def cont = ""
+		
+		if(params['all_cb']) {
+			def c = LoggedData.createCriteria()
+			entries = c {
+				and {
+					between("dateRecieved",params['fromDate'],params['tillDate'])
+				}
+				order("dateRecieved","asc")
+			}
+		} else {
+			if(checkedDevices.size > 0) {
+				def c = LoggedData.createCriteria()
+				entries = c {
+					and {
+						between("dateRecieved",params['fromDate'],params['tillDate'])
+						'in'("deviceId",checkedDevices)
+					}
+					order("dateRecieved","asc")
+				}
+			}
+		}
+		
+		if(entries.size == 0) {
+			flash['errors'] = "<p>Nothing to clear!</p><p>There are no log entries for selected devices in the time interval specified.</p>"
+		} else {
+			def entCleared = 0
+			entries.each {
+				it.delete()
+				entCleared++
+			}
+			flash['confirms'] = "<p>" + entCleared + " log entries succesfully cleared!</p>"
+		}
+		redirect(action:'clear')
+		
+	}
 	
 }
Index: hci/trunk/eneraptor-web-app/grails-app/domain/com/eneraptor/hci/EneGraph.groovy
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/domain/com/eneraptor/hci/EneGraph.groovy	(revision 0)
+++ hci/trunk/eneraptor-web-app/grails-app/domain/com/eneraptor/hci/EneGraph.groovy	(revision 42)
@@ -0,0 +1,37 @@
+package com.eneraptor.hci
+
+class EneGraph {
+
+	String name
+	String type
+	String timeFrameType
+	Date timeFrameStart
+	Date timeFrameEnd
+	int innerSections
+	int advHoursTimeFrameStart
+	int advHoursTimeFrameEnd
+	int advDayTimeFrameStart
+	int advDayTimeFrameEnd
+	int advMonthTimeFrameStart
+	int advMonthTimeFrameEnd
+	String deviceId
+	
+    static constraints = {
+		
+		name(blank:false, unique:true)
+		type(blank:false, inList:["max","min","avg","sum"])
+		timeFrameType(blank:false, inList:["day","month","year","custom"])
+		timeFrameStart(blank:false)
+		timeFrameEnd(blank:false)
+		innerSections(blank:false,min:(int)1)
+		advHoursTimeFrameStart(nullable:true)
+		advHoursTimeFrameEnd(nullable:true)
+		advDayTimeFrameStart(nullable:true)
+		advDayTimeFrameEnd(nullable:true)
+		advMonthTimeFrameStart(nullable:true)
+		advMonthTimeFrameEnd(nullable:true)
+		deviceId(blank:false)
+		
+    }
+	
+}
Index: hci/trunk/eneraptor-web-app/grails-app/views/statistics/graphs.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/statistics/graphs.gsp	(revision 0)
+++ hci/trunk/eneraptor-web-app/grails-app/views/statistics/graphs.gsp	(revision 42)
@@ -0,0 +1,58 @@
+<html>
+
+<head>
+	<title>Statistics</title>
+	<meta name="layout" content="main" />
+</head>
+
+<body>
+	
+	<erptr:box title="Saved graphs">
+		
+		<table>
+			<thead>
+				<tr>
+					<th><p>Graph name (short description)</p></th>
+					<th><p>For device</p></th>
+					<th><p>Type</p></th>
+					<th><p>Options</p></th>
+				</tr>
+			</thead>
+			<tbody>
+				<g:each in="${savedGraphs}" var="savedGraph">
+					<tr>
+						<td><p><erptr:icon w="chart_curve" /><g:link action="showGraph" params="[graphId: savedGraph.id]">${savedGraph.name}</g:link></p></td>
+						<td><p>${savedGraph.deviceId}</p></td>
+						<td><p>${savedGraph.type}</p></td>
+						<td><p>TODO</p></td>
+					</tr>
+				</g:each>
+			</tbody>
+		</table>
+		<g:if test="${savedGraphs.size == 0}">
+			<center><p><i>There are no saved graphs.</i></p></center>
+		</g:if>
+
+	</erptr:box>
+	
+	<erptr:box title="Create a new graph">
+		<p>To create a new graph, select one of the graph types below:</p>
+			<table style="text-align:center;border:none;">
+				<tr>
+					<td style="border:none;"><img src="${resource(dir:'img/',file:'min.png')}" /></td>
+					<td style="border:none;"><img src="${resource(dir:'img/',file:'max.png')}" /></td>
+					<td style="border:none;"><img src="${resource(dir:'img/',file:'avg.png')}" /></td>
+					<td style="border:none;"><img src="${resource(dir:'img/',file:'sum.png')}" /></td>
+				</tr>
+				<tr>
+					<td style="border:none;"><p><g:link action="newGraph" params="[graphType:'min']">Create a minimum value graph</g:link></p></td>
+					<td style="border:none;"><p><g:link action="newGraph" params="[graphType:'max']">Create a maximum value graph</g:link></p></td>
+					<td style="border:none;"><p><g:link action="newGraph" params="[graphType:'avg']">Create a average value graph</g:link></p></td>
+					<td style="border:none;"><p><g:link action="newGraph" params="[graphType:'sum']">Create a cumulative graph</g:link></p></td>
+				</tr>
+			</table>
+	</erptr:box>
+
+</body>
+
+</html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/views/statistics/main.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/statistics/main.gsp	(revision 41)
+++ hci/trunk/eneraptor-web-app/grails-app/views/statistics/main.gsp	(revision 42)
@@ -6,7 +6,11 @@
 </head>
 
 <body>
-	<p>Deluje!</p>
+	
+	<erptr:box title="Statistics">
+		<p>TODO</p>
+	</erptr:box>
+
 </body>
 
 </html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/views/statistics/newGraph.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/statistics/newGraph.gsp	(revision 0)
+++ hci/trunk/eneraptor-web-app/grails-app/views/statistics/newGraph.gsp	(revision 42)
@@ -0,0 +1,164 @@
+<html>
+
+<head>
+	<title>Statistics</title>
+	<meta name="layout" content="main" />
+</head>
+
+<body>
+	
+	<erptr:box title="New graph">
+		
+		<form name="newGraphForm" action="newGraphDo">
+		
+			<fieldset>
+				<legend>General information</legend>
+				<label for="graphName">Graph name (short description)</label>
+				<g:textField name="graphName" style="width:500px;" />
+				<br /><br />
+				<label for="deviceId">Device</label>
+				<g:select name="deviceId" from="${devicesFriendly}" keys="${devices}" />
+			</fieldset>
+		
+			<fieldset>
+				<legend>Graph type</legend>
+			
+				<label for="graphType">Calculation type</label>
+				<g:select from="${graphTypesFriendly}" value="${params.graphType}" name="graphType" keys="${graphTypes}" />
+				<br /><br />
+			
+				<label for="timeFrameType">Time frame type</label>
+				<select name="timeFrameType" id="timeFrameType" >
+					<option onclick="changeTimeFrameType('day')" value="day" selected="${timeFrameType == 'day'}">Daily</option>
+					<option onclick="changeTimeFrameType('month')" value="month" selected="${timeFrameType == 'month'}">Monthly</option>
+					<option onclick="changeTimeFrameType('year')" value="year" selected="${timeFrameType == 'year'}">Yearly</option>
+					<option onclick="changeTimeFrameType('custom')" value="custom" selected="${timeFrameType == 'custom'}">Custom</option>
+				</select>
+				<br />
+				
+				<label for="timeFrameTypeDesc">&nbsp;</label>
+				<p name="timeFrameTypeDesc" id="timeFrameTypeDesc">&nbsp;&nbsp;<i>Calculations will be made for custom inner time intervals separately.</i></p>
+				
+			</fieldset>
+			
+			<fieldset>
+				<legend>Main time frame</legend>
+				<div style="display:none;" id="dayMainTimeFrame" name="dayMainTimeFrame">
+					<label for="dayMainTimeFrameStart">From</label>
+					<g:datePicker name="dayMainTimeFrameStart" precision="day" />
+					<br /><br />
+					<label for="dayMainTimeFrameEnd">From</label>
+					<g:datePicker name="dayMainTimeFrameEnd" precision="day" />
+					<br /><br />
+				</div>
+				<div style="display:none;" id="monthMainTimeFrame" name="monthMainTimeFrame">
+					<label for="monthMainTimeFrameStart">From</label>
+					<g:datePicker name="monthMainTimeFrameStart" precision="month" />
+					<br /><br />
+					<label for="monthMainTimeFrameEnd">From</label>
+					<g:datePicker name="monthMainTimeFrameEnd" precision="month" />
+					<br /><br />
+				</div>
+				<div style="display:none;" id="yearMainTimeFrame" name="yearMainTimeFrame">
+					<label for="yearMainTimeFrameStart">From</label>
+					<g:datePicker name="yearMainTimeFrameStart" precision="year" />
+					<br /><br />
+					<label for="yearMainTimeFrameEnd">From</label>
+					<g:datePicker name="yearMainTimeFrameEnd" precision="year" />
+					<br /><br />
+				</div>
+				<div id="customMainTimeFrame" name="customMainTimeFrame">
+					<label for="customMainTimeFrameStart">From</label>
+					<g:datePicker name="customMainTimeFrameStart" />
+					<br /><br />
+					<label for="customMainTimeFrameEnd">From</label>
+					<g:datePicker name="customMainTimeFrameEnd" />
+					<br /><br />
+					<label for="customMainTimeFrameInnerSections">Number of inner intervals</label>
+					<input onkeyup="checkInnerSections();" type="text" id="customMainTimeFrameInnerSections" name="customMainTimeFrameInnerSections" value="1" />
+					<br /><br />
+				</div>
+			</fieldset>
+			
+			<fieldset>
+				<legend>Advanced options</legend>
+				<a name="advOptionsExp" id="advOptionsExp" href="#" onclick="$('advOptions').show();$('advOptionsExp').hide();return false;"><erptr:icon w="bullet_arrow_down" />Show advanced options</a>
+				<div name="advOptions" id="advOptions" style="display:none;">
+					<label for="advHoursStart">Include only hours from</label>
+					<g:select name="advHoursStart" from="${0..23}" value="0" />
+					<span> to </span>
+					<g:select name="advHoursEnd" from="${0..23}" value="23" />
+					<br /><br />
+					<label for="advDayStart">Include only days from</label>
+					<g:select name="advDayStart" from="${1..31}" value="1" />
+					<span> to </span>
+					<g:select name="advDayEnd" from="${1..31}" value="31" />
+					<br /><br />
+					<label for="advMonthStart">Include only months from</label>
+					<g:select name="advMonthStart" from="${1..12}" value="1" />
+					<span> to </span>
+					<g:select name="advMonthEnd" from="${1..12}" value="12" />
+					<br /><br />
+				</div>
+			</fieldset>
+		
+		<g:submitButton name="newGraphSubmit" value="Save & show" />&nbsp;&nbsp;
+		<g:actionSubmit name="newGraphShowOnly" action="showGraph" value="Show (without saving)" />&nbsp;&nbsp;
+		<g:actionSubmit name="newGraphCancel" action="newGraph" value="Cancel" />
+		
+		</form>
+		
+	</erptr:box>
+	
+	<g:javascript>
+		function changeTimeFrameType(toType) {
+			if(toType == 'day') {
+				$('timeFrameTypeDesc').innerHTML = "&nbsp;&nbsp;<i>Calculations will be made for each day separately.</i>";
+				$('dayMainTimeFrame').show();
+				$('monthMainTimeFrame').hide();
+				$('yearMainTimeFrame').hide();
+				$('customMainTimeFrame').hide();
+			} else if(toType == 'month') {
+				$('timeFrameTypeDesc').innerHTML = "&nbsp;&nbsp;<i>Calculations will be made for each month separately.</i>";
+				$('dayMainTimeFrame').hide();
+				$('monthMainTimeFrame').show();
+				$('yearMainTimeFrame').hide();
+				$('customMainTimeFrame').hide();
+			} else if(toType == 'year') {
+				$('timeFrameTypeDesc').innerHTML = "&nbsp;&nbsp;<i>Calculations will be made for each year separately.</i>";
+				$('dayMainTimeFrame').hide();
+				$('monthMainTimeFrame').hide();
+				$('yearMainTimeFrame').show();
+				$('customMainTimeFrame').hide();
+			} else if(toType == 'custom') {
+				$('timeFrameTypeDesc').innerHTML = "&nbsp;&nbsp;<i>Calculations will be made for custom inner time intervals separately.</i>";
+				$('dayMainTimeFrame').hide();
+				$('monthMainTimeFrame').hide();
+				$('yearMainTimeFrame').hide();
+				$('customMainTimeFrame').show();
+			}
+		}
+		function checkInnerSections() {
+			var sText = $('customMainTimeFrameInnerSections').value;
+			var validChars = "0123456789";
+			var isNumber = true;
+			var currChar;
+					 
+			for (i = 0; i < sText.length; i++) { 
+				currChar = sText.charAt(i); 
+				if (validChars.indexOf(currChar) == -1) {
+					isNumber = false;
+					break;
+				}
+			}
+			
+			if(isNumber == false) {
+				$('customMainTimeFrameInnerSections').value = sText.substring(0,(sText.length)-1)
+			}
+			
+		}
+	</g:javascript>
+
+</body>
+
+</html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/views/statistics/reports.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/statistics/reports.gsp	(revision 0)
+++ hci/trunk/eneraptor-web-app/grails-app/views/statistics/reports.gsp	(revision 42)
@@ -0,0 +1,20 @@
+<html>
+
+<head>
+	<title>Statistics</title>
+	<meta name="layout" content="main" />
+</head>
+
+<body>
+	
+	<erptr:box title="Saved reports">
+		<p>TODO</p>
+	</erptr:box>
+	
+	<erptr:box title="Create a new report">
+		<p>TODO</p>
+	</erptr:box>
+
+</body>
+
+</html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/views/statistics/showGraph.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/statistics/showGraph.gsp	(revision 0)
+++ hci/trunk/eneraptor-web-app/grails-app/views/statistics/showGraph.gsp	(revision 42)
@@ -0,0 +1,27 @@
+<html>
+
+<head>
+	<title>Statistics &raquo; Graph view</title>
+	<meta name="layout" content="main" />
+	<flot:resources />
+</head>
+
+<body>
+
+	<erptr:box title="Graph">
+		<g:javascript>
+			var data = [${data}];
+			var options = {
+				lines: { show: true },
+				points: { show: true },
+				xaxis: { mode: "time", timeformat: "%y/%m/%d %H:%M" }
+			};
+		</g:javascript>
+		<div class="chart">
+			<flot:plot id="placeholder" style="width: 900px; height: 300px; padding:5px;" data="data" options="options" />
+		</div>
+	</erptr:box>
+
+</body>
+
+</html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/views/actions/main.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/actions/main.gsp	(revision 41)
+++ hci/trunk/eneraptor-web-app/grails-app/views/actions/main.gsp	(revision 42)
@@ -1,12 +1,16 @@
 <html>
 
 <head>
-	<title>Actions</title>
+	<title>Scenarios</title>
 	<meta name="layout" content="main" />
 </head>
 
 <body>
-	<p>Deluje!</p>
+	
+	<erptr:box title="Scenarios">
+		<p>TODO</p>
+	</erptr:box>
+
 </body>
 
 </html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/views/actions/add.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/actions/add.gsp	(revision 0)
+++ hci/trunk/eneraptor-web-app/grails-app/views/actions/add.gsp	(revision 42)
@@ -0,0 +1,16 @@
+<html>
+
+<head>
+	<title>Scenarios</title>
+	<meta name="layout" content="main" />
+</head>
+
+<body>
+	
+	<erptr:box title="Add a new scenario">
+		<p>TODO</p>
+	</erptr:box>
+
+</body>
+
+</html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/views/actions/view.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/actions/view.gsp	(revision 0)
+++ hci/trunk/eneraptor-web-app/grails-app/views/actions/view.gsp	(revision 42)
@@ -0,0 +1,16 @@
+<html>
+
+<head>
+	<title>Scenarios</title>
+	<meta name="layout" content="main" />
+</head>
+
+<body>
+	
+	<erptr:box title="View scenarios">
+		<p>TODO</p>
+	</erptr:box>
+
+</body>
+
+</html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/views/layouts/main.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/layouts/main.gsp	(revision 41)
+++ hci/trunk/eneraptor-web-app/grails-app/views/layouts/main.gsp	(revision 42)
@@ -15,6 +15,47 @@
 <body onload="onLoadDo();">
 	<div id="container">
 		<img style="position:absolute;top:-0px;" src="${g.resource(dir: 'img/', file: 'logo.jpg')}" />
+		
+		<!-- Energy saved -->
+		<div style="position:absolute;top:10px;">
+			<div style="position:absolute;left:250px;color:white;">
+				<center style="width:150px;">
+					<p style="font-size:75%;">From start</p>
+					<p><b>1243432.45</b> kWh</p>
+					<p style="font-size:75%;">of energy saved</p>
+				</center>
+			</div>
+			<div style="position:absolute;left:400px;color:white;">
+				<center style="width:150px;">
+					<p style="font-size:75%;">Last year</p>
+					<p><b>87329.84</b> kWh</p>
+					<p style="font-size:75%;">of energy saved</p>
+				</center>
+			</div>
+			<div style="position:absolute;left:550px;color:white;">
+				<center style="width:150px;">
+					<p style="font-size:75%;">Last month</p>
+					<p><b>5644.56</b> kWh</p>
+					<p style="font-size:75%;">of energy saved</p>
+				</center>
+			</div>
+			<div style="position:absolute;left:700px;color:white;">
+				<center style="width:150px;">
+					<p style="font-size:75%;">Last week</p>
+					<p><b>453.00</b> kWh</p>
+					<p style="font-size:75%;">of energy saved</p>
+				</center>
+			</div>
+			<div style="position:absolute;left:850px;color:white;">
+				<center style="width:150px;">
+					<p style="font-size:75%;">Last day</p>
+					<p><b>23.28</b> kWh</p>
+					<p style="font-size:75%;">of energy saved</p>
+				</center>
+		</div>
+		</div>
+		<!-- / Energy saved -->
+		
 		<div id="header">
    			<h2>&nbsp;</h2>
 			<div id="topmenu">
Index: hci/trunk/eneraptor-web-app/grails-app/views/sysLog/main.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/sysLog/main.gsp	(revision 41)
+++ hci/trunk/eneraptor-web-app/grails-app/views/sysLog/main.gsp	(revision 42)
@@ -8,7 +8,10 @@
 <body>
 	
 	<erptr:box title="Log">
-		<p>TODO: Some information about log.</p>
+		<p>Log holds any information logged by input and output devices.</p>
+		<p>You can <g:link action="browse">browse</g:link> log entries manually, but be aware, that large intervals may take much time to process.</p>
+		<p>Eneraptor's storage space is limited, so you should <g:link action="clear">clear</g:link> the log entries when running out of space. To save old log entries you may use the <g:link action="export">export</g:link> function.</p>
+		<p>Log entries'' numeric data may be <g:link action="graph">viewed graphically</g:link> directly. If you want better and quicker results, you should use tools in the <g:link controller="statistics" action="main">Statistics</g:link> section instead.</p>
 	</erptr:box>
 	
 	<!-- DISK USAGE - ONLY IF ENERAPOTR HCI IS SUPERUSER
Index: hci/trunk/eneraptor-web-app/grails-app/views/sysLog/clear.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/sysLog/clear.gsp	(revision 0)
+++ hci/trunk/eneraptor-web-app/grails-app/views/sysLog/clear.gsp	(revision 42)
@@ -0,0 +1,37 @@
+<html>
+
+<head>
+	<title>Log &raquo; Browsing</title>
+	<meta name="layout" content="main" />
+</head>
+
+<body>
+	
+	<erptr:box title="Clear log entries">
+		<p>Devices to include / ignore:</p>
+		
+		<form id="clearForm" action="clearDo">			
+				<g:each in="${devicesForCheckBox}" var="deviceForCheckBox">
+					<label for="cb_${deviceForCheckBox.deviceId}">&nbsp;</label>
+					<g:checkBox name="cb_${deviceForCheckBox.deviceId}" value="${params['cb_' + deviceForCheckBox.deviceId]}"/>
+					<span>${deviceForCheckBox.friendlyName}</span>
+					<br />
+				</g:each>
+				<label for="all_cb">&nbsp;</label>
+				<g:checkBox name="all_cb" value="${params['all_cb']}" />
+				<span><b>All devices (including <i>unknown devices</i>)</b></span>
+			<br /><br />
+			<label for="fromDate">From</label>
+			<g:datePicker name="fromDate" value="${params.fromDate}" />
+			<br /><br />
+			<label for="tillDate">Till</label>
+			<g:datePicker name="tillDate" value="${params.tillDate}" />
+			<br /><br />
+			<g:submitButton name="submit" value="Clear" />
+		</form>
+		
+	</erptr:box>
+	
+</body>
+
+</html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/views/sysLog/browse.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/sysLog/browse.gsp	(revision 41)
+++ hci/trunk/eneraptor-web-app/grails-app/views/sysLog/browse.gsp	(revision 42)
@@ -7,6 +7,31 @@
 
 <body>
 	
+	<erptr:box title="Select device and interval">
+		<p>Please, select which devices to show / ignore:</p>
+		
+		<form id="browseForm" action="browse">			
+				<g:each in="${devicesForCheckBox}" var="deviceForCheckBox">
+					<label for="cb_${deviceForCheckBox.deviceId}">&nbsp;</label>
+					<g:checkBox name="cb_${deviceForCheckBox.deviceId}" value="${params['cb_' + deviceForCheckBox.deviceId]}"/>
+					<span>${deviceForCheckBox.friendlyName}</span>
+					<br />
+				</g:each>
+				<label for="all_cb">&nbsp;</label>
+				<g:checkBox name="all_cb" value="${params['all_cb']}" />
+				<span><b>All devices (including <i>unknown devices</i>)</b></span>
+			<br /><br />
+			<label for="fromDate">From</label>
+			<g:datePicker name="fromDate" value="${params.fromDate}" />
+			<br /><br />
+			<label for="tillDate">Till</label>
+			<g:datePicker name="tillDate" value="${params.tillDate}" />
+			<br /><br />
+			<g:submitButton name="submitButton" value="Show" />
+		</form>
+		
+	</erptr:box>
+	
 	<erptr:box title="Browse log">
 	
 		<table width="100%">
@@ -47,6 +72,8 @@
 		
 	</erptr:box>
 	
+	<js:checkBoxToggle />
+	
 </body>
 
 </html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/views/sysLog/export.gsp
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/views/sysLog/export.gsp	(revision 0)
+++ hci/trunk/eneraptor-web-app/grails-app/views/sysLog/export.gsp	(revision 42)
@@ -0,0 +1,41 @@
+<html>
+
+<head>
+	<title>Log &raquo; Browsing</title>
+	<meta name="layout" content="main" />
+</head>
+
+<body>
+	
+	<erptr:box title="Export log entries">
+		<p>Devices to include / ignore:</p>
+		
+		<form id="browseForm" action="exportDo" target="_blank">			
+				<g:each in="${devicesForCheckBox}" var="deviceForCheckBox">
+					<label for="cb_${deviceForCheckBox.deviceId}">&nbsp;</label>
+					<g:checkBox name="cb_${deviceForCheckBox.deviceId}" value="${params['cb_' + deviceForCheckBox.deviceId]}"/>
+					<span>${deviceForCheckBox.friendlyName}</span>
+					<br />
+				</g:each>
+				<label for="all_cb">&nbsp;</label>
+				<g:checkBox name="all_cb" value="${params['all_cb']}" />
+				<span><b>All devices (including <i>unknown devices</i>)</b></span>
+			<br /><br />
+			<label for="fromDate">From</label>
+			<g:datePicker name="fromDate" value="${params.fromDate}" />
+			<br /><br />
+			<label for="tillDate">Till</label>
+			<g:datePicker name="tillDate" value="${params.tillDate}" />
+			<br /><br />
+			<p>Options:</p>
+			<label for="format">Output format</label>
+			<g:select name="format" from="['Plain text (.txt)','PostgreSQL script (.sql)','Extensible Markup Language (.xml)']" />
+			<br /><br />
+			<g:submitButton name="submit" value="Export" />
+		</form>
+		
+	</erptr:box>
+	
+</body>
+
+</html>
\ No newline at end of file
Index: hci/trunk/eneraptor-web-app/grails-app/services/com/eneraptor/hci/MainMenuService.groovy
===================================================================
--- hci/trunk/eneraptor-web-app/grails-app/services/com/eneraptor/hci/MainMenuService.groovy	(revision 41)
+++ hci/trunk/eneraptor-web-app/grails-app/services/com/eneraptor/hci/MainMenuService.groovy	(revision 42)
@@ -26,7 +26,7 @@
 		mainMenuItems.add(new MenuItem("System state" ,"sysState"  ,"main"))
 		mainMenuItems.add(new MenuItem("Log"          ,"sysLog"    ,"main"))
 		mainMenuItems.add(new MenuItem("Statistics"   ,"statistics","main"))
-		mainMenuItems.add(new MenuItem("Actions"      ,"actions"   ,"main"))
+		mainMenuItems.add(new MenuItem("Scenarios"      ,"actions"   ,"main"))
 		mainMenuItems.add(new MenuItem("Configuration","config"    ,"main"))
 		
 		sysStateSubMenu = new ArrayList()
@@ -38,7 +38,19 @@
 		sysLogSubMenu.add(new MenuItem("Overview","sysLog","main"))
 		sysLogSubMenu.add(new MenuItem("Browse","sysLog","browse"))
 		sysLogSubMenu.add(new MenuItem("View logged data graphically","sysLog","graph"))
+		sysLogSubMenu.add(new MenuItem("Export","sysLog","export"))
+		sysLogSubMenu.add(new MenuItem("Clear","sysLog","clear"))
 		
+		statisticsSubMenu = new ArrayList()
+		statisticsSubMenu.add(new MenuItem("Overview","statistics","main"))
+		statisticsSubMenu.add(new MenuItem("Graphs","statistics","graphs"))
+		statisticsSubMenu.add(new MenuItem("Reports","statistics","reports"))
+		
+		actionsSubMenu = new ArrayList()
+		actionsSubMenu.add(new MenuItem("Overview","actions","main"))
+		actionsSubMenu.add(new MenuItem("View and edit","actions","view"))
+		actionsSubMenu.add(new MenuItem("Create new","actions","add"))
+		
 		configSubMenu = new ArrayList()
 		configSubMenu.add(new MenuItem("Overview","config","main"))
 		configSubMenu.add(new MenuItem("Configure HCI","config","hci"))
Index: hci/trunk/eneraptor-web-app/test/unit/com/eneraptor/EneGraphTests.groovy
===================================================================
--- hci/trunk/eneraptor-web-app/test/unit/com/eneraptor/EneGraphTests.groovy	(revision 0)
+++ hci/trunk/eneraptor-web-app/test/unit/com/eneraptor/EneGraphTests.groovy	(revision 42)
@@ -0,0 +1,17 @@
+package com.eneraptor
+
+import grails.test.*
+
+class EneGraphTests extends GrailsUnitTestCase {
+    protected void setUp() {
+        super.setUp()
+    }
+
+    protected void tearDown() {
+        super.tearDown()
+    }
+
+    void testSomething() {
+
+    }
+}
Index: hci/trunk/eneraptor-web-app/test/unit/com/eneraptor/hci/EneGraphTests.groovy
===================================================================
--- hci/trunk/eneraptor-web-app/test/unit/com/eneraptor/hci/EneGraphTests.groovy	(revision 0)
+++ hci/trunk/eneraptor-web-app/test/unit/com/eneraptor/hci/EneGraphTests.groovy	(revision 42)
@@ -0,0 +1,17 @@
+package com.eneraptor.hci
+
+import grails.test.*
+
+class EneGraphTests extends GrailsUnitTestCase {
+    protected void setUp() {
+        super.setUp()
+    }
+
+    protected void tearDown() {
+        super.tearDown()
+    }
+
+    void testSomething() {
+
+    }
+}
