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 [12/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/app/views/survey/_data_table.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_data_table.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_data_table.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_data_table.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,87 @@
+
+<table style="width:100%" id="log_table">
+<% if @records %>
+ <tr>
+  <% for column in current_table.columns %>
+   <% if not column.name =~ /metas_id$/ then %>
+    <th nowrap="true" style="text-align: left" <%= show_hide(column.name,nil) %>">
+		<div style="position: relative; width: 100%">
+			<%= column.human_name %>
+			
+    <div <%= show_hide_element(column.name) %> style="right:0px;top:0px;">
+			<%= link_to_remote image_tag("up.png"), :update => 'survey_table', :before => "table_reload()", :url => { :action => 'list_inline', :order => "#{column.name}", :state_id => @state_id} %>
+				<%= link_to_remote image_tag("down.png"), :update => 'survey_table', :before => "table_reload()", :url =>{ :action => 'list_inline', :order => "#{column.name} DESC", :state_id => @state_id} %>
+				<%=link_to image_tag("pie-chart.png"), :action => 'chart', :chart_type => :pie, "chart[column1]" => column.name, "chart[column2]" => "", "chart[aggregation_column]"=>"*", "chart[aggregation_function]" => "COUNT",  :state_id => @state_id %>
+				<%=link_to image_tag("bar-chart.png"), :action => 'chart', :chart_type => :bar, "chart[column1]" => column.name, "chart[column2]" => "", "chart[aggregation_column]"=>"*", "chart[aggregation_function]" => "COUNT",  :state_id => @state_id %>
+				<% if Chart.column_supports_type?(column,"line") then %><%= link_to image_tag("line-chart.png"), :action => 'chart', :chart_type => :line, "chart[column1]" => column.name, "chart[column2]" => "", "chart[aggregation_column]"=>"*", "chart[aggregation_function]" => "COUNT", :state_id => @state_id %><% end %>
+			<span>
+		</div>
+	</th>
+   <% end %>
+  <% end %>
+<% if params[:show_originals] %>
+  <th>Original Message</th>
+<% end %>
+<% if not current_table.class.name =~ /View$/ %>
+  <th>
+    <%= link_to_remote image_tag("show.png"), :update => 'survey_table', :before => "table_reload()", :url => { :action => 'list_inline', :show_originals => !params[:show_originals], :state_id => @state_id} unless params[:show_originals]%>
+  </th>
+<% end %>
+  </tr>
+  <tr>
+<% record_index = 0 %>
+<% for record in @records %>
+  <% record_index = record_index + 1 %>
+  <tr>
+  <% column_index = 0 %>
+  <% for column in current_table.columns %>
+   <% if not column.name =~ /metas_id$/ then %>
+    <% column_index = column_index + 1 %>    
+    <% color_index = (column_index % 2 + record_index % 2) %>
+    <% color = "#FFFFFF;" if color_index == 2 %>
+    <% color = "#DDDDDD;" if color_index == 1 %>
+    <% color = "#BBBBBB;" if color_index == 0 %>
+    <td style="background-color:<%= color %>" <%= show_hide("#{record_index.to_s}x#{column_index}",nil) %> >
+		<div style="position: relative; width: 100%">
+			<%= format_column(record,column,record_index) %> 
+    <div <%= show_hide_element("#{record_index}x#{column_index}") %> style="right:0px;top:0px;">
+			<%= link_to_remote image_tag("remove.png"), 
+			:update => 'edit_filter', 
+			:url => { :controller=> 'filters', 
+				:action => 'add_condition', 
+				:column => column.name, 
+				:operator => '!=',
+				:value => record.send("#{column.name}_before_type_cast"), 
+				:state_id => @state_id},
+			:before => "table_reload()",
+			:loaded => 'update_table()'  %>
+		
+			<%= link_to_remote image_tag("add.png"), 
+			:update => 'edit_filter', 
+			:url => { :controller=> 'filters',
+				:action => 'add_condition', 
+				:column => column.name, 
+				:operator => '=', 
+				:value => record.send("#{column.name}_before_type_cast"), 
+				:state_id => @state_id},
+			:before => "table_reload()",
+			:loaded => 'update_table()'  %>
+		</div>
+	</div>
+   </td>
+  <% end %>
+ <% end %>
+<% if params[:show_originals] %>
+  <th><%=h record.original_text %></th>
+<% end %>
+
+<% if record.class.columns.map {|col| col.name}.include?("id") %>
+    <td><%= link_to image_tag("show.png", :title => 'Show'), :action => 'show', :id => record["id"], :state_id => @state_id %></td>
+<% end %>
+  </tr>
+<% end %>  
+<% else %>
+<tr><td>No records to display.</td></tr>
+<% end %>
+
+</table>	

Added: incubator/alois/trunk/rails/app/views/survey/_db_info.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_db_info.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_db_info.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_db_info.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,7 @@
+<fieldset style="width: 100%">
+  <legend>DB Infos</legend>
+  Host: <%= @table_class.host %> <br/>
+  Name: <%= @table_class.connection.current_database %><br>
+  Time: <%= @table_class.connection.execute("SELECT CURRENT_DATE as date").fetch_hash['date'] %>
+	<%= @table_class.connection.execute("SELECT CURRENT_TIME as time").fetch_hash['time'] %> 
+</fieldset>

Added: incubator/alois/trunk/rails/app/views/survey/_edit_named_filters.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_edit_named_filters.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_edit_named_filters.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_edit_named_filters.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,36 @@
+<div id="named_filters">
+
+  <% if @filters and @filters.length > 0 %>
+    <table class="form">
+  <!-- Filters -->
+      <tr>
+        <th colspan="2" class="form_header">Filter</th>
+      </tr>
+
+      <tr>
+        <td colspan="2">
+
+          <table class="form" style="border:none">  
+            <tr>
+              <th>Name</th><th>Conditions</th><th>&nbsp;</th>
+            </tr>
+
+            <% for filter in @filters %>
+            <tr>
+              <td><%= filter.name %></td>
+              <td><%= render_component :controller => "filters", :action => "show_inline", :id => filter.id %></td>
+              <td><%= link_to_remote image_tag("remove.png"), 
+                    :before => "table_reload()",
+                    :update => 'named_filters', 
+                    :loaded => "update_table()", 
+                    :url => {:controller=> 'survey', :action => 'remove_filter', :filter_id => filter.id, :state_id => @state_id } %><%= help_button "survey","remove_filter" %>
+              </td>
+            </tr>
+            <% end %>
+
+          </table>
+        </td>
+      </tr>
+    </table>
+  <% end %>
+</div>

Added: incubator/alois/trunk/rails/app/views/survey/_filters.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_filters.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_filters.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_filters.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,35 @@
+<!-- Filters -->
+<%= render :partial => "edit_named_filters" %>
+
+<table class="form">
+<tr>
+  <th colspan="2" class="form_header">Conditions</th>
+</tr>
+<tr>
+  <td colspan="2">
+    <%= render :partial => "/filters/form", :state_id => @state_id %>
+  </td>
+</tr>
+<tr>
+  <td colspan="2" class="button-bar">
+    <!-- Filter-Actions -->
+	<%= button_to "Create Filter", :controller=> 'filters', :action => 'new', :use_current => true, :state_id => @state_id %><%= help_button "survey","create_filter" %>
+	<%= button_to_function "Clear", remote_function(:update => 'edit_filter', 
+		:before => "table_reload()",
+                :loaded => "update_table()", 
+		:url => {:controller=> 'filters', 
+			 :action => 'clear_current_filter', 
+			 :state_id => @state_id}) %>
+	
+	<% form_remote_tag( :update => 'named_filters', 
+      :loaded => "update_table()", 
+			:before => "table_reload()",
+			:url => {:action => 'add_filter',:state_id => @state_id}, 
+			:html => { :style => 'display: inline' }) do %>
+		<%= submit_tag "Add filter: ", :style => 'display: inline'  %>
+		<%= select "survey", "filter_id", Filter.find(:all).reject{|filter| !filter.applyable(@table_class)}.collect { |f| ["#{f.name} (ID #{f.id})", f.id]}  %><%= help_button "survey", "add_filter" %>
+	<% end %>
+  </td>
+</tr>
+</table>
+

Added: incubator/alois/trunk/rails/app/views/survey/_form.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_form.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_form.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_form.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,34 @@
+<%= error_messages_for 'last_log' %>
+
+<!--[form:last_log]-->
+<p><label for="last_log_ip">Ip</label><br/>
+<%= text_field 'last_log', 'ip'  %></p>
+
+<p><label for="last_log_host">Host</label><br/>
+<%= text_field 'last_log', 'host'  %></p>
+
+<p><label for="last_log_facility">Facility</label><br/>
+<%= text_field 'last_log', 'facility'  %></p>
+
+<p><label for="last_log_priority">Priority</label><br/>
+<%= text_field 'last_log', 'priority'  %></p>
+
+<p><label for="last_log_level">Level</label><br/>
+<%= text_field 'last_log', 'level'  %></p>
+
+<p><label for="last_log_tag">Tag</label><br/>
+<%= text_field 'last_log', 'tag'  %></p>
+
+<p><label for="last_log_date">Date</label><br/>
+<%= date_select 'last_log', 'date'  %></p>
+
+<p><label for="last_log_time">Time</label><br/>
+</p>
+
+<p><label for="last_log_program">Program</label><br/>
+<%= text_field 'last_log', 'program'  %></p>
+
+<p><label for="last_log_msg">Msg</label><br/>
+<%= text_area 'last_log', 'msg'  %></p>
+<!--[eoform:last_log]-->
+

Added: incubator/alois/trunk/rails/app/views/survey/_host_info.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_host_info.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_host_info.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_host_info.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,5 @@
+<fieldset style="width: 100%">
+  <legend>Host Infos</legend>
+  Host: <%= hostname %> <br/>
+  Time: <%= Time.now().to_s %><br/>  
+</fieldset>

Added: incubator/alois/trunk/rails/app/views/survey/_named_filters.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_named_filters.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_named_filters.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_named_filters.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,8 @@
+<% for filter in @filters %>
+  <fieldset>
+    <legend>
+	<%= filter.name %> 
+    </legend>
+    <%= render_component :controller => "filters", :action => "show_inline", :id => filter.id %>
+  </fieldset>
+<% end %>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/survey/_original.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_original.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_original.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_original.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,21 @@
+<table class="data">
+<% found = false %>
+<%  @record.original.each {|orig| %>
+   <% found = true %>
+   <tr><th colspan="3">Original <%= if orig.respond_to?(:origin) then orig.origin end %><th></tr>
+   <% if orig.class.respond_to?("columns") %>
+       <% for column in orig.class.columns %>
+       <tr>
+          <th><%=h column.human_name %>:</td>
+          <td><%=h orig.send(column.name) %></td>
+          <td>&nbsp;</td>
+      </tr>
+      <% end %>
+   <% else %>
+      <tr><th><%= orig.class.name %></th><td><%= orig.to_s %></td></tr>
+   <% end %>
+<% } %>
+</table>
+<% unless found %>
+No original message found.
+<% end %>

Added: incubator/alois/trunk/rails/app/views/survey/_pagination_form.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_pagination_form.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_pagination_form.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_pagination_form.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,34 @@
+<% if @records %>
+<% will_paginate(@records, :param_name => "page_number") %>  <% page_entries_info(@records) %>
+
+
+<% form_remote_tag :update => 'survey_table',
+	:before => "table_reload()",
+	:url => {:action => 'list_inline', :state_id => @state_id} do %>
+
+
+
+Displaying <%= text_field_tag "paging_size", (@records.per_page), :size => 5,:style => "text-align:right;" %> items per page.
+Current page is <%= link_to_remote  image_tag("left.png", :alt => "Previous #{pluralize((@records.per_page),'record')}") , :update => 'survey_table', 
+	:before => "table_reload()",
+	:url => {:action => 'list_inline', 
+			:state_id => @state_id,
+			:page_number => (@records.previous_page)} if (@records.previous_page) %>
+<%= text_field_tag "page_number", (@records.current_page), :size => 4, :style => "text-align:right;" %> 
+<%= link_to_remote image_tag("right.png",:alt=>"Next #{pluralize((@records.per_page),'record')}"), :update => 'survey_table',
+	:before => "table_reload()",
+	 :url => {:action => 'list_inline', 
+			:state_id => @state_id,
+			:page_number => (@records.next_page)} if (@records.next_page) %>
+<% if count_fast %>
+of <%= @records.total_pages %>.
+<% end %>
+Top item has offset <%= text_field_tag "page_offset", @page_offset, :size => 5 %>. 
+
+  <%= submit_tag 'Go' %>
+<% end %>
+<% end %>
+
+
+
+

Added: incubator/alois/trunk/rails/app/views/survey/_remove_filter_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_remove_filter_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_remove_filter_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_remove_filter_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,2 @@
+<%= help_title("Remove Filter") %>
+<p>Press the <%= image_tag("remove.png")%> button near the filter you want to delete.</p>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/survey/_show_filters.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_show_filters.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_show_filters.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_show_filters.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,14 @@
+<!-- Filter Select -->
+
+<!-- Filters -->
+<div id="named_filters">
+  <%= render :partial => "named_filters", :params => {:disabled => true} %>
+</div>
+
+<!-- Current Filter -->
+<fieldset style="width: 100%">
+  <legend>Current Filter</legend>
+  <%= render_component :controller => "filters", :action => "show_inline", :params => {:state_id => @state_id}%>
+</fieldset>
+
+<!-- Filter-Actions -->

Added: incubator/alois/trunk/rails/app/views/survey/_table.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_table.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_table.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_table.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,45 @@
+<div id="survey_table">
+
+<%= javascript_tag("function update_table() {" + remote_function(:update => 'survey_table', :url => { :controller=> 'survey', :action => 'list_inline', :state_id => @state_id }) + "}") %>
+
+<%= javascript_tag("function table_invalid(){Element.setStyle('log_table', {'background-color' : '#FFBBBB'})}") %>
+<%= javascript_tag("function table_reload(){Element.setStyle('log_table', {'background-color' : '#FFFF66'})}") %>
+<%= javascript_tag("function table_valid(){Element.setStyle('log_table', {'background-color' : 'transparent'})}") %>
+
+<%= show_hide_script %>
+<table class="form">
+  <tr>
+    <th colspan="2" class="form_header">Data</th>
+  </tr>
+  <tr>
+   <td colspan="2" class="button-bar">
+	<%= button_to 'Chart', {:action => 'chart',:state_id => @state_id }%>
+	<%= button_to "Create View", {:action => 'create_view', :state_id => @state_id} %>
+	<%= button_to_function('Hide query', "Element.toggle('action_hide_query','action_show_query', 'query')", :id => 'action_hide_query', :style => 'display: none' ) %>
+	Download data as: <%= button_to 'CSV', {:action => 'csv', :show_originals => params[:show_originals], :state_id => @state_id }%>
+	<%= button_to 'Text', {:action => 'text',:show_originals => params[:show_originals],:state_id => @state_id }%>
+	<%= button_to 'PDF', {:action => 'pdf',:show_originals => params[:show_originals],:state_id => @state_id }%>
+   </td>
+  <tr>
+  <tr id="query">
+    <th style="width: 20%; text-align: left">Query <%= short_help("Query","This query describes the current datasource containing all selected conditions  and filters.") %></th>
+    <td>
+	<%= create_links_in_query(@query_string) %>
+    </td>
+  </tr>
+  <tr>
+    <th style="width: 20%; text-align: left">Count <%= short_help("Count","The total count of the data source plus the percentage of the selected set. Because counting can be very slow, by default this field is not calculated. Pleas click on 'Calculate' to get the values.") %></th>
+    <td>  <span id="count_text"><%= render :partial => 'count_text' %></span>
+    </td>
+  </tr>
+  <tr>
+    <th style="width: 20%; text-align: left">Paging</th>
+    <td>
+      <%= render :partial => 'pagination_form' %>
+    </td>
+  </tr>
+    <td colspan="2"><%= render :partial => 'data_table' %></td>
+  </tr>
+   
+</table>
+</div>

Added: incubator/alois/trunk/rails/app/views/survey/_zoom_form.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_zoom_form.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_zoom_form.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_zoom_form.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,34 @@
+<table>
+
+<tr><td>Image Size:</td><td><% form_tag url_for( :action => "chart", :state_id => @state_id ) do %>
+  <%= link_to image_tag('zoom_out.png'), {"chart[zoom]" => (@chart.zoom*0.666666), :action => "chart", :state_id => @state_id} %>
+  <%= text_field "chart", "zoom", :size => 3 %> 
+  <%= link_to image_tag('zoom_in.png'), {"chart[zoom]" => @chart.zoom * 1.5,:action => "chart", :state_id => @state_id} %> 
+  <%= submit_tag 'Apply', :style=>"display:none;" %> 
+<% end %>
+</td>
+
+<td>Width:</td><td><% form_tag url_for( :action => "chart", :state_id => @state_id ) do %>
+  <%= link_to image_tag('zoom_out.png'), {"chart[width]" => (@chart.width*0.666666), :action => "chart", :state_id => @state_id} %>
+  <%= text_field "chart", "width", :size => 3 %> 
+  <%= link_to image_tag('zoom_in.png'), {"chart[width]" => @chart.width * 1.5,:action => "chart", :state_id => @state_id} %> 
+  <%= submit_tag 'Apply', :style=>"display:none;" %> 
+<% end %>
+</td>
+
+<td>Height:</td><td><% form_tag url_for( :action => "chart", :state_id => @state_id ) do %>
+  <%= link_to image_tag('zoom_out.png'), {"chart[height]" => (@chart.height*0.666666), :action => "chart", :state_id => @state_id} %>
+  <%= text_field "chart", "height", :size => 3 %> 
+  <%= link_to image_tag('zoom_in.png'), {"chart[height]" => @chart.height * 1.5,:action => "chart", :state_id => @state_id} %> 
+  <%= submit_tag 'Apply', :style=>"display:none;" %> 
+<% end %>
+</td>
+
+<td>Displayed Items:</td>
+<td><% form_tag url_for( :action => "chart", :state_id => @state_id ) do %>
+  <%= link_to image_tag('zoom_out.png'), {"chart[max_values]" => (@chart.max_values/2), :action => "chart", :state_id => @state_id} %>
+  <%= text_field "chart", "max_values", :size => 3 %> 
+  <%= link_to image_tag('zoom_in.png'), {"chart[max_values]" => @chart.max_values * 2,:action => "chart", :state_id => @state_id} %> 
+  <%= submit_tag 'Apply', :style=>"display:none;" %> 
+<% end %>
+</td></tr></table>

Added: incubator/alois/trunk/rails/app/views/survey/chart.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/chart.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/chart.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/chart.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,9 @@
+<%= title("Grafik") %>
+
+<fieldset style="width: 100%">
+  <legend><%= @table_class.name %></legend>
+  <%= @table_class.description %>
+</fieldset>
+
+<%= render :partial => "show_filters" %>
+

Added: incubator/alois/trunk/rails/app/views/survey/list.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/list.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/list.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/list.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,33 @@
+<%= title("Interaktive Analyse - #{current_datasource.name}") %>
+
+<div id="page">
+
+<%= render :partial => "filters" %>
+<br>
+
+
+<table class="form">
+  <tr>
+    <th style="width: 20%; text-align: left">Description <%= short_help("Description","The description of the current datasource.") %></th><td><%=h current_datasource.description %></td>
+  </tr>
+  <tr>
+    <th style="width: 20%; text-align: left">Auto refresh <%= short_help "Auto refreshing page","By specifying an interval you can reload the content of the current sight every n seconds. Take care to not reload the page to often. If you specify a too short interval the browser will not be able to reload as much as desired (many browsers do not like that)." %></th>
+    <td><span id="auto_refresh"><%= render :partial => "auto_refresh" %></span></td>
+  </tr>
+</table>
+<br>
+
+<% case @controller.action_name
+  when 'chart' %>
+
+  <%= render :partial => "chart" %>
+
+<% when 'export' %>
+
+<% else %>
+
+  <%= render :partial => "table" %>
+
+<% end %>
+
+</div>

Added: incubator/alois/trunk/rails/app/views/survey/list_inline.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/list_inline.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/list_inline.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/list_inline.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,7 @@
+<% @update_table = remote_function(:update => 'survey_table', :url => url_for ( :controller=> 'survey', :action => 'list_inline', :state_id => @state_id )) %>
+
+<%= javascript_tag("function table_invalid(){Element.setStyle('log_table', {'background-color' : '#FFBBBB'})}") %>
+<%= javascript_tag("function table_reload(){Element.setStyle('log_table', {'background-color' : '#FFFF66'})}") %>
+<%= javascript_tag("function table_valid(){Element.setStyle('log_table', {'background-color' : 'transparent'})}") %>
+
+<%= render :partial => "table" %>

Added: incubator/alois/trunk/rails/app/views/survey/show.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/show.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/show.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/show.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,79 @@
+<%= title("Log Meta Data") %>
+<div id="page" style="padding: 20px; min-width: 870px">
+	<% form_tag :controller => 'survey', :action => 'create_view_from_query', :id => @record["id"], :table => @record.class.table_name  do %>
+		
+	<%
+		meta = @record
+		meta_level_count = 0
+	 %>
+	<table>
+		<tr>
+			<% while meta != nil %>
+				<% meta_level_count += 1 %>
+				<td class="box">
+					<table class="data">
+						<tr>
+							<th colspan="3">
+								<%= link_to meta.class.table_name, :action => 'list', :table => meta.class.table_name %>
+								<%= link_to meta["id"], :action => 'show', :table => meta.class.table_name, :id => meta["id"] %>
+								<%= link_to "o", :controller => "tablelist", :action => 'schema', :table => meta.class.table_name, :id => meta["id"] %>
+							</th>
+						</tr>
+				
+						<% for column in meta.class.columns %>
+						<tr>
+							<th><%=h column.human_name %>:</td>
+							<td><%=h meta[column.name] %></td>
+							<td>
+								<% if @record == meta && column.name == 'id' %>
+									<input type="checkbox" name="select_columns[]" value="<%=meta.class.table_name%>.`<%= column.name %>`" checked="checked" readonly="readonly"/>
+								<% else %>
+									<input type="checkbox" name="select_columns[]" value="<%=meta.class.table_name%>.`<%= column.name %>`"/>
+								<% end %>
+							</td>
+						</tr>
+						<% end %>
+					</table>
+
+                                                <% if meta.class == SyslogdMeta %>
+							<% div_id = "orig_#{meta.class.table_name}_#{meta["id"]}" %>
+							<div id="<%= div_id %>">
+								<table class="data"><tr><th colspan="3"><%= link_to_remote "Find original...", :update => div_id, :url => {:action => "original_inline", :table => meta.class.table_name, :id => meta["id"] } %></th></tr></table>
+							</div>
+                                                <% end %>
+				</td>
+				<% 
+begin
+  if meta.respond_to?("parent")
+    meta = meta.parent
+  else
+    meta = nil
+  end
+rescue
+  meta = nil
+%>
+
+				<td class="box">
+					<table class="data">
+						<tr>
+							<th colspan="3">ERROR</th>
+						</tr>
+						<tr colspan="3">
+							<td><%= $! %></td>
+						</tr>
+					</table>
+				</td>
+
+<% end %>
+
+			<% end %>
+			</tr>
+			<tr>
+				<td class="button-bar" colspan="<%= meta_level_count %>">
+				<%= submit_tag 'Create View' %>
+				</td>
+			</tr>
+		</table>
+	<%= children_table(@record) %>
+  <% end %>
+</div>

Added: incubator/alois/trunk/rails/app/views/tablelist/_child_classes.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tablelist/_child_classes.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tablelist/_child_classes.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/tablelist/_child_classes.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,33 @@
+<% @children = @source_class.child_classes %>
+<% current_class = @source_class %>
+<% current_path = @child_path %>
+
+
+<table>
+  <tr><th class="table-classes-child <% if current_class.name == current_path[0].class.name %>table-classes-selected<% end %>" rowspan="<%= @children.length + 1 %>">
+      <% if current_class.name != @global_source_class.name %><%= render :partial => "class_content" %><% end %>
+    </th>
+    <td> <!--<%= current_class %> == <%= current_path[0].class%> --></td>
+  </tr>
+
+<% @children.each {|@source_class| %>
+  <tr><td>
+    <% if current_class.parent_class?(@source_class) %>
+      <%= render :partial => "class_content" %> (cyclic)
+    <% else %>
+      <% @done.push(@source_class) %>
+
+<% 
+ if current_class.name == current_path[0].class.name
+   @child_path = current_path.dup[1..-1]
+ else
+   @child_path = ["non"]
+ end
+%>
+      <%= render :partial => "child_classes" %>
+    <% end %>
+  </td></tr>
+<% } %>
+
+  </tr>
+</table>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/tablelist/_class_content.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tablelist/_class_content.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tablelist/_class_content.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/tablelist/_class_content.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,14 @@
+<% k =  (@source_class or @global_source_class) %>
+<div <%= show_hide(k.name) %>>
+<%= link_to "#{k.name}", :controller => "survey", :action => "list", :table => k.table_name %>&nbsp;(<%= k.approx_count %>)
+<% if k.may_have_messages? %>
+with Messages
+<% end %>
+
+<div <%= show_hide_element(k.name) %>>
+<%= k.description_html %>
+</div>
+<% if params[:message] %>
+  
+<% end %>
+</div>

Added: incubator/alois/trunk/rails/app/views/tablelist/_parent_classes.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tablelist/_parent_classes.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tablelist/_parent_classes.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/tablelist/_parent_classes.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,32 @@
+<% @parents = @source_class.parent_classes %>
+<% current_class = @source_class %>
+<% current_path = @parent_path %>
+
+<table>
+  <tr><td>
+<!--    <%= @parents.map {|p| p.name}.join(",") %> -->
+<!--  <%= @source_class %> == <%= current_path[0].class%> -->
+  </td><th class="table-classes-parent <% if current_class.name == current_path[0].class.name %>table-classes-selected<% end %>"  rowspan="<%= @parents.length + 1 %>">
+    <% if current_class.name != @global_source_class.name %><%= render :partial => "class_content" %><% end %>
+  </th></tr>
+
+<% @parents.each {|@source_class| %>
+  <tr><td style="text-align:right;float:right;">
+    <% if current_class.child_class?(@source_class) %>
+      <%= @source_class.name %> (cyclic)
+    <% else %>
+      <% @done.push(@source_class) %>
+<% 
+ if current_class.name == current_path[0].class.name
+   @parent_path = current_path.dup[1..-1]
+ else
+   @parent_path = current_path
+ end
+%>
+      <%= render :partial => "parent_classes" %>
+    <% end %>
+  </td></tr>
+<% } %>
+
+  </tr>
+</table>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/tablelist/count.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tablelist/count.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tablelist/count.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/tablelist/count.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1 @@
+<%= @count %>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/tablelist/index.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tablelist/index.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tablelist/index.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/tablelist/index.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,30 @@
+<%= title "Tabellen" %>
+
+<div id="page">
+<table class="form">
+  <tr>
+    <th class="form_header">Name</th>
+    <th class="form_header">Beschreibung</th>
+  </tr>
+<% for name, type in {"Log Tables" => :meta, "Raw Logs" => :raw, "Log Queue" => :message} %>
+  <tr>
+    <th colspan="2" style="text-align: left"><%=h name %></th>
+  </tr>
+    <% for klass in Prisma::Database.get_classes(type).sort{ |x,y| ((x.name <=> y.name) == 0) ? x.description <=> y.description : x.name <=> y.name } %>
+      <tr>
+        <td>
+          <%= link_to( h( klass.name ), :controller => 'survey', :table=> klass.table_name) %>
+          <span style='font-weight: bold'>(<span id='count_<%=h klass.table_name %>' align='right'><%= klass.approx_count %></span>)</span>
+        </td>
+        <td><%=h klass.description %></td>
+      </tr>
+
+      <script type="text/javascript">
+      <%= remote_function(:update => 'count_' + klass.table_name, :url => {:action => 'count', :params => {:table_name => klass.table_name} }) %>
+      </script>
+      
+      <%= periodically_call_remote(:update => 'count_' + klass.table_name, :frequency => 300, :url => {:action => 'count', :params => {:table_name => klass.table_name} }) %>
+    <% end %>
+<% end %>
+  </table>
+</div>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/tablelist/schema.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tablelist/schema.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tablelist/schema.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/tablelist/schema.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,14 @@
+<h1>Datastructure Overview</h1>
+<%= show_hide_script %>
+<% @done = [] %>
+<table>
+<tr>
+  <% @source_class = @global_source_class %> 
+  <td><%= render :partial => "parent_classes" %></td>
+  <% @source_class = @global_source_class %> 
+  <th class="table-classes-center <% if @child_path[0].class.name == @global_source_class.name %>table-classes-selected<% end %>"><%= render :partial => "class_content" %></th>
+  <td><%= render :partial => "child_classes" %></td>
+</table>
+<% if @record %>
+<p class="table-classes-selected">You selected <%= link_to "#{@record.class.name}.#{@record["id"]}", :controller => "survey", :action => 'show', :table => @record.class.table_name, :id => @record["id"] %></p>
+<% end %>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/tables/_form.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tables/_form.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tables/_form.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/tables/_form.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,28 @@
+    <tr>
+      <th><label for="table_name">Name</label></th>
+      <td><%= text_field 'table', 'name'  %></td>
+    </tr>
+    <tr>
+      <th><label for="table_description">Description</label></th>
+      <td><%= text_area 'table', 'description', :style => "width: 99%", :rows => 4  %></td>
+    </tr>
+    <tr>
+      <th><label for="table_columns">Columns</label></th>
+      <td><%= text_field 'table', 'columns', :style => "width: 99%" %></td>
+    </tr>
+    <tr>
+      <th><label for="table_order_by">Order by</label></th>
+      <td><%= text_field 'table', 'order_by', :style => "width: 99%"%></td>
+    </tr>
+    <tr>
+      <th><label for="table_group_by">Group by</label></th>
+      <td><%= text_field 'table', 'group_by', :style => "width: 99%"%></td>
+    </tr>
+    <tr>
+      <th><label for="table_max_count">Max count</label></th>
+      <td><%= text_field 'table', 'max_count', :style => "width: 99%"%></td>
+    </tr>
+    <tr>
+      <th><label for="table_max_display_count">Max display count</label></th>
+      <td><%= text_field 'table', 'max_display_count', :style => "width: 99%"%></td>
+    </tr>

Added: incubator/alois/trunk/rails/app/views/tables/edit.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tables/edit.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tables/edit.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/tables/edit.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,22 @@
+<%= title "#{@controller.action_name.humanize} #{@controller.controller_name.singularize.humanize} - #{@table.name}" %>
+
+<!-- leave that for function calls to this div -->
+<div id="log_table"></div>
+
+<% form_tag :action => 'update', :id => @table, :state_id => @state_id do %>
+<div id="page">
+  <%= error_messages_for 'table' %>
+  
+  <table class="form">
+    <tr>
+      <th class="form_header" colspan="2">Table</th>
+    </tr>
+
+    <%= render :partial => "form" %>
+
+    <tr>
+      <td class="button-bar" colspan="2"><%= submit_tag "Save" %><%= submit_tag "Cancel" %></td>
+    </tr>
+  </table>
+</div>
+<% end %>

Added: incubator/alois/trunk/rails/app/views/tables/index.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tables/index.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tables/index.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/tables/index.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,27 @@
+<%= title @controller.controller_name.humanize %>
+
+<div id="page">
+<%= error_messages %>
+
+<table class="form">
+	<tr>
+		<th class="form_header">Name</th>
+		<th class="form_header">Description</th>
+		<th class="form_header" style="width: 160px"/>
+	</tr>  
+<% for table in @tables %>
+	<tr>
+		<td><%=h table.name %></td>
+		<td><%=h table.description %></td>
+		<td>
+			<%= link_to image_tag( 'show.png' ), :action => 'show', :id => table %><%= link_to image_tag( 'edit.png' ), :action => 'edit', :id => table %>	<%= link_to image_tag('delete.png'), { :action => 'destroy', :id => table }, :confirm => 'Are you sure?', :method => :post %>
+  		</td>
+	</tr>
+<% end %>
+	<tr>
+		<td class="button-bar" colspan="3">
+			<%= button_to "New #{@controller.controller_name.singularize.humanize}", :action => 'new' %>
+		</td>
+	</tr>
+</table>
+</div>

Added: incubator/alois/trunk/rails/app/views/tables/new.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tables/new.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tables/new.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/tables/new.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,20 @@
+<%= title "#{h @controller.action_name.humanize} #{h @controller.controller_name.singularize.humanize}" %>
+
+<div id="page">
+  <%= error_messages_for 'table' %>
+  
+  <% form_tag :action => 'create', :state_id => @state_id do %>
+  <table class="form">
+    <tr>
+      <th class="form_header" colspan="2"><%=h controller.controller_name.singularize.humanize %></th>
+    </tr>
+   
+    <%= render :partial => "form" %>
+
+    <tr>
+      <td class="button-bar" colspan="2"><%= submit_tag "Create" %><%= submit_tag "Cancel" %></td>
+    </tr>
+    <% end %>
+    <%= post_attribute_new %>
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/tables/render_table.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tables/render_table.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tables/render_table.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/tables/render_table.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,6 @@
+<%= title("Render #{h @controller.controller_name.singularize.humanize} - #{h @table.name}") %>
+
+Datasource: <%= @datasource.name %><br>
+Conditions: <%= @conditions %><br>
+Count: <%= @count %><br>
+<pre><%= @data %></pre>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/tables/show.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/tables/show.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/tables/show.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/tables/show.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,33 @@
+<%= title("#{h @controller.controller_name.singularize.humanize} - #{h @table.name}") %>
+
+<div class="page">
+<table class="form">
+  <tr>
+    <th class="form_header" colspan="2">Table</th>
+  </tr>
+  <% for col in @table.class.columns %>
+    <tr>
+      <th><label for="table_#{col.name}"><%= col.human_name %></label></th>
+      <td><%=h @table.send(col.name) %></td>
+    </tr>
+  <% end %>
+
+  <%= post_attributes_show %>
+  <tr>
+    <td class="button-bar" colspan="2"><%= button_to "Edit", :action => :edit, :id => @table %><%= button_to "Delete", { :action => :destroy, :id => @table }, :confirm => 'Are you sure?' %><%= button_to "List all", :action => :list %></td>
+  </tr>
+  <tr>
+    <th class="form_header" colspan="2">Render</th>
+  </tr>
+  <tr>
+    <th>Select datasource to render with:</th><td>
+<% form_tag :action => :render_table, :id => @table do %>
+<%= datasource_fields {|ds| @table.applyable?(ds) and ds.table.column_names.include?("date")}%>	
+Text: <%= radio_button_tag 'type','text',true %>
+CSV: <%= radio_button_tag 'type','csv' %>
+<%= submit_tag "Render"%>
+<% end %>
+    </td>
+  </tr>
+</table>
+</div>

Added: incubator/alois/trunk/rails/app/views/views/_form.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/views/_form.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/views/_form.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/views/_form.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,41 @@
+<%= error_messages_for 'view' %>
+
+<!--[form:view]-->
+	<tr>
+		<th class="form_header" colspan="2">View</th>
+	</tr>
+	<tr>
+		<th style="width: 20%"><label for="view_name">Name</label></th>
+		<td><%= text_field 'view', 'name', :size => 40 %></td>
+	</tr>
+	<tr>
+		<th style="width: 20%"><label for="view_description">Description</label></th>
+		<td><%= text_area 'view', 'description', :rows => 4 %></td>
+	</tr>
+	<tr>
+		<th style="width: 20%"><label for="view_sql_declaration">Sql declaration</label></th>
+		<td><%= text_area 'view', 'sql_declaration', :rows => 10 %></td>
+	</tr>
+	<tr>
+		<th style="width: 20%"><label for="id_source_table">Id comes from table with name</label></th>
+		<td><%= text_field 'view', 'id_source_table', :rows => 4 %></td>
+	</tr>
+	<tr>
+		<th style="width: 20%"><label for="exclusive_for_group">Display only for group</label></th>
+		<td><%= text_field 'view', 'exclusive_for_group', :rows => 4 %></td>
+	</tr>
+	<tr>
+		<th style="width: 20%"><label for="do_not_use_view_for_query">Don't use mysql view for query</label></th>
+		<td><%= check_box 'view', 'do_not_use_view_for_query' %><br>Try to parse and adapt query for conditions, limit and orderbys.</td>
+	</tr>
+
+<!--
+<p><label for="view_additional_fields">Additional fields</label><br/>
+<%= text_area 'view', 'additional_fields', :rows => 2, :cols => 100  %></p>
+
+<p><label for="view_date_column_name">Date column name</label><br/>
+<%= text_field 'view', 'date_column_name'  %></p>
+-->
+
+<!--[eoform:view]-->
+

Added: incubator/alois/trunk/rails/app/views/views/_list_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/views/_list_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/views/_list_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/views/_list_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,2 @@
+<%= help_title("Views List") %>
+<p>This is a list of already created <%= help_link "Views" %>.</p>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/views/edit.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/views/edit.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/views/edit.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/views/edit.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,14 @@
+<%= title "#{@controller.action_name.humanize} #{@controller.controller_name.singularize.humanize} - #{@view.name}" %>
+
+<div id="page">
+  <%= error_messages_for 'view' %>
+  
+  <table class="form">
+  <% form_tag :action => 'update', :id => @view do %>
+    <%= render :partial => 'form' %>
+    <tr>
+      <td class="button-bar" colspan="2"><%= submit_tag "Update" %> <%= submit_tag "Cancel" %></td>
+    </tr>
+  <% end %>
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/views/list.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/views/list.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/views/list.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/views/list.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,31 @@
+<%= title @controller.controller_name.pluralize.humanize %>
+
+<div id="page">
+<%= error_messages %>
+
+<table class="form">
+	<tr>
+    <th class="form_header" style="width: 0px">ID</th>
+    <th class="form_header" style="width: 20%">Name</th>
+		<th class="form_header" style="width: 90%">Description</th>
+		<th class="form_header" style="min-width: 160px"/>
+	</tr>
+<% make_groups(@views).each{|name,views| %>
+  <% if name != "" %><tr><th colspan="4" style="text-align:left;">&nbsp;<%=h name %></th></td><% end %>
+<% for view in views %>
+	<tr>
+    <td><%=h view.id %></td>
+		<td><%= link_to(h(view.name), :controller => 'survey', :table => view.table.table_name) %></td>
+		<td><%=h view.description %></td>
+		<td>
+			<%= link_to image_tag( 'bar-chart.png', :title => 'Analyze data from view' ), :controller => 'survey', :table => view.table.table_name %><%= short_help "Survey Button","With this button you get to the #{help_link "survey"} page."%><%= link_to image_tag( 'show.png', :title => 'Show view details'), :action => 'show', :id => view %><%= link_to image_tag( 'edit.png', :title => 'Edit view' ), :action => 'edit', :id => view %><%= link_to image_tag('delete.png', :title => 'Delete view'), { :action => 'destroy', :id => view }, :confirm => 'Are you sure?', :method => :post %>
+  		</td>
+	</tr>
+<% end }%>
+	<tr>
+		<td class="button-bar" colspan="4">
+			<%= button_to "New #{@controller.controller_name.singularize}", :action => 'new' %>
+		</td>
+	</tr>
+</table>
+</div>

Added: incubator/alois/trunk/rails/app/views/views/new.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/views/new.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/views/new.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/views/new.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,26 @@
+<%= title "#{h @controller.action_name.humanize} #{h @controller.controller_name.singularize.humanize}" %>
+
+<div id="page">
+  <%= error_messages_for 'view' %>
+  
+  <table class="form">
+  <% form_tag :action => 'create' do %>
+    <%= render :partial => 'form' %>
+    <tr>
+      <td class="button-bar" colspan="2"><%= submit_tag "Create" %> <%= submit_tag "Cancel" %></td>
+    </tr>
+    <% end %>
+    <% form_tag :action=>'new', :state_id => @state_id do %>
+      <tr>
+        <th class="form_header" colspan="2">Upload</th>
+      </tr>
+      <tr>
+        <th>ZIP</th>
+        <td><%= text_area_tag 'view_zip', '', :rows => 4 %></td>
+      </tr>
+      <tr>
+        <td class="button-bar" colspan="2"><%= submit_tag "Load" %><%= submit_tag "Cancel" %></td>
+      </tr>
+    <% end %>
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/views/show.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/views/show.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/views/show.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/views/show.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,38 @@
+<%= title("View - #{@view.name}") %>
+
+<div class="page">
+<table class="form">
+  <tr>
+    <th class="form_header" colspan="2">View</th>
+  </tr>
+  <tr>
+    <th><label for="view_name">Name</label></th>
+    <td><%=h @view.name %></td>
+  </tr>
+  <tr>
+    <th><label for="view_description">Description</label></th>
+    <td><%=h @view.description %></td>
+  </tr>
+  <tr>
+    <th><label for="view_sql_declaration">Sql declaration</label></th>
+    <td><%= create_links_in_query(@view.sql_declaration) %></td>
+  </tr>
+  <tr>
+    <th><label for="view_do_not_use_view_for_query">Don't use mysql view for query</label></th>
+    <td><%=h @view.do_not_use_view_for_query %><br>Sample output:<br><%= (create_links_in_query @view.example_replacement_query) rescue $! %></td>
+  </tr>
+
+<% if @view.exclusive_for_group %>
+  <tr>
+    <th><label for="exclusive_for_group">Display only for group</label></th>
+    <td><%=h @view.exclusive_for_group %></td>
+  </tr>
+<% end %>
+  <tr>
+    <th>Serialized</th><td><pre><%=h @view.to_zip %></pre></td>
+  </tr>
+  <tr>
+    <td class="button-bar" colspan="2"><%= button_to "Analyze", :controller => 'survey', :table => @view.table.table_name %><%= button_to "Edit", :action => :edit, :id => @view %><%= button_to "Delete", { :action => :destroy, :id => @view }, :confirm => 'Are you sure?' %><%= button_to "List all", :action => :list %></td>
+  </tr>
+</table>
+</div>

Added: incubator/alois/trunk/rails/app/views/views/show_inline.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/views/show_inline.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/views/show_inline.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/views/show_inline.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,5 @@
+<% for column in View.content_columns %>
+<p>
+  <b><%= column.human_name %>:</b> <%=h @view.send(column.name) %>
+</p>
+<% end %>
\ No newline at end of file

Added: incubator/alois/trunk/rails/config/default_working_items/views.yaml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/config/default_working_items/views.yaml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/config/default_working_items/views.yaml (added)
+++ incubator/alois/trunk/rails/config/default_working_items/views.yaml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,88 @@
+# This File specifies the
+# default views generated in Alois
+firewall:
+  name: Firewall - iptables
+  description: Firewall logs from iptable firewalls
+  sql_declaration: "SELECT iptables_firewall_metas.`id`, iptables_firewall_metas.`rule`, iptables_firewall_metas.`src`, iptables_firewall_metas.`spt`, iptables_firewall_metas.`dst`, iptables_firewall_metas.`dpt`, iptables_firewall_metas.`custom`, iptables_firewall_metas.`in`, iptables_firewall_metas.`out`, iptables_firewall_metas.`physin`, iptables_firewall_metas.`physout`, iptables_firewall_metas.`len`, iptables_firewall_metas.`tos`, iptables_firewall_metas.`prec`, iptables_firewall_metas.`ttl`, iptables_firewall_metas.`proto`, iptables_firewall_metas.`additional`, log_metas.`date`, log_metas.`time`, log_metas.`host`, syslogd_metas.`facility`, syslogd_metas.`priority`, syslogd_metas.`level` ,HOUR(log_metas.time) as hour FROM iptables_firewall_metas, log_metas, syslogd_metas, source_db_metas WHERE iptables_firewall_metas.log_metas_id = log_metas.id AND syslogd_metas.source_db_metas_id = source_db_metas.id AND log_metas.syslogd_metas_id = syslogd_metas.id "
+  do_not_use_view_for_query: "0"
+  id_source_table: iptables_firewall_metas
+
+cisco_connections:
+  name: Firewall - Cisco
+  description: UDP, TCP und ICMP Verbindungen gemeldet vom Connectivity-Gateway.
+  sql_declaration: "SELECT cisco_firewall_connection_metas.`id`, cisco_firewall_connection_metas.`msg`, cisco_firewall_connection_metas.`reason`, cisco_firewall_connection_metas.`connection_id`, cisco_firewall_connection_metas.`connection_type`, cisco_firewall_connection_metas.`foreign_name`, cisco_firewall_connection_metas.`foreign_ip`, cisco_firewall_connection_metas.`foreign_port`, cisco_firewall_connection_metas.`local_name`, cisco_firewall_connection_metas.`local_ip`, cisco_firewall_connection_metas.`local_port`, cisco_firewall_connection_metas.`global_to_ip`, cisco_firewall_connection_metas.`global_to_port`, cisco_firewall_connection_metas.`global_from_ip`, cisco_firewall_connection_metas.`global_from_port`, cisco_firewall_connection_metas.`duration`, cisco_firewall_connection_metas.`bytes`,(cisco_firewall_connection_metas.`bytes`/1024/1024) as mega_bytes, log_metas.`date`, log_metas.`time`,HOUR(log_metas.`time`) as hour, log_metas.`host`, syslogd_metas.`priority`, sys
 logd_metas.`level`\r\n\
+    \r\n FROM  cisco_firewall_connection_metas , cisco_base_metas,log_metas FORCE INDEX (log_metas_date_index) , syslogd_metas , source_db_metas  WHERE\r\n cisco_firewall_connection_metas.cisco_base_metas_id = cisco_base_metas.id AND cisco_base_metas.log_metas_id = log_metas.id AND log_metas.syslogd_metas_id = syslogd_metas.id AND syslogd_metas.source_db_metas_id = source_db_metas.id "
+  id_source_table: cisco_firewall_connection_metas
+  do_not_use_view_for_query: "0"
+
+ace_passcodes:
+  name: ACE-Server passcodes
+  description: Ace passcode logs. Including Permits, Denies and Errors.
+  sql_declaration: SELECT ace_passcode_metas.`id`, ace_passcode_metas.`action`, ace_passcode_metas.`login`, ace_passcode_metas.`user_name`, ace_passcode_metas.`token`, ace_passcode_metas.`agent_host`, ace_passcode_metas.`server`, windows_event_metas.`date`, windows_event_metas.`time`, HOUR(windows_event_metas.time) as hour, log_metas.time as syslog_time,windows_event_metas.level FROM windows_event_metas LEFT JOIN ace_passcode_metas ON ace_passcode_metas.windows_event_metas_id = windows_event_metas.id LEFT JOIN log_metas ON windows_event_metas.log_metas_id = log_metas.id WHERE ace_passcode_metas.id IS NOT NULL
+  do_not_use_view_for_query: "0"
+  id_source_table: ace_passcode_metas
+
+syslog1:
+  name: Syslog
+  description: Logs that came over Syslog.
+  sql_declaration: SELECT log_metas.`id`, log_metas.`date`, log_metas.`time`, log_metas.`host`, log_metas.`syslogd_metas_id`, syslogd_metas.`ip`, syslogd_metas.`facility`, syslogd_metas.`priority`, syslogd_metas.`level`, hour(log_metas.time) as hour, minute(log_metas.time) minute , hour(log_metas.time) + minute(log_metas.time) / 100 as hourminute FROM log_metas LEFT JOIN syslogd_metas ON log_metas.syslogd_metas_id = syslogd_metas.id
+  do_not_use_view_for_query: "0"
+  id_source_table: log_metas
+
+syslog1_with_message:
+  name: Syslog with Message
+  description: Logs that came over Syslog. If the message has not been parsed further, the log message is displayed too.
+  sql_declaration: SELECT log_metas.`id`, log_metas.`date`, log_metas.`time`, log_metas.`host`, log_metas.`syslogd_metas_id`, syslogd_metas.`ip`, syslogd_metas.`facility`, syslogd_metas.`priority`, syslogd_metas.`level`, hour(log_metas.time) as hour, minute(log_metas.time) minute , hour(log_metas.time) + minute(log_metas.time) / 100 as hourminute, msg,  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, left(msg,5) as left_5_msg, left(msg,10) as left_10_msg, left(msg,15) as left_15_msg, IF(msg is NULL,'known message','unknown message') as message_type FROM log_metas LEFT JOIN syslogd_metas ON log_metas.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::LogMeta' AND messages.meta_id = log_metas.
 id
+  do_not_use_view_for_query: "0"
+  id_source_table: log_metas
+
+syslog1_windows:
+  name: Syslog with Message from WindowsEventMetas
+  description: Logs that came over Syslog and have not fully parsed WindowsEventMetas messages.
+  sql_declaration: SELECT STRAIGHT_JOIN log_metas.`id`, log_metas.`date`, log_metas.`time`, log_metas.`host`, syslogd_metas.`ip`, syslogd_metas.`facility`, syslogd_metas.`priority`, syslogd_metas.`level`, syslogd_metas.`tag`, syslogd_metas.`program`, messages.msg ,messages.meta_type_name,hour(log_metas.time) as hour, minute(log_metas.time) minute , hour(log_metas.time) + minute(log_metas.time) / 100 as hourminute, cast(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 char(255)) as msg_first, left(msg,5) as left_5_msg, left(msg,10) as left_10_msg, left(msg,15) as left_15_msg, IF(msg is NULL,'known message','unknown message') as message_type FROM log_metas,windows_event_metas,syslogd_metas,messages WHERE windows_event_metas.log_metas_id = log_metas.id AND log_metas.syslogd_metas_id = syslogd_metas.id  AND messages.meta_id = windo
 ws_event_metas.id AND messages.meta_type_name = 'Prisma::WindowsEventMeta'
+  do_not_use_view_for_query: "0"
+  id_source_table: log_metas
+
+syslog1_cisco:
+  name: Syslog with Message from CiscoBaseMeta
+  description: Logs that came over Syslog and have not fully parsed CiscoBaseMetas messages.
+  sql_declaration: SELECT STRAIGHT_JOIN log_metas.`id`, log_metas.`date`, log_metas.`time`, log_metas.`host`, syslogd_metas.`ip`, syslogd_metas.`facility`, syslogd_metas.`priority`, syslogd_metas.`level`, syslogd_metas.`tag`, syslogd_metas.`program`, messages.msg,messages.meta_type_name,hour(time) as hour, minute(time) minute , hour(time) + minute(time) / 100 as hourminute, cast(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 char(255)) as msg_first, left(msg,5) as left_5_msg, left(msg,10) as left_10_msg, left(msg,15) as left_15_msg, IF(msg is NULL,'known message','unknown message') as message_type FROM log_metas,cisco_base_metas,syslogd_metas,messages WHERE cisco_base_metas.log_metas_id = log_metas.id AND log_metas.syslogd_metas_id = syslogd_metas.id AND messages.meta_id = cisco_base_metas.id AND messages.meta_type_name = 'Pr
 isma::CiscoBaseMeta'
+  id_source_table: log_metas
+
+syslog1_log_meta:
+  name: Syslog with Message from LogMeta
+  description: Logs that came over Syslog and have not fully parsed LogMeta messages.
+  sql_declaration: |
+    SELECT STRAIGHT_JOIN log_metas.`id`, log_metas.`date`, log_metas.`time`, log_metas.`host`, syslogd_metas.`ip`, syslogd_metas.`facility`, syslogd_metas.`priority`, syslogd_metas.`level`, syslogd_metas.`tag`, syslogd_metas.`program`, messages.msg, messages.meta_type_name ,hour(time) as hour, minute(time) minute , hour(time) + minute(time) / 100 as hourminute, cast(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 char(255)) as msg_first, left(msg,5) as left_5_msg, left(msg,10) as left_10_msg, left(msg,15) as left_15_msg, IF(msg is NULL,'known message','unknown message') as message_type FROM log_metas,syslogd_metas,messages WHERE log_metas.syslogd_metas_id = syslogd_metas.id
+    AND messages.meta_id = log_metas.id AND messages.meta_type_name = 'Prisma::LogMeta'
+  description: Syslog Fields of messages that are in LogMetas
+  id_source_table: log_metas
+
+
+syslog2_unified:
+  name: Syslog with Message Unified
+  exclusive_for_group: ""
+  sql_declaration: (SELECT STRAIGHT_JOIN * FROM <<VIEW(Syslog with Message from WindowsEventMetas)>>) UNION (SELECT  STRAIGHT_JOIN * FROM <<VIEW(Syslog with Message from CiscoBaseMeta)>>) UNION (SELECT  STRAIGHT_JOIN* FROM <<VIEW(Syslog with Message from LogMeta)>>)
+  do_not_use_view_for_query: "1"
+  id: "103"
+  description: Use this view if you are looking for not fully parsed messages.
+  additional_fields:
+  id_source_table: log_metas
+  date_column_name:
+
+
+cisco1_prepare:
+  name: CiscoFirewall Prepare
+  exclusive_for_group: ""
+  sql_declaration: |-
+    SELECT STRAIGHT_JOIN cisco_firewall_metas.`id`, cisco_firewall_metas.`msg`, cisco_firewall_metas.`source`, cisco_firewall_metas.`source_port`, cisco_firewall_metas.`destination`, cisco_firewall_metas.`destination_port`, cisco_firewall_metas.`interface`, log_metas.`date`, log_metas.`time`, log_metas.`host`
+    , hour(log_metas.time) as hour FROM log_metas,cisco_base_metas,cisco_firewall_metas WHERE cisco_firewall_metas.cisco_base_metas_id = cisco_base_metas.id AND cisco_base_metas.log_metas_id = log_metas.id
+  do_not_use_view_for_query: "1"
+  id_source_table: cisco_firewall_metas
+
+cisco2:
+  name: CiscoFirewall
+  exclusive_for_group: ""
+  sql_declaration: SELECT STRAIGHT_JOIN * FROM <<VIEW(CiscoFirewall Prepare)>>
+  do_not_use_view_for_query: "1"
+  id_source_table: cisco_firewall_metas

Added: incubator/alois/trunk/rails/config/initializers/backtrace_silencers.rb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/config/initializers/backtrace_silencers.rb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/config/initializers/backtrace_silencers.rb (added)
+++ incubator/alois/trunk/rails/config/initializers/backtrace_silencers.rb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,21 @@
+# 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.
+
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
\ No newline at end of file

Added: incubator/alois/trunk/rails/config/initializers/inflections.rb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/config/initializers/inflections.rb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/config/initializers/inflections.rb (added)
+++ incubator/alois/trunk/rails/config/initializers/inflections.rb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,30 @@
+# 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.
+
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format 
+# (all these examples are active by default):
+# ActiveSupport::Inflector.inflections do |inflect|
+#   inflect.plural /^(ox)$/i, '\1en'
+#   inflect.singular /^(ox)en/i, '\1'
+#   inflect.irregular 'person', 'people'
+#   inflect.uncountable %w( fish sheep )
+# end
+
+ActiveSupport::Inflector.inflections do |inflect|
+  inflect.singular 'pies', 'pie'
+  inflect.singular 'sentinels', 'sentinel'
+  inflect.plural 'sentinel', 'sentinels'
+end

Added: incubator/alois/trunk/rails/config/initializers/libisi.rb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/config/initializers/libisi.rb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/config/initializers/libisi.rb (added)
+++ incubator/alois/trunk/rails/config/initializers/libisi.rb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,64 @@
+# 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.
+
+
+#mode = :real
+mode = :simple
+
+# Initialize Libisi unless it
+# has already been initialized
+unless defined?(LIBISI)
+  # Initialize libisi
+  case mode
+  when :simple
+    # simple way
+    $log = RAILS_DEFAULT_LOGGER
+  when :real  
+    require 'libisi'
+    init_libisi(:log_levels => [:DEBUG, :INFO, :PERF, :WARN, :ERROR, :FATAL])  
+  end
+  $log.info("Libisi functions enabled")
+end
+
+=begin
+#LIBISI Stuff
+#  Dispatcher.before_dispatch {|dispatcher|
+#    p "Libisi"
+#  }
+end
+
+def define_new_logger(name = nil)
+  $log.info{"Define new logger '#{name}'."}  
+  if Log.outputs[0] == :stdout
+    output = :stdout
+    pattern = Log::LOG_FORMAT.sub("::",":#{name}:")
+  else
+    pattern = nil
+    output= File.join(RAILS_ROOT,'log',name + '.log')
+  end
+  Log.redefine_logger(:output => output, :pattern => pattern)  
+end
+=end
+
+
+
+#$log = RAILS_DEFAULT_LOGGER
+#RAILS_DEFAULT_LOGGER.level = Logger.const_get(LOG_LEVEL.to_s.upcase) if defined?(LOG_LEVEL)
+#RAILS_DEFAULT_LOGGER.level = Logger.const_get(ENV["LOG_LEVEL"].to_s.upcase) if ENV["LOG_LEVEL"]
+#$log = RAILS_DEFAULT_LOGGER
+
+
+# $log is used in prisma
+#$log = RAILS_DEFAULT_LOGGER
+

Added: incubator/alois/trunk/rails/config/initializers/mime_types.rb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/config/initializers/mime_types.rb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/config/initializers/mime_types.rb (added)
+++ incubator/alois/trunk/rails/config/initializers/mime_types.rb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,19 @@
+# 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.
+
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone

Added: incubator/alois/trunk/rails/config/initializers/new_rails_defaults.rb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/config/initializers/new_rails_defaults.rb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/config/initializers/new_rails_defaults.rb (added)
+++ incubator/alois/trunk/rails/config/initializers/new_rails_defaults.rb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,33 @@
+# 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.
+
+# Be sure to restart your server when you modify this file.
+
+# These settings change the behavior of Rails 2 apps and will be defaults
+# for Rails 3. You can remove this initializer when Rails 3 is released.
+
+if defined?(ActiveRecord)
+  # Include Active Record class name as root for JSON serialized output.
+  ActiveRecord::Base.include_root_in_json = true
+
+  # Store the full class name (including module namespace) in STI type column.
+  ActiveRecord::Base.store_full_sti_class = true
+end
+
+# Use ISO 8601 format for JSON serialized times and dates.
+ActiveSupport.use_standard_json_time_format = true
+
+# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
+# if you're including raw json in an HTML page.
+ActiveSupport.escape_html_entities_in_json = false
\ No newline at end of file

Added: incubator/alois/trunk/rails/config/initializers/prisma.rb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/config/initializers/prisma.rb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/config/initializers/prisma.rb (added)
+++ incubator/alois/trunk/rails/config/initializers/prisma.rb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,27 @@
+# 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.
+
+# Prisma stuff
+PRISMA_ENV = RAILS_ENV
+begin
+  cf = Pathname.new(__FILE__).dirname + "../../../prisma/conf/prisma/environment.rb"  
+  if cf.exist?
+    require cf
+  else
+    require "/etc/prisma/environment.rb"
+  end
+  Prisma::Database.load_all
+rescue
+  $log.warn("Initialize Prisma failed: #{$!}")
+end

Added: incubator/alois/trunk/rails/config/initializers/session_store.rb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/config/initializers/session_store.rb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/config/initializers/session_store.rb (added)
+++ incubator/alois/trunk/rails/config/initializers/session_store.rb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,34 @@
+# 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.
+
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying cookie session data integrity.
+# If you change this key, all old sessions will become invalid!
+# Make sure the secret is at least 30 characters and all random, 
+# no regular words or you'll be exposed to dictionary attacks.
+ActionController::Base.session = {
+  :key         => '_alois_session',
+  :secret      => 'ef3f8da74daf392d4893dc6783ec350094fd0bf550162d802e837ba845fe60f13456e05ce0a3a05f18d0fd5835f0748856489f1a254f64c495684a8dca758348'
+}
+
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rake db:sessions:create")
+ActionController::Base.session_store = :active_record_store
+
+#ActionController::Base.cache_store = :memory_store
+#ActionController::Base.cache_store = :file_store, "/path/to/cache/directory"
+#ActionController::Base.cache_store = :drb_store, "druby://localhost:9192"
+#ActionController::Base.cache_store = :mem_cache_store, "localhost"

Added: incubator/alois/trunk/rails/config/locales/en.yml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/config/locales/en.yml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/config/locales/en.yml (added)
+++ incubator/alois/trunk/rails/config/locales/en.yml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,5 @@
+# Sample localization file for English. Add more files in this directory for other locales.
+# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+en:
+  hello: "Hello world"
\ No newline at end of file