From: Chris W. <la...@us...> - 2003-06-29 16:17:45
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1:/tmp/cvs-serv18904/examples Added Files: spops_simple_object_declare_security_post_rewrite spops_simple_object_declare_security logging_simple_example logging_l4p_example_usage_write logging_l4p_example_usage_nowrite logging_l4p_config conversion_eu_manifest conversion_conf_script_execute Log Message: add more examples --- NEW FILE: spops_simple_object_declare_security_post_rewrite --- [news_section] class = OpenInteract2::NewsSection isa = OpenInteract2::SPOPS::DBI isa = SPOPS::Secure isa = SPOPS::DBI::Pg isa = SPOPS::DBI is_secure = yes field = field_discover = yes id_field = news_section_id no_insert = news_section_id increment_field = yes sequence_name = oi_news_section_seq base_table = news_section name = section object_name = News Section --- NEW FILE: spops_simple_object_declare_security --- [news_section] class = OpenInteract2::NewsSection isa = is_secure = yes field = field_discover = yes id_field = news_section_id no_insert = news_section_id increment_field = yes sequence_name = oi_news_section_seq base_table = news_section name = section object_name = News Section --- NEW FILE: logging_simple_example --- use Log::Log4perl qw( get_logger ); use OpenInteract2::Constants qw( :log ); sub foo { my ( $self ) = @_; my $log = get_logger( LOG_APP ); $log->is_debug && $log->debug( "Entering the 'foo' method of action" ); } --- NEW FILE: logging_l4p_example_usage_write --- my $log = get_logger( LOG_OI ); $log->info( "This info message will get written" ); $log->warn( "This warn message will get written" ); my $log_conf = get_logger( LOG_CONFIG ); $log_conf->warn( "This warn message will get written" ); $log_conf->error( "This error message will get written" ); --- NEW FILE: logging_l4p_example_usage_nowrite --- my $log = get_logger( LOG_OI ); $log->debug( "This debug message will NOT get written" ); my $log_conf = get_logger( LOG_CONFIG ); $log_conf->debug( "This debug message will NOT get written" ); $log_conf->info( "This info message will NOT get written" ); --- NEW FILE: logging_l4p_config --- ######################################## # ROOT CATEGORY log4perl.logger = FATAL, FileAppender, OIAppender ######################################## # OI2 CATEGORIES # This is the root OI2 logger. Lowering its level without specifying # the other OI2 loggers will result in lots of messages. log4perl.logger.OI2 = INFO log4perl.logger.OI2.CONFIG = WARN ... ######################################## # OI2 APPENDERS # Normal file log log4perl.appender.FileAppender = Log::Log4perl::Appender::File log4perl.appender.FileAppender.filename = [% website_dir %]/logs/oi2.log log4perl.appender.FileAppender.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.FileAppender.layout.ConversionPattern = %d: %C %L %m %n # Creates an error object and saves it to the database. Don't lower # the threshold too much! log4perl.appender.OIAppender = OpenInteract2::Log::OIAppender log4perl.appender.OIAppender.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.OIAppender.layout.ConversionPattern = %c && %C && %L && %m log4perl.appender.OIAppender.Threshold = ERROR --- NEW FILE: conversion_eu_manifest --- $ perl -MExtUtils::Manifest -e 'ExtUtils::Manifest::mkmanifest()' --- NEW FILE: conversion_conf_script_execute --- $ cd /path/to/OpenInteract-2.00-source/script $ perl translate_action_to_ini.pl < ~/pkg/mypkg/conf/action.perl > action.ini $ perl translate_spops_to_ini.pl < ~/pkg/mypkg/conf/spops.perl > spops.ini |