You are viewing a plain text version of this content. The canonical link for it is here.
Posted to alois-commits@incubator.apache.org by fl...@apache.org on 2010/11/04 18:27:42 UTC

svn commit: r1031127 [19/22] - in /incubator/alois/trunk: ./ bin/ debian/ doc/ etc/ etc/alois/ etc/alois/apache2/ etc/alois/environments/ etc/alois/prisma/ etc/cron.d/ etc/default/ etc/logrotate.d/ prisma/ prisma/bin/ prisma/conf/ prisma/conf/prisma/ p...

Added: incubator/alois/trunk/rails/public/robots.txt
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/public/robots.txt?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/public/robots.txt (added)
+++ incubator/alois/trunk/rails/public/robots.txt Thu Nov  4 18:27:22 2010
@@ -0,0 +1 @@
+# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
\ No newline at end of file

Added: incubator/alois/trunk/rails/public/stylesheets/common.css
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/public/stylesheets/common.css?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/public/stylesheets/common.css (added)
+++ incubator/alois/trunk/rails/public/stylesheets/common.css Thu Nov  4 18:27:22 2010
@@ -0,0 +1,188 @@
+h1 { 
+  white-space:nowrap;
+}
+.homepageTitle { 
+  font-size: 2em;
+}
+
+a{ 
+  text-decoration:underline;
+ }
+
+.form { 
+  width: 100%;
+  border: 1px solid black;
+}
+
+.form_header, .form tr th.form_header { 
+  background-color:#A5314A;
+  font-weight:bold;
+}
+
+.form tr th { 
+  background-color:#DDDDDD;
+}
+.form tr td { 
+  background-color:#F0F0FF;
+}
+
+.box {
+	padding: 1px;
+        border:  1px dotted #A5314A;
+ 	vertical-align: top;
+	min-width: 62px;
+}
+
+.data * td {
+	background-color: #efefef;
+	border: none;
+}
+
+.data * th {
+	background-color: #d2d2d2;
+	border: none;
+}
+
+
+.show_hide { 
+  border-bottom:1px dotted black; 
+}
+.show_hide:hover { 
+  background-color:white;
+}
+
+.show_hide_element { 
+  z-index:10;
+  border:solid 1px black;
+  background-color: #d2d2d2;
+  position: absolute;
+  padding: 0px;
+  display: none; 
+  white-space:nowrap;
+}
+.show_hide_element:hover { 
+  display: block;
+}
+
+.button-bar, .form td.button-bar {
+  width: 100%;
+  background-color:#99BBFF;
+  padding: 3px;
+  text-align: center;
+}
+.button-bar input, .button-bar .button-to, .button-bar .button-to div, .button-bar div input {
+  display: inline;
+}
+
+#log_table th { 
+  background-color:#DDDDDD;
+ }
+
+
+#footer {
+    padding: 10px;
+}
+
+#header {
+  padding: 0px;
+  margin: 0px;
+}
+
+#page {
+  padding: 5px;
+  border:  1px dotted #A5314A;
+}
+
+.table-classes-center { 
+  border:1px solid black;
+}
+.table-classes-child { 
+  border-right:1px solid black;
+  border-top:1px solid black;
+  border-bottom:1px solid black;
+}
+.table-classes-parent { 
+  border-left:1px solid black;
+  border-top:1px solid black;
+  border-bottom:1px solid black;
+}
+
+.table-classes-selected { 
+  background-color: #76FF76;
+ }
+
+/** overview **/
+.paint_arrow {
+  margin-top:2px;
+  position:absolute;
+  font-size:7px;
+}
+.paint_arrow span a{
+  font-weight:bold;
+}
+.paint_link {
+  font-weight:bold;
+  font-color:white;
+}
+.paint_host {
+  margin-top:2px;
+  position:absolute;
+  font-size:7px;
+}
+.paint_host a {
+  color:white;
+  font-weight:bold;
+}
+
+#pumpy_queue a {
+  color:white;
+  font-weight:bold;
+}
+
+#pumpy_out a {
+  color:black;
+  font-weight:bold;
+}
+
+#alois_in a {
+  color:black;
+  font-weight:bold;
+}
+
+/** prisma/overview page **/
+
+.paint_arrow {
+  margin-top:2px;
+  position:absolute;
+}
+.paint_arrow span a{
+  font-weight:bold;
+}
+.paint_link {
+  font-weight:bold;
+  font-color:white;
+}
+.paint_host {
+  margin-top:2px;
+  position:absolute;
+}
+.paint_host a {
+  color:white;
+  font-weight:bold;
+}
+
+#pumpy_queue a {
+  color:white;
+  font-weight:bold;
+}
+
+#pumpy_out a {
+  color:black;
+  font-weight:bold;
+}
+
+#alois_in a {
+  color:black;
+  font-weight:bold;
+}
+

Added: incubator/alois/trunk/rails/public/stylesheets/imsec.css
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/public/stylesheets/imsec.css?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/public/stylesheets/imsec.css (added)
+++ incubator/alois/trunk/rails/public/stylesheets/imsec.css Thu Nov  4 18:27:22 2010
@@ -0,0 +1,212 @@
+base { 
+	target: "main" 
+	}
+
+body { 
+	background-color: #FAF5E4;
+	background-attachment: fixed;
+	text: #314273;
+	link: #A5314A;
+	text-align: left; 
+	font-family: Futura, Futura Bk BT, Futura Book BT, Tahoma, Arial, Helvetica, Lucida Sans, Lucida;
+	font-weight: 550;
+	color: #314273; 
+	margin: 0.5cm 0.5cm 0.5cm 0.5cm;
+	}
+	
+body.logo {
+	background-color: #FFFFFF;
+	
+	font-family: Futura, Futura Bk BT, Futura Book BT, Tahoma, Arial, Helvetica, Lucida Sans, Lucida;
+	font-weight: 550;
+	margin: 0 0 0 0;
+	}
+	
+body.main {
+	color: #314273;
+        background-color: #FAF5E4;
+        link: #FFFFFF;
+	visited: #000000;
+	
+	font-family: Futura, Futura Bk BT, Futura Book BT, Tahoma, Arial, Helvetica, Lucida Sans, Lucida;
+	font-weight: 550;
+   }
+	
+body.tab {
+	color: #314273;
+	background-color: #FFFFFF;
+        link: #FFFFFF;
+	visited: #000000;
+	margin: 0 0 0 0;
+	
+	font-family: Futura, Futura Bk BT, Futura Book BT, Tahoma, Arial, Helvetica, Lucida Sans, Lucida;
+	font-weight: 550;
+   }
+	
+body.list {
+	font-size: 70%;
+	color: #FAF5E4;
+	link: #FAF5E4;
+	background-color: #314273;
+	text-align: left;
+	margin: 0.2cm 0.2cm 0.2cm 0.2cm;
+
+	font-family: Futura, Futura Bk BT, Futura Book BT, Tahoma, Arial, Helvetica, Lucida Sans, Lucida;
+	font-weight: 550;
+	
+	}
+	
+body.bottom {
+	color: #F14273;
+	text: #314273;
+	background-color: #A5314A;
+	link: #FAF5E4;
+	visited: #FAF5E4;
+	/* text-align: right; */
+	font-size: 70%;
+	margin: 0 0 0 0;
+	}
+
+td {
+	font-family: Futura, Futura Bk BT, Futura Book BT, Tahoma, Arial, Helvetica, Lucida Sans, Lucida;
+	font-weight: 550;
+}
+
+tr {
+	font-family: Futura, Futura Bk BT, Futura Book BT, Tahoma, Arial, Helvetica, Lucida Sans, Lucida;
+	font-weight: 550;
+}
+
+th {
+	font-family: Futura, Futura Bk BT, Futura Book BT, Tahoma, Arial, Helvetica, Lucida Sans, Lucida;
+	font-weight: 550;
+}
+
+td.big {
+	font-size: 125%;
+	}
+
+th.big {
+	font-size: 125%;
+	}
+	
+th.red {
+	font-size:70%;
+	color: #FAF5E4;
+	}
+	
+P.bottom {
+	color: #314273;
+	text: #314273;
+	background-color: #A5314A;
+	link: #FAF5E4;
+	visited: #FAF5E4;
+	/* text-align: right; */
+	/*font-size: 60%;*/
+	}
+P.footer {
+	text-align: centered;
+	font-size: 50%;
+	}
+P.names {
+	font-family: Futura, Futura Bk BT, Futura Book BT, Tahoma, Arial, Helvetica, Lucida Sans, Lucida;
+/*	font-family: Futura Medium Condensed BT, Futura MdCn BT, Futura Light Condensed BT, Futura LtCn BT, Arial Narrow; */
+	text-align: left;
+	color: #314273;
+	link: #FF00FF;
+	visited: #FFFFFF;
+	}
+H1	{
+	text-align: left;
+	font-family: Futura Black, Futura XBlk BT, Futura Extra Black BT, Tahoma Fett, Tahoma Bold, Arial Black, Arial Bold, Arial, Swiss 742, Swiss, Lucida Sans, Lucida;
+	font-weight: 400;
+	}	
+H2	{
+	text-align: left;
+	font-family: Futura Black, Futura XBlk BT, Futura Extra Black BT, Tahoma Fett, Tahoma Bold, Arial Black, Arial Bold, Arial, Swiss 742, Swiss, Lucida Sans, Lucida;
+	font-weight: 400;
+	}	
+H3	{
+	text-align: left;
+	font-family: Futura Black, Futura XBlk BT, Futura Extra Black BT, Tahoma Fett, Tahoma Bold, Arial Black, Arial Bold, Arial, Swiss 742, Swiss, Lucida Sans, Lucida;
+	font-weight: 400;
+	}	
+H4	{
+	text-align: left;
+	font-family: Futura Black, Futura XBlk BT, Futura Extra Black BT, Tahoma Fett, Tahoma Bold, Arial Black, Arial Bold, Arial, Swiss 742, Swiss, Lucida Sans, Lucida;
+	font-weight: 400;
+	}	
+H5	{
+	text-align: left;
+	font-family: Futura Black, Futura XBlk BT, Futura Extra Black BT, Tahoma Fett, Tahoma Bold, Arial Black, Arial Bold, Arial, Swiss 742, Swiss, Lucida Sans, Lucida;
+	font-weight: 400;
+	}	
+
+	
+ul.listLevel1 { margin-top: 0cm;
+	 margin-left: 0cm;
+	 padding-left: 0.4cm;
+	 margin-bottom: 0.2cm;
+	}
+
+li.listLevel1 { margin-top: 0cm;
+	 margin-left: 0cm;
+	 padding-left: 0cm;
+	 margin-bottom: 0cm; 
+}
+
+ul.listLevel2 { margin-top: 0cm;
+	 margin-left: 0cm;
+	 padding-left: 0.4cm;
+	 margin-bottom: 0.2cm;
+	}
+
+li.listLevel2 { margin-top: 0cm;
+	 margin-left: 0cm;
+	 padding-left: 0cm;
+	 margin-bottom: 0cm; 
+}
+
+
+A.listLink:link {
+	text-decoration: none;
+	color: #FFFFFF;
+}
+A.listLink:visited {
+	text-decoration: none;
+	color: #FFFFFF;
+}
+A.listLink:active {
+	text-decoration: none;
+	color: #E8B0BC;
+}
+
+A.onRedLink:link {
+	color: #FAF5E4;
+	text-decoration: underline;
+}
+A.onRedLink:visited {
+	color: #FAF5E4;
+	text-decoration: underline;
+}
+A.onRedLink:active {
+	color: #FFFFFF;
+	text-decoration: underline;
+}
+
+A.docuLink:link {
+	color: #314273;
+	text-decoration: underline;
+}
+A.docuLink:visited {
+	color: #314273;
+	text-decoration: underline;
+}
+A.docuLink:active {
+	color: #A5314A;
+	text-decoration: underline;
+}
+
+#log_table { 
+  font-size:10pt;
+ }

Added: incubator/alois/trunk/rails/public/stylesheets/logintas.css
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/public/stylesheets/logintas.css?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/public/stylesheets/logintas.css (added)
+++ incubator/alois/trunk/rails/public/stylesheets/logintas.css Thu Nov  4 18:27:22 2010
@@ -0,0 +1,278 @@
+/*
+  Alois style for Logintas
+
+  Copyright (c) 2006 Marcus Holthaus <ma...@imsec.ch>
+  Copyright (c) 2006 Simon Huerlimann <si...@imsec.ch>
+  Copyright (c) 2006 IMSEC GmbH <http://www.imsec.ch>
+
+  Based on MoinMoin rightside-bar style
+  Copyright (c) 2001, 2002, 2003 by Juergen Hermann
+*/
+
+body {
+  background-color: #FAF5E4;
+  background-attachment: fixed;
+  color: #314273;
+  text-align: left; 
+  font-family: Futura, Futura Bk BT, Futura Book BT, Tahoma, Arial, Helvetica, Lucida Sans, Lucida, sans-serif;
+  font-weight: normal;
+  color: #314273; 
+  margin: 0;
+  padding: 0;
+}
+
+a {
+  color: #A5314A;
+}
+
+.footnotes div {
+  width: 5em;
+  border-top: 1px solid #e5e5e5;
+}
+
+textarea {
+    font-size: 1em;
+    font-family: monospace;
+}
+
+span.sep {
+    display: none;
+}
+
+/* user interface styles */
+
+#header {
+    border-bottom: 5px solid #A5314A;
+    line-height: 1.1em;
+    background-color: #FFFFFF;
+    width: 100%
+}
+
+#logo {
+  background-color: #FFFFFF;
+  font-weight: normal;
+  margin: 0 0 0 0;
+}
+
+#logo img {
+    height: 50px;
+    vertical-align: middle;
+}
+
+#logo a {
+    color: black;
+    text-decoration: none;
+    vertical-align: middle;
+}
+
+#header-text, #header-text span {
+  vertical-align: middle;
+  color: #A5314A;
+  font-weight: normal;
+  font-size:200%;
+  width: 100%;
+}
+
+#page, #message {
+    margin: 20px;
+}
+
+#sidebar {
+  font-size: 1.2em;
+  background-color: #314273;
+  color: #FAF5E4;
+}
+
+.sidepanel {
+
+}
+
+.sidepanel ul {
+  margin: 0px;
+}
+
+.sidepanel h1, .sidepanel h2 {
+  border: none;
+}
+.sidepanel li {
+  display: inline;
+  margin-left: 10px;
+  margin-right: 10px;
+}
+
+.sidepanel a {
+  text-decoration: none;
+}
+
+.sidepanel a:hover {
+  text-decoration: underline;
+}
+
+.actionsmenu select {
+    width: 160px;
+}
+
+#navibar li.current {
+  border: none;
+}
+
+#sidebar a {
+  color: #FAF5E4;
+}
+
+#message {
+  padding: 4px;
+  background-color: #F0ECE6;
+  border: 1px solid #9c9c9c;
+  border-bottom: 2px solid #9c9c9c;
+}
+
+#message p {
+  margin: 5px 0;
+  padding: 0;
+  font-weight: bold;
+}
+
+#message div.buttons {
+  font-weight: normal;
+}
+
+/* We use here dumb css1 ids because of IE suckiness */
+#editor-comment {width: 70%;}
+#editor-textarea {width: 100%;}
+
+#pagebottom {
+  clear: both;
+}
+
+#footer {
+  clear: both;
+  margin: 0;
+  padding: 0;
+
+  text-align: center;
+  font-size: 50%;
+}
+
+#address, #copyright {
+  font-size: 50%;
+  background-color: #A5314A;
+  color: #FAF5E4;
+
+  text-align: center;
+}
+
+#address a, #copyright a {
+  color: #FFFFFF;
+}
+
+#credits, #version, #timings{
+  margin: 5px 10px;
+  padding: 0;
+  text-align: center;
+  font-size: 0.88em;
+  color: #6C7680;
+}
+
+#credits li, #timings li {
+  display: inline;
+  padding: 0 2px;
+  margin: 0 4px;
+}
+
+#credits img {
+  vertical-align: middle;
+}
+
+/* Spans for line-anchors - uses * html hack so that the rule only applies to
+ * IE (where omitting the "display: none" triggers rendering bugs).
+ */
+* html span.anchor { display: none; }
+
+/* IE6 has a bug with rendering of float elements. We workaround this bug by
+ * assigning those elements a height attribute because we currently don't know
+ * a better solution. This results in IE calculating the correct height of the
+ * characters and displaying them correctly. We don't know any negative side
+ * effects of this workaround:
+ */
+* html div#page, * html div#header { height: 0.001%; }
+
+/* Logintas Theme */
+#header{
+        background-color: white;
+}
+
+body, #logo, #sidebar, #address, #copyright, #page {
+        background-color: white;
+        color: #314273;
+}
+
+.sidepanel, .sidepanel ul, .sidepanel h1, .sidepanel h2, .sidepanel a, #sidebar a {
+        color: #314273;
+}
+
+#sidebar {
+        border-bottom: 3px solid #A5314A;
+}
+
+.sidepanel li {
+}
+
+#header {
+    margin: 0;
+    border-bottom: 3px solid #A5314A;
+}
+
+#page, #header, #footer, #message {
+        padding: 10px;
+}
+
+#footer {
+    text-align: center;
+}
+
+#logo-text {
+        font-size: 25px;
+        font-weight: normal;
+        color: #3952AD;
+        text-align: center;
+        float: left;
+}
+
+#header, #logo-img, #logo-text {
+        border: none;
+}
+
+#header table, #header tr, #header td {
+        border: none;
+}
+
+#logo-text {
+        border-bottom: 2px dotted white;
+}
+
+h1, h2, h3 {
+  border: 0px;
+}
+
+
+/* Typo 3 */
+#sidebar {
+}
+
+.sidepanel ul {
+list-style-type: none;
+}
+
+.sidepanel h1 {
+font-size: 14px;
+color: #A5314A;
+text-decoration: none;
+}
+
+.sidepanel ul li a{
+font-size: 11px;
+color: #314273;
+margin-top: 0px;
+text-decoration: none;
+}

Added: incubator/alois/trunk/rails/public/stylesheets/menu-print.css
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/public/stylesheets/menu-print.css?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/public/stylesheets/menu-print.css (added)
+++ incubator/alois/trunk/rails/public/stylesheets/menu-print.css Thu Nov  4 18:27:22 2010
@@ -0,0 +1,93 @@
+/* Horizontal CSS Dropdown and Popout Menu */
+
+#menu {
+width: 100%;
+/* background: #eee; */
+float: left;
+z-index:100;
+}
+
+#menu ul {
+list-style: none;
+margin: 0;
+padding: 0; 
+/*width: 12em;*/
+float: left;
+z-index:100;
+}
+
+#menu a, #menu h2 {
+/* font: bold 11px/16px arial, helvetica, sans-serif; */
+/* border-width: 1px;
+border-style: solid;
+border-color: #ccc #888 #555 #bbb; */
+padding: 0px 0px 1px 0px; 
+margin: 0;
+display: none;
+white-space:nowrap;
+z-index:100;
+}
+
+#menu h2 {
+/* color: #fff;
+background: #000;
+text-transform: uppercase; */
+z-index:100;
+}
+
+#menu a {
+/* color: #000;
+  background: #efefef; */
+text-decoration: none; 
+z-index:100;
+}
+
+#menu a:hover {
+/*      color: #a00;
+      background: #fff; */
+z-index:100;
+}
+
+/* Positioning the Popout Menus and Dropdown Menus */
+
+#menu li {
+ position: relative;
+ z-index:100;
+}
+
+#menu ul ul {
+ position: absolute;
+ z-index:100;
+}
+
+#menu ul ul ul {
+position: absolute;
+top: 0;
+left: 100%;
+z-index:100;
+}
+
+/* Hiding and Revealing using :hover */
+
+div#menu ul ul {
+display: none;
+z-index:100;
+}
+
+div#menu ul ul,
+div#menu ul li:hover ul ul,
+div#menu ul ul li:hover ul ul,
+div#menu ul ul ul li:hover ul ul,
+div#menu ul ul ul ul li:hover ul ul
+{display: none;
+z-index:100;
+}
+
+div#menu ul li:hover ul,
+div#menu ul ul li:hover ul,
+div#menu ul ul ul li:hover ul,
+div#menu ul ul ul ul li:hover ul,
+div#menu ul ul ul ul ul li:hover ul
+{display: none;
+z-index:100;
+}

Added: incubator/alois/trunk/rails/public/stylesheets/menu.css
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/public/stylesheets/menu.css?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/public/stylesheets/menu.css (added)
+++ incubator/alois/trunk/rails/public/stylesheets/menu.css Thu Nov  4 18:27:22 2010
@@ -0,0 +1,100 @@
+/* Horizontal CSS Dropdown and Popout Menu */
+
+#menu {
+  width: 100%;
+  z-index:100;
+}
+
+#menu ul {
+  font-size:11pt;
+list-style: none;
+margin: 2;
+padding: 2; 
+/*width: 12em;*/
+float: left;
+z-index:100;
+background-color:white;
+
+}
+
+#menu a, #menu h2 {
+  font-size:11pt;
+/* font: bold 11px/16px arial, helvetica, sans-serif; */
+/* border-width: 1px;
+border-style: solid;
+border-color: #ccc #888 #555 #bbb; */
+padding: 0px 0px 1px 0px; 
+margin: 0;
+display: block;
+white-space:nowrap;
+z-index:100;
+}
+
+#menu h2 {
+/* color: #fff;
+background: #000;
+text-transform: uppercase; */
+z-index:100;
+}
+
+#menu a {
+/* color: #000;
+  background: #efefef; */
+text-decoration: none; 
+z-index:100;
+}
+
+#menu a:hover {
+/*      color: #a00;
+      background: #fff; */
+z-index:100;
+}
+
+/* Positioning the Popout Menus and Dropdown Menus */
+
+#menu li {
+ margin: 2;
+ padding: 2; 
+ position: relative;
+ z-index:100;
+}
+
+#menu ul ul {
+ border: 1px solid black;
+ position: absolute;
+ z-index:100;
+}
+
+#menu ul ul ul {
+position: absolute;
+top: 0;
+left: 100%;
+z-index:100;
+}
+
+/* Hiding and Revealing using :hover */
+
+div#menu ul ul {
+display: none;
+z-index:100;
+}
+
+div#menu ul ul,
+div#menu ul li:hover ul ul,
+div#menu ul ul li:hover ul ul,
+div#menu ul ul ul li:hover ul ul,
+div#menu ul ul ul ul li:hover ul ul
+{display: none;
+z-index:100;
+}
+
+div#menu ul li:hover ul,
+div#menu ul ul li:hover ul,
+div#menu ul ul ul li:hover ul,
+div#menu ul ul ul ul li:hover ul,
+div#menu ul ul ul ul ul li:hover ul
+{display: block;
+z-index:100;
+}
+
+

Added: incubator/alois/trunk/rails/public/stylesheets/modern.css
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/public/stylesheets/modern.css?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/public/stylesheets/modern.css (added)
+++ incubator/alois/trunk/rails/public/stylesheets/modern.css Thu Nov  4 18:27:22 2010
@@ -0,0 +1,316 @@
+/*Style sheet for NoProbs must be included to with HTML.*/
+/*Styles for body.*/
+body
+{
+	margin: 0 auto;
+	padding: 0;
+	font: 90% Verdana, Helvetica, Tahoma, Arial, sans-serif;
+	background: #F3F3F3 url(background.gif) top center repeat-y;
+	color: #494949;
+}
+
+/*Styles for main content which will be wrapped to centere. */
+#MainWrapper
+{
+/*	background: #ffffff;
+*/	color: #303030;
+	margin: 0 auto;
+	width: 100%;
+}
+
+/*Styles for the main header at the top. */
+#Header
+{
+	color:#ffffff;
+	background-color: #F3F3F3;
+}
+
+#Header a
+{
+	font-weight:normal;
+	font-size:27px;
+	text-decoration:none;
+	background-color: #79A3C1;
+	color:#ffffff;
+}
+
+#header
+{
+	display:none;
+}
+
+/*Styles for the main header menus. */
+#HeaderMenus, #mainnav
+{
+	color:#000000;
+	height:1.2em;
+	line-height:1.2em;
+	padding-left:11px;
+	margin:0 0 10px 0;
+	background-color: #dcdcdc;
+	border-bottom:solid 2px #a9a9a9;
+}
+#HeaderMenus ul, #mainnav ul
+{
+	padding: 0 0 0 0;
+	margin: 0 0 0 0;
+}
+#HeaderMenus li, #mainnav li
+{
+	float:left;
+	list-style-type:none;
+}
+#HeaderMenus li a, #mainnav li a
+{
+	display:block;
+	padding:0 10px;
+	font-size: 0.9em;
+	font-family: Verdana, Helvetica, Tahoma, Arial, sans-serif;
+	text-decoration:none;
+	background-color:inherit;
+	color:#000000;
+}
+#HeaderMenus .selected, #mainnav .selected
+{
+	color: #ffffff;
+	text-decoration: none;
+	background-color: #1D517C;
+}
+#HeaderMenus a:hover, #mainnav a:hover
+{
+	color: #336699;
+	text-decoration: none;
+	background-color:#AEB9CF;
+}
+
+/*Styles for the contens that are displayes in side column. */
+#SideContents, #metanav
+{
+	float:right;
+	width:170px;
+	color: #333300;
+	padding:0 6px 0 7px;
+	line-height:1.4em;
+/*	background-color:#ffffff;
+*/
+}
+#SideContents h3, #metanav h2
+{
+	color: #4D6E8F;
+	font-size: 1.1em;
+	margin: 0 auto;
+	padding: 0.8em 0 0.2em 0;
+	background-color:inherit;
+}
+#SideContents p, #metanav p
+{
+	font-size: 80%;
+	text-align: justify;
+	background-color:inherit;
+	color: #333300;
+	margin: 0 0 12px 0;
+}
+#SideContents a, #metanav a
+{
+        font-size: 90%;
+	text-decoration: none;
+	background-color:inherit;
+	color: #660000;
+}
+
+/*Styles for the main contets in the page. */
+#MainContent, #main
+{
+        font-size: 100%;
+	margin: 0 186px 0px 0px;
+	padding: 0 12px 0 10px;
+	border-right: 1px solid #DDD;
+	line-height: 1.6em;
+	min-height: 550px;
+}
+#MainContent h2, #main h2
+{
+	color:#000000;
+	font-size: 1.5em;
+	margin: 0.8em 0 0.8em 0;
+	background-color:inherit;
+	text-align: left;
+}
+#MainContent p, #main p
+{
+	color:#494949;
+	text-align: justify;
+	background-color:inherit;
+}
+#MainContent a, #main a
+{
+	text-decoration: none;
+	background-color:inherit;
+	color: #660000;
+}
+#MainContent img, #main img
+{
+	display:inline;
+	color: inherit;
+	background-color:inherit;
+#	border: 2px solid #79A3C1;
+}
+
+/*Styles for the page footer. */
+#Footer 
+{	
+	margin: 0 auto;
+	padding: 8px 0 2px 0;
+	border-top: 1px solid #ddd;
+	width: 760px;
+	text-align: center;
+	font-size: 0.9em;
+	line-height: 1.6em;
+}
+#Footer a 
+{
+	color: #000099;
+	background-color: inherit;
+	text-decoration: none;
+}
+#Footer a:hover 
+{
+	text-decoration: underline;
+}
+
+/*Styles for other classes. */
+.AlignLeft
+{
+	margin: 10px 10px 5px 0;
+	float: left;
+}
+.AlignRight
+{
+	margin: 10px 0 0 10px;
+	float: right;
+}
+
+/* histo.css */
+.note, .dfv_errors {
+	background-color: #ffffff;
+	color: #990000;
+	font-weight: bold;
+	text-align: center;
+	border-style: solid;
+	border-width: 1px;
+}
+
+.PAP_2A {color: black; background-color: yellow; }
+.PAP_2-3 {color: black; background-color: yellow; }
+.PAP_3L {color: black; background-color: #0066FF; }
+.PAP_3M {color: black; background-color: #0066FF; }
+.PAP_3S {color: black; background-color: #0066FF; }
+.PAP_4 {color: black; background-color: red; }
+.PAP_5 {color: black; background-color: red; }
+.PAP_hpv {color: black; background-color: #00CC00; }
+.PAP_mam {color: black; background-color: #00CC00; }
+
+
+
+/* Trac */
+
+
+/* Forms */
+input, textarea, select { margin: 2px }
+input, select { vertical-align: middle }
+select {
+ border: 1px solid #d7d7d7;
+}
+input[type=submit], input[type=reset] {
+ background: #eee;
+ color: #222;
+ border: 1px outset #ccc;
+ padding: .1em .5em;
+}
+input[type=submit]:hover, input[type=reset]:hover { background: #ccb }
+input[type=text], input.textwidget, textarea {
+ background: #fff;
+ color: #000;
+ border: 1px solid #d7d7d7;
+}
+input[type=text], input.textwidget { padding: .25em .5em }
+input[type=text]:focus, textarea:focus { border: 1px solid #886 }
+option { border-bottom: 1px dotted #d7d7d7 }
+fieldset { border: 1px solid #d7d7d7; padding: .5em; margin: 0 }
+fieldset.iefix { border: none; padding: 0; margin: 0 }
+* html fieldset.iefix { width: 98% }
+fieldset.iefix p { margin: 0 }
+legend { color: #999; padding: 0 .25em; font-size: 90%; font-weight: bold }
+label.disabled { color: #d7d7d7 }
+.buttons { margin: .5em .5em .5em 0 }
+.buttons form, .buttons form div { display: inline }
+.buttons input { margin: 1em .5em .1em 0 }
+
+
+
+#properties { white-space: nowrap; line-height: 160%; padding: .5em }
+#properties .main { margin-bottom: 1em }
+#properties .col1 {
+ border-right: 1px dotted #d7d7d7;
+ float: left;
+ margin-bottom: 1em;
+ width: 45%;
+}
+#properties .col2 { margin-left: 40% }
+#properties .main label, #properties .col1 label, #properties .col2 label {
+ float:left;
+ width: 7em;
+ text-align: right;
+ margin-right: .5em;
+}
+
+
+/* Styles for tabular listings such as those used for displaying directory
+   contents and report results. */
+table.listing {
+ clear: both;
+ border-bottom: 1px solid #d7d7d7;
+ border-collapse: collapse;
+ border-spacing: 0;
+ margin-top: 1em;
+ width: 100%;
+}
+table.listing th { text-align: left; padding: 0 1em .1em 0; font-size: 12px }
+table.listing thead { background: #f7f7f0 }
+table.listing thead th {
+ border: 1px solid #d7d7d7;
+ border-bottom-color: #999;
+ font-size: 11px;
+ font-weight: bold;
+ padding: 2px .5em;
+ vertical-align: bottom;
+}
+table.listing thead th :link:hover, table.listing thead th :visited:hover {
+ background-color: transparent;
+}
+table.listing thead th a { border: none; padding-right: 12px }
+table.listing th.asc a, table.listing th.desc a { font-weight: bold }
+table.listing th.asc a, table.listing th.desc a {
+ background-position: 100% 50%;
+ background-repeat: no-repeat;
+}
+table.listing th.asc a { background-image: url(../asc.png) }
+table.listing th.desc a { background-image: url(../desc.png) }
+table.listing tbody td, table.listing tbody th {
+ border: 1px dotted #ddd;
+ padding: .33em .5em;
+ vertical-align: top;
+}
+table.listing tbody td a:hover, table.listing tbody th a:hover {
+ background-color: transparent;
+}
+table.listing tbody tr { border-top: 1px solid #ddd }
+table.listing tbody tr.even { background-color: #fcfcfc }
+table.listing tbody tr.odd { background-color: #f7f7f7 }
+table.listing tbody tr:hover { background: #eed !important }
+
+.level10 { background-color:red; }
+.level20 { background-color:orange; }
+.level30 { background-color:gray; }
+.level40 { background-color:blue; }
+.level50 { background-color:green; }

Added: incubator/alois/trunk/rails/script/about
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/about?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/about (added)
+++ incubator/alois/trunk/rails/script/about Thu Nov  4 18:27:22 2010
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../config/boot'
+$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
+require 'commands/about'
\ No newline at end of file

Added: incubator/alois/trunk/rails/script/acl
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/acl?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/acl (added)
+++ incubator/alois/trunk/rails/script/acl Thu Nov  4 18:27:22 2010
@@ -0,0 +1,60 @@
+#!/usr/bin/ruby
+require 'libisi'
+init_libisi
+
+action, args = optparse( :actions =>{"objects" => "List all ACL objects"})
+
+require 'langscan'
+initialize_rails
+
+case action
+when "objects"
+  print "= Controllers =\n"
+  Dir.glob(RAILS_ROOT + "/app/controllers/*_controller.rb").sort.map {|c|
+    c =~ /([^\/]+)_controller.rb/
+    print " * " + $1.camelize + "Controller\n"
+    scanner = LangScan.choose(c)
+    c = Pathname.new(c)
+
+    scan = []
+
+    scanner.scan(c.readlines.join) {|element| scan << element}
+    
+    functions = []
+    acl = nil
+
+    scan.each_with_index { |el, i|
+      if el.type == :comment
+	acl = $1.strip if el.text =~ /ACL: (.*)/
+      end
+
+      next unless el.type == :fundef
+      nl = i
+      # find newline
+      while (scan[nl].type != :punct and scan[nl].text != "\n")
+	nl += 1
+      end
+      
+      if scan[i..nl].select {|e|
+	  e.type == :punct and e.text == "("
+	}.length > 0
+	# there are arguements, this is not accessible
+	# from outside
+      else
+	# this is accessible from outside
+	functions << {:name => el.text, :acl => acl}
+      end
+      acl = nil
+    }
+    
+    functions.sort_by {|f| f[:name] }.each {|f|
+      print "   * Function: #{f[:name]} => #{f[:acl]}\n"	  
+    }      
+  }
+
+  print "= Tables =\n"
+  $used_tables.sort_by(&:table_name).each {|t|
+    print " * #{t.table_name}\n"
+  }
+  end
+

Added: incubator/alois/trunk/rails/script/breakpointer
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/breakpointer?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/breakpointer (added)
+++ incubator/alois/trunk/rails/script/breakpointer Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/breakpointer'
\ No newline at end of file

Added: incubator/alois/trunk/rails/script/check_connections
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/check_connections?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/check_connections (added)
+++ incubator/alois/trunk/rails/script/check_connections Thu Nov  4 18:27:22 2010
@@ -0,0 +1,30 @@
+#!/usr/bin/ruby
+require "libisi"
+init_libisi
+optparse
+initialize_rails
+
+print "Connection check:"
+ret = subclasses_of(ActiveRecord::Base).map{ |klass| 
+  begin
+    print "\n  Checking class #{klass.name}..."
+    c = klass.connection
+    c.reconnect!
+    print "OK"
+    nil
+  rescue  
+    print "FAIL"
+    "  #{$!.message}\n"
+  end
+}.uniq.compact
+
+if ret.length == 0
+  print "\nAll connections active.\n"
+  exit 0
+else
+  print "\nConnection(s) failed with:\n"
+  for msg in ret 
+    print msg
+  end
+  exit 1
+end

Added: incubator/alois/trunk/rails/script/check_tables
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/check_tables?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/check_tables (added)
+++ incubator/alois/trunk/rails/script/check_tables Thu Nov  4 18:27:22 2010
@@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+require 'pathname'
+require File.dirname(Pathname.new(__FILE__).realpath) + '/../config/boot'
+require File.dirname(Pathname.new(__FILE__).realpath) + '/../config/environment'
+
+print "Table check\n"
+print "-----------\n\n"
+
+def check_type(description, type)
+  print "Checking #{description}:\n"
+  for klass in Prisma.get_classes(type)
+    print "  #{klass.name} --> #{klass.status}\n"
+  end
+end
+
+check_type("Raw Tables", :raw)
+check_type("Meta Tables", :meta)
+check_type("Message Tables", :message)
+

Added: incubator/alois/trunk/rails/script/compile_java
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/compile_java?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/compile_java (added)
+++ incubator/alois/trunk/rails/script/compile_java Thu Nov  4 18:27:22 2010
@@ -0,0 +1,7 @@
+#!/usr/bin/ruby
+require 'libisi'
+init_libisi
+optparse
+initialize_rails
+Chart.compile_command
+exit 0	

Added: incubator/alois/trunk/rails/script/console
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/console?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/console (added)
+++ incubator/alois/trunk/rails/script/console Thu Nov  4 18:27:22 2010
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require "pathname"
+require Pathname.new(__FILE__).realpath + '../../config/boot'
+require 'commands/console'

Added: incubator/alois/trunk/rails/script/create_fixture
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/create_fixture?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/create_fixture (added)
+++ incubator/alois/trunk/rails/script/create_fixture Thu Nov  4 18:27:22 2010
@@ -0,0 +1,25 @@
+#!/usr/bin/ruby
+# This is a helper script for outputting
+# sql table contents as fixtures.
+
+require File.dirname(__FILE__) + '/../config/boot'
+require File.dirname(__FILE__) + '/../config/environment'
+
+
+for arg in ARGV 
+  
+  file = RAILS_ROOT + "/test/fixtures"
+  p file
+  file = Pathname.new(file).realpath.to_s
+  p file
+  file = file + "/#{arg}.csv"
+  file = "/tmp/#{arg}.csv"
+
+  print "Generating #{file}?\n"
+  question_continue
+
+  ActiveRecord::Base.connection.execute("SELECT * INTO OUTFILE '#{file}'" +
+			     " FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'" +
+			     " FROM #{arg};")
+    
+end

Added: incubator/alois/trunk/rails/script/database
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/database?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/database (added)
+++ incubator/alois/trunk/rails/script/database Thu Nov  4 18:27:22 2010
@@ -0,0 +1,82 @@
+#!/usr/bin/ruby
+require "libisi"
+init_libisi(:ui => "console")
+
+delete = false
+recreate = false
+create = false
+load = false
+check = false
+migrate = false
+set_db = nil
+schema = false
+$force_local_connect = false
+
+def rake_task(task, local_connect = false)
+  error_message = "Rake error."
+  load_env {
+    ENV["LOCAL_CONNECT"] = "true" if $force_local_connect
+    # RAKE
+    $log.info("Doing #{task} localconnect #{$force_local_connect}...")
+    unless system("cd #{RAILS_ROOT}; /usr/bin/rake #{if $log.debug? then "--trace" else "--silent" end} --rakefile=#{RAILS_ROOT}/Rakefile \"#{task}\"")
+      $log.error(error_message)
+      exit $?.exitstatus
+    end
+    $log.info("... #{task} done.")
+  }
+end
+
+optparse {|o|
+  o.separator ""
+  o.separator "Use RAILS_ENV=(development|test|production) to select the correct environment."
+  o.separator "E.g. RAILS_ENV=test alsoi-database [OPTIONS]"
+
+  o.on( "-d", "--drop", "Drop the old database before adding." ) {|delete|}
+  o.on( "-c", "--create", "Create the necessary databases for ossim and alois." ) {|create|}
+  o.on( "-l", "--load", "Load the schema to existing database." ) {|load|}
+  o.on( "-r", "--recreate", "Recreate the ossim and alois databases." ) do |r|
+    delete = true
+    create = true
+  end
+  o.on("--schema", "Print the schema version." ) {|schema|}
+  o.on("--check", "Check if the current database structure matches the actual version." ) {|check|}
+  o.on( "-m", "--migrate", "Migrate the database to latest version." ) {|migrate|}
+  o.on( "-f", "--force-local-connect", "Forces to connect to local database with user root." ) {|$force_local_connect|} 
+  o.on( "-s", "--set DATABASE", "Sets the default database. BE CAREFUL WITH THIS OPTION!") do |db|
+    set_db = db
+  end
+}
+
+raise "No action selected." if not (delete || create || recreate || migrate || check|| set_db || schema || load)
+
+initialize_rails
+require "alois/utils"
+require "alois/config"
+
+if set_db
+  if set_db != ENV['DEFAULT_CONNECTION']
+    $log.warn("YOU WANT TO CHANGE THE DEFAULT DATABASE.")
+    $log.warn("ONLY CONTINUE IF YOU KNOW WHAT YOU DO.")
+    $log.warn("CURRENT DEFAULT IS '#{ENV['DEFAULT_CONNECTION']}'")
+    question_continue if $log.warn?
+    rake_task("alois:db:set_#{set_db}_db")
+  else
+    $log.warn("NOT CHANGING DEFAULT DATABASE.")
+    $log.warn("DEFAULT DATABASE IS ALREADY #{ENV['DEFAULT_CONNECTION']}.")
+  end
+end
+
+if $log.warn?
+  rake_task("alois:db:print_database")
+  question_continue
+end
+
+rake_task("alois:db:print_schema_version") if schema
+rake_task("alois:db:drop") if delete
+
+
+rake_task("alois:db:create") if create
+rake_task("db:schema:load") if create or load
+
+rake_task("alois:db:compare_schema") if check
+rake_task("db:migrate") if migrate

Added: incubator/alois/trunk/rails/script/dbconsole
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/dbconsole?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/dbconsole (added)
+++ incubator/alois/trunk/rails/script/dbconsole Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/dbconsole'

Added: incubator/alois/trunk/rails/script/destroy
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/destroy?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/destroy (added)
+++ incubator/alois/trunk/rails/script/destroy Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/destroy'

Added: incubator/alois/trunk/rails/script/fkey
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/fkey?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/fkey (added)
+++ incubator/alois/trunk/rails/script/fkey Thu Nov  4 18:27:22 2010
@@ -0,0 +1,29 @@
+#!/usr/bin/ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require File.dirname(__FILE__) + '/../config/environment'
+require "alois/utils"
+require "alois/config"
+
+a = []
+for klass in Prisma.get_classes
+  klass_n = klass.table_name
+
+  for source in klass.sources
+    source = source.table_name
+    a.push([klass_n,source])
+  end
+end
+
+a.sort{|x,y| x[1] <=> y[1] }
+
+ln = nil
+for e in a
+  klass_n=e[0]
+  source = e[1]
+
+  print "\n\n#{klass_n}\n" if ln != klass_n
+  ln = klass_n
+  
+  print "  t.column \"#{source}_id\", :integer\n"
+  print "  add_index \"#{klass_n}\", [\"#{source}_id\"], :name => \"#{klass_n}_#{source}_id_index\"\n"
+end

Added: incubator/alois/trunk/rails/script/generate
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/generate?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/generate (added)
+++ incubator/alois/trunk/rails/script/generate Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/generate'

Added: incubator/alois/trunk/rails/script/generate_testdata
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/generate_testdata?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/generate_testdata (added)
+++ incubator/alois/trunk/rails/script/generate_testdata Thu Nov  4 18:27:22 2010
@@ -0,0 +1,8 @@
+#!/usr/bin/ruby
+
+require 'pathname'
+require File.dirname(Pathname.new(__FILE__).realpath) + '/../config/boot'
+require File.dirname(Pathname.new(__FILE__).realpath) + '/../config/environment'
+
+p "Generated " + Prisma.generate_random_data.to_s + " records with archive"
+

Added: incubator/alois/trunk/rails/script/load_default_working_items
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/load_default_working_items?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/load_default_working_items (added)
+++ incubator/alois/trunk/rails/script/load_default_working_items Thu Nov  4 18:27:22 2010
@@ -0,0 +1,6 @@
+#!/usr/bin/ruby
+require 'pathname'
+require File.dirname(Pathname.new(__FILE__).realpath) + '/../config/boot'
+require File.dirname(Pathname.new(__FILE__).realpath) + '/../config/environment'
+print "Loading default working items.\n"
+Prisma.load_default_working_items

Added: incubator/alois/trunk/rails/script/make_snapshots
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/make_snapshots?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/make_snapshots (added)
+++ incubator/alois/trunk/rails/script/make_snapshots Thu Nov  4 18:27:22 2010
@@ -0,0 +1,90 @@
+#!/usr/bin/env ruby
+
+## Tip disable session restore for firefox.
+# Type about:config in your Firefox Address bar.
+# Select browser.sessionstore.enable
+# Double click to change the setting to false
+
+ENV["RAILS_ENV"] = "test"
+
+require 'pathname'
+require File.dirname(Pathname.new(__FILE__).realpath) + '/../config/boot'
+require File.dirname(Pathname.new(__FILE__).realpath) + '/../config/environment'
+
+$dir = "#{RAILS_ROOT}/tmp/snapshots/"
+FileUtils.mkdir($dir) unless File.exists?($dir)
+$resolution = "1280x1024x16"
+$host = "localhost:3999"
+$timeout = 10
+
+def take_screenshot(options = {})
+  name = (options[:name] or DateTime.now.strftime("%F &T"))
+  url = options[:url]   
+  return if File.exist?("#{$dir}/#{name}.png")
+  
+  pidf = fork do
+    p "firefox -height #{$resolution.split('x')[1]} -widht #{$resolution.split('x')[0]} -new-window '#{url}'"
+    exec("firefox -height #{$resolution.split('x')[1]} -widht #{$resolution.split('x')[0]} -new-window '#{url}'")
+  end
+  sleep (options[:timeout] or $timeout)
+ 
+  system("xwd -display :99 -root -out #{$dir}/#{name}.xwd")
+  system("convert #{$dir}/#{name}.xwd #{$dir}/#{name}.png")
+  File.delete("#{$dir}/#{name}.xwd")
+  Process.kill("TERM",pidf) 
+  Process.wait
+end
+
+# start xvfb
+pidx = fork do
+  exec("Xvfb :99 -screen 0 #{$resolution} -fbdir #{$dir}")
+end
+begin
+  while !File.exists?("#{$dir}/Xvfb_screen0")
+    sleep 1
+  end
+  ENV["DISPLAY"] = ":99"
+  
+  # initialize  data
+  system("rake db:fixtures:load")
+  Prisma.generate_random_data
+  # start mongrel
+  pidm = fork do
+    exec("./script/server -p 3999")
+  end
+  begin
+    
+    controllers = Dir.new("#{RAILS_ROOT}/app/controllers").entries
+    controllers.each do |controller|
+      if controller =~ /_controller/ 
+	cont = controller.camelize.gsub(".rb","")
+	#    klass = eval(cont)
+	
+	#    if klass.responds_to?(:screenshots)      
+	#    end
+      end
+    end
+    
+    sleep $timeout
+    
+    take_screenshot(:name => "Home",:url => "#{$host}")
+    take_screenshot(:name => "Database",:url => "#{$host}/prisma/databases")
+    take_screenshot(:name => "Views",:url => "#{$host}/views")
+    take_screenshot(:name => "Statistics",:url => "#{$host}/prisma/statistics")
+    take_screenshot(:name => "Alarms",:url => "#{$host}/alarms")
+    take_screenshot(:name => "Help",:url => "#{$host}/help")
+    take_screenshot(:name => "Table", :url => "#{$host}/table/view_11/list?state_id=test", :timeout => 2 * $timeout)
+    take_screenshot(:name => "Chart1", :url => "#{$host}/table/view_11/chart?chart%5Baggregation_column%5D=%2A&chart%5Baggregation_function%5D=COUNT&chart%5Bcolumn1%5D=facility&chart%5Bcolumn2%5D=&chart_type=bar&state_id=test#chart", :timeout => 3 * $timeout)
+    take_screenshot(:name => "Chart2", :url => "#{$host}/table/view_11/chart?chart%5Baggregation_column%5D=%2A&chart%5Baggregation_function%5D=COUNT&chart%5Bcolumn1%5D=level&chart%5Bcolumn2%5D=&chart_type=pie&state_id=test#chart", :timeout => 3 * $timeout)
+    take_screenshot(:name => "Schema", :url => "#{$host}/tablelist/schema/#{Message.find(:first,:order=>"id desc").id}?table=messages", :timeout => 3 * $timeout)
+    
+  ensure
+    # close mongrel
+    Process.kill("INT",pidm)
+    Process.wait
+  end
+    # close Xvfb
+ensure
+  Process.kill("TERM",pidx)
+  Process.wait
+end    

Added: incubator/alois/trunk/rails/script/mysql_alter_table_progress
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/mysql_alter_table_progress?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/mysql_alter_table_progress (added)
+++ incubator/alois/trunk/rails/script/mysql_alter_table_progress Thu Nov  4 18:27:22 2010
@@ -0,0 +1,121 @@
+#!/usr/bin/ruby
+require 'libisi'
+init_libisi
+optparse
+
+$pw = $ui.password("root pw?")
+$pw = "-p'#{$pw}'" unless $pw == ""
+print "Db:"
+$db = STDIN.readline.strip
+
+def mysql_status
+  ret = {}
+  cmd = "|mysql #{$pw} -e 'show innodb status\\G'"
+  $log.info(cmd)
+  open(cmd) {|f|
+    f.readlines.each {|l|
+      $log.debug{l.strip}
+      case l
+      when /(\d+) lock struct\(s\), heap size (\d+), undo log entries (\d+)/ 
+	# "12 lock struct(s), heap size 1024, undo log entries 1760\n"
+	$log.info(l.strip)
+	ret[:lock_structs] = $1.to_i
+	ret[:heap_size] = $2.to_i
+	ret[:undo_log_entries] = $3.to_i
+      when /MySQL thread id (\d+), query id (\d+) localhost (.*) copy to tmp table/
+	$log.info(l.strip)
+	ret[:modifying_thread_id] = $1
+	ret[:modifying_query_id] = $2
+	ret[:modifying_user] = $3
+      when /ALTER TABLE \`([^\`]+)\` (.*)$/
+	$log.info(l.strip)
+	ret[:modifying_query] = l
+	ret[:alter_table] = $1
+	ret[:alter_column] = $2
+      when /CREATE  INDEX \`([^\`]+)\` ON \`([^\`]+)\` \((.*)\)/
+	$log.info(l.strip)
+	ret[:modifying_query] = l
+	ret[:create_index_name] = $1
+	ret[:create_index_table] = $2
+	ret[:create_index_columns] = $3	
+      else
+      end
+    }
+  }
+  ret[:modifying_table] = (ret[:alter_table] or ret[:create_index_table])
+  ret
+end
+
+def table_status(table)
+  ret = {}
+  cmd = "|mysql #{$pw} #{$db} -e 'SHOW TABLE STATUS LIKE \"#{table}\"\\G'"
+  $log.info(cmd)
+  open(cmd) {|f|
+    f.each {|l|
+#*************************** 1. row ***************************
+#           Name: syslogd_metas
+#         Engine: InnoDB
+#        Version: 10
+#     Row_format: Compact
+#           Rows: 711329
+# Avg_row_length: 71
+#    Data_length: 50937856
+#Max_data_length: 0
+#   Index_length: 53067776
+#      Data_free: 0
+# Auto_increment: 714889
+#    Create_time: 2009-08-13 16:51:50
+#    Update_time: NULL
+#     Check_time: NULL
+#      Collation: utf8_general_ci
+#       Checksum: NULL
+# Create_options:
+#        Comment: InnoDB free: 98304 kB
+
+      $log.debug{l.strip}
+      if l =~ /^(.*)\: (.*)$/
+	ret[$1.strip.downcase.to_sym] = $2
+      end
+    }
+  }
+  ret  
+end
+
+while (true)
+  db_status = mysql_status
+  if ((table = db_status[:modifying_table]) and 
+      (query = db_status[:modifying_query]))
+
+    tbl_status = table_status(table)
+
+    $ui.progress_bar(query, tbl_status[:rows].to_i) {
+      while (query == db_status[:modifying_query])
+	$log.info(db_status[:undo_log_entries])
+  	$ui.progress(db_status[:undo_log_entries]) if db_status[:undo_log_entries]
+	sleep 1
+	db_status = mysql_status
+      end
+    }
+  else
+    $log.info("Waiting for altering table")
+  end
+  sleep 1
+end
+
+
+#p table
+#p query
+#p db_status
+
+exit 0
+=begin
+#!/bin/bash
+(while(true); do  \
+( ; sleep 1 ;  \
+mysql -e 'show innodb status \G' | grep undo\ log\ entries ) |    \
+egrep '[0-9][0-9][0-9][0-9]' |awk '{print $10;}' ; done ) | \
+perl -e '$t = ROWS_IN_TABLE; while(1) { \
+$n ++; $nn; $a = <>; $b = <>; $nn += ($b-$a); \
+printf "Rate: %d, avg: %d, %0.3f%% complete, done in %d sec\n", \
+$b-$a, $nn/$n, ($b/$t)*100, ($t-$b)/($nn/$n); }';
+=end

Added: incubator/alois/trunk/rails/script/performance/benchmarker
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/performance/benchmarker?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/performance/benchmarker (added)
+++ incubator/alois/trunk/rails/script/performance/benchmarker Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../../config/boot'
+require 'commands/performance/benchmarker'

Added: incubator/alois/trunk/rails/script/performance/profiler
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/performance/profiler?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/performance/profiler (added)
+++ incubator/alois/trunk/rails/script/performance/profiler Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../../config/boot'
+require 'commands/performance/profiler'

Added: incubator/alois/trunk/rails/script/plugin
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/plugin?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/plugin (added)
+++ incubator/alois/trunk/rails/script/plugin Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/plugin'

Added: incubator/alois/trunk/rails/script/process/inspector
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/process/inspector?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/process/inspector (added)
+++ incubator/alois/trunk/rails/script/process/inspector Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../../config/boot'
+require 'commands/process/inspector'

Added: incubator/alois/trunk/rails/script/process/reaper
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/process/reaper?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/process/reaper (added)
+++ incubator/alois/trunk/rails/script/process/reaper Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../../config/boot'
+require 'commands/process/reaper'

Added: incubator/alois/trunk/rails/script/process/spawner
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/process/spawner?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/process/spawner (added)
+++ incubator/alois/trunk/rails/script/process/spawner Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../../config/boot'
+require 'commands/process/spawner'

Added: incubator/alois/trunk/rails/script/runner
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/runner?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/runner (added)
+++ incubator/alois/trunk/rails/script/runner Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/runner'

Added: incubator/alois/trunk/rails/script/sentinel
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/sentinel?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/sentinel (added)
+++ incubator/alois/trunk/rails/script/sentinel Thu Nov  4 18:27:22 2010
@@ -0,0 +1,115 @@
+#!/usr/bin/ruby
+require 'optparse'
+report_directory = "/var/lib/prisma"
+
+send_event = false
+sentinel_name = nil
+sentinel_id = nil
+generate_crontab = false
+list_crontab = false
+opts = OptionParser.new do |o|
+  o.banner = "Usage: prisma-sentinel [options]"
+
+  o.on( "-s", "--send", "Send message to ossim-server." ) do |a|
+    send_event = true
+  end
+
+  o.on( "-s", "--sentinel SENTINEL", "The sentinel name to execute." ) do |a|
+    sentinel_name = a
+  end   
+
+  o.on( "-i", "--id SENTINEL_ID", "The sentinel id to execute." ) do |a|
+    sentinel_id = a
+  end   
+
+  o.on( "--list-crontab", "Writes generated crontab file to stdout." ) do |a|
+    list_crontab = true
+  end
+
+  o.on( "--generate-crontab", "Writes generated crontab file to crontab." ) do |a|
+    generate_crontab = true
+  end
+
+  o.on("-h", "--help", "This help." ) do
+    puts o
+    exit
+  end
+end
+
+
+begin
+  opts.parse!( ARGV )
+  
+  arg = ARGV[0]
+  unless list_crontab or generate_crontab
+    throw "Please specify a sentinel by id or name." if not (sentinel_name or sentinel_id)
+    throw "Please specify a name or an id for the sentinel." if (sentinel_name and sentinel_id)
+  end
+rescue => exc
+  STDERR.puts "E: #{exc.message}"
+  STDERR.puts opts.to_s
+  exit 1
+end
+
+require 'pathname'
+require File.dirname(Pathname.new(__FILE__).realpath) + '/../config/boot'
+require File.dirname(Pathname.new(__FILE__).realpath) + '/../config/environment'
+
+if generate_crontab or list_crontab
+  # check if script runs as prisma
+  require 'etc'
+  prisma_uid = Etc::getpwnam('prisma').uid
+  
+  # use as prisma-sentinel --generate_crontab | sudo -u primsa crontab -
+  crontab_entry = ""
+  crontab_entry += "# /etc/cron.d/alois-prisma: crontab entries for the prisma package\n"
+  crontab_entry += "# DO NOT EDIT THIS FILE\n"
+  crontab_entry += "# autogenerated by prisma\n"
+  crontab_entry += "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n"
+  crontab_entry += "MAILTO=root\n\n"
+  
+  for sentinel in Sentinel.find(:all, :conditions => "cron_interval IS NOT NULL").select {|s| s.enabled}
+    #      throw "Suspicious id found in filter!" unless "#{filter.id}" =~ /\d*/ 
+    #      throw "Suspicious interval found in filter!" if not filter.cron_interval =~ "[\d\/]*"
+    crontab_entry += "## Sentinel: #{sentinel.name}\n"
+    if sentinel.cron_interval =~ Sentinel::CRONTAB_REGEX 
+      crontab_entry += "#{sentinel.cron_interval}\t/usr/bin/prisma-sentinel --id #{sentinel.id}\n"      
+    else	
+      crontab_entry += "# INVALID/IGNORED --- #{sentinel.cron_interval}\t/usr/sbin/prisma-sentinel --id #{sentinel.id}\n\n"
+    end
+  end
+  crontab_entry += "\n# -- END OF FILE\n"
+
+  if generate_crontab
+    if Process.euid == prisma_uid then
+      Process.uid = prisma_uid
+      print "Writing crontab..."
+      ct = open("|crontab -","w")
+      ct.write(crontab_entry)
+      ct.close
+      print "DONE\n"
+      print "crontab -l:\n"
+      exec "crontab -l"
+    else
+      throw "Not run as user prisma."
+    end
+  end
+  if list_crontab
+    print crontab_entry
+  end
+  
+  exit 0
+end
+
+
+sentinel = Sentinel.find(sentinel_id) if sentinel_id
+sentinel = Sentinel.find_by_name(sentinel_name) if sentinel_name
+
+if sentinel == nil then
+  throw "Sentinel with id '#{sentinel_id}' not found!" if sentinel_id
+  throw "Sentinel with name '#{sentinel_name}' not found!" if sentinel_name
+end
+
+sentinel.process
+
+exit 0

Added: incubator/alois/trunk/rails/script/server
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/server?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/server (added)
+++ incubator/alois/trunk/rails/script/server Thu Nov  4 18:27:22 2010
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require "pathname"
+require Pathname.new(__FILE__).realpath + '../../config/boot'
+require 'commands/server'

Added: incubator/alois/trunk/rails/script/setup
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/setup?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/setup (added)
+++ incubator/alois/trunk/rails/script/setup Thu Nov  4 18:27:22 2010
@@ -0,0 +1,254 @@
+#!/usr/bin/ruby
+require "libisi"
+init_libisi
+
+PASSWORD_REGEX = /## SET PASSWORD HERE ##/
+BIN_DIR = Pathname.new(__FILE__).realpath.dirname
+$dryrun = false
+
+auto = false
+password = nil
+alois_password = nil
+http_password = nil
+skip_db_check = false
+optparse {|o|
+  o.on( "-a", "--auto", "Do not ask any questions and try to perform task without user interaction." ) {|auto| }
+  o.on( "-p", "--password PASSWORD", "Use this password to connect as root to the mysql database on localhost." ){|password|}   
+  o.on( "--alois-password PASSWORD", "Configure this password as credential to access the alois database from web and prisma." ) {|alois_password| @password = alois_password}
+  o.on( "--http-password PASSWORD", "Configure this password as credential to access the web frontend with user alois." ){|http_password|}
+  o.on( "--skip-db-check","Do not check if databases exist or needs migration") {|skip_db_check|}
+}
+
+DATABASE_COMMAND = "database -f #{if $log.debug? then "-vv" else "-q" end}"
+
+require "alois/utils"
+ENV["DB_ROOT_PASSWORD"] = (password or get_password("database root"))
+
+if check_mysql_password.class.name == "String"
+  $log.info("You have defined a new root password. Please restart this script.")
+  exit 1
+end
+
+def matching_lines(file, regex)
+  Pathname.new(file).readlines.grep(regex).length
+end
+
+def call_command(msg,cmd)
+  $log.info(msg)
+  cmd = (BIN_DIR.to_s + "/#{cmd}") unless cmd =~ /\//
+
+  if $dryrun
+    $log.debug("Would execute #{cmd.inspect}")
+    return true
+  else
+    $log.debug("Executing #{cmd.inspect}")
+    return system(cmd)
+  end
+end
+
+def get_database_status(name)
+  return :ok if $dryrun
+
+  system(BIN_DIR.to_s + "/" + DATABASE_COMMAND + " --schema")
+  $log.info("Exit stauts for db #{name} is: #{$?.exitstatus}")
+  case $?.exitstatus
+  when 0
+    # everythings fine
+    return :ok
+  when 1
+    # error ocurred
+    $log.error("#{name} database error.")
+    return :error
+  when 2
+    # migration needed
+    :migrate
+  when 3
+    # there is no database create it
+    :not_existing
+  when 4
+    # database is not initialized yet
+    :not_loaded
+  else
+    $log.error("Unexpected exit status from schema print '#{$?.exitstatus}'.")
+    exit 1
+  end
+end
+
+def create_database(name)
+  call_command("Using #{name} database.",DATABASE_COMMAND + " -s #{name}")
+
+  case get_database_status(name)
+  when :ok
+    $log.info("Database #{name} is OK.")
+    return
+  when :error
+    exit 1
+  when :migrate
+    $log.warn()
+    exit 1 unless $ui.question("Database needs migration, do this now?")
+    call_command("Setting up #{name} database.",DATABASE_COMMAND + " -m")
+  when :not_existing
+    $log.info("database does not exist, create it and load schem")
+    call_command("Setting up #{name} database.",DATABASE_COMMAND + " -c")
+  when :not_loaded
+    $log.info("database does exist but no schema loaded, load it")
+    call_command("Setting up #{name} database.",DATABASE_COMMAND + " -l")
+  end
+  
+  unless get_database_status(name) == :ok
+    $log.fatal("Database status for #{name} still not ok. Giving up.")
+    exit 2
+  end
+
+  $log.info("Setting mysql password for #{name} database.")
+end
+
+$log.info("You are about to configure your system to run alois.")
+
+def replace_in_file(file,regex,value)
+  return if $dryrun
+  new_text = Pathname.new(file).readlines.join.gsub(regex,value)  
+  open(file,"w") {|f|
+    f.write(new_text)
+  }
+
+end
+
+while matching_lines("/etc/alois/alois.conf",PASSWORD_REGEX) > 0
+  changed = true
+  if auto
+    if alois_password
+      replace_in_file("/etc/alois/alois.conf",PASSWORD_REGEX,"'#{alois_password.gsub("'","\\'")}'")
+    else
+      STDERR.write "Cannot automatically set alois password. No password given.\n"
+      STDERR.write "Specify it by option --alois-password or do it manually.\n" 
+      exit 1
+    end
+  else
+    $ui.info("Please replace ## SET PASSWORD HERE ## in '/etc/alois/alois.conf'\n" +
+	     "to a password you desire and press ENTER to continue.\n")
+  end
+end
+
+$log.info("Restarting apache2")
+system("/etc/init.d/apache2 restart") unless $dryrun
+
+unless skip_db_check
+  create_database("pumpy")
+  create_database("alois")
+end
+
+succ = call_command("Testing connections.","check_connections")
+if auto
+  if !succ
+    call_command("Setting up passwords.","updatepasswords --db --host localhost")    
+  end
+  if !call_command("Testing connections.","check_connections")
+    raise "Could not successfuly update passwords. Please run script manually."
+  end
+else
+  while !succ
+    print "Not all connections could be established.\n" +
+      "See message above. Alois can set the passwords\n" +
+      "for you. Want to do this?\n" +
+      "  yes:   do it.\n" +
+      "  list:  list only grants, and invoke them manually by you\n" +
+      "  check: check again.\n"
+    
+    ret = $ui.select(["yes","list","check"])[0]
+    $log.debug("Answer was #{ret.inspect}")
+    case ret
+    when "yes"
+      call_command("Setting up passwords.","updatepasswords --db --host localhost")      
+    when "list"
+      call_command("Setting up passwords.","updatepasswords --db -s --host localhost")
+    else
+      raise "Unexpected answer #{ret.inspect}"
+    end
+    
+    succ = call_command("Testing connections.","check_connections")
+  end
+end
+
+$log.info("Setting up syslog-ng.")
+changed = false
+while !$dryrun and matching_lines("/etc/syslog-ng/syslog-ng.conf",/Alois SQL Logging/) == 0
+  changed = true
+  if auto
+    raise "Could not append  /usr/share/doc/alois-sink/syslog-ng.conf.example to /etc/syslog-ng/syslog-ng.conf.\nPlease do it manually." if 
+      $dryrun or !system("cat /usr/share/doc/alois-sink/syslog-ng.conf.example >> /etc/syslog-ng/syslog-ng.conf")
+  else
+    print "Please append content of file /usr/share/doc/alois-sink/syslog-ng.conf.example\n"
+    print "# cat /usr/share/doc/alois-sink/syslog-ng.conf.example >> /etc/syslog-ng/syslog-ng.conf\n"
+    print "To syslog-ng and restart it. ENTER to continue.\n"  
+    STDIN.readline
+  end
+end
+call_command("Restart syslog-ng.","/etc/init.d/syslog-ng restart")
+call_command("Starting pipe.","/etc/init.d/prisma-mysqlpiped restart")
+
+def get_raws_index
+  return 0 if $dryrun
+  open("|#{BIN_DIR.to_s}/munin-sinkflows") {|f|
+    f.readlines.map {|l| l =~ /syslogd_raws_incoming.value (\d+)/; $1 }.compact[0].to_i
+  }
+end
+
+i = get_raws_index
+system("logger 'Alois setup test'") unless $dryrun
+sleep 1
+raise "No log recieved." unless get_raws_index > i
+
+$log.info("Setting up prisma.\n")
+changed = false
+while matching_lines("/etc/alois/environment.rb",/^\$do_not_run_prisma = true/) > 0
+  changed = true
+  if auto
+    replace_in_file("/etc/alois/environment.rb",/^\$do_not_run_prisma = true/,"$do_not_run_prisma = false")
+  else
+    print "Please change option $do_not_run_prisma in /etc/alois/environment.rb to false.\n"
+    print "If this option is set, prisma will not start (default behaviour\n"
+    print "to prevent unwanted processing from hosts).\n"
+    print "ENTER to continue.\n"
+    STDIN.readline
+  end
+ end
+
+raise "Error restarting prisma. Giving up." if !changed and
+  !call_command("Restarting prisma.", "/etc/init.d/prisma restart")
+
+def get_metas_index
+  return if $dryrun
+  i = open("|#{BIN_DIR.to_s}/munin-aloisdb") {|f|
+    f.readlines.map {|l| l =~ /syslogd_metas.value (\d+)/; $1 }.compact[0].to_i
+  }
+  $log.info("Meta index is #{i}")
+  i
+end
+
+i = get_metas_index
+
+system("logger 'Alois setup test'") unless $dryrun
+sleep 1
+raise "No log processed. Check /var/log/alois/prisma.* and restart prisma /etc/init.d/prisma restart." unless
+  get_metas_index > i
+
+$log.info("OK log processing works!")
+
+while matching_lines("/etc/alois/apache2/alois.passwd", /^alois\:x8C69afB0QydU$/) > 0
+  if !$dryrun and auto
+      $log.error("No http password provided but default http password defined in /etc/alois/apache2/alois.passwd.\nPlease change this manually.\n") unless http_password
+    unless system("htpasswd -b /etc/alois/apache2/alois.passwd alois '#{http_password.gsub("'","\'")}'")
+      STDERR.write "Could not change alois password in /etc/alois/apache2/alois.passwd. Please do it manually.\n"
+      exit 1
+    end    
+  else
+    print "Please change default alois password in /etc/alois/apache2/alois.passwd with:\n"
+    print " htpasswd /etc/alois/apache2/alois.passwd alois\n"
+    STDIN.readline 
+  end
+end
+
+call_command("Load default working items","load-default-working-items")
+
+exit 0

Added: incubator/alois/trunk/rails/script/updatepasswords
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/script/updatepasswords?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/script/updatepasswords (added)
+++ incubator/alois/trunk/rails/script/updatepasswords Thu Nov  4 18:27:22 2010
@@ -0,0 +1,169 @@
+#!/usr/bin/ruby
+require "libisi"
+init_libisi
+
+require 'optparse'
+require 'socket'
+require "fileutils"
+require 'termios'
+require 'pathname'
+require "alois/config"
+
+update_etc = false
+update_db = false
+update_ossim = false
+print_sql = false
+templateroot = "/etc/alois/templates"
+require "alois/utils"
+myname = hostname
+
+optparse do |o|
+  o.on( "-e", "--etc", "Updates passwords in the etc directory." ) {|update_etc|}  
+  o.on( "-d", "--db", "Updates passwords in the databases." ) {|update_db|}
+  o.on( "-s","--printsql","Print sql queries instead of execute." ) {|print_sql|}
+  o.on( "-o", "--ossim", "Updates ossimdatabase configuration." ) {|update_ossim|}
+  o.on( "--host HOSTNAME", "The name of the host to configure (this:#{myname})." ) do |hn|
+    myname = hn
+  end
+  
+  o.on( "-t", "--templates TEMPLATEROOT", "Template root (default:#{templateroot})." ) do |t|
+    templateroot = t
+  end
+end
+
+raise "No action selected." if not (update_etc || update_db || update_ossim)
+
+initialize_rails
+
+if update_etc then
+  configs = read_config()
+  replacements = get_replacements()
+
+  root = Pathname.new(templateroot)
+  etc = Pathname.new("/etc")
+  files = Dir.glob(root.join("**/*"))
+
+  for file in files
+    if File.file?(file)
+      relfile = Pathname.new(file).relative_path_from(root).to_s
+      
+      #      root.join(relfile)
+      if etc.join(relfile).file?() then
+	#  exists on computer so
+	# replace the markers and copy file
+	$log.info("Replacing file #{etc.join(relfile).to_s}.")
+
+	if not File.file?(etc.join(relfile).to_s + ".alois.bak") then
+	  FileUtils.copy(etc.join(relfile).to_s, etc.join(relfile).to_s + ".alois.bak")
+	end
+	
+	oFile = File.new(etc.join(relfile),"w")
+	
+	aFile = File.new(root.join(relfile))
+	aFile.each_line {|line| 
+	  str = line
+	  for (reg,val) in replacements
+	    str = str.gsub(reg.to_s,val.to_s)
+	  end
+	  print "WARNING: Not replaced:#{str}" if str =~ /\{\{/ or str =~ /\}\}/
+	  oFile.print(str)
+	}
+	oFile.close()
+      end
+      
+    end
+  end
+end
+
+if update_db then  
+   # find all databasekonfigurations for this host
+  configs = read_config()
+  connect_activerecord_local unless print_sql
+  
+  usable_configs = configs.select{|name,config| 
+    print "#WARNING: Configuraiton #{name} not found.\n" unless config
+    print "#WARNING: Configuration #{name} has unusable adapter '#{config["adapter"]}.\n" unless config["adapter"] == "mysql"
+    print "#WARNING: Configuration #{name} has no hosts defined.\n" unless config["hosts"]
+    config and config["host"] == myname and config["adapter"] == "mysql" and config["hosts"]
+  }
+
+
+  for (name,config) in usable_configs
+    # delete permissions and redefine it.
+    print "#Delete all permissions for #{config['username']} in database #{config['database']}.\n"
+    raise "DO NOT USE root TO CONNECT!!" if config["username"]=="root"
+    
+    cmd = "REVOKE ALL PRIVILEGES ON *.* FROM #{config['username']};"    
+    begin
+      print "#{cmd}\n"
+      ActiveRecord::Base.connection.execute(cmd) unless print_sql
+     rescue
+      raise if not $!.to_s =~ /There is no such grant/
+    end
+  end
+  
+  
+  done_one = false
+  users = {}
+  for (name,config) in usable_configs
+    done_one = true
+    # if the configurationdatabase is on this host
+    print "#Processing configuration #{name}.\n"
+    raise "password may not contain '" if (config["password"] =~ /\'/)
+    
+    for host in config['hosts']
+      print "#Setting new permissions (#{config['rights']}) for host: #{host}.\n"
+      
+      if not users["#{config['username']}@#{host}"].nil? and not users["#{config['username']}@#{host}"] == config['password'] then
+	print "#\n" if not done_one
+	print "##############################################\n" 
+	print "#       TWO DIFFERENT PASSWORDS FOR USER     #\n"  
+	print "# #{config['username']}@#{host} in #{myname}.\n"
+	print "#       ONLY SECOND WILL TAKE AFFECT!!!      #\n"  
+	print "##############################################\n" 
+	print "#\n" if not done_one
+      end
+      
+      users["#{config['username']}@#{host}"] = config['password']
+
+      for table in config['tables']
+	cmd = "GRANT #{config['rights']} ON #{config['database']}.#{table} TO "
+	cmd += "'#{config['username']}'@'#{host}' IDENTIFIED BY '#{config['password']}'"
+	print cmd + "\n" #if print_sql
+	
+	begin
+	  ActiveRecord::Base.connection.execute(cmd) if not print_sql
+	rescue
+	  print $!.to_s
+	end
+      end
+    end      
+  end
+  print "#\n" if not done_one
+  print "##############################################\n" if not done_one
+  print "#NO DB DEFINED FOR HOST #{myname}.\n" if not done_one
+  print "##############################################\n" if not done_one
+end
+
+if update_ossim then
+  configs = read_config()
+
+  ossim_config = configs["ossim"]
+  raise "ossim connection not found in #{}." if ossim_config == nil 
+  ossim_db_config = configs["ossim_database_configuration"]
+  raise "ossim_database_configuration not found." if ossim_db_config == nil 
+
+  ActiveRecord::Base.establish_connection({
+					    :adapter => ossim_config["adapter"],
+					    :database => ossim_config["database"],
+					    :host => ossim_config["host"],
+					    :username => ossim_config["username"],
+					    :password => ossim_config["password"],
+					    :port => ossim_config["port"],
+					  }) 
+  
+  for (config, value) in ossim_db_config
+    OssimConfig::set_value(config, value)
+  end
+
+end

Added: incubator/alois/trunk/rails/test/fixtures/alarms.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/alarms.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/alarms.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/alarms.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,9 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+<% 50.times {|i| %>
+
+alarm_<%= i %>:
+  id: <%= i %>
+  sentinel_id: 1
+  alarm_level: 4
+
+<% } %>
\ No newline at end of file

Added: incubator/alois/trunk/rails/test/fixtures/application_logs.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/application_logs.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/application_logs.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/application_logs.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,53 @@
+1:
+ id: 1
+ date: 2010-10-01
+ time: 12:00:00
+ message: Something
+
+2:
+ id: 2
+ date: 2010-10-01
+ time: 12:01:00
+ message: Something
+
+3:
+ id: 3
+ date: 2010-10-02
+ time: 12:02:00
+ message: Something
+
+4:
+ id: 4
+ date: 2010-10-02
+ time: 12:03:00
+ message: Something
+
+5:
+ id: 5
+ date: 2010-10-02
+ time: 12:04:00
+ message: Something
+
+6:
+ id: 6
+ date: 2009-02-02
+ time: 12:04:00
+ message: Something
+
+7:
+ id: 7
+ date: 2009-01-10
+ time: 12:04:00
+ message: Something
+
+8:
+ id: 8
+ date: 2009-01-01
+ time: 12:04:00
+ message: Something
+
+9:
+ id: 9
+ date: 2007-05-01
+ time: 12:04:00
+ message: Something

Added: incubator/alois/trunk/rails/test/fixtures/bookmarks.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/bookmarks.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/bookmarks.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/bookmarks.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,20 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  title: My Bookmark
+  description: For testing
+  table_name: MyString
+  mode: 
+  controller: AlarmsController
+  action: list
+  created_on: 2007-12-11
+
+two:
+  id: 2
+  title: MyString
+  description: MyText
+  table_name: MyString
+  mode: MyString
+  controller: MyString
+  action: MyString
+  created_on: 2007-12-11

Added: incubator/alois/trunk/rails/test/fixtures/charts.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/charts.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/charts.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/charts.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,92 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  name: Date Test Bars
+  description: For date report testing
+  column1: date
+  column2: time
+  aggregation_column: date
+  aggregation_function: COUNT
+  chart_type: bars
+  time_range: "2008-04-09"
+  height: 300
+  width: 300
+
+two:
+  id: 2
+  name: Other Test
+  description: Blabla
+  column1: date
+  column2: something
+  aggregation_column: date
+  aggregation_function: COUNT
+  chart_type: bars
+  height: 300
+  width: 300
+
+three:
+  id: 3
+  name: Date Test Pie
+  description: Aha
+  column1: date
+  column2:
+  aggregation_column: *
+  aggregation_function: COUNT
+  chart_type: pie
+  height: 300
+  width: 300
+
+bars:
+  id: 7
+  name: Bars test
+  description: Blabla
+  column1: date
+  column2:
+  aggregation_column: date
+  aggregation_function: COUNT
+  chart_type: bars
+  height: 400
+  width: 800
+  time_range:
+
+facility_pie:
+  id: 4
+  time_range: ""
+  name: Facility Pie
+  chart_type: pie
+  description: ""
+  height: "480"
+  order_by: COUNT(*) DESC
+  aggregation_column: "*"
+  column1: facility
+  width: "640"
+  aggregation_function: COUNT
+  column2: ""
+
+level_bars:
+  id: 5
+  time_range: ""
+  name: Understood Level Bars
+  chart_type: bar
+  description: ""
+  height: "480"
+  order_by: COUNT(*) DESC
+  aggregation_column: "*"
+  column1: level
+  width: "640"
+  aggregation_function: COUNT
+  column2: understood
+
+chart_bar:
+  id: 6
+  time_range: ""
+  name: Host Chart
+  chart_type: bar
+  description: ""
+  height: "480"
+  order_by: COUNT(*) DESC
+  aggregation_column: "*"
+  column1: host
+  width: "640"
+  aggregation_function: COUNT
+  column2: ""

Added: incubator/alois/trunk/rails/test/fixtures/charts_report_templates.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/charts_report_templates.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/charts_report_templates.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/charts_report_templates.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,30 @@
+# for date test
+date_test:
+ priority:
+ chart_id: 1
+ report_template_id: 1
+ view_id:
+
+date_test2:
+ priority:
+ chart_id: 7
+ report_template_id: 1 
+ view_id:
+
+#date_test2:
+# priority:
+# chart_id: 3
+# report_template_id: 1 
+# view_id:
+
+facility_pie:
+  chart_id: 4
+  report_template_id: 2
+
+level_bars:
+  chart_id: 5
+  report_template_id: 2
+
+chart_bar:
+  chart_id: 6
+  report_template_id: 2

Added: incubator/alois/trunk/rails/test/fixtures/connections.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/connections.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/connections.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/connections.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,17 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+one:
+  name: MyString
+  adapter: MyString
+  host: MyString
+  database: MyString
+  username: MyString
+  password: MyString
+
+two:
+  name: MyString
+  adapter: MyString
+  host: MyString
+  database: MyString
+  username: MyString
+  password: MyString

Added: incubator/alois/trunk/rails/test/fixtures/filters.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/filters.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/filters.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/filters.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,33 @@
+filter1:
+ id: 1
+ name: "Filter 1"
+
+today:
+  id: 2
+  name: Today
+  description: Today
+  yaml_declaration: |
+    ---
+    - !ruby/object:DateCondition
+      column: date
+      operator: DATE
+      options: {}
+
+      value: today
+
+  order_by:
+
+date_2007-05-01:
+  id: 3
+  name: Date 2007-05-01
+  description: 2007-05-01
+  yaml_declaration: |
+    ---
+    - !ruby/object:DateCondition
+      column: date
+      operator: =
+      options: {}
+
+      value: "2007-05-01"
+
+  order_by:

Added: incubator/alois/trunk/rails/test/fixtures/ip_ranges.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/ip_ranges.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/ip_ranges.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/ip_ranges.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,25 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+one:
+  id: 1
+  name: aa
+  description: dd
+  from_ip: 192.168.1.1
+  to_ip: 
+  netmask: 255.255.255.0
+
+two:
+  id: 2
+  name: bbb
+  description: 
+  from_ip: 192.168.1.1
+  to_ip: 
+  netmask: 255.255.255.0
+
+three:
+  id: 3
+  name: ccc
+  description: 
+  from_ip: 192.168.1.1
+  to_ip: 192.168.1.22
+  netmask: 255.255.255.0

Added: incubator/alois/trunk/rails/test/fixtures/report_templates.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/report_templates.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/report_templates.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/report_templates.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,35 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  name: DateTest
+  description: This is only for testing purpose
+  title: Date Test
+  text: "Some text with a chart here:<br><<CHART>><br>
+And a Table here:<br><<CHART>><br>
+The total count of records is: <<COUNT>><br>
+a Table:<br><<TABLE>><br>2nd table:<br><<TABLE>>"
+  view_id: 1
+  version: 1
+  created_on: 2008-03-25
+  created_at: 2008-03-25 13:52:45
+  modified_on: 2008-03-25
+  modified_at: 2008-03-25 13:52:45
+
+two:
+  id: 2
+  name: "Testing log metas statistics"
+  title: "Log meta statistic"
+  text: "There were a total of <<COUNT>> logs yesterday.<br><br>
+Overview of yesterdays syslog logs:<br>
+<<CHART>><br>
+Amount of understood and not understood messages:<br>
+<<CHART>><br>
+Distribution of source hosts:<br>
+<<CHART>><br>
+"
+  view_id: 
+  version: 1
+  created_on: 2008-03-25
+  created_at: 2008-03-25 13:52:45
+  modified_on: 2008-03-25
+  modified_at: 2008-03-25 13:52:45

Added: incubator/alois/trunk/rails/test/fixtures/report_templates_tables.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/report_templates_tables.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/report_templates_tables.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/report_templates_tables.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,12 @@
+# for date test
+date_test:
+ priority:
+ table_id: 1
+ report_template_id: 1
+ view_id:
+
+date_test2:
+ priority:
+ table_id: 2
+ report_template_id: 1
+ view_id:

Added: incubator/alois/trunk/rails/test/fixtures/reports.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/reports.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/reports.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/reports.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,19 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  name: Report One
+  date: 2008-03-26
+  time: 2008-03-26 09:24:25
+  path: /tmp/foo
+  report_template_id: 1
+  sentinel_id: 1
+  generated_by: sentinel
+
+two:
+  id: 2
+  date: 2008-03-26
+  time: 2008-03-26 09:24:25
+  path: MyString
+  report_template_id: 1
+  sentinel_id: 1
+  generated_by: MyString

Added: incubator/alois/trunk/rails/test/fixtures/sentinels.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/sentinels.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/sentinels.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/sentinels.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,40 @@
+sent1:
+ id: 1
+ name: "Some sentinel"
+ description: "Desc"
+ send_ossim: 0
+ send_mail: 0
+ view_id: 1
+ time_range:
+ threshold: 0
+ cron_interval: "0 0 0 0 0"
+
+sent2:
+ id: 2
+ name: "For testing today"
+ description: "Desc"
+ send_ossim: 0
+ send_mail: 0
+ view_id: 11
+ time_range: "today"
+ alarm_level: 3
+ action: 0
+ report_template: 1
+ threshold: 0
+ cron_interval: "0 0 0 0 0"
+ mail_to: ""
+
+sent3:
+ id: 3
+ name: "For testing yesterday"
+ description: "Desc"
+ send_ossim: 0
+ send_mail: 0
+ view_id: 11
+ time_range: "yesterday"
+ alarm_level: 3
+ action: 0
+ report_template_id: 2
+ threshold: 0
+ cron_interval: "0 0 0 0 0"
+ mail_to: ""

Added: incubator/alois/trunk/rails/test/fixtures/tables.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/tables.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/tables.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/tables.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,14 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  name: Date Test
+  description: For date report testing
+  columns: date, time
+  max_count: 1
+
+two:
+  id: 2
+  name: MyString
+  description: MyString
+  columns: time
+  max_count: 1

Added: incubator/alois/trunk/rails/test/fixtures/views.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/fixtures/views.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/fixtures/views.yml (added)
+++ incubator/alois/trunk/rails/test/fixtures/views.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,69 @@
+test1:
+ id: 1
+ name: "For always generating records"
+ sql_declaration: "SELECT CURRENT_DATE as date, CURRENT_TIME as time"
+
+test2:
+ id: 2
+ name: "Test 2"
+ sql_declaration: "SELECT CURRENT_DATE as date, CURRENT_TIME as time"
+
+test3:
+ id: 3
+ name: "Test X"
+ sql_declaration: "SELECT CURRENT_DATE as date, CURRENT_TIME as time"
+
+test4:
+ id: 4
+ name: "Test Y"
+ sql_declaration: "SELECT CURRENT_DATE as date, CURRENT_TIME as time"
+
+test5:
+ id: 5
+ name: "Test Z"
+ sql_declaration: "SELECT CURRENT_DATE as date, CURRENT_TIME as time"
+
+alois1:
+ id: 6
+ name: "Alois normal"
+ sql_declaration: "SELECT CURRENT_DATE as date, CURRENT_TIME as time"
+
+alois2:
+ id: 7
+ name: "Alois schnell"
+ sql_declaration: "SELECT CURRENT_DATE as date, CURRENT_TIME as time"
+
+alois3:
+ id: 8
+ name: "Alois ultraschnell"
+ sql_declaration: "SELECT CURRENT_DATE as date, CURRENT_TIME as time"
+
+allone:
+ id: 9
+ name: "Allone"
+ sql_declaration: "SELECT CURRENT_DATE as date, CURRENT_TIME as time"
+
+stallone:
+ id: 10
+ name: "Stallone Rock 5"
+ sql_declaration: "SELECT CURRENT_DATE as date, CURRENT_TIME as time"
+
+log_metas_with_syslogd_metas:
+ id: 11
+ name: Alois-Basis application_logs with syslogd_metas and messages
+ id_source_table: application_logs
+ description: Application logs
+ sql_declaration: "SELECT application_logs.`id`, application_logs.`date`, application_logs.`time`, message from application_logs"
+# sql_declaration: "SELECT application_logs.`id`, application_logs.`date`, application_logs.`time`, application_logs.`host`, application_logs.`syslogd_metas_id`, syslogd_metas.`ip`, syslogd_metas.`facility`, syslogd_metas.`priority`, syslogd_metas.`level`, hour(application_logs.time) as hour, minute(application_logs.time) minute , hour(application_logs.time) + minute(application_logs.time) / 100 as hourminute, msg, left(msg,10) as left_5_msg, left(msg,10) as left_10_msg, left(msg,15) as left_15_msg, msg is NULL as understood, replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(substring(msg,1, instr(msg, ' ')-1),'1',''),'2',''),'3',''),'4',''),'5',''),'6',''),'7',''),'8',''),'9',''),'0','') as msg_first FROM application_logs LEFT JOIN syslogd_metas ON application_logs.syslogd_metas_id = syslogd_metas.id LEFT JOIN source_db_metas ON syslogd_metas.source_db_metas_id = source_db_metas.id LEFT JOIN messages ON messages.`meta_type_name` = 'Prisma::LogM
 eta' AND messages.meta_id = application_logs.id"
+
+application_logs:
+ id: 12
+ name: 
+ sql_declaration: "SELECT * FROM application_logs"
+ id_source_table: application_logs
+
+union:
+ id: 13
+ name: Union query
+ sql_declaration: "SELECT * FROM view_11 UNION SELECT * FROM view_11"
+ id_source_table: application_logs

Added: incubator/alois/trunk/rails/test/functional/alarms_controller_test.rb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/test/functional/alarms_controller_test.rb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/test/functional/alarms_controller_test.rb (added)
+++ incubator/alois/trunk/rails/test/functional/alarms_controller_test.rb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,107 @@
+# Copyright 2010 The Apache Software Foundation.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+require File.dirname(__FILE__) + '/../test_helper'
+require 'alarms_controller'
+
+# Re-raise errors caught by the controller.
+class AlarmsController; def rescue_action(e) raise e end; end
+
+class AlarmsControllerTest < ActionController::TestCase
+  fixtures :alarms
+
+  def setup
+    @controller = AlarmsController.new
+    @request    = ActionController::TestRequest.new
+    @response   = ActionController::TestResponse.new
+
+    @first_id = Alarm.find(:first).id
+  end
+
+  def test_index
+    get :index
+    assert_response :success
+    assert_template 'status'
+  end
+
+  def test_list
+    get :list
+
+    assert_response :success
+    assert_template 'status'
+
+    assert_not_nil assigns(:alarms)
+  end
+
+  def test_show
+    get :show, :id => @first_id
+
+    assert_response :success
+    assert_template 'show'
+
+    assert_not_nil assigns(:alarm)
+    assert assigns(:alarm).valid?
+  end
+
+  def test_new
+    get :new
+
+    assert_response :success
+    assert_template 'new'
+
+    assert_not_nil assigns(:alarm)
+  end
+
+  def test_create
+    num_alarms = Alarm.count
+
+    post :create, :alarm => {}
+
+    assert_response :redirect
+    assert_redirected_to :action => 'list'
+
+    assert_equal num_alarms + 1, Alarm.count
+  end
+
+  def test_edit
+    get :edit, :id => @first_id
+
+    assert_response :success
+    assert_template 'edit'
+
+    assert_not_nil assigns(:alarm)
+    assert assigns(:alarm).valid?
+  end
+
+  def test_update
+    post :update, :id => @first_id
+    assert_response :redirect
+    assert_redirected_to :action => 'show', :id => @first_id
+  end
+
+  def test_destroy
+    assert_nothing_raised {
+      Alarm.find(@first_id)
+    }
+    assert_raise(RuntimeError) {
+      post :destroy, :id => @first_id
+    }
+#    assert_response :redirect
+#    assert_redirected_to :action => 'list'
+
+    assert_nothing_raised {
+      Alarm.find(@first_id)
+    }
+  end
+end