You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(381) |
Nov
(176) |
Dec
(310) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(334) |
Feb
(96) |
Mar
(149) |
Apr
(214) |
May
(120) |
Jun
(56) |
Jul
(10) |
Aug
(273) |
Sep
(182) |
Oct
(56) |
Nov
(125) |
Dec
(22) |
2003 |
Jan
(63) |
Feb
(181) |
Mar
(498) |
Apr
(433) |
May
(39) |
Jun
(512) |
Jul
(276) |
Aug
(156) |
Sep
(101) |
Oct
(66) |
Nov
(24) |
Dec
(161) |
2004 |
Jan
(1) |
Feb
(377) |
Mar
(68) |
Apr
(26) |
May
(107) |
Jun
(333) |
Jul
(13) |
Aug
|
Sep
(76) |
Oct
(88) |
Nov
(170) |
Dec
(91) |
2005 |
Jan
(52) |
Feb
(239) |
Mar
(402) |
Apr
(15) |
May
(2) |
Jun
(1) |
Jul
(13) |
Aug
|
Sep
(71) |
Oct
(34) |
Nov
|
Dec
|
2006 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(7) |
Oct
(2) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Chris W. <la...@us...> - 2004-11-30 02:26:47
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6184/examples Removed Files: templates_login_results1 templates_login_results2 templates_login_template templates_userlist_action_declare_source templates_userlist_actions templates_userlist_handler templates_userlist_handler_implicit templates_userlist_template templates_userlist_template_modified templates_userobject_properties Log Message: inline template examples --- templates_login_results1 DELETED --- --- templates_login_results2 DELETED --- --- templates_login_template DELETED --- --- templates_userlist_action_declare_source DELETED --- --- templates_userlist_actions DELETED --- --- templates_userlist_handler DELETED --- --- templates_userlist_handler_implicit DELETED --- --- templates_userlist_template DELETED --- --- templates_userlist_template_modified DELETED --- --- templates_userobject_properties DELETED --- |
From: Chris W. <la...@us...> - 2004-11-30 02:26:46
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6184/Manual Modified Files: Templates.pod Log Message: inline template examples Index: Templates.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Templates.pod,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Templates.pod 17 Feb 2004 04:30:11 -0000 1.12 --- Templates.pod 30 Nov 2004 02:26:37 -0000 1.13 *************** *** 20,29 **** template processing engine. Here's an example: ! [* INCLUDE examples/templates_login_template | linenum *] When run through the template processing engine with a normal user object in the 'OI.login' key, this will result in: ! [* INCLUDE examples/templates_login_results1 | linenum *] So the information between the '[%' and ' %]' symbols --- 20,31 ---- template processing engine. Here's an example: ! <p>Welcome back ! <font color="red">[% OI.login.full_name %]</font>!</p> When run through the template processing engine with a normal user object in the 'OI.login' key, this will result in: ! <p>Welcome back ! <font color="red">Charlie Brown</font>!</p> So the information between the '[%' and ' %]' symbols *************** *** 32,36 **** might have seen: ! [* INCLUDE examples/templates_login_results2 | linenum *] OpenInteract provides a number of tools for you in every template you --- 34,39 ---- might have seen: ! <p>Welcome back ! <font color="red">Peppermint Patty</font>!</p> OpenInteract provides a number of tools for you in every template you *************** *** 57,61 **** have a subroutine like this: ! [* INCLUDE examples/templates_userlist_handler | linenum *] (The actual code would have lots of good things like error checking, --- 60,87 ---- have a subroutine like this: ! sub list_time_limit { ! my ( $self ) = @_; ! my $request = CTX->request; ! my $time_limit = $self->param( 'time_limit' ) ! || $request->param( 'time_limit' ); ! ! # This SQL is Sybase-specific, but should be clear ! my $where = 'datediff( minute, last_access, getdate() ) <= 30'; ! ! # Note: 'fetch_group' returns an arrayref of objects. ! my $user_class = CTX->lookup_object( 'user' ); ! my $user_list = eval { ! $user_class->fetch_group({ ! where => $where, ! order => 'last_access', ! }) ! }; ! my %params = ( ! user_list => $user_list, ! time_limit => $time_limit, ! ); ! return $self->generate_content( ! \%params, { name => 'mypkg::user_list' } ); ! } (The actual code would have lots of good things like error checking, *************** *** 70,74 **** And your template might look like: ! [* INCLUDE examples/templates_userlist_template | linenum *] There are a few things at work here: --- 96,118 ---- And your template might look like: ! 1 : [%- DEFAULT theme = OI.theme_properties -%] ! 2 : ! 3 : <h2>User Listing</h2> ! 4 : ! 5 : <p>Users with accesses in the last <b>[% time_limit %]</b> minutes. ! 6 : ! 7 : <table border="0" cellpadding="4"> ! 8 : ! 9 : [% PROCESS header_row( [ 'Username', 'Full Name', 'Last Access' ] ) %] ! 10: ! 11: [% FOREACH user_object = user_list %] ! 12: <tr align="center" valign="middle"> ! 13: <td>[% user_object.login_name %]</td> ! 14: <td>[% user_object.full_name %]</td> ! 15: <td>[% user_object.last_access %]</td> ! 16: </tr> ! 17: [% END %] ! 18: ! 19: </table> There are a few things at work here: *************** *** 98,102 **** 'user_object.full_name' could transparently translate to either: ! [* INCLUDE examples/templates_userobject_properties | indent(2) *] Here we're using the 'user_object' variable (obviously) as an --- 142,147 ---- 'user_object.full_name' could transparently translate to either: ! $user_object->full_name() ! $user_object->{full_name} Here we're using the 'user_object' variable (obviously) as an *************** *** 108,112 **** =item 3. ! We access the OpenInteract plugin ('OI') and find the theme properties from it ('OI.theme_properties', line 1). These get assigned to a variable so we can use it multiple times throughout the template --- 153,157 ---- =item 3. ! We access the OpenInteract2 plugin ('OI') and find the theme properties from it ('OI.theme_properties', line 1). These get assigned to a variable so we can use it multiple times throughout the template *************** *** 127,131 **** replace the 'user_list' template with the following: ! [* INCLUDE examples/templates_userlist_template_modified | linenum *] If we did this, we would not have to change B<a single line> of our --- 172,185 ---- replace the 'user_list' template with the following: ! <h2>User Listing</h2> ! ! <p>Users with accesses in the last <b>[% time_limit %]</b> minutes. ! ! <ul> ! [% FOREACH user_object = user_list %] ! <li>[% user_object.full_name %] ([% user_object.login_name %]) ! accessed the system at [% user_object.last_access %]</li> ! [% END %] ! </ul> If we did this, we would not have to change B<a single line> of our *************** *** 230,239 **** following to our action configuration: ! [* INCLUDE examples/templates_userlist_action_declare_source | indent 2 *] The handler now doesn't even need to pass a template source, so the C<return> can be modified like this: ! [* INCLUDE examples/templates_userlist_handler_implicit | linenum 16 *] Now we can use the same action code with multiple template --- 284,298 ---- following to our action configuration: ! [userlist template_source] ! list_time_limit = mypkg::user_list The handler now doesn't even need to pass a template source, so the C<return> can be modified like this: ! my %params = ( ! user_list => $user_list, ! time_limit => $time_limit, ! ); ! return $self->generate_content( \%params ); Now we can use the same action code with multiple template *************** *** 241,248 **** that most people will see and one that uses very little layout for visually impaired folks. Further, we'll assume that the actions for ! visually impaired folks begin with a 'V_', so our action configuration might look like: ! [* INCLUDE examples/templates_userlist_actions | indent 2 *] =head2 Loading templates --- 300,315 ---- that most people will see and one that uses very little layout for visually impaired folks. Further, we'll assume that the actions for ! visually impaired folks begin with a 'v_', so our action configuration might look like: ! [timelimit] ! class = OpenInteract2::Action::UserList ! method = list_time_limit ! template_source = mypkg::userlist_normal ! ! [v_timelimit] ! class = OpenInteract2::Action::UserList ! method = list_time_limit ! template_source = mypkg::userlist_plain =head2 Loading templates |
From: Chris W. <la...@us...> - 2004-11-30 02:17:54
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4223/examples Removed Files: security_config_default_objects security_creation_security_newgroup security_object_level_check security_simple_fetch security_simple_fetch_catch security_table_schema security_user_creation_security Log Message: inline security examples --- security_config_default_objects DELETED --- --- security_creation_security_newgroup DELETED --- --- security_object_level_check DELETED --- --- security_simple_fetch DELETED --- --- security_simple_fetch_catch DELETED --- --- security_table_schema DELETED --- --- security_user_creation_security DELETED --- |
From: Chris W. <la...@us...> - 2004-11-30 02:17:50
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4223/Manual Modified Files: Security.pod Log Message: inline security examples Index: Security.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Security.pod,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Security.pod 17 Feb 2004 04:30:11 -0000 1.8 --- Security.pod 30 Nov 2004 02:17:41 -0000 1.9 *************** *** 49,53 **** PostgreSQL syntax): ! [% INCLUDE examples/security_table_schema | indent(4) %] Some notes on this table: --- 49,62 ---- PostgreSQL syntax): ! CREATE TABLE security ( ! sid int not null, ! object_id varchar(200) not null, ! class varchar(20) not null, ! scope char(1) not null, ! scope_id varchar(16) not null default 'world', ! level char(1) not null, ! primary key ( sid ), ! unique ( object_id, class, scope, scope_id ) ! ) Some notes on this table: *************** *** 120,124 **** implemented security: ! [% INCLUDE examples/security_simple_fetch | indent 4 %] SPOPS first ensures that the current user can READ it before fetching --- 129,135 ---- implemented security: ! my $file = eval { ! OpenInteract2::MyFileClass->fetch( $id ) ! }; SPOPS first ensures that the current user can READ it before fetching *************** *** 132,136 **** You can check for this as follows: ! [% INCLUDE examples/security_simple_fetch_catch | indent 4 %] Similarly, if you try to retrieve a group of objects, SPOPS will only --- 143,155 ---- You can check for this as follows: ! my $file = eval { ! OpenInteract2::MyFileClass->fetch( $id ) ! }; ! if ( $@->isa( 'SPOPS::Exception::Security' ) ) { ! warn "You do not have permission to look at item $id"; ! } ! else { ! warn "Error when trying to retrieve item $id: $@"; ! } Similarly, if you try to retrieve a group of objects, SPOPS will only *************** *** 140,144 **** always set by the C<fetch()> method. For instance: ! [% INCLUDE examples/security_object_level_check | indent 4 %] If you try to write (create, update or remove) an object, SPOPS ensures --- 159,171 ---- always set by the C<fetch()> method. For instance: ! my $file = eval { ! OpenInteract2::MyFileClass->fetch( $id ) ! }; ! if ( $obj->{tmp_security_level} == SEC_LEVEL_READ ) { ! warn "User has READ access"; ! } ! elsif ( $obj->{tmp_security_level} == SEC_LEVEL_WRITE ) { ! warn "User has WRITE access"; ! } If you try to write (create, update or remove) an object, SPOPS ensures *************** *** 175,179 **** C<base_user> package: ! [% INCLUDE examples/security_user_creation_security | indent 2 %] So here we've declared that every 'user' object created by the system --- 202,214 ---- C<base_user> package: ! [user] ! class = OpenInteract2::User ! is_secure = yes ! ... ! ! [user creation_security] ! user = ! group = site_admin_group:WRITE ! world = READ So here we've declared that every 'user' object created by the system *************** *** 186,194 **** example) in your server configuration: ! [% INCLUDE examples/security_config_default_objects | indent 2 %] Then set the relevant SPOPS 'creation_security' key: ! [% INCLUDE examples/security_creation_security_newgroup | indent 2 %] =head1 FUTURE WORK --- 221,241 ---- example) in your server configuration: ! [default_objects] ! ... ! public_group = 2 ! site_admin_group = 3 ! content_admin_group = 5 Then set the relevant SPOPS 'creation_security' key: ! [document] ! class = OpenInteract2::Document ! is_secure = yes ! ... ! ! [document creation_security] ! user = ! group = content_admin_group:WRITE ! world = READ =head1 FUTURE WORK |
From: Chris W. <la...@us...> - 2004-11-30 02:14:28
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3524/Manual Modified Files: SearchResults.pod Log Message: inline search results examples Index: SearchResults.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/SearchResults.pod,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SearchResults.pod 14 Jul 2004 01:34:49 -0000 1.6 --- SearchResults.pod 30 Nov 2004 02:14:17 -0000 1.7 *************** *** 22,26 **** L<OpenInteract2::ResultsIterator|OpenInteract2::ResultsIterator>, which is an implementation of L<SPOPS::Iterator|SPOPS::Iterator> that ! works with the first class to get results one at a time. =head2 Example --- 22,26 ---- L<OpenInteract2::ResultsIterator|OpenInteract2::ResultsIterator>, which is an implementation of L<SPOPS::Iterator|SPOPS::Iterator> that ! works with the first class to kick out results one at a time. =head2 Example *************** *** 29,42 **** (it doesn't matter what this is) and serialize them: ! [% INCLUDE examples/searchres_save_search | indent 4 %] Next, we'll use that same search ID to retrieve the resultset and get the first 50 entries back: ! [% INCLUDE examples/searchres_retrieve_first | indent 4 %] Later we'll retrieve results 51 to 100 from the resultset: ! [% INCLUDE examples/searchres_retrieve_second | indent 4 %] =head1 SEE ALSO --- 29,52 ---- (it doesn't matter what this is) and serialize them: ! my $object_list = perform_search( ... ); ! my $results = OpenInteract2::ResultsManage->new(); ! my $search_id = $results->save( $object_list ); Next, we'll use that same search ID to retrieve the resultset and get the first 50 entries back: ! my $search_id = $request->param( 'search_id' ); ! my $results = OpenInteract2::ResultsManage->new({ ! search_id => $search_id ! }); ! my $iterator = $results->retrieve({ max => 50 }); Later we'll retrieve results 51 to 100 from the resultset: ! my $search_id = $request->param( 'search_id' ); ! my $results = OpenInteract2::ResultsManage->new({ ! search_id => $search_id ! }); ! my $iterator = $results->retrieve({ min => 51, max => 100 }); =head1 SEE ALSO |
From: Chris W. <la...@us...> - 2004-11-30 02:14:26
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3524/examples Removed Files: searchres_retrieve_first searchres_retrieve_second searchres_save_search Log Message: inline search results examples --- searchres_retrieve_first DELETED --- --- searchres_retrieve_second DELETED --- --- searchres_save_search DELETED --- |
From: Chris W. <la...@us...> - 2004-11-30 02:11:38
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3057/Manual Modified Files: SPOPS.pod Log Message: inline SPOPS examples Index: SPOPS.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/SPOPS.pod,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SPOPS.pod 17 Feb 2004 04:30:11 -0000 1.8 --- SPOPS.pod 30 Nov 2004 02:11:15 -0000 1.9 *************** *** 18,22 **** configuration: ! [% INCLUDE examples/spops_datasource_default_config | indent 2 %] At startup time OI2 will rewrite the 'isa' key in every SPOPS object --- 18,25 ---- configuration: ! [datasource_config] ! spops = main ! system = main ! manager = OpenInteract2::DatasourceManager At startup time OI2 will rewrite the 'isa' key in every SPOPS object *************** *** 26,39 **** datasource declared in your server configuration: ! [% INCLUDE examples/spops_datasource_declare | indent 2 %] The declaration for a simple object might look like this: ! [% INCLUDE examples/spops_simple_object_declare | indent 2 %] Notice that the 'isa' field is absolutely empty. Here's what it would look like after the rewriting process at server startup: ! [% INCLUDE examples/spops_simple_object_declare_post_rewrite | indent 2 %] =head1 SECURITY TAGGING --- 29,69 ---- datasource declared in your server configuration: ! [datasource main] ! type = DBI ! spops = SPOPS::DBI::Pg ! ... The declaration for a simple object might look like this: ! [news_section] ! class = OpenInteract2::NewsSection ! isa = ! 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 Notice that the 'isa' field is absolutely empty. Here's what it would look like after the rewriting process at server startup: ! [news_section] ! class = OpenInteract2::NewsSection ! isa = OpenInteract2::SPOPS::DBI ! isa = SPOPS::DBI::Pg ! isa = SPOPS::DBI ! 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 =head1 SECURITY TAGGING *************** *** 44,52 **** to specify 'yes' for the 'is_secure' configuration key. Here's an example: ! [% INCLUDE examples/spops_simple_object_declare_security | indent 2 %] And after the rewriting process: ! [% INCLUDE examples/spops_simple_object_declare_security_post_rewrite | indent 2 %] =head1 CREATION SECURITY CONVERSION --- 74,93 ---- to specify 'yes' for the 'is_secure' configuration key. Here's an example: ! [news_section] ! class = OpenInteract2::NewsSection ! isa = ! is_secure = yes ! ... And after the rewriting process: ! [news_section] ! class = OpenInteract2::NewsSection ! isa = OpenInteract2::SPOPS::DBI ! isa = SPOPS::Secure ! isa = SPOPS::DBI::Pg ! isa = SPOPS::DBI ! is_secure = yes ! ... =head1 CREATION SECURITY CONVERSION *************** *** 59,68 **** 'document'. We'd first declare the group in the server configuration: ! [% INCLUDE examples/security_config_default_objects | indent 2 %] And then we'd be able to set relevant SPOPS 'creation_security' key with the group name and level: ! [% INCLUDE examples/security_creation_security_newgroup | indent 2 %] =head1 DISPLAY/EDIT URL --- 100,121 ---- 'document'. We'd first declare the group in the server configuration: ! [default_objects] ! ... ! public_group = 2 ! site_admin_group = 3 ! content_admin_group = 5 And then we'd be able to set relevant SPOPS 'creation_security' key with the group name and level: ! [document] ! class = OpenInteract2::Document ! is_secure = yes ! ... ! ! [document creation_security] ! user = ! group = content_admin_group:WRITE ! world = READ =head1 DISPLAY/EDIT URL *************** *** 76,80 **** Here's an example using the 'news' object: ! [% INCLUDE examples/spops_display_action_declare | indent 2 %] So this says to generate the URL to display a news object, first --- 129,140 ---- Here's an example using the 'news' object: ! [news] ! class = OpenInteract2::News ! ... ! ! [news display] ! ACTION = news ! TASK = display ! TASK_EDIT = display_form So this says to generate the URL to display a news object, first *************** *** 82,95 **** append the ID of the object as necessary. So when you call: ! [% INCLUDE examples/spops_object_info_call | indent 4 %] the result would be: ! [% INCLUDE examples/spops_object_info_result | indent 2 %] And if you were deployed under the URL space '/MyApp' it would look like this: ! [% INCLUDE examples/spops_object_info_result_context | indent 2 %] =head1 DATE CONVERSION --- 142,162 ---- append the ID of the object as necessary. So when you call: ! my $news = eval { ! CTX->lookup_object( 'news ' )->fetch( 15 ) ! }; ! my $object_info = $news->object_description; ! print "URL to display this news object: $object_info->{url}"; ! print "URL to edit this news object: $object_info->{url_edit}"; the result would be: ! URL to display this news object: /News/display/?news_id=15 ! URL to edit this news object: /News/display_form/?news_id=15 And if you were deployed under the URL space '/MyApp' it would look like this: ! URL to display this news object: /MyApp/News/display/?news_id=15 ! URL to edit this news object: /MyApp/News/display_form/?news_id=15 =head1 DATE CONVERSION *************** *** 97,103 **** OpenInteract can perform round-trip date conversion for you. This means that when a date is pulled out of the database it will be ! converted into an object (normally L<DateTime|DateTime>) and when you ! execute a C<save()> against an object it will be converted from the ! object format into one your database can understand. Setting it up is simple. Just set the key 'convert_date_field' in your --- 164,170 ---- OpenInteract can perform round-trip date conversion for you. This means that when a date is pulled out of the database it will be ! converted into a L<DateTime|DateTime> object and when you execute a ! C<save()> against an object it will be converted from the object ! format into one your database can understand. Setting it up is simple. Just set the key 'convert_date_field' in your *************** *** 106,114 **** object again: ! [% INCLUDE examples/spops_news_date_declare | indent 2 %] And an example of usage: ! [% INCLUDE examples/spops_news_date_use | indent 2 %] You also need to specify the format your database requires for --- 173,191 ---- object again: ! [news] ! class = OpenInteract2::News ! ... ! convert_date_field = posted_on ! convert_date_field = active_on ! convert_date_field = expires_on And an example of usage: ! my $news = eval { ! CTX->lookup_object( 'news ' )->fetch( 15 ) ! }; ! my $posted_on_display = "Posted on " . ! $news->posted_on->day_of_year . ! " day of the year"; You also need to specify the format your database requires for *************** *** 132,139 **** that should be indexed: ! [% INCLUDE examples/spops_fulltext_use | indent 2 %] =head1 SEE ALSO L<DateTime|DateTime> --- 209,221 ---- that should be indexed: ! is_searchable = yes ! fulltext_field = indexable_field_one ! fulltext_field = indexable_field_two ! fulltext_field = indexable_field_three =head1 SEE ALSO + L<OpenInteract2::Config::Initializer|OpenInteract2::Config::Initializer> + L<DateTime|DateTime> |
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3057/examples Removed Files: spops_datasource_declare spops_datasource_default_config spops_display_action_declare spops_fulltext_use spops_news_date_declare spops_news_date_use spops_object_info_call spops_object_info_result spops_object_info_result_context spops_simple_object_declare spops_simple_object_declare_post_rewrite spops_simple_object_declare_security spops_simple_object_declare_security_post_rewrite Log Message: inline SPOPS examples --- spops_datasource_declare DELETED --- --- spops_datasource_default_config DELETED --- --- spops_display_action_declare DELETED --- --- spops_fulltext_use DELETED --- --- spops_news_date_declare DELETED --- --- spops_news_date_use DELETED --- --- spops_object_info_call DELETED --- --- spops_object_info_result DELETED --- --- spops_object_info_result_context DELETED --- --- spops_simple_object_declare DELETED --- --- spops_simple_object_declare_post_rewrite DELETED --- --- spops_simple_object_declare_security DELETED --- --- spops_simple_object_declare_security_post_rewrite DELETED --- |
From: Chris W. <la...@us...> - 2004-11-30 02:00:41
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1264/Manual Modified Files: QuickStart.pod Log Message: inline quickstart examples Index: QuickStart.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/QuickStart.pod,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** QuickStart.pod 13 Jun 2004 18:19:06 -0000 1.9 --- QuickStart.pod 30 Nov 2004 02:00:29 -0000 1.10 *************** *** 46,50 **** website will live. The directory shouldn't exist yet. ! [% INCLUDE examples/quickstart_export_path | indent 2 %] (You'll need to use the full path for now, relative paths will fail in --- 46,50 ---- website will live. The directory shouldn't exist yet. ! $ export OPENINTERACT2=/PATH/TO/WEBSITE (You'll need to use the full path for now, relative paths will fail in *************** *** 56,60 **** Next, issue the command to create the website: ! [% INCLUDE examples/quickstart_create_site | indent 2 %] (You'll need to use the full path for now, relative paths will fail in --- 56,60 ---- Next, issue the command to create the website: ! $ oi2_manage create_website --source_dir=/path/to/OpenInteract2-source (You'll need to use the full path for now, relative paths will fail in *************** *** 79,83 **** Change: ! [% INCLUDE examples/quickstart_cfg_email | indent 2 %] to something relevant to your situation. --- 79,86 ---- Change: ! [mail] ! smtp_host = 127.0.0.1 ! admin_email = ad...@my... ! content_email = co...@my... to something relevant to your situation. *************** *** 87,95 **** Change: ! [% INCLUDE examples/quickstart_cfg_dbi_before | indent 2 %] to: ! [% INCLUDE examples/quickstart_cfg_dbi_after | indent 2 %] B<Set session handler> --- 90,118 ---- Change: ! [datasource main] ! type = DBI ! spops = ! driver_name = ! dsn = ! username = ! password = ! db_owner = ! sql_install = ! long_read_len = 65536 ! long_trunc_ok = 0 to: ! [datasource main] ! type = DBI ! spops = SPOPS::DBI::SQLite ! driver_name = SQLite ! dsn = dbname=/PATH/TO/WEBSITE/oi2test.db ! username = ! password = ! db_owner = ! sql_install = ! long_read_len = 65536 ! long_trunc_ok = 0 B<Set session handler> *************** *** 102,106 **** You need to create the database tables and seed it with initial data: ! [% INCLUDE examples/quickstart_install_sql | indent 2 %] This tells the OI2 website you've specified in the environment --- 125,129 ---- You need to create the database tables and seed it with initial data: ! $ oi2_manage install_sql --package=SYSTEM This tells the OI2 website you've specified in the environment *************** *** 116,120 **** Now it's time to create the superuser password: ! [% INCLUDE examples/quickstart_install_root_password | indent 2 %] (replacing 'cindilauper' with your favorite password) --- 139,143 ---- Now it's time to create the superuser password: ! $ oi2_manage create_password --password=cindilauper (replacing 'cindilauper' with your favorite password) *************** *** 125,134 **** command: ! [% INCLUDE examples/quickstart_start_server | indent 2 %] This uses the C<OPENINTERACT2> environment variable set earlier. You should see a message similar to this: ! [% INCLUDE examples/quickstart_daemon_output | indent 2 %] Now fire up your web browser to the given URL and you should see the --- 148,160 ---- command: ! $ oi2_daemon This uses the C<OPENINTERACT2> environment variable set earlier. You should see a message similar to this: ! Using OPENINTERACT2 environment for website directory: ! /PATH/TO/WEBSITE ! Using daemon configuration from website directory ! OpenInteract2 now running at URL <http://localhost:8080> Now fire up your web browser to the given URL and you should see the *************** *** 142,150 **** C</PATH/TO/WEBSITE/conf/log4perl.conf> change: ! [% INCLUDE examples/quickstart_log4perl_before | indent 2 %] to: ! [% INCLUDE examples/quickstart_log4perl_after | indent 2 %] Restart your server once you've made the change and monitor the file --- 168,176 ---- C</PATH/TO/WEBSITE/conf/log4perl.conf> change: ! log4perl.logger.OI2 = INFO to: ! log4perl.logger.OI2 = DEBUG Restart your server once you've made the change and monitor the file *************** *** 152,156 **** curtain. You may see a message like this: ! [% INCLUDE examples/quickstart_db_shutdown_msg | indent 2 %] Don't worry about it. We have to do this to prevent the forked --- 178,183 ---- curtain. You may see a message like this: ! 2003/06/26 10:30:15: OpenInteract2::DatasourceManager 121 Disconnecting ! datasource main from manager shutdown Don't worry about it. We have to do this to prevent the forked *************** *** 166,170 **** the process: ! [% INCLUDE examples/quickstart_kill_daemon | indent 2 %] =head1 MODULE INSTALL --- 193,197 ---- the process: ! $ kill -15 `cat /PATH/TO/WEBSITE/conf/oi2.pid` =head1 MODULE INSTALL |
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1264/examples Removed Files: quickstart_cfg_dbi_after quickstart_cfg_dbi_before quickstart_cfg_email quickstart_cfg_session_after quickstart_cfg_session_before quickstart_create_site quickstart_daemon_output quickstart_db_shutdown_msg quickstart_export_path quickstart_install_root_password quickstart_install_sql quickstart_kill_daemon quickstart_log4perl_after quickstart_log4perl_before quickstart_session_dir_create quickstart_start_server Log Message: inline quickstart examples --- quickstart_cfg_dbi_after DELETED --- --- quickstart_cfg_dbi_before DELETED --- --- quickstart_cfg_email DELETED --- --- quickstart_cfg_session_after DELETED --- --- quickstart_cfg_session_before DELETED --- --- quickstart_create_site DELETED --- --- quickstart_daemon_output DELETED --- --- quickstart_db_shutdown_msg DELETED --- --- quickstart_export_path DELETED --- --- quickstart_install_root_password DELETED --- --- quickstart_install_sql DELETED --- --- quickstart_kill_daemon DELETED --- --- quickstart_log4perl_after DELETED --- --- quickstart_log4perl_before DELETED --- --- quickstart_session_dir_create DELETED --- --- quickstart_start_server DELETED --- |
From: Chris W. <la...@us...> - 2004-11-30 01:55:15
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32736/examples Removed Files: pkg_file_listing pkg_manage_create_cmd pkg_manage_list_cmd pkg_manage_list_output pkg_read_info Log Message: inline package examples and add some more information --- pkg_file_listing DELETED --- --- pkg_manage_create_cmd DELETED --- --- pkg_manage_list_cmd DELETED --- --- pkg_manage_list_output DELETED --- --- pkg_read_info DELETED --- |
From: Chris W. <la...@us...> - 2004-11-30 01:55:14
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32736/Manual Modified Files: Packages.pod Log Message: inline package examples and add some more information Index: Packages.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Packages.pod,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Packages.pod 17 Feb 2004 04:30:11 -0000 1.7 --- Packages.pod 30 Nov 2004 01:55:02 -0000 1.8 *************** *** 86,94 **** basic package skeleton for you. Here's an example: ! [% INCLUDE examples/pkg_manage_create_cmd | indent 2 %] which creates the following directories and files: ! ! [% INCLUDE examples/pkg_file_listing | indent 2 %] For what files you'll most likely edit, check out the --- 86,116 ---- basic package skeleton for you. Here's an example: ! $ oi2_manage create_package \ ! --package=mypackage \ ! --source_dir=/path/to/OI2-source which creates the following directories and files: ! ! mypackage # Main directory ! mypackage/package.conf # Basic package configuration (name, ...) ! mypackage/MANIFEST # List of files in package ! mypackage/MANIFEST.SKIP # Regexes to skip when creating MANIFEST ! mypackage/conf # Configuration directory ! mypackage/conf/spops.ini # Persistent object(s) configuration ! mypackage/conf/action.ini # Action(s) configuration ! mypackage/data # Package data/security directory ! mypackage/doc # Documentation directory ! mypackage/doc/mypackage.pod # Starter documentation ! mypackage/struct # Package table definition directory ! mypackage/template # Template directory ! mypackage/template/sample.tmpl # Sample Template Toolkit template ! mypackage/script # Tools program directory ! mypackage/html # Static html directory ! mypackage/html/images # Image directory ! mypackage/OpenInteract2 # Object hierarchy directory ! mypackage/OpenInteract2/Action # Action implementation directory ! mypackage/OpenInteract2/Action/Mypackage.pm # Sample action with 'hello' and 'list' tasks ! mypackage/OpenInteract2/SQLInstall # Structure/data installation directory ! mypackage/OpenInteract2/SQLInstall/Mypackage.pm # Sample structure/data installation For what files you'll most likely edit, check out the *************** *** 106,110 **** L<OpenInteract2::Package|OpenInteract2::Package> documentation: ! [% INCLUDE examples/pkg_read_info | linenum %] For each website OpenInteract2 maintains a file with the installed --- 128,143 ---- L<OpenInteract2::Package|OpenInteract2::Package> documentation: ! # Read information about a package distribution ! ! my $package = OpenInteract2::Package->new({ ! package_file => '/home/cwinters/pkg/mynewpackage-1.02.zip' ! }); ! my $config = $package->config; ! print "Package ", $package->name, " ", $package->version, "\n", ! "Author ", join( ", ", @{ $config->author } ), "\n"; ! my $files = $package->get_files; ! foreach my $filename ( @{ $files } ) { ! print " File - $filename\n"; ! } For each website OpenInteract2 maintains a file with the installed *************** *** 118,126 **** C<oi2_manage> tool: ! [% INCLUDE examples/pkg_manage_list_cmd | indent 2 %] Which will give you output like this: ! [% INCLUDE examples/pkg_manage_list_output | indent 2 %] =head1 HOW OI2 USES PACKAGES --- 151,175 ---- C<oi2_manage> tool: ! $ oi2_manage list_packages --website_dir=$WEBSITE_DIR Which will give you output like this: ! PROGRESS: Starting task ! PROGRESS: Task complete ! ACTION: ! OK: Package base-2.02 in site ! OK: Package base_box-2.01 in site ! OK: Package base_error-2.02 in site ! OK: Package base_group-2.01 in site ! OK: Package base_page-2.04 in site ! OK: Package base_security-2.01 in site ! OK: Package base_template-3.00 in site ! OK: Package base_theme-2.01 in site ! OK: Package base_user-2.03 in site ! OK: Package full_text-2.01 in site ! OK: Package news-2.01 in site ! OK: Package lookup-2.00 in site ! OK: Package object_activity-2.02 in site ! OK: Package system_doc-2.00 in site =head1 HOW OI2 USES PACKAGES *************** *** 128,133 **** =head2 At Startup ! At server startup the OI2 server performs the following actions ! regarding packages: =over 4 --- 177,182 ---- =head2 At Startup ! At server startup the each package provides the OI2 server with the ! following data: =over 4 *************** *** 135,146 **** =item * ! It collects all modules from each package and places them in a ! consolidated library directory. This ensures we don't have an C<@INC> ! with so many entries. =item * ! It asks each module for its C<action.ini> file, scrubs the data (in ! L<OpenInteract2::Action|OpenInteract2::Action>), creates action objects from the file's information and asks each one for the URLs it will respond to. This becomes the URL-to-action mapping. --- 184,197 ---- =item * ! B<All Perl modules>. The server will place them in a consolidated ! library directory. This ensures we don't have an C<@INC> with so many ! entries. This directory is called 'tmplib' in any logging messages you ! might see. =item * ! B<Action configuration>. The package tells the server its ! C<action.ini> file. The server reads it in, scrubs and modifies the ! data (in L<OpenInteract2::Config::Initializer>), creates action objects from the file's information and asks each one for the URLs it will respond to. This becomes the URL-to-action mapping. *************** *** 148,158 **** =item * ! It asks each module for its C<spops.ini> files. It consolidates all ! SPOPS information, does some scrubbing of the data (in ! L<OpenInteract2::SPOPS|OpenInteract2::SPOPS>) and then whips the ! classes into existence using L<SPOPS::Initialize|SPOPS::Initialize>. =back The L<OpenInteract2::Context|OpenInteract2::Context> object also instantiates a L<OpenInteract2::Repository|OpenInteract2::Repository> --- 199,226 ---- =item * ! B<SPOPS configuration>. The package lets the server know about its ! C<spops.ini> files. The server reads them in, consolidates all SPOPS ! information, does some scrubbing of the data (in ! L<OpenInteract2::Config::Initializer>) and then whips the classes into ! existence using L<SPOPS::Initialize|SPOPS::Initialize>. ! ! =item * ! ! B<TT2 plugins>. The package lets the server know about any declared ! Template Toolkit plugins. These will be instiantiated at startup and ! made available in the TT environment just like the C<OI> plugin ! is. (See L<OpenInteract::TT2::Plugin> for more on it.) ! ! =item * ! ! B<Observers>. Any observer classes specified in the package ! configuration will be instantiated and registered for use. (See ! L<OpenInteract2::Observer> for more.) =back + See L<OpenInteract2::Config::Package> for more information about how + these data are provided. + The L<OpenInteract2::Context|OpenInteract2::Context> object also instantiates a L<OpenInteract2::Repository|OpenInteract2::Repository> |
From: Chris W. <la...@us...> - 2004-11-30 01:26:44
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26855/Manual Modified Files: Management.pod Log Message: inline management examples Index: Management.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Management.pod,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Management.pod 13 Jun 2004 18:18:48 -0000 1.9 --- Management.pod 30 Nov 2004 01:26:32 -0000 1.10 *************** *** 29,40 **** tasks this was fine, but it prevented B<any> sort of web-based management without simply cobbling together strings to run using ! C<system>. =item * ! Its size also meant that it was difficult to refactor. And it was ! fairly difficult to add new tasks without doing lots of copy-and-paste ! and knowing where certain tasks (parameter parsing, etc.) were ! performed. =item * --- 29,40 ---- tasks this was fine, but it prevented B<any> sort of web-based management without simply cobbling together strings to run using ! C<system>. Yuck. =item * ! Its size (4100+ lines) also meant that it was difficult to ! refactor. And it was fairly difficult to add new tasks without doing ! lots of copy-and-paste and knowing where certain tasks (parameter ! parsing, etc.) were performed. =item * *************** *** 47,51 **** =back ! =head2 Turnabout is fair play The architecture of the management framework in OI2 is exactly the --- 47,51 ---- =back ! =head2 Turn weaknesses into strengths The architecture of the management framework in OI2 is exactly the *************** *** 101,105 **** =item * ! And finally, B<running the task>! =back --- 101,105 ---- =item * ! And finally, B<Running the task>! =back *************** *** 188,192 **** can be used as necessary: ! [% INCLUDE examples/mgt_source_dir_param | indent 2 %] It specifies that the parameter is required and gives a generic --- 188,198 ---- can be used as necessary: ! sub get_parameters { ! my ( $self ) = @_; ! return { ! source_dir => $self->_get_source_dir_param(), ! ... ! }; ! } It specifies that the parameter is required and gives a generic *************** *** 253,262 **** C<website_dir> from L<OpenInteract2::Manage|OpenInteract2::Manage>: ! [% INCLUDE examples/mgt_parent_validate_website_dir | linenum 2 %] Easy enough. Now, say we want to validate a different parameter ourselves: ! [% INCLUDE examples/mgt_validate_game_choice | linenum 2 %] This ensures that the parameter value for 'game_choice' (a) exists and --- 259,299 ---- C<website_dir> from L<OpenInteract2::Manage|OpenInteract2::Manage>: ! sub get_parameters { ! my ( $self ) = @_; ! return { ! website_dir => { ! description => 'a directory', ! is_required => 'yes', ! }, ! }; ! } ! ! # we're not validating anything ourselves -- no 'validate_param' ! # subroutine defined Easy enough. Now, say we want to validate a different parameter ourselves: ! sub get_parameters { ! my ( $self ) = @_; ! return { ! game_choice => { ! description => 'Your choice in the game', ! is_required => 'yes', ! }, ! ... ! }; ! } ! ! sub validate_param { ! my ( $self, $param_name, $param_value ) = @_; ! if ( $param_name eq 'game_choice' ) { ! unless ( $param_value =~ /^(rock|scissors|paper)$/i ) { ! return "Value must be 'rock', 'scissors' or 'paper'"; ! } ! } ! return $self->SUPER::validate_param( $param_name, $param_value ); ! } ! This ensures that the parameter value for 'game_choice' (a) exists and *************** *** 274,282 **** a little confused if you use C<_add_status_head()>. ! B<_add_status( ( \%status, \%status, ...) )> Adds status message C<\%status> to those tracked by the object. ! B<_add_status_head( ( \%status, \%status, ... ) )> Adds status messages to the head of the list of status messages. This --- 311,319 ---- a little confused if you use C<_add_status_head()>. ! B<_add_status( \%status, \%status, ... )> Adds status message C<\%status> to those tracked by the object. ! B<_add_status_head( \%status, \%status, ... )> Adds status messages to the head of the list of status messages. This *************** *** 307,311 **** you post. Notifying observers is simple: ! [% INCLUDE examples/mgt_notify_observers | indent 2 %] What goes into C<@extra_info> depends on the C<$type>. The two types --- 344,348 ---- you post. Notifying observers is simple: ! $self->notify_observers( $type, @extra_info ) What goes into C<@extra_info> depends on the C<$type>. The two types *************** *** 322,326 **** differentiate -- let the user know it will take a while, etc. ! [% INCLUDE examples/mgt_run_task_notify_observers | indent 2 %] This is a contrived example -- if your task is very simple (like this) --- 359,377 ---- differentiate -- let the user know it will take a while, etc. ! sub run_task { ! my ( $self ) = @_; ! $self->_do_some_simple( 'thing' ); ! $self->notify_observers( progress => 'Simple thing complete' ); ! $self->_do_some_other( @stuff ); ! $self->notify_observers( progress => 'Other stuff complete' ); ! $self->notify_observers( progress => 'Preparing complex task', ! { long => 'yes' } ); ! $self->_do_complex_task; ! $self->notify_observers( progress => 'Complex task complete' ); ! ! # This fires an implicit observation of type 'status' ! $self->_add_status({ is_ok => 'yes', ! message => 'Foobar task ok' }); ! } This is a contrived example -- if your task is very simple (like this) *************** *** 337,345 **** 'hello_world' in the website directory: ! [% INCLUDE examples/mgt_sample_task | linenum %] And here is how you would run your task: ! [% INCLUDE examples/mgt_sample_task_run_prog | indent 2 %] Since all management tasks are auto-discovered by --- 388,464 ---- 'hello_world' in the website directory: ! package Openinteract2::Manage::MyTask ! ! use strict; ! use base qw( OpenInteract2::Manage::Website ); ! ! sub get_name { ! return 'hello_world'; ! } ! ! sub get_brief_description { ! return "Creates a 'hello_world' file in your website directory."; ! } ! ! sub get_parameters { ! my ( $self ) = @_; ! return { website_dir => $self->_get_website_dir_param, ! hello_message => { ! description => 'Message to write to file', ! is_required => 'yes', ! }, ! }; ! } ! ! sub run_task { ! my ( $self ) = @_; ! my $website_dir = $self->param( 'website_dir' ); ! $website_dir =~ s|/$||; ! my $filename = File::Spec->catfile( $website_dir, 'hello_world' ); ! my %status = (); ! if ( -f $filename ) { ! $status{message} = "Could not create [$filename]: already exists"; ! $status{is_ok} = 'no'; ! $self->_add_status( \%status ); ! return; ! } ! eval { open( HW, '>', $filename ) || die $! }; ! if ( $@ ) { ! $status{message} = "Cannot write to [$filename]: $@"; ! $status{is_ok} = 'no'; ! } ! else { ! print HW $self->param( 'hello_message' ); ! close( HW ); ! $status{is_ok} = 'yes'; ! $status{message} = "File [$filename] created ok"; ! } ! $self->_add_status( \%status ); ! } ! ! OpenInteract2::Manage->register_factory_type( get_name() => __PACKAGE__ ); ! ! 1; And here is how you would run your task: ! #!/usr/bin/perl ! ! use strict; ! use OpenInteract2::Manage; ! ! my $task = OpenInteract2::Manage->new( 'hello_world', { ! website_dir => $ENV{OPENINTERACT2} ! }); ! my @status = eval { $task->execute }; ! if ( $@ ) { ! print "Task failed to run: $@"; ! } ! else { ! foreach my $s ( @status ) { ! print "Task OK? $s->{is_ok}\n", ! "$s->{message}\n"; ! } ! } Since all management tasks are auto-discovered by *************** *** 347,351 **** also run: ! [% INCLUDE examples/mgt_sample_task_run_oi2_manage | indent 2 %] And it'll work! --- 466,470 ---- also run: ! $ oi2_manage hello_world And it'll work! |
From: Chris W. <la...@us...> - 2004-11-30 01:26:43
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26855/examples Removed Files: mgt_notify_observers mgt_parent_validate_website_dir mgt_run_task_notify_observers mgt_sample_task mgt_sample_task_run_oi2_manage mgt_sample_task_run_prog mgt_source_dir_param mgt_validate_game_choice Log Message: inline management examples --- mgt_notify_observers DELETED --- --- mgt_parent_validate_website_dir DELETED --- --- mgt_run_task_notify_observers DELETED --- --- mgt_sample_task DELETED --- --- mgt_sample_task_run_oi2_manage DELETED --- --- mgt_sample_task_run_prog DELETED --- --- mgt_source_dir_param DELETED --- --- mgt_validate_game_choice DELETED --- |
From: Chris W. <la...@us...> - 2004-11-30 00:24:41
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11064/Manual Modified Files: Logging.pod Log Message: inline logging examples Index: Logging.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Logging.pod,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Logging.pod 17 Feb 2004 04:30:11 -0000 1.3 --- Logging.pod 30 Nov 2004 00:24:31 -0000 1.4 *************** *** 13,17 **** application server wheel, the framework certainly isn't hesitant about using best-of-breed solutions where they're appropriate. Logging is ! one of these cases. Instead of the homegrowns solution that existed in OI 1.x and early betas of 2.x, we're now using L<Log::Log4perl|Log::Log4perl> to handle the job for us. --- 13,17 ---- application server wheel, the framework certainly isn't hesitant about using best-of-breed solutions where they're appropriate. Logging is ! one of these cases. Instead of the homegrown solution that existed in OI 1.x and early betas of 2.x, we're now using L<Log::Log4perl|Log::Log4perl> to handle the job for us. *************** *** 24,28 **** And it's simple to use as well. Here's a simple example: ! [% INCLUDE examples/logging_simple_example | linenum %] Line 1 imports the C<get_logger> method as a shortcut, and line 2 --- 24,36 ---- And it's simple to use as well. Here's a 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" ); ! } Line 1 imports the C<get_logger> method as a shortcut, and line 2 *************** *** 72,76 **** in C<$WEBSITE_DIR/conf/log4perl.conf>: ! [% INCLUDE examples/logging_l4p_config | linenum %] The original configuration defines a number of categories under the --- 80,114 ---- in C<$WEBSITE_DIR/conf/log4perl.conf>: ! ######################################## ! # 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 The original configuration defines a number of categories under the *************** *** 83,91 **** So the following would write to the appender: ! [% INCLUDE examples/logging_l4p_example_usage_write | indent 4 %] But these would not: ! [% INCLUDE examples/logging_l4p_example_usage_nowrite | indent 4 %] =head1 OI CUSTOMIZATIONS --- 121,140 ---- So the following would write to the appender: ! 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" ); But these would not: ! 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" ); =head1 OI CUSTOMIZATIONS *************** *** 118,122 **** L<Log::Log4perl|Log::Log4perl> ! http://log4perl.sourceforge.net/ L<OpenInteract2::Log|OpenInteract2::Log> --- 167,171 ---- L<Log::Log4perl|Log::Log4perl> ! L<http://log4perl.sourceforge.net/> L<OpenInteract2::Log|OpenInteract2::Log> |
From: Chris W. <la...@us...> - 2004-11-30 00:24:39
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11064/examples Removed Files: logging_l4p_config logging_l4p_example_usage_nowrite logging_l4p_example_usage_write logging_simple_example Log Message: inline logging examples --- logging_l4p_config DELETED --- --- logging_l4p_example_usage_nowrite DELETED --- --- logging_l4p_example_usage_write DELETED --- --- logging_simple_example DELETED --- |
From: Chris W. <la...@us...> - 2004-11-30 00:19:00
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9464/Manual Modified Files: Intro.pod Log Message: inline examples Index: Intro.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Intro.pod,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Intro.pod 27 Sep 2004 03:38:52 -0000 1.12 --- Intro.pod 30 Nov 2004 00:18:47 -0000 1.13 *************** *** 111,115 **** action my URLs might look like: ! [% INCLUDE examples/intro_news_url_tasks | indent 2 %] Every task returns some sort of content, generally by passing data to --- 111,118 ---- action my URLs might look like: ! /news/search/ ! /news/create/ ! /news/update/ ! /news/remove/ Every task returns some sort of content, generally by passing data to |
From: Chris W. <la...@us...> - 2004-11-30 00:18:59
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9464/examples Removed Files: intro_news_url_tasks Log Message: inline examples --- intro_news_url_tasks DELETED --- |
From: Chris W. <la...@us...> - 2004-11-30 00:06:34
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5999/Manual Modified Files: DataImport.pod Log Message: inline data import examples, and reference oi2_manage task vs the standalone script used before for security Index: DataImport.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/DataImport.pod,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DataImport.pod 17 Feb 2004 04:30:11 -0000 1.5 --- DataImport.pod 30 Nov 2004 00:06:23 -0000 1.6 *************** *** 22,26 **** OpenInteract2 for themes: ! [% INCLUDE examples/dataimport_theme_example | indent(4) %] So the first element in the C<$theme> arrayref is a hashref with three --- 22,33 ---- OpenInteract2 for themes: ! $theme = [ ! { import_type => 'object', ! spops_class => 'OpenInteract2::Theme', ! field_order => [ qw/ theme_id title description parent ! credit / ] }, ! [ 1, 'main', 'Your basic, parent of all themes. Main.', 0, ! 'OpenInteract Developers <in...@op...>' ], ! ]; So the first element in the C<$theme> arrayref is a hashref with three *************** *** 65,69 **** The import file can then be run using oi_manage: ! [% INCLUDE examples/dataimport_oi2_manage | indent(2) %] =head2 Setting Security on the Data --- 72,79 ---- The import file can then be run using oi_manage: ! $ export OPENINTERACT2=/path/to/mysite ! $ oi2_manage install_sql --package=mypackage ! # ALT: just run data import, no structures ! $ oi2_manage install_sql_data --package=mypackage =head2 Setting Security on the Data *************** *** 78,85 **** admin' group): ! [% INCLUDE examples/dataimport_set_security | indent(2) %] ! To learn more about its operation just run the script with the ! '--help' argument. If you need to setup security to distribute along with your package, --- 88,96 ---- admin' group): ! $ export OPENINTERACT2=/path/to/mysite ! $ oi2_manage create_security --spops=news --level=write --scope=group --scope_id=3 ! To learn more about its operation see ! L<OpenInteract2::Manage::Website::CreateSecurity>. If you need to setup security to distribute along with your package, |
From: Chris W. <la...@us...> - 2004-11-30 00:06:32
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5999/examples Removed Files: dataimport_oi2_manage dataimport_set_security dataimport_theme_example Log Message: inline data import examples, and reference oi2_manage task vs the standalone script used before for security --- dataimport_oi2_manage DELETED --- --- dataimport_set_security DELETED --- --- dataimport_theme_example DELETED --- |
From: Chris W. <la...@us...> - 2004-11-29 23:59:38
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4104/Manual Modified Files: Widgets.pod Log Message: inline widget examples Index: Widgets.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Widgets.pod,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Widgets.pod 17 Feb 2004 04:30:11 -0000 1.11 --- Widgets.pod 29 Nov 2004 23:59:27 -0000 1.12 *************** *** 1,2 **** --- 1,3 ---- + [%- TAGS star -%] =head1 NAME *************** *** 17,42 **** with a label on the left and the input widget on the right. ! One of the main benefits of using these over HTML is that these are ! centralized -- a change in one place enacts changes throughout your ! site. All column headers can look a certain way and be changed easily, ! all textboxes can be consistent and you can create widgets specific to ! your site and needs -- such as for inputting dates or money, or ! displaying addresses-- for a consistent user interface. Here's an example: ! [% INCLUDE examples/widget_form_text_code | linenum %] And you would reference this like: ! [% INCLUDE examples/widget_form_text_call | linenum %] And when the template is processed, get in return: ! [% INCLUDE examples/widget_form_text_result | linenum %] Calling widgets from other widgets is just as simple: ! [% INCLUDE examples/widget_call_other_code | linenum %] Here we call three separate items, two of which ('label_row_begin' and --- 18,73 ---- with a label on the left and the input widget on the right. ! One of the main benefits of using these over HTML is centralization -- ! a change in one place enacts changes throughout your site. All column ! headers can look a certain way and be changed easily, all textboxes ! can be consistent and you can create widgets specific to your site and ! needs -- such as for inputting dates or money, or displaying ! addresses-- for a consistent user interface. Here's an example: ! [%######################################## ! form_text( name, value, size, maxlength, field_label ) ! Generate a simple text field. ! ! Defaults: ! size = 20 ! maxlength = 50 ! ########################################-%] ! ! [%- DEFAULT size = 20; ! DEFAULT maxlength = 50; -%] ! [%- field_pre_label -%] ! <input type="text" name="[% name %]" value="[% value %]" ! size="[% size %]" maxlength="[% maxlength %]"> ! [%- field_label -%] And you would reference this like: ! [% INCLUDE form_text( name = "batting_average", ! value = ".389" size = 5 ) -%] And when the template is processed, get in return: ! <input type="text" name="batting_average" value=".389" ! size="5" maxlength="50"> Calling widgets from other widgets is just as simple: ! ! [%######################################## ! label_form_text_row( label, count, name, value, ! field_label ) ! Display a row to input text: label on left, ! text input on right. ! ! Defaults: ! colspan = 2 ! ########################################-%] ! ! [%- DEFAULT colspan = 2; -%] ! [%- INCLUDE label_row_begin( colspan = 1 ) -%] ! [%- INCLUDE data_cell_begin %][% INCLUDE form_text %] ! </td></tr> Here we call three separate items, two of which ('label_row_begin' and *************** *** 44,52 **** for common code. This might be called: ! [% INCLUDE examples/widget_call_other_call | linenum %] And result in: ! [% INCLUDE examples/widget_call_other_result | linenum %] And you're not restricted to simple fill-in elements either. You can --- 75,91 ---- for common code. This might be called: ! [% INCLUDE label_form_text_row( label = 'Batting Average', ! name = 'batting_average', ! value = '.389', size = 5 ) -%] And result in: ! <tr valign="middle"> ! <td align="right"><b>Batting Average</b></td> ! <td align="right"> ! <input type="text" name="batting_average" value=".389" ! size="5" maxlength="50"> ! </td> ! </tr> And you're not restricted to simple fill-in elements either. You can *************** *** 55,59 **** well. Here's how such a call might look: ! [% INCLUDE examples/widget_data_country_call | linenum %] Using this, the page designer doesn't care how many countries the --- 94,102 ---- well. Here's how such a call might look: ! [%# Use USA as default, antagonizing the rest of the world...-%] ! [%- picked_country = user.country || 'United States' -%] ! [% INCLUDE label_form_country_select( label = 'Countries', ! name = 'country', ! picked = picked_country ) -%] Using this, the page designer doesn't care how many countries the *************** *** 255,272 **** currently the ultra-simple: ! [% INCLUDE examples/widget_show_label_simple | linenum %] with: ! [% INCLUDE examples/widget_show_label_spanish | linenum %] =head1 OPERATION ! When you create a website you have a number of widgets installed by ! default in the C<$WEBSITE_DIR/template> directory. These widgets will ! never be overwritten unless you ask them to be (via the C<oi2_manage ! refresh_widget> command -- TODO: do we have a 'refresh_widget' ! command?) and they are specific to your website. You can add new ones, ! remove existing ones -- whatever you like =head2 Gotchas --- 298,324 ---- currently the ultra-simple: ! [%######################################## ! show_label( label ) ! Display a label. ! ########################################-%] ! <b>[% label %]</b> with: ! [%######################################## ! show_label( label, spanish ) ! Display a label (displaying spanish version if available) ! ########################################-%] ! <b>[% label %]</b> [% IF spanish %](<em>[% spanish %]<em>)[% END -%] =head1 OPERATION ! When you create a website you have a number of widgets installed in ! the C<$WEBSITE_DIR/template> directory. When you upgrade to a new ! version of OpenInteract2 these widgets will overwritten unless they're ! listed in the C<$WEBSITE_DIR/template/.no_overwrite> file. You can ! also add new ones and reference them just like the built-ins, and you ! can do so just by copying files to the directory or by using the ! browser interface to create and edit them. (Or both.) =head2 Gotchas *************** *** 293,297 **** For instance, say you have the following: ! [% INCLUDE examples/widget_process_gotcha | linenum %] You'd be extremely surprised to find your SELECT box being 20 rows --- 345,354 ---- For instance, say you have the following: ! [% PROCESS form_text( name = 'this', ! value = 'that' ) %] ! [% PROCESS form_select( name = 'them', ! list = object_list, ! value_field = 'id', ! label_field = 'full_name' ) %] You'd be extremely surprised to find your SELECT box being 20 rows *************** *** 299,303 **** statement: ! [% INCLUDE examples/widget_process_default | linenum %] Since we didn't pass any value for 'size' into 'form_text', it's set --- 356,361 ---- statement: ! [% DEFAULT size = 20 %] ! [% INCLUDE examples/widget_process_default | linenum %] Since we didn't pass any value for 'size' into 'form_text', it's set *************** *** 309,313 **** something like: ! [% INCLUDE examples/widget_process_default_fix | linenum %] So that the common variable 'size' isn't set as a side-effect. And --- 367,371 ---- something like: ! [% text_size = size || 20 %] So that the common variable 'size' isn't set as a side-effect. And |
From: Chris W. <la...@us...> - 2004-11-29 23:59:36
|
Update of /cvsroot/openinteract/OpenInteract2/doc/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4104/examples Removed Files: widget_call_other_call widget_call_other_code widget_call_other_result widget_data_country_call widget_form_text_call widget_form_text_code widget_form_text_result widget_process_default widget_process_default_fix widget_process_gotcha widget_show_label_simple widget_show_label_spanish Log Message: inline widget examples --- widget_call_other_call DELETED --- --- widget_call_other_code DELETED --- --- widget_call_other_result DELETED --- --- widget_data_country_call DELETED --- --- widget_form_text_call DELETED --- --- widget_form_text_code DELETED --- --- widget_form_text_result DELETED --- --- widget_process_default DELETED --- --- widget_process_default_fix DELETED --- --- widget_process_gotcha DELETED --- --- widget_show_label_simple DELETED --- --- widget_show_label_spanish DELETED --- |
From: Chris W. <la...@us...> - 2004-11-29 03:05:17
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11065 Modified Files: comment_list_page.tmpl Log Message: fix task name Index: comment_list_page.tmpl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/template/comment_list_page.tmpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** comment_list_page.tmpl 24 May 2004 23:41:46 -0000 1.4 --- comment_list_page.tmpl 29 Nov 2004 03:05:07 -0000 1.5 *************** *** 20,24 **** [% FOREACH comment = comments -%] ! [%- comment_url = OI.make_url( ACTION = 'comment', TASK = 'show', comment_id = comment.id ); object_url = comment.get_summary.object_url -%] --- 20,24 ---- [% FOREACH comment = comments -%] ! [%- comment_url = OI.make_url( ACTION = 'comment', TASK = 'display', comment_id = comment.id ); object_url = comment.get_summary.object_url -%] |
From: Chris W. <la...@us...> - 2004-11-29 02:59:03
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9606/pkg/comments Modified Files: Changes package.conf Log Message: fix small bug in finding count of all comments Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/Changes,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Changes 28 Nov 2004 06:46:09 -0000 1.14 --- Changes 29 Nov 2004 02:58:51 -0000 1.15 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package comments. + 1.17 Sun Nov 28 21:55:05 EST 2004 + + Fix OI2::Comment->count_comments + 1.16 Sun Nov 28 01:44:08 EST 2004 Index: package.conf =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/package.conf,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** package.conf 28 Nov 2004 06:46:09 -0000 1.14 --- package.conf 29 Nov 2004 02:58:51 -0000 1.15 *************** *** 1,4 **** name comments ! version 1.16 author Chris Winters <ch...@cw...> url http://www.cwinters.com/ --- 1,4 ---- name comments ! version 1.17 author Chris Winters <ch...@cw...> url http://www.cwinters.com/ |
From: Chris W. <la...@us...> - 2004-11-29 02:59:03
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9606/pkg/comments/OpenInteract2 Modified Files: Comment.pm Log Message: fix small bug in finding count of all comments Index: Comment.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/OpenInteract2/Comment.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Comment.pm 18 Feb 2004 05:25:24 -0000 1.3 --- Comment.pm 29 Nov 2004 02:58:51 -0000 1.4 *************** *** 43,64 **** sub count_comments { my ( $class ) = @_; ! $log ||= get_logger( LOG_APP ); ! ! my $sql = 'SELECT COUNT(*) FROM comment'; ! my $count = 0; ! my ( $sth ); ! eval { ! $sth = $class->global_datasource_handle->prepare( $sql ); ! $sth->execute; }; if ( $@ ) { $log->warn( "Failed to get total number of comments: $@" ); } ! else { ! ( $count ) = $sth->fetchrow_array; ! $sth->finish; ! } ! return $count; } ! 1; \ No newline at end of file --- 43,60 ---- sub count_comments { my ( $class ) = @_; ! my $sql = sprintf( 'SELECT COUNT(*) FROM %s', $class->base_table ); ! my $row = eval { ! $class->db_select({ ! sql => $sql, ! db => $class->global_datasource_handle, ! return => 'single', ! }) }; if ( $@ ) { + $log ||= get_logger( LOG_APP ); $log->warn( "Failed to get total number of comments: $@" ); } ! return $row->[0]; } ! 1; |