From alois-commits-return-19-apmail-incubator-alois-commits-archive=incubator.apache.org@incubator.apache.org Thu Nov 04 18:29:34 2010 Return-Path: Delivered-To: apmail-incubator-alois-commits-archive@minotaur.apache.org Received: (qmail 89890 invoked from network); 4 Nov 2010 18:29:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Nov 2010 18:29:33 -0000 Received: (qmail 97061 invoked by uid 500); 4 Nov 2010 18:30:05 -0000 Delivered-To: apmail-incubator-alois-commits-archive@incubator.apache.org Received: (qmail 97046 invoked by uid 500); 4 Nov 2010 18:30:05 -0000 Mailing-List: contact alois-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: alois-dev@incubator.apache.org Delivered-To: mailing list alois-commits@incubator.apache.org Received: (qmail 97039 invoked by uid 99); 4 Nov 2010 18:30:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Nov 2010 18:30:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Nov 2010 18:29:46 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9494D2388B6C; Thu, 4 Nov 2010 18:28:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1031127 [10/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... Date: Thu, 04 Nov 2010 18:27:42 -0000 To: alois-commits@incubator.apache.org From: flavio@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101104182801.9494D2388B6C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: incubator/alois/trunk/rails/app/models/sentinel.rb URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/models/sentinel.rb?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/models/sentinel.rb (added) +++ incubator/alois/trunk/rails/app/models/sentinel.rb Thu Nov 4 18:27:22 2010 @@ -0,0 +1,260 @@ +# 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. + + class Sentinel < ActiveRecord::Base + has_many :alarms + has_many :reports + + belongs_to :report_template + belongs_to :view + + CRONTAB_REGEX = /([0-5]?[0-9]|\*) ([0-1]?[0-9]|2[0-4]|\*) (\d*|\*) (\d*|\*) (\d*|\*)/ + ACTIONS = { + 0 => :disabled, + 1 => :report, + 2 => :alarm, + 3 => :alarm_and_report} + + validates_presence_of :name, :threshold, :view + validates_uniqueness_of :name + validates_format_of :cron_interval, :with => CRONTAB_REGEX + + validate do |s| + if s.action_name == :report or s.action_name == :alarm_and_report + s.errors.add("action", "Please specify a report_template for action '#{s.action_name}'") unless + s.report_template + end + if s.time_range and s.time_range != "" and s.view + begin + s.date_condition.validate(s.view) + rescue + s.errors.add("time_range",$!) + end + end + + if s.view + begin + s.filters.each {|f| + s.errors.add("filters", "Filter #{f.id} is not applicable for view #{s.view.id}") unless + f.valid_for_table?(s.view) + } + s.conditions + rescue + s.errors.add("Error building conditions: #{$!}") + end + end + end + + # hm, otherwise test fails: ruby test/functional/sentinels_controller_test.rb --name test_load_yaml + def include_csv_in_email; include_csv_in_email? rescue include_csv_in_email; end + def include_report_in_email; include_report_in_email? rescue include_report_in_email; end + + def date_condition + Condition.create("date","DATE",time_range) if time_range and time_range != "" + end + + def filters + Filter.parse_text_field(self["filters"]) + end + + def filters=(val) + remove_instance_variable("@count") if + instance_variable_defined?("@count") + super + end + + def conditions(options = {}) + options[:table_class] ||= view + c = ([date_condition] + filters).compact.map {|f| f.sql(options)}.join(" AND ") + return nil if c.strip == "" + c + end + + ## To use this add the following line into the sudoers file + # www-data ALL=(prisma) NOPASSWD:/usr/bin/prisma-sentinel --generate-crontab + if RAILS_ENV == 'production' + UPDATE_COMMAND = "/usr/bin/sudo -S -p '' -u prisma /usr/bin/alois-sentinel --generate-crontab < /dev/null" + else + UPDATE_COMMAND = RAILS_ROOT + "/script/sentinel --list-crontab > /dev/null" + end + def update_cron + errors.add_to_base("Error while updating crontab (#{UPDATE_COMMAND}).") unless system("#{UPDATE_COMMAND}") + end + + def save + ret = super + update_cron + ret + end + + def destroy + update_cron + super + end + + def enabled + action != ACTIONS.invert[:disabled] + end + + def count + return @count if defined?(@count) + raise "No view defined." unless view + view.create_view + @count = view.table.count(:conditions => conditions) + end + + def time_range=(val) + remove_instance_variable("@count") if + instance_variable_defined?("@count") + super + end + + def is_alarm? + threshold < count + end + + def action_name + ACTIONS[self.action] + end + + def action=(val) + if val.is_a?(Symbol) + "Action '#{val}' not found." unless ACTIONS.value?(val) + val = ACTIONS.invert[val] + end + super(val) + end + + def alarm_level_color + Alarm::ALARM_COLORS[self.alarm_level] + end + + def alarm_level_name + Alarm::ALARM_LEVELS[self.alarm_level] + end + + def alarm_level=(val) + if val.is_a?(Symbol) + "Alarm '#{val}' not found." unless Alarm::ALARM_LEVELS.value?(val) + val = Alarm::ALARM_LEVELS.invert[val] + end + super(val) + end + + def datasource + view + end + + def process + raise "This sentinel is disabled." if action_name == :disabled + + $log.debug "Processing sentinel.#{self.id}." if $log.debug? + alarm = nil + report = nil + @process_errors = [] + options = { :conditions => conditions, :datasource => view } + if is_alarm? + $log.debug "Sentinel claim it's an alarm." if $log.debug? + + if action_name == :report or action_name == :alarm_and_report + begin + rt = report_template + $log.info("Generating report.") + report = Report.generate(rt, self, options) + $log.info("Generated report has id #{report.id}.") + rescue + $log.error("Error generating report: '#{$!}'") + @process_errors.push($!) + end + end + + + if action_name == :alarm or action_name == :alarm_and_report + begin + alarm = Alarm.generate(self, report, options) + rescue + $log.error("Error generating alarm: '#{$!}'") + @process_errors.push($!) + end + end + + + if send_mail + begin + $log.info("Sending mails to '#{self.mail_to.inspect}'.") + + if alarm + AlarmMailer.deliver_simple(self.mail_to, alarm) + end + if report + if self.include_report_in_email + ReportMailer.deliver_normal(self.mail_to, report, {:add_csv => self.include_csv_in_email}) + else + ReportMailer.deliver_simple(self.mail_to, report, {:add_csv => self.include_csv_in_email}) + end + end + + $log.info("Mails sucessfully sent.") + rescue + $log.error("Error sending mail: '#{$!}'") + @process_errors.push($!) + end + end + end + + if @process_errors.length > 0 + # send error mail + BaseMailer.send_exception(@process_errors) + else + @process_errors = nil + end + + [alarm,report] + end + + def process_errors + return nil if @process_errors.nil? + return @process_errors + end + + + def text +throw "Deprecated function" + return @text if @text + total = self.view.table.count + + ret = "#{self.name}\n" + ret += "-" * self.name.length + "\n\n" + ret += "#{self.description}\n\n\n" + if total > RECORD_LIMIT + ret += "DATATABLE (top #{RECORD_LIMIT} of #{total} records):\n" + else + ret += "DATATABLE (#{total} records):\n" + end + + begin + @data = view.table.report_table(:all, :limit => RECORD_LIMIT) + txt = @data.as(:text, :ignore_table_width => true) + txt = "#{ret[0..MAX_TEXT_LENGTH]}\n.... (truncated) ...\n" if + ret.length > MAX_TEXT_LENGTH + rescue + txt = "ERROR GENERATING TABLE\n#{$!.inspect}" + end + @text = ret + txt + return @text + + end + + end + Added: incubator/alois/trunk/rails/app/models/sql_condition.rb URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/models/sql_condition.rb?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/models/sql_condition.rb (added) +++ incubator/alois/trunk/rails/app/models/sql_condition.rb Thu Nov 4 18:27:22 2010 @@ -0,0 +1,48 @@ +# 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. + + # The value field of SqlCondition will directly be inserted in the where clause of sql + class SqlCondition < Condition + + def validate(table_class=nil) + self.sql(table_class) + if table_class + raise "Condition not appliable to #{table_class}." unless applyable(table_class) + end + end + + def initialize(query, options = {}) + @value = query + end + + # Always empty, column must be included in value + def column + "" + end + + # Always "SQL", operator must be included in value + def operator + "SQL" + end + + # Sql statement, value with brackets, so ORs can be included. + # TODO: here pure SQL is included, maybe we should do some security checks + def sql(options = {}) + "( #{@value} )" + end + + def applyable(table_class) + return true + end + end Added: incubator/alois/trunk/rails/app/models/table.rb URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/models/table.rb?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/models/table.rb (added) +++ incubator/alois/trunk/rails/app/models/table.rb Thu Nov 4 18:27:22 2010 @@ -0,0 +1,186 @@ +# 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. + +class Table < ActiveRecord::Base + has_and_belongs_to_many :report_templates + + attr_accessor :datasource + attr_accessor :conditions + + validate do |t| + if t.datasource + cns = t.datasource.table.columns.map{|c| c.name} + ["columns","order_by","group_by"].each {|name| + missing_cols = t.send("#{name}_arr").reject {|cn| cns.include?(cn) } + t.errors.add(name,"Missing columns in datasource: #{missing_cols.inspect}.") unless + missing_cols.length == 0 + } + end + end + + def columns_arr + @columns_arr = columns.split(",").map{|n| + if n =~ /\((.*)\)/ + $1.strip + else + n.strip + end + }.reject {|n| n == "*"} + @columns_arr + end + def order_by_arr + return [] if order_by.nil? or order_by.strip == "" + group_by.split(",").map{|n| n.strip.split(" ")[0]} + end + def group_by_arr + return [] if group_by.nil? or group_by.strip == "" + group_by.split(",").map{|n| n.strip} + end + def needed_column_names + columns_arr + order_by_arr + group_by_arr + end + + def applyable?(ds) + t = self.clone + t.datasource = ds + return t.valid? + end + + def text + render + return open(text_filename) {|f| f.readlines} if File.exist?(text_filename) + end + + def html + "
#{text}
" + end + + def base_name; (data_directory + "table").to_s; end + + def data_filename; base_name + ".data"; end + def data_date; File.mtime(data_filename) rescue nil; end + + def text_filename; base_name + ".txt"; end + def text_date; File.mtime(text_filename) rescue nil; end + + def save_yaml + open((base_name + ".yaml"),"w") {|f| f.write(self.clone.to_yaml)} + end + + def self.load_yaml(data_dir) + if data_dir.to_i == 0 + data_directory = Pathname.new(data_dir) + raise "Data '#{data_dir}' directory not found." unless data_directory.exist? + else + data_directory = Pathname.new(RAILS_ROOT) + "tmp/tables/#{data_dir}" + end + file = (data_directory + "table.yaml").to_s + t = Table.from_yaml(open(file,"r"){|f|f.readlines.join}) + t.set_data_directory(data_directory) + t + end + + def render(options = {}) + return if File.exist?(text_filename) and not (text_date < data_date rescue false) + save_yaml + + data = get_data + if data.column_names.length == 0 + txt = "--------------------------\n" + txt += "| No columns to display. |\n" + txt += "--------------------------\n" + else + txt = data.as(:text, :ignore_table_width => true) + end + open(text_filename,"w") {|f| f.write(txt) } + end + + def set_data_directory(dir) + @data_directory = dir + end + def data_directory + if @data_directory + p = Pathname.new(@data_directory) + else + p = Pathname.new(RAILS_ROOT) + "tmp/tables/#{id}" + end + p.mkpath + p + end + def delete_data + d = data_directory + d.rmtree if d.exist? and d.directory? + end + + def group_by + return nil if super and super == "" + super + end + + def order_by + return nil if super and super == "" + super + end + + def to_csv + get_data.to_csv + end + def as(type, options = {}) + d = get_data + return nil if d.length == 0 + d.as(type,options) + end + def count + get_data.length + end + + def remove_cache + File.delete(data_filename) if File.exists?(data_filename) + end + + def get_data(recreate_data = false) + if !recreate_data and File.exists?(data_filename) + @data = YAML::load(File.open(data_filename)) + else + + if datasource.respond_to?(:data) + raise "Group by not supported by this datasource '#{datasource.name}'" if group_by + raise "Order by not supported by this datasource '#{datasource.name}'" if order_by + + data = datasource.data + cols = datasource.columns.map{|c| c.name}.select {|n| columns_arr.include?(n)} + data = data.map {|row| + nr = [] + cols.each{|col| nr.push(row[col])} + nr + } + + @data = Ruport::Data::Table.new :data => data, :column_names => cols + + else + @data = @datasource.table.report_table(:all, + :select => if (columns.nil? or columns == "") then nil else columns end, + :limit => max_count, + :only => if (columns.nil? or columns == "") then nil else columns.split(",").map{|n| n.strip} end, + :order => order_by, + :group => group_by, + :conditions => conditions) + end + + File.open(data_filename, 'w') { |f| f.puts @data.to_yaml } + end + @data + end + +end Added: incubator/alois/trunk/rails/app/models/view.rb URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/models/view.rb?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/models/view.rb (added) +++ incubator/alois/trunk/rails/app/models/view.rb Thu Nov 4 18:27:22 2010 @@ -0,0 +1,272 @@ +# 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. + + class View < ActiveRecord::Base + has_many :sentinels + + validate do |view| + if view.do_not_use_view_for_query + view.example_replacement_query + end + end + + def example_replacement_query + # try to replace the values + View.update_query(self.sql, + {:conditions => "date = CURRENT_DATE and id LIKE '1%'", + :order => "id", + :limit => "13", + :offset => "9"}) + end + + def host + view_connection.host + end + + def display_name + self.name + end + + def self.get_class_from_tablename(tablename) + return nil unless tablename + if tablename =~ /^view_(\d*)$/ + return find($1) + end + return nil + end + + def source_table_class + return @source_table_class if @source_table_class + @source_table_class = Prisma::Database.get_class_from_tablename(id_source_table) if defined?(Prisma::Database) + @source_table_class = View.get_class_from_tablename(id_source_table) unless @source_table_class + @source_table_class = GenericRecord.get_class_from_tablename(id_source_table) unless @source_table_class + return @source_table_class + end + + # Override Base functions + def save + create_view + ret = super + create_view + ret + end + + def table + return @table if @table + GenericRecord.table_name = view_name + GenericRecord.reset_column_information() + ActiveRecord::Base.connection_handler.connection_pools["GenericRecord"] = view_connection.pool + + begin + create_view unless GenericRecord.table_exists? + rescue + $log.error("Error creating view: #{$!}") + end + @table = GenericRecord + return @table + end + + def self.get_join + return nil + end + + def destroy + View.drop_view(view_connection, view_name) + super + end + + def view_name + "view_#{id}" + end + + def table_name + view_name + end + + def sql + s = self.sql_declaration + s.gsub!(/<>/) {|match| + view = View.find_by_name($1) + throw "View with name '#{$1}' not found!" unless view + view.table_name + } + s + end + + # Create a new view in the default (normally alois) database. + def View.create_view(connection, name, query, throw_exception = false) + begin + View.drop_view(connection, name) + throw "No query given." unless query + throw "No name given." unless name + create = "CREATE VIEW #{name} AS " + query + $log.debug{create} + connection.activerecord_connection.execute(create) + rescue ActiveRecord::Transactions::TransactionError + raise $! + rescue + $log.warn "Could not create view #{name}: #{$!.to_s}" if $log.warn? + throw $! if throw_exception + end + end + + # Drop the view with the given name in the default (normally alois) database.. + def View.drop_view(connection, name) + drop = "DROP VIEW IF EXISTS #{name}" + $log.debug{drop} + connection.activerecord_connection.execute(drop) + end + + def view_connection + # TODO: implement function to find correct parent class + if !id_source_table.blank? and !(id_source_table =~ /^view_/) + klass = eval(id_source_table.classify) + else + klass = LogMeta + end + + conn = Connection.from_pool(klass.connection_pool) + raise "Connection for class #{klass.name} not found" unless conn + conn + end + + def create_view + # not working because show field does not + # work anymore. Always create view + # Prisma.drop_view(view_name) +# if self.do_not_use_view_for_query +# Prisma.create_view(view_name, sql_declaration,true) +# else + View.create_view(view_connection, view_name, sql,true) +# end + end + + def get_date_column + date_column_name or "date" + end + + def get_select + return "*" + end + + def get_join + return nil + end + + #-------------------- quering --------- + # SELECT + # [ALL | DISTINCT | DISTINCTROW ] + # [HIGH_PRIORITY] + # [STRAIGHT_JOIN] + # [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] + # [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS] + # select_expr, ... + # [FROM table_references + # [WHERE where_condition] + # [GROUP BY {col_name | expr | position} + # [ASC | DESC], ... [WITH ROLLUP]] + # [HAVING where_condition] + # [ORDER BY {col_name | expr | position} + # [ASC | DESC], ...] + # [LIMIT {[offset,] row_count | row_count OFFSET offset}] + # [PROCEDURE procedure_name(argument_list)] + # [INTO OUTFILE 'file_name' export_options + # | INTO DUMPFILE 'file_name' + # | INTO var_name [, var_name]] + # [FOR UPDATE | LOCK IN SHARE MODE]] + + def View.insert_generic(type, query, value, regexps) + return query if value == "" or value.nil? + + regex = regexps.select {|reg| query =~ reg}[0] + if regex + query =~ regex + case type + when :before + throw "Missing ( ) in regexp #{regex}." unless $1 + query.sub(regex, "#{value} #{$1}") + when :after + throw "Missing ( ) in regexp #{regex}." unless $1 + query.sub(regex, "#{$1} #{value}") + when :substitute, :replace + query.sub(regex, "#{value}") + end + end + end + + def View.insert_condition(query, condition) + return query if condition == "" or condition.nil? + + insert_generic(:after, query, "#{condition} AND", [/(WHERE)/i]) or + insert_generic(:before, query, "WHERE #{condition}", [/(GROUP BY)/i,/(HAVING)/i, /(ORDER BY)/i, /(LIMIT)/i]) or + query + " WHERE #{condition}" + end + + def View.insert_limit_offset(query, limit, offset = nil) + if offset + val = "LIMIT #{offset.to_i}, #{limit.to_i}" + else + val = "LIMIT #{limit.to_i}" + end + insert_generic(:replace, query, val, [/LIMIT\s*\d+,\s*\d+/i,/LIMIT\s*\d+\s*OFFSET\s*\d+/i,/LIMIT\s*\d+/]) or + insert_generic(:before, query, val, [/(PROCEDURE)/i,/(INTO\s)/i,/(FOR UPDATE)/i, /(LOCK IN)/i]) or + query + " " + val + end + + def View.insert_order(query, order) + val = "ORDER BY #{order}" + insert_generic(:replace, query, "#{val} LIMIT", [/ORDER\s*BY\s.*\s*LIMIT/i]) or + insert_generic(:replace, query, "#{val} PROCEDURE", [/ORDER\s*BY\s.*\s*PROCEDURE/i]) or + insert_generic(:replace, query, "#{val} INTO", [/ORDER\s*BY\s.*\s*INTO/i]) or + insert_generic(:replace, query, "#{val} FOR UPDATE", [/ORDER\s*BY\s.*\s*FOR UPDATE/i]) or + insert_generic(:replace, query, "#{val} LOCK IN", [/ORDER\s*BY\s.*\s*LOCK IN/i]) or + insert_generic(:replace, query, "#{val}", [/ORDER\s*BY\s.*$/i]) or + insert_generic(:before, query, val, [/(LIMIT)/i,/(PROCEDURE)/i,/(INTO\s)/i,/(FOR UPDATE)/i, /(LOCK IN)/i]) or + query + " " + val + end + + def View.update_query(query, options = {}) + return query if options.nil? or options.length == 0 + # SELECT ... + # UNION [ALL | DISTINCT] SELECT ... + # [UNION [ALL | DISTINCT] SELECT ...] + parts = query.split(/union/i) + new_query = parts.map! {|part| + part = part.strip + # remove leading ALL or DISTINCT + start = "" + part.sub!(/^(all)\s/i) {|v| start = $1; "" } + part.sub!(/^(distinct)\s/i) {|v| start = $1; "" } + if start == "" + start += "(" + else + start += " (" + end + + # remove leading and tailing brackets + while part.strip.starts_with?("(") + throw "'#{part}' starts with a ( but does not end with one." unless + part.strip.ends_with?(")") + part = part.strip[1..-2] + end + + part = View.insert_condition(part,options[:conditions]) if options[:conditions] + part = View.insert_limit_offset(part,options[:limit],options[:offset]) if options[:limit] + part = View.insert_order(part,options[:order]) if options[:order] + part += " " unless part.ends_with?(" ") + start + part + }.join(") UNION ") + ")" + end + + end Added: incubator/alois/trunk/rails/app/views/_count_text.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/_count_text.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/_count_text.rhtml (added) +++ incubator/alois/trunk/rails/app/views/_count_text.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1 @@ +<%= get_count_text() %> \ No newline at end of file Added: incubator/alois/trunk/rails/app/views/_messages.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/_messages.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/_messages.rhtml (added) +++ incubator/alois/trunk/rails/app/views/_messages.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,24 @@ +<% + message_class = nil + message_class = "messages" unless notices.empty? + message_class = "important_messages" unless errors.empty? +%> + +<% unless message_class.nil? %> + + + + + <% for message in errors %> + + + + <% end %> + + <% for message in notices %> + + + + <% end %> +
Hinweis
<%= image_tag 'important_message.png' %><%=h message %>
<%= image_tag 'message.png' %><%=h message %>
+<% end %> Added: incubator/alois/trunk/rails/app/views/alarm_mailer/simple.html.erb URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarm_mailer/simple.html.erb?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarm_mailer/simple.html.erb (added) +++ incubator/alois/trunk/rails/app/views/alarm_mailer/simple.html.erb Thu Nov 4 18:27:22 2010 @@ -0,0 +1,32 @@ +Alarm ocurred on <%= @alarm.created_at %>. + + + + + + + + +<% if @sentinel = @alarm.sentinel %> + + + + +<% end %> + + + + + + + + + + + + + +
<%=h @alarm.id %>
<%= @sentinel.name %> +
+ <%=h @sentinel.description %> +
<%=h @alarm.alarm_level %>: <%= @alarm.alarm_level_name %>
<%=h @alarm.comment %>
<%= link_to "Alarm \##{@alarm.id}", :only_path => false,:controller => :alarms, :action => :show, :id => @alarm %>
Added: incubator/alois/trunk/rails/app/views/alarm_mailer/simple.plain.erb URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarm_mailer/simple.plain.erb?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarm_mailer/simple.plain.erb (added) +++ incubator/alois/trunk/rails/app/views/alarm_mailer/simple.plain.erb Thu Nov 4 18:27:22 2010 @@ -0,0 +1,12 @@ +Alarm ocurred on <%=h @alarm.created_at %>. + ID: <%=h @alarm.id %> +<% if @sentinel = @alarm.sentinel -%> + Created by Sentinel: <%= @sentinel.name %> +<% end -%> + Alarm Level: <%=h @alarm.alarm_level %> + Link: <%= url_for :only_path => false,:controller => :alarms, :action => :show, :id => @alarm %> + +Comment: +<%=h @alarm.comment %> + + Added: incubator/alois/trunk/rails/app/views/alarms/_form.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarms/_form.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarms/_form.rhtml (added) +++ incubator/alois/trunk/rails/app/views/alarms/_form.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,17 @@ +<%= error_messages_for 'alarm' %> + + + Alarm + + + + + <%= text_area 'alarm', 'comment' %> + + + + <%= select("alarm", "process_state", Alarm::PROCESS_STATES.map {|num, name| [name.to_s,num]}.sort_by{|p| p[1]}) %> + + + + Added: incubator/alois/trunk/rails/app/views/alarms/_status_item.html.erb URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarms/_status_item.html.erb?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarms/_status_item.html.erb (added) +++ incubator/alois/trunk/rails/app/views/alarms/_status_item.html.erb Thu Nov 4 18:27:22 2010 @@ -0,0 +1,15 @@ + + <%=h @alarm.id %><%= @alarm.acknowledge %> +<% if @alarm.acknowledge %> + <%=h @alarm.alarm_level_name %> +<% else %> + <%=h @alarm.alarm_level_name %> +<% end %> + <%= fobj(@alarm.sentinel) %> + <%=h @alarm.created_at.strftime("%F %T") %> + <%=h @alarm.process_state %> + <%=h @alarm.comment %> + + <%= link_to image_tag( 'show.png' ), :action => 'show', :id => @alarm %><%= link_to image_tag( 'edit.png' ), :action => 'edit', :id => @alarm %> + + Added: incubator/alois/trunk/rails/app/views/alarms/_survey_component.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarms/_survey_component.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarms/_survey_component.rhtml (added) +++ incubator/alois/trunk/rails/app/views/alarms/_survey_component.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,33 @@ +<%= title @controller.controller_name.humanize %> + +
+<%= error_messages %> + + + + + + + + +<% for alarm in @alarms %> + + + + + + + +<% end %> + + + + +
IDSentinel NameDateProcess State +
<%=h alarm.id %><%=h alarm.sentinel.name if alarm.sentinel %><%=h alarm.created_at %><%=h alarm.process_state %> + <%= link_to image_tag( 'show.png' ), :action => 'show', :id => alarm %><%= link_to image_tag( 'edit.png' ), :action => 'edit', :id => alarm %> +
+<%= link_to 'Previous page', { :page => @alarm_pages.current.previous } if @alarm_pages.current.previous %> +<%= link_to 'Next page', { :page => @alarm_pages.current.next } if @alarm_pages.current.next %> +
+
Added: incubator/alois/trunk/rails/app/views/alarms/edit.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarms/edit.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarms/edit.rhtml (added) +++ incubator/alois/trunk/rails/app/views/alarms/edit.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,13 @@ +<%= title "#{@controller.action_name.humanize} #{@controller.controller_name.singularize.humanize} - #{@alarm.id}" %> + +
+ + + <% form_tag :action => 'update', :id => @alarm do %> + <%= render :partial => 'form' %> + + + + <% end %> +
<%= submit_tag "Update" %> <%= submit_tag "Cancel" %>
+
Added: incubator/alois/trunk/rails/app/views/alarms/list.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarms/list.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarms/list.rhtml (added) +++ incubator/alois/trunk/rails/app/views/alarms/list.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,31 @@ +<%= title @controller.controller_name.humanize %> + +
+<%= error_messages %> + + + + + + + + +<% for alarm in @alarms %> + + + + + + + +<% end %> + + + + +
IDSentinel NameDateProcess State +
<%=h alarm.id %><%=h alarm.sentinel.name if alarm.sentinel %><%=h alarm.created_at %><%=h alarm.process_state %> + <%= link_to image_tag( 'show.png' ), :action => 'show', :id => alarm %><%= link_to image_tag( 'edit.png' ), :action => 'edit', :id => alarm %> +
<%= will_paginate @alarms %> +
+
Added: incubator/alois/trunk/rails/app/views/alarms/new.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarms/new.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarms/new.rhtml (added) +++ incubator/alois/trunk/rails/app/views/alarms/new.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,8 @@ +

New alarm

+ +<% form_tag :action => 'create' do %> + <%= render :partial => 'form' %> + <%= submit_tag "Create" %> +<% end %> + +<%= link_to 'Back', :action => 'list' %> Added: incubator/alois/trunk/rails/app/views/alarms/send_to_email.html.erb URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarms/send_to_email.html.erb?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarms/send_to_email.html.erb (added) +++ incubator/alois/trunk/rails/app/views/alarms/send_to_email.html.erb Thu Nov 4 18:27:22 2010 @@ -0,0 +1 @@ +Alarm <%= @alarm.id %> sent to <%= params[:addresses].inspect %>.
\ No newline at end of file Added: incubator/alois/trunk/rails/app/views/alarms/show.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarms/show.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarms/show.rhtml (added) +++ incubator/alois/trunk/rails/app/views/alarms/show.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,83 @@ +<%= title("Alarm - #{@alarm.id}") %> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Alarm
<%=h @alarm.id %>
<%=h @alarm.created_at %>
<%=h @alarm.alarm_level %>: <%= @alarm.alarm_level_name %>
<%= fobj(@alarm.sentinel) %> + <% if @sentinel = @alarm.sentinel %>
+ <%=h @sentinel.description %> + <% end %> +
<% @sentinel.alarms.reject {|a| a.acknowledge}.each {|a| %> + <%=h a.created_at %>: <%= fobj(a) %>
+ <% } %> +
Comment
<%=h @alarm.comment %>
<%=h @alarm.process_state %>
Data
<%=h @alarm.text rescue $! %>
<%= link_to "#{@alarm.sentinel.view.table_name} WHERE #{@alarm.conditions}", + :controller => "survey", :action => :list, + :table => @alarm.sentinel.view.table_name, + :default_filter => @alarm.conditions %>
<%=h @alarm.log %>
<%=h @alarm.path %>
<%= fobj(@alarm.report) %>
<%= button_to "Edit", :action => :edit, :id => @alarm %><%= button_to "List all", :action => :list %> + +<% form_tag :action => :send_to_email, :id => @alarm do %> + Send to alarm notification to email: <%= text_field_tag 'addresses' %> + <%= submit_tag "Send" %> +<% end %> + +
+
Added: incubator/alois/trunk/rails/app/views/alarms/status.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/alarms/status.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/alarms/status.rhtml (added) +++ incubator/alois/trunk/rails/app/views/alarms/status.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,63 @@ +<%= title @controller.controller_name.humanize %> + +
+<%= error_messages %> + + + + + + + + + + +<% if @alarms.length == 0 and not params[:page]%> + + + + + + +<% else %> + + + +<% for @alarm in @alarms %> + <%= render :partial => "status_item" %> +<% end %> + + + + +<% end %> + + + + +<% for @alarm in @ack_alarms %> + <%= render :partial => "status_item" %> +<% end %> + + + + + + + +<% for @alarm in @infos %> + <%= render :partial => "status_item" %> +<% end %> + + + + +
IDLevelSentinelDateProcess StateComment +
No Current Alarms
+ <%= link_to "Reload", :action => "list" %> +
Current Alarms
<%= will_paginate @alarms %> + <%= link_to "Reload", :action => "list" %> +
Latest Acknowledgements
<%= will_paginate @ack_alarms,:param_name => "page_ack" %> +
Informational or Debug Alarms
<%= will_paginate @infos, :param_name => "page_info" %> +
+
Added: incubator/alois/trunk/rails/app/views/bookmarks/_form.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/bookmarks/_form.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/bookmarks/_form.rhtml (added) +++ incubator/alois/trunk/rails/app/views/bookmarks/_form.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,26 @@ +<%= error_messages_for 'bookmark' %> + + +


+<%= text_field 'bookmark', 'title' %>

+ +


+<%= text_area 'bookmark', 'description' %>

+ +


+<%= select 'bookmark', 'table_name', Prisma::Database.data_sources.map {|s| [s.name,s.table.table_name] }.sort_by{|x|(x[0] or "")}, {:include_blank => true} %> + +


+<%= text_field 'bookmark', 'controller' %>

+ +


+<%= text_field 'bookmark', 'action' %>

+ +


+<%= text_field 'bookmark', 'identifier' %>

+ +


+<%= text_field 'bookmark', 'mode' %>

+ + + Added: incubator/alois/trunk/rails/app/views/bookmarks/edit.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/bookmarks/edit.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/bookmarks/edit.rhtml (added) +++ incubator/alois/trunk/rails/app/views/bookmarks/edit.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,9 @@ +

Editing bookmark

+ +<% form_tag :action => 'update', :id => @bookmark do %> + <%= render :partial => 'form' %> + <%= submit_tag 'Save' %> +<% end %> + +<%= link_to 'Show', :action => 'show', :id => @bookmark %> | +<%= link_to 'Back', :action => 'list' %> Added: incubator/alois/trunk/rails/app/views/bookmarks/list.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/bookmarks/list.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/bookmarks/list.rhtml (added) +++ incubator/alois/trunk/rails/app/views/bookmarks/list.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,29 @@ +<%= title @controller.controller_name.humanize %> + +
+<%= error_messages %> + + + + + + +<% for bookmark in @bookmarks %> + + + + + +<% end %> + + + + +
IDTitle +
<%=h bookmark.id %><%=h bookmark.title %> + <%= link_to image_tag( 'goto.png' ), bookmark.url rescue "" %><%= link_to image_tag( 'show.png' ), :action => 'show', :id => bookmark %><%= link_to image_tag( 'edit.png' ), :action => 'edit', :id => bookmark %><%= link_to image_tag( 'delete.png' ),{:action => 'destroy', :id => bookmark }, :confirm => 'Are you sure?', :method => :post %> +
+<%= will_paginate(@bookmarks) %> +<%= link_to 'New bookmark', { :action => "new" } %> +
+
Added: incubator/alois/trunk/rails/app/views/bookmarks/new.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/bookmarks/new.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/bookmarks/new.rhtml (added) +++ incubator/alois/trunk/rails/app/views/bookmarks/new.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,8 @@ +

New bookmark

+ +<% form_tag :action => 'create' do %> + <%= render :partial => 'form' %> + <%= submit_tag "Create" %> +<% end %> + +<%= link_to 'Back', :action => 'list' %> Added: incubator/alois/trunk/rails/app/views/bookmarks/show.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/bookmarks/show.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/bookmarks/show.rhtml (added) +++ incubator/alois/trunk/rails/app/views/bookmarks/show.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,8 @@ +<% for column in Bookmark.content_columns %> +

+ <%= column.human_name %>: <%=h @bookmark.send(column.name) %> +

+<% end %> + +<%= link_to 'Edit', :action => 'edit', :id => @bookmark %> | +<%= link_to 'Back', :action => 'list' %> Added: incubator/alois/trunk/rails/app/views/charts/_column_fields.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/_column_fields.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/_column_fields.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/_column_fields.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,69 @@ + + + + + + + + + + + <% if current_table %> + + + + + <% else %> + + + + + <% end %> + + + <% ["1st","2nd","3rd"].each {|num| %> + + + <% Chart::ORDER_NAMES.each_with_index {|order_name,index| %> + + <% } %> + <% if current_table %> + + <% } %> + + + +
X-Axis <%= short_help "Chart X-Axis","The column to use for the X-Axis of the chart." %>Y-Axis <%= short_help "Chart Y-Axis, Aggregation Function", "This function and column is used to compute the data values for the chart. The value used is then AGG_FUNC(AGG_COL) (e.g. COUNT(*) or SUM(bytes)...)." %>Z-Axis <%= short_help "Chart Z-Axis","The column to use for the Y-Axis of the chart (select a column to get a stacket chart)." %>Multi Chart <%= short_help "Mutli Chart","Select a column to define for which values a sepearate chart should be rendered." %>
Data<%= select("chart", "column1", current_table.columns.map {|c| c.name }.sort) %><%= select("chart", "aggregation_function", Chart::AGGREGATION_FUNCTIONS) -%><%= select("chart", "aggregation_column", ["*"] + current_table.columns.map {|c| c.name} ) %><%= select("chart", "column2", current_table.columns.map {|c| c.name }.sort, { :include_blank => true }) %><%= select("chart", "column3", current_table.columns.map {|c| c.name }.sort, { :include_blank => true }) %><%= text_field("chart", "column1",:size => 10) %><%= select("chart", "aggregation_function", Chart::AGGREGATION_FUNCTIONS) -%><%= text_field("chart", "aggregation_column", {:default => "*",:size => 10}) %><%= text_field("chart", "column2",:size => 10) %><%= text_field("chart", "column3",:size => 10) %>
<%= num %>-Order <%= short_help "How the data should be orderd in the chart", "Select an order an the chart will be ordered like this. SQL syntax is used here. For example COUNT(*) DESC means it will be orderd by COUNT(*) descending." %><%= image_tag("up.png") %><%= radio_button "chart", "order_#{num}", "#{order_name}" %> + <%= image_tag("down.png") %><%= radio_button "chart", "order_#{num}", "#{order_name}_desc" %><%= radio_button "chart", "order_#{num}", "none" %><%= select("chart", "order_field_#{num}", @chart.possible_orders, { :include_blank => true } ) %> + <% else %> + <%= text_field("chart", "order_by",:size => 10) %> + <% end %> +
Type + + + + <% Chart::CHART_TYPES.each {|chart_type| %> + + <% } %> + <% Chart::CHART_OPTIONS.each {|option| %> + + <% } %> + + + <% Chart::CHART_TYPES.each {|chart_type| %> + + <% } %> + <% Chart::CHART_OPTIONS.each {|option| %> + + <% } %> + + +
+ <%= image_tag("#{chart_type}-chart.png") %> + <%= short_help "#{chart_type.to_s.camelize} Chart",Chart::CHART_TEXTS[chart_type][1] %> + <%= option.to_s.camelize %>
<%= radio_button "chart", "chart_type", chart_type %><%= check_box "chart", option %>
+ +
+ + + Added: incubator/alois/trunk/rails/app/views/charts/_form.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/_form.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/_form.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/_form.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,28 @@ + + + <%= text_field 'chart', 'name' %> + + + + <%= text_area 'chart', 'description', :style => "width: 99%", :rows => 4 %> + + + + <%= text_field_with_auto_complete :chart, :time_range, :autocomplete => "off", :style => 'width: 98%', :rows => 4 %> + + + + <%= text_field 'chart', 'width', :style => "width: 99%" %> + + + + <%= text_field 'chart', 'height', :style => "width: 99%"%> + + + + <%= text_field 'chart', 'max_values', :style => "width: 99%"%> + + + + <%= render :partial => "column_fields" %> + Added: incubator/alois/trunk/rails/app/views/charts/_render_chart_inline.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/_render_chart_inline.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/_render_chart_inline.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/_render_chart_inline.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,19 @@ +<% if @chart.datasource(true) %> + <%= @chart.image_tag({:url => url_for(:action => "chart_image", :id => @chart, :table => params[:table])}) %> + <%= @chart.image_map({:link => url_for(:controller => "survey",:action => "chart_click",:table => @chart.datasource.table.table_name) + "?"}) %> + +
+ <% if @chart.data_date %> + Data generated: <%= @chart.data_date.strftime("%c") %> + <% end %> + <% if @chart.image_date %> + Image generated: <%= @chart.image_date.strftime("%c") %> + <% end %> + + <%= link_to_remote "Reload", + :before => "table_reload()", + :update => 'survey_chart', + :url => { :controller=> 'survey', :action => 'chart_inline', :state_id => @state_id, :recreate_data => true} %> +<% else %> + +<% end %> Added: incubator/alois/trunk/rails/app/views/charts/_show_conditions.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/_show_conditions.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/_show_conditions.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/_show_conditions.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,3 @@ +<% @current_filter.conditions.each_with_index { |@condition, @condition_index| %> + <%= @condition.sql(nil) %>
+<% } %> Added: incubator/alois/trunk/rails/app/views/charts/edit.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/edit.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/edit.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/edit.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,22 @@ +<%= title "#{@controller.action_name.humanize} #{@controller.controller_name.singularize.humanize} - #{@chart.name}" %> + + +
+ +<% form_tag :action => 'update', :id => @chart, :state_id => @state_id do %> +
+ <%= error_messages_for 'chart' %> + + + + + + + <%= render :partial => "form" %> + + + + +
Chart
<%= submit_tag "Save" %><%= submit_tag "Cancel" %>
+
+<% end %> Added: incubator/alois/trunk/rails/app/views/charts/edit_current.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/edit_current.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/edit_current.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/edit_current.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,6 @@ +
+<% form_remote_tag :update => 'edit_filter', :url => {:controller=> 'filters', :action => 'index', :id => @filter,:state_id => @state_id} do %> + <%= render :partial => 'form' %> + <%= submit_tag 'Update' %> +<% end %> +
Added: incubator/alois/trunk/rails/app/views/charts/list.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/list.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/list.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/list.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,27 @@ +<%= title @controller.controller_name.humanize %> + +
+<%= error_messages %> + + + + + + +<% for chart in @charts %> + + + + + +<% end %> + + + +
NameDescription +
<%=h chart.name %><%=h chart.description %> + <%= link_to image_tag( 'show.png' ), :action => 'show', :id => chart %><%= link_to image_tag( 'edit.png' ), :action => 'edit', :id => chart %> <%= link_to image_tag('delete.png'), { :action => 'destroy', :id => chart }, :confirm => 'Are you sure?', :method => :post %> +
+ <%= button_to "New #{@controller.controller_name.singularize.humanize}", :action => 'new' %> +
+
Added: incubator/alois/trunk/rails/app/views/charts/list_inline.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/list_inline.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/list_inline.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/list_inline.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,33 @@ + + + + + + + +<% for filter in @filters %> + + + + +<% end %> +
Name<%= link_to_remote(image_tag("update.png", :alt => "Reload filter list"), :update => "filters", :url => {:controller => "filters", :action => "list_inline", :params=>@current_filter.get_params}) %> +
<%=h filter.send("name") %> 'list', :params => filter.get_params %>">Use + <%= link_to_remote 'Destroy', :update => "filters", :url => {:controller => "filters", :action => 'destroy_inline', :id => filter }, :confirm => 'Are you sure?', :method => :post %>
+ + +<%= link_to_remote("Previous page", :update => "filters", :url => {:controller => "filters", :action => "list_inline", :page => @filter_pages.current.previous }) if @filter_pages.current.previous %> + +<%= link_to_remote("next page", :update => "filters", :url => {:controller => "filters", :action => "list_inline", :page => @filter_pages.current.next }) if @filter_pages.current.next %> + + +<% form_remote_tag :update => 'filters', :url => {:controller => "filters", :action => 'add_inline', :id => nil} do %> + + <%= text_field_tag :name %> + <% ps = @current_filter.get_params %> + <% for (name,value) in ps %> + <%= hidden_field_tag name,value %> + <% end %> + + +<% end %> Added: incubator/alois/trunk/rails/app/views/charts/new.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/new.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/new.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/new.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,20 @@ +<%= title "#{h @controller.action_name.humanize} #{h @controller.controller_name.singularize.humanize}" %> + +
+ <%= error_messages_for 'chart' %> + + <% form_tag :action => 'create', :state_id => @state_id do %> + + + + + + <%= render :partial => "form" %> + + + + + <% end %> + <%= post_attribute_new %> +
<%=h controller.controller_name.singularize.humanize %>
<%= submit_tag "Create" %><%= submit_tag "Cancel" %>
+
Added: incubator/alois/trunk/rails/app/views/charts/render_chart.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/render_chart.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/render_chart.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/render_chart.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1 @@ +<%= render :partial => "render_chart_inline" %> Added: incubator/alois/trunk/rails/app/views/charts/show.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/charts/show.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/charts/show.rhtml (added) +++ incubator/alois/trunk/rails/app/views/charts/show.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,38 @@ +<%= title("#{h @controller.controller_name.singularize.humanize} - #{h @chart.name}") %> + +
+ + + + + <% for col in @chart.class.columns %> + + + + + <% end %> + + <%= post_attributes_show %> + + + + + + + + + + + +
Chart
<%=h @chart.send(col.name) %>
<%= button_to "Edit", :action => :edit, :id => @chart %><%= button_to "Delete", { :action => :destroy, :id => @chart }, :confirm => 'Are you sure?' %><%= button_to "List all", :action => :list %>
Render
Select datasource to render with: +<% form_tag :action => :render_chart, :id => @chart do %> + +<%= select_tag('table', options_for_select(Prisma::Database.data_sources.select {|s| + @chart.applyable?(s) + }.map {|s| + [s.name,s.table_name] + }.sort{|x,y| (x[0] or "") <=> (y[0] or "")}), {:include_blank => true}) %> +<%= submit_tag "Render"%> +<% end %> +
+
Added: incubator/alois/trunk/rails/app/views/exception/_generic.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/exception/_generic.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/exception/_generic.rhtml (added) +++ incubator/alois/trunk/rails/app/views/exception/_generic.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,16 @@ +

A unhandled exception occurred: <%= @exception_name %>

+

This application is still under development. Something unexpected happened:

+

<%=h @exception.to_s %>

+

If you think this is a bug of the application and should work, please report the error to the developer: Flavio Pellanda The more information you can give the more we can help.

+

Message:

+
+<%=h $!.message %>
+
+

Params:

+
+<%=h params.inspect %>
+
+

Trace:

+
+<%=h $!.backtrace.join("\n") %>
+
\ No newline at end of file Added: incubator/alois/trunk/rails/app/views/exception/generic.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/exception/generic.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/exception/generic.rhtml (added) +++ incubator/alois/trunk/rails/app/views/exception/generic.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1 @@ +<%= render :partial => "generic" %> \ No newline at end of file Added: incubator/alois/trunk/rails/app/views/exception/record_not_found.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/exception/record_not_found.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/exception/record_not_found.rhtml (added) +++ incubator/alois/trunk/rails/app/views/exception/record_not_found.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1 @@ +RECORD NOT FOUND EXCEPTION <%= params[:exception].inspect %> \ No newline at end of file Added: incubator/alois/trunk/rails/app/views/filters/_add_condition_help.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/_add_condition_help.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/_add_condition_help.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/_add_condition_help.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,40 @@ +<%= help_title("Adding Conditions") %> +

A condition consists of a column, operator and a +value.

+ +<%= help_subtitle("Column") %> +

Dropdown: You can select a column or ANY. ANY means that +the value compared with the selected operator must match for +any column of the view. E.g. you can look for a existence of +a word in any column.
+The column is always ment to be the one from +the current view, so you do not have to declare the +table name.

+ +<%= help_subtitle("Operator") %> +

The operator generally have the same meaning as in SQL. +There are two special operators: +

+ +<%= help_subsubtitle("SQL") %> +

Use this operator if you want to type a sql statement by +yourself. In this case the column will be ignored totally and +you can enter the sql statement in the value textbox.
+<%= help_notice("Be aware there will not be any semantic check in that case.") %>

+ +<%= help_subsubtitle("DATE") %> +

If you select this operator you can enter the meaningful name +for a date period into the value field. At the moment the following +values are supported: +

    + <% for name in DateCondition.get_date_descriptions %> +
  • <%= name %>
  • + <% end %> +
+

+ +<%= help_subtitle("Value") %> +

The value you want to compare with. Do not use any quotes +for string or any value. The system can check the type of +the column and do the proper escapement.
+<%= help_notice("You must take care of the escapements when using the SQL operator.") %>

Added: incubator/alois/trunk/rails/app/views/filters/_condition.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/_condition.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/_condition.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/_condition.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,18 @@ + <%= @condition.column %> + <%= @condition.operator %> +<% if @condition.updatable? then %> + <% form_remote_tag :update => 'edit_filter',:url => {:controller=> 'filters', + :action => 'update_condition', + :state_id => @state_id, + :condition_id => @condition_index} do -%> + <%= submit_to_remote "Send","Update", + :update => 'edit_filter', + :before => 'table_reload()', + :loaded => 'update_table()', :url => {:controller=> 'filters', + :action => 'update_condition', + :state_id => @state_id, + :condition_id => @condition_index} -%> + <% if @condition.operator == "DATE" and @condition_index -%><%= text_field_with_auto_complete :condition, :value, :autocomplete => "off", :size => 25 -%><% else -%><%= text_field :condition, :value, :size => 25 %><% end -%><% end -%> +<% else %> +<%= @condition.value %> +<% end %> \ No newline at end of file Added: incubator/alois/trunk/rails/app/views/filters/_condition_form.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/_condition_form.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/_condition_form.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/_condition_form.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,39 @@ + + + <% if current_table %> + + <% else %> + <%= text_field_tag "column", nil, :style => "width: 99%" %> + <% end %> + + + + + + + + + <%= submit_to_remote "Send", "Add", + :update => 'edit_filter', + :before => "table_reload()", + :loaded => 'update_table()', + :url => { :controller=> 'filters', + :action => 'add_condition', + :state_id => @state_id} %> + + <%= help_button "filter","condition_form" %> + + + Added: incubator/alois/trunk/rails/app/views/filters/_date_condition.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/_date_condition.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/_date_condition.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/_date_condition.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,8 @@ +<% form_tag :action => 'add_date_condition', :params => @current_filter.get_params ,:id => nil do %> +

<%= select_date @current_filter.from_date, :prefix => "new_from_date", :include_blank => true %> + -  +<%= select_date @current_filter.to_date, :prefix => "new_to_date", :include_blank => true %> +<%= select "current_filter", "time_description", Filter.get_date_descriptions, { :include_blank => true } %> + +

+<% end %> Added: incubator/alois/trunk/rails/app/views/filters/_detail_form.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/_detail_form.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/_detail_form.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/_detail_form.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,11 @@ + + Detail + + + + <%= text_field 'current_filter', 'name' %> + + + + <%= text_area 'current_filter', 'description', :style => "width: 99%", :rows => 4 %> + Added: incubator/alois/trunk/rails/app/views/filters/_form.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/_form.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/_form.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/_form.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,31 @@ +
+<%= error_messages_for 'current_filter', :header_message => "" %>
+<% form_remote_tag :update => 'edit_filter', + :url => {:controller=> 'filters', + :action => 'index', + :state_id => @state_id} do %> + + + + + + + + <% @current_filter.conditions.each_with_index { |@condition,@condition_index| %> + + <%= render :partial => "/filters/condition" %> + + + <% } %> + + <%= render :partial => "/filters/condition_form" %> +
ColumnOperatorValue 
<%= submit_to_remote "Send", "Delete", + :update => 'edit_filter', + :before => 'table_reload()', + :loaded => 'update_table()', + :url => { :controller=> 'filters', + :action => 'remove_condition', + :condition_id => @condition_index, + :state_id => @state_id} -%>
+<% end %> +
Added: incubator/alois/trunk/rails/app/views/filters/_form_with_functions.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/_form_with_functions.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/_form_with_functions.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/_form_with_functions.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,5 @@ +<%= 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 => "/filters/form" %> Added: incubator/alois/trunk/rails/app/views/filters/_possible_filters.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/_possible_filters.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/_possible_filters.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/_possible_filters.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,3 @@ +Possible Filters for source <%= current_datasource.name %>: <% @filters.each {|f| %> + <%= f.id %>: <%= fobj(f) %> +<% } %> Added: incubator/alois/trunk/rails/app/views/filters/_remove_condition_help.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/_remove_condition_help.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/_remove_condition_help.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/_remove_condition_help.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,2 @@ +<%= help_title("Remove Filter") %> +

Press the "Delete" button near the condition you want to delete.

\ No newline at end of file Added: incubator/alois/trunk/rails/app/views/filters/_show_conditions.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/_show_conditions.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/_show_conditions.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/_show_conditions.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,3 @@ +<% @current_filter.conditions.each_with_index { |@condition, @condition_index| %> + <%= @condition.sql(nil) rescue $! %>
+<% } %> Added: incubator/alois/trunk/rails/app/views/filters/edit.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/edit.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/edit.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/edit.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,22 @@ +<%= title "#{@controller.action_name.humanize} #{@controller.controller_name.singularize.humanize} - #{@current_filter.name}" %> + + +
+ +
+ + + + + + + + + <% form_tag :action => 'update', :id => @current_filter, :state_id => @state_id do %> + <%= render :partial => 'detail_form' %> + + + + <% end %> +
Conditions
<%= render :partial => "form_with_functions" %>
<%= submit_tag "Save" %><%= submit_tag "Cancel" %>
+
Added: incubator/alois/trunk/rails/app/views/filters/edit_current.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/edit_current.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/edit_current.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/edit_current.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,6 @@ +
+<% form_remote_tag :update => 'edit_filter', :url => {:controller=> 'filters', :action => 'index', :id => @filter,:state_id => @state_id} do %> + <%= render :partial => 'form' %> + <%= submit_tag 'Update' %> +<% end %> +
Added: incubator/alois/trunk/rails/app/views/filters/list.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/list.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/list.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/list.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,32 @@ +<%= title @controller.controller_name.humanize %> + +
+<%= error_messages %> + + + + + + + + +<% for filter in @filters %> + + + + +<% @current_filter = filter %> + + + +<% end %> + + + +
IDNameDescriptionRules +
<%=h filter.id %><%=h filter.name %><%=h filter.description %><%= render :partial => "show_conditions" %> + <%= link_to image_tag( 'show.png' ), :action => 'show', :id => filter %><%= link_to image_tag( 'edit.png' ), :action => 'edit', :id => filter %> <%= link_to image_tag('delete.png'), { :action => 'destroy', :id => filter }, :confirm => 'Are you sure?', :method => :post %> +
+ <%= button_to "New #{@controller.controller_name.singularize.humanize}", :action => 'new' %> +
+
Added: incubator/alois/trunk/rails/app/views/filters/list_inline.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/list_inline.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/list_inline.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/list_inline.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,33 @@ + + + + + + + +<% for filter in @filters %> + + + + +<% end %> +
Name<%= link_to_remote(image_tag("update.png", :alt => "Reload filter list"), :update => "filters", :url => {:controller => "filters", :action => "list_inline", :params=>@current_filter.get_params}) %> +
<%=h filter.send("name") %> 'list', :params => filter.get_params %>">Use + <%= link_to_remote 'Destroy', :update => "filters", :url => {:controller => "filters", :action => 'destroy_inline', :id => filter }, :confirm => 'Are you sure?', :method => :post, :id => @first_id %>
+ + +<%= link_to_remote("Previous page", :update => "filters", :url => {:controller => "filters", :action => "list_inline", :page => @filter_pages.current.previous }) if @filter_pages.current.previous %> + +<%= link_to_remote("next page", :update => "filters", :url => {:controller => "filters", :action => "list_inline", :page => @filter_pages.current.next }) if @filter_pages.current.next %> + + +<% form_remote_tag :update => 'filters', :url => {:controller => "filters", :action => 'add_inline', :id => nil} do %> + + <%= text_field_tag :name %> + <% ps = @current_filter.get_params %> + <% for (name,value) in ps %> + <%= hidden_field_tag name,value %> + <% end %> + + +<% end %> Added: incubator/alois/trunk/rails/app/views/filters/new.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/new.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/new.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/new.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,35 @@ +<%= title "#{h @controller.action_name.humanize} #{h @controller.controller_name.singularize.humanize}" %> + + +
+ +
+ <%= error_messages_for 'current_filter' %> + + + + + + + + + <% form_tag :action => 'create', :state_id => @state_id do %> + <%= render :partial => 'detail_form' %> + + + + <% end %> + <% form_tag :action=>'new', :state_id => @state_id do %> + + + + + + + + + + + <% end %> +
Conditions
<%= render :partial => "form_with_functions" %>
<%= submit_tag "Create" %><%= submit_tag "Cancel" %>
Upload
ZIP<%= text_area_tag 'filter_zip', '', :rows => 4 %>
<%= submit_tag "Load" %><%= submit_tag "Cancel" %>
+
Added: incubator/alois/trunk/rails/app/views/filters/show.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/show.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/show.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/show.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,27 @@ +<%= title("#{h @controller.controller_name.singularize.humanize} - #{h @current_filter.name}") %> + +
+ + + + + + + + + + + + + + + + + + + +
Filter
Description<%=h @current_filter.description %>
Rules<%= render :partial => "show_conditions" %>
Serialized
<%=h @current_filter.to_zip %>
+ <%= button_to 'Edit filter', :action => 'edit', :id => @filter %> + <%= button_to 'List all filters', :action => 'list' %> +
+
\ No newline at end of file Added: incubator/alois/trunk/rails/app/views/filters/show_inline.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/filters/show_inline.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/filters/show_inline.rhtml (added) +++ incubator/alois/trunk/rails/app/views/filters/show_inline.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,2 @@ +<%= render :partial => "show_conditions" %> + Added: incubator/alois/trunk/rails/app/views/help/_alois_in_help.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_alois_in_help.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/help/_alois_in_help.rhtml (added) +++ incubator/alois/trunk/rails/app/views/help/_alois_in_help.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,9 @@ +<%= help_title("Dobby in rate") %> +

The total aomunt of reocrds written by +prisma into the dobby database.

+

This rate is bigger than the +<%= help_link "pumpy outgoing rate", "pumpy_out" %> +because each message will be splited into +several sub records. So one incoming message may +be part of e.g. 5 records.

+

The unit is messages per second.

Added: incubator/alois/trunk/rails/app/views/help/_cron_help.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_cron_help.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/help/_cron_help.rhtml (added) +++ incubator/alois/trunk/rails/app/views/help/_cron_help.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,35 @@ +<%= help_title "Cron interval" %> +

The following is an extract from linux contab man pages and gives you a explanation how to format the cron field. +In our environment there is only a list of numbers or asterix allowed.
+

+ +
+Commands are executed by cron(8) when the minute, hour,
+and month of year fields match the  current  time,  and
+when at least  one  of  the  two  day fields (day of
+month, or day of week) match the current time examines
+cron entries once every minute.  The time and date fields
+are:
+
+field          allowed values
+-----          --------------
+minute         0-59
+hour           0-23
+day of month   1-31
+month          1-12 (or names, see below)
+day of week    0-7 (0 or 7 is Sun, or use names)
+
+A field may be an asterisk (*), which always stands for
+first-last.
+
+
+

Here is a list of examples:

+

+Run once a year, "0 0 1 1 *".
+Run once a month, "0 0 1 * *".
+Run once a week, "0 0 * * 0".
+Run once a day, "0 0 * * *".
+Run once an hour, "0 * * * *".
+Run once an hour at five past, "5 * * * *".
+
+
\ No newline at end of file Added: incubator/alois/trunk/rails/app/views/help/_dobby_help.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_dobby_help.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/help/_dobby_help.rhtml (added) +++ incubator/alois/trunk/rails/app/views/help/_dobby_help.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,8 @@ +<%= help_title("Dobby") %> +

Dobby is the database where the dispatched +messages are stored. This is the main database +where all the queries and sentinels work on.

+

On the <%= help_link "Tablelist" %> +page you can see which system tables exists in +the database and on the <%= help_link "Views" %> +you can see the views..

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

A filter is a set of sql conditions. You can apply a filter to a <%= help_link "view" %> or a table. By doing so you pick a specific set of data out of the whole datasource. Maybe you want to specify a filter for data on a day where something special happened, for a group of users and so on.

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

Probably you got here because a help page could not be found. Sorry for that. Maybe you can find the desired information somewhere under the following helps.

+

+

    +<% lc = nil %> +<% get_all_help_pages.each {|category,name,context,page| %> +<% unless lc == category %> +<% lc = category %> +

<%= context.humanize %>

    +<% end %> +
  • <%= name %>: <%= link_to image_tag("goto.png"),:controller => 'help',:action => 'index',:context => context,:page => page %>
  • +<% } %> +
+

+ +
Added: incubator/alois/trunk/rails/app/views/help/_help_not_found.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_help_not_found.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/help/_help_not_found.rhtml (added) +++ incubator/alois/trunk/rails/app/views/help/_help_not_found.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,6 @@ +<%= help_title("Help Not Found") %> +

The requested help page could not be found.

+

Context: <%=h params[:context]%>

+

Page: <%=h params[:page]%>

+

Help home: <%= help_goto "help" %>

+ Added: incubator/alois/trunk/rails/app/views/help/_hidden_help.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_hidden_help.rhtml?rev=1031127&view=auto ============================================================================== (empty) Added: incubator/alois/trunk/rails/app/views/help/_index_help.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_index_help.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/help/_index_help.rhtml (added) +++ incubator/alois/trunk/rails/app/views/help/_index_help.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,14 @@ +<%= help_title("Help Index") %> +

+
    +<% lc = nil %> +<% get_all_help_pages.each {|category,name,context,page| %> +<% unless lc == category %> +<% lc = category %> +

<%= category %>

    +<% end %> +
  • <%= name %>: <%= link_to image_tag("goto.png"),:context => context,:page => page %>
  • +<% } %> +
+
+

Added: incubator/alois/trunk/rails/app/views/help/_lizard_help.rhtml URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_lizard_help.rhtml?rev=1031127&view=auto ============================================================================== --- incubator/alois/trunk/rails/app/views/help/_lizard_help.rhtml (added) +++ incubator/alois/trunk/rails/app/views/help/_lizard_help.rhtml Thu Nov 4 18:27:22 2010 @@ -0,0 +1,6 @@ +<%= help_title("Lizard") %> +

The Lizard appliance searches the <%= help_link "Dobby" %> +database for unusual activities in your environment. It executes +so called <%= help_link "Sentinels" %> that will find +events that are diverging from predefined policies.

+